aws_sdk_dynamodb/operation/create_table/
_create_table_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents the input of a <code>CreateTable</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateTableInput  {
7    /// <p>An array of attributes that describe the key schema for the table and indexes.</p>
8    pub attribute_definitions: ::std::option::Option<::std::vec::Vec::<crate::types::AttributeDefinition>>,
9    /// <p>The name of the table to create. 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>Specifies the attributes that make up the primary key for a table or an index. The attributes in <code>KeySchema</code> must also be defined in the <code>AttributeDefinitions</code> array. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html">Data Model</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
12    /// <p>Each <code>KeySchemaElement</code> in the array is composed of:</p>
13    /// <ul>
14    /// <li>
15    /// <p><code>AttributeName</code> - The name of this key attribute.</p></li>
16    /// <li>
17    /// <p><code>KeyType</code> - The role that the key attribute will assume:</p>
18    /// <ul>
19    /// <li>
20    /// <p><code>HASH</code> - partition key</p></li>
21    /// <li>
22    /// <p><code>RANGE</code> - sort key</p></li>
23    /// </ul></li>
24    /// </ul><note>
25    /// <p>The partition key of an item is also known as its <i>hash attribute</i>. The term "hash attribute" derives from the DynamoDB usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values.</p>
26    /// <p>The sort key of an item is also known as its <i>range attribute</i>. The term "range attribute" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.</p>
27    /// </note>
28    /// <p>For a simple primary key (partition key), you must provide exactly one element with a <code>KeyType</code> of <code>HASH</code>.</p>
29    /// <p>For a composite primary key (partition key and sort key), you must provide exactly two elements, in this order: The first element must have a <code>KeyType</code> of <code>HASH</code>, and the second element must have a <code>KeyType</code> of <code>RANGE</code>.</p>
30    /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#WorkingWithTables.primary.key">Working with Tables</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
31    pub key_schema: ::std::option::Option<::std::vec::Vec::<crate::types::KeySchemaElement>>,
32    /// <p>One or more local secondary indexes (the maximum is 5) to be created on the table. Each index is scoped to a given partition key value. There is a 10 GB size limit per partition key value; otherwise, the size of a local secondary index is unconstrained.</p>
33    /// <p>Each local secondary index in the array includes the following:</p>
34    /// <ul>
35    /// <li>
36    /// <p><code>IndexName</code> - The name of the local secondary index. Must be unique only for this table.</p>
37    /// <p></p></li>
38    /// <li>
39    /// <p><code>KeySchema</code> - Specifies the key schema for the local secondary index. The key schema must begin with the same partition key as the table.</p></li>
40    /// <li>
41    /// <p><code>Projection</code> - Specifies attributes that are copied (projected) from the table into the index. These are in addition to the primary key attributes and index key attributes, which are automatically projected. Each attribute specification is composed of:</p>
42    /// <ul>
43    /// <li>
44    /// <p><code>ProjectionType</code> - One of the following:</p>
45    /// <ul>
46    /// <li>
47    /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
48    /// <li>
49    /// <p><code>INCLUDE</code> - Only the specified table attributes are projected into the index. The list of projected attributes is in <code>NonKeyAttributes</code>.</p></li>
50    /// <li>
51    /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
52    /// </ul></li>
53    /// <li>
54    /// <p><code>NonKeyAttributes</code> - A list of one or more non-key attribute names that are projected into the secondary index. The total count of attributes provided in <code>NonKeyAttributes</code>, summed across all of the secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total. This limit only applies when you specify the ProjectionType of <code>INCLUDE</code>. You still can specify the ProjectionType of <code>ALL</code> to project all attributes from the source table, even if the table has more than 100 attributes.</p></li>
55    /// </ul></li>
56    /// </ul>
57    pub local_secondary_indexes: ::std::option::Option<::std::vec::Vec::<crate::types::LocalSecondaryIndex>>,
58    /// <p>One or more global secondary indexes (the maximum is 20) to be created on the table. Each global secondary index in the array includes the following:</p>
59    /// <ul>
60    /// <li>
61    /// <p><code>IndexName</code> - The name of the global secondary index. Must be unique only for this table.</p>
62    /// <p></p></li>
63    /// <li>
64    /// <p><code>KeySchema</code> - Specifies the key schema for the global secondary index. Each global secondary index supports up to 4 partition keys and up to 4 sort keys.</p></li>
65    /// <li>
66    /// <p><code>Projection</code> - Specifies attributes that are copied (projected) from the table into the index. These are in addition to the primary key attributes and index key attributes, which are automatically projected. Each attribute specification is composed of:</p>
67    /// <ul>
68    /// <li>
69    /// <p><code>ProjectionType</code> - One of the following:</p>
70    /// <ul>
71    /// <li>
72    /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
73    /// <li>
74    /// <p><code>INCLUDE</code> - Only the specified table attributes are projected into the index. The list of projected attributes is in <code>NonKeyAttributes</code>.</p></li>
75    /// <li>
76    /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
77    /// </ul></li>
78    /// <li>
79    /// <p><code>NonKeyAttributes</code> - A list of one or more non-key attribute names that are projected into the secondary index. The total count of attributes provided in <code>NonKeyAttributes</code>, summed across all of the secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total. This limit only applies when you specify the ProjectionType of <code>INCLUDE</code>. You still can specify the ProjectionType of <code>ALL</code> to project all attributes from the source table, even if the table has more than 100 attributes.</p></li>
80    /// </ul></li>
81    /// <li>
82    /// <p><code>ProvisionedThroughput</code> - The provisioned throughput settings for the global secondary index, consisting of read and write capacity units.</p></li>
83    /// </ul>
84    pub global_secondary_indexes: ::std::option::Option<::std::vec::Vec::<crate::types::GlobalSecondaryIndex>>,
85    /// <p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
86    /// <ul>
87    /// <li>
88    /// <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>
89    /// <li>
90    /// <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>
91    /// </ul>
92    pub billing_mode: ::std::option::Option<crate::types::BillingMode>,
93    /// <p>Represents the provisioned throughput settings for a specified table or index. The settings can be modified using the <code>UpdateTable</code> operation.</p>
94    /// <p>If you set BillingMode as <code>PROVISIONED</code>, you must specify this property. If you set BillingMode as <code>PAY_PER_REQUEST</code>, you cannot specify this property.</p>
95    /// <p>For current minimum and maximum provisioned throughput values, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html">Service, Account, and Table Quotas</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
96    pub provisioned_throughput: ::std::option::Option<crate::types::ProvisionedThroughput>,
97    /// <p>The settings for DynamoDB Streams on the table. These settings consist of:</p>
98    /// <ul>
99    /// <li>
100    /// <p><code>StreamEnabled</code> - Indicates whether DynamoDB Streams is to be enabled (true) or disabled (false).</p></li>
101    /// <li>
102    /// <p><code>StreamViewType</code> - When an item in the table is modified, <code>StreamViewType</code> determines what information is written to the table's stream. Valid values for <code>StreamViewType</code> are:</p>
103    /// <ul>
104    /// <li>
105    /// <p><code>KEYS_ONLY</code> - Only the key attributes of the modified item are written to the stream.</p></li>
106    /// <li>
107    /// <p><code>NEW_IMAGE</code> - The entire item, as it appears after it was modified, is written to the stream.</p></li>
108    /// <li>
109    /// <p><code>OLD_IMAGE</code> - The entire item, as it appeared before it was modified, is written to the stream.</p></li>
110    /// <li>
111    /// <p><code>NEW_AND_OLD_IMAGES</code> - Both the new and the old item images of the item are written to the stream.</p></li>
112    /// </ul></li>
113    /// </ul>
114    pub stream_specification: ::std::option::Option<crate::types::StreamSpecification>,
115    /// <p>Represents the settings used to enable server-side encryption.</p>
116    pub sse_specification: ::std::option::Option<crate::types::SseSpecification>,
117    /// <p>A list of key-value pairs to label the table. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html">Tagging for DynamoDB</a>.</p>
118    pub tags: ::std::option::Option<::std::vec::Vec::<crate::types::Tag>>,
119    /// <p>The table class of the new table. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
120    pub table_class: ::std::option::Option<crate::types::TableClass>,
121    /// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
122    pub deletion_protection_enabled: ::std::option::Option<bool>,
123    /// <p>Represents the warm throughput (in read units per second and write units per second) for creating a table.</p>
124    pub warm_throughput: ::std::option::Option<crate::types::WarmThroughput>,
125    /// <p>An Amazon Web Services resource-based policy document in JSON format that will be attached to the table.</p>
126    /// <p>When you attach a resource-based policy while creating a table, the policy application is <i>strongly consistent</i>.</p>
127    /// <p>The maximum size supported for a resource-based policy document is 20 KB. DynamoDB counts whitespaces when calculating the size of a policy against this limit. For a full list of all considerations that apply for resource-based policies, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-considerations.html">Resource-based policy considerations</a>.</p><note>
128    /// <p>You need to specify the <code>CreateTable</code> and <code>PutResourcePolicy</code> IAM actions for authorizing a user to create a table with a resource-based policy.</p>
129    /// </note>
130    pub resource_policy: ::std::option::Option<::std::string::String>,
131    /// <p>Sets 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>
132    pub on_demand_throughput: ::std::option::Option<crate::types::OnDemandThroughput>,
133    /// <p>The Amazon Resource Name (ARN) of the source table used for the creation of a multi-account global table.</p>
134    pub global_table_source_arn: ::std::option::Option<::std::string::String>,
135    /// <p>Controls the settings synchronization mode for the global table. For multi-account global tables, this parameter is required and the only supported value is ENABLED. For same-account global tables, this parameter is set to ENABLED_WITH_OVERRIDES.</p>
136    pub global_table_settings_replication_mode: ::std::option::Option<crate::types::GlobalTableSettingsReplicationMode>,
137}
138impl  CreateTableInput  {
139    /// <p>An array of attributes that describe the key schema for the table and indexes.</p>
140    ///
141    /// 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()`.
142    pub fn attribute_definitions(&self) -> &[crate::types::AttributeDefinition] {
143        self.attribute_definitions.as_deref()
144        .unwrap_or_default()
145    }
146    /// <p>The name of the table to create. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
147    pub fn table_name(&self) -> ::std::option::Option<&str> {
148        self.table_name.as_deref()
149    }
150    /// <p>Specifies the attributes that make up the primary key for a table or an index. The attributes in <code>KeySchema</code> must also be defined in the <code>AttributeDefinitions</code> array. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html">Data Model</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
151    /// <p>Each <code>KeySchemaElement</code> in the array is composed of:</p>
152    /// <ul>
153    /// <li>
154    /// <p><code>AttributeName</code> - The name of this key attribute.</p></li>
155    /// <li>
156    /// <p><code>KeyType</code> - The role that the key attribute will assume:</p>
157    /// <ul>
158    /// <li>
159    /// <p><code>HASH</code> - partition key</p></li>
160    /// <li>
161    /// <p><code>RANGE</code> - sort key</p></li>
162    /// </ul></li>
163    /// </ul><note>
164    /// <p>The partition key of an item is also known as its <i>hash attribute</i>. The term "hash attribute" derives from the DynamoDB usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values.</p>
165    /// <p>The sort key of an item is also known as its <i>range attribute</i>. The term "range attribute" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.</p>
166    /// </note>
167    /// <p>For a simple primary key (partition key), you must provide exactly one element with a <code>KeyType</code> of <code>HASH</code>.</p>
168    /// <p>For a composite primary key (partition key and sort key), you must provide exactly two elements, in this order: The first element must have a <code>KeyType</code> of <code>HASH</code>, and the second element must have a <code>KeyType</code> of <code>RANGE</code>.</p>
169    /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#WorkingWithTables.primary.key">Working with Tables</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
170    ///
171    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.key_schema.is_none()`.
172    pub fn key_schema(&self) -> &[crate::types::KeySchemaElement] {
173        self.key_schema.as_deref()
174        .unwrap_or_default()
175    }
176    /// <p>One or more local secondary indexes (the maximum is 5) to be created on the table. Each index is scoped to a given partition key value. There is a 10 GB size limit per partition key value; otherwise, the size of a local secondary index is unconstrained.</p>
177    /// <p>Each local secondary index in the array includes the following:</p>
178    /// <ul>
179    /// <li>
180    /// <p><code>IndexName</code> - The name of the local secondary index. Must be unique only for this table.</p>
181    /// <p></p></li>
182    /// <li>
183    /// <p><code>KeySchema</code> - Specifies the key schema for the local secondary index. The key schema must begin with the same partition key as the table.</p></li>
184    /// <li>
185    /// <p><code>Projection</code> - Specifies attributes that are copied (projected) from the table into the index. These are in addition to the primary key attributes and index key attributes, which are automatically projected. Each attribute specification is composed of:</p>
186    /// <ul>
187    /// <li>
188    /// <p><code>ProjectionType</code> - One of the following:</p>
189    /// <ul>
190    /// <li>
191    /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
192    /// <li>
193    /// <p><code>INCLUDE</code> - Only the specified table attributes are projected into the index. The list of projected attributes is in <code>NonKeyAttributes</code>.</p></li>
194    /// <li>
195    /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
196    /// </ul></li>
197    /// <li>
198    /// <p><code>NonKeyAttributes</code> - A list of one or more non-key attribute names that are projected into the secondary index. The total count of attributes provided in <code>NonKeyAttributes</code>, summed across all of the secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total. This limit only applies when you specify the ProjectionType of <code>INCLUDE</code>. You still can specify the ProjectionType of <code>ALL</code> to project all attributes from the source table, even if the table has more than 100 attributes.</p></li>
199    /// </ul></li>
200    /// </ul>
201    ///
202    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.local_secondary_indexes.is_none()`.
203    pub fn local_secondary_indexes(&self) -> &[crate::types::LocalSecondaryIndex] {
204        self.local_secondary_indexes.as_deref()
205        .unwrap_or_default()
206    }
207    /// <p>One or more global secondary indexes (the maximum is 20) to be created on the table. Each global secondary index in the array includes the following:</p>
208    /// <ul>
209    /// <li>
210    /// <p><code>IndexName</code> - The name of the global secondary index. Must be unique only for this table.</p>
211    /// <p></p></li>
212    /// <li>
213    /// <p><code>KeySchema</code> - Specifies the key schema for the global secondary index. Each global secondary index supports up to 4 partition keys and up to 4 sort keys.</p></li>
214    /// <li>
215    /// <p><code>Projection</code> - Specifies attributes that are copied (projected) from the table into the index. These are in addition to the primary key attributes and index key attributes, which are automatically projected. Each attribute specification is composed of:</p>
216    /// <ul>
217    /// <li>
218    /// <p><code>ProjectionType</code> - One of the following:</p>
219    /// <ul>
220    /// <li>
221    /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
222    /// <li>
223    /// <p><code>INCLUDE</code> - Only the specified table attributes are projected into the index. The list of projected attributes is in <code>NonKeyAttributes</code>.</p></li>
224    /// <li>
225    /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
226    /// </ul></li>
227    /// <li>
228    /// <p><code>NonKeyAttributes</code> - A list of one or more non-key attribute names that are projected into the secondary index. The total count of attributes provided in <code>NonKeyAttributes</code>, summed across all of the secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total. This limit only applies when you specify the ProjectionType of <code>INCLUDE</code>. You still can specify the ProjectionType of <code>ALL</code> to project all attributes from the source table, even if the table has more than 100 attributes.</p></li>
229    /// </ul></li>
230    /// <li>
231    /// <p><code>ProvisionedThroughput</code> - The provisioned throughput settings for the global secondary index, consisting of read and write capacity units.</p></li>
232    /// </ul>
233    ///
234    /// 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_indexes.is_none()`.
235    pub fn global_secondary_indexes(&self) -> &[crate::types::GlobalSecondaryIndex] {
236        self.global_secondary_indexes.as_deref()
237        .unwrap_or_default()
238    }
239    /// <p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
240    /// <ul>
241    /// <li>
242    /// <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>
243    /// <li>
244    /// <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>
245    /// </ul>
246    pub fn billing_mode(&self) -> ::std::option::Option<&crate::types::BillingMode> {
247        self.billing_mode.as_ref()
248    }
249    /// <p>Represents the provisioned throughput settings for a specified table or index. The settings can be modified using the <code>UpdateTable</code> operation.</p>
250    /// <p>If you set BillingMode as <code>PROVISIONED</code>, you must specify this property. If you set BillingMode as <code>PAY_PER_REQUEST</code>, you cannot specify this property.</p>
251    /// <p>For current minimum and maximum provisioned throughput values, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html">Service, Account, and Table Quotas</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
252    pub fn provisioned_throughput(&self) -> ::std::option::Option<&crate::types::ProvisionedThroughput> {
253        self.provisioned_throughput.as_ref()
254    }
255    /// <p>The settings for DynamoDB Streams on the table. These settings consist of:</p>
256    /// <ul>
257    /// <li>
258    /// <p><code>StreamEnabled</code> - Indicates whether DynamoDB Streams is to be enabled (true) or disabled (false).</p></li>
259    /// <li>
260    /// <p><code>StreamViewType</code> - When an item in the table is modified, <code>StreamViewType</code> determines what information is written to the table's stream. Valid values for <code>StreamViewType</code> are:</p>
261    /// <ul>
262    /// <li>
263    /// <p><code>KEYS_ONLY</code> - Only the key attributes of the modified item are written to the stream.</p></li>
264    /// <li>
265    /// <p><code>NEW_IMAGE</code> - The entire item, as it appears after it was modified, is written to the stream.</p></li>
266    /// <li>
267    /// <p><code>OLD_IMAGE</code> - The entire item, as it appeared before it was modified, is written to the stream.</p></li>
268    /// <li>
269    /// <p><code>NEW_AND_OLD_IMAGES</code> - Both the new and the old item images of the item are written to the stream.</p></li>
270    /// </ul></li>
271    /// </ul>
272    pub fn stream_specification(&self) -> ::std::option::Option<&crate::types::StreamSpecification> {
273        self.stream_specification.as_ref()
274    }
275    /// <p>Represents the settings used to enable server-side encryption.</p>
276    pub fn sse_specification(&self) -> ::std::option::Option<&crate::types::SseSpecification> {
277        self.sse_specification.as_ref()
278    }
279    /// <p>A list of key-value pairs to label the table. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html">Tagging for DynamoDB</a>.</p>
280    ///
281    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
282    pub fn tags(&self) -> &[crate::types::Tag] {
283        self.tags.as_deref()
284        .unwrap_or_default()
285    }
286    /// <p>The table class of the new table. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
287    pub fn table_class(&self) -> ::std::option::Option<&crate::types::TableClass> {
288        self.table_class.as_ref()
289    }
290    /// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
291    pub fn deletion_protection_enabled(&self) -> ::std::option::Option<bool> {
292        self.deletion_protection_enabled
293    }
294    /// <p>Represents the warm throughput (in read units per second and write units per second) for creating a table.</p>
295    pub fn warm_throughput(&self) -> ::std::option::Option<&crate::types::WarmThroughput> {
296        self.warm_throughput.as_ref()
297    }
298    /// <p>An Amazon Web Services resource-based policy document in JSON format that will be attached to the table.</p>
299    /// <p>When you attach a resource-based policy while creating a table, the policy application is <i>strongly consistent</i>.</p>
300    /// <p>The maximum size supported for a resource-based policy document is 20 KB. DynamoDB counts whitespaces when calculating the size of a policy against this limit. For a full list of all considerations that apply for resource-based policies, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-considerations.html">Resource-based policy considerations</a>.</p><note>
301    /// <p>You need to specify the <code>CreateTable</code> and <code>PutResourcePolicy</code> IAM actions for authorizing a user to create a table with a resource-based policy.</p>
302    /// </note>
303    pub fn resource_policy(&self) -> ::std::option::Option<&str> {
304        self.resource_policy.as_deref()
305    }
306    /// <p>Sets 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>
307    pub fn on_demand_throughput(&self) -> ::std::option::Option<&crate::types::OnDemandThroughput> {
308        self.on_demand_throughput.as_ref()
309    }
310    /// <p>The Amazon Resource Name (ARN) of the source table used for the creation of a multi-account global table.</p>
311    pub fn global_table_source_arn(&self) -> ::std::option::Option<&str> {
312        self.global_table_source_arn.as_deref()
313    }
314    /// <p>Controls the settings synchronization mode for the global table. For multi-account global tables, this parameter is required and the only supported value is ENABLED. For same-account global tables, this parameter is set to ENABLED_WITH_OVERRIDES.</p>
315    pub fn global_table_settings_replication_mode(&self) -> ::std::option::Option<&crate::types::GlobalTableSettingsReplicationMode> {
316        self.global_table_settings_replication_mode.as_ref()
317    }
318}
319impl CreateTableInput {
320    /// Creates a new builder-style object to manufacture [`CreateTableInput`](crate::operation::create_table::CreateTableInput).
321    pub fn builder() -> crate::operation::create_table::builders::CreateTableInputBuilder {
322        crate::operation::create_table::builders::CreateTableInputBuilder::default()
323    }
324}
325
326/// A builder for [`CreateTableInput`](crate::operation::create_table::CreateTableInput).
327#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
328#[non_exhaustive]
329pub struct CreateTableInputBuilder {
330    pub(crate) attribute_definitions: ::std::option::Option<::std::vec::Vec::<crate::types::AttributeDefinition>>,
331    pub(crate) table_name: ::std::option::Option<::std::string::String>,
332    pub(crate) key_schema: ::std::option::Option<::std::vec::Vec::<crate::types::KeySchemaElement>>,
333    pub(crate) local_secondary_indexes: ::std::option::Option<::std::vec::Vec::<crate::types::LocalSecondaryIndex>>,
334    pub(crate) global_secondary_indexes: ::std::option::Option<::std::vec::Vec::<crate::types::GlobalSecondaryIndex>>,
335    pub(crate) billing_mode: ::std::option::Option<crate::types::BillingMode>,
336    pub(crate) provisioned_throughput: ::std::option::Option<crate::types::ProvisionedThroughput>,
337    pub(crate) stream_specification: ::std::option::Option<crate::types::StreamSpecification>,
338    pub(crate) sse_specification: ::std::option::Option<crate::types::SseSpecification>,
339    pub(crate) tags: ::std::option::Option<::std::vec::Vec::<crate::types::Tag>>,
340    pub(crate) table_class: ::std::option::Option<crate::types::TableClass>,
341    pub(crate) deletion_protection_enabled: ::std::option::Option<bool>,
342    pub(crate) warm_throughput: ::std::option::Option<crate::types::WarmThroughput>,
343    pub(crate) resource_policy: ::std::option::Option<::std::string::String>,
344    pub(crate) on_demand_throughput: ::std::option::Option<crate::types::OnDemandThroughput>,
345    pub(crate) global_table_source_arn: ::std::option::Option<::std::string::String>,
346    pub(crate) global_table_settings_replication_mode: ::std::option::Option<crate::types::GlobalTableSettingsReplicationMode>,
347}
348impl CreateTableInputBuilder {
349    /// Appends an item to `attribute_definitions`.
350    ///
351    /// To override the contents of this collection use [`set_attribute_definitions`](Self::set_attribute_definitions).
352    ///
353    /// <p>An array of attributes that describe the key schema for the table and indexes.</p>
354    pub fn attribute_definitions(mut self, input: crate::types::AttributeDefinition) -> Self {
355        let mut v = self.attribute_definitions.unwrap_or_default();
356                        v.push(input);
357                        self.attribute_definitions = ::std::option::Option::Some(v);
358                        self
359    }
360    /// <p>An array of attributes that describe the key schema for the table and indexes.</p>
361    pub fn set_attribute_definitions(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::AttributeDefinition>>) -> Self {
362        self.attribute_definitions = input; self
363    }
364    /// <p>An array of attributes that describe the key schema for the table and indexes.</p>
365    pub fn get_attribute_definitions(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::AttributeDefinition>> {
366        &self.attribute_definitions
367    }
368    /// <p>The name of the table to create. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
369    /// This field is required.
370    pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
371        self.table_name = ::std::option::Option::Some(input.into());
372        self
373    }
374    /// <p>The name of the table to create. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
375    pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
376        self.table_name = input; self
377    }
378    /// <p>The name of the table to create. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
379    pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
380        &self.table_name
381    }
382    /// Appends an item to `key_schema`.
383    ///
384    /// To override the contents of this collection use [`set_key_schema`](Self::set_key_schema).
385    ///
386    /// <p>Specifies the attributes that make up the primary key for a table or an index. The attributes in <code>KeySchema</code> must also be defined in the <code>AttributeDefinitions</code> array. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html">Data Model</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
387    /// <p>Each <code>KeySchemaElement</code> in the array is composed of:</p>
388    /// <ul>
389    /// <li>
390    /// <p><code>AttributeName</code> - The name of this key attribute.</p></li>
391    /// <li>
392    /// <p><code>KeyType</code> - The role that the key attribute will assume:</p>
393    /// <ul>
394    /// <li>
395    /// <p><code>HASH</code> - partition key</p></li>
396    /// <li>
397    /// <p><code>RANGE</code> - sort key</p></li>
398    /// </ul></li>
399    /// </ul><note>
400    /// <p>The partition key of an item is also known as its <i>hash attribute</i>. The term "hash attribute" derives from the DynamoDB usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values.</p>
401    /// <p>The sort key of an item is also known as its <i>range attribute</i>. The term "range attribute" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.</p>
402    /// </note>
403    /// <p>For a simple primary key (partition key), you must provide exactly one element with a <code>KeyType</code> of <code>HASH</code>.</p>
404    /// <p>For a composite primary key (partition key and sort key), you must provide exactly two elements, in this order: The first element must have a <code>KeyType</code> of <code>HASH</code>, and the second element must have a <code>KeyType</code> of <code>RANGE</code>.</p>
405    /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#WorkingWithTables.primary.key">Working with Tables</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
406    pub fn key_schema(mut self, input: crate::types::KeySchemaElement) -> Self {
407        let mut v = self.key_schema.unwrap_or_default();
408                        v.push(input);
409                        self.key_schema = ::std::option::Option::Some(v);
410                        self
411    }
412    /// <p>Specifies the attributes that make up the primary key for a table or an index. The attributes in <code>KeySchema</code> must also be defined in the <code>AttributeDefinitions</code> array. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html">Data Model</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
413    /// <p>Each <code>KeySchemaElement</code> in the array is composed of:</p>
414    /// <ul>
415    /// <li>
416    /// <p><code>AttributeName</code> - The name of this key attribute.</p></li>
417    /// <li>
418    /// <p><code>KeyType</code> - The role that the key attribute will assume:</p>
419    /// <ul>
420    /// <li>
421    /// <p><code>HASH</code> - partition key</p></li>
422    /// <li>
423    /// <p><code>RANGE</code> - sort key</p></li>
424    /// </ul></li>
425    /// </ul><note>
426    /// <p>The partition key of an item is also known as its <i>hash attribute</i>. The term "hash attribute" derives from the DynamoDB usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values.</p>
427    /// <p>The sort key of an item is also known as its <i>range attribute</i>. The term "range attribute" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.</p>
428    /// </note>
429    /// <p>For a simple primary key (partition key), you must provide exactly one element with a <code>KeyType</code> of <code>HASH</code>.</p>
430    /// <p>For a composite primary key (partition key and sort key), you must provide exactly two elements, in this order: The first element must have a <code>KeyType</code> of <code>HASH</code>, and the second element must have a <code>KeyType</code> of <code>RANGE</code>.</p>
431    /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#WorkingWithTables.primary.key">Working with Tables</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
432    pub fn set_key_schema(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::KeySchemaElement>>) -> Self {
433        self.key_schema = input; self
434    }
435    /// <p>Specifies the attributes that make up the primary key for a table or an index. The attributes in <code>KeySchema</code> must also be defined in the <code>AttributeDefinitions</code> array. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html">Data Model</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
436    /// <p>Each <code>KeySchemaElement</code> in the array is composed of:</p>
437    /// <ul>
438    /// <li>
439    /// <p><code>AttributeName</code> - The name of this key attribute.</p></li>
440    /// <li>
441    /// <p><code>KeyType</code> - The role that the key attribute will assume:</p>
442    /// <ul>
443    /// <li>
444    /// <p><code>HASH</code> - partition key</p></li>
445    /// <li>
446    /// <p><code>RANGE</code> - sort key</p></li>
447    /// </ul></li>
448    /// </ul><note>
449    /// <p>The partition key of an item is also known as its <i>hash attribute</i>. The term "hash attribute" derives from the DynamoDB usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values.</p>
450    /// <p>The sort key of an item is also known as its <i>range attribute</i>. The term "range attribute" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.</p>
451    /// </note>
452    /// <p>For a simple primary key (partition key), you must provide exactly one element with a <code>KeyType</code> of <code>HASH</code>.</p>
453    /// <p>For a composite primary key (partition key and sort key), you must provide exactly two elements, in this order: The first element must have a <code>KeyType</code> of <code>HASH</code>, and the second element must have a <code>KeyType</code> of <code>RANGE</code>.</p>
454    /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#WorkingWithTables.primary.key">Working with Tables</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
455    pub fn get_key_schema(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::KeySchemaElement>> {
456        &self.key_schema
457    }
458    /// Appends an item to `local_secondary_indexes`.
459    ///
460    /// To override the contents of this collection use [`set_local_secondary_indexes`](Self::set_local_secondary_indexes).
461    ///
462    /// <p>One or more local secondary indexes (the maximum is 5) to be created on the table. Each index is scoped to a given partition key value. There is a 10 GB size limit per partition key value; otherwise, the size of a local secondary index is unconstrained.</p>
463    /// <p>Each local secondary index in the array includes the following:</p>
464    /// <ul>
465    /// <li>
466    /// <p><code>IndexName</code> - The name of the local secondary index. Must be unique only for this table.</p>
467    /// <p></p></li>
468    /// <li>
469    /// <p><code>KeySchema</code> - Specifies the key schema for the local secondary index. The key schema must begin with the same partition key as the table.</p></li>
470    /// <li>
471    /// <p><code>Projection</code> - Specifies attributes that are copied (projected) from the table into the index. These are in addition to the primary key attributes and index key attributes, which are automatically projected. Each attribute specification is composed of:</p>
472    /// <ul>
473    /// <li>
474    /// <p><code>ProjectionType</code> - One of the following:</p>
475    /// <ul>
476    /// <li>
477    /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
478    /// <li>
479    /// <p><code>INCLUDE</code> - Only the specified table attributes are projected into the index. The list of projected attributes is in <code>NonKeyAttributes</code>.</p></li>
480    /// <li>
481    /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
482    /// </ul></li>
483    /// <li>
484    /// <p><code>NonKeyAttributes</code> - A list of one or more non-key attribute names that are projected into the secondary index. The total count of attributes provided in <code>NonKeyAttributes</code>, summed across all of the secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total. This limit only applies when you specify the ProjectionType of <code>INCLUDE</code>. You still can specify the ProjectionType of <code>ALL</code> to project all attributes from the source table, even if the table has more than 100 attributes.</p></li>
485    /// </ul></li>
486    /// </ul>
487    pub fn local_secondary_indexes(mut self, input: crate::types::LocalSecondaryIndex) -> Self {
488        let mut v = self.local_secondary_indexes.unwrap_or_default();
489                        v.push(input);
490                        self.local_secondary_indexes = ::std::option::Option::Some(v);
491                        self
492    }
493    /// <p>One or more local secondary indexes (the maximum is 5) to be created on the table. Each index is scoped to a given partition key value. There is a 10 GB size limit per partition key value; otherwise, the size of a local secondary index is unconstrained.</p>
494    /// <p>Each local secondary index in the array includes the following:</p>
495    /// <ul>
496    /// <li>
497    /// <p><code>IndexName</code> - The name of the local secondary index. Must be unique only for this table.</p>
498    /// <p></p></li>
499    /// <li>
500    /// <p><code>KeySchema</code> - Specifies the key schema for the local secondary index. The key schema must begin with the same partition key as the table.</p></li>
501    /// <li>
502    /// <p><code>Projection</code> - Specifies attributes that are copied (projected) from the table into the index. These are in addition to the primary key attributes and index key attributes, which are automatically projected. Each attribute specification is composed of:</p>
503    /// <ul>
504    /// <li>
505    /// <p><code>ProjectionType</code> - One of the following:</p>
506    /// <ul>
507    /// <li>
508    /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
509    /// <li>
510    /// <p><code>INCLUDE</code> - Only the specified table attributes are projected into the index. The list of projected attributes is in <code>NonKeyAttributes</code>.</p></li>
511    /// <li>
512    /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
513    /// </ul></li>
514    /// <li>
515    /// <p><code>NonKeyAttributes</code> - A list of one or more non-key attribute names that are projected into the secondary index. The total count of attributes provided in <code>NonKeyAttributes</code>, summed across all of the secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total. This limit only applies when you specify the ProjectionType of <code>INCLUDE</code>. You still can specify the ProjectionType of <code>ALL</code> to project all attributes from the source table, even if the table has more than 100 attributes.</p></li>
516    /// </ul></li>
517    /// </ul>
518    pub fn set_local_secondary_indexes(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::LocalSecondaryIndex>>) -> Self {
519        self.local_secondary_indexes = input; self
520    }
521    /// <p>One or more local secondary indexes (the maximum is 5) to be created on the table. Each index is scoped to a given partition key value. There is a 10 GB size limit per partition key value; otherwise, the size of a local secondary index is unconstrained.</p>
522    /// <p>Each local secondary index in the array includes the following:</p>
523    /// <ul>
524    /// <li>
525    /// <p><code>IndexName</code> - The name of the local secondary index. Must be unique only for this table.</p>
526    /// <p></p></li>
527    /// <li>
528    /// <p><code>KeySchema</code> - Specifies the key schema for the local secondary index. The key schema must begin with the same partition key as the table.</p></li>
529    /// <li>
530    /// <p><code>Projection</code> - Specifies attributes that are copied (projected) from the table into the index. These are in addition to the primary key attributes and index key attributes, which are automatically projected. Each attribute specification is composed of:</p>
531    /// <ul>
532    /// <li>
533    /// <p><code>ProjectionType</code> - One of the following:</p>
534    /// <ul>
535    /// <li>
536    /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
537    /// <li>
538    /// <p><code>INCLUDE</code> - Only the specified table attributes are projected into the index. The list of projected attributes is in <code>NonKeyAttributes</code>.</p></li>
539    /// <li>
540    /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
541    /// </ul></li>
542    /// <li>
543    /// <p><code>NonKeyAttributes</code> - A list of one or more non-key attribute names that are projected into the secondary index. The total count of attributes provided in <code>NonKeyAttributes</code>, summed across all of the secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total. This limit only applies when you specify the ProjectionType of <code>INCLUDE</code>. You still can specify the ProjectionType of <code>ALL</code> to project all attributes from the source table, even if the table has more than 100 attributes.</p></li>
544    /// </ul></li>
545    /// </ul>
546    pub fn get_local_secondary_indexes(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::LocalSecondaryIndex>> {
547        &self.local_secondary_indexes
548    }
549    /// Appends an item to `global_secondary_indexes`.
550    ///
551    /// To override the contents of this collection use [`set_global_secondary_indexes`](Self::set_global_secondary_indexes).
552    ///
553    /// <p>One or more global secondary indexes (the maximum is 20) to be created on the table. Each global secondary index in the array includes the following:</p>
554    /// <ul>
555    /// <li>
556    /// <p><code>IndexName</code> - The name of the global secondary index. Must be unique only for this table.</p>
557    /// <p></p></li>
558    /// <li>
559    /// <p><code>KeySchema</code> - Specifies the key schema for the global secondary index. Each global secondary index supports up to 4 partition keys and up to 4 sort keys.</p></li>
560    /// <li>
561    /// <p><code>Projection</code> - Specifies attributes that are copied (projected) from the table into the index. These are in addition to the primary key attributes and index key attributes, which are automatically projected. Each attribute specification is composed of:</p>
562    /// <ul>
563    /// <li>
564    /// <p><code>ProjectionType</code> - One of the following:</p>
565    /// <ul>
566    /// <li>
567    /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
568    /// <li>
569    /// <p><code>INCLUDE</code> - Only the specified table attributes are projected into the index. The list of projected attributes is in <code>NonKeyAttributes</code>.</p></li>
570    /// <li>
571    /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
572    /// </ul></li>
573    /// <li>
574    /// <p><code>NonKeyAttributes</code> - A list of one or more non-key attribute names that are projected into the secondary index. The total count of attributes provided in <code>NonKeyAttributes</code>, summed across all of the secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total. This limit only applies when you specify the ProjectionType of <code>INCLUDE</code>. You still can specify the ProjectionType of <code>ALL</code> to project all attributes from the source table, even if the table has more than 100 attributes.</p></li>
575    /// </ul></li>
576    /// <li>
577    /// <p><code>ProvisionedThroughput</code> - The provisioned throughput settings for the global secondary index, consisting of read and write capacity units.</p></li>
578    /// </ul>
579    pub fn global_secondary_indexes(mut self, input: crate::types::GlobalSecondaryIndex) -> Self {
580        let mut v = self.global_secondary_indexes.unwrap_or_default();
581                        v.push(input);
582                        self.global_secondary_indexes = ::std::option::Option::Some(v);
583                        self
584    }
585    /// <p>One or more global secondary indexes (the maximum is 20) to be created on the table. Each global secondary index in the array includes the following:</p>
586    /// <ul>
587    /// <li>
588    /// <p><code>IndexName</code> - The name of the global secondary index. Must be unique only for this table.</p>
589    /// <p></p></li>
590    /// <li>
591    /// <p><code>KeySchema</code> - Specifies the key schema for the global secondary index. Each global secondary index supports up to 4 partition keys and up to 4 sort keys.</p></li>
592    /// <li>
593    /// <p><code>Projection</code> - Specifies attributes that are copied (projected) from the table into the index. These are in addition to the primary key attributes and index key attributes, which are automatically projected. Each attribute specification is composed of:</p>
594    /// <ul>
595    /// <li>
596    /// <p><code>ProjectionType</code> - One of the following:</p>
597    /// <ul>
598    /// <li>
599    /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
600    /// <li>
601    /// <p><code>INCLUDE</code> - Only the specified table attributes are projected into the index. The list of projected attributes is in <code>NonKeyAttributes</code>.</p></li>
602    /// <li>
603    /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
604    /// </ul></li>
605    /// <li>
606    /// <p><code>NonKeyAttributes</code> - A list of one or more non-key attribute names that are projected into the secondary index. The total count of attributes provided in <code>NonKeyAttributes</code>, summed across all of the secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total. This limit only applies when you specify the ProjectionType of <code>INCLUDE</code>. You still can specify the ProjectionType of <code>ALL</code> to project all attributes from the source table, even if the table has more than 100 attributes.</p></li>
607    /// </ul></li>
608    /// <li>
609    /// <p><code>ProvisionedThroughput</code> - The provisioned throughput settings for the global secondary index, consisting of read and write capacity units.</p></li>
610    /// </ul>
611    pub fn set_global_secondary_indexes(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::GlobalSecondaryIndex>>) -> Self {
612        self.global_secondary_indexes = input; self
613    }
614    /// <p>One or more global secondary indexes (the maximum is 20) to be created on the table. Each global secondary index in the array includes the following:</p>
615    /// <ul>
616    /// <li>
617    /// <p><code>IndexName</code> - The name of the global secondary index. Must be unique only for this table.</p>
618    /// <p></p></li>
619    /// <li>
620    /// <p><code>KeySchema</code> - Specifies the key schema for the global secondary index. Each global secondary index supports up to 4 partition keys and up to 4 sort keys.</p></li>
621    /// <li>
622    /// <p><code>Projection</code> - Specifies attributes that are copied (projected) from the table into the index. These are in addition to the primary key attributes and index key attributes, which are automatically projected. Each attribute specification is composed of:</p>
623    /// <ul>
624    /// <li>
625    /// <p><code>ProjectionType</code> - One of the following:</p>
626    /// <ul>
627    /// <li>
628    /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
629    /// <li>
630    /// <p><code>INCLUDE</code> - Only the specified table attributes are projected into the index. The list of projected attributes is in <code>NonKeyAttributes</code>.</p></li>
631    /// <li>
632    /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
633    /// </ul></li>
634    /// <li>
635    /// <p><code>NonKeyAttributes</code> - A list of one or more non-key attribute names that are projected into the secondary index. The total count of attributes provided in <code>NonKeyAttributes</code>, summed across all of the secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total. This limit only applies when you specify the ProjectionType of <code>INCLUDE</code>. You still can specify the ProjectionType of <code>ALL</code> to project all attributes from the source table, even if the table has more than 100 attributes.</p></li>
636    /// </ul></li>
637    /// <li>
638    /// <p><code>ProvisionedThroughput</code> - The provisioned throughput settings for the global secondary index, consisting of read and write capacity units.</p></li>
639    /// </ul>
640    pub fn get_global_secondary_indexes(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::GlobalSecondaryIndex>> {
641        &self.global_secondary_indexes
642    }
643    /// <p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
644    /// <ul>
645    /// <li>
646    /// <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>
647    /// <li>
648    /// <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>
649    /// </ul>
650    pub fn billing_mode(mut self, input: crate::types::BillingMode) -> Self {
651        self.billing_mode = ::std::option::Option::Some(input);
652        self
653    }
654    /// <p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
655    /// <ul>
656    /// <li>
657    /// <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>
658    /// <li>
659    /// <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>
660    /// </ul>
661    pub fn set_billing_mode(mut self, input: ::std::option::Option<crate::types::BillingMode>) -> Self {
662        self.billing_mode = input; self
663    }
664    /// <p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
665    /// <ul>
666    /// <li>
667    /// <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>
668    /// <li>
669    /// <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>
670    /// </ul>
671    pub fn get_billing_mode(&self) -> &::std::option::Option<crate::types::BillingMode> {
672        &self.billing_mode
673    }
674    /// <p>Represents the provisioned throughput settings for a specified table or index. The settings can be modified using the <code>UpdateTable</code> operation.</p>
675    /// <p>If you set BillingMode as <code>PROVISIONED</code>, you must specify this property. If you set BillingMode as <code>PAY_PER_REQUEST</code>, you cannot specify this property.</p>
676    /// <p>For current minimum and maximum provisioned throughput values, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html">Service, Account, and Table Quotas</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
677    pub fn provisioned_throughput(mut self, input: crate::types::ProvisionedThroughput) -> Self {
678        self.provisioned_throughput = ::std::option::Option::Some(input);
679        self
680    }
681    /// <p>Represents the provisioned throughput settings for a specified table or index. The settings can be modified using the <code>UpdateTable</code> operation.</p>
682    /// <p>If you set BillingMode as <code>PROVISIONED</code>, you must specify this property. If you set BillingMode as <code>PAY_PER_REQUEST</code>, you cannot specify this property.</p>
683    /// <p>For current minimum and maximum provisioned throughput values, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html">Service, Account, and Table Quotas</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
684    pub fn set_provisioned_throughput(mut self, input: ::std::option::Option<crate::types::ProvisionedThroughput>) -> Self {
685        self.provisioned_throughput = input; self
686    }
687    /// <p>Represents the provisioned throughput settings for a specified table or index. The settings can be modified using the <code>UpdateTable</code> operation.</p>
688    /// <p>If you set BillingMode as <code>PROVISIONED</code>, you must specify this property. If you set BillingMode as <code>PAY_PER_REQUEST</code>, you cannot specify this property.</p>
689    /// <p>For current minimum and maximum provisioned throughput values, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html">Service, Account, and Table Quotas</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
690    pub fn get_provisioned_throughput(&self) -> &::std::option::Option<crate::types::ProvisionedThroughput> {
691        &self.provisioned_throughput
692    }
693    /// <p>The settings for DynamoDB Streams on the table. These settings consist of:</p>
694    /// <ul>
695    /// <li>
696    /// <p><code>StreamEnabled</code> - Indicates whether DynamoDB Streams is to be enabled (true) or disabled (false).</p></li>
697    /// <li>
698    /// <p><code>StreamViewType</code> - When an item in the table is modified, <code>StreamViewType</code> determines what information is written to the table's stream. Valid values for <code>StreamViewType</code> are:</p>
699    /// <ul>
700    /// <li>
701    /// <p><code>KEYS_ONLY</code> - Only the key attributes of the modified item are written to the stream.</p></li>
702    /// <li>
703    /// <p><code>NEW_IMAGE</code> - The entire item, as it appears after it was modified, is written to the stream.</p></li>
704    /// <li>
705    /// <p><code>OLD_IMAGE</code> - The entire item, as it appeared before it was modified, is written to the stream.</p></li>
706    /// <li>
707    /// <p><code>NEW_AND_OLD_IMAGES</code> - Both the new and the old item images of the item are written to the stream.</p></li>
708    /// </ul></li>
709    /// </ul>
710    pub fn stream_specification(mut self, input: crate::types::StreamSpecification) -> Self {
711        self.stream_specification = ::std::option::Option::Some(input);
712        self
713    }
714    /// <p>The settings for DynamoDB Streams on the table. These settings consist of:</p>
715    /// <ul>
716    /// <li>
717    /// <p><code>StreamEnabled</code> - Indicates whether DynamoDB Streams is to be enabled (true) or disabled (false).</p></li>
718    /// <li>
719    /// <p><code>StreamViewType</code> - When an item in the table is modified, <code>StreamViewType</code> determines what information is written to the table's stream. Valid values for <code>StreamViewType</code> are:</p>
720    /// <ul>
721    /// <li>
722    /// <p><code>KEYS_ONLY</code> - Only the key attributes of the modified item are written to the stream.</p></li>
723    /// <li>
724    /// <p><code>NEW_IMAGE</code> - The entire item, as it appears after it was modified, is written to the stream.</p></li>
725    /// <li>
726    /// <p><code>OLD_IMAGE</code> - The entire item, as it appeared before it was modified, is written to the stream.</p></li>
727    /// <li>
728    /// <p><code>NEW_AND_OLD_IMAGES</code> - Both the new and the old item images of the item are written to the stream.</p></li>
729    /// </ul></li>
730    /// </ul>
731    pub fn set_stream_specification(mut self, input: ::std::option::Option<crate::types::StreamSpecification>) -> Self {
732        self.stream_specification = input; self
733    }
734    /// <p>The settings for DynamoDB Streams on the table. These settings consist of:</p>
735    /// <ul>
736    /// <li>
737    /// <p><code>StreamEnabled</code> - Indicates whether DynamoDB Streams is to be enabled (true) or disabled (false).</p></li>
738    /// <li>
739    /// <p><code>StreamViewType</code> - When an item in the table is modified, <code>StreamViewType</code> determines what information is written to the table's stream. Valid values for <code>StreamViewType</code> are:</p>
740    /// <ul>
741    /// <li>
742    /// <p><code>KEYS_ONLY</code> - Only the key attributes of the modified item are written to the stream.</p></li>
743    /// <li>
744    /// <p><code>NEW_IMAGE</code> - The entire item, as it appears after it was modified, is written to the stream.</p></li>
745    /// <li>
746    /// <p><code>OLD_IMAGE</code> - The entire item, as it appeared before it was modified, is written to the stream.</p></li>
747    /// <li>
748    /// <p><code>NEW_AND_OLD_IMAGES</code> - Both the new and the old item images of the item are written to the stream.</p></li>
749    /// </ul></li>
750    /// </ul>
751    pub fn get_stream_specification(&self) -> &::std::option::Option<crate::types::StreamSpecification> {
752        &self.stream_specification
753    }
754    /// <p>Represents the settings used to enable server-side encryption.</p>
755    pub fn sse_specification(mut self, input: crate::types::SseSpecification) -> Self {
756        self.sse_specification = ::std::option::Option::Some(input);
757        self
758    }
759    /// <p>Represents the settings used to enable server-side encryption.</p>
760    pub fn set_sse_specification(mut self, input: ::std::option::Option<crate::types::SseSpecification>) -> Self {
761        self.sse_specification = input; self
762    }
763    /// <p>Represents the settings used to enable server-side encryption.</p>
764    pub fn get_sse_specification(&self) -> &::std::option::Option<crate::types::SseSpecification> {
765        &self.sse_specification
766    }
767    /// Appends an item to `tags`.
768    ///
769    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
770    ///
771    /// <p>A list of key-value pairs to label the table. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html">Tagging for DynamoDB</a>.</p>
772    pub fn tags(mut self, input: crate::types::Tag) -> Self {
773        let mut v = self.tags.unwrap_or_default();
774                        v.push(input);
775                        self.tags = ::std::option::Option::Some(v);
776                        self
777    }
778    /// <p>A list of key-value pairs to label the table. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html">Tagging for DynamoDB</a>.</p>
779    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::Tag>>) -> Self {
780        self.tags = input; self
781    }
782    /// <p>A list of key-value pairs to label the table. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html">Tagging for DynamoDB</a>.</p>
783    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::Tag>> {
784        &self.tags
785    }
786    /// <p>The table class of the new table. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
787    pub fn table_class(mut self, input: crate::types::TableClass) -> Self {
788        self.table_class = ::std::option::Option::Some(input);
789        self
790    }
791    /// <p>The table class of the new table. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
792    pub fn set_table_class(mut self, input: ::std::option::Option<crate::types::TableClass>) -> Self {
793        self.table_class = input; self
794    }
795    /// <p>The table class of the new table. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
796    pub fn get_table_class(&self) -> &::std::option::Option<crate::types::TableClass> {
797        &self.table_class
798    }
799    /// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
800    pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
801        self.deletion_protection_enabled = ::std::option::Option::Some(input);
802        self
803    }
804    /// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
805    pub fn set_deletion_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
806        self.deletion_protection_enabled = input; self
807    }
808    /// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
809    pub fn get_deletion_protection_enabled(&self) -> &::std::option::Option<bool> {
810        &self.deletion_protection_enabled
811    }
812    /// <p>Represents the warm throughput (in read units per second and write units per second) for creating a table.</p>
813    pub fn warm_throughput(mut self, input: crate::types::WarmThroughput) -> Self {
814        self.warm_throughput = ::std::option::Option::Some(input);
815        self
816    }
817    /// <p>Represents the warm throughput (in read units per second and write units per second) for creating a table.</p>
818    pub fn set_warm_throughput(mut self, input: ::std::option::Option<crate::types::WarmThroughput>) -> Self {
819        self.warm_throughput = input; self
820    }
821    /// <p>Represents the warm throughput (in read units per second and write units per second) for creating a table.</p>
822    pub fn get_warm_throughput(&self) -> &::std::option::Option<crate::types::WarmThroughput> {
823        &self.warm_throughput
824    }
825    /// <p>An Amazon Web Services resource-based policy document in JSON format that will be attached to the table.</p>
826    /// <p>When you attach a resource-based policy while creating a table, the policy application is <i>strongly consistent</i>.</p>
827    /// <p>The maximum size supported for a resource-based policy document is 20 KB. DynamoDB counts whitespaces when calculating the size of a policy against this limit. For a full list of all considerations that apply for resource-based policies, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-considerations.html">Resource-based policy considerations</a>.</p><note>
828    /// <p>You need to specify the <code>CreateTable</code> and <code>PutResourcePolicy</code> IAM actions for authorizing a user to create a table with a resource-based policy.</p>
829    /// </note>
830    pub fn resource_policy(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
831        self.resource_policy = ::std::option::Option::Some(input.into());
832        self
833    }
834    /// <p>An Amazon Web Services resource-based policy document in JSON format that will be attached to the table.</p>
835    /// <p>When you attach a resource-based policy while creating a table, the policy application is <i>strongly consistent</i>.</p>
836    /// <p>The maximum size supported for a resource-based policy document is 20 KB. DynamoDB counts whitespaces when calculating the size of a policy against this limit. For a full list of all considerations that apply for resource-based policies, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-considerations.html">Resource-based policy considerations</a>.</p><note>
837    /// <p>You need to specify the <code>CreateTable</code> and <code>PutResourcePolicy</code> IAM actions for authorizing a user to create a table with a resource-based policy.</p>
838    /// </note>
839    pub fn set_resource_policy(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
840        self.resource_policy = input; self
841    }
842    /// <p>An Amazon Web Services resource-based policy document in JSON format that will be attached to the table.</p>
843    /// <p>When you attach a resource-based policy while creating a table, the policy application is <i>strongly consistent</i>.</p>
844    /// <p>The maximum size supported for a resource-based policy document is 20 KB. DynamoDB counts whitespaces when calculating the size of a policy against this limit. For a full list of all considerations that apply for resource-based policies, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-considerations.html">Resource-based policy considerations</a>.</p><note>
845    /// <p>You need to specify the <code>CreateTable</code> and <code>PutResourcePolicy</code> IAM actions for authorizing a user to create a table with a resource-based policy.</p>
846    /// </note>
847    pub fn get_resource_policy(&self) -> &::std::option::Option<::std::string::String> {
848        &self.resource_policy
849    }
850    /// <p>Sets 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>
851    pub fn on_demand_throughput(mut self, input: crate::types::OnDemandThroughput) -> Self {
852        self.on_demand_throughput = ::std::option::Option::Some(input);
853        self
854    }
855    /// <p>Sets 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>
856    pub fn set_on_demand_throughput(mut self, input: ::std::option::Option<crate::types::OnDemandThroughput>) -> Self {
857        self.on_demand_throughput = input; self
858    }
859    /// <p>Sets 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>
860    pub fn get_on_demand_throughput(&self) -> &::std::option::Option<crate::types::OnDemandThroughput> {
861        &self.on_demand_throughput
862    }
863    /// <p>The Amazon Resource Name (ARN) of the source table used for the creation of a multi-account global table.</p>
864    pub fn global_table_source_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
865        self.global_table_source_arn = ::std::option::Option::Some(input.into());
866        self
867    }
868    /// <p>The Amazon Resource Name (ARN) of the source table used for the creation of a multi-account global table.</p>
869    pub fn set_global_table_source_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
870        self.global_table_source_arn = input; self
871    }
872    /// <p>The Amazon Resource Name (ARN) of the source table used for the creation of a multi-account global table.</p>
873    pub fn get_global_table_source_arn(&self) -> &::std::option::Option<::std::string::String> {
874        &self.global_table_source_arn
875    }
876    /// <p>Controls the settings synchronization mode for the global table. For multi-account global tables, this parameter is required and the only supported value is ENABLED. For same-account global tables, this parameter is set to ENABLED_WITH_OVERRIDES.</p>
877    pub fn global_table_settings_replication_mode(mut self, input: crate::types::GlobalTableSettingsReplicationMode) -> Self {
878        self.global_table_settings_replication_mode = ::std::option::Option::Some(input);
879        self
880    }
881    /// <p>Controls the settings synchronization mode for the global table. For multi-account global tables, this parameter is required and the only supported value is ENABLED. For same-account global tables, this parameter is set to ENABLED_WITH_OVERRIDES.</p>
882    pub fn set_global_table_settings_replication_mode(mut self, input: ::std::option::Option<crate::types::GlobalTableSettingsReplicationMode>) -> Self {
883        self.global_table_settings_replication_mode = input; self
884    }
885    /// <p>Controls the settings synchronization mode for the global table. For multi-account global tables, this parameter is required and the only supported value is ENABLED. For same-account global tables, this parameter is set to ENABLED_WITH_OVERRIDES.</p>
886    pub fn get_global_table_settings_replication_mode(&self) -> &::std::option::Option<crate::types::GlobalTableSettingsReplicationMode> {
887        &self.global_table_settings_replication_mode
888    }
889    /// Consumes the builder and constructs a [`CreateTableInput`](crate::operation::create_table::CreateTableInput).
890    pub fn build(self) -> ::std::result::Result<crate::operation::create_table::CreateTableInput, ::aws_smithy_types::error::operation::BuildError> {
891        ::std::result::Result::Ok(
892            crate::operation::create_table::CreateTableInput {
893                attribute_definitions: self.attribute_definitions
894                ,
895                table_name: self.table_name
896                ,
897                key_schema: self.key_schema
898                ,
899                local_secondary_indexes: self.local_secondary_indexes
900                ,
901                global_secondary_indexes: self.global_secondary_indexes
902                ,
903                billing_mode: self.billing_mode
904                ,
905                provisioned_throughput: self.provisioned_throughput
906                ,
907                stream_specification: self.stream_specification
908                ,
909                sse_specification: self.sse_specification
910                ,
911                tags: self.tags
912                ,
913                table_class: self.table_class
914                ,
915                deletion_protection_enabled: self.deletion_protection_enabled
916                ,
917                warm_throughput: self.warm_throughput
918                ,
919                resource_policy: self.resource_policy
920                ,
921                on_demand_throughput: self.on_demand_throughput
922                ,
923                global_table_source_arn: self.global_table_source_arn
924                ,
925                global_table_settings_replication_mode: self.global_table_settings_replication_mode
926                ,
927            }
928        )
929    }
930}
931