aws-sdk-context 1.0.0

AWS SDK for AWS Context
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateConnectionInput {
    /// <p>A client idempotency token. It is optional, so the AWS SDKs can generate it automatically and reuse it on retries. A retry with an identical request returns the original connection. A different request returns <code>ValidationException</code>. <code>acknowledgements</code>, <code>tags</code> and, once the connection is <code>ACTIVE</code>, <code>publish</code> are not compared with the original request. A create refused for a missing acknowledgement records no token.</p>
    pub client_token: ::std::option::Option<::std::string::String>,
    /// <p>The name of the connection. Required. You can change it later with UpdateConnection. Starts with a letter and contains 3–63 ASCII letters, digits, and hyphens.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The external data source that this connection binds to: its <code>type</code> and <code>location.arn</code>. The ARN must be in your account, except for <code>GLUE_DATA_CATALOG</code>, where it can name a catalog or an AWS Glue connection in another account.</p>
    /// <ul>
    /// <li>
    /// <p><code>GLUE_DATA_CATALOG</code> - An AWS Glue Data Catalog ARN (<code>:catalog</code> or <code>:catalog/&lt;path&gt;</code>), or the ARN of an existing AWS Glue connection (<code>:connection/&lt;name&gt;</code>) for a federated AWS data source such as Amazon Redshift or Amazon RDS. The AWS Glue connection must be a unified connection (ConnectionSchemaVersion 2) in your partition and Region that you can read. You can't specify <code>scope</code> with an AWS Glue connection ARN. While AWS Glue is still validating the connection, the request fails with <code>ConflictException</code>. If its validation failed, the request fails with <code>AccessDeniedException</code>.</p></li>
    /// <li>
    /// <p><code>DATABRICKS</code> or <code>SNOWFLAKE</code> - The ARN of an existing AWS Glue connection whose AWS Glue ConnectionType matches <code>type</code>. AWS Context validates its Credential Broker settings, if present, and doesn't store them.</p></li>
    /// </ul>
    pub data_source: ::std::option::Option<crate::types::DataSourceReference>,
    /// <p>Optional hierarchical subset of the data source to ingest. Absent means the whole source. A DATABRICKS scope names at most one <code>databricksCatalog</code>, and a SNOWFLAKE scope one <code>snowflakeDatabase</code>. A GLUE_DATA_CATALOG scope can select by service with a <code>glueService</code> segment (see <code>DataSourceScope</code>). An unknown service name, a repeated or misplaced <code>glueService</code> segment, a later level of another service, or <code>glueService</code> on another connection type returns ValidationException.</p>
    pub scope: ::std::option::Option<crate::types::DataSourceScope>,
    /// <p>The access configuration for the data source, which names the AWS Identity and Access Management (IAM) role for data access. Optional.</p>
    /// <p>For <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code>, <code>iamRole</code> is the IAM role that AWS Context assumes to read the source and the AWS Glue connections in <code>glueConnectionMappings</code>. If you omit <code>accessConfig</code> or set no variant, AWS Context reads them with your own credentials. This applies whether the source is in your account or another account. For a source in another account, AWS Context checks when it creates the connection that <code>iamRole</code> can read the source, and the request fails if it can't. A source in another account with no <code>iamRole</code> isn't checked when the connection is created. An <code>accessConfig</code> with no variant is stored as absent and is not returned on the connection.</p>
    /// <p>For <code>DATABRICKS</code> and <code>SNOWFLAKE</code>, AWS Glue reads the source with the <code>ROLE_ARN</code> of the AWS Glue connection in <code>dataSource</code>, not with <code>accessConfig</code>. For these types, <code>accessConfig</code> is reserved for other roles.</p>
    pub access_config: ::std::option::Option<crate::types::AccessConfig>,
    /// <p>How often AWS Context re-syncs a <code>DATABRICKS</code> or <code>SNOWFLAKE</code> source. If you omit it, the default is <code>DAILY</code>. Not accepted for <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code> connections. You can change it with UpdateConnection.</p>
    pub sync_schedule: ::std::option::Option<crate::types::SyncSchedule>,
    /// <p>The ingestion configuration: the IAM role that a data producer (AWS Glue Data Catalog or Amazon Bedrock knowledge base) assumes to push data into this connection's agent contexts. It is separate from <code>accessConfig</code>, which names the role that AWS Context assumes to read the source. Required, because a connection can't ingest data without a role that its data producer can assume. You must have <code>iam:PassRole</code> permission to pass this role to the data producer, and the role must be in your account.</p>
    pub ingestion_config: ::std::option::Option<crate::types::IngestionConfig>,
    /// <p>The AWS Glue connection to use for each <code>redshiftNamespace</code>, each <code>rdsInstance</code> and <code>rdsDatabase</code> pair, or each <code>snowflakeDatabase</code> in <code>scope</code>, keyed by <code>path</code>. Optional. You can specify 0–20 entries. The following rules apply:</p>
    /// <ul>
    /// <li>
    /// <p>Once an entry names a level, every resource of that level in <code>scope</code> needs an entry. While an entry names <code>rdsInstance</code>, every selector that names an <code>rdsInstance</code> must also name its <code>rdsDatabase</code>.</p></li>
    /// <li>
    /// <p><code>redshiftNamespace</code> and <code>rdsInstance</code> entries require <code>dataSource</code> to be an AWS Glue Data Catalog ARN. <code>accessConfig.iamRole</code> is optional.</p></li>
    /// <li>
    /// <p><code>snowflakeDatabase</code> entries require <code>dataSource</code> to be an AWS Glue connection ARN.</p></li>
    /// <li>
    /// <p>While any entry is present, <code>scope</code> cannot contain a selector that names only a catalog or a <code>glueService</code>, because such a selector covers every resource of the catalog or service. Otherwise, a selector with a <code>glueService</code> segment follows these rules as it would without that segment. An entry's <code>path</code> never names <code>glueService</code>.</p></li>
    /// <li>
    /// <p>A selector that names only <code>glueService</code> <code>REDSHIFT</code> or <code>RDS</code>, with no namespace or instance, cannot be combined with any entry. Such a connection reads only the service's metadata, and you cannot query its data.</p></li>
    /// </ul>
    pub glue_connection_mappings: ::std::option::Option<::std::vec::Vec<crate::types::GlueConnectionMapping>>,
    /// <p>Specifies whether to configure catalog synchronization and wait for it to be provisioned during this call. If you omit it, the default is <code>true</code>. For a <code>DATABRICKS</code> or <code>SNOWFLAKE</code> connection, <code>false</code> validates only the AWS Glue connection. The connection is returned as <code>CREATING</code> with <code>subStatus</code> <code>GLUE_CONNECTION_VALIDATED</code>, and you publish it later by calling UpdateConnection with <code>publish</code> set to <code>true</code>. Ignored for <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code> connections, which have no sync job.</p>
    pub publish: ::std::option::Option<bool>,
    /// <p>The conditions that you acknowledge AWS Context can't honor. Specify <code>CUSTOMER_MANAGED_KEY</code> when the knowledge base is encrypted with an AWS KMS customer managed key and you accept that AWS Context stores the ingested data under AWS owned keys. If you omit it, creating a connection to such a knowledge base fails with <code>ValidationException</code>. An unknown or repeated value also fails with <code>ValidationException</code>.</p>
    pub acknowledgements: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>Tags to add to the connection when you create it: up to 200 in the request, of which at most 50 can be user tags. Keys can't start with <code>aws:</code>. To add tags, you also need <code>context:TagResource</code> permission on the new connection. If you specify more than 50 user tags, the request fails with <code>ServiceQuotaExceededException</code>, as on TagResource. If an AWS Organizations tag policy refuses a tag, the request fails with <code>ValidationException</code>.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateConnectionInput {
    /// <p>A client idempotency token. It is optional, so the AWS SDKs can generate it automatically and reuse it on retries. A retry with an identical request returns the original connection. A different request returns <code>ValidationException</code>. <code>acknowledgements</code>, <code>tags</code> and, once the connection is <code>ACTIVE</code>, <code>publish</code> are not compared with the original request. A create refused for a missing acknowledgement records no token.</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
    /// <p>The name of the connection. Required. You can change it later with UpdateConnection. Starts with a letter and contains 3–63 ASCII letters, digits, and hyphens.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The external data source that this connection binds to: its <code>type</code> and <code>location.arn</code>. The ARN must be in your account, except for <code>GLUE_DATA_CATALOG</code>, where it can name a catalog or an AWS Glue connection in another account.</p>
    /// <ul>
    /// <li>
    /// <p><code>GLUE_DATA_CATALOG</code> - An AWS Glue Data Catalog ARN (<code>:catalog</code> or <code>:catalog/&lt;path&gt;</code>), or the ARN of an existing AWS Glue connection (<code>:connection/&lt;name&gt;</code>) for a federated AWS data source such as Amazon Redshift or Amazon RDS. The AWS Glue connection must be a unified connection (ConnectionSchemaVersion 2) in your partition and Region that you can read. You can't specify <code>scope</code> with an AWS Glue connection ARN. While AWS Glue is still validating the connection, the request fails with <code>ConflictException</code>. If its validation failed, the request fails with <code>AccessDeniedException</code>.</p></li>
    /// <li>
    /// <p><code>DATABRICKS</code> or <code>SNOWFLAKE</code> - The ARN of an existing AWS Glue connection whose AWS Glue ConnectionType matches <code>type</code>. AWS Context validates its Credential Broker settings, if present, and doesn't store them.</p></li>
    /// </ul>
    pub fn data_source(&self) -> ::std::option::Option<&crate::types::DataSourceReference> {
        self.data_source.as_ref()
    }
    /// <p>Optional hierarchical subset of the data source to ingest. Absent means the whole source. A DATABRICKS scope names at most one <code>databricksCatalog</code>, and a SNOWFLAKE scope one <code>snowflakeDatabase</code>. A GLUE_DATA_CATALOG scope can select by service with a <code>glueService</code> segment (see <code>DataSourceScope</code>). An unknown service name, a repeated or misplaced <code>glueService</code> segment, a later level of another service, or <code>glueService</code> on another connection type returns ValidationException.</p>
    pub fn scope(&self) -> ::std::option::Option<&crate::types::DataSourceScope> {
        self.scope.as_ref()
    }
    /// <p>The access configuration for the data source, which names the AWS Identity and Access Management (IAM) role for data access. Optional.</p>
    /// <p>For <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code>, <code>iamRole</code> is the IAM role that AWS Context assumes to read the source and the AWS Glue connections in <code>glueConnectionMappings</code>. If you omit <code>accessConfig</code> or set no variant, AWS Context reads them with your own credentials. This applies whether the source is in your account or another account. For a source in another account, AWS Context checks when it creates the connection that <code>iamRole</code> can read the source, and the request fails if it can't. A source in another account with no <code>iamRole</code> isn't checked when the connection is created. An <code>accessConfig</code> with no variant is stored as absent and is not returned on the connection.</p>
    /// <p>For <code>DATABRICKS</code> and <code>SNOWFLAKE</code>, AWS Glue reads the source with the <code>ROLE_ARN</code> of the AWS Glue connection in <code>dataSource</code>, not with <code>accessConfig</code>. For these types, <code>accessConfig</code> is reserved for other roles.</p>
    pub fn access_config(&self) -> ::std::option::Option<&crate::types::AccessConfig> {
        self.access_config.as_ref()
    }
    /// <p>How often AWS Context re-syncs a <code>DATABRICKS</code> or <code>SNOWFLAKE</code> source. If you omit it, the default is <code>DAILY</code>. Not accepted for <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code> connections. You can change it with UpdateConnection.</p>
    pub fn sync_schedule(&self) -> ::std::option::Option<&crate::types::SyncSchedule> {
        self.sync_schedule.as_ref()
    }
    /// <p>The ingestion configuration: the IAM role that a data producer (AWS Glue Data Catalog or Amazon Bedrock knowledge base) assumes to push data into this connection's agent contexts. It is separate from <code>accessConfig</code>, which names the role that AWS Context assumes to read the source. Required, because a connection can't ingest data without a role that its data producer can assume. You must have <code>iam:PassRole</code> permission to pass this role to the data producer, and the role must be in your account.</p>
    pub fn ingestion_config(&self) -> ::std::option::Option<&crate::types::IngestionConfig> {
        self.ingestion_config.as_ref()
    }
    /// <p>The AWS Glue connection to use for each <code>redshiftNamespace</code>, each <code>rdsInstance</code> and <code>rdsDatabase</code> pair, or each <code>snowflakeDatabase</code> in <code>scope</code>, keyed by <code>path</code>. Optional. You can specify 0–20 entries. The following rules apply:</p>
    /// <ul>
    /// <li>
    /// <p>Once an entry names a level, every resource of that level in <code>scope</code> needs an entry. While an entry names <code>rdsInstance</code>, every selector that names an <code>rdsInstance</code> must also name its <code>rdsDatabase</code>.</p></li>
    /// <li>
    /// <p><code>redshiftNamespace</code> and <code>rdsInstance</code> entries require <code>dataSource</code> to be an AWS Glue Data Catalog ARN. <code>accessConfig.iamRole</code> is optional.</p></li>
    /// <li>
    /// <p><code>snowflakeDatabase</code> entries require <code>dataSource</code> to be an AWS Glue connection ARN.</p></li>
    /// <li>
    /// <p>While any entry is present, <code>scope</code> cannot contain a selector that names only a catalog or a <code>glueService</code>, because such a selector covers every resource of the catalog or service. Otherwise, a selector with a <code>glueService</code> segment follows these rules as it would without that segment. An entry's <code>path</code> never names <code>glueService</code>.</p></li>
    /// <li>
    /// <p>A selector that names only <code>glueService</code> <code>REDSHIFT</code> or <code>RDS</code>, with no namespace or instance, cannot be combined with any entry. Such a connection reads only the service's metadata, and you cannot query its data.</p></li>
    /// </ul>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.glue_connection_mappings.is_none()`.
    pub fn glue_connection_mappings(&self) -> &[crate::types::GlueConnectionMapping] {
        self.glue_connection_mappings.as_deref().unwrap_or_default()
    }
    /// <p>Specifies whether to configure catalog synchronization and wait for it to be provisioned during this call. If you omit it, the default is <code>true</code>. For a <code>DATABRICKS</code> or <code>SNOWFLAKE</code> connection, <code>false</code> validates only the AWS Glue connection. The connection is returned as <code>CREATING</code> with <code>subStatus</code> <code>GLUE_CONNECTION_VALIDATED</code>, and you publish it later by calling UpdateConnection with <code>publish</code> set to <code>true</code>. Ignored for <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code> connections, which have no sync job.</p>
    pub fn publish(&self) -> ::std::option::Option<bool> {
        self.publish
    }
    /// <p>The conditions that you acknowledge AWS Context can't honor. Specify <code>CUSTOMER_MANAGED_KEY</code> when the knowledge base is encrypted with an AWS KMS customer managed key and you accept that AWS Context stores the ingested data under AWS owned keys. If you omit it, creating a connection to such a knowledge base fails with <code>ValidationException</code>. An unknown or repeated value also fails with <code>ValidationException</code>.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.acknowledgements.is_none()`.
    pub fn acknowledgements(&self) -> &[::std::string::String] {
        self.acknowledgements.as_deref().unwrap_or_default()
    }
    /// <p>Tags to add to the connection when you create it: up to 200 in the request, of which at most 50 can be user tags. Keys can't start with <code>aws:</code>. To add tags, you also need <code>context:TagResource</code> permission on the new connection. If you specify more than 50 user tags, the request fails with <code>ServiceQuotaExceededException</code>, as on TagResource. If an AWS Organizations tag policy refuses a tag, the request fails with <code>ValidationException</code>.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
}
impl CreateConnectionInput {
    /// Creates a new builder-style object to manufacture [`CreateConnectionInput`](crate::operation::create_connection::CreateConnectionInput).
    pub fn builder() -> crate::operation::create_connection::builders::CreateConnectionInputBuilder {
        crate::operation::create_connection::builders::CreateConnectionInputBuilder::default()
    }
}

