> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prequel.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Test source connection

> Test the connection to a source.



## OpenAPI

````yaml /generated/openapi-generated-2023-12-01.json post /sources/{source_id}/test-connection
openapi: 3.1.0
info:
  title: Prequel Data Export
  description: Data Export API spec
  version: '2023-12-01'
servers:
  - url: https://api.prequel.co
    description: Cloud-hosted server (US)
  - url: https://eu-api.prequel.co
    description: Cloud-hosted server (EU)
  - url: https://{custom_host}/
    description: Cloud-prem or shared-cloud server
security:
  - ApiKeyAuth: []
paths:
  /sources/{source_id}/test-connection:
    post:
      tags:
        - Sources
      summary: Test source connection
      description: Test the connection to a source.
      operationId: create-source-test
      parameters:
        - name: source_id
          in: path
          required: true
          description: Source ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSourceRequest'
              $schema: https://json-schema.org/draft/2020-12/schema
              $id: >-
                https://github.com/prequel-co/datafeed/internal/export/api/models/update-source-request
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    const: success
                  data:
                    $ref: '#/components/schemas/SourceResponse'
                    $schema: https://json-schema.org/draft/2020-12/schema
                    $id: >-
                      https://github.com/prequel-co/datafeed/internal/export/api/models/source-response
                  message:
                    type: string
                type: object
                required:
                  - status
                  - data
                  - message
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    UpdateSourceRequest:
      properties:
        source:
          $ref: '#/components/schemas/UpdateSourceOptions'
      additionalProperties: false
      type: object
      required:
        - source
    SourceResponse:
      properties:
        ssh_public_key:
          type: string
        source:
          $ref: '#/components/schemas/SourceResource'
      additionalProperties: false
      type: object
      required:
        - source
    UpdateSourceOptions:
      properties:
        name:
          type: string
          title: Source name
          description: Descriptive name for this source.
        max_concurrent_transfers:
          type: integer
          title: Max Concurrent Transfers
          description: The max concurrent allowed for the source
        vendor:
          type: string
          enum:
            - snowflake
            - bigquery
            - redshift
            - redshift_serverless
            - databricks
            - athena
            - aurora_mysql
            - aurora_postgres
            - clickhouse
            - mock
            - mongodb
            - motherduck
            - mysql
            - oracle
            - postgres
            - sql_server
            - singlestore
          readOnly: true
        athena:
          $ref: '#/components/schemas/UpdateAthenaSourceOptions'
          title: Amazon Athena
        aurora_mysql:
          $ref: '#/components/schemas/UpdateMySQLSourceOptions'
          title: Amazon Aurora MySQL
        aurora_postgres:
          $ref: '#/components/schemas/UpdatePostgresSourceOptions'
          title: Amazon Aurora PostgreSQL
        bigquery:
          $ref: '#/components/schemas/UpdateBigQuerySourceOptions'
          title: Google BigQuery
        clickhouse:
          $ref: '#/components/schemas/UpdateClickhouseSourceOptions'
          title: ClickHouse
        databricks:
          $ref: '#/components/schemas/UpdateDatabricksSourceOptions'
          title: Databricks
        mock:
          $ref: '#/components/schemas/UpdateMockSourceOptions'
          title: Mock (for testing in staging only)
        motherduck:
          $ref: '#/components/schemas/UpdateMotherDuckSourceOptions'
          title: MotherDuck
        mongodb:
          $ref: '#/components/schemas/UpdateMongoDBSourceOptions'
          title: MongoDB
        mysql:
          $ref: '#/components/schemas/UpdateMySQLSourceOptions'
          title: MySQL
        oracle:
          $ref: '#/components/schemas/UpdateOracleSourceOptions'
          title: Oracle
        postgres:
          $ref: '#/components/schemas/UpdatePostgresSourceOptions'
          title: PostgreSQL
        redshift:
          $ref: '#/components/schemas/UpdateRedshiftSourceOptions'
          title: Amazon Redshift
        redshift_serverless:
          $ref: '#/components/schemas/UpdateRedshiftServerlessSourceOptions'
          title: Amazon Redshift Serverless
        singlestore:
          $ref: '#/components/schemas/UpdateMySQLSourceOptions'
          title: SingleStore
        snowflake:
          $ref: '#/components/schemas/UpdateSnowflakeSourceOptions'
          title: Snowflake
        sql_server:
          $ref: '#/components/schemas/UpdateSQLServerSourceOptions'
          title: SQL Server
      additionalProperties: false
      type: object
    SourceResource:
      oneOf:
        - properties:
            athena:
              $ref: '#/components/schemas/AthenaSourceResource'
          required:
            - athena
          title: athena
        - properties:
            aurora_mysql:
              $ref: '#/components/schemas/MySQLSourceResource'
          required:
            - aurora_mysql
          title: aurora_mysql
        - properties:
            aurora_postgres:
              $ref: '#/components/schemas/PostgresSourceResource'
          required:
            - aurora_postgres
          title: aurora_postgres
        - properties:
            bigquery:
              $ref: '#/components/schemas/BigQuerySourceResource'
          required:
            - bigquery
          title: bigquery
        - properties:
            clickhouse:
              $ref: '#/components/schemas/ClickhouseSourceResource'
          required:
            - clickhouse
          title: clickhouse
        - properties:
            databricks:
              $ref: '#/components/schemas/DatabricksSourceResource'
          required:
            - databricks
          title: databricks
        - properties:
            mock:
              $ref: '#/components/schemas/MockSourceResource'
          required:
            - mock
          title: mock
        - properties:
            mongodb:
              $ref: '#/components/schemas/MongoDBSourceResource'
          required:
            - mongodb
          title: mongodb
        - properties:
            motherduck:
              $ref: '#/components/schemas/MotherDuckSourceResource'
          required:
            - motherduck
          title: motherduck
        - properties:
            mysql:
              $ref: '#/components/schemas/MySQLSourceResource'
          required:
            - mysql
          title: mysql
        - properties:
            oracle:
              $ref: '#/components/schemas/OracleSourceResource'
          required:
            - oracle
          title: oracle
        - properties:
            postgres:
              $ref: '#/components/schemas/PostgresSourceResource'
          required:
            - postgres
          title: postgres
        - properties:
            redshift:
              $ref: '#/components/schemas/RedshiftSourceResource'
          required:
            - redshift
          title: redshift
        - properties:
            redshift_serverless:
              $ref: '#/components/schemas/RedshiftServerlessSourceResource'
          required:
            - redshift_serverless
          title: redshift_serverless
        - properties:
            singlestore:
              $ref: '#/components/schemas/MySQLSourceResource'
          required:
            - singlestore
          title: singlestore
        - properties:
            snowflake:
              $ref: '#/components/schemas/SnowflakeSourceResource'
          required:
            - snowflake
          title: snowflake
        - properties:
            sql_server:
              $ref: '#/components/schemas/SQLServerResource'
          required:
            - sql_server
          title: sql_server
      properties:
        id:
          type: string
          description: Prequel-generated unique identifier for the source.
        vendor:
          type: string
          description: The vendor of the source.
        name:
          type: string
          description: Descriptive name of database. (Used only for reference or comment)
        created_at:
          type: string
          format: date-time
          description: Timestamp when the source was created.
        updated_at:
          type: string
          format: date-time
          description: Timestamp when the source was last updated.
        max_concurrent_transfers:
          type: integer
          description: Maximum number of concurrent transfers allowed for this source.
        max_concurrent_queries_per_transfer:
          type: integer
          description: >-
            Maximum number of concurrent queries allowed per transfer for this
            source.
      type: object
      required:
        - id
        - vendor
        - name
        - created_at
        - updated_at
        - max_concurrent_transfers
        - max_concurrent_queries_per_transfer
      unevaluatedProperties: false
    ErrorResponse:
      properties:
        status:
          type: string
          const: error
        message:
          type: string
        data:
          type: 'null'
      type: object
      required:
        - status
        - message
    UpdateAthenaSourceOptions:
      properties:
        workgroup:
          type: string
          title: Workgroup
          description: >-
            Optional field to specify the Athena Workgroup to use. Must be
            configured for Athena engine version 3. If left blank
        connection_database:
          type: string
          title: Query results location
          description: >-
            The name of the folder where the query results will be stored. This
            folder will be created within the S3 bucket.
        auth_method:
          type: string
          enum:
            - aws_iam_role
            - aws_access_keys
          title: Auth method
          description: The method of authentication to use for this source.
        aws_iam_role:
          $ref: '#/components/schemas/AWSIAMRole'
        aws_access_keys:
          $ref: '#/components/schemas/UpdateAWSAccessKeys'
          description: Required details if authenticating using AWS access keys.
        bucket_s3:
          $ref: '#/components/schemas/UpdateS3BucketParams'
          description: Required details about the S3 bucket used for staging data.
      additionalProperties: false
      type: object
      required:
        - workgroup
        - connection_database
        - auth_method
        - bucket_s3
    UpdateMySQLSourceOptions:
      properties:
        host:
          type: string
          description: The hostname of the MySQL server.
        port:
          type: integer
          exclusiveMinimum: 0
          description: The port of the MySQL server.
        connection_database:
          type: string
          description: The name of the database to connect to.
        auth_method:
          type: string
          enum:
            - password_auth
          description: >-
            Placeholder value in case authentication options are added.
            Currently must be set to password_auth.
        password_auth:
          $ref: '#/components/schemas/UpdatePasswordAuth'
          description: Required details for username/password authentication.
        use_ssh_tunnel:
          type: boolean
          title: Use SSH Tunnel
          description: Whether to use an SSH tunnel for the connection.
        ssh_tunnel:
          $ref: '#/components/schemas/SSHTunnelParams'
          description: Required details if using SSH tunneling.
        disable_ssl:
          type: boolean
          description: Whether to disable SSL for the MySQL connection.
      additionalProperties: false
      type: object
    UpdatePostgresSourceOptions:
      properties:
        host:
          type: string
          description: The hostname of the PostgreSQL server.
        port:
          type: integer
          exclusiveMinimum: 0
          description: The port of the PostgreSQL server.
        database:
          type: string
          description: The name of the database to connect to.
        auth_method:
          type: string
          enum:
            - password_auth
          description: >-
            Placeholder value in case authentication options are added.
            Currently must be set to password_auth.
        password_auth:
          $ref: '#/components/schemas/UpdatePasswordAuth'
          description: Required details for username/password authentication.
        use_ssh_tunnel:
          type: boolean
          title: Use SSH Tunnel
          description: Whether to use an SSH tunnel for the connection.
        ssh_tunnel:
          $ref: '#/components/schemas/SSHTunnelParams'
          description: Required details if using SSH tunneling.
        disable_ssl:
          type: boolean
          description: Whether to disable SSL for the PostgreSQL connection.
        connection_timeout_in_seconds:
          type: integer
          minimum: 0
          title: Connection Timeout (in seconds)
          description: Duration to wait for successful connection to Postgres
      additionalProperties: false
      type: object
    UpdateBigQuerySourceOptions:
      properties:
        project_id:
          $comment: >-
            BigQuery Project IDs must consist of 4-30 lowercase letters,
            numbers, and hyphens, and must begin with a lowercase letter and end
            with a lowercase letter or number.
          type: string
          pattern: ^[a-z][a-z0-9-]{2,28}[a-z0-9]$
          title: Project ID
        auth_method:
          type: string
          enum:
            - gcp_service_account_role
            - gcp_service_account_key
            - federated_gcp_service_account_role
          title: Auth method
          description: The method of authentication to use for this source.
        gcp_service_account_role:
          $ref: '#/components/schemas/UpdateGCPServiceAccountRole'
          description: Required details if authenticating using a GCP service account role.
        federated_gcp_service_account_role:
          $ref: '#/components/schemas/UpdateFederatedGCPServiceAccountRole'
          description: >-
            Required details if authenticating using Workload Identity
            Federation.
        gcp_service_account_key:
          $ref: '#/components/schemas/UpdateGCPServiceAccountKey'
          description: Required details if authenticating using a GCP service account key.
        bucket_gcs:
          $ref: '#/components/schemas/UpdateBigQueryGCSBucketParams'
          description: Required details about the GCS bucket used for staging data.
      additionalProperties: false
      type: object
      required:
        - project_id
        - auth_method
    UpdateClickhouseSourceOptions:
      properties:
        host:
          type: string
          title: Host
        port:
          type: integer
          exclusiveMinimum: 0
          title: Port
        cluster:
          type: string
          title: Cluster
          description: >-
            Optional field to specify the Cluster to use in 'ON CLUSTER'
            statements.
        connection_database:
          type: string
          title: Connection database
        auth_method:
          type: string
          enum:
            - password_auth
          title: Auth method
          description: >-
            Placeholder value in case authentication options are added.
            Currently must be set to password_auth.
        password_auth:
          $ref: '#/components/schemas/UpdatePasswordAuth'
          description: Required details for username/password authentication.
        bucket_vendor:
          type: string
          enum:
            - bucket_s3
            - bucket_gcs
            - bucket_implicit
          title: Bucket vendor
          description: '''s3'' for Amazon S3 ''gcs'' for Google Cloud Storage'
        bucket_s3:
          $ref: '#/components/schemas/UpdateClickhouseS3BucketParams'
          description: Required details about the S3 bucket used for staging data.
        bucket_gcs:
          $ref: '#/components/schemas/UpdateClickhouseGCSBucketParams'
          description: Required details about the GCS bucket used for staging data.
        disable_ssl:
          type: boolean
          title: Disable SSL
      additionalProperties: false
      type: object
      required:
        - host
        - port
        - connection_database
        - auth_method
        - password_auth
        - bucket_vendor
    UpdateDatabricksSourceOptions:
      properties:
        host:
          type: string
          description: The hostname of the Databricks server.
        port:
          type: integer
          exclusiveMinimum: 0
          description: The port of the Databricks server.
        catalog:
          type: string
          description: The name of the catalog to write to.
        http_path:
          type: string
          description: The HTTP path to use for the Databricks connection.
        auth_method:
          type: string
          enum:
            - access_token_auth
            - oauth_client_secret_auth
          description: >-
            Placeholder value in case authentication options are added.
            Currently must be set to access_token_auth.
        access_token_auth:
          $ref: '#/components/schemas/AccessToken'
          description: The access token authentication object.
        oauth_client_secret_auth:
          $ref: '#/components/schemas/UpdateOauthClientSecretAuth'
          description: The OAuth client secret authentication object.
        metastore:
          type: string
          enum:
            - hive
            - unity_catalog
        hive:
          $ref: '#/components/schemas/UpdateDatabricksHiveOptions'
        use_ssh_tunnel:
          type: boolean
          title: Use SSH Tunnel
          description: Whether to use an SSH tunnel for the connection.
        ssh_tunnel:
          $ref: '#/components/schemas/SSHTunnelParams'
          description: Required details if using SSH tunneling.
      additionalProperties: false
      type: object
    UpdateMockSourceOptions:
      properties:
        database:
          type: string
          description: Mock database name.
        error_code:
          type: string
      additionalProperties: false
      type: object
      required:
        - database
    UpdateMotherDuckSourceOptions:
      properties:
        database:
          type: string
          description: MotherDuck database name.
        access_token_auth:
          $ref: '#/components/schemas/AccessToken'
          description: The access token authentication object.
      additionalProperties: false
      type: object
      required:
        - database
    UpdateMongoDBSourceOptions:
      properties:
        host:
          type: string
          description: The hostname of the MongoDB server.
        port:
          type: integer
          description: The port of the MongoDB server.
        authentication_database:
          type: string
          description: The name of the MongoDB Authentication Database.
        auth_method:
          type: string
          enum:
            - aws_iam_role
            - password_auth
          description: The method of authentication to use for this destination.
        aws_iam_role:
          $ref: '#/components/schemas/AWSIAMRole'
          description: Required details if authenticating using an AWS IAM role.
        password_auth:
          $ref: '#/components/schemas/UpdatePasswordAuth'
          description: Required details if authenticating with username/password.
        use_ssh_tunnel:
          type: boolean
          title: Use SSH Tunnel
          description: Whether to use an SSH tunnel for the connection.
        ssh_tunnel:
          $ref: '#/components/schemas/SSHTunnelParams'
          description: Required details if using SSH tunneling.
        disable_ssl:
          type: boolean
          description: Whether to disable SSL for the MongoDB connection.
      additionalProperties: false
      type: object
    UpdateOracleSourceOptions:
      oneOf:
        - properties:
            disable_ssl:
              const: false
            ssl_options:
              $ref: '#/components/schemas/OracleSSLParams'
              description: Required details if using SSL connection.
          required:
            - ssl_options
          title: SSL Enabled
        - properties:
            disable_ssl:
              type: boolean
              description: Whether to disable SSL for the PostgreSQL connection.
          required:
            - disable_ssl
          title: SSL Disabled
      properties:
        host:
          type: string
          description: The hostname of the PostgreSQL server.
        port:
          type: integer
          exclusiveMinimum: 0
          description: The port of the PostgreSQL server.
        database:
          type: string
          description: The name of the database to connect to.
        auth_method:
          type: string
          enum:
            - password_auth
          description: >-
            Placeholder value in case authentication options are added.
            Currently must be set to password_auth.
        password_auth:
          $ref: '#/components/schemas/UpdatePasswordAuth'
          description: Required details for username/password authentication.
        use_ssh_tunnel:
          type: boolean
          title: Use SSH Tunnel
          description: Whether to use an SSH tunnel for the connection.
        ssh_tunnel:
          $ref: '#/components/schemas/SSHTunnelParams'
          description: Required details if using SSH tunneling.
      type: object
      unevaluatedProperties: false
    UpdateRedshiftSourceOptions:
      properties:
        host:
          type: string
          description: The hostname of the Redshift server.
        port:
          type: integer
          exclusiveMinimum: 0
          description: The port of the Redshift server.
        database:
          type: string
          description: The name of the database to connect to.
        cluster:
          type: string
          description: The name of the Redshift cluster to connect to.
        username:
          type: string
          title: Username
        auth_method:
          type: string
          enum:
            - aws_iam_role
            - password_auth
          title: Auth method
          description: The method of authentication to use for this destination.
        aws_access_keys:
          $ref: '#/components/schemas/UpdateRedshiftAccessKeys'
          description: Required details for username/password authentication.
        aws_iam_role:
          $ref: '#/components/schemas/AWSIAMRole'
          description: Required details if authenticating using an AWS IAM role.
        bucket_s3:
          $ref: '#/components/schemas/UpdateRedshiftS3BucketParams'
          description: Required details about the S3 bucket used for staging data.
        use_ssh_tunnel:
          type: boolean
          title: Use SSH Tunnel
          description: Whether to use an SSH tunnel for the connection.
        ssh_tunnel:
          $ref: '#/components/schemas/SSHTunnelParams'
          description: Required details if using SSH tunneling.
      additionalProperties: false
      type: object
      required:
        - auth_method
    UpdateRedshiftServerlessSourceOptions:
      properties:
        workgroup:
          type: string
          description: The name of the Redshift Serverless workgroup.
        host:
          type: string
          description: The hostname to use to connect.
        port:
          type: integer
          exclusiveMinimum: 0
          description: The port to use to connect.
        database:
          type: string
          description: The name of the database to connect to.
        schema:
          type: string
          description: The name of the schema to write to.
        auth_method:
          type: string
          enum:
            - aws_access_keys
            - aws_iam_role
          title: Auth method
        aws_iam_role:
          $ref: '#/components/schemas/AWSIAMRole'
          description: Required details if authenticating using an AWS IAM role.
        aws_access_keys:
          $ref: '#/components/schemas/UpdateAWSAccessKeys'
          description: Required details if authenticating using AWS access keys.
        bucket_s3:
          $ref: '#/components/schemas/UpdateRedshiftS3BucketParams'
          description: Required details about the S3 bucket used for staging data.
      additionalProperties: false
      type: object
      required:
        - auth_method
    UpdateSnowflakeSourceOptions:
      properties:
        username:
          type: string
          description: The name of the Snowflake user.
        host:
          type: string
          pattern: .*\.snowflakecomputing.com$
          description: The hostname of the Snowflake server.
        port:
          type: integer
          exclusiveMinimum: 0
          description: The port of the Snowflake server.
        database:
          type: string
          description: The name of the database to connect to.
        auth_method:
          type: string
          enum:
            - password_auth
            - public_key_auth
          title: Auth method
        password_auth:
          $ref: '#/components/schemas/UpdatePasswordOnlyAuth'
          description: Required details for username/password authentication.
        public_key_auth:
          $ref: '#/components/schemas/PublicKeyAuth'
          description: Required details for public key authentication.
      additionalProperties: false
      type: object
    UpdateSQLServerSourceOptions:
      properties:
        host:
          type: string
          description: The hostname of the PostgreSQL server.
        port:
          type: integer
          exclusiveMinimum: 0
          description: The port of the PostgreSQL server.
        database:
          type: string
          description: The name of the database to connect to.
        auth_method:
          type: string
          enum:
            - password_auth
          description: >-
            Placeholder value in case authentication options are added.
            Currently must be set to password_auth.
        password_auth:
          $ref: '#/components/schemas/UpdatePasswordAuth'
          description: Required details for username/password authentication.
        use_ssh_tunnel:
          type: boolean
          title: Use SSH Tunnel
          description: Whether to use an SSH tunnel for the connection.
        ssh_tunnel:
          $ref: '#/components/schemas/SSHTunnelParams'
          description: Required details if using SSH tunneling.
        disable_ssl:
          type: boolean
          description: Whether to disable SSL for the PostgreSQL connection.
      additionalProperties: false
      type: object
    AthenaSourceResource:
      oneOf:
        - $ref: '#/components/schemas/AthenaSourceResourceAWSIAMRole'
        - $ref: '#/components/schemas/AthenaSourceResourceAWSAccessKeys'
      discriminator:
        mapping:
          aws_access_keys:
            $ref: '#/components/schemas/AthenaSourceResourceAWSAccessKeys'
          aws_iam_role:
            $ref: '#/components/schemas/AthenaSourceResourceAWSIAMRole'
        propertyName: auth_method
    MySQLSourceResource:
      properties:
        host:
          type: string
        port:
          type: integer
        connection_database:
          type: string
        auth_method:
          type: string
          enum:
            - password_auth
        password_auth:
          $ref: '#/components/schemas/PasswordAuthResource'
        use_ssh_tunnel:
          type: boolean
        ssh_tunnel:
          $ref: '#/components/schemas/SSHTunnelResource'
        disable_ssl:
          type: boolean
      additionalProperties: false
      type: object
      required:
        - host
        - port
        - connection_database
        - auth_method
        - password_auth
        - use_ssh_tunnel
    PostgresSourceResource:
      properties:
        host:
          type: string
        port:
          type: integer
        database:
          type: string
        auth_method:
          type: string
          enum:
            - password_auth
        password_auth:
          $ref: '#/components/schemas/PasswordAuthResource'
        use_ssh_tunnel:
          type: boolean
        ssh_tunnel:
          $ref: '#/components/schemas/SSHTunnelResource'
        disable_ssl:
          type: boolean
      additionalProperties: false
      type: object
      required:
        - host
        - port
        - database
        - auth_method
        - password_auth
        - use_ssh_tunnel
    BigQuerySourceResource:
      oneOf:
        - $ref: '#/components/schemas/BigQuerySourceResourceGCPServiceAccountRole'
        - $ref: >-
            #/components/schemas/BigQuerySourceResourceFederatedGCPServiceAccountRole
        - $ref: '#/components/schemas/BigQuerySourceResourceGCPServiceAccountKey'
      discriminator:
        mapping:
          federated_gcp_service_account_role:
            $ref: >-
              #/components/schemas/BigQuerySourceResourceFederatedGCPServiceAccountRole
          gcp_service_account_key:
            $ref: '#/components/schemas/BigQuerySourceResourceGCPServiceAccountKey'
          gcp_service_account_role:
            $ref: '#/components/schemas/BigQuerySourceResourceGCPServiceAccountRole'
        propertyName: auth_method
    ClickhouseSourceResource:
      properties:
        cluster:
          type: string
        host:
          type: string
        port:
          type: integer
        connection_database:
          type: string
        auth_method:
          type: string
          enum:
            - password_auth
        password_auth:
          $ref: '#/components/schemas/PasswordAuthResource'
        bucket_vendor:
          type: string
        bucket_s3:
          $ref: '#/components/schemas/ClickhouseS3BucketResource'
        bucket_gcs:
          $ref: '#/components/schemas/ClickhouseGCSBucketResource'
        disable_ssl:
          type: boolean
      additionalProperties: false
      type: object
      required:
        - host
        - port
        - connection_database
        - auth_method
        - password_auth
        - bucket_vendor
    DatabricksSourceResource:
      oneOf:
        - properties:
            metastore:
              const: hive
            hive:
              $ref: '#/components/schemas/DatabricksHiveResource'
              title: Hive Metastore
          required:
            - metastore
            - hive
          title: Hive Metastore
        - properties:
            metastore:
              const: unity_catalog
          required:
            - metastore
          title: Unity Catalog Metastore
      properties:
        host:
          type: string
        port:
          type: integer
        catalog:
          type: string
        http_path:
          type: string
        auth_method:
          type: string
          enum:
            - access_token_auth
        oauth_client_secret_auth:
          $ref: '#/components/schemas/OauthClientSecretAuthResource'
        use_ssh_tunnel:
          type: boolean
        ssh_tunnel:
          $ref: '#/components/schemas/SSHTunnelResource'
      type: object
      required:
        - host
        - port
        - catalog
        - http_path
        - auth_method
        - use_ssh_tunnel
      unevaluatedProperties: false
    MockSourceResource:
      properties:
        database:
          type: string
      additionalProperties: false
      type: object
      required:
        - database
    MongoDBSourceResource:
      oneOf:
        - $ref: '#/components/schemas/MongoDBSourceResourceAWSIAMRole'
        - $ref: '#/components/schemas/MongoDBSourceResourcePasswordAuth'
      discriminator:
        mapping:
          aws_iam_role:
            $ref: '#/components/schemas/MongoDBSourceResourceAWSIAMRole'
          password_auth:
            $ref: '#/components/schemas/MongoDBSourceResourcePasswordAuth'
        propertyName: auth_method
    MotherDuckSourceResource:
      properties:
        database:
          type: string
        auth_method:
          type: string
      additionalProperties: false
      type: object
      required:
        - database
        - auth_method
    OracleSourceResource:
      properties:
        host:
          type: string
        port:
          type: integer
        database:
          type: string
        auth_method:
          type: string
          enum:
            - password_auth
        password_auth:
          $ref: '#/components/schemas/PasswordAuthResource'
        use_ssh_tunnel:
          type: boolean
        ssh_tunnel:
          $ref: '#/components/schemas/SSHTunnelResource'
        disable_ssl:
          type: boolean
      additionalProperties: false
      type: object
      required:
        - host
        - port
        - database
        - auth_method
        - password_auth
        - use_ssh_tunnel
    RedshiftSourceResource:
      oneOf:
        - $ref: '#/components/schemas/RedshiftSourceResourceAWSAccessKeys'
        - $ref: '#/components/schemas/RedshiftSourceResourceAWSIAMRole'
      discriminator:
        mapping:
          aws_access_keys:
            $ref: '#/components/schemas/RedshiftSourceResourceAWSAccessKeys'
          aws_iam_role:
            $ref: '#/components/schemas/RedshiftSourceResourceAWSIAMRole'
        propertyName: auth_method
    RedshiftServerlessSourceResource:
      oneOf:
        - $ref: '#/components/schemas/RedshiftServerlessSourceResourceAWSAccessKeys'
        - $ref: '#/components/schemas/RedshiftServerlessSourceResourceAWSIAMRole'
      discriminator:
        mapping:
          aws_access_keys:
            $ref: '#/components/schemas/RedshiftServerlessSourceResourceAWSAccessKeys'
          aws_iam_role:
            $ref: '#/components/schemas/RedshiftServerlessSourceResourceAWSIAMRole'
        propertyName: auth_method
    SnowflakeSourceResource:
      properties:
        username:
          type: string
        host:
          type: string
        port:
          type: integer
        database:
          type: string
        auth_method:
          type: string
          enum:
            - password_auth
            - public_key_auth
        public_key_auth:
          $ref: '#/components/schemas/PublicKeyAuth'
      additionalProperties: false
      type: object
      required:
        - username
        - host
        - port
        - database
        - auth_method
    SQLServerResource:
      properties:
        host:
          type: string
        port:
          type: integer
        database:
          type: string
        auth_method:
          type: string
          enum:
            - password_auth
        password_auth:
          $ref: '#/components/schemas/PasswordAuthResource'
        use_ssh_tunnel:
          type: boolean
        ssh_tunnel:
          $ref: '#/components/schemas/SSHTunnelResource'
        disable_ssl:
          type: boolean
      additionalProperties: false
      type: object
      required:
        - host
        - port
        - database
        - auth_method
        - password_auth
        - use_ssh_tunnel
    AWSIAMRole:
      properties:
        aws_iam_role_arn:
          type: string
          title: IAM role ARN
          default: arn:aws:iam::123456789012:role/service-role/role-name
      additionalProperties: false
      type: object
      required:
        - aws_iam_role_arn
    UpdateAWSAccessKeys:
      properties:
        access_id:
          type: string
          description: The access key ID to use for authentication.
        secret_key:
          type: string
          description: The secret key to use for authentication.
      additionalProperties: false
      type: object
    UpdateS3BucketParams:
      properties:
        bucket_name:
          type: string
          description: The name of the S3 bucket.
        bucket_region:
          type: string
          description: >-
            The region of the S3 bucket. Must be a valid [AWS
            region](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html)
      additionalProperties: false
      type: object
    UpdatePasswordAuth:
      properties:
        username:
          type: string
          description: The username to use for authentication.
        password:
          type: string
          description: The password to use for authentication.
      additionalProperties: false
      type: object
    SSHTunnelParams:
      properties:
        ssh_tunnel_host:
          type: string
          title: SSH tunnel host
        ssh_tunnel_port:
          type: integer
          title: SSH tunnel port
          default: 22
        ssh_tunnel_username:
          type: string
          title: SSH tunnel username
        ssh_public_key:
          type: string
          enum:
            - primary_public_key
            - secondary_public_key
          title: SSH Public Key
          description: >-
            This is the public SSH key that will be used to establish the SSH
            tunnel. It should be added to the list of authorized keys on the
            bastion host.
      additionalProperties: false
      type: object
      required:
        - ssh_tunnel_host
        - ssh_tunnel_port
        - ssh_tunnel_username
    UpdateGCPServiceAccountRole:
      properties:
        service_account_email:
          type: string
          pattern: ^.*gserviceaccount.com$
          format: email
          description: The email of the GCP service account to use for authentication.
        workload_identity_federation_metadata:
          $ref: '#/components/schemas/GcpExternalAccountMetadata'
          title: Workload identity metadata
          description: The federation metadata to use for authentication.
      additionalProperties: false
      type: object
    UpdateFederatedGCPServiceAccountRole:
      properties:
        service_account_email:
          type: string
          pattern: ^.*gserviceaccount.com$
          format: email
          title: Service account email
          default: service-account-name@project-id.iam.gserviceaccount.com
        workload_identity_federation_metadata:
          $ref: '#/components/schemas/GcpExternalAccountMetadata'
          title: Workload identity metadata
      additionalProperties: false
      type: object
      required:
        - service_account_email
    UpdateGCPServiceAccountKey:
      properties:
        service_account_email:
          type: string
          pattern: ^.*gserviceaccount.com$
          format: email
          description: The email of the GCP service account to use for authentication.
        service_account_key:
          description: The full Google-generated JSON service account key object.
      additionalProperties: false
      type: object
    UpdateBigQueryGCSBucketParams:
      properties:
        bucket_name:
          type: string
          description: The name of the GCS bucket.
        bucket_region:
          type: string
          description: >-
            The region of the staging GCS bucket. Must be a valid GCS [bucket
            location](https://cloud.google.com/storage/docs/locations)
      additionalProperties: false
      type: object
    UpdateClickhouseS3BucketParams:
      properties:
        bucket_name:
          type: string
          description: The name of the S3 bucket.
        bucket_region:
          type: string
          description: >-
            The region of the S3 bucket. Must be a valid [AWS
            region](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html)
        bucket_auth_method:
          type: string
          enum:
            - aws_iam_role
            - aws_access_keys
          description: Authentication method for S3 bucket.
        aws_access_keys:
          $ref: '#/components/schemas/UpdateAWSAccessKeys'
          description: Required details for access key authentication.
        aws_iam_role:
          $ref: '#/components/schemas/AWSIAMRole'
          description: Required details for AWS IAM role authentication.
      additionalProperties: false
      type: object
    UpdateClickhouseGCSBucketParams:
      properties:
        bucket_name:
          type: string
          description: The name of the GCS bucket.
        gcs_hmac_keys:
          $ref: '#/components/schemas/UpdateGCSAccessKeys'
          description: Required details for GCS HMAC key authentication.
      additionalProperties: false
      type: object
    AccessToken:
      properties:
        access_token:
          type: string
          title: Personal access token
          description: The access token to use for the connection.
      additionalProperties: false
      type: object
      required:
        - access_token
    UpdateOauthClientSecretAuth:
      properties:
        client_id:
          type: string
          title: Client ID
        client_secret:
          type: string
          title: Client Secret
      additionalProperties: false
      type: object
    UpdateDatabricksHiveOptions:
      properties:
        bucket_vendor:
          type: string
          enum:
            - bucket_s3
          description: Where the staging bucket is hosted.
        bucket_s3:
          $ref: '#/components/schemas/UpdateDatabricksS3BucketParams'
          description: Required details if using an S3 bucket for staging data.
      additionalProperties: false
      type: object
    OracleSSLParams:
      properties:
        wallet:
          type: string
          title: Oracle Wallet
          description: Base64 encoded contents of Oracle Wallet.
      additionalProperties: false
      type: object
    UpdateRedshiftAccessKeys:
      properties:
        password:
          type: string
          title: Password
        access_id:
          type: string
          title: Bucket access ID
        secret_key:
          type: string
          title: Bucket secret key
      additionalProperties: false
      type: object
      required:
        - password
        - access_id
        - secret_key
    UpdateRedshiftS3BucketParams:
      properties:
        bucket_name:
          type: string
          description: The name of the S3 bucket.
        bucket_region:
          type: string
          description: >-
            The region of the S3 bucket. Must be a valid [AWS
            region](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html)
      additionalProperties: false
      type: object
    UpdatePasswordOnlyAuth:
      properties:
        password:
          type: string
          title: Password
      additionalProperties: false
      type: object
      required:
        - password
    PublicKeyAuth:
      properties:
        public_key:
          type: string
          enum:
            - primary_public_key
            - secondary_public_key
          title: Public key
          description: >-
            This is the public SSH key that will be used to establish the SSH
            tunnel. It should be added to the list of authorized keys on the
            bastion host.
      additionalProperties: false
      type: object
      required:
        - public_key
    AthenaSourceResourceAWSIAMRole:
      properties:
        workgroup:
          type: string
        connection_database:
          type: string
        bucket_s3:
          $ref: '#/components/schemas/S3BucketResource'
        auth_method:
          const: aws_iam_role
        aws_iam_role:
          $ref: '#/components/schemas/AWSIAMRoleResource'
          title: Authenticate using an AWS IAM role (recommended)
      type: object
      required:
        - workgroup
        - connection_database
        - bucket_s3
        - auth_method
        - aws_iam_role
      title: Authenticate using an AWS IAM role (recommended)
      unevaluatedProperties: false
    AthenaSourceResourceAWSAccessKeys:
      properties:
        workgroup:
          type: string
        connection_database:
          type: string
        bucket_s3:
          $ref: '#/components/schemas/S3BucketResource'
        auth_method:
          const: aws_access_keys
        aws_access_keys:
          $ref: '#/components/schemas/AWSAccessKeysResource'
          title: Authenticate using AWS access keys
      type: object
      required:
        - workgroup
        - connection_database
        - bucket_s3
        - auth_method
        - aws_access_keys
      title: Authenticate using AWS access keys
      unevaluatedProperties: false
    PasswordAuthResource:
      properties:
        username:
          type: string
      additionalProperties: false
      type: object
      required:
        - username
    SSHTunnelResource:
      properties:
        ssh_tunnel_host:
          type: string
        ssh_tunnel_port:
          type: integer
        ssh_tunnel_username:
          type: string
        ssh_public_key:
          type: string
      additionalProperties: false
      type: object
    BigQuerySourceResourceGCPServiceAccountRole:
      properties:
        project_id:
          type: string
        bucket_gcs:
          $ref: '#/components/schemas/BigQueryGCSBucketResource'
        auth_method:
          const: gcp_service_account_role
        gcp_service_account_role:
          $ref: '#/components/schemas/GCPServiceAccountRoleResource'
          title: Authenticate using a GCP service account (recommended)
      type: object
      required:
        - project_id
        - bucket_gcs
        - auth_method
        - gcp_service_account_role
      title: Authenticate using a GCP service account (recommended)
      unevaluatedProperties: false
    BigQuerySourceResourceFederatedGCPServiceAccountRole:
      properties:
        project_id:
          type: string
        bucket_gcs:
          $ref: '#/components/schemas/BigQueryGCSBucketResource'
        auth_method:
          const: federated_gcp_service_account_role
        federated_gcp_service_account_role:
          $ref: '#/components/schemas/FederatedGCPServiceAccountRoleResource'
          title: Authenticate using federation (only if self-hosting)
      type: object
      required:
        - project_id
        - bucket_gcs
        - auth_method
        - federated_gcp_service_account_role
      title: Authenticate using federation (only if self-hosting)
      unevaluatedProperties: false
    BigQuerySourceResourceGCPServiceAccountKey:
      properties:
        project_id:
          type: string
        bucket_gcs:
          $ref: '#/components/schemas/BigQueryGCSBucketResource'
        auth_method:
          const: gcp_service_account_key
        gcp_service_account_key:
          $ref: '#/components/schemas/GCPServiceAccountKeyResource'
          title: Authenticate using direct access
      type: object
      required:
        - project_id
        - bucket_gcs
        - auth_method
        - gcp_service_account_key
      title: Authenticate using direct access
      unevaluatedProperties: false
    ClickhouseS3BucketResource:
      properties:
        bucket_name:
          type: string
        bucket_region:
          type: string
        bucket_auth_method:
          type: string
        aws_iam_role:
          $ref: '#/components/schemas/AWSIAMRoleResource'
        aws_access_keys:
          $ref: '#/components/schemas/AWSAccessKeysResource'
      additionalProperties: false
      type: object
      required:
        - bucket_name
        - bucket_region
        - bucket_auth_method
    ClickhouseGCSBucketResource:
      properties:
        bucket_name:
          type: string
        gcs_hmac_keys:
          $ref: '#/components/schemas/GCSAccessKeysResource'
      additionalProperties: false
      type: object
      required:
        - bucket_name
        - gcs_hmac_keys
    DatabricksHiveResource:
      oneOf:
        - properties:
            bucket_s3:
              $ref: '#/components/schemas/DatabricksS3BucketResource'
          required:
            - bucket_s3
          title: bucket_s3
      properties:
        bucket_vendor:
          type: string
      type: object
      required:
        - bucket_vendor
      unevaluatedProperties: false
    OauthClientSecretAuthResource:
      properties:
        client_id:
          type: string
      additionalProperties: false
      type: object
      required:
        - client_id
    MongoDBSourceResourceAWSIAMRole:
      properties:
        host:
          type: string
        port:
          type: integer
        authentication_database:
          type: string
        use_ssh_tunnel:
          type: boolean
        ssh_tunnel:
          $ref: '#/components/schemas/SSHTunnelResource'
        disable_ssl:
          type: boolean
        auth_method:
          const: aws_iam_role
        aws_iam_role:
          $ref: '#/components/schemas/AWSIAMRoleResource'
          title: Authenticate using an AWS IAM role (recommended)
      type: object
      required:
        - host
        - port
        - authentication_database
        - use_ssh_tunnel
        - auth_method
        - aws_iam_role
      title: Authenticate using an AWS IAM role (recommended)
      unevaluatedProperties: false
    MongoDBSourceResourcePasswordAuth:
      properties:
        host:
          type: string
        port:
          type: integer
        authentication_database:
          type: string
        use_ssh_tunnel:
          type: boolean
        ssh_tunnel:
          $ref: '#/components/schemas/SSHTunnelResource'
        disable_ssl:
          type: boolean
        auth_method:
          const: password_auth
        password_auth:
          $ref: '#/components/schemas/PasswordAuthResource'
          title: Authenticate using a username and password
      type: object
      required:
        - host
        - port
        - authentication_database
        - use_ssh_tunnel
        - auth_method
        - password_auth
      title: Authenticate using a username and password
      unevaluatedProperties: false
    RedshiftSourceResourceAWSAccessKeys:
      properties:
        host:
          type: string
        port:
          type: integer
        database:
          type: string
        cluster:
          type: string
        username:
          type: string
        bucket_s3:
          $ref: '#/components/schemas/RedshiftS3BucketResource'
        use_ssh_tunnel:
          type: boolean
        ssh_tunnel:
          $ref: '#/components/schemas/SSHTunnelResource'
        auth_method:
          const: aws_access_keys
        aws_access_keys:
          $ref: '#/components/schemas/RedshiftAccessKeysResource'
          title: Authenticate using AWS access keys
      type: object
      required:
        - host
        - port
        - database
        - cluster
        - username
        - bucket_s3
        - use_ssh_tunnel
        - auth_method
        - aws_access_keys
      title: Authenticate using AWS access keys
      unevaluatedProperties: false
    RedshiftSourceResourceAWSIAMRole:
      properties:
        host:
          type: string
        port:
          type: integer
        database:
          type: string
        cluster:
          type: string
        username:
          type: string
        bucket_s3:
          $ref: '#/components/schemas/RedshiftS3BucketResource'
        use_ssh_tunnel:
          type: boolean
        ssh_tunnel:
          $ref: '#/components/schemas/SSHTunnelResource'
        auth_method:
          const: aws_iam_role
        aws_iam_role:
          $ref: '#/components/schemas/AWSIAMRoleResource'
          title: Authenticate using an AWS IAM role (recommended)
      type: object
      required:
        - host
        - port
        - database
        - cluster
        - username
        - bucket_s3
        - use_ssh_tunnel
        - auth_method
        - aws_iam_role
      title: Authenticate using an AWS IAM role (recommended)
      unevaluatedProperties: false
    RedshiftServerlessSourceResourceAWSAccessKeys:
      properties:
        workgroup:
          type: string
        host:
          type: string
        port:
          type: integer
        database:
          type: string
        bucket_s3:
          $ref: '#/components/schemas/RedshiftS3BucketResource'
        auth_method:
          const: aws_access_keys
        aws_access_keys:
          $ref: '#/components/schemas/AWSAccessKeysResource'
          title: Authenticate using AWS access keys
      type: object
      required:
        - workgroup
        - host
        - port
        - database
        - bucket_s3
        - auth_method
        - aws_access_keys
      title: Authenticate using AWS access keys
      unevaluatedProperties: false
    RedshiftServerlessSourceResourceAWSIAMRole:
      properties:
        workgroup:
          type: string
        host:
          type: string
        port:
          type: integer
        database:
          type: string
        bucket_s3:
          $ref: '#/components/schemas/RedshiftS3BucketResource'
        auth_method:
          const: aws_iam_role
        aws_iam_role:
          $ref: '#/components/schemas/AWSIAMRoleResource'
          title: Authenticate using an AWS IAM role (recommended)
      type: object
      required:
        - workgroup
        - host
        - port
        - database
        - bucket_s3
        - auth_method
        - aws_iam_role
      title: Authenticate using an AWS IAM role (recommended)
      unevaluatedProperties: false
    GcpExternalAccountMetadata:
      properties:
        type:
          type: string
        audience:
          type: string
        subject_token_type:
          type: string
        service_account_impersonation_url:
          type: string
        token_url:
          type: string
        credential_source:
          $ref: '#/components/schemas/CredentialSource'
      type: object
      required:
        - type
        - audience
        - subject_token_type
        - service_account_impersonation_url
        - token_url
        - credential_source
    UpdateGCSAccessKeys:
      properties:
        access_key:
          type: string
          description: The access key to use for authentication.
        secret:
          type: string
          description: The secret to use for authentication.
      additionalProperties: false
      type: object
    UpdateDatabricksS3BucketParams:
      properties:
        bucket_name:
          type: string
          description: The name of the S3 bucket.
        bucket_region:
          type: string
          description: >-
            The region of the S3 bucket. Must be a valid [AWS
            region](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html)
        aws_access_keys:
          $ref: '#/components/schemas/UpdateAWSAccessKeys'
          description: Required details if authenticating using AWS access keys.
      additionalProperties: false
      type: object
    S3BucketResource:
      properties:
        bucket_name:
          type: string
        bucket_region:
          type: string
      additionalProperties: false
      type: object
      required:
        - bucket_name
        - bucket_region
    AWSIAMRoleResource:
      properties:
        aws_iam_role_arn:
          type: string
      additionalProperties: false
      type: object
      required:
        - aws_iam_role_arn
    AWSAccessKeysResource:
      properties:
        access_id:
          type: string
      additionalProperties: false
      type: object
      required:
        - access_id
    BigQueryGCSBucketResource:
      properties:
        bucket_name:
          type: string
        bucket_region:
          type: string
      additionalProperties: false
      type: object
      required:
        - bucket_name
        - bucket_region
    GCPServiceAccountRoleResource:
      properties:
        service_account_email:
          type: string
      additionalProperties: false
      type: object
      required:
        - service_account_email
    FederatedGCPServiceAccountRoleResource:
      properties:
        service_account_email:
          type: string
      additionalProperties: false
      type: object
      required:
        - service_account_email
    GCPServiceAccountKeyResource:
      properties:
        service_account_email:
          type: string
      additionalProperties: false
      type: object
      required:
        - service_account_email
    GCSAccessKeysResource:
      properties:
        access_key:
          type: string
      additionalProperties: false
      type: object
      required:
        - access_key
    DatabricksS3BucketResource:
      properties:
        bucket_name:
          type: string
        bucket_region:
          type: string
        aws_access_keys:
          $ref: '#/components/schemas/AWSAccessKeysResource'
      additionalProperties: false
      type: object
      required:
        - bucket_name
        - bucket_region
        - aws_access_keys
    RedshiftS3BucketResource:
      properties:
        bucket_name:
          type: string
        bucket_region:
          type: string
      additionalProperties: false
      type: object
      required:
        - bucket_name
        - bucket_region
    RedshiftAccessKeysResource:
      properties:
        access_id:
          type: string
      additionalProperties: false
      type: object
      required:
        - access_id
    CredentialSource:
      properties:
        environment_id:
          type: string
        region_url:
          type: string
        url:
          type: string
        regional_cred_verification_url:
          type: string
      additionalProperties: false
      type: object
      required:
        - environment_id
        - region_url
        - url
        - regional_cred_verification_url
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````