aws_sdk_context/operation/update_connection/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_connection::_update_connection_input::UpdateConnectionInputBuilder;
3
4pub use crate::operation::update_connection::_update_connection_output::UpdateConnectionOutputBuilder;
5
6impl crate::operation::update_connection::builders::UpdateConnectionInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::update_connection::UpdateConnectionOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::update_connection::UpdateConnectionError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.update_connection();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UpdateConnection`.
24///
25/// <p>Updates a connection's configuration.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateConnectionFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::update_connection::builders::UpdateConnectionInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::update_connection::UpdateConnectionOutput,
35 crate::operation::update_connection::UpdateConnectionError,
36 > for UpdateConnectionFluentBuilder
37{
38 fn send(
39 self,
40 config_override: crate::config::Builder,
41 ) -> crate::client::customize::internal::BoxFuture<
42 crate::client::customize::internal::SendResult<
43 crate::operation::update_connection::UpdateConnectionOutput,
44 crate::operation::update_connection::UpdateConnectionError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl UpdateConnectionFluentBuilder {
51 /// Creates a new `UpdateConnectionFluentBuilder`.
52 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53 Self {
54 handle,
55 inner: ::std::default::Default::default(),
56 config_override: ::std::option::Option::None,
57 }
58 }
59 /// Access the UpdateConnection as a reference.
60 pub fn as_input(&self) -> &crate::operation::update_connection::builders::UpdateConnectionInputBuilder {
61 &self.inner
62 }
63 /// Sends the request and returns the response.
64 ///
65 /// If an error occurs, an `SdkError` will be returned with additional details that
66 /// can be matched against.
67 ///
68 /// By default, any retryable failures will be retried twice. Retry behavior
69 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70 /// set when configuring the client.
71 pub async fn send(
72 self,
73 ) -> ::std::result::Result<
74 crate::operation::update_connection::UpdateConnectionOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::update_connection::UpdateConnectionError,
77 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78 >,
79 > {
80 let input = self
81 .inner
82 .build()
83 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84 let runtime_plugins = crate::operation::update_connection::UpdateConnection::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::update_connection::UpdateConnection::orchestrate(&runtime_plugins, input).await
90 }
91
92 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93 pub fn customize(
94 self,
95 ) -> crate::client::customize::CustomizableOperation<
96 crate::operation::update_connection::UpdateConnectionOutput,
97 crate::operation::update_connection::UpdateConnectionError,
98 Self,
99 > {
100 crate::client::customize::CustomizableOperation::new(self)
101 }
102 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103 self.set_config_override(::std::option::Option::Some(config_override.into()));
104 self
105 }
106
107 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108 self.config_override = config_override;
109 self
110 }
111 /// <p>The connection to update, by its ID (which starts with <code>conn-</code>) or its ARN.</p>
112 pub fn connection_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113 self.inner = self.inner.connection_id(input.into());
114 self
115 }
116 /// <p>The connection to update, by its ID (which starts with <code>conn-</code>) or its ARN.</p>
117 pub fn set_connection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118 self.inner = self.inner.set_connection_id(input);
119 self
120 }
121 /// <p>The connection to update, by its ID (which starts with <code>conn-</code>) or its ARN.</p>
122 pub fn get_connection_id(&self) -> &::std::option::Option<::std::string::String> {
123 self.inner.get_connection_id()
124 }
125 /// <p>The new name. If you omit it, the name is unchanged.</p>
126 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127 self.inner = self.inner.name(input.into());
128 self
129 }
130 /// <p>The new name. If you omit it, the name is unchanged.</p>
131 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132 self.inner = self.inner.set_name(input);
133 self
134 }
135 /// <p>The new name. If you omit it, the name is unchanged.</p>
136 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
137 self.inner.get_name()
138 }
139 /// <p>The new ingestion scope for the connection. If you omit it, the existing scope is unchanged. The rules of <code>CreateConnectionRequest.scope</code> apply, with the following additions:</p>
140 /// <ul>
141 /// <li>
142 /// <p>A <code>DATABRICKS</code> or <code>SNOWFLAKE</code> scope names at most one <code>databricksCatalog</code> or <code>snowflakeDatabase</code>, unless the existing scope already names each one.</p></li>
143 /// <li>
144 /// <p>If the stored scope has a selector with a <code>glueService</code> segment, the new scope can't be empty. Every selector that it adds must also have a <code>glueService</code> segment. Otherwise, the request fails with <code>ValidationException</code>. You can keep a selector that the stored scope already has, so resending the stored scope unchanged succeeds.</p></li>
145 /// </ul>
146 pub fn scope(mut self, input: crate::types::DataSourceScope) -> Self {
147 self.inner = self.inner.scope(input);
148 self
149 }
150 /// <p>The new ingestion scope for the connection. If you omit it, the existing scope is unchanged. The rules of <code>CreateConnectionRequest.scope</code> apply, with the following additions:</p>
151 /// <ul>
152 /// <li>
153 /// <p>A <code>DATABRICKS</code> or <code>SNOWFLAKE</code> scope names at most one <code>databricksCatalog</code> or <code>snowflakeDatabase</code>, unless the existing scope already names each one.</p></li>
154 /// <li>
155 /// <p>If the stored scope has a selector with a <code>glueService</code> segment, the new scope can't be empty. Every selector that it adds must also have a <code>glueService</code> segment. Otherwise, the request fails with <code>ValidationException</code>. You can keep a selector that the stored scope already has, so resending the stored scope unchanged succeeds.</p></li>
156 /// </ul>
157 pub fn set_scope(mut self, input: ::std::option::Option<crate::types::DataSourceScope>) -> Self {
158 self.inner = self.inner.set_scope(input);
159 self
160 }
161 /// <p>The new ingestion scope for the connection. If you omit it, the existing scope is unchanged. The rules of <code>CreateConnectionRequest.scope</code> apply, with the following additions:</p>
162 /// <ul>
163 /// <li>
164 /// <p>A <code>DATABRICKS</code> or <code>SNOWFLAKE</code> scope names at most one <code>databricksCatalog</code> or <code>snowflakeDatabase</code>, unless the existing scope already names each one.</p></li>
165 /// <li>
166 /// <p>If the stored scope has a selector with a <code>glueService</code> segment, the new scope can't be empty. Every selector that it adds must also have a <code>glueService</code> segment. Otherwise, the request fails with <code>ValidationException</code>. You can keep a selector that the stored scope already has, so resending the stored scope unchanged succeeds.</p></li>
167 /// </ul>
168 pub fn get_scope(&self) -> &::std::option::Option<crate::types::DataSourceScope> {
169 self.inner.get_scope()
170 }
171 /// <p>The updated access configuration for the data source. If you omit it, the existing configuration is unchanged. If you provide one, it replaces the stored configuration, including its variant.</p>
172 /// <p>For <code>DATABRICKS</code> and <code>SNOWFLAKE</code>, a configuration with no variant clears a stored <code>iamRole</code>, and the connection is then returned with no <code>accessConfig</code>.</p>
173 /// <p>For <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code>, you cannot add or remove the <code>iamRole</code>. An update that adds an <code>iamRole</code> to a connection stored without one fails with <code>ValidationException</code>. So does an update that provides a configuration without <code>iamRole</code> for a connection that has one. You can replace a stored role with another role. To change how such a connection reads its data source, delete the connection and create it again.</p>
174 pub fn access_config(mut self, input: crate::types::AccessConfig) -> Self {
175 self.inner = self.inner.access_config(input);
176 self
177 }
178 /// <p>The updated access configuration for the data source. If you omit it, the existing configuration is unchanged. If you provide one, it replaces the stored configuration, including its variant.</p>
179 /// <p>For <code>DATABRICKS</code> and <code>SNOWFLAKE</code>, a configuration with no variant clears a stored <code>iamRole</code>, and the connection is then returned with no <code>accessConfig</code>.</p>
180 /// <p>For <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code>, you cannot add or remove the <code>iamRole</code>. An update that adds an <code>iamRole</code> to a connection stored without one fails with <code>ValidationException</code>. So does an update that provides a configuration without <code>iamRole</code> for a connection that has one. You can replace a stored role with another role. To change how such a connection reads its data source, delete the connection and create it again.</p>
181 pub fn set_access_config(mut self, input: ::std::option::Option<crate::types::AccessConfig>) -> Self {
182 self.inner = self.inner.set_access_config(input);
183 self
184 }
185 /// <p>The updated access configuration for the data source. If you omit it, the existing configuration is unchanged. If you provide one, it replaces the stored configuration, including its variant.</p>
186 /// <p>For <code>DATABRICKS</code> and <code>SNOWFLAKE</code>, a configuration with no variant clears a stored <code>iamRole</code>, and the connection is then returned with no <code>accessConfig</code>.</p>
187 /// <p>For <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code>, you cannot add or remove the <code>iamRole</code>. An update that adds an <code>iamRole</code> to a connection stored without one fails with <code>ValidationException</code>. So does an update that provides a configuration without <code>iamRole</code> for a connection that has one. You can replace a stored role with another role. To change how such a connection reads its data source, delete the connection and create it again.</p>
188 pub fn get_access_config(&self) -> &::std::option::Option<crate::types::AccessConfig> {
189 self.inner.get_access_config()
190 }
191 /// <p>The new sync schedule for a <code>DATABRICKS</code> or <code>SNOWFLAKE</code> source. If you omit it, the existing schedule is unchanged. Not accepted for <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code> connections.</p>
192 pub fn sync_schedule(mut self, input: crate::types::SyncSchedule) -> Self {
193 self.inner = self.inner.sync_schedule(input);
194 self
195 }
196 /// <p>The new sync schedule for a <code>DATABRICKS</code> or <code>SNOWFLAKE</code> source. If you omit it, the existing schedule is unchanged. Not accepted for <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code> connections.</p>
197 pub fn set_sync_schedule(mut self, input: ::std::option::Option<crate::types::SyncSchedule>) -> Self {
198 self.inner = self.inner.set_sync_schedule(input);
199 self
200 }
201 /// <p>The new sync schedule for a <code>DATABRICKS</code> or <code>SNOWFLAKE</code> source. If you omit it, the existing schedule is unchanged. Not accepted for <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code> connections.</p>
202 pub fn get_sync_schedule(&self) -> &::std::option::Option<crate::types::SyncSchedule> {
203 self.inner.get_sync_schedule()
204 }
205 /// <p>The ingestion configuration: the IAM role that a data producer assumes to push data into this connection. Required on every update, so that an existing connection always has an ingestion role that AWS Context can authorize. You must have <code>iam:PassRole</code> permission to pass this role to the data producer, and the role must be in your account. You can't clear the role.</p>
206 pub fn ingestion_config(mut self, input: crate::types::IngestionConfig) -> Self {
207 self.inner = self.inner.ingestion_config(input);
208 self
209 }
210 /// <p>The ingestion configuration: the IAM role that a data producer assumes to push data into this connection. Required on every update, so that an existing connection always has an ingestion role that AWS Context can authorize. You must have <code>iam:PassRole</code> permission to pass this role to the data producer, and the role must be in your account. You can't clear the role.</p>
211 pub fn set_ingestion_config(mut self, input: ::std::option::Option<crate::types::IngestionConfig>) -> Self {
212 self.inner = self.inner.set_ingestion_config(input);
213 self
214 }
215 /// <p>The ingestion configuration: the IAM role that a data producer assumes to push data into this connection. Required on every update, so that an existing connection always has an ingestion role that AWS Context can authorize. You must have <code>iam:PassRole</code> permission to pass this role to the data producer, and the role must be in your account. You can't clear the role.</p>
216 pub fn get_ingestion_config(&self) -> &::std::option::Option<crate::types::IngestionConfig> {
217 self.inner.get_ingestion_config()
218 }
219 ///
220 /// Appends an item to `glueConnectionMappings`.
221 ///
222 /// To override the contents of this collection use [`set_glue_connection_mappings`](Self::set_glue_connection_mappings).
223 ///
224 /// <p>The AWS Glue connection for each <code>redshiftNamespace</code>, and for each <code>rdsInstance</code> and <code>rdsDatabase</code> pair, in <code>scope</code>. If you omit it, the stored list is kept. A list replaces the stored list, and an empty list clears it. If the update changes <code>scope</code>, or changes the role of a connection to another account's catalog, AWS Context validates the kept list again. The rules are those of <code>CreateConnectionRequest.glueConnectionMappings</code>. You can't change the list of a <code>SNOWFLAKE</code> connection, which is keyed by <code>snowflakeDatabase</code>: omit it or send it unchanged.</p>
225 pub fn glue_connection_mappings(mut self, input: crate::types::GlueConnectionMapping) -> Self {
226 self.inner = self.inner.glue_connection_mappings(input);
227 self
228 }
229 /// <p>The AWS Glue connection for each <code>redshiftNamespace</code>, and for each <code>rdsInstance</code> and <code>rdsDatabase</code> pair, in <code>scope</code>. If you omit it, the stored list is kept. A list replaces the stored list, and an empty list clears it. If the update changes <code>scope</code>, or changes the role of a connection to another account's catalog, AWS Context validates the kept list again. The rules are those of <code>CreateConnectionRequest.glueConnectionMappings</code>. You can't change the list of a <code>SNOWFLAKE</code> connection, which is keyed by <code>snowflakeDatabase</code>: omit it or send it unchanged.</p>
230 pub fn set_glue_connection_mappings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GlueConnectionMapping>>) -> Self {
231 self.inner = self.inner.set_glue_connection_mappings(input);
232 self
233 }
234 /// <p>The AWS Glue connection for each <code>redshiftNamespace</code>, and for each <code>rdsInstance</code> and <code>rdsDatabase</code> pair, in <code>scope</code>. If you omit it, the stored list is kept. A list replaces the stored list, and an empty list clears it. If the update changes <code>scope</code>, or changes the role of a connection to another account's catalog, AWS Context validates the kept list again. The rules are those of <code>CreateConnectionRequest.glueConnectionMappings</code>. You can't change the list of a <code>SNOWFLAKE</code> connection, which is keyed by <code>snowflakeDatabase</code>: omit it or send it unchanged.</p>
235 pub fn get_glue_connection_mappings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GlueConnectionMapping>> {
236 self.inner.get_glue_connection_mappings()
237 }
238 /// <p>Specifies whether to publish a third-party connection created with <code>publish: false</code>. If <code>true</code>, AWS Context configures catalog synchronization. The connection moves to ACTIVE when AWS Glue finishes provisioning the managed crawler. This has no effect on an ACTIVE connection. <code>false</code> is not accepted, because a connection can't be unpublished. Delete the connection instead.</p>
239 pub fn publish(mut self, input: bool) -> Self {
240 self.inner = self.inner.publish(input);
241 self
242 }
243 /// <p>Specifies whether to publish a third-party connection created with <code>publish: false</code>. If <code>true</code>, AWS Context configures catalog synchronization. The connection moves to ACTIVE when AWS Glue finishes provisioning the managed crawler. This has no effect on an ACTIVE connection. <code>false</code> is not accepted, because a connection can't be unpublished. Delete the connection instead.</p>
244 pub fn set_publish(mut self, input: ::std::option::Option<bool>) -> Self {
245 self.inner = self.inner.set_publish(input);
246 self
247 }
248 /// <p>Specifies whether to publish a third-party connection created with <code>publish: false</code>. If <code>true</code>, AWS Context configures catalog synchronization. The connection moves to ACTIVE when AWS Glue finishes provisioning the managed crawler. This has no effect on an ACTIVE connection. <code>false</code> is not accepted, because a connection can't be unpublished. Delete the connection instead.</p>
249 pub fn get_publish(&self) -> &::std::option::Option<bool> {
250 self.inner.get_publish()
251 }
252}