aws_sdk_docdbelastic/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>Modifies an elastic cluster. This includes updating admin-username/password, upgrading the API version, and setting up a backup window and maintenance window</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateClusterFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::update_cluster::builders::UpdateClusterInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::update_cluster::UpdateClusterOutput,
35        crate::operation::update_cluster::UpdateClusterError,
36    > for UpdateClusterFluentBuilder
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_cluster::UpdateClusterOutput,
44            crate::operation::update_cluster::UpdateClusterError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl UpdateClusterFluentBuilder {
51    /// Creates a new `UpdateClusterFluentBuilder`.
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 UpdateCluster as a reference.
60    pub fn as_input(&self) -> &crate::operation::update_cluster::builders::UpdateClusterInputBuilder {
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_cluster::UpdateClusterOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::update_cluster::UpdateClusterError,
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_cluster::UpdateCluster::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::update_cluster::UpdateCluster::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_cluster::UpdateClusterOutput,
97        crate::operation::update_cluster::UpdateClusterError,
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 ARN identifier of the elastic cluster.</p>
112    pub fn cluster_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.cluster_arn(input.into());
114        self
115    }
116    /// <p>The ARN identifier of the elastic cluster.</p>
117    pub fn set_cluster_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_cluster_arn(input);
119        self
120    }
121    /// <p>The ARN identifier of the elastic cluster.</p>
122    pub fn get_cluster_arn(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_cluster_arn()
124    }
125    /// <p>The authentication type used to determine where to fetch the password used for accessing the elastic cluster. Valid types are <code>PLAIN_TEXT</code> or <code>SECRET_ARN</code>.</p>
126    pub fn auth_type(mut self, input: crate::types::Auth) -> Self {
127        self.inner = self.inner.auth_type(input);
128        self
129    }
130    /// <p>The authentication type used to determine where to fetch the password used for accessing the elastic cluster. Valid types are <code>PLAIN_TEXT</code> or <code>SECRET_ARN</code>.</p>
131    pub fn set_auth_type(mut self, input: ::std::option::Option<crate::types::Auth>) -> Self {
132        self.inner = self.inner.set_auth_type(input);
133        self
134    }
135    /// <p>The authentication type used to determine where to fetch the password used for accessing the elastic cluster. Valid types are <code>PLAIN_TEXT</code> or <code>SECRET_ARN</code>.</p>
136    pub fn get_auth_type(&self) -> &::std::option::Option<crate::types::Auth> {
137        self.inner.get_auth_type()
138    }
139    /// <p>The number of vCPUs assigned to each elastic cluster shard. Maximum is 64. Allowed values are 2, 4, 8, 16, 32, 64.</p>
140    pub fn shard_capacity(mut self, input: i32) -> Self {
141        self.inner = self.inner.shard_capacity(input);
142        self
143    }
144    /// <p>The number of vCPUs assigned to each elastic cluster shard. Maximum is 64. Allowed values are 2, 4, 8, 16, 32, 64.</p>
145    pub fn set_shard_capacity(mut self, input: ::std::option::Option<i32>) -> Self {
146        self.inner = self.inner.set_shard_capacity(input);
147        self
148    }
149    /// <p>The number of vCPUs assigned to each elastic cluster shard. Maximum is 64. Allowed values are 2, 4, 8, 16, 32, 64.</p>
150    pub fn get_shard_capacity(&self) -> &::std::option::Option<i32> {
151        self.inner.get_shard_capacity()
152    }
153    /// <p>The number of shards assigned to the elastic cluster. Maximum is 32.</p>
154    pub fn shard_count(mut self, input: i32) -> Self {
155        self.inner = self.inner.shard_count(input);
156        self
157    }
158    /// <p>The number of shards assigned to the elastic cluster. Maximum is 32.</p>
159    pub fn set_shard_count(mut self, input: ::std::option::Option<i32>) -> Self {
160        self.inner = self.inner.set_shard_count(input);
161        self
162    }
163    /// <p>The number of shards assigned to the elastic cluster. Maximum is 32.</p>
164    pub fn get_shard_count(&self) -> &::std::option::Option<i32> {
165        self.inner.get_shard_count()
166    }
167    ///
168    /// Appends an item to `vpcSecurityGroupIds`.
169    ///
170    /// To override the contents of this collection use [`set_vpc_security_group_ids`](Self::set_vpc_security_group_ids).
171    ///
172    /// <p>A list of EC2 VPC security groups to associate with the elastic cluster.</p>
173    pub fn vpc_security_group_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
174        self.inner = self.inner.vpc_security_group_ids(input.into());
175        self
176    }
177    /// <p>A list of EC2 VPC security groups to associate with the elastic cluster.</p>
178    pub fn set_vpc_security_group_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
179        self.inner = self.inner.set_vpc_security_group_ids(input);
180        self
181    }
182    /// <p>A list of EC2 VPC security groups to associate with the elastic cluster.</p>
183    pub fn get_vpc_security_group_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
184        self.inner.get_vpc_security_group_ids()
185    }
186    ///
187    /// Appends an item to `subnetIds`.
188    ///
189    /// To override the contents of this collection use [`set_subnet_ids`](Self::set_subnet_ids).
190    ///
191    /// <p>The Amazon EC2 subnet IDs for the elastic cluster.</p>
192    pub fn subnet_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
193        self.inner = self.inner.subnet_ids(input.into());
194        self
195    }
196    /// <p>The Amazon EC2 subnet IDs for the elastic cluster.</p>
197    pub fn set_subnet_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
198        self.inner = self.inner.set_subnet_ids(input);
199        self
200    }
201    /// <p>The Amazon EC2 subnet IDs for the elastic cluster.</p>
202    pub fn get_subnet_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
203        self.inner.get_subnet_ids()
204    }
205    /// <p>The password associated with the elastic cluster administrator. This password can contain any printable ASCII character except forward slash (/), double quote ("), or the "at" symbol (@).</p>
206    /// <p><i>Constraints</i>: Must contain from 8 to 100 characters.</p>
207    pub fn admin_user_password(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
208        self.inner = self.inner.admin_user_password(input.into());
209        self
210    }
211    /// <p>The password associated with the elastic cluster administrator. This password can contain any printable ASCII character except forward slash (/), double quote ("), or the "at" symbol (@).</p>
212    /// <p><i>Constraints</i>: Must contain from 8 to 100 characters.</p>
213    pub fn set_admin_user_password(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
214        self.inner = self.inner.set_admin_user_password(input);
215        self
216    }
217    /// <p>The password associated with the elastic cluster administrator. This password can contain any printable ASCII character except forward slash (/), double quote ("), or the "at" symbol (@).</p>
218    /// <p><i>Constraints</i>: Must contain from 8 to 100 characters.</p>
219    pub fn get_admin_user_password(&self) -> &::std::option::Option<::std::string::String> {
220        self.inner.get_admin_user_password()
221    }
222    /// <p>The client token for the elastic cluster.</p>
223    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
224        self.inner = self.inner.client_token(input.into());
225        self
226    }
227    /// <p>The client token for the elastic cluster.</p>
228    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
229        self.inner = self.inner.set_client_token(input);
230        self
231    }
232    /// <p>The client token for the elastic cluster.</p>
233    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
234        self.inner.get_client_token()
235    }
236    /// <p>The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).</p>
237    /// <p><i>Format</i>: <code>ddd:hh24:mi-ddd:hh24:mi</code></p>
238    /// <p><i>Default</i>: a 30-minute window selected at random from an 8-hour block of time for each Amazon Web Services Region, occurring on a random day of the week.</p>
239    /// <p><i>Valid days</i>: Mon, Tue, Wed, Thu, Fri, Sat, Sun</p>
240    /// <p><i>Constraints</i>: Minimum 30-minute window.</p>
241    pub fn preferred_maintenance_window(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
242        self.inner = self.inner.preferred_maintenance_window(input.into());
243        self
244    }
245    /// <p>The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).</p>
246    /// <p><i>Format</i>: <code>ddd:hh24:mi-ddd:hh24:mi</code></p>
247    /// <p><i>Default</i>: a 30-minute window selected at random from an 8-hour block of time for each Amazon Web Services Region, occurring on a random day of the week.</p>
248    /// <p><i>Valid days</i>: Mon, Tue, Wed, Thu, Fri, Sat, Sun</p>
249    /// <p><i>Constraints</i>: Minimum 30-minute window.</p>
250    pub fn set_preferred_maintenance_window(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
251        self.inner = self.inner.set_preferred_maintenance_window(input);
252        self
253    }
254    /// <p>The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).</p>
255    /// <p><i>Format</i>: <code>ddd:hh24:mi-ddd:hh24:mi</code></p>
256    /// <p><i>Default</i>: a 30-minute window selected at random from an 8-hour block of time for each Amazon Web Services Region, occurring on a random day of the week.</p>
257    /// <p><i>Valid days</i>: Mon, Tue, Wed, Thu, Fri, Sat, Sun</p>
258    /// <p><i>Constraints</i>: Minimum 30-minute window.</p>
259    pub fn get_preferred_maintenance_window(&self) -> &::std::option::Option<::std::string::String> {
260        self.inner.get_preferred_maintenance_window()
261    }
262    /// <p>The number of days for which automatic snapshots are retained.</p>
263    pub fn backup_retention_period(mut self, input: i32) -> Self {
264        self.inner = self.inner.backup_retention_period(input);
265        self
266    }
267    /// <p>The number of days for which automatic snapshots are retained.</p>
268    pub fn set_backup_retention_period(mut self, input: ::std::option::Option<i32>) -> Self {
269        self.inner = self.inner.set_backup_retention_period(input);
270        self
271    }
272    /// <p>The number of days for which automatic snapshots are retained.</p>
273    pub fn get_backup_retention_period(&self) -> &::std::option::Option<i32> {
274        self.inner.get_backup_retention_period()
275    }
276    /// <p>The daily time range during which automated backups are created if automated backups are enabled, as determined by the <code>backupRetentionPeriod</code>.</p>
277    pub fn preferred_backup_window(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
278        self.inner = self.inner.preferred_backup_window(input.into());
279        self
280    }
281    /// <p>The daily time range during which automated backups are created if automated backups are enabled, as determined by the <code>backupRetentionPeriod</code>.</p>
282    pub fn set_preferred_backup_window(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
283        self.inner = self.inner.set_preferred_backup_window(input);
284        self
285    }
286    /// <p>The daily time range during which automated backups are created if automated backups are enabled, as determined by the <code>backupRetentionPeriod</code>.</p>
287    pub fn get_preferred_backup_window(&self) -> &::std::option::Option<::std::string::String> {
288        self.inner.get_preferred_backup_window()
289    }
290    /// <p>The number of replica instances applying to all shards in the elastic cluster. A <code>shardInstanceCount</code> value of 1 means there is one writer instance, and any additional instances are replicas that can be used for reads and to improve availability.</p>
291    pub fn shard_instance_count(mut self, input: i32) -> Self {
292        self.inner = self.inner.shard_instance_count(input);
293        self
294    }
295    /// <p>The number of replica instances applying to all shards in the elastic cluster. A <code>shardInstanceCount</code> value of 1 means there is one writer instance, and any additional instances are replicas that can be used for reads and to improve availability.</p>
296    pub fn set_shard_instance_count(mut self, input: ::std::option::Option<i32>) -> Self {
297        self.inner = self.inner.set_shard_instance_count(input);
298        self
299    }
300    /// <p>The number of replica instances applying to all shards in the elastic cluster. A <code>shardInstanceCount</code> value of 1 means there is one writer instance, and any additional instances are replicas that can be used for reads and to improve availability.</p>
301    pub fn get_shard_instance_count(&self) -> &::std::option::Option<i32> {
302        self.inner.get_shard_instance_count()
303    }
304}