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()
76 .unwrap_or_default()
77 }
78 /// <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>
79 pub fn table_name(&self) -> ::std::option::Option<&str> {
80 self.table_name.as_deref()
81 }
82 /// <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>
83 /// <ul>
84 /// <li>
85 /// <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>
86 /// <li>
87 /// <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>
88 /// </ul>
89 pub fn billing_mode(&self) -> ::std::option::Option<&crate::types::BillingMode> {
90 self.billing_mode.as_ref()
91 }
92 /// <p>The new provisioned throughput settings for the specified table or index.</p>
93 pub fn provisioned_throughput(&self) -> ::std::option::Option<&crate::types::ProvisionedThroughput> {
94 self.provisioned_throughput.as_ref()
95 }
96 /// <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>
97 /// <ul>
98 /// <li>
99 /// <p><code>Create</code> - add a new global secondary index to the table.</p></li>
100 /// <li>
101 /// <p><code>Update</code> - modify the provisioned throughput settings of an existing global secondary index.</p></li>
102 /// <li>
103 /// <p><code>Delete</code> - remove a global secondary index from the table.</p></li>
104 /// </ul>
105 /// <p>You can create or delete only one global secondary index per <code>UpdateTable</code> operation.</p>
106 /// <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>
107 ///
108 /// 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()`.
109 pub fn global_secondary_index_updates(&self) -> &[crate::types::GlobalSecondaryIndexUpdate] {
110 self.global_secondary_index_updates.as_deref()
111 .unwrap_or_default()
112 }
113 /// <p>Represents the DynamoDB Streams configuration for the table.</p><note>
114 /// <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>
115 /// </note>
116 pub fn stream_specification(&self) -> ::std::option::Option<&crate::types::StreamSpecification> {
117 self.stream_specification.as_ref()
118 }
119 /// <p>The new server-side encryption settings for the specified table.</p>
120 pub fn sse_specification(&self) -> ::std::option::Option<&crate::types::SseSpecification> {
121 self.sse_specification.as_ref()
122 }
123 /// <p>A list of replica update actions (create, delete, or update) for the table.</p>
124 ///
125 /// 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()`.
126 pub fn replica_updates(&self) -> &[crate::types::ReplicationGroupUpdate] {
127 self.replica_updates.as_deref()
128 .unwrap_or_default()
129 }
130 /// <p>The table class of the table to be updated. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
131 pub fn table_class(&self) -> ::std::option::Option<&crate::types::TableClass> {
132 self.table_class.as_ref()
133 }
134 /// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
135 pub fn deletion_protection_enabled(&self) -> ::std::option::Option<bool> {
136 self.deletion_protection_enabled
137 }
138 /// <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>
139 /// <p>You can specify one of the following consistency modes:</p>
140 /// <ul>
141 /// <li>
142 /// <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>
143 /// <li>
144 /// <p><code>STRONG</code>: Configures a new global table for multi-Region strong consistency (MRSC).</p></li>
145 /// </ul>
146 /// <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>
147 pub fn multi_region_consistency(&self) -> ::std::option::Option<&crate::types::MultiRegionConsistency> {
148 self.multi_region_consistency.as_ref()
149 }
150 /// <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>
151 /// <ul>
152 /// <li>
153 /// <p><code>Create</code> - add a new witness to the global table.</p></li>
154 /// <li>
155 /// <p><code>Delete</code> - remove a witness from the global table.</p></li>
156 /// </ul>
157 /// <p>You can create or delete only one witness per <code>UpdateTable</code> operation.</p>
158 /// <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>
159 ///
160 /// 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()`.
161 pub fn global_table_witness_updates(&self) -> &[crate::types::GlobalTableWitnessGroupUpdate] {
162 self.global_table_witness_updates.as_deref()
163 .unwrap_or_default()
164 }
165 /// <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>
166 pub fn on_demand_throughput(&self) -> ::std::option::Option<&crate::types::OnDemandThroughput> {
167 self.on_demand_throughput.as_ref()
168 }
169 /// <p>Represents the warm throughput (in read units per second and write units per second) for updating a table.</p>
170 pub fn warm_throughput(&self) -> ::std::option::Option<&crate::types::WarmThroughput> {
171 self.warm_throughput.as_ref()
172 }
173}
174impl UpdateTableInput {
175 /// Creates a new builder-style object to manufacture [`UpdateTableInput`](crate::operation::update_table::UpdateTableInput).
176 pub fn builder() -> crate::operation::update_table::builders::UpdateTableInputBuilder {
177 crate::operation::update_table::builders::UpdateTableInputBuilder::default()
178 }
179}
180
181/// A builder for [`UpdateTableInput`](crate::operation::update_table::UpdateTableInput).
182#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
183#[non_exhaustive]
184pub struct UpdateTableInputBuilder {
185 pub(crate) attribute_definitions: ::std::option::Option<::std::vec::Vec::<crate::types::AttributeDefinition>>,
186 pub(crate) table_name: ::std::option::Option<::std::string::String>,
187 pub(crate) billing_mode: ::std::option::Option<crate::types::BillingMode>,
188 pub(crate) provisioned_throughput: ::std::option::Option<crate::types::ProvisionedThroughput>,
189 pub(crate) global_secondary_index_updates: ::std::option::Option<::std::vec::Vec::<crate::types::GlobalSecondaryIndexUpdate>>,
190 pub(crate) stream_specification: ::std::option::Option<crate::types::StreamSpecification>,
191 pub(crate) sse_specification: ::std::option::Option<crate::types::SseSpecification>,
192 pub(crate) replica_updates: ::std::option::Option<::std::vec::Vec::<crate::types::ReplicationGroupUpdate>>,
193 pub(crate) table_class: ::std::option::Option<crate::types::TableClass>,
194 pub(crate) deletion_protection_enabled: ::std::option::Option<bool>,
195 pub(crate) multi_region_consistency: ::std::option::Option<crate::types::MultiRegionConsistency>,
196 pub(crate) global_table_witness_updates: ::std::option::Option<::std::vec::Vec::<crate::types::GlobalTableWitnessGroupUpdate>>,
197 pub(crate) on_demand_throughput: ::std::option::Option<crate::types::OnDemandThroughput>,
198 pub(crate) warm_throughput: ::std::option::Option<crate::types::WarmThroughput>,
199}
200impl UpdateTableInputBuilder {
201 /// Appends an item to `attribute_definitions`.
202 ///
203 /// To override the contents of this collection use [`set_attribute_definitions`](Self::set_attribute_definitions).
204 ///
205 /// <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>
206 pub fn attribute_definitions(mut self, input: crate::types::AttributeDefinition) -> Self {
207 let mut v = self.attribute_definitions.unwrap_or_default();
208 v.push(input);
209 self.attribute_definitions = ::std::option::Option::Some(v);
210 self
211 }
212 /// <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>
213 pub fn set_attribute_definitions(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::AttributeDefinition>>) -> Self {
214 self.attribute_definitions = input; self
215 }
216 /// <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>
217 pub fn get_attribute_definitions(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::AttributeDefinition>> {
218 &self.attribute_definitions
219 }
220 /// <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>
221 /// This field is required.
222 pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
223 self.table_name = ::std::option::Option::Some(input.into());
224 self
225 }
226 /// <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>
227 pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
228 self.table_name = input; self
229 }
230 /// <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>
231 pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
232 &self.table_name
233 }
234 /// <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>
235 /// <ul>
236 /// <li>
237 /// <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>
238 /// <li>
239 /// <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>
240 /// </ul>
241 pub fn billing_mode(mut self, input: crate::types::BillingMode) -> Self {
242 self.billing_mode = ::std::option::Option::Some(input);
243 self
244 }
245 /// <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>
246 /// <ul>
247 /// <li>
248 /// <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>
249 /// <li>
250 /// <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>
251 /// </ul>
252 pub fn set_billing_mode(mut self, input: ::std::option::Option<crate::types::BillingMode>) -> Self {
253 self.billing_mode = input; self
254 }
255 /// <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>
256 /// <ul>
257 /// <li>
258 /// <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>
259 /// <li>
260 /// <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>
261 /// </ul>
262 pub fn get_billing_mode(&self) -> &::std::option::Option<crate::types::BillingMode> {
263 &self.billing_mode
264 }
265 /// <p>The new provisioned throughput settings for the specified table or index.</p>
266 pub fn provisioned_throughput(mut self, input: crate::types::ProvisionedThroughput) -> Self {
267 self.provisioned_throughput = ::std::option::Option::Some(input);
268 self
269 }
270 /// <p>The new provisioned throughput settings for the specified table or index.</p>
271 pub fn set_provisioned_throughput(mut self, input: ::std::option::Option<crate::types::ProvisionedThroughput>) -> Self {
272 self.provisioned_throughput = input; 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(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::GlobalSecondaryIndexUpdate>>) -> Self {
311 self.global_secondary_index_updates = input; self
312 }
313 /// <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>
314 /// <ul>
315 /// <li>
316 /// <p><code>Create</code> - add a new global secondary index to the table.</p></li>
317 /// <li>
318 /// <p><code>Update</code> - modify the provisioned throughput settings of an existing global secondary index.</p></li>
319 /// <li>
320 /// <p><code>Delete</code> - remove a global secondary index from the table.</p></li>
321 /// </ul>
322 /// <p>You can create or delete only one global secondary index per <code>UpdateTable</code> operation.</p>
323 /// <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>
324 pub fn get_global_secondary_index_updates(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::GlobalSecondaryIndexUpdate>> {
325 &self.global_secondary_index_updates
326 }
327 /// <p>Represents the DynamoDB Streams configuration for the table.</p><note>
328 /// <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>
329 /// </note>
330 pub fn stream_specification(mut self, input: crate::types::StreamSpecification) -> Self {
331 self.stream_specification = ::std::option::Option::Some(input);
332 self
333 }
334 /// <p>Represents the DynamoDB Streams configuration for the table.</p><note>
335 /// <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>
336 /// </note>
337 pub fn set_stream_specification(mut self, input: ::std::option::Option<crate::types::StreamSpecification>) -> Self {
338 self.stream_specification = input; self
339 }
340 /// <p>Represents the DynamoDB Streams configuration for the table.</p><note>
341 /// <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>
342 /// </note>
343 pub fn get_stream_specification(&self) -> &::std::option::Option<crate::types::StreamSpecification> {
344 &self.stream_specification
345 }
346 /// <p>The new server-side encryption settings for the specified table.</p>
347 pub fn sse_specification(mut self, input: crate::types::SseSpecification) -> Self {
348 self.sse_specification = ::std::option::Option::Some(input);
349 self
350 }
351 /// <p>The new server-side encryption settings for the specified table.</p>
352 pub fn set_sse_specification(mut self, input: ::std::option::Option<crate::types::SseSpecification>) -> Self {
353 self.sse_specification = input; self
354 }
355 /// <p>The new server-side encryption settings for the specified table.</p>
356 pub fn get_sse_specification(&self) -> &::std::option::Option<crate::types::SseSpecification> {
357 &self.sse_specification
358 }
359 /// Appends an item to `replica_updates`.
360 ///
361 /// To override the contents of this collection use [`set_replica_updates`](Self::set_replica_updates).
362 ///
363 /// <p>A list of replica update actions (create, delete, or update) for the table.</p>
364 pub fn replica_updates(mut self, input: crate::types::ReplicationGroupUpdate) -> Self {
365 let mut v = self.replica_updates.unwrap_or_default();
366 v.push(input);
367 self.replica_updates = ::std::option::Option::Some(v);
368 self
369 }
370 /// <p>A list of replica update actions (create, delete, or update) for the table.</p>
371 pub fn set_replica_updates(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::ReplicationGroupUpdate>>) -> Self {
372 self.replica_updates = input; self
373 }
374 /// <p>A list of replica update actions (create, delete, or update) for the table.</p>
375 pub fn get_replica_updates(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::ReplicationGroupUpdate>> {
376 &self.replica_updates
377 }
378 /// <p>The table class of the table to be updated. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
379 pub fn table_class(mut self, input: crate::types::TableClass) -> Self {
380 self.table_class = ::std::option::Option::Some(input);
381 self
382 }
383 /// <p>The table class of the table to be updated. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
384 pub fn set_table_class(mut self, input: ::std::option::Option<crate::types::TableClass>) -> Self {
385 self.table_class = input; self
386 }
387 /// <p>The table class of the table to be updated. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
388 pub fn get_table_class(&self) -> &::std::option::Option<crate::types::TableClass> {
389 &self.table_class
390 }
391 /// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
392 pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
393 self.deletion_protection_enabled = ::std::option::Option::Some(input);
394 self
395 }
396 /// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
397 pub fn set_deletion_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
398 self.deletion_protection_enabled = input; self
399 }
400 /// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
401 pub fn get_deletion_protection_enabled(&self) -> &::std::option::Option<bool> {
402 &self.deletion_protection_enabled
403 }
404 /// <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>
405 /// <p>You can specify one of the following consistency modes:</p>
406 /// <ul>
407 /// <li>
408 /// <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>
409 /// <li>
410 /// <p><code>STRONG</code>: Configures a new global table for multi-Region strong consistency (MRSC).</p></li>
411 /// </ul>
412 /// <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>
413 pub fn multi_region_consistency(mut self, input: crate::types::MultiRegionConsistency) -> Self {
414 self.multi_region_consistency = ::std::option::Option::Some(input);
415 self
416 }
417 /// <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>
418 /// <p>You can specify one of the following consistency modes:</p>
419 /// <ul>
420 /// <li>
421 /// <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>
422 /// <li>
423 /// <p><code>STRONG</code>: Configures a new global table for multi-Region strong consistency (MRSC).</p></li>
424 /// </ul>
425 /// <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>
426 pub fn set_multi_region_consistency(mut self, input: ::std::option::Option<crate::types::MultiRegionConsistency>) -> Self {
427 self.multi_region_consistency = input; self
428 }
429 /// <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>
430 /// <p>You can specify one of the following consistency modes:</p>
431 /// <ul>
432 /// <li>
433 /// <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>
434 /// <li>
435 /// <p><code>STRONG</code>: Configures a new global table for multi-Region strong consistency (MRSC).</p></li>
436 /// </ul>
437 /// <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>
438 pub fn get_multi_region_consistency(&self) -> &::std::option::Option<crate::types::MultiRegionConsistency> {
439 &self.multi_region_consistency
440 }
441 /// Appends an item to `global_table_witness_updates`.
442 ///
443 /// To override the contents of this collection use [`set_global_table_witness_updates`](Self::set_global_table_witness_updates).
444 ///
445 /// <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>
446 /// <ul>
447 /// <li>
448 /// <p><code>Create</code> - add a new witness to the global table.</p></li>
449 /// <li>
450 /// <p><code>Delete</code> - remove a witness from the global table.</p></li>
451 /// </ul>
452 /// <p>You can create or delete only one witness per <code>UpdateTable</code> operation.</p>
453 /// <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>
454 pub fn global_table_witness_updates(mut self, input: crate::types::GlobalTableWitnessGroupUpdate) -> Self {
455 let mut v = self.global_table_witness_updates.unwrap_or_default();
456 v.push(input);
457 self.global_table_witness_updates = ::std::option::Option::Some(v);
458 self
459 }
460 /// <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>
461 /// <ul>
462 /// <li>
463 /// <p><code>Create</code> - add a new witness to the global table.</p></li>
464 /// <li>
465 /// <p><code>Delete</code> - remove a witness from the global table.</p></li>
466 /// </ul>
467 /// <p>You can create or delete only one witness per <code>UpdateTable</code> operation.</p>
468 /// <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>
469 pub fn set_global_table_witness_updates(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::GlobalTableWitnessGroupUpdate>>) -> Self {
470 self.global_table_witness_updates = input; self
471 }
472 /// <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>
473 /// <ul>
474 /// <li>
475 /// <p><code>Create</code> - add a new witness to the global table.</p></li>
476 /// <li>
477 /// <p><code>Delete</code> - remove a witness from the global table.</p></li>
478 /// </ul>
479 /// <p>You can create or delete only one witness per <code>UpdateTable</code> operation.</p>
480 /// <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>
481 pub fn get_global_table_witness_updates(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::GlobalTableWitnessGroupUpdate>> {
482 &self.global_table_witness_updates
483 }
484 /// <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>
485 pub fn on_demand_throughput(mut self, input: crate::types::OnDemandThroughput) -> Self {
486 self.on_demand_throughput = ::std::option::Option::Some(input);
487 self
488 }
489 /// <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>
490 pub fn set_on_demand_throughput(mut self, input: ::std::option::Option<crate::types::OnDemandThroughput>) -> Self {
491 self.on_demand_throughput = input; self
492 }
493 /// <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>
494 pub fn get_on_demand_throughput(&self) -> &::std::option::Option<crate::types::OnDemandThroughput> {
495 &self.on_demand_throughput
496 }
497 /// <p>Represents the warm throughput (in read units per second and write units per second) for updating a table.</p>
498 pub fn warm_throughput(mut self, input: crate::types::WarmThroughput) -> Self {
499 self.warm_throughput = ::std::option::Option::Some(input);
500 self
501 }
502 /// <p>Represents the warm throughput (in read units per second and write units per second) for updating a table.</p>
503 pub fn set_warm_throughput(mut self, input: ::std::option::Option<crate::types::WarmThroughput>) -> Self {
504 self.warm_throughput = input; self
505 }
506 /// <p>Represents the warm throughput (in read units per second and write units per second) for updating a table.</p>
507 pub fn get_warm_throughput(&self) -> &::std::option::Option<crate::types::WarmThroughput> {
508 &self.warm_throughput
509 }
510 /// Consumes the builder and constructs a [`UpdateTableInput`](crate::operation::update_table::UpdateTableInput).
511 pub fn build(self) -> ::std::result::Result<crate::operation::update_table::UpdateTableInput, ::aws_smithy_types::error::operation::BuildError> {
512 ::std::result::Result::Ok(
513 crate::operation::update_table::UpdateTableInput {
514 attribute_definitions: self.attribute_definitions
515 ,
516 table_name: self.table_name
517 ,
518 billing_mode: self.billing_mode
519 ,
520 provisioned_throughput: self.provisioned_throughput
521 ,
522 global_secondary_index_updates: self.global_secondary_index_updates
523 ,
524 stream_specification: self.stream_specification
525 ,
526 sse_specification: self.sse_specification
527 ,
528 replica_updates: self.replica_updates
529 ,
530 table_class: self.table_class
531 ,
532 deletion_protection_enabled: self.deletion_protection_enabled
533 ,
534 multi_region_consistency: self.multi_region_consistency
535 ,
536 global_table_witness_updates: self.global_table_witness_updates
537 ,
538 on_demand_throughput: self.on_demand_throughput
539 ,
540 warm_throughput: self.warm_throughput
541 ,
542 }
543 )
544 }
545}
546