aws_sdk_dynamodb/operation/create_table/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_table::_create_table_output::CreateTableOutputBuilder;
3
4pub use crate::operation::create_table::_create_table_input::CreateTableInputBuilder;
5
6impl crate::operation::create_table::builders::CreateTableInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::create_table::CreateTableOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_table::CreateTableError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_table();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateTable`.
24///
25/// <p>The <code>CreateTable</code> operation adds a new table to your account. In an Amazon Web Services account, table names must be unique within each Region. That is, you can have two tables with same name if you create the tables in different Regions.</p>
26/// <p><code>CreateTable</code> is an asynchronous operation. Upon receiving a <code>CreateTable</code> request, DynamoDB immediately returns a response with a <code>TableStatus</code> of <code>CREATING</code>. After the table is created, DynamoDB sets the <code>TableStatus</code> to <code>ACTIVE</code>. You can perform read and write operations only on an <code>ACTIVE</code> table.</p>
27/// <p>You can optionally define secondary indexes on the new table, as part of the <code>CreateTable</code> operation. If you want to create multiple tables with secondary indexes on them, you must create the tables sequentially. Only one table with secondary indexes can be in the <code>CREATING</code> state at any given time.</p>
28/// <p>You can use the <code>DescribeTable</code> action to check the table status.</p>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct CreateTableFluentBuilder {
31 handle: ::std::sync::Arc<crate::client::Handle>,
32 inner: crate::operation::create_table::builders::CreateTableInputBuilder,
33 config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36 crate::client::customize::internal::CustomizableSend<
37 crate::operation::create_table::CreateTableOutput,
38 crate::operation::create_table::CreateTableError,
39 > for CreateTableFluentBuilder
40{
41 fn send(
42 self,
43 config_override: crate::config::Builder,
44 ) -> crate::client::customize::internal::BoxFuture<
45 crate::client::customize::internal::SendResult<
46 crate::operation::create_table::CreateTableOutput,
47 crate::operation::create_table::CreateTableError,
48 >,
49 > {
50 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51 }
52}
53impl CreateTableFluentBuilder {
54 /// Creates a new `CreateTableFluentBuilder`.
55 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56 Self {
57 handle,
58 inner: ::std::default::Default::default(),
59 config_override: ::std::option::Option::None,
60 }
61 }
62 /// Access the CreateTable as a reference.
63 pub fn as_input(&self) -> &crate::operation::create_table::builders::CreateTableInputBuilder {
64 &self.inner
65 }
66 /// Sends the request and returns the response.
67 ///
68 /// If an error occurs, an `SdkError` will be returned with additional details that
69 /// can be matched against.
70 ///
71 /// By default, any retryable failures will be retried twice. Retry behavior
72 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73 /// set when configuring the client.
74 pub async fn send(
75 self,
76 ) -> ::std::result::Result<
77 crate::operation::create_table::CreateTableOutput,
78 ::aws_smithy_runtime_api::client::result::SdkError<
79 crate::operation::create_table::CreateTableError,
80 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81 >,
82 > {
83 let input = self
84 .inner
85 .build()
86 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87 let runtime_plugins = crate::operation::create_table::CreateTable::operation_runtime_plugins(
88 self.handle.runtime_plugins.clone(),
89 &self.handle.conf,
90 self.config_override,
91 );
92 crate::operation::create_table::CreateTable::orchestrate(&runtime_plugins, input).await
93 }
94
95 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96 pub fn customize(
97 self,
98 ) -> crate::client::customize::CustomizableOperation<
99 crate::operation::create_table::CreateTableOutput,
100 crate::operation::create_table::CreateTableError,
101 Self,
102 > {
103 crate::client::customize::CustomizableOperation::new(self)
104 }
105 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106 self.set_config_override(::std::option::Option::Some(config_override.into()));
107 self
108 }
109
110 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111 self.config_override = config_override;
112 self
113 }
114 ///
115 /// Appends an item to `AttributeDefinitions`.
116 ///
117 /// To override the contents of this collection use [`set_attribute_definitions`](Self::set_attribute_definitions).
118 ///
119 /// <p>An array of attributes that describe the key schema for the table and indexes.</p>
120 pub fn attribute_definitions(mut self, input: crate::types::AttributeDefinition) -> Self {
121 self.inner = self.inner.attribute_definitions(input);
122 self
123 }
124 /// <p>An array of attributes that describe the key schema for the table and indexes.</p>
125 pub fn set_attribute_definitions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AttributeDefinition>>) -> Self {
126 self.inner = self.inner.set_attribute_definitions(input);
127 self
128 }
129 /// <p>An array of attributes that describe the key schema for the table and indexes.</p>
130 pub fn get_attribute_definitions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AttributeDefinition>> {
131 self.inner.get_attribute_definitions()
132 }
133 /// <p>The name of the table to create. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
134 pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135 self.inner = self.inner.table_name(input.into());
136 self
137 }
138 /// <p>The name of the table to create. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
139 pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140 self.inner = self.inner.set_table_name(input);
141 self
142 }
143 /// <p>The name of the table to create. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
144 pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
145 self.inner.get_table_name()
146 }
147 ///
148 /// Appends an item to `KeySchema`.
149 ///
150 /// To override the contents of this collection use [`set_key_schema`](Self::set_key_schema).
151 ///
152 /// <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>
153 /// <p>Each <code>KeySchemaElement</code> in the array is composed of:</p>
154 /// <ul>
155 /// <li>
156 /// <p><code>AttributeName</code> - The name of this key attribute.</p></li>
157 /// <li>
158 /// <p><code>KeyType</code> - The role that the key attribute will assume:</p>
159 /// <ul>
160 /// <li>
161 /// <p><code>HASH</code> - partition key</p></li>
162 /// <li>
163 /// <p><code>RANGE</code> - sort key</p></li>
164 /// </ul></li>
165 /// </ul><note>
166 /// <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>
167 /// <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>
168 /// </note>
169 /// <p>For a simple primary key (partition key), you must provide exactly one element with a <code>KeyType</code> of <code>HASH</code>.</p>
170 /// <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>
171 /// <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>
172 pub fn key_schema(mut self, input: crate::types::KeySchemaElement) -> Self {
173 self.inner = self.inner.key_schema(input);
174 self
175 }
176 /// <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>
177 /// <p>Each <code>KeySchemaElement</code> in the array is composed of:</p>
178 /// <ul>
179 /// <li>
180 /// <p><code>AttributeName</code> - The name of this key attribute.</p></li>
181 /// <li>
182 /// <p><code>KeyType</code> - The role that the key attribute will assume:</p>
183 /// <ul>
184 /// <li>
185 /// <p><code>HASH</code> - partition key</p></li>
186 /// <li>
187 /// <p><code>RANGE</code> - sort key</p></li>
188 /// </ul></li>
189 /// </ul><note>
190 /// <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>
191 /// <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>
192 /// </note>
193 /// <p>For a simple primary key (partition key), you must provide exactly one element with a <code>KeyType</code> of <code>HASH</code>.</p>
194 /// <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>
195 /// <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>
196 pub fn set_key_schema(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::KeySchemaElement>>) -> Self {
197 self.inner = self.inner.set_key_schema(input);
198 self
199 }
200 /// <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>
201 /// <p>Each <code>KeySchemaElement</code> in the array is composed of:</p>
202 /// <ul>
203 /// <li>
204 /// <p><code>AttributeName</code> - The name of this key attribute.</p></li>
205 /// <li>
206 /// <p><code>KeyType</code> - The role that the key attribute will assume:</p>
207 /// <ul>
208 /// <li>
209 /// <p><code>HASH</code> - partition key</p></li>
210 /// <li>
211 /// <p><code>RANGE</code> - sort key</p></li>
212 /// </ul></li>
213 /// </ul><note>
214 /// <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>
215 /// <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>
216 /// </note>
217 /// <p>For a simple primary key (partition key), you must provide exactly one element with a <code>KeyType</code> of <code>HASH</code>.</p>
218 /// <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>
219 /// <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>
220 pub fn get_key_schema(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::KeySchemaElement>> {
221 self.inner.get_key_schema()
222 }
223 ///
224 /// Appends an item to `LocalSecondaryIndexes`.
225 ///
226 /// To override the contents of this collection use [`set_local_secondary_indexes`](Self::set_local_secondary_indexes).
227 ///
228 /// <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>
229 /// <p>Each local secondary index in the array includes the following:</p>
230 /// <ul>
231 /// <li>
232 /// <p><code>IndexName</code> - The name of the local secondary index. Must be unique only for this table.</p>
233 /// <p></p></li>
234 /// <li>
235 /// <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>
236 /// <li>
237 /// <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>
238 /// <ul>
239 /// <li>
240 /// <p><code>ProjectionType</code> - One of the following:</p>
241 /// <ul>
242 /// <li>
243 /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
244 /// <li>
245 /// <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>
246 /// <li>
247 /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
248 /// </ul></li>
249 /// <li>
250 /// <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>
251 /// </ul></li>
252 /// </ul>
253 pub fn local_secondary_indexes(mut self, input: crate::types::LocalSecondaryIndex) -> Self {
254 self.inner = self.inner.local_secondary_indexes(input);
255 self
256 }
257 /// <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>
258 /// <p>Each local secondary index in the array includes the following:</p>
259 /// <ul>
260 /// <li>
261 /// <p><code>IndexName</code> - The name of the local secondary index. Must be unique only for this table.</p>
262 /// <p></p></li>
263 /// <li>
264 /// <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>
265 /// <li>
266 /// <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>
267 /// <ul>
268 /// <li>
269 /// <p><code>ProjectionType</code> - One of the following:</p>
270 /// <ul>
271 /// <li>
272 /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
273 /// <li>
274 /// <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>
275 /// <li>
276 /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
277 /// </ul></li>
278 /// <li>
279 /// <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>
280 /// </ul></li>
281 /// </ul>
282 pub fn set_local_secondary_indexes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LocalSecondaryIndex>>) -> Self {
283 self.inner = self.inner.set_local_secondary_indexes(input);
284 self
285 }
286 /// <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>
287 /// <p>Each local secondary index in the array includes the following:</p>
288 /// <ul>
289 /// <li>
290 /// <p><code>IndexName</code> - The name of the local secondary index. Must be unique only for this table.</p>
291 /// <p></p></li>
292 /// <li>
293 /// <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>
294 /// <li>
295 /// <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>
296 /// <ul>
297 /// <li>
298 /// <p><code>ProjectionType</code> - One of the following:</p>
299 /// <ul>
300 /// <li>
301 /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
302 /// <li>
303 /// <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>
304 /// <li>
305 /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
306 /// </ul></li>
307 /// <li>
308 /// <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>
309 /// </ul></li>
310 /// </ul>
311 pub fn get_local_secondary_indexes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LocalSecondaryIndex>> {
312 self.inner.get_local_secondary_indexes()
313 }
314 ///
315 /// Appends an item to `GlobalSecondaryIndexes`.
316 ///
317 /// To override the contents of this collection use [`set_global_secondary_indexes`](Self::set_global_secondary_indexes).
318 ///
319 /// <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>
320 /// <ul>
321 /// <li>
322 /// <p><code>IndexName</code> - The name of the global secondary index. Must be unique only for this table.</p>
323 /// <p></p></li>
324 /// <li>
325 /// <p><code>KeySchema</code> - Specifies the key schema for the global secondary index.</p></li>
326 /// <li>
327 /// <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>
328 /// <ul>
329 /// <li>
330 /// <p><code>ProjectionType</code> - One of the following:</p>
331 /// <ul>
332 /// <li>
333 /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
334 /// <li>
335 /// <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>
336 /// <li>
337 /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
338 /// </ul></li>
339 /// <li>
340 /// <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>
341 /// </ul></li>
342 /// <li>
343 /// <p><code>ProvisionedThroughput</code> - The provisioned throughput settings for the global secondary index, consisting of read and write capacity units.</p></li>
344 /// </ul>
345 pub fn global_secondary_indexes(mut self, input: crate::types::GlobalSecondaryIndex) -> Self {
346 self.inner = self.inner.global_secondary_indexes(input);
347 self
348 }
349 /// <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>
350 /// <ul>
351 /// <li>
352 /// <p><code>IndexName</code> - The name of the global secondary index. Must be unique only for this table.</p>
353 /// <p></p></li>
354 /// <li>
355 /// <p><code>KeySchema</code> - Specifies the key schema for the global secondary index.</p></li>
356 /// <li>
357 /// <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>
358 /// <ul>
359 /// <li>
360 /// <p><code>ProjectionType</code> - One of the following:</p>
361 /// <ul>
362 /// <li>
363 /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
364 /// <li>
365 /// <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>
366 /// <li>
367 /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
368 /// </ul></li>
369 /// <li>
370 /// <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>
371 /// </ul></li>
372 /// <li>
373 /// <p><code>ProvisionedThroughput</code> - The provisioned throughput settings for the global secondary index, consisting of read and write capacity units.</p></li>
374 /// </ul>
375 pub fn set_global_secondary_indexes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GlobalSecondaryIndex>>) -> Self {
376 self.inner = self.inner.set_global_secondary_indexes(input);
377 self
378 }
379 /// <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>
380 /// <ul>
381 /// <li>
382 /// <p><code>IndexName</code> - The name of the global secondary index. Must be unique only for this table.</p>
383 /// <p></p></li>
384 /// <li>
385 /// <p><code>KeySchema</code> - Specifies the key schema for the global secondary index.</p></li>
386 /// <li>
387 /// <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>
388 /// <ul>
389 /// <li>
390 /// <p><code>ProjectionType</code> - One of the following:</p>
391 /// <ul>
392 /// <li>
393 /// <p><code>KEYS_ONLY</code> - Only the index and primary keys are projected into the index.</p></li>
394 /// <li>
395 /// <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>
396 /// <li>
397 /// <p><code>ALL</code> - All of the table attributes are projected into the index.</p></li>
398 /// </ul></li>
399 /// <li>
400 /// <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>
401 /// </ul></li>
402 /// <li>
403 /// <p><code>ProvisionedThroughput</code> - The provisioned throughput settings for the global secondary index, consisting of read and write capacity units.</p></li>
404 /// </ul>
405 pub fn get_global_secondary_indexes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GlobalSecondaryIndex>> {
406 self.inner.get_global_secondary_indexes()
407 }
408 /// <p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
409 /// <ul>
410 /// <li>
411 /// <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>
412 /// <li>
413 /// <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>
414 /// </ul>
415 pub fn billing_mode(mut self, input: crate::types::BillingMode) -> Self {
416 self.inner = self.inner.billing_mode(input);
417 self
418 }
419 /// <p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
420 /// <ul>
421 /// <li>
422 /// <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>
423 /// <li>
424 /// <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>
425 /// </ul>
426 pub fn set_billing_mode(mut self, input: ::std::option::Option<crate::types::BillingMode>) -> Self {
427 self.inner = self.inner.set_billing_mode(input);
428 self
429 }
430 /// <p>Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.</p>
431 /// <ul>
432 /// <li>
433 /// <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>
434 /// <li>
435 /// <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>
436 /// </ul>
437 pub fn get_billing_mode(&self) -> &::std::option::Option<crate::types::BillingMode> {
438 self.inner.get_billing_mode()
439 }
440 /// <p>Represents the provisioned throughput settings for a specified table or index. The settings can be modified using the <code>UpdateTable</code> operation.</p>
441 /// <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>
442 /// <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>
443 pub fn provisioned_throughput(mut self, input: crate::types::ProvisionedThroughput) -> Self {
444 self.inner = self.inner.provisioned_throughput(input);
445 self
446 }
447 /// <p>Represents the provisioned throughput settings for a specified table or index. The settings can be modified using the <code>UpdateTable</code> operation.</p>
448 /// <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>
449 /// <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>
450 pub fn set_provisioned_throughput(mut self, input: ::std::option::Option<crate::types::ProvisionedThroughput>) -> Self {
451 self.inner = self.inner.set_provisioned_throughput(input);
452 self
453 }
454 /// <p>Represents the provisioned throughput settings for a specified table or index. The settings can be modified using the <code>UpdateTable</code> operation.</p>
455 /// <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>
456 /// <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>
457 pub fn get_provisioned_throughput(&self) -> &::std::option::Option<crate::types::ProvisionedThroughput> {
458 self.inner.get_provisioned_throughput()
459 }
460 /// <p>The settings for DynamoDB Streams on the table. These settings consist of:</p>
461 /// <ul>
462 /// <li>
463 /// <p><code>StreamEnabled</code> - Indicates whether DynamoDB Streams is to be enabled (true) or disabled (false).</p></li>
464 /// <li>
465 /// <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>
466 /// <ul>
467 /// <li>
468 /// <p><code>KEYS_ONLY</code> - Only the key attributes of the modified item are written to the stream.</p></li>
469 /// <li>
470 /// <p><code>NEW_IMAGE</code> - The entire item, as it appears after it was modified, is written to the stream.</p></li>
471 /// <li>
472 /// <p><code>OLD_IMAGE</code> - The entire item, as it appeared before it was modified, is written to the stream.</p></li>
473 /// <li>
474 /// <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>
475 /// </ul></li>
476 /// </ul>
477 pub fn stream_specification(mut self, input: crate::types::StreamSpecification) -> Self {
478 self.inner = self.inner.stream_specification(input);
479 self
480 }
481 /// <p>The settings for DynamoDB Streams on the table. These settings consist of:</p>
482 /// <ul>
483 /// <li>
484 /// <p><code>StreamEnabled</code> - Indicates whether DynamoDB Streams is to be enabled (true) or disabled (false).</p></li>
485 /// <li>
486 /// <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>
487 /// <ul>
488 /// <li>
489 /// <p><code>KEYS_ONLY</code> - Only the key attributes of the modified item are written to the stream.</p></li>
490 /// <li>
491 /// <p><code>NEW_IMAGE</code> - The entire item, as it appears after it was modified, is written to the stream.</p></li>
492 /// <li>
493 /// <p><code>OLD_IMAGE</code> - The entire item, as it appeared before it was modified, is written to the stream.</p></li>
494 /// <li>
495 /// <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>
496 /// </ul></li>
497 /// </ul>
498 pub fn set_stream_specification(mut self, input: ::std::option::Option<crate::types::StreamSpecification>) -> Self {
499 self.inner = self.inner.set_stream_specification(input);
500 self
501 }
502 /// <p>The settings for DynamoDB Streams on the table. These settings consist of:</p>
503 /// <ul>
504 /// <li>
505 /// <p><code>StreamEnabled</code> - Indicates whether DynamoDB Streams is to be enabled (true) or disabled (false).</p></li>
506 /// <li>
507 /// <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>
508 /// <ul>
509 /// <li>
510 /// <p><code>KEYS_ONLY</code> - Only the key attributes of the modified item are written to the stream.</p></li>
511 /// <li>
512 /// <p><code>NEW_IMAGE</code> - The entire item, as it appears after it was modified, is written to the stream.</p></li>
513 /// <li>
514 /// <p><code>OLD_IMAGE</code> - The entire item, as it appeared before it was modified, is written to the stream.</p></li>
515 /// <li>
516 /// <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>
517 /// </ul></li>
518 /// </ul>
519 pub fn get_stream_specification(&self) -> &::std::option::Option<crate::types::StreamSpecification> {
520 self.inner.get_stream_specification()
521 }
522 /// <p>Represents the settings used to enable server-side encryption.</p>
523 pub fn sse_specification(mut self, input: crate::types::SseSpecification) -> Self {
524 self.inner = self.inner.sse_specification(input);
525 self
526 }
527 /// <p>Represents the settings used to enable server-side encryption.</p>
528 pub fn set_sse_specification(mut self, input: ::std::option::Option<crate::types::SseSpecification>) -> Self {
529 self.inner = self.inner.set_sse_specification(input);
530 self
531 }
532 /// <p>Represents the settings used to enable server-side encryption.</p>
533 pub fn get_sse_specification(&self) -> &::std::option::Option<crate::types::SseSpecification> {
534 self.inner.get_sse_specification()
535 }
536 ///
537 /// Appends an item to `Tags`.
538 ///
539 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
540 ///
541 /// <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>
542 pub fn tags(mut self, input: crate::types::Tag) -> Self {
543 self.inner = self.inner.tags(input);
544 self
545 }
546 /// <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>
547 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
548 self.inner = self.inner.set_tags(input);
549 self
550 }
551 /// <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>
552 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
553 self.inner.get_tags()
554 }
555 /// <p>The table class of the new table. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
556 pub fn table_class(mut self, input: crate::types::TableClass) -> Self {
557 self.inner = self.inner.table_class(input);
558 self
559 }
560 /// <p>The table class of the new table. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
561 pub fn set_table_class(mut self, input: ::std::option::Option<crate::types::TableClass>) -> Self {
562 self.inner = self.inner.set_table_class(input);
563 self
564 }
565 /// <p>The table class of the new table. Valid values are <code>STANDARD</code> and <code>STANDARD_INFREQUENT_ACCESS</code>.</p>
566 pub fn get_table_class(&self) -> &::std::option::Option<crate::types::TableClass> {
567 self.inner.get_table_class()
568 }
569 /// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
570 pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
571 self.inner = self.inner.deletion_protection_enabled(input);
572 self
573 }
574 /// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
575 pub fn set_deletion_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
576 self.inner = self.inner.set_deletion_protection_enabled(input);
577 self
578 }
579 /// <p>Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.</p>
580 pub fn get_deletion_protection_enabled(&self) -> &::std::option::Option<bool> {
581 self.inner.get_deletion_protection_enabled()
582 }
583 /// <p>Represents the warm throughput (in read units per second and write units per second) for creating a table.</p>
584 pub fn warm_throughput(mut self, input: crate::types::WarmThroughput) -> Self {
585 self.inner = self.inner.warm_throughput(input);
586 self
587 }
588 /// <p>Represents the warm throughput (in read units per second and write units per second) for creating a table.</p>
589 pub fn set_warm_throughput(mut self, input: ::std::option::Option<crate::types::WarmThroughput>) -> Self {
590 self.inner = self.inner.set_warm_throughput(input);
591 self
592 }
593 /// <p>Represents the warm throughput (in read units per second and write units per second) for creating a table.</p>
594 pub fn get_warm_throughput(&self) -> &::std::option::Option<crate::types::WarmThroughput> {
595 self.inner.get_warm_throughput()
596 }
597 /// <p>An Amazon Web Services resource-based policy document in JSON format that will be attached to the table.</p>
598 /// <p>When you attach a resource-based policy while creating a table, the policy application is <i>strongly consistent</i>.</p>
599 /// <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>
600 /// <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>
601 /// </note>
602 pub fn resource_policy(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
603 self.inner = self.inner.resource_policy(input.into());
604 self
605 }
606 /// <p>An Amazon Web Services resource-based policy document in JSON format that will be attached to the table.</p>
607 /// <p>When you attach a resource-based policy while creating a table, the policy application is <i>strongly consistent</i>.</p>
608 /// <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>
609 /// <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>
610 /// </note>
611 pub fn set_resource_policy(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
612 self.inner = self.inner.set_resource_policy(input);
613 self
614 }
615 /// <p>An Amazon Web Services resource-based policy document in JSON format that will be attached to the table.</p>
616 /// <p>When you attach a resource-based policy while creating a table, the policy application is <i>strongly consistent</i>.</p>
617 /// <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>
618 /// <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>
619 /// </note>
620 pub fn get_resource_policy(&self) -> &::std::option::Option<::std::string::String> {
621 self.inner.get_resource_policy()
622 }
623 /// <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>
624 pub fn on_demand_throughput(mut self, input: crate::types::OnDemandThroughput) -> Self {
625 self.inner = self.inner.on_demand_throughput(input);
626 self
627 }
628 /// <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>
629 pub fn set_on_demand_throughput(mut self, input: ::std::option::Option<crate::types::OnDemandThroughput>) -> Self {
630 self.inner = self.inner.set_on_demand_throughput(input);
631 self
632 }
633 /// <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>
634 pub fn get_on_demand_throughput(&self) -> &::std::option::Option<crate::types::OnDemandThroughput> {
635 self.inner.get_on_demand_throughput()
636 }
637}