aws_sdk_dynamodb/operation/update_table/_update_table_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents the input of an <code>UpdateTable</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateTableInput {
7 /// <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>
8 pub attribute_definitions: ::std::option::Option<::std::vec::Vec<crate::types::AttributeDefinition>>,
9 /// <p>The name of the table to be updated. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
10 pub table_name: ::std::option::Option<::std::string::String>,
11 /// <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>
12 /// <ul>
13 /// <li>
14 /// <p><code>PAY_PER_REQUEST</code> - We recommend using <code>PAY_PER_REQUEST</code> for most DynamoDB workloads. <code>PAY_PER_REQUEST</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/on-demand-capacity-mode.html">On-demand capacity mode</a>.</p></li>
15 /// <li>
16 /// <p><code>PROVISIONED</code> - We recommend using <code>PROVISIONED</code> for steady workloads with predictable growth where capacity requirements can be reliably forecasted. <code>PROVISIONED</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html">Provisioned capacity mode</a>.</p></li>
17 /// </ul>
18 pub billing_mode: ::std::option::Option<crate::types::BillingMode>,
19 /// <p>The new provisioned throughput settings for the specified table or index.</p>
20 pub provisioned_throughput: ::std::option::Option<crate::types::ProvisionedThroughput>,
21 /// <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>
22 /// <ul>
23 /// <li>
24 /// <p><code>Create</code> - add a new global secondary index to the table.</p></li>
25 /// <li>
26 /// <p><code>Update</code> - modify the provisioned throughput settings of an existing global secondary index.</p></li>
27 /// <li>
28 /// <p><code>Delete</code> - remove a global secondary index from the table.</p></li>
29 /// </ul>
30 /// <p>You can create or delete only one global secondary index per <code>UpdateTable</code> operation.</p>
31 /// <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>
32 pub global_secondary_index_updates: ::std::option::Option<::std::vec::Vec<crate::types::GlobalSecondaryIndexUpdate>>,
33 /// <p>Represents the DynamoDB Streams configuration for the table.</p><note>
34 /// <p>You receive a <code>ValidationException</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>
35 /// </note>
36 pub stream_specification: ::std::option::Option<crate::types::StreamSpecification>,
37 /// <p>The new server-side encryption settings for the specified table.</p>
38 pub sse_specification: ::std::option::Option<crate::types::SseSpecification>,
39 /// <p>A list of replica update actions (create, delete, or update) for the table.</p>
40 pub replica_updates: ::std::option::Option<::std::vec::Vec<crate::types::ReplicationGroupUpdate>>,
41 /// <p>The table class of the table to be updated. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
42 pub table_class: ::std::option::Option<crate::types::TableClass>,
43 /// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
44 pub deletion_protection_enabled: ::std::option::Option<bool>,
45 /// <p>Specifies the consistency mode for a new global table. This parameter is only valid when you create a global table by specifying one or more <a href="https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ReplicationGroupUpdate.html#DDB-Type-ReplicationGroupUpdate-Create">Create</a> actions in the <a href="https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateTable.html#DDB-UpdateTable-request-ReplicaUpdates">ReplicaUpdates</a> action list.</p>
46 /// <p>You can specify one of the following consistency modes:</p>
47 /// <ul>
48 /// <li>
49 /// <p><code>EVENTUAL</code>: Configures a new global table for multi-Region eventual consistency (MREC). This is the default consistency mode for global tables.</p></li>
50 /// <li>
51 /// <p><code>STRONG</code>: Configures a new global table for multi-Region strong consistency (MRSC).</p></li>
52 /// </ul>
53 /// <p>If you don't specify this field, the global table consistency mode defaults to <code>EVENTUAL</code>. For more information about global tables consistency modes, see <a href="https://docs.aws.amazon.com/V2globaltables_HowItWorks.html#V2globaltables_HowItWorks.consistency-modes"> Consistency modes</a> in DynamoDB developer guide.</p>
54 pub multi_region_consistency: ::std::option::Option<crate::types::MultiRegionConsistency>,
55 /// <p>A list of witness updates for a MRSC global table. A witness provides a cost-effective alternative to a full replica in a MRSC global table by maintaining replicated change data written to global table replicas. You cannot perform read or write operations on a witness. For each witness, you can request one action:</p>
56 /// <ul>
57 /// <li>
58 /// <p><code>Create</code> - add a new witness to the global table.</p></li>
59 /// <li>
60 /// <p><code>Delete</code> - remove a witness from the global table.</p></li>
61 /// </ul>
62 /// <p>You can create or delete only one witness per <code>UpdateTable</code> operation.</p>
63 /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/V2globaltables_HowItWorks.html#V2globaltables_HowItWorks.consistency-modes">Multi-Region strong consistency (MRSC)</a> in the Amazon DynamoDB Developer Guide</p>
64 pub global_table_witness_updates: ::std::option::Option<::std::vec::Vec<crate::types::GlobalTableWitnessGroupUpdate>>,
65 /// <p>Updates the maximum number of read and write units for the specified table in on-demand capacity mode. If you use this parameter, you must specify <code>MaxReadRequestUnits</code>, <code>MaxWriteRequestUnits</code>, or both.</p>
66 pub on_demand_throughput: ::std::option::Option<crate::types::OnDemandThroughput>,
67 /// <p>Represents the warm throughput (in read units per second and write units per second) for updating a table.</p>
68 pub warm_throughput: ::std::option::Option<crate::types::WarmThroughput>,
69}
70impl UpdateTableInput {
71 /// <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>
72 ///
73 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.attribute_definitions.is_none()`.
74 pub fn attribute_definitions(&self) -> &[crate::types::AttributeDefinition] {
75 self.attribute_definitions.as_deref().unwrap_or_default()
76 }
77 /// <p>The name of the table to be updated. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
78 pub fn table_name(&self) -> ::std::option::Option<&str> {
79 self.table_name.as_deref()
80 }
81 /// <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>
82 /// <ul>
83 /// <li>
84 /// <p><code>PAY_PER_REQUEST</code> - We recommend using <code>PAY_PER_REQUEST</code> for most DynamoDB workloads. <code>PAY_PER_REQUEST</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/on-demand-capacity-mode.html">On-demand capacity mode</a>.</p></li>
85 /// <li>
86 /// <p><code>PROVISIONED</code> - We recommend using <code>PROVISIONED</code> for steady workloads with predictable growth where capacity requirements can be reliably forecasted. <code>PROVISIONED</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html">Provisioned capacity mode</a>.</p></li>
87 /// </ul>
88 pub fn billing_mode(&self) -> ::std::option::Option<&crate::types::BillingMode> {
89 self.billing_mode.as_ref()
90 }
91 /// <p>The new provisioned throughput settings for the specified table or index.</p>
92 pub fn provisioned_throughput(&self) -> ::std::option::Option<&crate::types::ProvisionedThroughput> {
93 self.provisioned_throughput.as_ref()
94 }
95 /// <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>
96 /// <ul>
97 /// <li>
98 /// <p><code>Create</code> - add a new global secondary index to the table.</p></li>
99 /// <li>
100 /// <p><code>Update</code> - modify the provisioned throughput settings of an existing global secondary index.</p></li>
101 /// <li>
102 /// <p><code>Delete</code> - remove a global secondary index from the table.</p></li>
103 /// </ul>
104 /// <p>You can create or delete only one global secondary index per <code>UpdateTable</code> operation.</p>
105 /// <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>
106 ///
107 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.global_secondary_index_updates.is_none()`.
108 pub fn global_secondary_index_updates(&self) -> &[crate::types::GlobalSecondaryIndexUpdate] {
109 self.global_secondary_index_updates.as_deref().unwrap_or_default()
110 }
111 /// <p>Represents the DynamoDB Streams configuration for the table.</p><note>
112 /// <p>You receive a <code>ValidationException</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>
113 /// </note>
114 pub fn stream_specification(&self) -> ::std::option::Option<&crate::types::StreamSpecification> {
115 self.stream_specification.as_ref()
116 }
117 /// <p>The new server-side encryption settings for the specified table.</p>
118 pub fn sse_specification(&self) -> ::std::option::Option<&crate::types::SseSpecification> {
119 self.sse_specification.as_ref()
120 }
121 /// <p>A list of replica update actions (create, delete, or update) for the table.</p>
122 ///
123 /// 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_updates.is_none()`.
124 pub fn replica_updates(&self) -> &[crate::types::ReplicationGroupUpdate] {
125 self.replica_updates.as_deref().unwrap_or_default()
126 }
127 /// <p>The table class of the table to be updated. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
128 pub fn table_class(&self) -> ::std::option::Option<&crate::types::TableClass> {
129 self.table_class.as_ref()
130 }
131 /// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
132 pub fn deletion_protection_enabled(&self) -> ::std::option::Option<bool> {
133 self.deletion_protection_enabled
134 }
135 /// <p>Specifies the consistency mode for a new global table. This parameter is only valid when you create a global table by specifying one or more <a href="https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ReplicationGroupUpdate.html#DDB-Type-ReplicationGroupUpdate-Create">Create</a> actions in the <a href="https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateTable.html#DDB-UpdateTable-request-ReplicaUpdates">ReplicaUpdates</a> action list.</p>
136 /// <p>You can specify one of the following consistency modes:</p>
137 /// <ul>
138 /// <li>
139 /// <p><code>EVENTUAL</code>: Configures a new global table for multi-Region eventual consistency (MREC). This is the default consistency mode for global tables.</p></li>
140 /// <li>
141 /// <p><code>STRONG</code>: Configures a new global table for multi-Region strong consistency (MRSC).</p></li>
142 /// </ul>
143 /// <p>If you don't specify this field, the global table consistency mode defaults to <code>EVENTUAL</code>. For more information about global tables consistency modes, see <a href="https://docs.aws.amazon.com/V2globaltables_HowItWorks.html#V2globaltables_HowItWorks.consistency-modes"> Consistency modes</a> in DynamoDB developer guide.</p>
144 pub fn multi_region_consistency(&self) -> ::std::option::Option<&crate::types::MultiRegionConsistency> {
145 self.multi_region_consistency.as_ref()
146 }
147 /// <p>A list of witness updates for a MRSC global table. A witness provides a cost-effective alternative to a full replica in a MRSC global table by maintaining replicated change data written to global table replicas. You cannot perform read or write operations on a witness. For each witness, you can request one action:</p>
148 /// <ul>
149 /// <li>
150 /// <p><code>Create</code> - add a new witness to the global table.</p></li>
151 /// <li>
152 /// <p><code>Delete</code> - remove a witness from the global table.</p></li>
153 /// </ul>
154 /// <p>You can create or delete only one witness per <code>UpdateTable</code> operation.</p>
155 /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/V2globaltables_HowItWorks.html#V2globaltables_HowItWorks.consistency-modes">Multi-Region strong consistency (MRSC)</a> in the Amazon DynamoDB Developer Guide</p>
156 ///
157 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.global_table_witness_updates.is_none()`.
158 pub fn global_table_witness_updates(&self) -> &[crate::types::GlobalTableWitnessGroupUpdate] {
159 self.global_table_witness_updates.as_deref().unwrap_or_default()
160 }
161 /// <p>Updates the maximum number of read and write units for the specified table in on-demand capacity mode. If you use this parameter, you must specify <code>MaxReadRequestUnits</code>, <code>MaxWriteRequestUnits</code>, or both.</p>
162 pub fn on_demand_throughput(&self) -> ::std::option::Option<&crate::types::OnDemandThroughput> {
163 self.on_demand_throughput.as_ref()
164 }
165 /// <p>Represents the warm throughput (in read units per second and write units per second) for updating a table.</p>
166 pub fn warm_throughput(&self) -> ::std::option::Option<&crate::types::WarmThroughput> {
167 self.warm_throughput.as_ref()
168 }
169}
170impl UpdateTableInput {
171 /// Creates a new builder-style object to manufacture [`UpdateTableInput`](crate::operation::update_table::UpdateTableInput).
172 pub fn builder() -> crate::operation::update_table::builders::UpdateTableInputBuilder {
173 crate::operation::update_table::builders::UpdateTableInputBuilder::default()
174 }
175}
176
177/// A builder for [`UpdateTableInput`](crate::operation::update_table::UpdateTableInput).
178#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
179#[non_exhaustive]
180pub struct UpdateTableInputBuilder {
181 pub(crate) attribute_definitions: ::std::option::Option<::std::vec::Vec<crate::types::AttributeDefinition>>,
182 pub(crate) table_name: ::std::option::Option<::std::string::String>,
183 pub(crate) billing_mode: ::std::option::Option<crate::types::BillingMode>,
184 pub(crate) provisioned_throughput: ::std::option::Option<crate::types::ProvisionedThroughput>,
185 pub(crate) global_secondary_index_updates: ::std::option::Option<::std::vec::Vec<crate::types::GlobalSecondaryIndexUpdate>>,
186 pub(crate) stream_specification: ::std::option::Option<crate::types::StreamSpecification>,
187 pub(crate) sse_specification: ::std::option::Option<crate::types::SseSpecification>,
188 pub(crate) replica_updates: ::std::option::Option<::std::vec::Vec<crate::types::ReplicationGroupUpdate>>,
189 pub(crate) table_class: ::std::option::Option<crate::types::TableClass>,
190 pub(crate) deletion_protection_enabled: ::std::option::Option<bool>,
191 pub(crate) multi_region_consistency: ::std::option::Option<crate::types::MultiRegionConsistency>,
192 pub(crate) global_table_witness_updates: ::std::option::Option<::std::vec::Vec<crate::types::GlobalTableWitnessGroupUpdate>>,
193 pub(crate) on_demand_throughput: ::std::option::Option<crate::types::OnDemandThroughput>,
194 pub(crate) warm_throughput: ::std::option::Option<crate::types::WarmThroughput>,
195}
196impl UpdateTableInputBuilder {
197 /// Appends an item to `attribute_definitions`.
198 ///
199 /// To override the contents of this collection use [`set_attribute_definitions`](Self::set_attribute_definitions).
200 ///
201 /// <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>
202 pub fn attribute_definitions(mut self, input: crate::types::AttributeDefinition) -> Self {
203 let mut v = self.attribute_definitions.unwrap_or_default();
204 v.push(input);
205 self.attribute_definitions = ::std::option::Option::Some(v);
206 self
207 }
208 /// <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>
209 pub fn set_attribute_definitions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AttributeDefinition>>) -> Self {
210 self.attribute_definitions = input;
211 self
212 }
213 /// <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>
214 pub fn get_attribute_definitions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AttributeDefinition>> {
215 &self.attribute_definitions
216 }
217 /// <p>The name of the table to be updated. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
218 /// This field is required.
219 pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
220 self.table_name = ::std::option::Option::Some(input.into());
221 self
222 }
223 /// <p>The name of the table to be updated. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
224 pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
225 self.table_name = input;
226 self
227 }
228 /// <p>The name of the table to be updated. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
229 pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
230 &self.table_name
231 }
232 /// <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>
233 /// <ul>
234 /// <li>
235 /// <p><code>PAY_PER_REQUEST</code> - We recommend using <code>PAY_PER_REQUEST</code> for most DynamoDB workloads. <code>PAY_PER_REQUEST</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/on-demand-capacity-mode.html">On-demand capacity mode</a>.</p></li>
236 /// <li>
237 /// <p><code>PROVISIONED</code> - We recommend using <code>PROVISIONED</code> for steady workloads with predictable growth where capacity requirements can be reliably forecasted. <code>PROVISIONED</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html">Provisioned capacity mode</a>.</p></li>
238 /// </ul>
239 pub fn billing_mode(mut self, input: crate::types::BillingMode) -> Self {
240 self.billing_mode = ::std::option::Option::Some(input);
241 self
242 }
243 /// <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>
244 /// <ul>
245 /// <li>
246 /// <p><code>PAY_PER_REQUEST</code> - We recommend using <code>PAY_PER_REQUEST</code> for most DynamoDB workloads. <code>PAY_PER_REQUEST</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/on-demand-capacity-mode.html">On-demand capacity mode</a>.</p></li>
247 /// <li>
248 /// <p><code>PROVISIONED</code> - We recommend using <code>PROVISIONED</code> for steady workloads with predictable growth where capacity requirements can be reliably forecasted. <code>PROVISIONED</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html">Provisioned capacity mode</a>.</p></li>
249 /// </ul>
250 pub fn set_billing_mode(mut self, input: ::std::option::Option<crate::types::BillingMode>) -> Self {
251 self.billing_mode = input;
252 self
253 }
254 /// <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>
255 /// <ul>
256 /// <li>
257 /// <p><code>PAY_PER_REQUEST</code> - We recommend using <code>PAY_PER_REQUEST</code> for most DynamoDB workloads. <code>PAY_PER_REQUEST</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/on-demand-capacity-mode.html">On-demand capacity mode</a>.</p></li>
258 /// <li>
259 /// <p><code>PROVISIONED</code> - We recommend using <code>PROVISIONED</code> for steady workloads with predictable growth where capacity requirements can be reliably forecasted. <code>PROVISIONED</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html">Provisioned capacity mode</a>.</p></li>
260 /// </ul>
261 pub fn get_billing_mode(&self) -> &::std::option::Option<crate::types::BillingMode> {
262 &self.billing_mode
263 }
264 /// <p>The new provisioned throughput settings for the specified table or index.</p>
265 pub fn provisioned_throughput(mut self, input: crate::types::ProvisionedThroughput) -> Self {
266 self.provisioned_throughput = ::std::option::Option::Some(input);
267 self
268 }
269 /// <p>The new provisioned throughput settings for the specified table or index.</p>
270 pub fn set_provisioned_throughput(mut self, input: ::std::option::Option<crate::types::ProvisionedThroughput>) -> Self {
271 self.provisioned_throughput = input;
272 self
273 }
274 /// <p>The new provisioned throughput settings for the specified table or index.</p>
275 pub fn get_provisioned_throughput(&self) -> &::std::option::Option<crate::types::ProvisionedThroughput> {
276 &self.provisioned_throughput
277 }
278 /// Appends an item to `global_secondary_index_updates`.
279 ///
280 /// To override the contents of this collection use [`set_global_secondary_index_updates`](Self::set_global_secondary_index_updates).
281 ///
282 /// <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>
283 /// <ul>
284 /// <li>
285 /// <p><code>Create</code> - add a new global secondary index to the table.</p></li>
286 /// <li>
287 /// <p><code>Update</code> - modify the provisioned throughput settings of an existing global secondary index.</p></li>
288 /// <li>
289 /// <p><code>Delete</code> - remove a global secondary index from the table.</p></li>
290 /// </ul>
291 /// <p>You can create or delete only one global secondary index per <code>UpdateTable</code> operation.</p>
292 /// <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>
293 pub fn global_secondary_index_updates(mut self, input: crate::types::GlobalSecondaryIndexUpdate) -> Self {
294 let mut v = self.global_secondary_index_updates.unwrap_or_default();
295 v.push(input);
296 self.global_secondary_index_updates = ::std::option::Option::Some(v);
297 self
298 }
299 /// <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>
300 /// <ul>
301 /// <li>
302 /// <p><code>Create</code> - add a new global secondary index to the table.</p></li>
303 /// <li>
304 /// <p><code>Update</code> - modify the provisioned throughput settings of an existing global secondary index.</p></li>
305 /// <li>
306 /// <p><code>Delete</code> - remove a global secondary index from the table.</p></li>
307 /// </ul>
308 /// <p>You can create or delete only one global secondary index per <code>UpdateTable</code> operation.</p>
309 /// <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>
310 pub fn set_global_secondary_index_updates(
311 mut self,
312 input: ::std::option::Option<::std::vec::Vec<crate::types::GlobalSecondaryIndexUpdate>>,
313 ) -> Self {
314 self.global_secondary_index_updates = input;
315 self
316 }
317 /// <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>
318 /// <ul>
319 /// <li>
320 /// <p><code>Create</code> - add a new global secondary index to the table.</p></li>
321 /// <li>
322 /// <p><code>Update</code> - modify the provisioned throughput settings of an existing global secondary index.</p></li>
323 /// <li>
324 /// <p><code>Delete</code> - remove a global secondary index from the table.</p></li>
325 /// </ul>
326 /// <p>You can create or delete only one global secondary index per <code>UpdateTable</code> operation.</p>
327 /// <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>
328 pub fn get_global_secondary_index_updates(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GlobalSecondaryIndexUpdate>> {
329 &self.global_secondary_index_updates
330 }
331 /// <p>Represents the DynamoDB Streams configuration for the table.</p><note>
332 /// <p>You receive a <code>ValidationException</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>
333 /// </note>
334 pub fn stream_specification(mut self, input: crate::types::StreamSpecification) -> Self {
335 self.stream_specification = ::std::option::Option::Some(input);
336 self
337 }
338 /// <p>Represents the DynamoDB Streams configuration for the table.</p><note>
339 /// <p>You receive a <code>ValidationException</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>
340 /// </note>
341 pub fn set_stream_specification(mut self, input: ::std::option::Option<crate::types::StreamSpecification>) -> Self {
342 self.stream_specification = input;
343 self
344 }
345 /// <p>Represents the DynamoDB Streams configuration for the table.</p><note>
346 /// <p>You receive a <code>ValidationException</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>
347 /// </note>
348 pub fn get_stream_specification(&self) -> &::std::option::Option<crate::types::StreamSpecification> {
349 &self.stream_specification
350 }
351 /// <p>The new server-side encryption settings for the specified table.</p>
352 pub fn sse_specification(mut self, input: crate::types::SseSpecification) -> Self {
353 self.sse_specification = ::std::option::Option::Some(input);
354 self
355 }
356 /// <p>The new server-side encryption settings for the specified table.</p>
357 pub fn set_sse_specification(mut self, input: ::std::option::Option<crate::types::SseSpecification>) -> Self {
358 self.sse_specification = input;
359 self
360 }
361 /// <p>The new server-side encryption settings for the specified table.</p>
362 pub fn get_sse_specification(&self) -> &::std::option::Option<crate::types::SseSpecification> {
363 &self.sse_specification
364 }
365 /// Appends an item to `replica_updates`.
366 ///
367 /// To override the contents of this collection use [`set_replica_updates`](Self::set_replica_updates).
368 ///
369 /// <p>A list of replica update actions (create, delete, or update) for the table.</p>
370 pub fn replica_updates(mut self, input: crate::types::ReplicationGroupUpdate) -> Self {
371 let mut v = self.replica_updates.unwrap_or_default();
372 v.push(input);
373 self.replica_updates = ::std::option::Option::Some(v);
374 self
375 }
376 /// <p>A list of replica update actions (create, delete, or update) for the table.</p>
377 pub fn set_replica_updates(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ReplicationGroupUpdate>>) -> Self {
378 self.replica_updates = input;
379 self
380 }
381 /// <p>A list of replica update actions (create, delete, or update) for the table.</p>
382 pub fn get_replica_updates(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ReplicationGroupUpdate>> {
383 &self.replica_updates
384 }
385 /// <p>The table class of the table to be updated. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
386 pub fn table_class(mut self, input: crate::types::TableClass) -> Self {
387 self.table_class = ::std::option::Option::Some(input);
388 self
389 }
390 /// <p>The table class of the table to be updated. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
391 pub fn set_table_class(mut self, input: ::std::option::Option<crate::types::TableClass>) -> Self {
392 self.table_class = input;
393 self
394 }
395 /// <p>The table class of the table to be updated. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
396 pub fn get_table_class(&self) -> &::std::option::Option<crate::types::TableClass> {
397 &self.table_class
398 }
399 /// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
400 pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
401 self.deletion_protection_enabled = ::std::option::Option::Some(input);
402 self
403 }
404 /// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
405 pub fn set_deletion_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
406 self.deletion_protection_enabled = input;
407 self
408 }
409 /// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
410 pub fn get_deletion_protection_enabled(&self) -> &::std::option::Option<bool> {
411 &self.deletion_protection_enabled
412 }
413 /// <p>Specifies the consistency mode for a new global table. This parameter is only valid when you create a global table by specifying one or more <a href="https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ReplicationGroupUpdate.html#DDB-Type-ReplicationGroupUpdate-Create">Create</a> actions in the <a href="https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateTable.html#DDB-UpdateTable-request-ReplicaUpdates">ReplicaUpdates</a> action list.</p>
414 /// <p>You can specify one of the following consistency modes:</p>
415 /// <ul>
416 /// <li>
417 /// <p><code>EVENTUAL</code>: Configures a new global table for multi-Region eventual consistency (MREC). This is the default consistency mode for global tables.</p></li>
418 /// <li>
419 /// <p><code>STRONG</code>: Configures a new global table for multi-Region strong consistency (MRSC).</p></li>
420 /// </ul>
421 /// <p>If you don't specify this field, the global table consistency mode defaults to <code>EVENTUAL</code>. For more information about global tables consistency modes, see <a href="https://docs.aws.amazon.com/V2globaltables_HowItWorks.html#V2globaltables_HowItWorks.consistency-modes"> Consistency modes</a> in DynamoDB developer guide.</p>
422 pub fn multi_region_consistency(mut self, input: crate::types::MultiRegionConsistency) -> Self {
423 self.multi_region_consistency = ::std::option::Option::Some(input);
424 self
425 }
426 /// <p>Specifies the consistency mode for a new global table. This parameter is only valid when you create a global table by specifying one or more <a href="https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ReplicationGroupUpdate.html#DDB-Type-ReplicationGroupUpdate-Create">Create</a> actions in the <a href="https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateTable.html#DDB-UpdateTable-request-ReplicaUpdates">ReplicaUpdates</a> action list.</p>
427 /// <p>You can specify one of the following consistency modes:</p>
428 /// <ul>
429 /// <li>
430 /// <p><code>EVENTUAL</code>: Configures a new global table for multi-Region eventual consistency (MREC). This is the default consistency mode for global tables.</p></li>
431 /// <li>
432 /// <p><code>STRONG</code>: Configures a new global table for multi-Region strong consistency (MRSC).</p></li>
433 /// </ul>
434 /// <p>If you don't specify this field, the global table consistency mode defaults to <code>EVENTUAL</code>. For more information about global tables consistency modes, see <a href="https://docs.aws.amazon.com/V2globaltables_HowItWorks.html#V2globaltables_HowItWorks.consistency-modes"> Consistency modes</a> in DynamoDB developer guide.</p>
435 pub fn set_multi_region_consistency(mut self, input: ::std::option::Option<crate::types::MultiRegionConsistency>) -> Self {
436 self.multi_region_consistency = input;
437 self
438 }
439 /// <p>Specifies the consistency mode for a new global table. This parameter is only valid when you create a global table by specifying one or more <a href="https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ReplicationGroupUpdate.html#DDB-Type-ReplicationGroupUpdate-Create">Create</a> actions in the <a href="https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateTable.html#DDB-UpdateTable-request-ReplicaUpdates">ReplicaUpdates</a> action list.</p>
440 /// <p>You can specify one of the following consistency modes:</p>
441 /// <ul>
442 /// <li>
443 /// <p><code>EVENTUAL</code>: Configures a new global table for multi-Region eventual consistency (MREC). This is the default consistency mode for global tables.</p></li>
444 /// <li>
445 /// <p><code>STRONG</code>: Configures a new global table for multi-Region strong consistency (MRSC).</p></li>
446 /// </ul>
447 /// <p>If you don't specify this field, the global table consistency mode defaults to <code>EVENTUAL</code>. For more information about global tables consistency modes, see <a href="https://docs.aws.amazon.com/V2globaltables_HowItWorks.html#V2globaltables_HowItWorks.consistency-modes"> Consistency modes</a> in DynamoDB developer guide.</p>
448 pub fn get_multi_region_consistency(&self) -> &::std::option::Option<crate::types::MultiRegionConsistency> {
449 &self.multi_region_consistency
450 }
451 /// Appends an item to `global_table_witness_updates`.
452 ///
453 /// To override the contents of this collection use [`set_global_table_witness_updates`](Self::set_global_table_witness_updates).
454 ///
455 /// <p>A list of witness updates for a MRSC global table. A witness provides a cost-effective alternative to a full replica in a MRSC global table by maintaining replicated change data written to global table replicas. You cannot perform read or write operations on a witness. For each witness, you can request one action:</p>
456 /// <ul>
457 /// <li>
458 /// <p><code>Create</code> - add a new witness to the global table.</p></li>
459 /// <li>
460 /// <p><code>Delete</code> - remove a witness from the global table.</p></li>
461 /// </ul>
462 /// <p>You can create or delete only one witness per <code>UpdateTable</code> operation.</p>
463 /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/V2globaltables_HowItWorks.html#V2globaltables_HowItWorks.consistency-modes">Multi-Region strong consistency (MRSC)</a> in the Amazon DynamoDB Developer Guide</p>
464 pub fn global_table_witness_updates(mut self, input: crate::types::GlobalTableWitnessGroupUpdate) -> Self {
465 let mut v = self.global_table_witness_updates.unwrap_or_default();
466 v.push(input);
467 self.global_table_witness_updates = ::std::option::Option::Some(v);
468 self
469 }
470 /// <p>A list of witness updates for a MRSC global table. A witness provides a cost-effective alternative to a full replica in a MRSC global table by maintaining replicated change data written to global table replicas. You cannot perform read or write operations on a witness. For each witness, you can request one action:</p>
471 /// <ul>
472 /// <li>
473 /// <p><code>Create</code> - add a new witness to the global table.</p></li>
474 /// <li>
475 /// <p><code>Delete</code> - remove a witness from the global table.</p></li>
476 /// </ul>
477 /// <p>You can create or delete only one witness per <code>UpdateTable</code> operation.</p>
478 /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/V2globaltables_HowItWorks.html#V2globaltables_HowItWorks.consistency-modes">Multi-Region strong consistency (MRSC)</a> in the Amazon DynamoDB Developer Guide</p>
479 pub fn set_global_table_witness_updates(
480 mut self,
481 input: ::std::option::Option<::std::vec::Vec<crate::types::GlobalTableWitnessGroupUpdate>>,
482 ) -> Self {
483 self.global_table_witness_updates = input;
484 self
485 }
486 /// <p>A list of witness updates for a MRSC global table. A witness provides a cost-effective alternative to a full replica in a MRSC global table by maintaining replicated change data written to global table replicas. You cannot perform read or write operations on a witness. For each witness, you can request one action:</p>
487 /// <ul>
488 /// <li>
489 /// <p><code>Create</code> - add a new witness to the global table.</p></li>
490 /// <li>
491 /// <p><code>Delete</code> - remove a witness from the global table.</p></li>
492 /// </ul>
493 /// <p>You can create or delete only one witness per <code>UpdateTable</code> operation.</p>
494 /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/V2globaltables_HowItWorks.html#V2globaltables_HowItWorks.consistency-modes">Multi-Region strong consistency (MRSC)</a> in the Amazon DynamoDB Developer Guide</p>
495 pub fn get_global_table_witness_updates(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GlobalTableWitnessGroupUpdate>> {
496 &self.global_table_witness_updates
497 }
498 /// <p>Updates the maximum number of read and write units for the specified table in on-demand capacity mode. If you use this parameter, you must specify <code>MaxReadRequestUnits</code>, <code>MaxWriteRequestUnits</code>, or both.</p>
499 pub fn on_demand_throughput(mut self, input: crate::types::OnDemandThroughput) -> Self {
500 self.on_demand_throughput = ::std::option::Option::Some(input);
501 self
502 }
503 /// <p>Updates the maximum number of read and write units for the specified table in on-demand capacity mode. If you use this parameter, you must specify <code>MaxReadRequestUnits</code>, <code>MaxWriteRequestUnits</code>, or both.</p>
504 pub fn set_on_demand_throughput(mut self, input: ::std::option::Option<crate::types::OnDemandThroughput>) -> Self {
505 self.on_demand_throughput = input;
506 self
507 }
508 /// <p>Updates the maximum number of read and write units for the specified table in on-demand capacity mode. If you use this parameter, you must specify <code>MaxReadRequestUnits</code>, <code>MaxWriteRequestUnits</code>, or both.</p>
509 pub fn get_on_demand_throughput(&self) -> &::std::option::Option<crate::types::OnDemandThroughput> {
510 &self.on_demand_throughput
511 }
512 /// <p>Represents the warm throughput (in read units per second and write units per second) for updating a table.</p>
513 pub fn warm_throughput(mut self, input: crate::types::WarmThroughput) -> Self {
514 self.warm_throughput = ::std::option::Option::Some(input);
515 self
516 }
517 /// <p>Represents the warm throughput (in read units per second and write units per second) for updating a table.</p>
518 pub fn set_warm_throughput(mut self, input: ::std::option::Option<crate::types::WarmThroughput>) -> Self {
519 self.warm_throughput = input;
520 self
521 }
522 /// <p>Represents the warm throughput (in read units per second and write units per second) for updating a table.</p>
523 pub fn get_warm_throughput(&self) -> &::std::option::Option<crate::types::WarmThroughput> {
524 &self.warm_throughput
525 }
526 /// Consumes the builder and constructs a [`UpdateTableInput`](crate::operation::update_table::UpdateTableInput).
527 pub fn build(self) -> ::std::result::Result<crate::operation::update_table::UpdateTableInput, ::aws_smithy_types::error::operation::BuildError> {
528 ::std::result::Result::Ok(crate::operation::update_table::UpdateTableInput {
529 attribute_definitions: self.attribute_definitions,
530 table_name: self.table_name,
531 billing_mode: self.billing_mode,
532 provisioned_throughput: self.provisioned_throughput,
533 global_secondary_index_updates: self.global_secondary_index_updates,
534 stream_specification: self.stream_specification,
535 sse_specification: self.sse_specification,
536 replica_updates: self.replica_updates,
537 table_class: self.table_class,
538 deletion_protection_enabled: self.deletion_protection_enabled,
539 multi_region_consistency: self.multi_region_consistency,
540 global_table_witness_updates: self.global_table_witness_updates,
541 on_demand_throughput: self.on_demand_throughput,
542 warm_throughput: self.warm_throughput,
543 })
544 }
545}