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.</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}
134impl CreateTableInput {
135 /// <p>An array of attributes that describe the key schema for the table and indexes.</p>
136 ///
137 /// 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()`.
138 pub fn attribute_definitions(&self) -> &[crate::types::AttributeDefinition] {
139 self.attribute_definitions.as_deref()
140 .unwrap_or_default()
141 }
142 /// <p>The name of the table to create. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
143 pub fn table_name(&self) -> ::std::option::Option<&str> {
144 self.table_name.as_deref()
145 }
146 /// <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>
147 /// <p>Each <code>KeySchemaElement</code> in the array is composed of:</p>
148 /// <ul>
149 /// <li>
150 /// <p><code>AttributeName</code> - The name of this key attribute.</p></li>
151 /// <li>
152 /// <p><code>KeyType</code> - The role that the key attribute will assume:</p>
153 /// <ul>
154 /// <li>
155 /// <p><code>HASH</code> - partition key</p></li>
156 /// <li>
157 /// <p><code>RANGE</code> - sort key</p></li>
158 /// </ul></li>
159 /// </ul><note>
160 /// <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>
161 /// <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>
162 /// </note>
163 /// <p>For a simple primary key (partition key), you must provide exactly one element with a <code>KeyType</code> of <code>HASH</code>.</p>
164 /// <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>
165 /// <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>
166 ///
167 /// 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()`.
168 pub fn key_schema(&self) -> &[crate::types::KeySchemaElement] {
169 self.key_schema.as_deref()
170 .unwrap_or_default()
171 }
172 /// <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>
173 /// <p>Each local secondary index in the array includes the following:</p>
174 /// <ul>
175 /// <li>
176 /// <p><code>IndexName</code> - The name of the local secondary index. Must be unique only for this table.</p>
177 /// <p></p></li>
178 /// <li>
179 /// <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>
180 /// <li>
181 /// <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>
182 /// <ul>
183 /// <li>
184 /// <p><code>ProjectionType</code> - One of the following:</p>
185 /// <ul>
186 /// <li>
187 /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
188 /// <li>
189 /// <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>
190 /// <li>
191 /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
192 /// </ul></li>
193 /// <li>
194 /// <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>
195 /// </ul></li>
196 /// </ul>
197 ///
198 /// 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()`.
199 pub fn local_secondary_indexes(&self) -> &[crate::types::LocalSecondaryIndex] {
200 self.local_secondary_indexes.as_deref()
201 .unwrap_or_default()
202 }
203 /// <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>
204 /// <ul>
205 /// <li>
206 /// <p><code>IndexName</code> - The name of the global secondary index. Must be unique only for this table.</p>
207 /// <p></p></li>
208 /// <li>
209 /// <p><code>KeySchema</code> - Specifies the key schema for the global secondary index.</p></li>
210 /// <li>
211 /// <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>
212 /// <ul>
213 /// <li>
214 /// <p><code>ProjectionType</code> - One of the following:</p>
215 /// <ul>
216 /// <li>
217 /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
218 /// <li>
219 /// <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>
220 /// <li>
221 /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
222 /// </ul></li>
223 /// <li>
224 /// <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>
225 /// </ul></li>
226 /// <li>
227 /// <p><code>ProvisionedThroughput</code> - The provisioned throughput settings for the global secondary index, consisting of read and write capacity units.</p></li>
228 /// </ul>
229 ///
230 /// 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()`.
231 pub fn global_secondary_indexes(&self) -> &[crate::types::GlobalSecondaryIndex] {
232 self.global_secondary_indexes.as_deref()
233 .unwrap_or_default()
234 }
235 /// <p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
236 /// <ul>
237 /// <li>
238 /// <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>
239 /// <li>
240 /// <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>
241 /// </ul>
242 pub fn billing_mode(&self) -> ::std::option::Option<&crate::types::BillingMode> {
243 self.billing_mode.as_ref()
244 }
245 /// <p>Represents the provisioned throughput settings for a specified table or index. The settings can be modified using the <code>UpdateTable</code> operation.</p>
246 /// <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>
247 /// <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>
248 pub fn provisioned_throughput(&self) -> ::std::option::Option<&crate::types::ProvisionedThroughput> {
249 self.provisioned_throughput.as_ref()
250 }
251 /// <p>The settings for DynamoDB Streams on the table. These settings consist of:</p>
252 /// <ul>
253 /// <li>
254 /// <p><code>StreamEnabled</code> - Indicates whether DynamoDB Streams is to be enabled (true) or disabled (false).</p></li>
255 /// <li>
256 /// <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>
257 /// <ul>
258 /// <li>
259 /// <p><code>KEYS_ONLY</code> - Only the key attributes of the modified item are written to the stream.</p></li>
260 /// <li>
261 /// <p><code>NEW_IMAGE</code> - The entire item, as it appears after it was modified, is written to the stream.</p></li>
262 /// <li>
263 /// <p><code>OLD_IMAGE</code> - The entire item, as it appeared before it was modified, is written to the stream.</p></li>
264 /// <li>
265 /// <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>
266 /// </ul></li>
267 /// </ul>
268 pub fn stream_specification(&self) -> ::std::option::Option<&crate::types::StreamSpecification> {
269 self.stream_specification.as_ref()
270 }
271 /// <p>Represents the settings used to enable server-side encryption.</p>
272 pub fn sse_specification(&self) -> ::std::option::Option<&crate::types::SseSpecification> {
273 self.sse_specification.as_ref()
274 }
275 /// <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>
276 ///
277 /// 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()`.
278 pub fn tags(&self) -> &[crate::types::Tag] {
279 self.tags.as_deref()
280 .unwrap_or_default()
281 }
282 /// <p>The table class of the new table. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
283 pub fn table_class(&self) -> ::std::option::Option<&crate::types::TableClass> {
284 self.table_class.as_ref()
285 }
286 /// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
287 pub fn deletion_protection_enabled(&self) -> ::std::option::Option<bool> {
288 self.deletion_protection_enabled
289 }
290 /// <p>Represents the warm throughput (in read units per second and write units per second) for creating a table.</p>
291 pub fn warm_throughput(&self) -> ::std::option::Option<&crate::types::WarmThroughput> {
292 self.warm_throughput.as_ref()
293 }
294 /// <p>An Amazon Web Services resource-based policy document in JSON format that will be attached to the table.</p>
295 /// <p>When you attach a resource-based policy while creating a table, the policy application is <i>strongly consistent</i>.</p>
296 /// <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>
297 /// <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>
298 /// </note>
299 pub fn resource_policy(&self) -> ::std::option::Option<&str> {
300 self.resource_policy.as_deref()
301 }
302 /// <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>
303 pub fn on_demand_throughput(&self) -> ::std::option::Option<&crate::types::OnDemandThroughput> {
304 self.on_demand_throughput.as_ref()
305 }
306}
307static CREATETABLEINPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.dynamodb.synthetic#CreateTableInput", "com.amazonaws.dynamodb.synthetic", "CreateTableInput");
308static CREATETABLEINPUT_MEMBER_ATTRIBUTE_DEFINITIONS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
309 ::aws_smithy_schema::ShapeId::from_static(
310 "com.amazonaws.dynamodb.synthetic#CreateTableInput$AttributeDefinitions",
311 "com.amazonaws.dynamodb.synthetic",
312 "CreateTableInput",
313 ),
314 ::aws_smithy_schema::ShapeType::List,
315 "AttributeDefinitions",
316 0,
317 );
318static CREATETABLEINPUT_MEMBER_TABLE_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
319 ::aws_smithy_schema::ShapeId::from_static(
320 "com.amazonaws.dynamodb.synthetic#CreateTableInput$TableName",
321 "com.amazonaws.dynamodb.synthetic",
322 "CreateTableInput",
323 ),
324 ::aws_smithy_schema::ShapeType::String,
325 "TableName",
326 1,
327 );
328static CREATETABLEINPUT_MEMBER_KEY_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
329 ::aws_smithy_schema::ShapeId::from_static(
330 "com.amazonaws.dynamodb.synthetic#CreateTableInput$KeySchema",
331 "com.amazonaws.dynamodb.synthetic",
332 "CreateTableInput",
333 ),
334 ::aws_smithy_schema::ShapeType::List,
335 "KeySchema",
336 2,
337 );
338static CREATETABLEINPUT_MEMBER_LOCAL_SECONDARY_INDEXES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
339 ::aws_smithy_schema::ShapeId::from_static(
340 "com.amazonaws.dynamodb.synthetic#CreateTableInput$LocalSecondaryIndexes",
341 "com.amazonaws.dynamodb.synthetic",
342 "CreateTableInput",
343 ),
344 ::aws_smithy_schema::ShapeType::List,
345 "LocalSecondaryIndexes",
346 3,
347 );
348static CREATETABLEINPUT_MEMBER_GLOBAL_SECONDARY_INDEXES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
349 ::aws_smithy_schema::ShapeId::from_static(
350 "com.amazonaws.dynamodb.synthetic#CreateTableInput$GlobalSecondaryIndexes",
351 "com.amazonaws.dynamodb.synthetic",
352 "CreateTableInput",
353 ),
354 ::aws_smithy_schema::ShapeType::List,
355 "GlobalSecondaryIndexes",
356 4,
357 );
358static CREATETABLEINPUT_MEMBER_BILLING_MODE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
359 ::aws_smithy_schema::ShapeId::from_static(
360 "com.amazonaws.dynamodb.synthetic#CreateTableInput$BillingMode",
361 "com.amazonaws.dynamodb.synthetic",
362 "CreateTableInput",
363 ),
364 ::aws_smithy_schema::ShapeType::String,
365 "BillingMode",
366 5,
367 );
368static CREATETABLEINPUT_MEMBER_PROVISIONED_THROUGHPUT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
369 ::aws_smithy_schema::ShapeId::from_static(
370 "com.amazonaws.dynamodb.synthetic#CreateTableInput$ProvisionedThroughput",
371 "com.amazonaws.dynamodb.synthetic",
372 "CreateTableInput",
373 ),
374 ::aws_smithy_schema::ShapeType::Structure,
375 "ProvisionedThroughput",
376 6,
377 );
378static CREATETABLEINPUT_MEMBER_STREAM_SPECIFICATION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
379 ::aws_smithy_schema::ShapeId::from_static(
380 "com.amazonaws.dynamodb.synthetic#CreateTableInput$StreamSpecification",
381 "com.amazonaws.dynamodb.synthetic",
382 "CreateTableInput",
383 ),
384 ::aws_smithy_schema::ShapeType::Structure,
385 "StreamSpecification",
386 7,
387 );
388static CREATETABLEINPUT_MEMBER_SSE_SPECIFICATION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
389 ::aws_smithy_schema::ShapeId::from_static(
390 "com.amazonaws.dynamodb.synthetic#CreateTableInput$SSESpecification",
391 "com.amazonaws.dynamodb.synthetic",
392 "CreateTableInput",
393 ),
394 ::aws_smithy_schema::ShapeType::Structure,
395 "SSESpecification",
396 8,
397 );
398static CREATETABLEINPUT_MEMBER_TAGS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
399 ::aws_smithy_schema::ShapeId::from_static(
400 "com.amazonaws.dynamodb.synthetic#CreateTableInput$Tags",
401 "com.amazonaws.dynamodb.synthetic",
402 "CreateTableInput",
403 ),
404 ::aws_smithy_schema::ShapeType::List,
405 "Tags",
406 9,
407 );
408static CREATETABLEINPUT_MEMBER_TABLE_CLASS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
409 ::aws_smithy_schema::ShapeId::from_static(
410 "com.amazonaws.dynamodb.synthetic#CreateTableInput$TableClass",
411 "com.amazonaws.dynamodb.synthetic",
412 "CreateTableInput",
413 ),
414 ::aws_smithy_schema::ShapeType::String,
415 "TableClass",
416 10,
417 );
418static CREATETABLEINPUT_MEMBER_DELETION_PROTECTION_ENABLED: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
419 ::aws_smithy_schema::ShapeId::from_static(
420 "com.amazonaws.dynamodb.synthetic#CreateTableInput$DeletionProtectionEnabled",
421 "com.amazonaws.dynamodb.synthetic",
422 "CreateTableInput",
423 ),
424 ::aws_smithy_schema::ShapeType::Boolean,
425 "DeletionProtectionEnabled",
426 11,
427 );
428static CREATETABLEINPUT_MEMBER_WARM_THROUGHPUT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
429 ::aws_smithy_schema::ShapeId::from_static(
430 "com.amazonaws.dynamodb.synthetic#CreateTableInput$WarmThroughput",
431 "com.amazonaws.dynamodb.synthetic",
432 "CreateTableInput",
433 ),
434 ::aws_smithy_schema::ShapeType::Structure,
435 "WarmThroughput",
436 12,
437 );
438static CREATETABLEINPUT_MEMBER_RESOURCE_POLICY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
439 ::aws_smithy_schema::ShapeId::from_static(
440 "com.amazonaws.dynamodb.synthetic#CreateTableInput$ResourcePolicy",
441 "com.amazonaws.dynamodb.synthetic",
442 "CreateTableInput",
443 ),
444 ::aws_smithy_schema::ShapeType::String,
445 "ResourcePolicy",
446 13,
447 );
448static CREATETABLEINPUT_MEMBER_ON_DEMAND_THROUGHPUT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
449 ::aws_smithy_schema::ShapeId::from_static(
450 "com.amazonaws.dynamodb.synthetic#CreateTableInput$OnDemandThroughput",
451 "com.amazonaws.dynamodb.synthetic",
452 "CreateTableInput",
453 ),
454 ::aws_smithy_schema::ShapeType::Structure,
455 "OnDemandThroughput",
456 14,
457 );
458static CREATETABLEINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
459 CREATETABLEINPUT_SCHEMA_ID,
460 ::aws_smithy_schema::ShapeType::Structure,
461 &[&CREATETABLEINPUT_MEMBER_ATTRIBUTE_DEFINITIONS, &CREATETABLEINPUT_MEMBER_TABLE_NAME, &CREATETABLEINPUT_MEMBER_KEY_SCHEMA, &CREATETABLEINPUT_MEMBER_LOCAL_SECONDARY_INDEXES, &CREATETABLEINPUT_MEMBER_GLOBAL_SECONDARY_INDEXES, &CREATETABLEINPUT_MEMBER_BILLING_MODE, &CREATETABLEINPUT_MEMBER_PROVISIONED_THROUGHPUT, &CREATETABLEINPUT_MEMBER_STREAM_SPECIFICATION, &CREATETABLEINPUT_MEMBER_SSE_SPECIFICATION, &CREATETABLEINPUT_MEMBER_TAGS, &CREATETABLEINPUT_MEMBER_TABLE_CLASS, &CREATETABLEINPUT_MEMBER_DELETION_PROTECTION_ENABLED, &CREATETABLEINPUT_MEMBER_WARM_THROUGHPUT, &CREATETABLEINPUT_MEMBER_RESOURCE_POLICY, &CREATETABLEINPUT_MEMBER_ON_DEMAND_THROUGHPUT],
462 );
463impl CreateTableInput {
464 /// The schema for this shape.
465 pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &CREATETABLEINPUT_SCHEMA;
466 }
467impl ::aws_smithy_schema::serde::SerializableStruct for CreateTableInput {
468 #[allow(unused_variables, clippy::diverging_sub_expression)]
469 fn serialize_members(&self, ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
470 if let Some(ref val) = self.attribute_definitions {
471
472 ser.write_list(&CREATETABLEINPUT_MEMBER_ATTRIBUTE_DEFINITIONS, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
473 for item in val {
474 ser.write_struct(crate::types::AttributeDefinition::SCHEMA, item)?;
475 }
476 Ok(())
477 })?;
478
479 }
480if let Some(ref val) = self.table_name {
481 ser.write_string(&CREATETABLEINPUT_MEMBER_TABLE_NAME, val)?;
482 }
483if let Some(ref val) = self.key_schema {
484
485 ser.write_list(&CREATETABLEINPUT_MEMBER_KEY_SCHEMA, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
486 for item in val {
487 ser.write_struct(crate::types::KeySchemaElement::SCHEMA, item)?;
488 }
489 Ok(())
490 })?;
491
492 }
493if let Some(ref val) = self.local_secondary_indexes {
494
495 ser.write_list(&CREATETABLEINPUT_MEMBER_LOCAL_SECONDARY_INDEXES, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
496 for item in val {
497 ser.write_struct(crate::types::LocalSecondaryIndex::SCHEMA, item)?;
498 }
499 Ok(())
500 })?;
501
502 }
503if let Some(ref val) = self.global_secondary_indexes {
504
505 ser.write_list(&CREATETABLEINPUT_MEMBER_GLOBAL_SECONDARY_INDEXES, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
506 for item in val {
507 ser.write_struct(crate::types::GlobalSecondaryIndex::SCHEMA, item)?;
508 }
509 Ok(())
510 })?;
511
512 }
513if let Some(ref val) = self.billing_mode {
514 ser.write_string(&CREATETABLEINPUT_MEMBER_BILLING_MODE, val.as_str())?;
515 }
516if let Some(ref val) = self.provisioned_throughput {
517 ser.write_struct(&CREATETABLEINPUT_MEMBER_PROVISIONED_THROUGHPUT, val)?;
518 }
519if let Some(ref val) = self.stream_specification {
520 ser.write_struct(&CREATETABLEINPUT_MEMBER_STREAM_SPECIFICATION, val)?;
521 }
522if let Some(ref val) = self.sse_specification {
523 ser.write_struct(&CREATETABLEINPUT_MEMBER_SSE_SPECIFICATION, val)?;
524 }
525if let Some(ref val) = self.tags {
526
527 ser.write_list(&CREATETABLEINPUT_MEMBER_TAGS, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
528 for item in val {
529 ser.write_struct(crate::types::Tag::SCHEMA, item)?;
530 }
531 Ok(())
532 })?;
533
534 }
535if let Some(ref val) = self.table_class {
536 ser.write_string(&CREATETABLEINPUT_MEMBER_TABLE_CLASS, val.as_str())?;
537 }
538if let Some(ref val) = self.deletion_protection_enabled {
539 ser.write_boolean(&CREATETABLEINPUT_MEMBER_DELETION_PROTECTION_ENABLED, *val)?;
540 }
541if let Some(ref val) = self.warm_throughput {
542 ser.write_struct(&CREATETABLEINPUT_MEMBER_WARM_THROUGHPUT, val)?;
543 }
544if let Some(ref val) = self.resource_policy {
545 ser.write_string(&CREATETABLEINPUT_MEMBER_RESOURCE_POLICY, val)?;
546 }
547if let Some(ref val) = self.on_demand_throughput {
548 ser.write_struct(&CREATETABLEINPUT_MEMBER_ON_DEMAND_THROUGHPUT, val)?;
549 }
550 Ok(())
551 }
552 }
553impl CreateTableInput {
554 /// Deserializes this structure from a [`ShapeDeserializer`].
555 pub fn deserialize(deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
556 #[allow(unused_variables, unused_mut)]
557 let mut builder = Self::builder();
558 #[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding, clippy::diverging_sub_expression)]
559 deserializer.read_struct(&CREATETABLEINPUT_SCHEMA, &mut |member, deser| {
560 match member.member_index() {
561 Some(0) => {
562 builder.attribute_definitions = Some({ let mut container = Vec::new(); deser.read_list(member, &mut |deser| { container.push(crate::types::AttributeDefinition::deserialize(deser)?); Ok(()) })?; container });
563 }
564Some(1) => {
565 builder.table_name = Some(deser.read_string(member)?);
566 }
567Some(2) => {
568 builder.key_schema = Some({ let mut container = Vec::new(); deser.read_list(member, &mut |deser| { container.push(crate::types::KeySchemaElement::deserialize(deser)?); Ok(()) })?; container });
569 }
570Some(3) => {
571 builder.local_secondary_indexes = Some({ let mut container = Vec::new(); deser.read_list(member, &mut |deser| { container.push(crate::types::LocalSecondaryIndex::deserialize(deser)?); Ok(()) })?; container });
572 }
573Some(4) => {
574 builder.global_secondary_indexes = Some({ let mut container = Vec::new(); deser.read_list(member, &mut |deser| { container.push(crate::types::GlobalSecondaryIndex::deserialize(deser)?); Ok(()) })?; container });
575 }
576Some(5) => {
577 builder.billing_mode = Some(crate::types::BillingMode::from(deser.read_string(member)?.as_str()));
578 }
579Some(6) => {
580 builder.provisioned_throughput = Some(crate::types::ProvisionedThroughput::deserialize(deser)?);
581 }
582Some(7) => {
583 builder.stream_specification = Some(crate::types::StreamSpecification::deserialize(deser)?);
584 }
585Some(8) => {
586 builder.sse_specification = Some(crate::types::SseSpecification::deserialize(deser)?);
587 }
588Some(9) => {
589 builder.tags = Some({ let mut container = Vec::new(); deser.read_list(member, &mut |deser| { container.push(crate::types::Tag::deserialize(deser)?); Ok(()) })?; container });
590 }
591Some(10) => {
592 builder.table_class = Some(crate::types::TableClass::from(deser.read_string(member)?.as_str()));
593 }
594Some(11) => {
595 builder.deletion_protection_enabled = Some(deser.read_boolean(member)?);
596 }
597Some(12) => {
598 builder.warm_throughput = Some(crate::types::WarmThroughput::deserialize(deser)?);
599 }
600Some(13) => {
601 builder.resource_policy = Some(deser.read_string(member)?);
602 }
603Some(14) => {
604 builder.on_demand_throughput = Some(crate::types::OnDemandThroughput::deserialize(deser)?);
605 }
606 _ => {}
607 }
608 Ok(())
609 })?;
610 builder.attribute_definitions = builder.attribute_definitions.or(Some(Vec::new()));
611builder.table_name = builder.table_name.or(Some(String::new()));
612builder.key_schema = builder.key_schema.or(Some(Vec::new()));
613builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
614 }
615 }
616impl CreateTableInput {
617 /// Deserializes this structure from a body deserializer and HTTP response.
618 pub fn deserialize_with_response(
619 deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
620 _headers: &::aws_smithy_runtime_api::http::Headers,
621 _status: u16,
622 _body: &[u8],
623 ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
624 Self::deserialize(deserializer)
625 }
626 }
627impl CreateTableInput {
628 /// Creates a new builder-style object to manufacture [`CreateTableInput`](crate::operation::create_table::CreateTableInput).
629 pub fn builder() -> crate::operation::create_table::builders::CreateTableInputBuilder {
630 crate::operation::create_table::builders::CreateTableInputBuilder::default()
631 }
632}
633
634/// A builder for [`CreateTableInput`](crate::operation::create_table::CreateTableInput).
635#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
636#[non_exhaustive]
637pub struct CreateTableInputBuilder {
638 pub(crate) attribute_definitions: ::std::option::Option<::std::vec::Vec::<crate::types::AttributeDefinition>>,
639 pub(crate) table_name: ::std::option::Option<::std::string::String>,
640 pub(crate) key_schema: ::std::option::Option<::std::vec::Vec::<crate::types::KeySchemaElement>>,
641 pub(crate) local_secondary_indexes: ::std::option::Option<::std::vec::Vec::<crate::types::LocalSecondaryIndex>>,
642 pub(crate) global_secondary_indexes: ::std::option::Option<::std::vec::Vec::<crate::types::GlobalSecondaryIndex>>,
643 pub(crate) billing_mode: ::std::option::Option<crate::types::BillingMode>,
644 pub(crate) provisioned_throughput: ::std::option::Option<crate::types::ProvisionedThroughput>,
645 pub(crate) stream_specification: ::std::option::Option<crate::types::StreamSpecification>,
646 pub(crate) sse_specification: ::std::option::Option<crate::types::SseSpecification>,
647 pub(crate) tags: ::std::option::Option<::std::vec::Vec::<crate::types::Tag>>,
648 pub(crate) table_class: ::std::option::Option<crate::types::TableClass>,
649 pub(crate) deletion_protection_enabled: ::std::option::Option<bool>,
650 pub(crate) warm_throughput: ::std::option::Option<crate::types::WarmThroughput>,
651 pub(crate) resource_policy: ::std::option::Option<::std::string::String>,
652 pub(crate) on_demand_throughput: ::std::option::Option<crate::types::OnDemandThroughput>,
653}
654impl CreateTableInputBuilder {
655 /// Appends an item to `attribute_definitions`.
656 ///
657 /// To override the contents of this collection use [`set_attribute_definitions`](Self::set_attribute_definitions).
658 ///
659 /// <p>An array of attributes that describe the key schema for the table and indexes.</p>
660 pub fn attribute_definitions(mut self, input: crate::types::AttributeDefinition) -> Self {
661 let mut v = self.attribute_definitions.unwrap_or_default();
662 v.push(input);
663 self.attribute_definitions = ::std::option::Option::Some(v);
664 self
665 }
666 /// <p>An array of attributes that describe the key schema for the table and indexes.</p>
667 pub fn set_attribute_definitions(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::AttributeDefinition>>) -> Self {
668 self.attribute_definitions = input; self
669 }
670 /// <p>An array of attributes that describe the key schema for the table and indexes.</p>
671 pub fn get_attribute_definitions(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::AttributeDefinition>> {
672 &self.attribute_definitions
673 }
674 /// <p>The name of the table to create. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
675 /// This field is required.
676 pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
677 self.table_name = ::std::option::Option::Some(input.into());
678 self
679 }
680 /// <p>The name of the table to create. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
681 pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
682 self.table_name = input; self
683 }
684 /// <p>The name of the table to create. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
685 pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
686 &self.table_name
687 }
688 /// Appends an item to `key_schema`.
689 ///
690 /// To override the contents of this collection use [`set_key_schema`](Self::set_key_schema).
691 ///
692 /// <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>
693 /// <p>Each <code>KeySchemaElement</code> in the array is composed of:</p>
694 /// <ul>
695 /// <li>
696 /// <p><code>AttributeName</code> - The name of this key attribute.</p></li>
697 /// <li>
698 /// <p><code>KeyType</code> - The role that the key attribute will assume:</p>
699 /// <ul>
700 /// <li>
701 /// <p><code>HASH</code> - partition key</p></li>
702 /// <li>
703 /// <p><code>RANGE</code> - sort key</p></li>
704 /// </ul></li>
705 /// </ul><note>
706 /// <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>
707 /// <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>
708 /// </note>
709 /// <p>For a simple primary key (partition key), you must provide exactly one element with a <code>KeyType</code> of <code>HASH</code>.</p>
710 /// <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>
711 /// <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>
712 pub fn key_schema(mut self, input: crate::types::KeySchemaElement) -> Self {
713 let mut v = self.key_schema.unwrap_or_default();
714 v.push(input);
715 self.key_schema = ::std::option::Option::Some(v);
716 self
717 }
718 /// <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>
719 /// <p>Each <code>KeySchemaElement</code> in the array is composed of:</p>
720 /// <ul>
721 /// <li>
722 /// <p><code>AttributeName</code> - The name of this key attribute.</p></li>
723 /// <li>
724 /// <p><code>KeyType</code> - The role that the key attribute will assume:</p>
725 /// <ul>
726 /// <li>
727 /// <p><code>HASH</code> - partition key</p></li>
728 /// <li>
729 /// <p><code>RANGE</code> - sort key</p></li>
730 /// </ul></li>
731 /// </ul><note>
732 /// <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>
733 /// <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>
734 /// </note>
735 /// <p>For a simple primary key (partition key), you must provide exactly one element with a <code>KeyType</code> of <code>HASH</code>.</p>
736 /// <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>
737 /// <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>
738 pub fn set_key_schema(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::KeySchemaElement>>) -> Self {
739 self.key_schema = input; self
740 }
741 /// <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>
742 /// <p>Each <code>KeySchemaElement</code> in the array is composed of:</p>
743 /// <ul>
744 /// <li>
745 /// <p><code>AttributeName</code> - The name of this key attribute.</p></li>
746 /// <li>
747 /// <p><code>KeyType</code> - The role that the key attribute will assume:</p>
748 /// <ul>
749 /// <li>
750 /// <p><code>HASH</code> - partition key</p></li>
751 /// <li>
752 /// <p><code>RANGE</code> - sort key</p></li>
753 /// </ul></li>
754 /// </ul><note>
755 /// <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>
756 /// <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>
757 /// </note>
758 /// <p>For a simple primary key (partition key), you must provide exactly one element with a <code>KeyType</code> of <code>HASH</code>.</p>
759 /// <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>
760 /// <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>
761 pub fn get_key_schema(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::KeySchemaElement>> {
762 &self.key_schema
763 }
764 /// Appends an item to `local_secondary_indexes`.
765 ///
766 /// To override the contents of this collection use [`set_local_secondary_indexes`](Self::set_local_secondary_indexes).
767 ///
768 /// <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>
769 /// <p>Each local secondary index in the array includes the following:</p>
770 /// <ul>
771 /// <li>
772 /// <p><code>IndexName</code> - The name of the local secondary index. Must be unique only for this table.</p>
773 /// <p></p></li>
774 /// <li>
775 /// <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>
776 /// <li>
777 /// <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>
778 /// <ul>
779 /// <li>
780 /// <p><code>ProjectionType</code> - One of the following:</p>
781 /// <ul>
782 /// <li>
783 /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
784 /// <li>
785 /// <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>
786 /// <li>
787 /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
788 /// </ul></li>
789 /// <li>
790 /// <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>
791 /// </ul></li>
792 /// </ul>
793 pub fn local_secondary_indexes(mut self, input: crate::types::LocalSecondaryIndex) -> Self {
794 let mut v = self.local_secondary_indexes.unwrap_or_default();
795 v.push(input);
796 self.local_secondary_indexes = ::std::option::Option::Some(v);
797 self
798 }
799 /// <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>
800 /// <p>Each local secondary index in the array includes the following:</p>
801 /// <ul>
802 /// <li>
803 /// <p><code>IndexName</code> - The name of the local secondary index. Must be unique only for this table.</p>
804 /// <p></p></li>
805 /// <li>
806 /// <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>
807 /// <li>
808 /// <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>
809 /// <ul>
810 /// <li>
811 /// <p><code>ProjectionType</code> - One of the following:</p>
812 /// <ul>
813 /// <li>
814 /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
815 /// <li>
816 /// <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>
817 /// <li>
818 /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
819 /// </ul></li>
820 /// <li>
821 /// <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>
822 /// </ul></li>
823 /// </ul>
824 pub fn set_local_secondary_indexes(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::LocalSecondaryIndex>>) -> Self {
825 self.local_secondary_indexes = input; self
826 }
827 /// <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>
828 /// <p>Each local secondary index in the array includes the following:</p>
829 /// <ul>
830 /// <li>
831 /// <p><code>IndexName</code> - The name of the local secondary index. Must be unique only for this table.</p>
832 /// <p></p></li>
833 /// <li>
834 /// <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>
835 /// <li>
836 /// <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>
837 /// <ul>
838 /// <li>
839 /// <p><code>ProjectionType</code> - One of the following:</p>
840 /// <ul>
841 /// <li>
842 /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
843 /// <li>
844 /// <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>
845 /// <li>
846 /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
847 /// </ul></li>
848 /// <li>
849 /// <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>
850 /// </ul></li>
851 /// </ul>
852 pub fn get_local_secondary_indexes(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::LocalSecondaryIndex>> {
853 &self.local_secondary_indexes
854 }
855 /// Appends an item to `global_secondary_indexes`.
856 ///
857 /// To override the contents of this collection use [`set_global_secondary_indexes`](Self::set_global_secondary_indexes).
858 ///
859 /// <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>
860 /// <ul>
861 /// <li>
862 /// <p><code>IndexName</code> - The name of the global secondary index. Must be unique only for this table.</p>
863 /// <p></p></li>
864 /// <li>
865 /// <p><code>KeySchema</code> - Specifies the key schema for the global secondary index.</p></li>
866 /// <li>
867 /// <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>
868 /// <ul>
869 /// <li>
870 /// <p><code>ProjectionType</code> - One of the following:</p>
871 /// <ul>
872 /// <li>
873 /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
874 /// <li>
875 /// <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>
876 /// <li>
877 /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
878 /// </ul></li>
879 /// <li>
880 /// <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>
881 /// </ul></li>
882 /// <li>
883 /// <p><code>ProvisionedThroughput</code> - The provisioned throughput settings for the global secondary index, consisting of read and write capacity units.</p></li>
884 /// </ul>
885 pub fn global_secondary_indexes(mut self, input: crate::types::GlobalSecondaryIndex) -> Self {
886 let mut v = self.global_secondary_indexes.unwrap_or_default();
887 v.push(input);
888 self.global_secondary_indexes = ::std::option::Option::Some(v);
889 self
890 }
891 /// <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>
892 /// <ul>
893 /// <li>
894 /// <p><code>IndexName</code> - The name of the global secondary index. Must be unique only for this table.</p>
895 /// <p></p></li>
896 /// <li>
897 /// <p><code>KeySchema</code> - Specifies the key schema for the global secondary index.</p></li>
898 /// <li>
899 /// <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>
900 /// <ul>
901 /// <li>
902 /// <p><code>ProjectionType</code> - One of the following:</p>
903 /// <ul>
904 /// <li>
905 /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
906 /// <li>
907 /// <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>
908 /// <li>
909 /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
910 /// </ul></li>
911 /// <li>
912 /// <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>
913 /// </ul></li>
914 /// <li>
915 /// <p><code>ProvisionedThroughput</code> - The provisioned throughput settings for the global secondary index, consisting of read and write capacity units.</p></li>
916 /// </ul>
917 pub fn set_global_secondary_indexes(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::GlobalSecondaryIndex>>) -> Self {
918 self.global_secondary_indexes = input; self
919 }
920 /// <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>
921 /// <ul>
922 /// <li>
923 /// <p><code>IndexName</code> - The name of the global secondary index. Must be unique only for this table.</p>
924 /// <p></p></li>
925 /// <li>
926 /// <p><code>KeySchema</code> - Specifies the key schema for the global secondary index.</p></li>
927 /// <li>
928 /// <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>
929 /// <ul>
930 /// <li>
931 /// <p><code>ProjectionType</code> - One of the following:</p>
932 /// <ul>
933 /// <li>
934 /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
935 /// <li>
936 /// <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>
937 /// <li>
938 /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
939 /// </ul></li>
940 /// <li>
941 /// <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>
942 /// </ul></li>
943 /// <li>
944 /// <p><code>ProvisionedThroughput</code> - The provisioned throughput settings for the global secondary index, consisting of read and write capacity units.</p></li>
945 /// </ul>
946 pub fn get_global_secondary_indexes(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::GlobalSecondaryIndex>> {
947 &self.global_secondary_indexes
948 }
949 /// <p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
950 /// <ul>
951 /// <li>
952 /// <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>
953 /// <li>
954 /// <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>
955 /// </ul>
956 pub fn billing_mode(mut self, input: crate::types::BillingMode) -> Self {
957 self.billing_mode = ::std::option::Option::Some(input);
958 self
959 }
960 /// <p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
961 /// <ul>
962 /// <li>
963 /// <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>
964 /// <li>
965 /// <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>
966 /// </ul>
967 pub fn set_billing_mode(mut self, input: ::std::option::Option<crate::types::BillingMode>) -> Self {
968 self.billing_mode = input; self
969 }
970 /// <p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
971 /// <ul>
972 /// <li>
973 /// <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>
974 /// <li>
975 /// <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>
976 /// </ul>
977 pub fn get_billing_mode(&self) -> &::std::option::Option<crate::types::BillingMode> {
978 &self.billing_mode
979 }
980 /// <p>Represents the provisioned throughput settings for a specified table or index. The settings can be modified using the <code>UpdateTable</code> operation.</p>
981 /// <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>
982 /// <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>
983 pub fn provisioned_throughput(mut self, input: crate::types::ProvisionedThroughput) -> Self {
984 self.provisioned_throughput = ::std::option::Option::Some(input);
985 self
986 }
987 /// <p>Represents the provisioned throughput settings for a specified table or index. The settings can be modified using the <code>UpdateTable</code> operation.</p>
988 /// <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>
989 /// <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>
990 pub fn set_provisioned_throughput(mut self, input: ::std::option::Option<crate::types::ProvisionedThroughput>) -> Self {
991 self.provisioned_throughput = input; self
992 }
993 /// <p>Represents the provisioned throughput settings for a specified table or index. The settings can be modified using the <code>UpdateTable</code> operation.</p>
994 /// <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>
995 /// <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>
996 pub fn get_provisioned_throughput(&self) -> &::std::option::Option<crate::types::ProvisionedThroughput> {
997 &self.provisioned_throughput
998 }
999 /// <p>The settings for DynamoDB Streams on the table. These settings consist of:</p>
1000 /// <ul>
1001 /// <li>
1002 /// <p><code>StreamEnabled</code> - Indicates whether DynamoDB Streams is to be enabled (true) or disabled (false).</p></li>
1003 /// <li>
1004 /// <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>
1005 /// <ul>
1006 /// <li>
1007 /// <p><code>KEYS_ONLY</code> - Only the key attributes of the modified item are written to the stream.</p></li>
1008 /// <li>
1009 /// <p><code>NEW_IMAGE</code> - The entire item, as it appears after it was modified, is written to the stream.</p></li>
1010 /// <li>
1011 /// <p><code>OLD_IMAGE</code> - The entire item, as it appeared before it was modified, is written to the stream.</p></li>
1012 /// <li>
1013 /// <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>
1014 /// </ul></li>
1015 /// </ul>
1016 pub fn stream_specification(mut self, input: crate::types::StreamSpecification) -> Self {
1017 self.stream_specification = ::std::option::Option::Some(input);
1018 self
1019 }
1020 /// <p>The settings for DynamoDB Streams on the table. These settings consist of:</p>
1021 /// <ul>
1022 /// <li>
1023 /// <p><code>StreamEnabled</code> - Indicates whether DynamoDB Streams is to be enabled (true) or disabled (false).</p></li>
1024 /// <li>
1025 /// <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>
1026 /// <ul>
1027 /// <li>
1028 /// <p><code>KEYS_ONLY</code> - Only the key attributes of the modified item are written to the stream.</p></li>
1029 /// <li>
1030 /// <p><code>NEW_IMAGE</code> - The entire item, as it appears after it was modified, is written to the stream.</p></li>
1031 /// <li>
1032 /// <p><code>OLD_IMAGE</code> - The entire item, as it appeared before it was modified, is written to the stream.</p></li>
1033 /// <li>
1034 /// <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>
1035 /// </ul></li>
1036 /// </ul>
1037 pub fn set_stream_specification(mut self, input: ::std::option::Option<crate::types::StreamSpecification>) -> Self {
1038 self.stream_specification = input; self
1039 }
1040 /// <p>The settings for DynamoDB Streams on the table. These settings consist of:</p>
1041 /// <ul>
1042 /// <li>
1043 /// <p><code>StreamEnabled</code> - Indicates whether DynamoDB Streams is to be enabled (true) or disabled (false).</p></li>
1044 /// <li>
1045 /// <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>
1046 /// <ul>
1047 /// <li>
1048 /// <p><code>KEYS_ONLY</code> - Only the key attributes of the modified item are written to the stream.</p></li>
1049 /// <li>
1050 /// <p><code>NEW_IMAGE</code> - The entire item, as it appears after it was modified, is written to the stream.</p></li>
1051 /// <li>
1052 /// <p><code>OLD_IMAGE</code> - The entire item, as it appeared before it was modified, is written to the stream.</p></li>
1053 /// <li>
1054 /// <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>
1055 /// </ul></li>
1056 /// </ul>
1057 pub fn get_stream_specification(&self) -> &::std::option::Option<crate::types::StreamSpecification> {
1058 &self.stream_specification
1059 }
1060 /// <p>Represents the settings used to enable server-side encryption.</p>
1061 pub fn sse_specification(mut self, input: crate::types::SseSpecification) -> Self {
1062 self.sse_specification = ::std::option::Option::Some(input);
1063 self
1064 }
1065 /// <p>Represents the settings used to enable server-side encryption.</p>
1066 pub fn set_sse_specification(mut self, input: ::std::option::Option<crate::types::SseSpecification>) -> Self {
1067 self.sse_specification = input; self
1068 }
1069 /// <p>Represents the settings used to enable server-side encryption.</p>
1070 pub fn get_sse_specification(&self) -> &::std::option::Option<crate::types::SseSpecification> {
1071 &self.sse_specification
1072 }
1073 /// Appends an item to `tags`.
1074 ///
1075 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
1076 ///
1077 /// <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>
1078 pub fn tags(mut self, input: crate::types::Tag) -> Self {
1079 let mut v = self.tags.unwrap_or_default();
1080 v.push(input);
1081 self.tags = ::std::option::Option::Some(v);
1082 self
1083 }
1084 /// <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>
1085 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::Tag>>) -> Self {
1086 self.tags = input; self
1087 }
1088 /// <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>
1089 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::Tag>> {
1090 &self.tags
1091 }
1092 /// <p>The table class of the new table. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
1093 pub fn table_class(mut self, input: crate::types::TableClass) -> Self {
1094 self.table_class = ::std::option::Option::Some(input);
1095 self
1096 }
1097 /// <p>The table class of the new table. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
1098 pub fn set_table_class(mut self, input: ::std::option::Option<crate::types::TableClass>) -> Self {
1099 self.table_class = input; self
1100 }
1101 /// <p>The table class of the new table. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
1102 pub fn get_table_class(&self) -> &::std::option::Option<crate::types::TableClass> {
1103 &self.table_class
1104 }
1105 /// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
1106 pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
1107 self.deletion_protection_enabled = ::std::option::Option::Some(input);
1108 self
1109 }
1110 /// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
1111 pub fn set_deletion_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
1112 self.deletion_protection_enabled = input; self
1113 }
1114 /// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
1115 pub fn get_deletion_protection_enabled(&self) -> &::std::option::Option<bool> {
1116 &self.deletion_protection_enabled
1117 }
1118 /// <p>Represents the warm throughput (in read units per second and write units per second) for creating a table.</p>
1119 pub fn warm_throughput(mut self, input: crate::types::WarmThroughput) -> Self {
1120 self.warm_throughput = ::std::option::Option::Some(input);
1121 self
1122 }
1123 /// <p>Represents the warm throughput (in read units per second and write units per second) for creating a table.</p>
1124 pub fn set_warm_throughput(mut self, input: ::std::option::Option<crate::types::WarmThroughput>) -> Self {
1125 self.warm_throughput = input; self
1126 }
1127 /// <p>Represents the warm throughput (in read units per second and write units per second) for creating a table.</p>
1128 pub fn get_warm_throughput(&self) -> &::std::option::Option<crate::types::WarmThroughput> {
1129 &self.warm_throughput
1130 }
1131 /// <p>An Amazon Web Services resource-based policy document in JSON format that will be attached to the table.</p>
1132 /// <p>When you attach a resource-based policy while creating a table, the policy application is <i>strongly consistent</i>.</p>
1133 /// <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>
1134 /// <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>
1135 /// </note>
1136 pub fn resource_policy(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
1137 self.resource_policy = ::std::option::Option::Some(input.into());
1138 self
1139 }
1140 /// <p>An Amazon Web Services resource-based policy document in JSON format that will be attached to the table.</p>
1141 /// <p>When you attach a resource-based policy while creating a table, the policy application is <i>strongly consistent</i>.</p>
1142 /// <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>
1143 /// <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>
1144 /// </note>
1145 pub fn set_resource_policy(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
1146 self.resource_policy = input; self
1147 }
1148 /// <p>An Amazon Web Services resource-based policy document in JSON format that will be attached to the table.</p>
1149 /// <p>When you attach a resource-based policy while creating a table, the policy application is <i>strongly consistent</i>.</p>
1150 /// <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>
1151 /// <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>
1152 /// </note>
1153 pub fn get_resource_policy(&self) -> &::std::option::Option<::std::string::String> {
1154 &self.resource_policy
1155 }
1156 /// <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>
1157 pub fn on_demand_throughput(mut self, input: crate::types::OnDemandThroughput) -> Self {
1158 self.on_demand_throughput = ::std::option::Option::Some(input);
1159 self
1160 }
1161 /// <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>
1162 pub fn set_on_demand_throughput(mut self, input: ::std::option::Option<crate::types::OnDemandThroughput>) -> Self {
1163 self.on_demand_throughput = input; self
1164 }
1165 /// <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>
1166 pub fn get_on_demand_throughput(&self) -> &::std::option::Option<crate::types::OnDemandThroughput> {
1167 &self.on_demand_throughput
1168 }
1169 /// Consumes the builder and constructs a [`CreateTableInput`](crate::operation::create_table::CreateTableInput).
1170 pub fn build(self) -> ::std::result::Result<crate::operation::create_table::CreateTableInput, ::aws_smithy_types::error::operation::BuildError> {
1171 ::std::result::Result::Ok(
1172 crate::operation::create_table::CreateTableInput {
1173 attribute_definitions: self.attribute_definitions
1174 ,
1175 table_name: self.table_name
1176 ,
1177 key_schema: self.key_schema
1178 ,
1179 local_secondary_indexes: self.local_secondary_indexes
1180 ,
1181 global_secondary_indexes: self.global_secondary_indexes
1182 ,
1183 billing_mode: self.billing_mode
1184 ,
1185 provisioned_throughput: self.provisioned_throughput
1186 ,
1187 stream_specification: self.stream_specification
1188 ,
1189 sse_specification: self.sse_specification
1190 ,
1191 tags: self.tags
1192 ,
1193 table_class: self.table_class
1194 ,
1195 deletion_protection_enabled: self.deletion_protection_enabled
1196 ,
1197 warm_throughput: self.warm_throughput
1198 ,
1199 resource_policy: self.resource_policy
1200 ,
1201 on_demand_throughput: self.on_demand_throughput
1202 ,
1203 }
1204 )
1205 }
1206}
1207