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

/// <p>Represents the input of an <code>UpdateTable</code> operation.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateTableInput {
    /// <p>An array of attributes that describe the key schema for the table and indexes. If you are adding a new global secondary index to the table, <code>AttributeDefinitions</code> must include the key element(s) of the new index.</p>
    #[doc(hidden)]
    pub attribute_definitions:
        std::option::Option<std::vec::Vec<crate::types::AttributeDefinition>>,
    /// <p>The name of the table to be updated.</p>
    #[doc(hidden)]
    pub table_name: std::option::Option<std::string::String>,
    /// <p>Controls how you are charged for read and write throughput and how you manage capacity. When switching from pay-per-request to provisioned capacity, initial provisioned capacity values must be set. The initial provisioned capacity values are estimated based on the consumed read and write capacity of your table and global secondary indexes over the past 30 minutes.</p>
    /// <ul>
    /// <li> <p> <code>PROVISIONED</code> - We recommend using <code>PROVISIONED</code> for predictable workloads. <code>PROVISIONED</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html#HowItWorks.ProvisionedThroughput.Manual">Provisioned Mode</a>.</p> </li>
    /// <li> <p> <code>PAY_PER_REQUEST</code> - We recommend using <code>PAY_PER_REQUEST</code> for unpredictable workloads. <code>PAY_PER_REQUEST</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html#HowItWorks.OnDemand">On-Demand Mode</a>. </p> </li>
    /// </ul>
    #[doc(hidden)]
    pub billing_mode: std::option::Option<crate::types::BillingMode>,
    /// <p>The new provisioned throughput settings for the specified table or index.</p>
    #[doc(hidden)]
    pub provisioned_throughput: std::option::Option<crate::types::ProvisionedThroughput>,
    /// <p>An array of one or more global secondary indexes for the table. For each index in the array, you can request one action:</p>
    /// <ul>
    /// <li> <p> <code>Create</code> - add a new global secondary index to the table.</p> </li>
    /// <li> <p> <code>Update</code> - modify the provisioned throughput settings of an existing global secondary index.</p> </li>
    /// <li> <p> <code>Delete</code> - remove a global secondary index from the table.</p> </li>
    /// </ul>
    /// <p>You can create or delete only one global secondary index per <code>UpdateTable</code> operation.</p>
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.OnlineOps.html">Managing Global Secondary Indexes</a> in the <i>Amazon DynamoDB Developer Guide</i>. </p>
    #[doc(hidden)]
    pub global_secondary_index_updates:
        std::option::Option<std::vec::Vec<crate::types::GlobalSecondaryIndexUpdate>>,
    /// <p>Represents the DynamoDB Streams configuration for the table.</p> <note>
    /// <p>You receive a <code>ResourceInUseException</code> if you try to enable a stream on a table that already has a stream, or if you try to disable a stream on a table that doesn't have a stream.</p>
    /// </note>
    #[doc(hidden)]
    pub stream_specification: std::option::Option<crate::types::StreamSpecification>,
    /// <p>The new server-side encryption settings for the specified table.</p>
    #[doc(hidden)]
    pub sse_specification: std::option::Option<crate::types::SseSpecification>,
    /// <p>A list of replica update actions (create, delete, or update) for the table.</p> <note>
    /// <p>This property only applies to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/globaltables.V2.html">Version 2019.11.21 (Current)</a> of global tables. </p>
    /// </note>
    #[doc(hidden)]
    pub replica_updates: std::option::Option<std::vec::Vec<crate::types::ReplicationGroupUpdate>>,
    /// <p>The table class of the table to be updated. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
    #[doc(hidden)]
    pub table_class: std::option::Option<crate::types::TableClass>,
    /// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
    #[doc(hidden)]
    pub deletion_protection_enabled: std::option::Option<bool>,
}
impl UpdateTableInput {
    /// <p>An array of attributes that describe the key schema for the table and indexes. If you are adding a new global secondary index to the table, <code>AttributeDefinitions</code> must include the key element(s) of the new index.</p>
    pub fn attribute_definitions(
        &self,
    ) -> std::option::Option<&[crate::types::AttributeDefinition]> {
        self.attribute_definitions.as_deref()
    }
    /// <p>The name of the table to be updated.</p>
    pub fn table_name(&self) -> std::option::Option<&str> {
        self.table_name.as_deref()
    }
    /// <p>Controls how you are charged for read and write throughput and how you manage capacity. When switching from pay-per-request to provisioned capacity, initial provisioned capacity values must be set. The initial provisioned capacity values are estimated based on the consumed read and write capacity of your table and global secondary indexes over the past 30 minutes.</p>
    /// <ul>
    /// <li> <p> <code>PROVISIONED</code> - We recommend using <code>PROVISIONED</code> for predictable workloads. <code>PROVISIONED</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html#HowItWorks.ProvisionedThroughput.Manual">Provisioned Mode</a>.</p> </li>
    /// <li> <p> <code>PAY_PER_REQUEST</code> - We recommend using <code>PAY_PER_REQUEST</code> for unpredictable workloads. <code>PAY_PER_REQUEST</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html#HowItWorks.OnDemand">On-Demand Mode</a>. </p> </li>
    /// </ul>
    pub fn billing_mode(&self) -> std::option::Option<&crate::types::BillingMode> {
        self.billing_mode.as_ref()
    }
    /// <p>The new provisioned throughput settings for the specified table or index.</p>
    pub fn provisioned_throughput(
        &self,
    ) -> std::option::Option<&crate::types::ProvisionedThroughput> {
        self.provisioned_throughput.as_ref()
    }
    /// <p>An array of one or more global secondary indexes for the table. For each index in the array, you can request one action:</p>
    /// <ul>
    /// <li> <p> <code>Create</code> - add a new global secondary index to the table.</p> </li>
    /// <li> <p> <code>Update</code> - modify the provisioned throughput settings of an existing global secondary index.</p> </li>
    /// <li> <p> <code>Delete</code> - remove a global secondary index from the table.</p> </li>
    /// </ul>
    /// <p>You can create or delete only one global secondary index per <code>UpdateTable</code> operation.</p>
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.OnlineOps.html">Managing Global Secondary Indexes</a> in the <i>Amazon DynamoDB Developer Guide</i>. </p>
    pub fn global_secondary_index_updates(
        &self,
    ) -> std::option::Option<&[crate::types::GlobalSecondaryIndexUpdate]> {
        self.global_secondary_index_updates.as_deref()
    }
    /// <p>Represents the DynamoDB Streams configuration for the table.</p> <note>
    /// <p>You receive a <code>ResourceInUseException</code> if you try to enable a stream on a table that already has a stream, or if you try to disable a stream on a table that doesn't have a stream.</p>
    /// </note>
    pub fn stream_specification(&self) -> std::option::Option<&crate::types::StreamSpecification> {
        self.stream_specification.as_ref()
    }
    /// <p>The new server-side encryption settings for the specified table.</p>
    pub fn sse_specification(&self) -> std::option::Option<&crate::types::SseSpecification> {
        self.sse_specification.as_ref()
    }
    /// <p>A list of replica update actions (create, delete, or update) for the table.</p> <note>
    /// <p>This property only applies to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/globaltables.V2.html">Version 2019.11.21 (Current)</a> of global tables. </p>
    /// </note>
    pub fn replica_updates(&self) -> std::option::Option<&[crate::types::ReplicationGroupUpdate]> {
        self.replica_updates.as_deref()
    }
    /// <p>The table class of the table to be updated. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
    pub fn table_class(&self) -> std::option::Option<&crate::types::TableClass> {
        self.table_class.as_ref()
    }
    /// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
    pub fn deletion_protection_enabled(&self) -> std::option::Option<bool> {
        self.deletion_protection_enabled
    }
}
impl UpdateTableInput {
    /// Creates a new builder-style object to manufacture [`UpdateTableInput`](crate::operation::update_table::UpdateTableInput).
    pub fn builder() -> crate::operation::update_table::builders::UpdateTableInputBuilder {
        crate::operation::update_table::builders::UpdateTableInputBuilder::default()
    }
}

