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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Represents the properties of a replica.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ReplicaSettingsDescription {
    /// <p>The Region name of the replica.</p>
    pub region_name: ::std::string::String,
    /// <p>The current state of the Region:</p>
    /// <ul>
    /// <li>
    /// <p><code>CREATING</code> - The Region is being created.</p></li>
    /// <li>
    /// <p><code>UPDATING</code> - The Region is being updated.</p></li>
    /// <li>
    /// <p><code>DELETING</code> - The Region is being deleted.</p></li>
    /// <li>
    /// <p><code>ACTIVE</code> - The Region is ready for use.</p></li>
    /// </ul>
    pub replica_status: ::std::option::Option<crate::types::ReplicaStatus>,
    /// <p>The read/write capacity mode of the replica.</p>
    pub replica_billing_mode_summary: ::std::option::Option<crate::types::BillingModeSummary>,
    /// <p>The maximum number of strongly consistent reads consumed per second before DynamoDB returns a <code>ThrottlingException</code>. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput">Specifying Read and Write Requirements</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
    pub replica_provisioned_read_capacity_units: ::std::option::Option<i64>,
    /// <p>Auto scaling settings for a global table replica's read capacity units.</p>
    pub replica_provisioned_read_capacity_auto_scaling_settings: ::std::option::Option<crate::types::AutoScalingSettingsDescription>,
    /// <p>The maximum number of writes consumed per second before DynamoDB returns a <code>ThrottlingException</code>. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput">Specifying Read and Write Requirements</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
    pub replica_provisioned_write_capacity_units: ::std::option::Option<i64>,
    /// <p>Auto scaling settings for a global table replica's write capacity units.</p>
    pub replica_provisioned_write_capacity_auto_scaling_settings: ::std::option::Option<crate::types::AutoScalingSettingsDescription>,
    /// <p>Replica global secondary index settings for the global table.</p>
    pub replica_global_secondary_index_settings: ::std::option::Option<::std::vec::Vec<crate::types::ReplicaGlobalSecondaryIndexSettingsDescription>>,
    /// <p>Contains details of the table class.</p>
    pub replica_table_class_summary: ::std::option::Option<crate::types::TableClassSummary>,
}
impl ReplicaSettingsDescription {
    /// <p>The Region name of the replica.</p>
    pub fn region_name(&self) -> &str {
        use std::ops::Deref;
        self.region_name.deref()
    }
    /// <p>The current state of the Region:</p>
    /// <ul>
    /// <li>
    /// <p><code>CREATING</code> - The Region is being created.</p></li>
    /// <li>
    /// <p><code>UPDATING</code> - The Region is being updated.</p></li>
    /// <li>
    /// <p><code>DELETING</code> - The Region is being deleted.</p></li>
    /// <li>
    /// <p><code>ACTIVE</code> - The Region is ready for use.</p></li>
    /// </ul>
    pub fn replica_status(&self) -> ::std::option::Option<&crate::types::ReplicaStatus> {
        self.replica_status.as_ref()
    }
    /// <p>The read/write capacity mode of the replica.</p>
    pub fn replica_billing_mode_summary(&self) -> ::std::option::Option<&crate::types::BillingModeSummary> {
        self.replica_billing_mode_summary.as_ref()
    }
    /// <p>The maximum number of strongly consistent reads consumed per second before DynamoDB returns a <code>ThrottlingException</code>. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput">Specifying Read and Write Requirements</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
    pub fn replica_provisioned_read_capacity_units(&self) -> ::std::option::Option<i64> {
        self.replica_provisioned_read_capacity_units
    }
    /// <p>Auto scaling settings for a global table replica's read capacity units.</p>
    pub fn replica_provisioned_read_capacity_auto_scaling_settings(&self) -> ::std::option::Option<&crate::types::AutoScalingSettingsDescription> {
        self.replica_provisioned_read_capacity_auto_scaling_settings.as_ref()
    }
    /// <p>The maximum number of writes consumed per second before DynamoDB returns a <code>ThrottlingException</code>. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput">Specifying Read and Write Requirements</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
    pub fn replica_provisioned_write_capacity_units(&self) -> ::std::option::Option<i64> {
        self.replica_provisioned_write_capacity_units
    }
    /// <p>Auto scaling settings for a global table replica's write capacity units.</p>
    pub fn replica_provisioned_write_capacity_auto_scaling_settings(&self) -> ::std::option::Option<&crate::types::AutoScalingSettingsDescription> {
        self.replica_provisioned_write_capacity_auto_scaling_settings.as_ref()
    }
    /// <p>Replica global secondary index settings for the global table.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.replica_global_secondary_index_settings.is_none()`.
    pub fn replica_global_secondary_index_settings(&self) -> &[crate::types::ReplicaGlobalSecondaryIndexSettingsDescription] {
        self.replica_global_secondary_index_settings.as_deref().unwrap_or_default()
    }
    /// <p>Contains details of the table class.</p>
    pub fn replica_table_class_summary(&self) -> ::std::option::Option<&crate::types::TableClassSummary> {
        self.replica_table_class_summary.as_ref()
    }
}
impl ReplicaSettingsDescription {
    /// Creates a new builder-style object to manufacture [`ReplicaSettingsDescription`](crate::types::ReplicaSettingsDescription).
    pub fn builder() -> crate::types::builders::ReplicaSettingsDescriptionBuilder {
        crate::types::builders::ReplicaSettingsDescriptionBuilder::default()
    }
}

