aws_sdk_dsql/operation/update_cluster/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_cluster::_update_cluster_output::UpdateClusterOutputBuilder;
3
4pub use crate::operation::update_cluster::_update_cluster_input::UpdateClusterInputBuilder;
5
6impl crate::operation::update_cluster::builders::UpdateClusterInputBuilder {
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_cluster::UpdateClusterOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::update_cluster::UpdateClusterError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.update_cluster();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UpdateCluster`.
24///
25/// <p>The <i>UpdateCluster</i> API allows you to modify both single-Region and multi-Region cluster configurations. With the <i>multiRegionProperties</i> parameter, you can add or modify witness Region support and manage peer relationships with clusters in other Regions.</p><note>
26/// <p>Note that updating multi-region clusters requires additional IAM permissions beyond those needed for standard cluster updates, as detailed in the Permissions section.</p>
27/// </note>
28/// <p><b>Required permissions</b></p>
29/// <dl>
30/// <dt>
31/// dsql:UpdateCluster
32/// </dt>
33/// <dd>
34/// <p>Permission to update a DSQL cluster.</p>
35/// <p>Resources: <code>arn:aws:dsql:<i>region</i>:<i>account-id</i>:cluster/<i>cluster-id</i> </code></p>
36/// </dd>
37/// </dl>
38/// <dl>
39/// <dt>
40/// dsql:PutMultiRegionProperties
41/// </dt>
42/// <dd>
43/// <p>Permission to configure multi-Region properties for a cluster.</p>
44/// <p>Resources: <code>arn:aws:dsql:<i>region</i>:<i>account-id</i>:cluster/<i>cluster-id</i> </code></p>
45/// </dd>
46/// </dl>
47/// <dl>
48/// <dt>
49/// dsql:GetCluster
50/// </dt>
51/// <dd>
52/// <p>Permission to retrieve cluster information.</p>
53/// <p>Resources: <code>arn:aws:dsql:<i>region</i>:<i>account-id</i>:cluster/<i>cluster-id</i> </code></p>
54/// </dd>
55/// <dt>
56/// dsql:AddPeerCluster
57/// </dt>
58/// <dd>
59/// <p>Permission to add peer clusters.</p>
60/// <p>Resources:</p>
61/// <ul>
62/// <li>
63/// <p>Local cluster: <code>arn:aws:dsql:<i>region</i>:<i>account-id</i>:cluster/<i>cluster-id</i> </code></p></li>
64/// <li>
65/// <p>Each peer cluster: exact ARN of each specified peer cluster</p></li>
66/// </ul>
67/// </dd>
68/// <dt>
69/// dsql:RemovePeerCluster
70/// </dt>
71/// <dd>
72/// <p>Permission to remove peer clusters. The <i>dsql:RemovePeerCluster</i> permission uses a wildcard ARN pattern to simplify permission management during updates.</p>
73/// <p>Resources: <code>arn:aws:dsql:*:<i>account-id</i>:cluster/*</code></p>
74/// </dd>
75/// </dl>
76/// <dl>
77/// <dt>
78/// dsql:PutWitnessRegion
79/// </dt>
80/// <dd>
81/// <p>Permission to set a witness Region.</p>
82/// <p>Resources: <code>arn:aws:dsql:<i>region</i>:<i>account-id</i>:cluster/<i>cluster-id</i> </code></p>
83/// <p>Condition Keys: dsql:WitnessRegion (matching the specified witness Region)</p>
84/// <p><b>This permission is checked both in the cluster Region and in the witness Region.</b></p>
85/// </dd>
86/// </dl><important>
87/// <ul>
88/// <li>
89/// <p>The witness region specified in <code>multiRegionProperties.witnessRegion</code> cannot be the same as the cluster's Region.</p></li>
90/// <li>
91/// <p>When updating clusters with peer relationships, permissions are checked for both adding and removing peers.</p></li>
92/// <li>
93/// <p>The <code>dsql:RemovePeerCluster</code> permission uses a wildcard ARN pattern to simplify permission management during updates.</p></li>
94/// </ul>
95/// </important>
96#[derive(::std::clone::Clone, ::std::fmt::Debug)]
97pub struct UpdateClusterFluentBuilder {
98 handle: ::std::sync::Arc<crate::client::Handle>,
99 inner: crate::operation::update_cluster::builders::UpdateClusterInputBuilder,
100 config_override: ::std::option::Option<crate::config::Builder>,
101}
102impl
103 crate::client::customize::internal::CustomizableSend<
104 crate::operation::update_cluster::UpdateClusterOutput,
105 crate::operation::update_cluster::UpdateClusterError,
106 > for UpdateClusterFluentBuilder
107{
108 fn send(
109 self,
110 config_override: crate::config::Builder,
111 ) -> crate::client::customize::internal::BoxFuture<
112 crate::client::customize::internal::SendResult<
113 crate::operation::update_cluster::UpdateClusterOutput,
114 crate::operation::update_cluster::UpdateClusterError,
115 >,
116 > {
117 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
118 }
119}
120impl UpdateClusterFluentBuilder {
121 /// Creates a new `UpdateClusterFluentBuilder`.
122 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
123 Self {
124 handle,
125 inner: ::std::default::Default::default(),
126 config_override: ::std::option::Option::None,
127 }
128 }
129 /// Access the UpdateCluster as a reference.
130 pub fn as_input(&self) -> &crate::operation::update_cluster::builders::UpdateClusterInputBuilder {
131 &self.inner
132 }
133 /// Sends the request and returns the response.
134 ///
135 /// If an error occurs, an `SdkError` will be returned with additional details that
136 /// can be matched against.
137 ///
138 /// By default, any retryable failures will be retried twice. Retry behavior
139 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
140 /// set when configuring the client.
141 pub async fn send(
142 self,
143 ) -> ::std::result::Result<
144 crate::operation::update_cluster::UpdateClusterOutput,
145 ::aws_smithy_runtime_api::client::result::SdkError<
146 crate::operation::update_cluster::UpdateClusterError,
147 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
148 >,
149 > {
150 let input = self
151 .inner
152 .build()
153 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
154 let runtime_plugins = crate::operation::update_cluster::UpdateCluster::operation_runtime_plugins(
155 self.handle.runtime_plugins.clone(),
156 &self.handle.conf,
157 self.config_override,
158 );
159 crate::operation::update_cluster::UpdateCluster::orchestrate(&runtime_plugins, input).await
160 }
161
162 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
163 pub fn customize(
164 self,
165 ) -> crate::client::customize::CustomizableOperation<
166 crate::operation::update_cluster::UpdateClusterOutput,
167 crate::operation::update_cluster::UpdateClusterError,
168 Self,
169 > {
170 crate::client::customize::CustomizableOperation::new(self)
171 }
172 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
173 self.set_config_override(::std::option::Option::Some(config_override.into()));
174 self
175 }
176
177 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
178 self.config_override = config_override;
179 self
180 }
181 /// <p>The ID of the cluster you want to update.</p>
182 pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
183 self.inner = self.inner.identifier(input.into());
184 self
185 }
186 /// <p>The ID of the cluster you want to update.</p>
187 pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
188 self.inner = self.inner.set_identifier(input);
189 self
190 }
191 /// <p>The ID of the cluster you want to update.</p>
192 pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
193 self.inner.get_identifier()
194 }
195 /// <p>Specifies whether to enable deletion protection in your cluster.</p>
196 pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
197 self.inner = self.inner.deletion_protection_enabled(input);
198 self
199 }
200 /// <p>Specifies whether to enable deletion protection in your cluster.</p>
201 pub fn set_deletion_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
202 self.inner = self.inner.set_deletion_protection_enabled(input);
203 self
204 }
205 /// <p>Specifies whether to enable deletion protection in your cluster.</p>
206 pub fn get_deletion_protection_enabled(&self) -> &::std::option::Option<bool> {
207 self.inner.get_deletion_protection_enabled()
208 }
209 /// <p>The KMS key that encrypts and protects the data on your cluster. You can specify the ARN, ID, or alias of an existing key or have Amazon Web Services create a default key for you.</p>
210 pub fn kms_encryption_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
211 self.inner = self.inner.kms_encryption_key(input.into());
212 self
213 }
214 /// <p>The KMS key that encrypts and protects the data on your cluster. You can specify the ARN, ID, or alias of an existing key or have Amazon Web Services create a default key for you.</p>
215 pub fn set_kms_encryption_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
216 self.inner = self.inner.set_kms_encryption_key(input);
217 self
218 }
219 /// <p>The KMS key that encrypts and protects the data on your cluster. You can specify the ARN, ID, or alias of an existing key or have Amazon Web Services create a default key for you.</p>
220 pub fn get_kms_encryption_key(&self) -> &::std::option::Option<::std::string::String> {
221 self.inner.get_kms_encryption_key()
222 }
223 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully. The subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
224 /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
225 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
226 self.inner = self.inner.client_token(input.into());
227 self
228 }
229 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully. The subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
230 /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
231 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
232 self.inner = self.inner.set_client_token(input);
233 self
234 }
235 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully. The subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
236 /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
237 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
238 self.inner.get_client_token()
239 }
240 /// <p>The new multi-Region cluster configuration settings to be applied during an update operation.</p>
241 pub fn multi_region_properties(mut self, input: crate::types::MultiRegionProperties) -> Self {
242 self.inner = self.inner.multi_region_properties(input);
243 self
244 }
245 /// <p>The new multi-Region cluster configuration settings to be applied during an update operation.</p>
246 pub fn set_multi_region_properties(mut self, input: ::std::option::Option<crate::types::MultiRegionProperties>) -> Self {
247 self.inner = self.inner.set_multi_region_properties(input);
248 self
249 }
250 /// <p>The new multi-Region cluster configuration settings to be applied during an update operation.</p>
251 pub fn get_multi_region_properties(&self) -> &::std::option::Option<crate::types::MultiRegionProperties> {
252 self.inner.get_multi_region_properties()
253 }
254}