{
  "description": "BigQueryDataTransferConfig is the Schema for the BigQueryDataTransferConfig 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": "BigQueryDataTransferConfigSpec defines the desired state of BigQueryDataTransferConfig",
      "properties": {
        "dataRefreshWindowDays": {
          "description": "The number of days to look back to automatically refresh the data. For example, if `data_refresh_window_days = 10`, then every day BigQuery reingests data for [today-10, today-1], rather than ingesting data for just [today-1]. Only valid if the data source supports the feature. Set the value to 0 to use the default value.",
          "format": "int32",
          "type": "integer"
        },
        "dataSourceID": {
          "description": "Immutable. Data source ID. This cannot be changed once data transfer is created. The full list of available data source IDs can be returned through an API call: https://cloud.google.com/bigquery-transfer/docs/reference/datatransfer/rest/v1/projects.locations.dataSources/list",
          "type": "string",
          "x-kubernetes-validations": [
            {
              "message": "DataSourceID field is immutable",
              "rule": "self == oldSelf"
            }
          ]
        },
        "datasetRef": {
          "description": "The BigQuery target dataset id.",
          "oneOf": [
            {
              "not": {
                "required": [
                  "external"
                ]
              },
              "required": [
                "name"
              ]
            },
            {
              "not": {
                "anyOf": [
                  {
                    "required": [
                      "name"
                    ]
                  },
                  {
                    "required": [
                      "namespace"
                    ]
                  }
                ]
              },
              "required": [
                "external"
              ]
            }
          ],
          "properties": {
            "external": {
              "description": "A reference to an externally-managed BigQueryDataset resource. Should be in the format \"projects/{{projectID}}/datasets/{{datasetID}}\".",
              "type": "string"
            },
            "name": {
              "description": "The name of a BigQueryDataset resource.",
              "type": "string"
            },
            "namespace": {
              "description": "The namespace of a BigQueryDataset resource.",
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "disabled": {
          "description": "Is this config disabled. When set to true, no runs will be scheduled for this transfer config.",
          "type": "boolean"
        },
        "displayName": {
          "description": "User specified display name for the data transfer.",
          "type": "string"
        },
        "emailPreferences": {
          "description": "Email notifications will be sent according to these preferences to the email address of the user who owns this transfer config.",
          "properties": {
            "enableFailureEmail": {
              "description": "If true, email notifications will be sent on transfer run failures.",
              "type": "boolean"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "encryptionConfiguration": {
          "description": "The encryption configuration part. Currently, it is only used for the optional KMS key name. The BigQuery service account of your project must be granted permissions to use the key. Read methods will return the key name applied in effect. Write methods will apply the key if it is present, or otherwise try to apply project default keys if it is absent.",
          "properties": {
            "kmsKeyRef": {
              "description": "The KMS key used for encrypting BigQuery data.",
              "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": "object",
          "additionalProperties": false
        },
        "location": {
          "description": "Immutable.",
          "type": "string",
          "x-kubernetes-validations": [
            {
              "message": "Location field is immutable",
              "rule": "self == oldSelf"
            }
          ]
        },
        "params": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Parameters specific to each data source. For more information see the bq tab in the 'Setting up a data transfer' section for each data source. For example the parameters for Cloud Storage transfers are listed here: https://cloud.google.com/bigquery-transfer/docs/cloud-storage-transfer#bq",
          "type": "object"
        },
        "projectRef": {
          "description": "The Project that this resource belongs to.",
          "oneOf": [
            {
              "not": {
                "required": [
                  "external"
                ]
              },
              "required": [
                "name"
              ]
            },
            {
              "not": {
                "anyOf": [
                  {
                    "required": [
                      "name"
                    ]
                  },
                  {
                    "required": [
                      "namespace"
                    ]
                  }
                ]
              },
              "required": [
                "external"
              ]
            }
          ],
          "properties": {
            "external": {
              "description": "The `projectID` field of a project, when not managed by Config Connector.",
              "type": "string"
            },
            "kind": {
              "description": "The kind of the Project resource; optional but must be `Project` if provided.",
              "type": "string"
            },
            "name": {
              "description": "The `name` field of a `Project` resource.",
              "type": "string"
            },
            "namespace": {
              "description": "The `namespace` field of a `Project` resource.",
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "pubSubTopicRef": {
          "description": "Pub/Sub topic where notifications will be sent after transfer runs associated with this transfer config finish.",
          "oneOf": [
            {
              "not": {
                "required": [
                  "external"
                ]
              },
              "required": [
                "name"
              ]
            },
            {
              "not": {
                "anyOf": [
                  {
                    "required": [
                      "name"
                    ]
                  },
                  {
                    "required": [
                      "namespace"
                    ]
                  }
                ]
              },
              "required": [
                "external"
              ]
            }
          ],
          "properties": {
            "external": {
              "description": "A reference to an externally managed PubSubTopic resource. Should be in the format \"projects/{{projectID}}/topics/{{topicID}}\".",
              "type": "string"
            },
            "name": {
              "description": "The name of a PubSubTopic resource.",
              "type": "string"
            },
            "namespace": {
              "description": "The namespace of a PubSubTopic resource.",
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "resourceID": {
          "description": "The BigQueryDataTransferConfig name. If not given, the metadata.name will be used.",
          "type": "string"
        },
        "schedule": {
          "description": "Data transfer schedule.\n If the data source does not support a custom schedule, this should be\n empty. If it is empty, the default value for the data source will be used.\n The specified times are in UTC.\n Examples of valid format:\n `1st,3rd monday of month 15:30`,\n `every wed,fri of jan,jun 13:15`, and\n `first sunday of quarter 00:00`.\n See more explanation about the format here:\n https://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml#the_schedule_format\n\n NOTE: The minimum interval time between recurring transfers depends on the\n data source; refer to the documentation for your data source.",
          "type": "string"
        },
        "scheduleOptions": {
          "description": "Options customizing the data transfer schedule.",
          "properties": {
            "disableAutoScheduling": {
              "description": "If true, automatic scheduling of data transfer runs for this configuration will be disabled. The runs can be started on ad-hoc basis using StartManualTransferRuns API. When automatic scheduling is disabled, the TransferConfig.schedule field will be ignored.",
              "type": "boolean"
            },
            "endTime": {
              "description": "Defines time to stop scheduling transfer runs. A transfer run cannot be scheduled at or after the end time. The end time can be changed at any moment. The time when a data transfer can be triggered manually is not limited by this option.",
              "type": "string"
            },
            "startTime": {
              "description": "Specifies time to start scheduling transfer runs. The first run will be scheduled at or after the start time according to a recurrence pattern defined in the schedule string. The start time can be changed at any moment. The time when a data transfer can be triggered manually is not limited by this option.",
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "scheduleOptionsV2": {
          "description": "Options customizing different types of data transfer schedule. This field replaces \"schedule\" and \"schedule_options\" fields. ScheduleOptionsV2 cannot be used together with ScheduleOptions/Schedule.",
          "properties": {
            "eventDrivenSchedule": {
              "description": "Event driven transfer schedule options. If set, the transfer will be scheduled upon events arrial.",
              "properties": {
                "pubSubSubscriptionRef": {
                  "description": "Pub/Sub subscription used to receive events. Only Google Cloud Storage data source support this option.",
                  "oneOf": [
                    {
                      "not": {
                        "required": [
                          "external"
                        ]
                      },
                      "required": [
                        "name"
                      ]
                    },
                    {
                      "not": {
                        "anyOf": [
                          {
                            "required": [
                              "name"
                            ]
                          },
                          {
                            "required": [
                              "namespace"
                            ]
                          }
                        ]
                      },
                      "required": [
                        "external"
                      ]
                    }
                  ],
                  "properties": {
                    "external": {
                      "description": "A reference to an externally managed PubSubSubscription resource. Should be in the format \"projects/{{projectID}}/subscriptions/{{subscriptionID}}\".",
                      "type": "string"
                    },
                    "name": {
                      "description": "The name of a PubSubSubscription resource.",
                      "type": "string"
                    },
                    "namespace": {
                      "description": "The namespace of a PubSubSubscription resource.",
                      "type": "string"
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "manualSchedule": {
              "description": "Manual transfer schedule. If set, the transfer run will not be auto-scheduled by the system, unless the client invokes StartManualTransferRuns.  This is equivalent to disable_auto_scheduling = true.",
              "type": "object"
            },
            "timeBasedSchedule": {
              "description": "Time based transfer schedule options. This is the default schedule option.",
              "properties": {
                "endTime": {
                  "description": "Defines time to stop scheduling transfer runs. A transfer run cannot be scheduled at or after the end time. The end time can be changed at any moment.",
                  "type": "string"
                },
                "schedule": {
                  "description": "Data transfer schedule.\n If the data source does not support a custom schedule, this should be\n empty. If it is empty, the default value for the data source will be used.\n The specified times are in UTC.\n Examples of valid format:\n `1st,3rd monday of month 15:30`,\n `every wed,fri of jan,jun 13:15`, and\n `first sunday of quarter 00:00`.\n See more explanation about the format here:\n https://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml#the_schedule_format\n\n NOTE: The minimum interval time between recurring transfers depends on the\n data source; refer to the documentation for your data source.",
                  "type": "string"
                },
                "startTime": {
                  "description": "Specifies time to start scheduling transfer runs. The first run will be scheduled at or after the start time according to a recurrence pattern defined in the schedule string. The start time can be changed at any moment.",
                  "type": "string"
                }
              },
              "type": "object",
              "additionalProperties": false
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "serviceAccountRef": {
          "description": "Service account email. If this field is set, the transfer config will be created with this service account's credentials. It requires that the requesting user calling this API has permissions to act as this service account. Note that not all data sources support service account credentials when creating a transfer config. For the latest list of data sources, please refer to https://cloud.google.com/bigquery/docs/use-service-accounts.",
          "oneOf": [
            {
              "not": {
                "required": [
                  "external"
                ]
              },
              "required": [
                "name"
              ]
            },
            {
              "not": {
                "anyOf": [
                  {
                    "required": [
                      "name"
                    ]
                  },
                  {
                    "required": [
                      "namespace"
                    ]
                  }
                ]
              },
              "required": [
                "external"
              ]
            }
          ],
          "properties": {
            "external": {
              "description": "The `email` field of an `IAMServiceAccount` resource.",
              "type": "string"
            },
            "name": {
              "description": "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
              "type": "string"
            },
            "namespace": {
              "description": "Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/",
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        }
      },
      "required": [
        "dataSourceID",
        "location",
        "params",
        "projectRef"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "status": {
      "description": "BigQueryDataTransferConfigStatus defines the config connector machine state of BigQueryDataTransferConfig",
      "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 BigQueryDataTransferConfig 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": {
            "datasetRegion": {
              "description": "Output only. Region in which BigQuery dataset is located.",
              "type": "string"
            },
            "error": {
              "description": "Output only. Error code with detailed information about reason of the latest config failure.",
              "properties": {
                "code": {
                  "description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].",
                  "format": "int32",
                  "type": "integer"
                },
                "message": {
                  "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.",
                  "type": "string"
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "name": {
              "description": "Identifier. The resource name of the transfer config. Transfer config names have the form either `projects/{project_id}/locations/{region}/transferConfigs/{config_id}` or `projects/{project_id}/transferConfigs/{config_id}`, where `config_id` is usually a UUID, even though it is not guaranteed or required. The name is ignored when creating a transfer config.",
              "type": "string"
            },
            "nextRunTime": {
              "description": "Output only. Next time when data transfer will run.",
              "type": "string"
            },
            "ownerInfo": {
              "description": "Output only. Information about the user whose credentials are used to transfer data. Populated only for `transferConfigs.get` requests. In case the user information is not available, this field will not be populated.",
              "properties": {
                "email": {
                  "description": "E-mail address of the user.",
                  "type": "string"
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "state": {
              "description": "Output only. State of the most recently updated transfer run.",
              "type": "string"
            },
            "updateTime": {
              "description": "Output only. Data transfer modification time. Ignored by server on input.",
              "type": "string"
            },
            "userID": {
              "description": "Deprecated. Unique ID of the user on whose behalf transfer is done.",
              "format": "int64",
              "type": "integer"
            }
          },
          "type": "object",
          "additionalProperties": false
        }
      },
      "type": "object",
      "additionalProperties": false
    }
  },
  "required": [
    "spec"
  ],
  "type": "object"
}