/// A builder for [`CreateConnectionInput`](crate::operation::create_connection::CreateConnectionInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateConnectionInputBuilder {
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) data_source: ::std::option::Option<crate::types::DataSourceReference>,
    pub(crate) scope: ::std::option::Option<crate::types::DataSourceScope>,
    pub(crate) access_config: ::std::option::Option<crate::types::AccessConfig>,
    pub(crate) sync_schedule: ::std::option::Option<crate::types::SyncSchedule>,
    pub(crate) ingestion_config: ::std::option::Option<crate::types::IngestionConfig>,
    pub(crate) glue_connection_mappings: ::std::option::Option<::std::vec::Vec<crate::types::GlueConnectionMapping>>,
    pub(crate) publish: ::std::option::Option<bool>,
    pub(crate) acknowledgements: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateConnectionInputBuilder {
    /// <p>A client idempotency token. It is optional, so the AWS SDKs can generate it automatically and reuse it on retries. A retry with an identical request returns the original connection. A different request returns <code>ValidationException</code>. <code>acknowledgements</code>, <code>tags</code> and, once the connection is <code>ACTIVE</code>, <code>publish</code> are not compared with the original request. A create refused for a missing acknowledgement records no token.</p>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A client idempotency token. It is optional, so the AWS SDKs can generate it automatically and reuse it on retries. A retry with an identical request returns the original connection. A different request returns <code>ValidationException</code>. <code>acknowledgements</code>, <code>tags</code> and, once the connection is <code>ACTIVE</code>, <code>publish</code> are not compared with the original request. A create refused for a missing acknowledgement records no token.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>A client idempotency token. It is optional, so the AWS SDKs can generate it automatically and reuse it on retries. A retry with an identical request returns the original connection. A different request returns <code>ValidationException</code>. <code>acknowledgements</code>, <code>tags</code> and, once the connection is <code>ACTIVE</code>, <code>publish</code> are not compared with the original request. A create refused for a missing acknowledgement records no token.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// <p>The name of the connection. Required. You can change it later with UpdateConnection. Starts with a letter and contains 3–63 ASCII letters, digits, and hyphens.</p>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the connection. Required. You can change it later with UpdateConnection. Starts with a letter and contains 3–63 ASCII letters, digits, and hyphens.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the connection. Required. You can change it later with UpdateConnection. Starts with a letter and contains 3–63 ASCII letters, digits, and hyphens.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The external data source that this connection binds to: its <code>type</code> and <code>location.arn</code>. The ARN must be in your account, except for <code>GLUE_DATA_CATALOG</code>, where it can name a catalog or an AWS Glue connection in another account.</p>
    /// <ul>
    /// <li>
    /// <p><code>GLUE_DATA_CATALOG</code> - An AWS Glue Data Catalog ARN (<code>:catalog</code> or <code>:catalog/&lt;path&gt;</code>), or the ARN of an existing AWS Glue connection (<code>:connection/&lt;name&gt;</code>) for a federated AWS data source such as Amazon Redshift or Amazon RDS. The AWS Glue connection must be a unified connection (ConnectionSchemaVersion 2) in your partition and Region that you can read. You can't specify <code>scope</code> with an AWS Glue connection ARN. While AWS Glue is still validating the connection, the request fails with <code>ConflictException</code>. If its validation failed, the request fails with <code>AccessDeniedException</code>.</p></li>
    /// <li>
    /// <p><code>DATABRICKS</code> or <code>SNOWFLAKE</code> - The ARN of an existing AWS Glue connection whose AWS Glue ConnectionType matches <code>type</code>. AWS Context validates its Credential Broker settings, if present, and doesn't store them.</p></li>
    /// </ul>
    /// This field is required.
    pub fn data_source(mut self, input: crate::types::DataSourceReference) -> Self {
        self.data_source = ::std::option::Option::Some(input);
        self
    }
    /// <p>The external data source that this connection binds to: its <code>type</code> and <code>location.arn</code>. The ARN must be in your account, except for <code>GLUE_DATA_CATALOG</code>, where it can name a catalog or an AWS Glue connection in another account.</p>
    /// <ul>
    /// <li>
    /// <p><code>GLUE_DATA_CATALOG</code> - An AWS Glue Data Catalog ARN (<code>:catalog</code> or <code>:catalog/&lt;path&gt;</code>), or the ARN of an existing AWS Glue connection (<code>:connection/&lt;name&gt;</code>) for a federated AWS data source such as Amazon Redshift or Amazon RDS. The AWS Glue connection must be a unified connection (ConnectionSchemaVersion 2) in your partition and Region that you can read. You can't specify <code>scope</code> with an AWS Glue connection ARN. While AWS Glue is still validating the connection, the request fails with <code>ConflictException</code>. If its validation failed, the request fails with <code>AccessDeniedException</code>.</p></li>
    /// <li>
    /// <p><code>DATABRICKS</code> or <code>SNOWFLAKE</code> - The ARN of an existing AWS Glue connection whose AWS Glue ConnectionType matches <code>type</code>. AWS Context validates its Credential Broker settings, if present, and doesn't store them.</p></li>
    /// </ul>
    pub fn set_data_source(mut self, input: ::std::option::Option<crate::types::DataSourceReference>) -> Self {
        self.data_source = input;
        self
    }
    /// <p>The external data source that this connection binds to: its <code>type</code> and <code>location.arn</code>. The ARN must be in your account, except for <code>GLUE_DATA_CATALOG</code>, where it can name a catalog or an AWS Glue connection in another account.</p>
    /// <ul>
    /// <li>
    /// <p><code>GLUE_DATA_CATALOG</code> - An AWS Glue Data Catalog ARN (<code>:catalog</code> or <code>:catalog/&lt;path&gt;</code>), or the ARN of an existing AWS Glue connection (<code>:connection/&lt;name&gt;</code>) for a federated AWS data source such as Amazon Redshift or Amazon RDS. The AWS Glue connection must be a unified connection (ConnectionSchemaVersion 2) in your partition and Region that you can read. You can't specify <code>scope</code> with an AWS Glue connection ARN. While AWS Glue is still validating the connection, the request fails with <code>ConflictException</code>. If its validation failed, the request fails with <code>AccessDeniedException</code>.</p></li>
    /// <li>
    /// <p><code>DATABRICKS</code> or <code>SNOWFLAKE</code> - The ARN of an existing AWS Glue connection whose AWS Glue ConnectionType matches <code>type</code>. AWS Context validates its Credential Broker settings, if present, and doesn't store them.</p></li>
    /// </ul>
    pub fn get_data_source(&self) -> &::std::option::Option<crate::types::DataSourceReference> {
        &self.data_source
    }
    /// <p>Optional hierarchical subset of the data source to ingest. Absent means the whole source. A DATABRICKS scope names at most one <code>databricksCatalog</code>, and a SNOWFLAKE scope one <code>snowflakeDatabase</code>. A GLUE_DATA_CATALOG scope can select by service with a <code>glueService</code> segment (see <code>DataSourceScope</code>). An unknown service name, a repeated or misplaced <code>glueService</code> segment, a later level of another service, or <code>glueService</code> on another connection type returns ValidationException.</p>
    pub fn scope(mut self, input: crate::types::DataSourceScope) -> Self {
        self.scope = ::std::option::Option::Some(input);
        self
    }
    /// <p>Optional hierarchical subset of the data source to ingest. Absent means the whole source. A DATABRICKS scope names at most one <code>databricksCatalog</code>, and a SNOWFLAKE scope one <code>snowflakeDatabase</code>. A GLUE_DATA_CATALOG scope can select by service with a <code>glueService</code> segment (see <code>DataSourceScope</code>). An unknown service name, a repeated or misplaced <code>glueService</code> segment, a later level of another service, or <code>glueService</code> on another connection type returns ValidationException.</p>
    pub fn set_scope(mut self, input: ::std::option::Option<crate::types::DataSourceScope>) -> Self {
        self.scope = input;
        self
    }
    /// <p>Optional hierarchical subset of the data source to ingest. Absent means the whole source. A DATABRICKS scope names at most one <code>databricksCatalog</code>, and a SNOWFLAKE scope one <code>snowflakeDatabase</code>. A GLUE_DATA_CATALOG scope can select by service with a <code>glueService</code> segment (see <code>DataSourceScope</code>). An unknown service name, a repeated or misplaced <code>glueService</code> segment, a later level of another service, or <code>glueService</code> on another connection type returns ValidationException.</p>
    pub fn get_scope(&self) -> &::std::option::Option<crate::types::DataSourceScope> {
        &self.scope
    }
    /// <p>The access configuration for the data source, which names the AWS Identity and Access Management (IAM) role for data access. Optional.</p>
    /// <p>For <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code>, <code>iamRole</code> is the IAM role that AWS Context assumes to read the source and the AWS Glue connections in <code>glueConnectionMappings</code>. If you omit <code>accessConfig</code> or set no variant, AWS Context reads them with your own credentials. This applies whether the source is in your account or another account. For a source in another account, AWS Context checks when it creates the connection that <code>iamRole</code> can read the source, and the request fails if it can't. A source in another account with no <code>iamRole</code> isn't checked when the connection is created. An <code>accessConfig</code> with no variant is stored as absent and is not returned on the connection.</p>
    /// <p>For <code>DATABRICKS</code> and <code>SNOWFLAKE</code>, AWS Glue reads the source with the <code>ROLE_ARN</code> of the AWS Glue connection in <code>dataSource</code>, not with <code>accessConfig</code>. For these types, <code>accessConfig</code> is reserved for other roles.</p>
    pub fn access_config(mut self, input: crate::types::AccessConfig) -> Self {
        self.access_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>The access configuration for the data source, which names the AWS Identity and Access Management (IAM) role for data access. Optional.</p>
    /// <p>For <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code>, <code>iamRole</code> is the IAM role that AWS Context assumes to read the source and the AWS Glue connections in <code>glueConnectionMappings</code>. If you omit <code>accessConfig</code> or set no variant, AWS Context reads them with your own credentials. This applies whether the source is in your account or another account. For a source in another account, AWS Context checks when it creates the connection that <code>iamRole</code> can read the source, and the request fails if it can't. A source in another account with no <code>iamRole</code> isn't checked when the connection is created. An <code>accessConfig</code> with no variant is stored as absent and is not returned on the connection.</p>
    /// <p>For <code>DATABRICKS</code> and <code>SNOWFLAKE</code>, AWS Glue reads the source with the <code>ROLE_ARN</code> of the AWS Glue connection in <code>dataSource</code>, not with <code>accessConfig</code>. For these types, <code>accessConfig</code> is reserved for other roles.</p>
    pub fn set_access_config(mut self, input: ::std::option::Option<crate::types::AccessConfig>) -> Self {
        self.access_config = input;
        self
    }
    /// <p>The access configuration for the data source, which names the AWS Identity and Access Management (IAM) role for data access. Optional.</p>
    /// <p>For <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code>, <code>iamRole</code> is the IAM role that AWS Context assumes to read the source and the AWS Glue connections in <code>glueConnectionMappings</code>. If you omit <code>accessConfig</code> or set no variant, AWS Context reads them with your own credentials. This applies whether the source is in your account or another account. For a source in another account, AWS Context checks when it creates the connection that <code>iamRole</code> can read the source, and the request fails if it can't. A source in another account with no <code>iamRole</code> isn't checked when the connection is created. An <code>accessConfig</code> with no variant is stored as absent and is not returned on the connection.</p>
    /// <p>For <code>DATABRICKS</code> and <code>SNOWFLAKE</code>, AWS Glue reads the source with the <code>ROLE_ARN</code> of the AWS Glue connection in <code>dataSource</code>, not with <code>accessConfig</code>. For these types, <code>accessConfig</code> is reserved for other roles.</p>
    pub fn get_access_config(&self) -> &::std::option::Option<crate::types::AccessConfig> {
        &self.access_config
    }
    /// <p>How often AWS Context re-syncs a <code>DATABRICKS</code> or <code>SNOWFLAKE</code> source. If you omit it, the default is <code>DAILY</code>. Not accepted for <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code> connections. You can change it with UpdateConnection.</p>
    pub fn sync_schedule(mut self, input: crate::types::SyncSchedule) -> Self {
        self.sync_schedule = ::std::option::Option::Some(input);
        self
    }
    /// <p>How often AWS Context re-syncs a <code>DATABRICKS</code> or <code>SNOWFLAKE</code> source. If you omit it, the default is <code>DAILY</code>. Not accepted for <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code> connections. You can change it with UpdateConnection.</p>
    pub fn set_sync_schedule(mut self, input: ::std::option::Option<crate::types::SyncSchedule>) -> Self {
        self.sync_schedule = input;
        self
    }
    /// <p>How often AWS Context re-syncs a <code>DATABRICKS</code> or <code>SNOWFLAKE</code> source. If you omit it, the default is <code>DAILY</code>. Not accepted for <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code> connections. You can change it with UpdateConnection.</p>
    pub fn get_sync_schedule(&self) -> &::std::option::Option<crate::types::SyncSchedule> {
        &self.sync_schedule
    }
    /// <p>The ingestion configuration: the IAM role that a data producer (AWS Glue Data Catalog or Amazon Bedrock knowledge base) assumes to push data into this connection's agent contexts. It is separate from <code>accessConfig</code>, which names the role that AWS Context assumes to read the source. Required, because a connection can't ingest data without a role that its data producer can assume. You must have <code>iam:PassRole</code> permission to pass this role to the data producer, and the role must be in your account.</p>
    /// This field is required.
    pub fn ingestion_config(mut self, input: crate::types::IngestionConfig) -> Self {
        self.ingestion_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>The ingestion configuration: the IAM role that a data producer (AWS Glue Data Catalog or Amazon Bedrock knowledge base) assumes to push data into this connection's agent contexts. It is separate from <code>accessConfig</code>, which names the role that AWS Context assumes to read the source. Required, because a connection can't ingest data without a role that its data producer can assume. You must have <code>iam:PassRole</code> permission to pass this role to the data producer, and the role must be in your account.</p>
    pub fn set_ingestion_config(mut self, input: ::std::option::Option<crate::types::IngestionConfig>) -> Self {
        self.ingestion_config = input;
        self
    }
    /// <p>The ingestion configuration: the IAM role that a data producer (AWS Glue Data Catalog or Amazon Bedrock knowledge base) assumes to push data into this connection's agent contexts. It is separate from <code>accessConfig</code>, which names the role that AWS Context assumes to read the source. Required, because a connection can't ingest data without a role that its data producer can assume. You must have <code>iam:PassRole</code> permission to pass this role to the data producer, and the role must be in your account.</p>
    pub fn get_ingestion_config(&self) -> &::std::option::Option<crate::types::IngestionConfig> {
        &self.ingestion_config
    }
    /// Appends an item to `glue_connection_mappings`.
    ///
    /// To override the contents of this collection use [`set_glue_connection_mappings`](Self::set_glue_connection_mappings).
    ///
    /// <p>The AWS Glue connection to use for each <code>redshiftNamespace</code>, each <code>rdsInstance</code> and <code>rdsDatabase</code> pair, or each <code>snowflakeDatabase</code> in <code>scope</code>, keyed by <code>path</code>. Optional. You can specify 0–20 entries. The following rules apply:</p>
    /// <ul>
    /// <li>
    /// <p>Once an entry names a level, every resource of that level in <code>scope</code> needs an entry. While an entry names <code>rdsInstance</code>, every selector that names an <code>rdsInstance</code> must also name its <code>rdsDatabase</code>.</p></li>
    /// <li>
    /// <p><code>redshiftNamespace</code> and <code>rdsInstance</code> entries require <code>dataSource</code> to be an AWS Glue Data Catalog ARN. <code>accessConfig.iamRole</code> is optional.</p></li>
    /// <li>
    /// <p><code>snowflakeDatabase</code> entries require <code>dataSource</code> to be an AWS Glue connection ARN.</p></li>
    /// <li>
    /// <p>While any entry is present, <code>scope</code> cannot contain a selector that names only a catalog or a <code>glueService</code>, because such a selector covers every resource of the catalog or service. Otherwise, a selector with a <code>glueService</code> segment follows these rules as it would without that segment. An entry's <code>path</code> never names <code>glueService</code>.</p></li>
    /// <li>
    /// <p>A selector that names only <code>glueService</code> <code>REDSHIFT</code> or <code>RDS</code>, with no namespace or instance, cannot be combined with any entry. Such a connection reads only the service's metadata, and you cannot query its data.</p></li>
    /// </ul>
    pub fn glue_connection_mappings(mut self, input: crate::types::GlueConnectionMapping) -> Self {
        let mut v = self.glue_connection_mappings.unwrap_or_default();
        v.push(input);
        self.glue_connection_mappings = ::std::option::Option::Some(v);
        self
    }
    /// <p>The AWS Glue connection to use for each <code>redshiftNamespace</code>, each <code>rdsInstance</code> and <code>rdsDatabase</code> pair, or each <code>snowflakeDatabase</code> in <code>scope</code>, keyed by <code>path</code>. Optional. You can specify 0–20 entries. The following rules apply:</p>
    /// <ul>
    /// <li>
    /// <p>Once an entry names a level, every resource of that level in <code>scope</code> needs an entry. While an entry names <code>rdsInstance</code>, every selector that names an <code>rdsInstance</code> must also name its <code>rdsDatabase</code>.</p></li>
    /// <li>
    /// <p><code>redshiftNamespace</code> and <code>rdsInstance</code> entries require <code>dataSource</code> to be an AWS Glue Data Catalog ARN. <code>accessConfig.iamRole</code> is optional.</p></li>
    /// <li>
    /// <p><code>snowflakeDatabase</code> entries require <code>dataSource</code> to be an AWS Glue connection ARN.</p></li>
    /// <li>
    /// <p>While any entry is present, <code>scope</code> cannot contain a selector that names only a catalog or a <code>glueService</code>, because such a selector covers every resource of the catalog or service. Otherwise, a selector with a <code>glueService</code> segment follows these rules as it would without that segment. An entry's <code>path</code> never names <code>glueService</code>.</p></li>
    /// <li>
    /// <p>A selector that names only <code>glueService</code> <code>REDSHIFT</code> or <code>RDS</code>, with no namespace or instance, cannot be combined with any entry. Such a connection reads only the service's metadata, and you cannot query its data.</p></li>
    /// </ul>
    pub fn set_glue_connection_mappings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GlueConnectionMapping>>) -> Self {
        self.glue_connection_mappings = input;
        self
    }
    /// <p>The AWS Glue connection to use for each <code>redshiftNamespace</code>, each <code>rdsInstance</code> and <code>rdsDatabase</code> pair, or each <code>snowflakeDatabase</code> in <code>scope</code>, keyed by <code>path</code>. Optional. You can specify 0–20 entries. The following rules apply:</p>
    /// <ul>
    /// <li>
    /// <p>Once an entry names a level, every resource of that level in <code>scope</code> needs an entry. While an entry names <code>rdsInstance</code>, every selector that names an <code>rdsInstance</code> must also name its <code>rdsDatabase</code>.</p></li>
    /// <li>
    /// <p><code>redshiftNamespace</code> and <code>rdsInstance</code> entries require <code>dataSource</code> to be an AWS Glue Data Catalog ARN. <code>accessConfig.iamRole</code> is optional.</p></li>
    /// <li>
    /// <p><code>snowflakeDatabase</code> entries require <code>dataSource</code> to be an AWS Glue connection ARN.</p></li>
    /// <li>
    /// <p>While any entry is present, <code>scope</code> cannot contain a selector that names only a catalog or a <code>glueService</code>, because such a selector covers every resource of the catalog or service. Otherwise, a selector with a <code>glueService</code> segment follows these rules as it would without that segment. An entry's <code>path</code> never names <code>glueService</code>.</p></li>
    /// <li>
    /// <p>A selector that names only <code>glueService</code> <code>REDSHIFT</code> or <code>RDS</code>, with no namespace or instance, cannot be combined with any entry. Such a connection reads only the service's metadata, and you cannot query its data.</p></li>
    /// </ul>
    pub fn get_glue_connection_mappings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GlueConnectionMapping>> {
        &self.glue_connection_mappings
    }
    /// <p>Specifies whether to configure catalog synchronization and wait for it to be provisioned during this call. If you omit it, the default is <code>true</code>. For a <code>DATABRICKS</code> or <code>SNOWFLAKE</code> connection, <code>false</code> validates only the AWS Glue connection. The connection is returned as <code>CREATING</code> with <code>subStatus</code> <code>GLUE_CONNECTION_VALIDATED</code>, and you publish it later by calling UpdateConnection with <code>publish</code> set to <code>true</code>. Ignored for <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code> connections, which have no sync job.</p>
    pub fn publish(mut self, input: bool) -> Self {
        self.publish = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies whether to configure catalog synchronization and wait for it to be provisioned during this call. If you omit it, the default is <code>true</code>. For a <code>DATABRICKS</code> or <code>SNOWFLAKE</code> connection, <code>false</code> validates only the AWS Glue connection. The connection is returned as <code>CREATING</code> with <code>subStatus</code> <code>GLUE_CONNECTION_VALIDATED</code>, and you publish it later by calling UpdateConnection with <code>publish</code> set to <code>true</code>. Ignored for <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code> connections, which have no sync job.</p>
    pub fn set_publish(mut self, input: ::std::option::Option<bool>) -> Self {
        self.publish = input;
        self
    }
    /// <p>Specifies whether to configure catalog synchronization and wait for it to be provisioned during this call. If you omit it, the default is <code>true</code>. For a <code>DATABRICKS</code> or <code>SNOWFLAKE</code> connection, <code>false</code> validates only the AWS Glue connection. The connection is returned as <code>CREATING</code> with <code>subStatus</code> <code>GLUE_CONNECTION_VALIDATED</code>, and you publish it later by calling UpdateConnection with <code>publish</code> set to <code>true</code>. Ignored for <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code> connections, which have no sync job.</p>
    pub fn get_publish(&self) -> &::std::option::Option<bool> {
        &self.publish
    }
    /// Appends an item to `acknowledgements`.
    ///
    /// To override the contents of this collection use [`set_acknowledgements`](Self::set_acknowledgements).
    ///
    /// <p>The conditions that you acknowledge AWS Context can't honor. Specify <code>CUSTOMER_MANAGED_KEY</code> when the knowledge base is encrypted with an AWS KMS customer managed key and you accept that AWS Context stores the ingested data under AWS owned keys. If you omit it, creating a connection to such a knowledge base fails with <code>ValidationException</code>. An unknown or repeated value also fails with <code>ValidationException</code>.</p>
    pub fn acknowledgements(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.acknowledgements.unwrap_or_default();
        v.push(input.into());
        self.acknowledgements = ::std::option::Option::Some(v);
        self
    }
    /// <p>The conditions that you acknowledge AWS Context can't honor. Specify <code>CUSTOMER_MANAGED_KEY</code> when the knowledge base is encrypted with an AWS KMS customer managed key and you accept that AWS Context stores the ingested data under AWS owned keys. If you omit it, creating a connection to such a knowledge base fails with <code>ValidationException</code>. An unknown or repeated value also fails with <code>ValidationException</code>.</p>
    pub fn set_acknowledgements(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.acknowledgements = input;
        self
    }
    /// <p>The conditions that you acknowledge AWS Context can't honor. Specify <code>CUSTOMER_MANAGED_KEY</code> when the knowledge base is encrypted with an AWS KMS customer managed key and you accept that AWS Context stores the ingested data under AWS owned keys. If you omit it, creating a connection to such a knowledge base fails with <code>ValidationException</code>. An unknown or repeated value also fails with <code>ValidationException</code>.</p>
    pub fn get_acknowledgements(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.acknowledgements
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>Tags to add to the connection when you create it: up to 200 in the request, of which at most 50 can be user tags. Keys can't start with <code>aws:</code>. To add tags, you also need <code>context:TagResource</code> permission on the new connection. If you specify more than 50 user tags, the request fails with <code>ServiceQuotaExceededException</code>, as on TagResource. If an AWS Organizations tag policy refuses a tag, the request fails with <code>ValidationException</code>.</p>
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.tags = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>Tags to add to the connection when you create it: up to 200 in the request, of which at most 50 can be user tags. Keys can't start with <code>aws:</code>. To add tags, you also need <code>context:TagResource</code> permission on the new connection. If you specify more than 50 user tags, the request fails with <code>ServiceQuotaExceededException</code>, as on TagResource. If an AWS Organizations tag policy refuses a tag, the request fails with <code>ValidationException</code>.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>Tags to add to the connection when you create it: up to 200 in the request, of which at most 50 can be user tags. Keys can't start with <code>aws:</code>. To add tags, you also need <code>context:TagResource</code> permission on the new connection. If you specify more than 50 user tags, the request fails with <code>ServiceQuotaExceededException</code>, as on TagResource. If an AWS Organizations tag policy refuses a tag, the request fails with <code>ValidationException</code>.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`CreateConnectionInput`](crate::operation::create_connection::CreateConnectionInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_connection::CreateConnectionInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_connection::CreateConnectionInput {
            client_token: self.client_token,
            name: self.name,
            data_source: self.data_source,
            scope: self.scope,
            access_config: self.access_config,
            sync_schedule: self.sync_schedule,
            ingestion_config: self.ingestion_config,
            glue_connection_mappings: self.glue_connection_mappings,
            publish: self.publish,
            acknowledgements: self.acknowledgements,
            tags: self.tags,
        })
    }
}