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>Updates a cluster.</p>
26/// <p><b>Example IAM Policy for Multi-Region Operations</b></p>
27/// <p>The following IAM policy grants permissions for multi-Region operations.</p>
28/// <p>The <code>dsql:RemovePeerCluster</code> permission uses a wildcard ARN pattern to simplify permission management during updates.</p><important>
29/// <p><b>Important Notes for Multi-Region Operations</b></p>
30/// <ul>
31/// <li>
32/// <p>The witness region specified in <code>multiRegionProperties.witnessRegion</code> cannot be the same as the cluster's Region.</p></li>
33/// <li>
34/// <p>When updating clusters with peer relationships, permissions are checked for both adding and removing peers.</p></li>
35/// <li>
36/// <p>The <code>dsql:RemovePeerCluster</code> permission uses a wildcard ARN pattern to simplify permission management during updates.</p></li>
37/// </ul>
38/// </important>
39#[derive(::std::clone::Clone, ::std::fmt::Debug)]
40pub struct UpdateClusterFluentBuilder {
41    handle: ::std::sync::Arc<crate::client::Handle>,
42    inner: crate::operation::update_cluster::builders::UpdateClusterInputBuilder,
43    config_override: ::std::option::Option<crate::config::Builder>,
44}
45impl
46    crate::client::customize::internal::CustomizableSend<
47        crate::operation::update_cluster::UpdateClusterOutput,
48        crate::operation::update_cluster::UpdateClusterError,
49    > for UpdateClusterFluentBuilder
50{
51    fn send(
52        self,
53        config_override: crate::config::Builder,
54    ) -> crate::client::customize::internal::BoxFuture<
55        crate::client::customize::internal::SendResult<
56            crate::operation::update_cluster::UpdateClusterOutput,
57            crate::operation::update_cluster::UpdateClusterError,
58        >,
59    > {
60        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
61    }
62}
63impl UpdateClusterFluentBuilder {
64    /// Creates a new `UpdateClusterFluentBuilder`.
65    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
66        Self {
67            handle,
68            inner: ::std::default::Default::default(),
69            config_override: ::std::option::Option::None,
70        }
71    }
72    /// Access the UpdateCluster as a reference.
73    pub fn as_input(&self) -> &crate::operation::update_cluster::builders::UpdateClusterInputBuilder {
74        &self.inner
75    }
76    /// Sends the request and returns the response.
77    ///
78    /// If an error occurs, an `SdkError` will be returned with additional details that
79    /// can be matched against.
80    ///
81    /// By default, any retryable failures will be retried twice. Retry behavior
82    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
83    /// set when configuring the client.
84    pub async fn send(
85        self,
86    ) -> ::std::result::Result<
87        crate::operation::update_cluster::UpdateClusterOutput,
88        ::aws_smithy_runtime_api::client::result::SdkError<
89            crate::operation::update_cluster::UpdateClusterError,
90            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
91        >,
92    > {
93        let input = self
94            .inner
95            .build()
96            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
97        let runtime_plugins = crate::operation::update_cluster::UpdateCluster::operation_runtime_plugins(
98            self.handle.runtime_plugins.clone(),
99            &self.handle.conf,
100            self.config_override,
101        );
102        crate::operation::update_cluster::UpdateCluster::orchestrate(&runtime_plugins, input).await
103    }
104
105    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
106    pub fn customize(
107        self,
108    ) -> crate::client::customize::CustomizableOperation<
109        crate::operation::update_cluster::UpdateClusterOutput,
110        crate::operation::update_cluster::UpdateClusterError,
111        Self,
112    > {
113        crate::client::customize::CustomizableOperation::new(self)
114    }
115    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
116        self.set_config_override(::std::option::Option::Some(config_override.into()));
117        self
118    }
119
120    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
121        self.config_override = config_override;
122        self
123    }
124    /// <p>The ID of the cluster you want to update.</p>
125    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126        self.inner = self.inner.identifier(input.into());
127        self
128    }
129    /// <p>The ID of the cluster you want to update.</p>
130    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131        self.inner = self.inner.set_identifier(input);
132        self
133    }
134    /// <p>The ID of the cluster you want to update.</p>
135    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
136        self.inner.get_identifier()
137    }
138    /// <p>Specifies whether to enable deletion protection in your cluster.</p>
139    pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
140        self.inner = self.inner.deletion_protection_enabled(input);
141        self
142    }
143    /// <p>Specifies whether to enable deletion protection in your cluster.</p>
144    pub fn set_deletion_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
145        self.inner = self.inner.set_deletion_protection_enabled(input);
146        self
147    }
148    /// <p>Specifies whether to enable deletion protection in your cluster.</p>
149    pub fn get_deletion_protection_enabled(&self) -> &::std::option::Option<bool> {
150        self.inner.get_deletion_protection_enabled()
151    }
152    /// <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>
153    /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
154    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.client_token(input.into());
156        self
157    }
158    /// <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>
159    /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
160    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
161        self.inner = self.inner.set_client_token(input);
162        self
163    }
164    /// <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>
165    /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
166    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
167        self.inner.get_client_token()
168    }
169    /// <p>The new multi-Region cluster configuration settings to be applied during an update operation.</p>
170    pub fn multi_region_properties(mut self, input: crate::types::MultiRegionProperties) -> Self {
171        self.inner = self.inner.multi_region_properties(input);
172        self
173    }
174    /// <p>The new multi-Region cluster configuration settings to be applied during an update operation.</p>
175    pub fn set_multi_region_properties(mut self, input: ::std::option::Option<crate::types::MultiRegionProperties>) -> Self {
176        self.inner = self.inner.set_multi_region_properties(input);
177        self
178    }
179    /// <p>The new multi-Region cluster configuration settings to be applied during an update operation.</p>
180    pub fn get_multi_region_properties(&self) -> &::std::option::Option<crate::types::MultiRegionProperties> {
181        self.inner.get_multi_region_properties()
182    }
183}