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().unwrap_or_default()
140 }
141 /// <p>The name of the table to create. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
142 pub fn table_name(&self) -> ::std::option::Option<&str> {
143 self.table_name.as_deref()
144 }
145 /// <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>
146 /// <p>Each <code>KeySchemaElement</code> in the array is composed of:</p>
147 /// <ul>
148 /// <li>
149 /// <p><code>AttributeName</code> - The name of this key attribute.</p></li>
150 /// <li>
151 /// <p><code>KeyType</code> - The role that the key attribute will assume:</p>
152 /// <ul>
153 /// <li>
154 /// <p><code>HASH</code> - partition key</p></li>
155 /// <li>
156 /// <p><code>RANGE</code> - sort key</p></li>
157 /// </ul></li>
158 /// </ul><note>
159 /// <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>
160 /// <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>
161 /// </note>
162 /// <p>For a simple primary key (partition key), you must provide exactly one element with a <code>KeyType</code> of <code>HASH</code>.</p>
163 /// <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>
164 /// <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>
165 ///
166 /// 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()`.
167 pub fn key_schema(&self) -> &[crate::types::KeySchemaElement] {
168 self.key_schema.as_deref().unwrap_or_default()
169 }
170 /// <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>
171 /// <p>Each local secondary index in the array includes the following:</p>
172 /// <ul>
173 /// <li>
174 /// <p><code>IndexName</code> - The name of the local secondary index. Must be unique only for this table.</p>
175 /// <p></p></li>
176 /// <li>
177 /// <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>
178 /// <li>
179 /// <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>
180 /// <ul>
181 /// <li>
182 /// <p><code>ProjectionType</code> - One of the following:</p>
183 /// <ul>
184 /// <li>
185 /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
186 /// <li>
187 /// <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>
188 /// <li>
189 /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
190 /// </ul></li>
191 /// <li>
192 /// <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>
193 /// </ul></li>
194 /// </ul>
195 ///
196 /// 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()`.
197 pub fn local_secondary_indexes(&self) -> &[crate::types::LocalSecondaryIndex] {
198 self.local_secondary_indexes.as_deref().unwrap_or_default()
199 }
200 /// <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>
201 /// <ul>
202 /// <li>
203 /// <p><code>IndexName</code> - The name of the global secondary index. Must be unique only for this table.</p>
204 /// <p></p></li>
205 /// <li>
206 /// <p><code>KeySchema</code> - Specifies the key schema for the global secondary index.</p></li>
207 /// <li>
208 /// <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>
209 /// <ul>
210 /// <li>
211 /// <p><code>ProjectionType</code> - One of the following:</p>
212 /// <ul>
213 /// <li>
214 /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
215 /// <li>
216 /// <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>
217 /// <li>
218 /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
219 /// </ul></li>
220 /// <li>
221 /// <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>
222 /// </ul></li>
223 /// <li>
224 /// <p><code>ProvisionedThroughput</code> - The provisioned throughput settings for the global secondary index, consisting of read and write capacity units.</p></li>
225 /// </ul>
226 ///
227 /// 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()`.
228 pub fn global_secondary_indexes(&self) -> &[crate::types::GlobalSecondaryIndex] {
229 self.global_secondary_indexes.as_deref().unwrap_or_default()
230 }
231 /// <p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
232 /// <ul>
233 /// <li>
234 /// <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>
235 /// <li>
236 /// <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>
237 /// </ul>
238 pub fn billing_mode(&self) -> ::std::option::Option<&crate::types::BillingMode> {
239 self.billing_mode.as_ref()
240 }
241 /// <p>Represents the provisioned throughput settings for a specified table or index. The settings can be modified using the <code>UpdateTable</code> operation.</p>
242 /// <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>
243 /// <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>
244 pub fn provisioned_throughput(&self) -> ::std::option::Option<&crate::types::ProvisionedThroughput> {
245 self.provisioned_throughput.as_ref()
246 }
247 /// <p>The settings for DynamoDB Streams on the table. These settings consist of:</p>
248 /// <ul>
249 /// <li>
250 /// <p><code>StreamEnabled</code> - Indicates whether DynamoDB Streams is to be enabled (true) or disabled (false).</p></li>
251 /// <li>
252 /// <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>
253 /// <ul>
254 /// <li>
255 /// <p><code>KEYS_ONLY</code> - Only the key attributes of the modified item are written to the stream.</p></li>
256 /// <li>
257 /// <p><code>NEW_IMAGE</code> - The entire item, as it appears after it was modified, is written to the stream.</p></li>
258 /// <li>
259 /// <p><code>OLD_IMAGE</code> - The entire item, as it appeared before it was modified, is written to the stream.</p></li>
260 /// <li>
261 /// <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>
262 /// </ul></li>
263 /// </ul>
264 pub fn stream_specification(&self) -> ::std::option::Option<&crate::types::StreamSpecification> {
265 self.stream_specification.as_ref()
266 }
267 /// <p>Represents the settings used to enable server-side encryption.</p>
268 pub fn sse_specification(&self) -> ::std::option::Option<&crate::types::SseSpecification> {
269 self.sse_specification.as_ref()
270 }
271 /// <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>
272 ///
273 /// 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()`.
274 pub fn tags(&self) -> &[crate::types::Tag] {
275 self.tags.as_deref().unwrap_or_default()
276 }
277 /// <p>The table class of the new table. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
278 pub fn table_class(&self) -> ::std::option::Option<&crate::types::TableClass> {
279 self.table_class.as_ref()
280 }
281 /// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
282 pub fn deletion_protection_enabled(&self) -> ::std::option::Option<bool> {
283 self.deletion_protection_enabled
284 }
285 /// <p>Represents the warm throughput (in read units per second and write units per second) for creating a table.</p>
286 pub fn warm_throughput(&self) -> ::std::option::Option<&crate::types::WarmThroughput> {
287 self.warm_throughput.as_ref()
288 }
289 /// <p>An Amazon Web Services resource-based policy document in JSON format that will be attached to the table.</p>
290 /// <p>When you attach a resource-based policy while creating a table, the policy application is <i>strongly consistent</i>.</p>
291 /// <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>
292 /// <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>
293 /// </note>
294 pub fn resource_policy(&self) -> ::std::option::Option<&str> {
295 self.resource_policy.as_deref()
296 }
297 /// <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>
298 pub fn on_demand_throughput(&self) -> ::std::option::Option<&crate::types::OnDemandThroughput> {
299 self.on_demand_throughput.as_ref()
300 }
301}
302impl CreateTableInput {
303 /// Creates a new builder-style object to manufacture [`CreateTableInput`](crate::operation::create_table::CreateTableInput).
304 pub fn builder() -> crate::operation::create_table::builders::CreateTableInputBuilder {
305 crate::operation::create_table::builders::CreateTableInputBuilder::default()
306 }
307}
308
309/// A builder for [`CreateTableInput`](crate::operation::create_table::CreateTableInput).
310#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
311#[non_exhaustive]
312pub struct CreateTableInputBuilder {
313 pub(crate) attribute_definitions: ::std::option::Option<::std::vec::Vec<crate::types::AttributeDefinition>>,
314 pub(crate) table_name: ::std::option::Option<::std::string::String>,
315 pub(crate) key_schema: ::std::option::Option<::std::vec::Vec<crate::types::KeySchemaElement>>,
316 pub(crate) local_secondary_indexes: ::std::option::Option<::std::vec::Vec<crate::types::LocalSecondaryIndex>>,
317 pub(crate) global_secondary_indexes: ::std::option::Option<::std::vec::Vec<crate::types::GlobalSecondaryIndex>>,
318 pub(crate) billing_mode: ::std::option::Option<crate::types::BillingMode>,
319 pub(crate) provisioned_throughput: ::std::option::Option<crate::types::ProvisionedThroughput>,
320 pub(crate) stream_specification: ::std::option::Option<crate::types::StreamSpecification>,
321 pub(crate) sse_specification: ::std::option::Option<crate::types::SseSpecification>,
322 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
323 pub(crate) table_class: ::std::option::Option<crate::types::TableClass>,
324 pub(crate) deletion_protection_enabled: ::std::option::Option<bool>,
325 pub(crate) warm_throughput: ::std::option::Option<crate::types::WarmThroughput>,
326 pub(crate) resource_policy: ::std::option::Option<::std::string::String>,
327 pub(crate) on_demand_throughput: ::std::option::Option<crate::types::OnDemandThroughput>,
328}
329impl CreateTableInputBuilder {
330 /// Appends an item to `attribute_definitions`.
331 ///
332 /// To override the contents of this collection use [`set_attribute_definitions`](Self::set_attribute_definitions).
333 ///
334 /// <p>An array of attributes that describe the key schema for the table and indexes.</p>
335 pub fn attribute_definitions(mut self, input: crate::types::AttributeDefinition) -> Self {
336 let mut v = self.attribute_definitions.unwrap_or_default();
337 v.push(input);
338 self.attribute_definitions = ::std::option::Option::Some(v);
339 self
340 }
341 /// <p>An array of attributes that describe the key schema for the table and indexes.</p>
342 pub fn set_attribute_definitions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AttributeDefinition>>) -> Self {
343 self.attribute_definitions = input;
344 self
345 }
346 /// <p>An array of attributes that describe the key schema for the table and indexes.</p>
347 pub fn get_attribute_definitions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AttributeDefinition>> {
348 &self.attribute_definitions
349 }
350 /// <p>The name of the table to create. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
351 /// This field is required.
352 pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
353 self.table_name = ::std::option::Option::Some(input.into());
354 self
355 }
356 /// <p>The name of the table to create. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
357 pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
358 self.table_name = input;
359 self
360 }
361 /// <p>The name of the table to create. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
362 pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
363 &self.table_name
364 }
365 /// Appends an item to `key_schema`.
366 ///
367 /// To override the contents of this collection use [`set_key_schema`](Self::set_key_schema).
368 ///
369 /// <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>
370 /// <p>Each <code>KeySchemaElement</code> in the array is composed of:</p>
371 /// <ul>
372 /// <li>
373 /// <p><code>AttributeName</code> - The name of this key attribute.</p></li>
374 /// <li>
375 /// <p><code>KeyType</code> - The role that the key attribute will assume:</p>
376 /// <ul>
377 /// <li>
378 /// <p><code>HASH</code> - partition key</p></li>
379 /// <li>
380 /// <p><code>RANGE</code> - sort key</p></li>
381 /// </ul></li>
382 /// </ul><note>
383 /// <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>
384 /// <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>
385 /// </note>
386 /// <p>For a simple primary key (partition key), you must provide exactly one element with a <code>KeyType</code> of <code>HASH</code>.</p>
387 /// <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>
388 /// <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>
389 pub fn key_schema(mut self, input: crate::types::KeySchemaElement) -> Self {
390 let mut v = self.key_schema.unwrap_or_default();
391 v.push(input);
392 self.key_schema = ::std::option::Option::Some(v);
393 self
394 }
395 /// <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>
396 /// <p>Each <code>KeySchemaElement</code> in the array is composed of:</p>
397 /// <ul>
398 /// <li>
399 /// <p><code>AttributeName</code> - The name of this key attribute.</p></li>
400 /// <li>
401 /// <p><code>KeyType</code> - The role that the key attribute will assume:</p>
402 /// <ul>
403 /// <li>
404 /// <p><code>HASH</code> - partition key</p></li>
405 /// <li>
406 /// <p><code>RANGE</code> - sort key</p></li>
407 /// </ul></li>
408 /// </ul><note>
409 /// <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>
410 /// <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>
411 /// </note>
412 /// <p>For a simple primary key (partition key), you must provide exactly one element with a <code>KeyType</code> of <code>HASH</code>.</p>
413 /// <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>
414 /// <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>
415 pub fn set_key_schema(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::KeySchemaElement>>) -> Self {
416 self.key_schema = input;
417 self
418 }
419 /// <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>
420 /// <p>Each <code>KeySchemaElement</code> in the array is composed of:</p>
421 /// <ul>
422 /// <li>
423 /// <p><code>AttributeName</code> - The name of this key attribute.</p></li>
424 /// <li>
425 /// <p><code>KeyType</code> - The role that the key attribute will assume:</p>
426 /// <ul>
427 /// <li>
428 /// <p><code>HASH</code> - partition key</p></li>
429 /// <li>
430 /// <p><code>RANGE</code> - sort key</p></li>
431 /// </ul></li>
432 /// </ul><note>
433 /// <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>
434 /// <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>
435 /// </note>
436 /// <p>For a simple primary key (partition key), you must provide exactly one element with a <code>KeyType</code> of <code>HASH</code>.</p>
437 /// <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>
438 /// <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>
439 pub fn get_key_schema(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::KeySchemaElement>> {
440 &self.key_schema
441 }
442 /// Appends an item to `local_secondary_indexes`.
443 ///
444 /// To override the contents of this collection use [`set_local_secondary_indexes`](Self::set_local_secondary_indexes).
445 ///
446 /// <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>
447 /// <p>Each local secondary index in the array includes the following:</p>
448 /// <ul>
449 /// <li>
450 /// <p><code>IndexName</code> - The name of the local secondary index. Must be unique only for this table.</p>
451 /// <p></p></li>
452 /// <li>
453 /// <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>
454 /// <li>
455 /// <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>
456 /// <ul>
457 /// <li>
458 /// <p><code>ProjectionType</code> - One of the following:</p>
459 /// <ul>
460 /// <li>
461 /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
462 /// <li>
463 /// <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>
464 /// <li>
465 /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
466 /// </ul></li>
467 /// <li>
468 /// <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>
469 /// </ul></li>
470 /// </ul>
471 pub fn local_secondary_indexes(mut self, input: crate::types::LocalSecondaryIndex) -> Self {
472 let mut v = self.local_secondary_indexes.unwrap_or_default();
473 v.push(input);
474 self.local_secondary_indexes = ::std::option::Option::Some(v);
475 self
476 }
477 /// <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>
478 /// <p>Each local secondary index in the array includes the following:</p>
479 /// <ul>
480 /// <li>
481 /// <p><code>IndexName</code> - The name of the local secondary index. Must be unique only for this table.</p>
482 /// <p></p></li>
483 /// <li>
484 /// <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>
485 /// <li>
486 /// <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>
487 /// <ul>
488 /// <li>
489 /// <p><code>ProjectionType</code> - One of the following:</p>
490 /// <ul>
491 /// <li>
492 /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
493 /// <li>
494 /// <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>
495 /// <li>
496 /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
497 /// </ul></li>
498 /// <li>
499 /// <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>
500 /// </ul></li>
501 /// </ul>
502 pub fn set_local_secondary_indexes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LocalSecondaryIndex>>) -> Self {
503 self.local_secondary_indexes = input;
504 self
505 }
506 /// <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>
507 /// <p>Each local secondary index in the array includes the following:</p>
508 /// <ul>
509 /// <li>
510 /// <p><code>IndexName</code> - The name of the local secondary index. Must be unique only for this table.</p>
511 /// <p></p></li>
512 /// <li>
513 /// <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>
514 /// <li>
515 /// <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>
516 /// <ul>
517 /// <li>
518 /// <p><code>ProjectionType</code> - One of the following:</p>
519 /// <ul>
520 /// <li>
521 /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
522 /// <li>
523 /// <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>
524 /// <li>
525 /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
526 /// </ul></li>
527 /// <li>
528 /// <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>
529 /// </ul></li>
530 /// </ul>
531 pub fn get_local_secondary_indexes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LocalSecondaryIndex>> {
532 &self.local_secondary_indexes
533 }
534 /// Appends an item to `global_secondary_indexes`.
535 ///
536 /// To override the contents of this collection use [`set_global_secondary_indexes`](Self::set_global_secondary_indexes).
537 ///
538 /// <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>
539 /// <ul>
540 /// <li>
541 /// <p><code>IndexName</code> - The name of the global secondary index. Must be unique only for this table.</p>
542 /// <p></p></li>
543 /// <li>
544 /// <p><code>KeySchema</code> - Specifies the key schema for the global secondary index.</p></li>
545 /// <li>
546 /// <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>
547 /// <ul>
548 /// <li>
549 /// <p><code>ProjectionType</code> - One of the following:</p>
550 /// <ul>
551 /// <li>
552 /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
553 /// <li>
554 /// <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>
555 /// <li>
556 /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
557 /// </ul></li>
558 /// <li>
559 /// <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>
560 /// </ul></li>
561 /// <li>
562 /// <p><code>ProvisionedThroughput</code> - The provisioned throughput settings for the global secondary index, consisting of read and write capacity units.</p></li>
563 /// </ul>
564 pub fn global_secondary_indexes(mut self, input: crate::types::GlobalSecondaryIndex) -> Self {
565 let mut v = self.global_secondary_indexes.unwrap_or_default();
566 v.push(input);
567 self.global_secondary_indexes = ::std::option::Option::Some(v);
568 self
569 }
570 /// <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>
571 /// <ul>
572 /// <li>
573 /// <p><code>IndexName</code> - The name of the global secondary index. Must be unique only for this table.</p>
574 /// <p></p></li>
575 /// <li>
576 /// <p><code>KeySchema</code> - Specifies the key schema for the global secondary index.</p></li>
577 /// <li>
578 /// <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>
579 /// <ul>
580 /// <li>
581 /// <p><code>ProjectionType</code> - One of the following:</p>
582 /// <ul>
583 /// <li>
584 /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
585 /// <li>
586 /// <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>
587 /// <li>
588 /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
589 /// </ul></li>
590 /// <li>
591 /// <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>
592 /// </ul></li>
593 /// <li>
594 /// <p><code>ProvisionedThroughput</code> - The provisioned throughput settings for the global secondary index, consisting of read and write capacity units.</p></li>
595 /// </ul>
596 pub fn set_global_secondary_indexes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GlobalSecondaryIndex>>) -> Self {
597 self.global_secondary_indexes = input;
598 self
599 }
600 /// <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>
601 /// <ul>
602 /// <li>
603 /// <p><code>IndexName</code> - The name of the global secondary index. Must be unique only for this table.</p>
604 /// <p></p></li>
605 /// <li>
606 /// <p><code>KeySchema</code> - Specifies the key schema for the global secondary index.</p></li>
607 /// <li>
608 /// <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>
609 /// <ul>
610 /// <li>
611 /// <p><code>ProjectionType</code> - One of the following:</p>
612 /// <ul>
613 /// <li>
614 /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
615 /// <li>
616 /// <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>
617 /// <li>
618 /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
619 /// </ul></li>
620 /// <li>
621 /// <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>
622 /// </ul></li>
623 /// <li>
624 /// <p><code>ProvisionedThroughput</code> - The provisioned throughput settings for the global secondary index, consisting of read and write capacity units.</p></li>
625 /// </ul>
626 pub fn get_global_secondary_indexes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GlobalSecondaryIndex>> {
627 &self.global_secondary_indexes
628 }
629 /// <p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
630 /// <ul>
631 /// <li>
632 /// <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>
633 /// <li>
634 /// <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>
635 /// </ul>
636 pub fn billing_mode(mut self, input: crate::types::BillingMode) -> Self {
637 self.billing_mode = ::std::option::Option::Some(input);
638 self
639 }
640 /// <p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
641 /// <ul>
642 /// <li>
643 /// <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>
644 /// <li>
645 /// <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>
646 /// </ul>
647 pub fn set_billing_mode(mut self, input: ::std::option::Option<crate::types::BillingMode>) -> Self {
648 self.billing_mode = input;
649 self
650 }
651 /// <p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
652 /// <ul>
653 /// <li>
654 /// <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>
655 /// <li>
656 /// <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>
657 /// </ul>
658 pub fn get_billing_mode(&self) -> &::std::option::Option<crate::types::BillingMode> {
659 &self.billing_mode
660 }
661 /// <p>Represents the provisioned throughput settings for a specified table or index. The settings can be modified using the <code>UpdateTable</code> operation.</p>
662 /// <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>
663 /// <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>
664 pub fn provisioned_throughput(mut self, input: crate::types::ProvisionedThroughput) -> Self {
665 self.provisioned_throughput = ::std::option::Option::Some(input);
666 self
667 }
668 /// <p>Represents the provisioned throughput settings for a specified table or index. The settings can be modified using the <code>UpdateTable</code> operation.</p>
669 /// <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>
670 /// <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>
671 pub fn set_provisioned_throughput(mut self, input: ::std::option::Option<crate::types::ProvisionedThroughput>) -> Self {
672 self.provisioned_throughput = input;
673 self
674 }
675 /// <p>Represents the provisioned throughput settings for a specified table or index. The settings can be modified using the <code>UpdateTable</code> operation.</p>
676 /// <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>
677 /// <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>
678 pub fn get_provisioned_throughput(&self) -> &::std::option::Option<crate::types::ProvisionedThroughput> {
679 &self.provisioned_throughput
680 }
681 /// <p>The settings for DynamoDB Streams on the table. These settings consist of:</p>
682 /// <ul>
683 /// <li>
684 /// <p><code>StreamEnabled</code> - Indicates whether DynamoDB Streams is to be enabled (true) or disabled (false).</p></li>
685 /// <li>
686 /// <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>
687 /// <ul>
688 /// <li>
689 /// <p><code>KEYS_ONLY</code> - Only the key attributes of the modified item are written to the stream.</p></li>
690 /// <li>
691 /// <p><code>NEW_IMAGE</code> - The entire item, as it appears after it was modified, is written to the stream.</p></li>
692 /// <li>
693 /// <p><code>OLD_IMAGE</code> - The entire item, as it appeared before it was modified, is written to the stream.</p></li>
694 /// <li>
695 /// <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>
696 /// </ul></li>
697 /// </ul>
698 pub fn stream_specification(mut self, input: crate::types::StreamSpecification) -> Self {
699 self.stream_specification = ::std::option::Option::Some(input);
700 self
701 }
702 /// <p>The settings for DynamoDB Streams on the table. These settings consist of:</p>
703 /// <ul>
704 /// <li>
705 /// <p><code>StreamEnabled</code> - Indicates whether DynamoDB Streams is to be enabled (true) or disabled (false).</p></li>
706 /// <li>
707 /// <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>
708 /// <ul>
709 /// <li>
710 /// <p><code>KEYS_ONLY</code> - Only the key attributes of the modified item are written to the stream.</p></li>
711 /// <li>
712 /// <p><code>NEW_IMAGE</code> - The entire item, as it appears after it was modified, is written to the stream.</p></li>
713 /// <li>
714 /// <p><code>OLD_IMAGE</code> - The entire item, as it appeared before it was modified, is written to the stream.</p></li>
715 /// <li>
716 /// <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>
717 /// </ul></li>
718 /// </ul>
719 pub fn set_stream_specification(mut self, input: ::std::option::Option<crate::types::StreamSpecification>) -> Self {
720 self.stream_specification = input;
721 self
722 }
723 /// <p>The settings for DynamoDB Streams on the table. These settings consist of:</p>
724 /// <ul>
725 /// <li>
726 /// <p><code>StreamEnabled</code> - Indicates whether DynamoDB Streams is to be enabled (true) or disabled (false).</p></li>
727 /// <li>
728 /// <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>
729 /// <ul>
730 /// <li>
731 /// <p><code>KEYS_ONLY</code> - Only the key attributes of the modified item are written to the stream.</p></li>
732 /// <li>
733 /// <p><code>NEW_IMAGE</code> - The entire item, as it appears after it was modified, is written to the stream.</p></li>
734 /// <li>
735 /// <p><code>OLD_IMAGE</code> - The entire item, as it appeared before it was modified, is written to the stream.</p></li>
736 /// <li>
737 /// <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>
738 /// </ul></li>
739 /// </ul>
740 pub fn get_stream_specification(&self) -> &::std::option::Option<crate::types::StreamSpecification> {
741 &self.stream_specification
742 }
743 /// <p>Represents the settings used to enable server-side encryption.</p>
744 pub fn sse_specification(mut self, input: crate::types::SseSpecification) -> Self {
745 self.sse_specification = ::std::option::Option::Some(input);
746 self
747 }
748 /// <p>Represents the settings used to enable server-side encryption.</p>
749 pub fn set_sse_specification(mut self, input: ::std::option::Option<crate::types::SseSpecification>) -> Self {
750 self.sse_specification = input;
751 self
752 }
753 /// <p>Represents the settings used to enable server-side encryption.</p>
754 pub fn get_sse_specification(&self) -> &::std::option::Option<crate::types::SseSpecification> {
755 &self.sse_specification
756 }
757 /// Appends an item to `tags`.
758 ///
759 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
760 ///
761 /// <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>
762 pub fn tags(mut self, input: crate::types::Tag) -> Self {
763 let mut v = self.tags.unwrap_or_default();
764 v.push(input);
765 self.tags = ::std::option::Option::Some(v);
766 self
767 }
768 /// <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>
769 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
770 self.tags = input;
771 self
772 }
773 /// <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>
774 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
775 &self.tags
776 }
777 /// <p>The table class of the new table. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
778 pub fn table_class(mut self, input: crate::types::TableClass) -> Self {
779 self.table_class = ::std::option::Option::Some(input);
780 self
781 }
782 /// <p>The table class of the new table. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
783 pub fn set_table_class(mut self, input: ::std::option::Option<crate::types::TableClass>) -> Self {
784 self.table_class = input;
785 self
786 }
787 /// <p>The table class of the new table. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
788 pub fn get_table_class(&self) -> &::std::option::Option<crate::types::TableClass> {
789 &self.table_class
790 }
791 /// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
792 pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
793 self.deletion_protection_enabled = ::std::option::Option::Some(input);
794 self
795 }
796 /// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
797 pub fn set_deletion_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
798 self.deletion_protection_enabled = input;
799 self
800 }
801 /// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
802 pub fn get_deletion_protection_enabled(&self) -> &::std::option::Option<bool> {
803 &self.deletion_protection_enabled
804 }
805 /// <p>Represents the warm throughput (in read units per second and write units per second) for creating a table.</p>
806 pub fn warm_throughput(mut self, input: crate::types::WarmThroughput) -> Self {
807 self.warm_throughput = ::std::option::Option::Some(input);
808 self
809 }
810 /// <p>Represents the warm throughput (in read units per second and write units per second) for creating a table.</p>
811 pub fn set_warm_throughput(mut self, input: ::std::option::Option<crate::types::WarmThroughput>) -> Self {
812 self.warm_throughput = input;
813 self
814 }
815 /// <p>Represents the warm throughput (in read units per second and write units per second) for creating a table.</p>
816 pub fn get_warm_throughput(&self) -> &::std::option::Option<crate::types::WarmThroughput> {
817 &self.warm_throughput
818 }
819 /// <p>An Amazon Web Services resource-based policy document in JSON format that will be attached to the table.</p>
820 /// <p>When you attach a resource-based policy while creating a table, the policy application is <i>strongly consistent</i>.</p>
821 /// <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>
822 /// <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>
823 /// </note>
824 pub fn resource_policy(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
825 self.resource_policy = ::std::option::Option::Some(input.into());
826 self
827 }
828 /// <p>An Amazon Web Services resource-based policy document in JSON format that will be attached to the table.</p>
829 /// <p>When you attach a resource-based policy while creating a table, the policy application is <i>strongly consistent</i>.</p>
830 /// <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>
831 /// <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>
832 /// </note>
833 pub fn set_resource_policy(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
834 self.resource_policy = input;
835 self
836 }
837 /// <p>An Amazon Web Services resource-based policy document in JSON format that will be attached to the table.</p>
838 /// <p>When you attach a resource-based policy while creating a table, the policy application is <i>strongly consistent</i>.</p>
839 /// <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>
840 /// <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>
841 /// </note>
842 pub fn get_resource_policy(&self) -> &::std::option::Option<::std::string::String> {
843 &self.resource_policy
844 }
845 /// <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>
846 pub fn on_demand_throughput(mut self, input: crate::types::OnDemandThroughput) -> Self {
847 self.on_demand_throughput = ::std::option::Option::Some(input);
848 self
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 set_on_demand_throughput(mut self, input: ::std::option::Option<crate::types::OnDemandThroughput>) -> Self {
852 self.on_demand_throughput = 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 get_on_demand_throughput(&self) -> &::std::option::Option<crate::types::OnDemandThroughput> {
857 &self.on_demand_throughput
858 }
859 /// Consumes the builder and constructs a [`CreateTableInput`](crate::operation::create_table::CreateTableInput).
860 pub fn build(self) -> ::std::result::Result<crate::operation::create_table::CreateTableInput, ::aws_smithy_types::error::operation::BuildError> {
861 ::std::result::Result::Ok(crate::operation::create_table::CreateTableInput {
862 attribute_definitions: self.attribute_definitions,
863 table_name: self.table_name,
864 key_schema: self.key_schema,
865 local_secondary_indexes: self.local_secondary_indexes,
866 global_secondary_indexes: self.global_secondary_indexes,
867 billing_mode: self.billing_mode,
868 provisioned_throughput: self.provisioned_throughput,
869 stream_specification: self.stream_specification,
870 sse_specification: self.sse_specification,
871 tags: self.tags,
872 table_class: self.table_class,
873 deletion_protection_enabled: self.deletion_protection_enabled,
874 warm_throughput: self.warm_throughput,
875 resource_policy: self.resource_policy,
876 on_demand_throughput: self.on_demand_throughput,
877 })
878 }
879}