Skip to main content

aws_sdk_context/operation/create_connection/
_create_connection_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateConnectionInput {
6    /// <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>
7    pub client_token: ::std::option::Option<::std::string::String>,
8    /// <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>
9    pub name: ::std::option::Option<::std::string::String>,
10    /// <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>
11    /// <ul>
12    /// <li>
13    /// <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>
14    /// <li>
15    /// <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>
16    /// </ul>
17    pub data_source: ::std::option::Option<crate::types::DataSourceReference>,
18    /// <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>
19    pub scope: ::std::option::Option<crate::types::DataSourceScope>,
20    /// <p>The access configuration for the data source, which names the AWS Identity and Access Management (IAM) role for data access. Optional.</p>
21    /// <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>
22    /// <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>
23    pub access_config: ::std::option::Option<crate::types::AccessConfig>,
24    /// <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>
25    pub sync_schedule: ::std::option::Option<crate::types::SyncSchedule>,
26    /// <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>
27    pub ingestion_config: ::std::option::Option<crate::types::IngestionConfig>,
28    /// <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>
29    /// <ul>
30    /// <li>
31    /// <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>
32    /// <li>
33    /// <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>
34    /// <li>
35    /// <p><code>snowflakeDatabase</code> entries require <code>dataSource</code> to be an AWS Glue connection ARN.</p></li>
36    /// <li>
37    /// <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>
38    /// <li>
39    /// <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>
40    /// </ul>
41    pub glue_connection_mappings: ::std::option::Option<::std::vec::Vec<crate::types::GlueConnectionMapping>>,
42    /// <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>
43    pub publish: ::std::option::Option<bool>,
44    /// <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>
45    pub acknowledgements: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
46    /// <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>
47    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
48}
49impl CreateConnectionInput {
50    /// <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>
51    pub fn client_token(&self) -> ::std::option::Option<&str> {
52        self.client_token.as_deref()
53    }
54    /// <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>
55    pub fn name(&self) -> ::std::option::Option<&str> {
56        self.name.as_deref()
57    }
58    /// <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>
59    /// <ul>
60    /// <li>
61    /// <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>
62    /// <li>
63    /// <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>
64    /// </ul>
65    pub fn data_source(&self) -> ::std::option::Option<&crate::types::DataSourceReference> {
66        self.data_source.as_ref()
67    }
68    /// <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>
69    pub fn scope(&self) -> ::std::option::Option<&crate::types::DataSourceScope> {
70        self.scope.as_ref()
71    }
72    /// <p>The access configuration for the data source, which names the AWS Identity and Access Management (IAM) role for data access. Optional.</p>
73    /// <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>
74    /// <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>
75    pub fn access_config(&self) -> ::std::option::Option<&crate::types::AccessConfig> {
76        self.access_config.as_ref()
77    }
78    /// <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>
79    pub fn sync_schedule(&self) -> ::std::option::Option<&crate::types::SyncSchedule> {
80        self.sync_schedule.as_ref()
81    }
82    /// <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>
83    pub fn ingestion_config(&self) -> ::std::option::Option<&crate::types::IngestionConfig> {
84        self.ingestion_config.as_ref()
85    }
86    /// <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>
87    /// <ul>
88    /// <li>
89    /// <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>
90    /// <li>
91    /// <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>
92    /// <li>
93    /// <p><code>snowflakeDatabase</code> entries require <code>dataSource</code> to be an AWS Glue connection ARN.</p></li>
94    /// <li>
95    /// <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>
96    /// <li>
97    /// <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>
98    /// </ul>
99    ///
100    /// 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()`.
101    pub fn glue_connection_mappings(&self) -> &[crate::types::GlueConnectionMapping] {
102        self.glue_connection_mappings.as_deref().unwrap_or_default()
103    }
104    /// <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>
105    pub fn publish(&self) -> ::std::option::Option<bool> {
106        self.publish
107    }
108    /// <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>
109    ///
110    /// 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()`.
111    pub fn acknowledgements(&self) -> &[::std::string::String] {
112        self.acknowledgements.as_deref().unwrap_or_default()
113    }
114    /// <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>
115    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
116        self.tags.as_ref()
117    }
118}
119impl CreateConnectionInput {
120    /// Creates a new builder-style object to manufacture [`CreateConnectionInput`](crate::operation::create_connection::CreateConnectionInput).
121    pub fn builder() -> crate::operation::create_connection::builders::CreateConnectionInputBuilder {
122        crate::operation::create_connection::builders::CreateConnectionInputBuilder::default()
123    }
124}
125
126/// A builder for [`CreateConnectionInput`](crate::operation::create_connection::CreateConnectionInput).
127#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
128#[non_exhaustive]
129pub struct CreateConnectionInputBuilder {
130    pub(crate) client_token: ::std::option::Option<::std::string::String>,
131    pub(crate) name: ::std::option::Option<::std::string::String>,
132    pub(crate) data_source: ::std::option::Option<crate::types::DataSourceReference>,
133    pub(crate) scope: ::std::option::Option<crate::types::DataSourceScope>,
134    pub(crate) access_config: ::std::option::Option<crate::types::AccessConfig>,
135    pub(crate) sync_schedule: ::std::option::Option<crate::types::SyncSchedule>,
136    pub(crate) ingestion_config: ::std::option::Option<crate::types::IngestionConfig>,
137    pub(crate) glue_connection_mappings: ::std::option::Option<::std::vec::Vec<crate::types::GlueConnectionMapping>>,
138    pub(crate) publish: ::std::option::Option<bool>,
139    pub(crate) acknowledgements: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
140    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
141}
142impl CreateConnectionInputBuilder {
143    /// <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>
144    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        self.client_token = ::std::option::Option::Some(input.into());
146        self
147    }
148    /// <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>
149    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150        self.client_token = input;
151        self
152    }
153    /// <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>
154    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
155        &self.client_token
156    }
157    /// <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>
158    /// This field is required.
159    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160        self.name = ::std::option::Option::Some(input.into());
161        self
162    }
163    /// <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>
164    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165        self.name = input;
166        self
167    }
168    /// <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>
169    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
170        &self.name
171    }
172    /// <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>
173    /// <ul>
174    /// <li>
175    /// <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>
176    /// <li>
177    /// <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>
178    /// </ul>
179    /// This field is required.
180    pub fn data_source(mut self, input: crate::types::DataSourceReference) -> Self {
181        self.data_source = ::std::option::Option::Some(input);
182        self
183    }
184    /// <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>
185    /// <ul>
186    /// <li>
187    /// <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>
188    /// <li>
189    /// <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>
190    /// </ul>
191    pub fn set_data_source(mut self, input: ::std::option::Option<crate::types::DataSourceReference>) -> Self {
192        self.data_source = input;
193        self
194    }
195    /// <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>
196    /// <ul>
197    /// <li>
198    /// <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>
199    /// <li>
200    /// <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>
201    /// </ul>
202    pub fn get_data_source(&self) -> &::std::option::Option<crate::types::DataSourceReference> {
203        &self.data_source
204    }
205    /// <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>
206    pub fn scope(mut self, input: crate::types::DataSourceScope) -> Self {
207        self.scope = ::std::option::Option::Some(input);
208        self
209    }
210    /// <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>
211    pub fn set_scope(mut self, input: ::std::option::Option<crate::types::DataSourceScope>) -> Self {
212        self.scope = input;
213        self
214    }
215    /// <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>
216    pub fn get_scope(&self) -> &::std::option::Option<crate::types::DataSourceScope> {
217        &self.scope
218    }
219    /// <p>The access configuration for the data source, which names the AWS Identity and Access Management (IAM) role for data access. Optional.</p>
220    /// <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>
221    /// <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>
222    pub fn access_config(mut self, input: crate::types::AccessConfig) -> Self {
223        self.access_config = ::std::option::Option::Some(input);
224        self
225    }
226    /// <p>The access configuration for the data source, which names the AWS Identity and Access Management (IAM) role for data access. Optional.</p>
227    /// <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>
228    /// <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>
229    pub fn set_access_config(mut self, input: ::std::option::Option<crate::types::AccessConfig>) -> Self {
230        self.access_config = input;
231        self
232    }
233    /// <p>The access configuration for the data source, which names the AWS Identity and Access Management (IAM) role for data access. Optional.</p>
234    /// <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>
235    /// <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>
236    pub fn get_access_config(&self) -> &::std::option::Option<crate::types::AccessConfig> {
237        &self.access_config
238    }
239    /// <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>
240    pub fn sync_schedule(mut self, input: crate::types::SyncSchedule) -> Self {
241        self.sync_schedule = ::std::option::Option::Some(input);
242        self
243    }
244    /// <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>
245    pub fn set_sync_schedule(mut self, input: ::std::option::Option<crate::types::SyncSchedule>) -> Self {
246        self.sync_schedule = input;
247        self
248    }
249    /// <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>
250    pub fn get_sync_schedule(&self) -> &::std::option::Option<crate::types::SyncSchedule> {
251        &self.sync_schedule
252    }
253    /// <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>
254    /// This field is required.
255    pub fn ingestion_config(mut self, input: crate::types::IngestionConfig) -> Self {
256        self.ingestion_config = ::std::option::Option::Some(input);
257        self
258    }
259    /// <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>
260    pub fn set_ingestion_config(mut self, input: ::std::option::Option<crate::types::IngestionConfig>) -> Self {
261        self.ingestion_config = input;
262        self
263    }
264    /// <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>
265    pub fn get_ingestion_config(&self) -> &::std::option::Option<crate::types::IngestionConfig> {
266        &self.ingestion_config
267    }
268    /// Appends an item to `glue_connection_mappings`.
269    ///
270    /// To override the contents of this collection use [`set_glue_connection_mappings`](Self::set_glue_connection_mappings).
271    ///
272    /// <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>
273    /// <ul>
274    /// <li>
275    /// <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>
276    /// <li>
277    /// <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>
278    /// <li>
279    /// <p><code>snowflakeDatabase</code> entries require <code>dataSource</code> to be an AWS Glue connection ARN.</p></li>
280    /// <li>
281    /// <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>
282    /// <li>
283    /// <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>
284    /// </ul>
285    pub fn glue_connection_mappings(mut self, input: crate::types::GlueConnectionMapping) -> Self {
286        let mut v = self.glue_connection_mappings.unwrap_or_default();
287        v.push(input);
288        self.glue_connection_mappings = ::std::option::Option::Some(v);
289        self
290    }
291    /// <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>
292    /// <ul>
293    /// <li>
294    /// <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>
295    /// <li>
296    /// <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>
297    /// <li>
298    /// <p><code>snowflakeDatabase</code> entries require <code>dataSource</code> to be an AWS Glue connection ARN.</p></li>
299    /// <li>
300    /// <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>
301    /// <li>
302    /// <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>
303    /// </ul>
304    pub fn set_glue_connection_mappings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GlueConnectionMapping>>) -> Self {
305        self.glue_connection_mappings = input;
306        self
307    }
308    /// <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>
309    /// <ul>
310    /// <li>
311    /// <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>
312    /// <li>
313    /// <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>
314    /// <li>
315    /// <p><code>snowflakeDatabase</code> entries require <code>dataSource</code> to be an AWS Glue connection ARN.</p></li>
316    /// <li>
317    /// <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>
318    /// <li>
319    /// <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>
320    /// </ul>
321    pub fn get_glue_connection_mappings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GlueConnectionMapping>> {
322        &self.glue_connection_mappings
323    }
324    /// <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>
325    pub fn publish(mut self, input: bool) -> Self {
326        self.publish = ::std::option::Option::Some(input);
327        self
328    }
329    /// <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>
330    pub fn set_publish(mut self, input: ::std::option::Option<bool>) -> Self {
331        self.publish = input;
332        self
333    }
334    /// <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>
335    pub fn get_publish(&self) -> &::std::option::Option<bool> {
336        &self.publish
337    }
338    /// Appends an item to `acknowledgements`.
339    ///
340    /// To override the contents of this collection use [`set_acknowledgements`](Self::set_acknowledgements).
341    ///
342    /// <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>
343    pub fn acknowledgements(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
344        let mut v = self.acknowledgements.unwrap_or_default();
345        v.push(input.into());
346        self.acknowledgements = ::std::option::Option::Some(v);
347        self
348    }
349    /// <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>
350    pub fn set_acknowledgements(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
351        self.acknowledgements = input;
352        self
353    }
354    /// <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>
355    pub fn get_acknowledgements(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
356        &self.acknowledgements
357    }
358    /// Adds a key-value pair to `tags`.
359    ///
360    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
361    ///
362    /// <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>
363    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
364        let mut hash_map = self.tags.unwrap_or_default();
365        hash_map.insert(k.into(), v.into());
366        self.tags = ::std::option::Option::Some(hash_map);
367        self
368    }
369    /// <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>
370    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
371        self.tags = input;
372        self
373    }
374    /// <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>
375    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
376        &self.tags
377    }
378    /// Consumes the builder and constructs a [`CreateConnectionInput`](crate::operation::create_connection::CreateConnectionInput).
379    pub fn build(
380        self,
381    ) -> ::std::result::Result<crate::operation::create_connection::CreateConnectionInput, ::aws_smithy_types::error::operation::BuildError> {
382        ::std::result::Result::Ok(crate::operation::create_connection::CreateConnectionInput {
383            client_token: self.client_token,
384            name: self.name,
385            data_source: self.data_source,
386            scope: self.scope,
387            access_config: self.access_config,
388            sync_schedule: self.sync_schedule,
389            ingestion_config: self.ingestion_config,
390            glue_connection_mappings: self.glue_connection_mappings,
391            publish: self.publish,
392            acknowledgements: self.acknowledgements,
393            tags: self.tags,
394        })
395    }
396}