{
  "description": "SpannerBackupSchedule is the Schema for the SpannerBackupSchedule API",
  "properties": {
    "apiVersion": {
      "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
      "type": "string"
    },
    "kind": {
      "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
      "type": "string"
    },
    "metadata": {
      "type": "object"
    },
    "spec": {
      "description": "SpannerBackupScheduleSpec defines the desired state of SpannerBackupSchedule",
      "properties": {
        "encryptionConfig": {
          "description": "Optional. The encryption configuration that will be used to encrypt the backup. If this field is not specified, the backup will use the same encryption configuration as the database.",
          "properties": {
            "encryptionType": {
              "description": "Required. The encryption type of the backup.",
              "type": "string"
            },
            "kmsKeyRef": {
              "description": "Optional. The Cloud KMS key that will be used to protect the backup. This field should be set only when [encryption_type][google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type] is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form `projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.",
              "oneOf": [
                {
                  "not": {
                    "required": [
                      "external"
                    ]
                  },
                  "required": [
                    "name"
                  ]
                },
                {
                  "not": {
                    "anyOf": [
                      {
                        "required": [
                          "name"
                        ]
                      },
                      {
                        "required": [
                          "namespace"
                        ]
                      }
                    ]
                  },
                  "required": [
                    "external"
                  ]
                }
              ],
              "properties": {
                "external": {
                  "description": "A reference to an externally managed KMSCryptoKey. Should be in the format `projects/[kms_project_id]/locations/[region]/keyRings/[key_ring_id]/cryptoKeys/[key]`.",
                  "type": "string"
                },
                "name": {
                  "description": "The `name` of a `KMSCryptoKey` resource.",
                  "type": "string"
                },
                "namespace": {
                  "description": "The `namespace` of a `KMSCryptoKey` resource.",
                  "type": "string"
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "kmsKeyRefs": {
              "description": "Optional. Specifies the KMS configuration for the one or more keys used to\n protect the backup. Values are of the form\n `projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.\n\n The keys referenced by kms_key_names must fully cover all\n regions of the backup's instance configuration. Some examples:\n * For single region instance configs, specify a single regional\n location KMS key.\n * For multi-regional instance configs of type GOOGLE_MANAGED,\n either specify a multi-regional location KMS key or multiple regional\n location KMS keys that cover all regions in the instance config.\n * For an instance config of type USER_MANAGED, please specify only\n regional location KMS keys to cover each region in the instance config.\n Multi-regional location KMS keys are not supported for USER_MANAGED\n instance configs.",
              "items": {
                "oneOf": [
                  {
                    "not": {
                      "required": [
                        "external"
                      ]
                    },
                    "required": [
                      "name"
                    ]
                  },
                  {
                    "not": {
                      "anyOf": [
                        {
                          "required": [
                            "name"
                          ]
                        },
                        {
                          "required": [
                            "namespace"
                          ]
                        }
                      ]
                    },
                    "required": [
                      "external"
                    ]
                  }
                ],
                "properties": {
                  "external": {
                    "description": "A reference to an externally managed KMSCryptoKey. Should be in the format `projects/[kms_project_id]/locations/[region]/keyRings/[key_ring_id]/cryptoKeys/[key]`.",
                    "type": "string"
                  },
                  "name": {
                    "description": "The `name` of a `KMSCryptoKey` resource.",
                    "type": "string"
                  },
                  "namespace": {
                    "description": "The `namespace` of a `KMSCryptoKey` resource.",
                    "type": "string"
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "type": "array"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "fullBackupSpec": {
          "description": "The schedule creates only full backups.",
          "type": "object"
        },
        "incrementalBackupSpec": {
          "description": "The schedule creates incremental backup chains.",
          "type": "object"
        },
        "resourceID": {
          "description": "The SpannerBackupSchedule name. If not given, the metadata.name will be used.",
          "type": "string"
        },
        "retentionDuration": {
          "description": "Optional. The retention duration of a backup that must be at least 6 hours and at most 366 days. The backup is eligible to be automatically deleted once the retention period has elapsed.",
          "type": "string"
        },
        "spannerDatabaseRef": {
          "description": "Required. The Spanner Database that this backup applies to.",
          "oneOf": [
            {
              "not": {
                "required": [
                  "external"
                ]
              },
              "required": [
                "name"
              ]
            },
            {
              "not": {
                "anyOf": [
                  {
                    "required": [
                      "name"
                    ]
                  },
                  {
                    "required": [
                      "namespace"
                    ]
                  }
                ]
              },
              "required": [
                "external"
              ]
            }
          ],
          "properties": {
            "external": {
              "description": "A reference to an externally managed SpannerDatabase resource. Should be in the format \"projects/{{projectID}}/instances/{{instanceID}}/databases/{{databaseID}}\".",
              "type": "string"
            },
            "name": {
              "description": "The name of a SpannerDatabase resource.",
              "type": "string"
            },
            "namespace": {
              "description": "The namespace of a SpannerDatabase resource.",
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "spec": {
          "description": "Optional. The schedule specification based on which the backup creations are triggered.",
          "properties": {
            "cronSpec": {
              "description": "Cron style schedule specification.",
              "properties": {
                "text": {
                  "description": "Required. Textual representation of the crontab. User can customize the\n backup frequency and the backup version time using the cron\n expression. The version time must be in UTC timzeone.\n\n The backup will contain an externally consistent copy of the\n database at the version time. Allowed frequencies are 12 hour, 1 day,\n 1 week and 1 month. Examples of valid cron specifications:\n   * `0 2/12 * * * ` : every 12 hours at (2, 14) hours past midnight in UTC.\n   * `0 2,14 * * * ` : every 12 hours at (2,14) hours past midnight in UTC.\n   * `0 2 * * * `    : once a day at 2 past midnight in UTC.\n   * `0 2 * * 0 `    : once a week every Sunday at 2 past midnight in UTC.\n   * `0 2 8 * * `    : once a month on 8th day at 2 past midnight in UTC.",
                  "type": "string"
                }
              },
              "type": "object",
              "additionalProperties": false
            }
          },
          "type": "object",
          "additionalProperties": false
        }
      },
      "type": "object",
      "additionalProperties": false
    },
    "status": {
      "description": "SpannerBackupScheduleStatus defines the config connector machine state of SpannerBackupSchedule",
      "properties": {
        "conditions": {
          "description": "Conditions represent the latest available observations of the object's current state.",
          "items": {
            "properties": {
              "lastTransitionTime": {
                "description": "Last time the condition transitioned from one status to another.",
                "type": "string"
              },
              "message": {
                "description": "Human-readable message indicating details about last transition.",
                "type": "string"
              },
              "reason": {
                "description": "Unique, one-word, CamelCase reason for the condition's last transition.",
                "type": "string"
              },
              "status": {
                "description": "Status is the status of the condition. Can be True, False, Unknown.",
                "type": "string"
              },
              "type": {
                "description": "Type is the type of the condition.",
                "type": "string"
              }
            },
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        },
        "externalRef": {
          "description": "A unique specifier for the SpannerBackupSchedule resource in GCP.",
          "type": "string"
        },
        "observedGeneration": {
          "description": "ObservedGeneration is the generation of the resource that was most recently observed by the Config Connector controller. If this is equal to metadata.generation, then that means that the current reported status reflects the most recent desired state of the resource.",
          "format": "int64",
          "type": "integer"
        },
        "observedState": {
          "description": "ObservedState is the state of the resource as most recently observed in GCP.",
          "properties": {
            "cronSpec": {
              "description": "Cron style schedule specification.",
              "properties": {
                "creationWindow": {
                  "description": "Output only. Schedule backups will contain an externally consistent copy of the database at the version time specified in `schedule_spec.cron_spec`. However, Spanner may not initiate the creation of the scheduled backups at that version time. Spanner will initiate the creation of scheduled backups within the time window bounded by the version_time specified in `schedule_spec.cron_spec` and version_time + `creation_window`.",
                  "type": "string"
                },
                "timeZone": {
                  "description": "Output only. The time zone of the times in `CrontabSpec.text`. Currently only UTC is supported.",
                  "type": "string"
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "updateTime": {
              "description": "Output only. The timestamp at which the schedule was last updated. If the schedule has never been updated, this field contains the timestamp when the schedule was first created.",
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        }
      },
      "type": "object",
      "additionalProperties": false
    }
  },
  "required": [
    "spec"
  ],
  "type": "object"
}
