aws_sdk_docdbelastic/operation/create_cluster/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_cluster::_create_cluster_output::CreateClusterOutputBuilder;
3
4pub use crate::operation::create_cluster::_create_cluster_input::CreateClusterInputBuilder;
5
6impl crate::operation::create_cluster::builders::CreateClusterInputBuilder {
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::create_cluster::CreateClusterOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_cluster::CreateClusterError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_cluster();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateCluster`.
24///
25/// <p>Creates a new Amazon DocumentDB elastic cluster and returns its cluster structure.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateClusterFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::create_cluster::builders::CreateClusterInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::create_cluster::CreateClusterOutput,
35 crate::operation::create_cluster::CreateClusterError,
36 > for CreateClusterFluentBuilder
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::create_cluster::CreateClusterOutput,
44 crate::operation::create_cluster::CreateClusterError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl CreateClusterFluentBuilder {
51 /// Creates a new `CreateClusterFluentBuilder`.
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 CreateCluster as a reference.
60 pub fn as_input(&self) -> &crate::operation::create_cluster::builders::CreateClusterInputBuilder {
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::create_cluster::CreateClusterOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::create_cluster::CreateClusterError,
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::create_cluster::CreateCluster::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::create_cluster::CreateCluster::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::create_cluster::CreateClusterOutput,
97 crate::operation::create_cluster::CreateClusterError,
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 name of the new elastic cluster. This parameter is stored as a lowercase string.</p>
112 /// <p><i>Constraints</i>:</p>
113 /// <ul>
114 /// <li>
115 /// <p>Must contain from 1 to 63 letters, numbers, or hyphens.</p></li>
116 /// <li>
117 /// <p>The first character must be a letter.</p></li>
118 /// <li>
119 /// <p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
120 /// </ul>
121 /// <p><i>Example</i>: <code>my-cluster</code></p>
122 pub fn cluster_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123 self.inner = self.inner.cluster_name(input.into());
124 self
125 }
126 /// <p>The name of the new elastic cluster. This parameter is stored as a lowercase string.</p>
127 /// <p><i>Constraints</i>:</p>
128 /// <ul>
129 /// <li>
130 /// <p>Must contain from 1 to 63 letters, numbers, or hyphens.</p></li>
131 /// <li>
132 /// <p>The first character must be a letter.</p></li>
133 /// <li>
134 /// <p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
135 /// </ul>
136 /// <p><i>Example</i>: <code>my-cluster</code></p>
137 pub fn set_cluster_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138 self.inner = self.inner.set_cluster_name(input);
139 self
140 }
141 /// <p>The name of the new elastic cluster. This parameter is stored as a lowercase string.</p>
142 /// <p><i>Constraints</i>:</p>
143 /// <ul>
144 /// <li>
145 /// <p>Must contain from 1 to 63 letters, numbers, or hyphens.</p></li>
146 /// <li>
147 /// <p>The first character must be a letter.</p></li>
148 /// <li>
149 /// <p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
150 /// </ul>
151 /// <p><i>Example</i>: <code>my-cluster</code></p>
152 pub fn get_cluster_name(&self) -> &::std::option::Option<::std::string::String> {
153 self.inner.get_cluster_name()
154 }
155 /// <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>
156 pub fn auth_type(mut self, input: crate::types::Auth) -> Self {
157 self.inner = self.inner.auth_type(input);
158 self
159 }
160 /// <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>
161 pub fn set_auth_type(mut self, input: ::std::option::Option<crate::types::Auth>) -> Self {
162 self.inner = self.inner.set_auth_type(input);
163 self
164 }
165 /// <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>
166 pub fn get_auth_type(&self) -> &::std::option::Option<crate::types::Auth> {
167 self.inner.get_auth_type()
168 }
169 /// <p>The name of the Amazon DocumentDB elastic clusters administrator.</p>
170 /// <p><i>Constraints</i>:</p>
171 /// <ul>
172 /// <li>
173 /// <p>Must be from 1 to 63 letters or numbers.</p></li>
174 /// <li>
175 /// <p>The first character must be a letter.</p></li>
176 /// <li>
177 /// <p>Cannot be a reserved word.</p></li>
178 /// </ul>
179 pub fn admin_user_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
180 self.inner = self.inner.admin_user_name(input.into());
181 self
182 }
183 /// <p>The name of the Amazon DocumentDB elastic clusters administrator.</p>
184 /// <p><i>Constraints</i>:</p>
185 /// <ul>
186 /// <li>
187 /// <p>Must be from 1 to 63 letters or numbers.</p></li>
188 /// <li>
189 /// <p>The first character must be a letter.</p></li>
190 /// <li>
191 /// <p>Cannot be a reserved word.</p></li>
192 /// </ul>
193 pub fn set_admin_user_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
194 self.inner = self.inner.set_admin_user_name(input);
195 self
196 }
197 /// <p>The name of the Amazon DocumentDB elastic clusters administrator.</p>
198 /// <p><i>Constraints</i>:</p>
199 /// <ul>
200 /// <li>
201 /// <p>Must be from 1 to 63 letters or numbers.</p></li>
202 /// <li>
203 /// <p>The first character must be a letter.</p></li>
204 /// <li>
205 /// <p>Cannot be a reserved word.</p></li>
206 /// </ul>
207 pub fn get_admin_user_name(&self) -> &::std::option::Option<::std::string::String> {
208 self.inner.get_admin_user_name()
209 }
210 /// <p>The password for the Amazon DocumentDB elastic clusters administrator. The password can contain any printable ASCII characters.</p>
211 /// <p><i>Constraints</i>:</p>
212 /// <ul>
213 /// <li>
214 /// <p>Must contain from 8 to 100 characters.</p></li>
215 /// <li>
216 /// <p>Cannot contain a forward slash (/), double quote ("), or the "at" symbol (@).</p></li>
217 /// </ul>
218 pub fn admin_user_password(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
219 self.inner = self.inner.admin_user_password(input.into());
220 self
221 }
222 /// <p>The password for the Amazon DocumentDB elastic clusters administrator. The password can contain any printable ASCII characters.</p>
223 /// <p><i>Constraints</i>:</p>
224 /// <ul>
225 /// <li>
226 /// <p>Must contain from 8 to 100 characters.</p></li>
227 /// <li>
228 /// <p>Cannot contain a forward slash (/), double quote ("), or the "at" symbol (@).</p></li>
229 /// </ul>
230 pub fn set_admin_user_password(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
231 self.inner = self.inner.set_admin_user_password(input);
232 self
233 }
234 /// <p>The password for the Amazon DocumentDB elastic clusters administrator. The password can contain any printable ASCII characters.</p>
235 /// <p><i>Constraints</i>:</p>
236 /// <ul>
237 /// <li>
238 /// <p>Must contain from 8 to 100 characters.</p></li>
239 /// <li>
240 /// <p>Cannot contain a forward slash (/), double quote ("), or the "at" symbol (@).</p></li>
241 /// </ul>
242 pub fn get_admin_user_password(&self) -> &::std::option::Option<::std::string::String> {
243 self.inner.get_admin_user_password()
244 }
245 /// <p>The number of vCPUs assigned to each elastic cluster shard. Maximum is 64. Allowed values are 2, 4, 8, 16, 32, 64.</p>
246 pub fn shard_capacity(mut self, input: i32) -> Self {
247 self.inner = self.inner.shard_capacity(input);
248 self
249 }
250 /// <p>The number of vCPUs assigned to each elastic cluster shard. Maximum is 64. Allowed values are 2, 4, 8, 16, 32, 64.</p>
251 pub fn set_shard_capacity(mut self, input: ::std::option::Option<i32>) -> Self {
252 self.inner = self.inner.set_shard_capacity(input);
253 self
254 }
255 /// <p>The number of vCPUs assigned to each elastic cluster shard. Maximum is 64. Allowed values are 2, 4, 8, 16, 32, 64.</p>
256 pub fn get_shard_capacity(&self) -> &::std::option::Option<i32> {
257 self.inner.get_shard_capacity()
258 }
259 /// <p>The number of shards assigned to the elastic cluster. Maximum is 32.</p>
260 pub fn shard_count(mut self, input: i32) -> Self {
261 self.inner = self.inner.shard_count(input);
262 self
263 }
264 /// <p>The number of shards assigned to the elastic cluster. Maximum is 32.</p>
265 pub fn set_shard_count(mut self, input: ::std::option::Option<i32>) -> Self {
266 self.inner = self.inner.set_shard_count(input);
267 self
268 }
269 /// <p>The number of shards assigned to the elastic cluster. Maximum is 32.</p>
270 pub fn get_shard_count(&self) -> &::std::option::Option<i32> {
271 self.inner.get_shard_count()
272 }
273 ///
274 /// Appends an item to `vpcSecurityGroupIds`.
275 ///
276 /// To override the contents of this collection use [`set_vpc_security_group_ids`](Self::set_vpc_security_group_ids).
277 ///
278 /// <p>A list of EC2 VPC security groups to associate with the new elastic cluster.</p>
279 pub fn vpc_security_group_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
280 self.inner = self.inner.vpc_security_group_ids(input.into());
281 self
282 }
283 /// <p>A list of EC2 VPC security groups to associate with the new elastic cluster.</p>
284 pub fn set_vpc_security_group_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
285 self.inner = self.inner.set_vpc_security_group_ids(input);
286 self
287 }
288 /// <p>A list of EC2 VPC security groups to associate with the new elastic cluster.</p>
289 pub fn get_vpc_security_group_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
290 self.inner.get_vpc_security_group_ids()
291 }
292 ///
293 /// Appends an item to `subnetIds`.
294 ///
295 /// To override the contents of this collection use [`set_subnet_ids`](Self::set_subnet_ids).
296 ///
297 /// <p>The Amazon EC2 subnet IDs for the new elastic cluster.</p>
298 pub fn subnet_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
299 self.inner = self.inner.subnet_ids(input.into());
300 self
301 }
302 /// <p>The Amazon EC2 subnet IDs for the new elastic cluster.</p>
303 pub fn set_subnet_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
304 self.inner = self.inner.set_subnet_ids(input);
305 self
306 }
307 /// <p>The Amazon EC2 subnet IDs for the new elastic cluster.</p>
308 pub fn get_subnet_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
309 self.inner.get_subnet_ids()
310 }
311 /// <p>The KMS key identifier to use to encrypt the new elastic cluster.</p>
312 /// <p>The KMS key identifier is the Amazon Resource Name (ARN) for the KMS encryption key. If you are creating a cluster using the same Amazon account that owns this KMS encryption key, you can use the KMS key alias instead of the ARN as the KMS encryption key.</p>
313 /// <p>If an encryption key is not specified, Amazon DocumentDB uses the default encryption key that KMS creates for your account. Your account has a different default encryption key for each Amazon Region.</p>
314 pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
315 self.inner = self.inner.kms_key_id(input.into());
316 self
317 }
318 /// <p>The KMS key identifier to use to encrypt the new elastic cluster.</p>
319 /// <p>The KMS key identifier is the Amazon Resource Name (ARN) for the KMS encryption key. If you are creating a cluster using the same Amazon account that owns this KMS encryption key, you can use the KMS key alias instead of the ARN as the KMS encryption key.</p>
320 /// <p>If an encryption key is not specified, Amazon DocumentDB uses the default encryption key that KMS creates for your account. Your account has a different default encryption key for each Amazon Region.</p>
321 pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
322 self.inner = self.inner.set_kms_key_id(input);
323 self
324 }
325 /// <p>The KMS key identifier to use to encrypt the new elastic cluster.</p>
326 /// <p>The KMS key identifier is the Amazon Resource Name (ARN) for the KMS encryption key. If you are creating a cluster using the same Amazon account that owns this KMS encryption key, you can use the KMS key alias instead of the ARN as the KMS encryption key.</p>
327 /// <p>If an encryption key is not specified, Amazon DocumentDB uses the default encryption key that KMS creates for your account. Your account has a different default encryption key for each Amazon Region.</p>
328 pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
329 self.inner.get_kms_key_id()
330 }
331 /// <p>The client token for the elastic cluster.</p>
332 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
333 self.inner = self.inner.client_token(input.into());
334 self
335 }
336 /// <p>The client token for the elastic cluster.</p>
337 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
338 self.inner = self.inner.set_client_token(input);
339 self
340 }
341 /// <p>The client token for the elastic cluster.</p>
342 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
343 self.inner.get_client_token()
344 }
345 /// <p>The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).</p>
346 /// <p><i>Format</i>: <code>ddd:hh24:mi-ddd:hh24:mi</code></p>
347 /// <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>
348 /// <p><i>Valid days</i>: Mon, Tue, Wed, Thu, Fri, Sat, Sun</p>
349 /// <p><i>Constraints</i>: Minimum 30-minute window.</p>
350 pub fn preferred_maintenance_window(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
351 self.inner = self.inner.preferred_maintenance_window(input.into());
352 self
353 }
354 /// <p>The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).</p>
355 /// <p><i>Format</i>: <code>ddd:hh24:mi-ddd:hh24:mi</code></p>
356 /// <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>
357 /// <p><i>Valid days</i>: Mon, Tue, Wed, Thu, Fri, Sat, Sun</p>
358 /// <p><i>Constraints</i>: Minimum 30-minute window.</p>
359 pub fn set_preferred_maintenance_window(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
360 self.inner = self.inner.set_preferred_maintenance_window(input);
361 self
362 }
363 /// <p>The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).</p>
364 /// <p><i>Format</i>: <code>ddd:hh24:mi-ddd:hh24:mi</code></p>
365 /// <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>
366 /// <p><i>Valid days</i>: Mon, Tue, Wed, Thu, Fri, Sat, Sun</p>
367 /// <p><i>Constraints</i>: Minimum 30-minute window.</p>
368 pub fn get_preferred_maintenance_window(&self) -> &::std::option::Option<::std::string::String> {
369 self.inner.get_preferred_maintenance_window()
370 }
371 ///
372 /// Adds a key-value pair to `tags`.
373 ///
374 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
375 ///
376 /// <p>The tags to be assigned to the new elastic cluster.</p>
377 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
378 self.inner = self.inner.tags(k.into(), v.into());
379 self
380 }
381 /// <p>The tags to be assigned to the new elastic cluster.</p>
382 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
383 self.inner = self.inner.set_tags(input);
384 self
385 }
386 /// <p>The tags to be assigned to the new elastic cluster.</p>
387 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
388 self.inner.get_tags()
389 }
390 /// <p>The number of days for which automatic snapshots are retained.</p>
391 pub fn backup_retention_period(mut self, input: i32) -> Self {
392 self.inner = self.inner.backup_retention_period(input);
393 self
394 }
395 /// <p>The number of days for which automatic snapshots are retained.</p>
396 pub fn set_backup_retention_period(mut self, input: ::std::option::Option<i32>) -> Self {
397 self.inner = self.inner.set_backup_retention_period(input);
398 self
399 }
400 /// <p>The number of days for which automatic snapshots are retained.</p>
401 pub fn get_backup_retention_period(&self) -> &::std::option::Option<i32> {
402 self.inner.get_backup_retention_period()
403 }
404 /// <p>The daily time range during which automated backups are created if automated backups are enabled, as determined by the <code>backupRetentionPeriod</code>.</p>
405 pub fn preferred_backup_window(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
406 self.inner = self.inner.preferred_backup_window(input.into());
407 self
408 }
409 /// <p>The daily time range during which automated backups are created if automated backups are enabled, as determined by the <code>backupRetentionPeriod</code>.</p>
410 pub fn set_preferred_backup_window(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
411 self.inner = self.inner.set_preferred_backup_window(input);
412 self
413 }
414 /// <p>The daily time range during which automated backups are created if automated backups are enabled, as determined by the <code>backupRetentionPeriod</code>.</p>
415 pub fn get_preferred_backup_window(&self) -> &::std::option::Option<::std::string::String> {
416 self.inner.get_preferred_backup_window()
417 }
418 /// <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>
419 pub fn shard_instance_count(mut self, input: i32) -> Self {
420 self.inner = self.inner.shard_instance_count(input);
421 self
422 }
423 /// <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>
424 pub fn set_shard_instance_count(mut self, input: ::std::option::Option<i32>) -> Self {
425 self.inner = self.inner.set_shard_instance_count(input);
426 self
427 }
428 /// <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>
429 pub fn get_shard_instance_count(&self) -> &::std::option::Option<i32> {
430 self.inner.get_shard_instance_count()
431 }
432}