/// A builder for [`UpdateTableInput`](crate::operation::update_table::UpdateTableInput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct UpdateTableInputBuilder {
    pub(crate) attribute_definitions:
        std::option::Option<std::vec::Vec<crate::types::AttributeDefinition>>,
    pub(crate) table_name: std::option::Option<std::string::String>,
    pub(crate) billing_mode: std::option::Option<crate::types::BillingMode>,
    pub(crate) provisioned_throughput: std::option::Option<crate::types::ProvisionedThroughput>,
    pub(crate) global_secondary_index_updates:
        std::option::Option<std::vec::Vec<crate::types::GlobalSecondaryIndexUpdate>>,
    pub(crate) stream_specification: std::option::Option<crate::types::StreamSpecification>,
    pub(crate) sse_specification: std::option::Option<crate::types::SseSpecification>,
    pub(crate) replica_updates:
        std::option::Option<std::vec::Vec<crate::types::ReplicationGroupUpdate>>,
    pub(crate) table_class: std::option::Option<crate::types::TableClass>,
    pub(crate) deletion_protection_enabled: std::option::Option<bool>,
}
impl UpdateTableInputBuilder {
    /// Appends an item to `attribute_definitions`.
    ///
    /// To override the contents of this collection use [`set_attribute_definitions`](Self::set_attribute_definitions).
    ///
    /// <p>An array of attributes that describe the key schema for the table and indexes. If you are adding a new global secondary index to the table, <code>AttributeDefinitions</code> must include the key element(s) of the new index.</p>
    pub fn attribute_definitions(mut self, input: crate::types::AttributeDefinition) -> Self {
        let mut v = self.attribute_definitions.unwrap_or_default();
        v.push(input);
        self.attribute_definitions = Some(v);
        self
    }
    /// <p>An array of attributes that describe the key schema for the table and indexes. If you are adding a new global secondary index to the table, <code>AttributeDefinitions</code> must include the key element(s) of the new index.</p>
    pub fn set_attribute_definitions(
        mut self,
        input: std::option::Option<std::vec::Vec<crate::types::AttributeDefinition>>,
    ) -> Self {
        self.attribute_definitions = input;
        self
    }
    /// <p>The name of the table to be updated.</p>
    pub fn table_name(mut self, input: impl Into<std::string::String>) -> Self {
        self.table_name = Some(input.into());
        self
    }
    /// <p>The name of the table to be updated.</p>
    pub fn set_table_name(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.table_name = input;
        self
    }
    /// <p>Controls how you are charged for read and write throughput and how you manage capacity. When switching from pay-per-request to provisioned capacity, initial provisioned capacity values must be set. The initial provisioned capacity values are estimated based on the consumed read and write capacity of your table and global secondary indexes over the past 30 minutes.</p>
    /// <ul>
    /// <li> <p> <code>PROVISIONED</code> - We recommend using <code>PROVISIONED</code> for predictable workloads. <code>PROVISIONED</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html#HowItWorks.ProvisionedThroughput.Manual">Provisioned Mode</a>.</p> </li>
    /// <li> <p> <code>PAY_PER_REQUEST</code> - We recommend using <code>PAY_PER_REQUEST</code> for unpredictable workloads. <code>PAY_PER_REQUEST</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html#HowItWorks.OnDemand">On-Demand Mode</a>. </p> </li>
    /// </ul>
    pub fn billing_mode(mut self, input: crate::types::BillingMode) -> Self {
        self.billing_mode = Some(input);
        self
    }
    /// <p>Controls how you are charged for read and write throughput and how you manage capacity. When switching from pay-per-request to provisioned capacity, initial provisioned capacity values must be set. The initial provisioned capacity values are estimated based on the consumed read and write capacity of your table and global secondary indexes over the past 30 minutes.</p>
    /// <ul>
    /// <li> <p> <code>PROVISIONED</code> - We recommend using <code>PROVISIONED</code> for predictable workloads. <code>PROVISIONED</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html#HowItWorks.ProvisionedThroughput.Manual">Provisioned Mode</a>.</p> </li>
    /// <li> <p> <code>PAY_PER_REQUEST</code> - We recommend using <code>PAY_PER_REQUEST</code> for unpredictable workloads. <code>PAY_PER_REQUEST</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html#HowItWorks.OnDemand">On-Demand Mode</a>. </p> </li>
    /// </ul>
    pub fn set_billing_mode(
        mut self,
        input: std::option::Option<crate::types::BillingMode>,
    ) -> Self {
        self.billing_mode = input;
        self
    }
    /// <p>The new provisioned throughput settings for the specified table or index.</p>
    pub fn provisioned_throughput(mut self, input: crate::types::ProvisionedThroughput) -> Self {
        self.provisioned_throughput = Some(input);
        self
    }
    /// <p>The new provisioned throughput settings for the specified table or index.</p>
    pub fn set_provisioned_throughput(
        mut self,
        input: std::option::Option<crate::types::ProvisionedThroughput>,
    ) -> Self {
        self.provisioned_throughput = input;
        self
    }
    /// Appends an item to `global_secondary_index_updates`.
    ///
    /// To override the contents of this collection use [`set_global_secondary_index_updates`](Self::set_global_secondary_index_updates).
    ///
    /// <p>An array of one or more global secondary indexes for the table. For each index in the array, you can request one action:</p>
    /// <ul>
    /// <li> <p> <code>Create</code> - add a new global secondary index to the table.</p> </li>
    /// <li> <p> <code>Update</code> - modify the provisioned throughput settings of an existing global secondary index.</p> </li>
    /// <li> <p> <code>Delete</code> - remove a global secondary index from the table.</p> </li>
    /// </ul>
    /// <p>You can create or delete only one global secondary index per <code>UpdateTable</code> operation.</p>
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.OnlineOps.html">Managing Global Secondary Indexes</a> in the <i>Amazon DynamoDB Developer Guide</i>. </p>
    pub fn global_secondary_index_updates(
        mut self,
        input: crate::types::GlobalSecondaryIndexUpdate,
    ) -> Self {
        let mut v = self.global_secondary_index_updates.unwrap_or_default();
        v.push(input);
        self.global_secondary_index_updates = Some(v);
        self
    }
    /// <p>An array of one or more global secondary indexes for the table. For each index in the array, you can request one action:</p>
    /// <ul>
    /// <li> <p> <code>Create</code> - add a new global secondary index to the table.</p> </li>
    /// <li> <p> <code>Update</code> - modify the provisioned throughput settings of an existing global secondary index.</p> </li>
    /// <li> <p> <code>Delete</code> - remove a global secondary index from the table.</p> </li>
    /// </ul>
    /// <p>You can create or delete only one global secondary index per <code>UpdateTable</code> operation.</p>
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.OnlineOps.html">Managing Global Secondary Indexes</a> in the <i>Amazon DynamoDB Developer Guide</i>. </p>
    pub fn set_global_secondary_index_updates(
        mut self,
        input: std::option::Option<std::vec::Vec<crate::types::GlobalSecondaryIndexUpdate>>,
    ) -> Self {
        self.global_secondary_index_updates = input;
        self
    }
    /// <p>Represents the DynamoDB Streams configuration for the table.</p> <note>
    /// <p>You receive a <code>ResourceInUseException</code> if you try to enable a stream on a table that already has a stream, or if you try to disable a stream on a table that doesn't have a stream.</p>
    /// </note>
    pub fn stream_specification(mut self, input: crate::types::StreamSpecification) -> Self {
        self.stream_specification = Some(input);
        self
    }
    /// <p>Represents the DynamoDB Streams configuration for the table.</p> <note>
    /// <p>You receive a <code>ResourceInUseException</code> if you try to enable a stream on a table that already has a stream, or if you try to disable a stream on a table that doesn't have a stream.</p>
    /// </note>
    pub fn set_stream_specification(
        mut self,
        input: std::option::Option<crate::types::StreamSpecification>,
    ) -> Self {
        self.stream_specification = input;
        self
    }
    /// <p>The new server-side encryption settings for the specified table.</p>
    pub fn sse_specification(mut self, input: crate::types::SseSpecification) -> Self {
        self.sse_specification = Some(input);
        self
    }
    /// <p>The new server-side encryption settings for the specified table.</p>
    pub fn set_sse_specification(
        mut self,
        input: std::option::Option<crate::types::SseSpecification>,
    ) -> Self {
        self.sse_specification = input;
        self
    }
    /// Appends an item to `replica_updates`.
    ///
    /// To override the contents of this collection use [`set_replica_updates`](Self::set_replica_updates).
    ///
    /// <p>A list of replica update actions (create, delete, or update) for the table.</p> <note>
    /// <p>This property only applies to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/globaltables.V2.html">Version 2019.11.21 (Current)</a> of global tables. </p>
    /// </note>
    pub fn replica_updates(mut self, input: crate::types::ReplicationGroupUpdate) -> Self {
        let mut v = self.replica_updates.unwrap_or_default();
        v.push(input);
        self.replica_updates = Some(v);
        self
    }
    /// <p>A list of replica update actions (create, delete, or update) for the table.</p> <note>
    /// <p>This property only applies to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/globaltables.V2.html">Version 2019.11.21 (Current)</a> of global tables. </p>
    /// </note>
    pub fn set_replica_updates(
        mut self,
        input: std::option::Option<std::vec::Vec<crate::types::ReplicationGroupUpdate>>,
    ) -> Self {
        self.replica_updates = input;
        self
    }
    /// <p>The table class of the table to be updated. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
    pub fn table_class(mut self, input: crate::types::TableClass) -> Self {
        self.table_class = Some(input);
        self
    }
    /// <p>The table class of the table to be updated. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
    pub fn set_table_class(mut self, input: std::option::Option<crate::types::TableClass>) -> Self {
        self.table_class = input;
        self
    }
    /// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
    pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
        self.deletion_protection_enabled = Some(input);
        self
    }
    /// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
    pub fn set_deletion_protection_enabled(mut self, input: std::option::Option<bool>) -> Self {
        self.deletion_protection_enabled = input;
        self
    }
    /// Consumes the builder and constructs a [`UpdateTableInput`](crate::operation::update_table::UpdateTableInput).
    pub fn build(
        self,
    ) -> Result<
        crate::operation::update_table::UpdateTableInput,
        aws_smithy_http::operation::error::BuildError,
    > {
        Ok(crate::operation::update_table::UpdateTableInput {
            attribute_definitions: self.attribute_definitions,
            table_name: self.table_name,
            billing_mode: self.billing_mode,
            provisioned_throughput: self.provisioned_throughput,
            global_secondary_index_updates: self.global_secondary_index_updates,
            stream_specification: self.stream_specification,
            sse_specification: self.sse_specification,
            replica_updates: self.replica_updates,
            table_class: self.table_class,
            deletion_protection_enabled: self.deletion_protection_enabled,
        })
    }
}