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