1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Returns information about a specific Elastic DocumentDB cluster.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Cluster {
/// <p>The name of the Elastic DocumentDB cluster.</p>
pub cluster_name: ::std::string::String,
/// <p>The arn of the Elastic DocumentDB cluster.</p>
pub cluster_arn: ::std::string::String,
/// <p>The status of the Elastic DocumentDB cluster.</p>
pub status: crate::types::Status,
/// <p>The URL used to connect to the Elastic DocumentDB cluster.</p>
pub cluster_endpoint: ::std::string::String,
/// <p>The time when the Elastic DocumentDB cluster was created in Universal Coordinated Time (UTC).</p>
pub create_time: ::std::string::String,
/// <p>The name of the Elastic DocumentDB cluster administrator.</p>
pub admin_user_name: ::std::string::String,
/// <p>The authentication type for the Elastic DocumentDB cluster.</p>
pub auth_type: crate::types::Auth,
/// <p>The capacity of each shard in the Elastic DocumentDB cluster.</p>
pub shard_capacity: i32,
/// <p>The number of shards in the Elastic DocumentDB cluster.</p>
pub shard_count: i32,
/// <p>A list of EC2 VPC security groups associated with this cluster.</p>
pub vpc_security_group_ids: ::std::vec::Vec<::std::string::String>,
/// <p>The Amazon EC2 subnet IDs for the Elastic DocumentDB cluster.</p>
pub subnet_ids: ::std::vec::Vec<::std::string::String>,
/// <p>The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).</p>
/// <p> <i>Format</i>: <code>ddd:hh24:mi-ddd:hh24:mi</code> </p>
pub preferred_maintenance_window: ::std::string::String,
/// <p>The KMS key identifier to use to encrypt the Elastic DocumentDB cluster.</p>
pub kms_key_id: ::std::string::String,
}
impl Cluster {
/// <p>The name of the Elastic DocumentDB cluster.</p>
pub fn cluster_name(&self) -> &str {
use std::ops::Deref;
self.cluster_name.deref()
}
/// <p>The arn of the Elastic DocumentDB cluster.</p>
pub fn cluster_arn(&self) -> &str {
use std::ops::Deref;
self.cluster_arn.deref()
}
/// <p>The status of the Elastic DocumentDB cluster.</p>
pub fn status(&self) -> &crate::types::Status {
&self.status
}
/// <p>The URL used to connect to the Elastic DocumentDB cluster.</p>
pub fn cluster_endpoint(&self) -> &str {
use std::ops::Deref;
self.cluster_endpoint.deref()
}
/// <p>The time when the Elastic DocumentDB cluster was created in Universal Coordinated Time (UTC).</p>
pub fn create_time(&self) -> &str {
use std::ops::Deref;
self.create_time.deref()
}
/// <p>The name of the Elastic DocumentDB cluster administrator.</p>
pub fn admin_user_name(&self) -> &str {
use std::ops::Deref;
self.admin_user_name.deref()
}
/// <p>The authentication type for the Elastic DocumentDB cluster.</p>
pub fn auth_type(&self) -> &crate::types::Auth {
&self.auth_type
}
/// <p>The capacity of each shard in the Elastic DocumentDB cluster.</p>
pub fn shard_capacity(&self) -> i32 {
self.shard_capacity
}
/// <p>The number of shards in the Elastic DocumentDB cluster.</p>
pub fn shard_count(&self) -> i32 {
self.shard_count
}
/// <p>A list of EC2 VPC security groups associated with this cluster.</p>
pub fn vpc_security_group_ids(&self) -> &[::std::string::String] {
use std::ops::Deref;
self.vpc_security_group_ids.deref()
}
/// <p>The Amazon EC2 subnet IDs for the Elastic DocumentDB cluster.</p>
pub fn subnet_ids(&self) -> &[::std::string::String] {
use std::ops::Deref;
self.subnet_ids.deref()
}
/// <p>The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).</p>
/// <p> <i>Format</i>: <code>ddd:hh24:mi-ddd:hh24:mi</code> </p>
pub fn preferred_maintenance_window(&self) -> &str {
use std::ops::Deref;
self.preferred_maintenance_window.deref()
}
/// <p>The KMS key identifier to use to encrypt the Elastic DocumentDB cluster.</p>
pub fn kms_key_id(&self) -> &str {
use std::ops::Deref;
self.kms_key_id.deref()
}
}
impl Cluster {
/// Creates a new builder-style object to manufacture [`Cluster`](crate::types::Cluster).
pub fn builder() -> crate::types::builders::ClusterBuilder {
crate::types::builders::ClusterBuilder::default()
}
}
/// A builder for [`Cluster`](crate::types::Cluster).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ClusterBuilder {
pub(crate) cluster_name: ::std::option::Option<::std::string::String>,
pub(crate) cluster_arn: ::std::option::Option<::std::string::String>,
pub(crate) status: ::std::option::Option<crate::types::Status>,
pub(crate) cluster_endpoint: ::std::option::Option<::std::string::String>,
pub(crate) create_time: ::std::option::Option<::std::string::String>,
pub(crate) admin_user_name: ::std::option::Option<::std::string::String>,
pub(crate) auth_type: ::std::option::Option<crate::types::Auth>,
pub(crate) shard_capacity: ::std::option::Option<i32>,
pub(crate) shard_count: ::std::option::Option<i32>,
pub(crate) vpc_security_group_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) subnet_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) preferred_maintenance_window: ::std::option::Option<::std::string::String>,
pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
}
impl ClusterBuilder {
/// <p>The name of the Elastic DocumentDB cluster.</p>
/// This field is required.
pub fn cluster_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.cluster_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the Elastic DocumentDB cluster.</p>
pub fn set_cluster_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.cluster_name = input;
self
}
/// <p>The name of the Elastic DocumentDB cluster.</p>
pub fn get_cluster_name(&self) -> &::std::option::Option<::std::string::String> {
&self.cluster_name
}
/// <p>The arn of the Elastic DocumentDB cluster.</p>
/// This field is required.
pub fn cluster_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.cluster_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The arn of the Elastic DocumentDB cluster.</p>
pub fn set_cluster_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.cluster_arn = input;
self
}
/// <p>The arn of the Elastic DocumentDB cluster.</p>
pub fn get_cluster_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.cluster_arn
}
/// <p>The status of the Elastic DocumentDB cluster.</p>
/// This field is required.
pub fn status(mut self, input: crate::types::Status) -> Self {
self.status = ::std::option::Option::Some(input);
self
}
/// <p>The status of the Elastic DocumentDB cluster.</p>
pub fn set_status(mut self, input: ::std::option::Option<crate::types::Status>) -> Self {
self.status = input;
self
}
/// <p>The status of the Elastic DocumentDB cluster.</p>
pub fn get_status(&self) -> &::std::option::Option<crate::types::Status> {
&self.status
}
/// <p>The URL used to connect to the Elastic DocumentDB cluster.</p>
/// This field is required.
pub fn cluster_endpoint(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.cluster_endpoint = ::std::option::Option::Some(input.into());
self
}
/// <p>The URL used to connect to the Elastic DocumentDB cluster.</p>
pub fn set_cluster_endpoint(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.cluster_endpoint = input;
self
}
/// <p>The URL used to connect to the Elastic DocumentDB cluster.</p>
pub fn get_cluster_endpoint(&self) -> &::std::option::Option<::std::string::String> {
&self.cluster_endpoint
}
/// <p>The time when the Elastic DocumentDB cluster was created in Universal Coordinated Time (UTC).</p>
/// This field is required.
pub fn create_time(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.create_time = ::std::option::Option::Some(input.into());
self
}
/// <p>The time when the Elastic DocumentDB cluster was created in Universal Coordinated Time (UTC).</p>
pub fn set_create_time(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.create_time = input;
self
}
/// <p>The time when the Elastic DocumentDB cluster was created in Universal Coordinated Time (UTC).</p>
pub fn get_create_time(&self) -> &::std::option::Option<::std::string::String> {
&self.create_time
}
/// <p>The name of the Elastic DocumentDB cluster administrator.</p>
/// This field is required.
pub fn admin_user_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.admin_user_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the Elastic DocumentDB cluster administrator.</p>
pub fn set_admin_user_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.admin_user_name = input;
self
}
/// <p>The name of the Elastic DocumentDB cluster administrator.</p>
pub fn get_admin_user_name(&self) -> &::std::option::Option<::std::string::String> {
&self.admin_user_name
}
/// <p>The authentication type for the Elastic DocumentDB cluster.</p>
/// This field is required.
pub fn auth_type(mut self, input: crate::types::Auth) -> Self {
self.auth_type = ::std::option::Option::Some(input);
self
}
/// <p>The authentication type for the Elastic DocumentDB cluster.</p>
pub fn set_auth_type(mut self, input: ::std::option::Option<crate::types::Auth>) -> Self {
self.auth_type = input;
self
}
/// <p>The authentication type for the Elastic DocumentDB cluster.</p>
pub fn get_auth_type(&self) -> &::std::option::Option<crate::types::Auth> {
&self.auth_type
}
/// <p>The capacity of each shard in the Elastic DocumentDB cluster.</p>
/// This field is required.
pub fn shard_capacity(mut self, input: i32) -> Self {
self.shard_capacity = ::std::option::Option::Some(input);
self
}
/// <p>The capacity of each shard in the Elastic DocumentDB cluster.</p>
pub fn set_shard_capacity(mut self, input: ::std::option::Option<i32>) -> Self {
self.shard_capacity = input;
self
}
/// <p>The capacity of each shard in the Elastic DocumentDB cluster.</p>
pub fn get_shard_capacity(&self) -> &::std::option::Option<i32> {
&self.shard_capacity
}
/// <p>The number of shards in the Elastic DocumentDB cluster.</p>
/// This field is required.
pub fn shard_count(mut self, input: i32) -> Self {
self.shard_count = ::std::option::Option::Some(input);
self
}
/// <p>The number of shards in the Elastic DocumentDB cluster.</p>
pub fn set_shard_count(mut self, input: ::std::option::Option<i32>) -> Self {
self.shard_count = input;
self
}
/// <p>The number of shards in the Elastic DocumentDB cluster.</p>
pub fn get_shard_count(&self) -> &::std::option::Option<i32> {
&self.shard_count
}
/// Appends an item to `vpc_security_group_ids`.
///
/// To override the contents of this collection use [`set_vpc_security_group_ids`](Self::set_vpc_security_group_ids).
///
/// <p>A list of EC2 VPC security groups associated with this cluster.</p>
pub fn vpc_security_group_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.vpc_security_group_ids.unwrap_or_default();
v.push(input.into());
self.vpc_security_group_ids = ::std::option::Option::Some(v);
self
}
/// <p>A list of EC2 VPC security groups associated with this cluster.</p>
pub fn set_vpc_security_group_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.vpc_security_group_ids = input;
self
}
/// <p>A list of EC2 VPC security groups associated with this cluster.</p>
pub fn get_vpc_security_group_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.vpc_security_group_ids
}
/// Appends an item to `subnet_ids`.
///
/// To override the contents of this collection use [`set_subnet_ids`](Self::set_subnet_ids).
///
/// <p>The Amazon EC2 subnet IDs for the Elastic DocumentDB cluster.</p>
pub fn subnet_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.subnet_ids.unwrap_or_default();
v.push(input.into());
self.subnet_ids = ::std::option::Option::Some(v);
self
}
/// <p>The Amazon EC2 subnet IDs for the Elastic DocumentDB cluster.</p>
pub fn set_subnet_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.subnet_ids = input;
self
}
/// <p>The Amazon EC2 subnet IDs for the Elastic DocumentDB cluster.</p>
pub fn get_subnet_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.subnet_ids
}
/// <p>The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).</p>
/// <p> <i>Format</i>: <code>ddd:hh24:mi-ddd:hh24:mi</code> </p>
/// This field is required.
pub fn preferred_maintenance_window(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.preferred_maintenance_window = ::std::option::Option::Some(input.into());
self
}
/// <p>The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).</p>
/// <p> <i>Format</i>: <code>ddd:hh24:mi-ddd:hh24:mi</code> </p>
pub fn set_preferred_maintenance_window(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.preferred_maintenance_window = input;
self
}
/// <p>The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).</p>
/// <p> <i>Format</i>: <code>ddd:hh24:mi-ddd:hh24:mi</code> </p>
pub fn get_preferred_maintenance_window(&self) -> &::std::option::Option<::std::string::String> {
&self.preferred_maintenance_window
}
/// <p>The KMS key identifier to use to encrypt the Elastic DocumentDB cluster.</p>
/// This field is required.
pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.kms_key_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The KMS key identifier to use to encrypt the Elastic DocumentDB cluster.</p>
pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.kms_key_id = input;
self
}
/// <p>The KMS key identifier to use to encrypt the Elastic DocumentDB cluster.</p>
pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
&self.kms_key_id
}
/// Consumes the builder and constructs a [`Cluster`](crate::types::Cluster).
/// This method will fail if any of the following fields are not set:
/// - [`cluster_name`](crate::types::builders::ClusterBuilder::cluster_name)
/// - [`cluster_arn`](crate::types::builders::ClusterBuilder::cluster_arn)
/// - [`status`](crate::types::builders::ClusterBuilder::status)
/// - [`cluster_endpoint`](crate::types::builders::ClusterBuilder::cluster_endpoint)
/// - [`create_time`](crate::types::builders::ClusterBuilder::create_time)
/// - [`admin_user_name`](crate::types::builders::ClusterBuilder::admin_user_name)
/// - [`auth_type`](crate::types::builders::ClusterBuilder::auth_type)
/// - [`shard_capacity`](crate::types::builders::ClusterBuilder::shard_capacity)
/// - [`shard_count`](crate::types::builders::ClusterBuilder::shard_count)
/// - [`vpc_security_group_ids`](crate::types::builders::ClusterBuilder::vpc_security_group_ids)
/// - [`subnet_ids`](crate::types::builders::ClusterBuilder::subnet_ids)
/// - [`preferred_maintenance_window`](crate::types::builders::ClusterBuilder::preferred_maintenance_window)
/// - [`kms_key_id`](crate::types::builders::ClusterBuilder::kms_key_id)
pub fn build(self) -> ::std::result::Result<crate::types::Cluster, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Cluster {
cluster_name: self.cluster_name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"cluster_name",
"cluster_name was not specified but it is required when building Cluster",
)
})?,
cluster_arn: self.cluster_arn.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"cluster_arn",
"cluster_arn was not specified but it is required when building Cluster",
)
})?,
status: self.status.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"status",
"status was not specified but it is required when building Cluster",
)
})?,
cluster_endpoint: self.cluster_endpoint.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"cluster_endpoint",
"cluster_endpoint was not specified but it is required when building Cluster",
)
})?,
create_time: self.create_time.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"create_time",
"create_time was not specified but it is required when building Cluster",
)
})?,
admin_user_name: self.admin_user_name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"admin_user_name",
"admin_user_name was not specified but it is required when building Cluster",
)
})?,
auth_type: self.auth_type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"auth_type",
"auth_type was not specified but it is required when building Cluster",
)
})?,
shard_capacity: self.shard_capacity.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"shard_capacity",
"shard_capacity was not specified but it is required when building Cluster",
)
})?,
shard_count: self.shard_count.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"shard_count",
"shard_count was not specified but it is required when building Cluster",
)
})?,
vpc_security_group_ids: self.vpc_security_group_ids.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"vpc_security_group_ids",
"vpc_security_group_ids was not specified but it is required when building Cluster",
)
})?,
subnet_ids: self.subnet_ids.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"subnet_ids",
"subnet_ids was not specified but it is required when building Cluster",
)
})?,
preferred_maintenance_window: self.preferred_maintenance_window.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"preferred_maintenance_window",
"preferred_maintenance_window was not specified but it is required when building Cluster",
)
})?,
kms_key_id: self.kms_key_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"kms_key_id",
"kms_key_id was not specified but it is required when building Cluster",
)
})?,
})
}
}