/// A builder for [`ReplicaSettingsDescription`](crate::types::ReplicaSettingsDescription).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ReplicaSettingsDescriptionBuilder {
    pub(crate) region_name: ::std::option::Option<::std::string::String>,
    pub(crate) replica_status: ::std::option::Option<crate::types::ReplicaStatus>,
    pub(crate) replica_billing_mode_summary: ::std::option::Option<crate::types::BillingModeSummary>,
    pub(crate) replica_provisioned_read_capacity_units: ::std::option::Option<i64>,
    pub(crate) replica_provisioned_read_capacity_auto_scaling_settings: ::std::option::Option<crate::types::AutoScalingSettingsDescription>,
    pub(crate) replica_provisioned_write_capacity_units: ::std::option::Option<i64>,
    pub(crate) replica_provisioned_write_capacity_auto_scaling_settings: ::std::option::Option<crate::types::AutoScalingSettingsDescription>,
    pub(crate) replica_global_secondary_index_settings:
        ::std::option::Option<::std::vec::Vec<crate::types::ReplicaGlobalSecondaryIndexSettingsDescription>>,
    pub(crate) replica_table_class_summary: ::std::option::Option<crate::types::TableClassSummary>,
}
impl ReplicaSettingsDescriptionBuilder {
    /// <p>The Region name of the replica.</p>
    /// This field is required.
    pub fn region_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.region_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Region name of the replica.</p>
    pub fn set_region_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.region_name = input;
        self
    }
    /// <p>The Region name of the replica.</p>
    pub fn get_region_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.region_name
    }
    /// <p>The current state of the Region:</p>
    /// <ul>
    /// <li>
    /// <p><code>CREATING</code> - The Region is being created.</p></li>
    /// <li>
    /// <p><code>UPDATING</code> - The Region is being updated.</p></li>
    /// <li>
    /// <p><code>DELETING</code> - The Region is being deleted.</p></li>
    /// <li>
    /// <p><code>ACTIVE</code> - The Region is ready for use.</p></li>
    /// </ul>
    pub fn replica_status(mut self, input: crate::types::ReplicaStatus) -> Self {
        self.replica_status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The current state of the Region:</p>
    /// <ul>
    /// <li>
    /// <p><code>CREATING</code> - The Region is being created.</p></li>
    /// <li>
    /// <p><code>UPDATING</code> - The Region is being updated.</p></li>
    /// <li>
    /// <p><code>DELETING</code> - The Region is being deleted.</p></li>
    /// <li>
    /// <p><code>ACTIVE</code> - The Region is ready for use.</p></li>
    /// </ul>
    pub fn set_replica_status(mut self, input: ::std::option::Option<crate::types::ReplicaStatus>) -> Self {
        self.replica_status = input;
        self
    }
    /// <p>The current state of the Region:</p>
    /// <ul>
    /// <li>
    /// <p><code>CREATING</code> - The Region is being created.</p></li>
    /// <li>
    /// <p><code>UPDATING</code> - The Region is being updated.</p></li>
    /// <li>
    /// <p><code>DELETING</code> - The Region is being deleted.</p></li>
    /// <li>
    /// <p><code>ACTIVE</code> - The Region is ready for use.</p></li>
    /// </ul>
    pub fn get_replica_status(&self) -> &::std::option::Option<crate::types::ReplicaStatus> {
        &self.replica_status
    }
    /// <p>The read/write capacity mode of the replica.</p>
    pub fn replica_billing_mode_summary(mut self, input: crate::types::BillingModeSummary) -> Self {
        self.replica_billing_mode_summary = ::std::option::Option::Some(input);
        self
    }
    /// <p>The read/write capacity mode of the replica.</p>
    pub fn set_replica_billing_mode_summary(mut self, input: ::std::option::Option<crate::types::BillingModeSummary>) -> Self {
        self.replica_billing_mode_summary = input;
        self
    }
    /// <p>The read/write capacity mode of the replica.</p>
    pub fn get_replica_billing_mode_summary(&self) -> &::std::option::Option<crate::types::BillingModeSummary> {
        &self.replica_billing_mode_summary
    }
    /// <p>The maximum number of strongly consistent reads consumed per second before DynamoDB returns a <code>ThrottlingException</code>. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput">Specifying Read and Write Requirements</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
    pub fn replica_provisioned_read_capacity_units(mut self, input: i64) -> Self {
        self.replica_provisioned_read_capacity_units = ::std::option::Option::Some(input);
        self
    }
    /// <p>The maximum number of strongly consistent reads consumed per second before DynamoDB returns a <code>ThrottlingException</code>. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput">Specifying Read and Write Requirements</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
    pub fn set_replica_provisioned_read_capacity_units(mut self, input: ::std::option::Option<i64>) -> Self {
        self.replica_provisioned_read_capacity_units = input;
        self
    }
    /// <p>The maximum number of strongly consistent reads consumed per second before DynamoDB returns a <code>ThrottlingException</code>. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput">Specifying Read and Write Requirements</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
    pub fn get_replica_provisioned_read_capacity_units(&self) -> &::std::option::Option<i64> {
        &self.replica_provisioned_read_capacity_units
    }
    /// <p>Auto scaling settings for a global table replica's read capacity units.</p>
    pub fn replica_provisioned_read_capacity_auto_scaling_settings(mut self, input: crate::types::AutoScalingSettingsDescription) -> Self {
        self.replica_provisioned_read_capacity_auto_scaling_settings = ::std::option::Option::Some(input);
        self
    }
    /// <p>Auto scaling settings for a global table replica's read capacity units.</p>
    pub fn set_replica_provisioned_read_capacity_auto_scaling_settings(
        mut self,
        input: ::std::option::Option<crate::types::AutoScalingSettingsDescription>,
    ) -> Self {
        self.replica_provisioned_read_capacity_auto_scaling_settings = input;
        self
    }
    /// <p>Auto scaling settings for a global table replica's read capacity units.</p>
    pub fn get_replica_provisioned_read_capacity_auto_scaling_settings(
        &self,
    ) -> &::std::option::Option<crate::types::AutoScalingSettingsDescription> {
        &self.replica_provisioned_read_capacity_auto_scaling_settings
    }
    /// <p>The maximum number of writes consumed per second before DynamoDB returns a <code>ThrottlingException</code>. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput">Specifying Read and Write Requirements</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
    pub fn replica_provisioned_write_capacity_units(mut self, input: i64) -> Self {
        self.replica_provisioned_write_capacity_units = ::std::option::Option::Some(input);
        self
    }
    /// <p>The maximum number of writes consumed per second before DynamoDB returns a <code>ThrottlingException</code>. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput">Specifying Read and Write Requirements</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
    pub fn set_replica_provisioned_write_capacity_units(mut self, input: ::std::option::Option<i64>) -> Self {
        self.replica_provisioned_write_capacity_units = input;
        self
    }
    /// <p>The maximum number of writes consumed per second before DynamoDB returns a <code>ThrottlingException</code>. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput">Specifying Read and Write Requirements</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
    pub fn get_replica_provisioned_write_capacity_units(&self) -> &::std::option::Option<i64> {
        &self.replica_provisioned_write_capacity_units
    }
    /// <p>Auto scaling settings for a global table replica's write capacity units.</p>
    pub fn replica_provisioned_write_capacity_auto_scaling_settings(mut self, input: crate::types::AutoScalingSettingsDescription) -> Self {
        self.replica_provisioned_write_capacity_auto_scaling_settings = ::std::option::Option::Some(input);
        self
    }
    /// <p>Auto scaling settings for a global table replica's write capacity units.</p>
    pub fn set_replica_provisioned_write_capacity_auto_scaling_settings(
        mut self,
        input: ::std::option::Option<crate::types::AutoScalingSettingsDescription>,
    ) -> Self {
        self.replica_provisioned_write_capacity_auto_scaling_settings = input;
        self
    }
    /// <p>Auto scaling settings for a global table replica's write capacity units.</p>
    pub fn get_replica_provisioned_write_capacity_auto_scaling_settings(
        &self,
    ) -> &::std::option::Option<crate::types::AutoScalingSettingsDescription> {
        &self.replica_provisioned_write_capacity_auto_scaling_settings
    }
    /// Appends an item to `replica_global_secondary_index_settings`.
    ///
    /// To override the contents of this collection use [`set_replica_global_secondary_index_settings`](Self::set_replica_global_secondary_index_settings).
    ///
    /// <p>Replica global secondary index settings for the global table.</p>
    pub fn replica_global_secondary_index_settings(mut self, input: crate::types::ReplicaGlobalSecondaryIndexSettingsDescription) -> Self {
        let mut v = self.replica_global_secondary_index_settings.unwrap_or_default();
        v.push(input);
        self.replica_global_secondary_index_settings = ::std::option::Option::Some(v);
        self
    }
    /// <p>Replica global secondary index settings for the global table.</p>
    pub fn set_replica_global_secondary_index_settings(
        mut self,
        input: ::std::option::Option<::std::vec::Vec<crate::types::ReplicaGlobalSecondaryIndexSettingsDescription>>,
    ) -> Self {
        self.replica_global_secondary_index_settings = input;
        self
    }
    /// <p>Replica global secondary index settings for the global table.</p>
    pub fn get_replica_global_secondary_index_settings(
        &self,
    ) -> &::std::option::Option<::std::vec::Vec<crate::types::ReplicaGlobalSecondaryIndexSettingsDescription>> {
        &self.replica_global_secondary_index_settings
    }
    /// <p>Contains details of the table class.</p>
    pub fn replica_table_class_summary(mut self, input: crate::types::TableClassSummary) -> Self {
        self.replica_table_class_summary = ::std::option::Option::Some(input);
        self
    }
    /// <p>Contains details of the table class.</p>
    pub fn set_replica_table_class_summary(mut self, input: ::std::option::Option<crate::types::TableClassSummary>) -> Self {
        self.replica_table_class_summary = input;
        self
    }
    /// <p>Contains details of the table class.</p>
    pub fn get_replica_table_class_summary(&self) -> &::std::option::Option<crate::types::TableClassSummary> {
        &self.replica_table_class_summary
    }
    /// Consumes the builder and constructs a [`ReplicaSettingsDescription`](crate::types::ReplicaSettingsDescription).
    /// This method will fail if any of the following fields are not set:
    /// - [`region_name`](crate::types::builders::ReplicaSettingsDescriptionBuilder::region_name)
    pub fn build(self) -> ::std::result::Result<crate::types::ReplicaSettingsDescription, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::ReplicaSettingsDescription {
            region_name: self.region_name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "region_name",
                    "region_name was not specified but it is required when building ReplicaSettingsDescription",
                )
            })?,
            replica_status: self.replica_status,
            replica_billing_mode_summary: self.replica_billing_mode_summary,
            replica_provisioned_read_capacity_units: self.replica_provisioned_read_capacity_units,
            replica_provisioned_read_capacity_auto_scaling_settings: self.replica_provisioned_read_capacity_auto_scaling_settings,
            replica_provisioned_write_capacity_units: self.replica_provisioned_write_capacity_units,
            replica_provisioned_write_capacity_auto_scaling_settings: self.replica_provisioned_write_capacity_auto_scaling_settings,
            replica_global_secondary_index_settings: self.replica_global_secondary_index_settings,
            replica_table_class_summary: self.replica_table_class_summary,
        })
    }
}