aws_lite_rs/types/dynamodb.rs
1//! Types for the Amazon DynamoDB API (v1).
2//!
3//! Auto-generated from the AWS Botocore Model.
4//! **Do not edit manually** — modify the manifest and re-run codegen.
5
6use serde::{Deserialize, Serialize};
7
8/// Represents the input of a ListTables operation.
9///
10/// **AWS API**: `dynamodb.v1.ListTablesInput`
11/// **Reference**: <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference//ListTablesInput>
12#[derive(Debug, Clone, Default, Serialize, Deserialize)]
13#[serde(rename_all = "PascalCase")]
14pub struct ListTablesInput {
15 /// The first table name that this operation will evaluate. Use the value that was returned
16 /// for LastEvaluatedTableName in a previous operation, so that you can obtain the next page
17 /// of results.
18 #[serde(skip_serializing_if = "Option::is_none")]
19 pub exclusive_start_table_name: Option<String>,
20
21 /// A maximum number of table names to return. If this parameter is not specified, the limit
22 /// is 100.
23 #[serde(skip_serializing_if = "Option::is_none")]
24 pub limit: Option<i32>,
25}
26
27impl ListTablesInput {
28 #[cfg(any(test, feature = "test-support"))]
29 /// Create a fixture instance for testing.
30 pub fn fixture() -> Self {
31 Self {
32 exclusive_start_table_name: Some("test-exclusive_start_table_name".into()),
33 limit: Some(100),
34 }
35 }
36}
37
38/// Represents the output of a ListTables operation.
39///
40/// **AWS API**: `dynamodb.v1.ListTablesOutput`
41/// **Reference**: <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference//ListTablesOutput>
42#[derive(Debug, Clone, Default, Serialize, Deserialize)]
43#[serde(rename_all = "PascalCase")]
44pub struct ListTablesOutput {
45 /// The names of the tables associated with the current account at the current endpoint. The
46 /// maximum size of this array is 100. If LastEvaluatedTableName also appears in the output,
47 /// you can use this value as the ExclusiveStartTableName parameter in a subsequent
48 /// ListTables request and obtain the next page of results.
49 #[serde(default)]
50 #[serde(skip_serializing_if = "Vec::is_empty")]
51 pub table_names: Vec<String>,
52
53 /// The name of the last table in the current page of results. Use this value as the
54 /// ExclusiveStartTableName in a new request to obtain the next page of results, until all
55 /// the table names are returned. If you do not receive a LastEvaluatedTableName value in
56 /// the response, this means that there are no more table names to be retrieved.
57 #[serde(skip_serializing_if = "Option::is_none")]
58 pub last_evaluated_table_name: Option<String>,
59}
60
61impl ListTablesOutput {
62 #[cfg(any(test, feature = "test-support"))]
63 /// Create a fixture instance for testing.
64 pub fn fixture() -> Self {
65 Self {
66 table_names: vec![],
67 last_evaluated_table_name: Some("test-last_evaluated_table_name".into()),
68 }
69 }
70}
71
72/// Represents the input of a DescribeTable operation.
73///
74/// **AWS API**: `dynamodb.v1.DescribeTableInput`
75/// **Reference**: <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference//DescribeTableInput>
76#[derive(Debug, Clone, Default, Serialize, Deserialize)]
77#[serde(rename_all = "PascalCase")]
78pub struct DescribeTableInput {
79 /// The name of the table to describe. You can also provide the Amazon Resource Name (ARN)
80 /// of the table in this parameter.
81 pub table_name: String,
82}
83
84impl DescribeTableInput {
85 #[cfg(any(test, feature = "test-support"))]
86 /// Create a fixture instance for testing.
87 pub fn fixture() -> Self {
88 Self {
89 table_name: "test-table_name".into(),
90 }
91 }
92}
93
94/// Represents the output of a DescribeTable operation.
95///
96/// **AWS API**: `dynamodb.v1.DescribeTableOutput`
97/// **Reference**: <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference//DescribeTableOutput>
98#[derive(Debug, Clone, Default, Serialize, Deserialize)]
99#[serde(rename_all = "PascalCase")]
100pub struct DescribeTableOutput {
101 /// The properties of the table.
102 #[serde(skip_serializing_if = "Option::is_none")]
103 pub table: Option<TableDescription>,
104}
105
106impl DescribeTableOutput {
107 #[cfg(any(test, feature = "test-support"))]
108 /// Create a fixture instance for testing.
109 pub fn fixture() -> Self {
110 Self {
111 table: Some(TableDescription::fixture()),
112 }
113 }
114}
115
116/// Represents the input of an UpdateTable operation.
117///
118/// **AWS API**: `dynamodb.v1.UpdateTableInput`
119/// **Reference**: <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference//UpdateTableInput>
120///
121/// ## Coverage
122/// 6 of 14 fields included.
123/// Omitted fields:
124/// - `AttributeDefinitions` — not selected in manifest
125/// - `GlobalSecondaryIndexUpdates` — not selected in manifest
126/// - `SSESpecification` — not selected in manifest
127/// - `ReplicaUpdates` — not selected in manifest
128/// - `MultiRegionConsistency` — not selected in manifest
129/// - `GlobalTableWitnessUpdates` — not selected in manifest
130/// - `OnDemandThroughput` — not selected in manifest
131/// - `WarmThroughput` — not selected in manifest
132#[derive(Debug, Clone, Default, Serialize, Deserialize)]
133#[serde(rename_all = "PascalCase")]
134pub struct UpdateTableInput {
135 /// The name of the table to be updated. You can also provide the Amazon Resource Name (ARN)
136 /// of the table in this parameter.
137 pub table_name: String,
138
139 /// Controls how you are charged for read and write throughput and how you manage capacity.
140 /// When switching from pay-per-request to provisioned capacity, initial provisioned
141 /// capacity values must be set. The initial provisioned capacity values are estimated based
142 /// on the consumed read and write capacity of your table and global secondary indexes over
143 /// the past 30 minutes. PAY_PER_REQUEST
144 /// - We recommend using PAY_PER_REQUEST for most DynamoDB workloads. PAY_PER_REQUEST sets
145 /// the billing mode to On-demand capacity mode. PROVISIONED
146 /// - We recommend using PROVISIONED for steady workloads with predictable growth where
147 /// capacity requirements can be reliably forecasted. PROVISIONED sets the billing mode to
148 /// Provisioned capacity mode.
149 #[serde(skip_serializing_if = "Option::is_none")]
150 pub billing_mode: Option<String>,
151
152 /// The new provisioned throughput settings for the specified table or index.
153 #[serde(skip_serializing_if = "Option::is_none")]
154 pub provisioned_throughput: Option<ProvisionedThroughput>,
155
156 /// Indicates whether deletion protection is to be enabled (true) or disabled (false) on the
157 /// table.
158 #[serde(skip_serializing_if = "Option::is_none")]
159 pub deletion_protection_enabled: Option<bool>,
160
161 /// The table class of the table to be updated. Valid values are STANDARD and
162 /// STANDARD_INFREQUENT_ACCESS.
163 #[serde(skip_serializing_if = "Option::is_none")]
164 pub table_class: Option<String>,
165
166 /// Represents the DynamoDB Streams configuration for the table. You receive a
167 /// ValidationException if you try to enable a stream on a table that already has a stream,
168 /// or if you try to disable a stream on a table that doesn't have a stream.
169 #[serde(skip_serializing_if = "Option::is_none")]
170 pub stream_specification: Option<StreamSpecification>,
171}
172
173impl UpdateTableInput {
174 #[cfg(any(test, feature = "test-support"))]
175 /// Create a fixture instance for testing.
176 pub fn fixture() -> Self {
177 Self {
178 table_name: "test-table_name".into(),
179 billing_mode: Some("test-billing_mode".into()),
180 provisioned_throughput: Some(ProvisionedThroughput::fixture()),
181 deletion_protection_enabled: Some(false),
182 table_class: Some("test-table_class".into()),
183 stream_specification: Some(StreamSpecification::fixture()),
184 }
185 }
186}
187
188/// Represents the output of an UpdateTable operation.
189///
190/// **AWS API**: `dynamodb.v1.UpdateTableOutput`
191/// **Reference**: <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference//UpdateTableOutput>
192#[derive(Debug, Clone, Default, Serialize, Deserialize)]
193#[serde(rename_all = "PascalCase")]
194pub struct UpdateTableOutput {
195 /// Represents the properties of the table.
196 #[serde(skip_serializing_if = "Option::is_none")]
197 pub table_description: Option<TableDescription>,
198}
199
200impl UpdateTableOutput {
201 #[cfg(any(test, feature = "test-support"))]
202 /// Create a fixture instance for testing.
203 pub fn fixture() -> Self {
204 Self {
205 table_description: Some(TableDescription::fixture()),
206 }
207 }
208}
209
210/// Represents the input of a DeleteTable operation.
211///
212/// **AWS API**: `dynamodb.v1.DeleteTableInput`
213/// **Reference**: <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference//DeleteTableInput>
214#[derive(Debug, Clone, Default, Serialize, Deserialize)]
215#[serde(rename_all = "PascalCase")]
216pub struct DeleteTableInput {
217 /// The name of the table to delete. You can also provide the Amazon Resource Name (ARN) of
218 /// the table in this parameter.
219 pub table_name: String,
220}
221
222impl DeleteTableInput {
223 #[cfg(any(test, feature = "test-support"))]
224 /// Create a fixture instance for testing.
225 pub fn fixture() -> Self {
226 Self {
227 table_name: "test-table_name".into(),
228 }
229 }
230}
231
232/// Represents the output of a DeleteTable operation.
233///
234/// **AWS API**: `dynamodb.v1.DeleteTableOutput`
235/// **Reference**: <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference//DeleteTableOutput>
236#[derive(Debug, Clone, Default, Serialize, Deserialize)]
237#[serde(rename_all = "PascalCase")]
238pub struct DeleteTableOutput {
239 /// Represents the properties of a table.
240 #[serde(skip_serializing_if = "Option::is_none")]
241 pub table_description: Option<TableDescription>,
242}
243
244impl DeleteTableOutput {
245 #[cfg(any(test, feature = "test-support"))]
246 /// Create a fixture instance for testing.
247 pub fn fixture() -> Self {
248 Self {
249 table_description: Some(TableDescription::fixture()),
250 }
251 }
252}
253
254/// Represents the properties of a table.
255///
256/// **AWS API**: `dynamodb.v1.TableDescription`
257/// **Reference**: <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference//TableDescription>
258///
259/// ## Coverage
260/// 16 of 28 fields included.
261/// Omitted fields:
262/// - `LocalSecondaryIndexes` — not selected in manifest
263/// - `GlobalSecondaryIndexes` — not selected in manifest
264/// - `LatestStreamLabel` — not selected in manifest
265/// - `LatestStreamArn` — not selected in manifest
266/// - `GlobalTableVersion` — not selected in manifest
267/// - `Replicas` — not selected in manifest
268/// - `GlobalTableWitnesses` — not selected in manifest
269/// - `GlobalTableSettingsReplicationMode` — not selected in manifest
270/// - `RestoreSummary` — not selected in manifest
271/// - `OnDemandThroughput` — not selected in manifest
272/// - `WarmThroughput` — not selected in manifest
273/// - `MultiRegionConsistency` — not selected in manifest
274#[derive(Debug, Clone, Default, Serialize, Deserialize)]
275#[serde(rename_all = "PascalCase")]
276pub struct TableDescription {
277 /// The name of the table.
278 #[serde(skip_serializing_if = "Option::is_none")]
279 pub table_name: Option<String>,
280
281 /// The Amazon Resource Name (ARN) that uniquely identifies the table.
282 #[serde(skip_serializing_if = "Option::is_none")]
283 pub table_arn: Option<String>,
284
285 /// Unique identifier for the table for which the backup was created.
286 #[serde(skip_serializing_if = "Option::is_none")]
287 pub table_id: Option<String>,
288
289 /// The current state of the table: CREATING
290 /// - The table is being created. UPDATING
291 /// - The table/index configuration is being updated. The table/index remains available for
292 /// data operations when UPDATING. DELETING
293 /// - The table is being deleted. ACTIVE
294 /// - The table is ready for use. INACCESSIBLE_ENCRYPTION_CREDENTIALS
295 /// - The KMS key used to encrypt the table in inaccessible. Table operations may fail due
296 /// to failure to use the KMS key. DynamoDB will initiate the table archival process when
297 /// a table's KMS key remains inaccessible for more than seven days. ARCHIVING
298 /// - The table is being archived. Operations are not allowed until archival is complete.
299 /// ARCHIVED
300 /// - The table has been archived. See the ArchivalReason for more information.
301 #[serde(skip_serializing_if = "Option::is_none")]
302 pub table_status: Option<String>,
303
304 /// The date and time when the table was created, in UNIX epoch time format.
305 #[serde(skip_serializing_if = "Option::is_none")]
306 pub creation_date_time: Option<f64>,
307
308 /// The number of items in the specified table. DynamoDB updates this value approximately
309 /// every six hours. Recent changes might not be reflected in this value.
310 #[serde(skip_serializing_if = "Option::is_none")]
311 pub item_count: Option<i64>,
312
313 /// The total size of the specified table, in bytes. DynamoDB updates this value
314 /// approximately every six hours. Recent changes might not be reflected in this value.
315 #[serde(skip_serializing_if = "Option::is_none")]
316 pub table_size_bytes: Option<i64>,
317
318 /// Contains the details for the read/write capacity mode.
319 #[serde(skip_serializing_if = "Option::is_none")]
320 pub billing_mode_summary: Option<BillingModeSummary>,
321
322 /// The provisioned throughput settings for the table, consisting of read and write capacity
323 /// units, along with data about increases and decreases.
324 #[serde(skip_serializing_if = "Option::is_none")]
325 pub provisioned_throughput: Option<ProvisionedThroughputDescription>,
326
327 /// The primary key structure for the table. Each KeySchemaElement consists of:
328 /// AttributeName
329 /// - The name of the attribute. KeyType
330 /// - The role of the attribute: HASH
331 /// - partition key RANGE
332 /// - sort key The partition key of an item is also known as its hash attribute. The term
333 /// "hash attribute" derives from DynamoDB's usage of an internal hash function to evenly
334 /// distribute data items across partitions, based on their partition key values. The sort
335 /// key of an item is also known as its range attribute. The term "range attribute"
336 /// derives from the way DynamoDB stores items with the same partition key physically
337 /// close together, in sorted order by the sort key value. For more information about
338 /// primary keys, see Primary Key in the Amazon DynamoDB Developer Guide.
339 #[serde(default)]
340 #[serde(skip_serializing_if = "Vec::is_empty")]
341 pub key_schema: Vec<KeySchemaElement>,
342
343 /// An array of AttributeDefinition objects. Each of these objects describes one attribute
344 /// in the table and index key schema. Each AttributeDefinition object in this array is
345 /// composed of: AttributeName
346 /// - The name of the attribute. AttributeType
347 /// - The data type for the attribute.
348 #[serde(default)]
349 #[serde(skip_serializing_if = "Vec::is_empty")]
350 pub attribute_definitions: Vec<AttributeDefinition>,
351
352 /// The current DynamoDB Streams configuration for the table.
353 #[serde(skip_serializing_if = "Option::is_none")]
354 pub stream_specification: Option<StreamSpecification>,
355
356 /// The description of the server-side encryption status on the specified table.
357 #[serde(skip_serializing_if = "Option::is_none")]
358 pub sse_description: Option<SSEDescription>,
359
360 /// Contains details of the table class.
361 #[serde(skip_serializing_if = "Option::is_none")]
362 pub table_class_summary: Option<TableClassSummary>,
363
364 /// Indicates whether deletion protection is enabled (true) or disabled (false) on the
365 /// table.
366 #[serde(skip_serializing_if = "Option::is_none")]
367 pub deletion_protection_enabled: Option<bool>,
368
369 /// Contains information about the table archive.
370 #[serde(skip_serializing_if = "Option::is_none")]
371 pub archival_summary: Option<ArchivalSummary>,
372}
373
374impl TableDescription {
375 #[cfg(any(test, feature = "test-support"))]
376 /// Create a fixture instance for testing.
377 pub fn fixture() -> Self {
378 Self {
379 table_name: Some("test-table_name".into()),
380 table_arn: Some("test-table_arn".into()),
381 table_id: Some("test-table_id".into()),
382 table_status: Some("test-table_status".into()),
383 item_count: Some(100),
384 table_size_bytes: Some(100),
385 billing_mode_summary: Some(BillingModeSummary::fixture()),
386 provisioned_throughput: Some(ProvisionedThroughputDescription::fixture()),
387 key_schema: vec![],
388 attribute_definitions: vec![],
389 stream_specification: Some(StreamSpecification::fixture()),
390 sse_description: Some(SSEDescription::fixture()),
391 table_class_summary: Some(TableClassSummary::fixture()),
392 deletion_protection_enabled: Some(false),
393 archival_summary: Some(ArchivalSummary::fixture()),
394 ..Default::default()
395 }
396 }
397}
398
399/// Contains the details for the read/write capacity mode. This page talks about PROVISIONED and
400/// PAY_PER_REQUEST billing modes. For more information about these modes, see Read/write
401/// capacity mode. You may need to switch to on-demand mode at least once in order to return a
402/// BillingModeSummary response.
403///
404/// **AWS API**: `dynamodb.v1.BillingModeSummary`
405/// **Reference**: <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference//BillingModeSummary>
406#[derive(Debug, Clone, Default, Serialize, Deserialize)]
407#[serde(rename_all = "PascalCase")]
408pub struct BillingModeSummary {
409 /// Controls how you are charged for read and write throughput and how you manage capacity.
410 /// This setting can be changed later. PROVISIONED
411 /// - Sets the read/write capacity mode to PROVISIONED. We recommend using PROVISIONED for
412 /// predictable workloads. PAY_PER_REQUEST
413 /// - Sets the read/write capacity mode to PAY_PER_REQUEST. We recommend using
414 /// PAY_PER_REQUEST for unpredictable workloads.
415 #[serde(skip_serializing_if = "Option::is_none")]
416 pub billing_mode: Option<String>,
417
418 /// Represents the time when PAY_PER_REQUEST was last set as the read/write capacity mode.
419 #[serde(skip_serializing_if = "Option::is_none")]
420 pub last_update_to_pay_per_request_date_time: Option<f64>,
421}
422
423impl BillingModeSummary {
424 #[cfg(any(test, feature = "test-support"))]
425 /// Create a fixture instance for testing.
426 pub fn fixture() -> Self {
427 Self {
428 billing_mode: Some("test-billing_mode".into()),
429 ..Default::default()
430 }
431 }
432}
433
434/// Represents the provisioned throughput settings for the table, consisting of read and write
435/// capacity units, along with data about increases and decreases.
436///
437/// **AWS API**: `dynamodb.v1.ProvisionedThroughputDescription`
438/// **Reference**: <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference//ProvisionedThroughputDescription>
439#[derive(Debug, Clone, Default, Serialize, Deserialize)]
440#[serde(rename_all = "PascalCase")]
441pub struct ProvisionedThroughputDescription {
442 /// The maximum number of strongly consistent reads consumed per second before DynamoDB
443 /// returns a ThrottlingException. Eventually consistent reads require less effort than
444 /// strongly consistent reads, so a setting of 50 ReadCapacityUnits per second provides 100
445 /// eventually consistent ReadCapacityUnits per second.
446 #[serde(skip_serializing_if = "Option::is_none")]
447 pub read_capacity_units: Option<i64>,
448
449 /// The maximum number of writes consumed per second before DynamoDB returns a
450 /// ThrottlingException.
451 #[serde(skip_serializing_if = "Option::is_none")]
452 pub write_capacity_units: Option<i64>,
453
454 /// The number of provisioned throughput decreases for this table during this UTC calendar
455 /// day. For current maximums on provisioned throughput decreases, see Service, Account, and
456 /// Table Quotas in the Amazon DynamoDB Developer Guide.
457 #[serde(skip_serializing_if = "Option::is_none")]
458 pub number_of_decreases_today: Option<i64>,
459
460 /// The date and time of the last provisioned throughput increase for this table.
461 #[serde(skip_serializing_if = "Option::is_none")]
462 pub last_increase_date_time: Option<f64>,
463
464 /// The date and time of the last provisioned throughput decrease for this table.
465 #[serde(skip_serializing_if = "Option::is_none")]
466 pub last_decrease_date_time: Option<f64>,
467}
468
469impl ProvisionedThroughputDescription {
470 #[cfg(any(test, feature = "test-support"))]
471 /// Create a fixture instance for testing.
472 pub fn fixture() -> Self {
473 Self {
474 read_capacity_units: Some(100),
475 write_capacity_units: Some(100),
476 number_of_decreases_today: Some(100),
477 ..Default::default()
478 }
479 }
480}
481
482/// Represents the provisioned throughput settings for the specified global secondary index. You
483/// must use ProvisionedThroughput or OnDemandThroughput based on your table’s capacity mode.
484/// For current minimum and maximum provisioned throughput values, see Service, Account, and
485/// Table Quotas in the Amazon DynamoDB Developer Guide.
486///
487/// **AWS API**: `dynamodb.v1.ProvisionedThroughput`
488/// **Reference**: <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference//ProvisionedThroughput>
489#[derive(Debug, Clone, Default, Serialize, Deserialize)]
490#[serde(rename_all = "PascalCase")]
491pub struct ProvisionedThroughput {
492 /// The maximum number of strongly consistent reads consumed per second before DynamoDB
493 /// returns a ThrottlingException. For more information, see Specifying Read and Write
494 /// Requirements in the Amazon DynamoDB Developer Guide. If read/write capacity mode is
495 /// PAY_PER_REQUEST the value is set to 0.
496 pub read_capacity_units: i64,
497
498 /// The maximum number of writes consumed per second before DynamoDB returns a
499 /// ThrottlingException. For more information, see Specifying Read and Write Requirements in
500 /// the Amazon DynamoDB Developer Guide. If read/write capacity mode is PAY_PER_REQUEST the
501 /// value is set to 0.
502 pub write_capacity_units: i64,
503}
504
505impl ProvisionedThroughput {
506 #[cfg(any(test, feature = "test-support"))]
507 /// Create a fixture instance for testing.
508 pub fn fixture() -> Self {
509 Self {
510 read_capacity_units: 100,
511 write_capacity_units: 100,
512 }
513 }
514}
515
516/// Represents a single element of a key schema. A key schema specifies the attributes that make
517/// up the primary key of a table, or the key attributes of an index. A KeySchemaElement
518/// represents exactly one attribute of the primary key. For example, a simple primary key would
519/// be represented by one KeySchemaElement (for the partition key). A composite primary key
520/// would require one KeySchemaElement for the partition key, and another KeySchemaElement for
521/// the sort key. A KeySchemaElement must be a scalar, top-level attribute (not a nested
522/// attribute). The data type must be one of String, Number, or Binary. The attribute cannot be
523/// nested within a List or a Map.
524///
525/// **AWS API**: `dynamodb.v1.KeySchemaElement`
526/// **Reference**: <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference//KeySchemaElement>
527#[derive(Debug, Clone, Default, Serialize, Deserialize)]
528#[serde(rename_all = "PascalCase")]
529pub struct KeySchemaElement {
530 /// The name of a key attribute.
531 pub attribute_name: String,
532
533 /// The role that this key attribute will assume: HASH
534 /// - partition key RANGE
535 /// - sort key The partition key of an item is also known as its hash attribute. The term
536 /// "hash attribute" derives from DynamoDB's usage of an internal hash function to evenly
537 /// distribute data items across partitions, based on their partition key values. The sort
538 /// key of an item is also known as its range attribute. The term "range attribute"
539 /// derives from the way DynamoDB stores items with the same partition key physically
540 /// close together, in sorted order by the sort key value.
541 pub key_type: String,
542}
543
544impl KeySchemaElement {
545 #[cfg(any(test, feature = "test-support"))]
546 /// Create a fixture instance for testing.
547 pub fn fixture() -> Self {
548 Self {
549 attribute_name: "test-attribute_name".into(),
550 key_type: "test-key_type".into(),
551 }
552 }
553}
554
555/// Represents an attribute for describing the schema for the table and indexes.
556///
557/// **AWS API**: `dynamodb.v1.AttributeDefinition`
558/// **Reference**: <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference//AttributeDefinition>
559#[derive(Debug, Clone, Default, Serialize, Deserialize)]
560#[serde(rename_all = "PascalCase")]
561pub struct AttributeDefinition {
562 /// A name for the attribute.
563 pub attribute_name: String,
564
565 /// The data type for the attribute, where: S
566 /// - the attribute is of type String N
567 /// - the attribute is of type Number B
568 /// - the attribute is of type Binary
569 pub attribute_type: String,
570}
571
572impl AttributeDefinition {
573 #[cfg(any(test, feature = "test-support"))]
574 /// Create a fixture instance for testing.
575 pub fn fixture() -> Self {
576 Self {
577 attribute_name: "test-attribute_name".into(),
578 attribute_type: "test-attribute_type".into(),
579 }
580 }
581}
582
583/// Represents the DynamoDB Streams configuration for a table in DynamoDB.
584///
585/// **AWS API**: `dynamodb.v1.StreamSpecification`
586/// **Reference**: <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference//StreamSpecification>
587#[derive(Debug, Clone, Default, Serialize, Deserialize)]
588#[serde(rename_all = "PascalCase")]
589pub struct StreamSpecification {
590 /// Indicates whether DynamoDB Streams is enabled (true) or disabled (false) on the table.
591 #[serde(default)]
592 pub stream_enabled: bool,
593
594 /// When an item in the table is modified, StreamViewType determines what information is
595 /// written to the stream for this table. Valid values for StreamViewType are: KEYS_ONLY
596 /// - Only the key attributes of the modified item are written to the stream. NEW_IMAGE
597 /// - The entire item, as it appears after it was modified, is written to the stream.
598 /// OLD_IMAGE
599 /// - The entire item, as it appeared before it was modified, is written to the stream.
600 /// NEW_AND_OLD_IMAGES
601 /// - Both the new and the old item images of the item are written to the stream.
602 #[serde(skip_serializing_if = "Option::is_none")]
603 pub stream_view_type: Option<String>,
604}
605
606impl StreamSpecification {
607 #[cfg(any(test, feature = "test-support"))]
608 /// Create a fixture instance for testing.
609 pub fn fixture() -> Self {
610 Self {
611 stream_enabled: false,
612 stream_view_type: Some("test-stream_view_type".into()),
613 }
614 }
615}
616
617/// The description of the server-side encryption status on the specified table.
618///
619/// **AWS API**: `dynamodb.v1.SSEDescription`
620/// **Reference**: <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference//SSEDescription>
621#[derive(Debug, Clone, Default, Serialize, Deserialize)]
622#[serde(rename_all = "PascalCase")]
623pub struct SSEDescription {
624 /// Represents the current state of server-side encryption. The only supported values are:
625 /// ENABLED
626 /// - Server-side encryption is enabled. UPDATING
627 /// - Server-side encryption is being updated.
628 #[serde(skip_serializing_if = "Option::is_none")]
629 pub status: Option<String>,
630
631 /// Server-side encryption type. The only supported value is: KMS
632 /// - Server-side encryption that uses Key Management Service. The key is stored in your
633 /// account and is managed by KMS (KMS charges apply).
634 #[serde(skip_serializing_if = "Option::is_none")]
635 pub sse_type: Option<String>,
636
637 /// The KMS key ARN used for the KMS encryption.
638 #[serde(skip_serializing_if = "Option::is_none")]
639 pub kms_master_key_arn: Option<String>,
640
641 /// Indicates the time, in UNIX epoch date format, when DynamoDB detected that the table's
642 /// KMS key was inaccessible. This attribute will automatically be cleared when DynamoDB
643 /// detects that the table's KMS key is accessible again. DynamoDB will initiate the table
644 /// archival process when table's KMS key remains inaccessible for more than seven days from
645 /// this date.
646 #[serde(skip_serializing_if = "Option::is_none")]
647 pub inaccessible_encryption_date_time: Option<f64>,
648}
649
650impl SSEDescription {
651 #[cfg(any(test, feature = "test-support"))]
652 /// Create a fixture instance for testing.
653 pub fn fixture() -> Self {
654 Self {
655 status: Some("test-status".into()),
656 sse_type: Some("test-sse_type".into()),
657 kms_master_key_arn: Some("test-kms_master_key_arn".into()),
658 ..Default::default()
659 }
660 }
661}
662
663/// Contains details of the table class.
664///
665/// **AWS API**: `dynamodb.v1.TableClassSummary`
666/// **Reference**: <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference//TableClassSummary>
667#[derive(Debug, Clone, Default, Serialize, Deserialize)]
668#[serde(rename_all = "PascalCase")]
669pub struct TableClassSummary {
670 /// The table class of the specified table. Valid values are STANDARD and
671 /// STANDARD_INFREQUENT_ACCESS.
672 #[serde(skip_serializing_if = "Option::is_none")]
673 pub table_class: Option<String>,
674
675 /// The date and time at which the table class was last updated.
676 #[serde(skip_serializing_if = "Option::is_none")]
677 pub last_update_date_time: Option<f64>,
678}
679
680impl TableClassSummary {
681 #[cfg(any(test, feature = "test-support"))]
682 /// Create a fixture instance for testing.
683 pub fn fixture() -> Self {
684 Self {
685 table_class: Some("test-table_class".into()),
686 ..Default::default()
687 }
688 }
689}
690
691/// Contains details of a table archival operation.
692///
693/// **AWS API**: `dynamodb.v1.ArchivalSummary`
694/// **Reference**: <https://docs.aws.amazon.com/amazondynamodb/latest/APIReference//ArchivalSummary>
695#[derive(Debug, Clone, Default, Serialize, Deserialize)]
696#[serde(rename_all = "PascalCase")]
697pub struct ArchivalSummary {
698 /// The date and time when table archival was initiated by DynamoDB, in UNIX epoch time
699 /// format.
700 #[serde(skip_serializing_if = "Option::is_none")]
701 pub archival_date_time: Option<f64>,
702
703 /// The reason DynamoDB archived the table. Currently, the only possible value is:
704 /// INACCESSIBLE_ENCRYPTION_CREDENTIALS
705 /// - The table was archived due to the table's KMS key being inaccessible for more than
706 /// seven days. An On-Demand backup was created at the archival time.
707 #[serde(skip_serializing_if = "Option::is_none")]
708 pub archival_reason: Option<String>,
709
710 /// The Amazon Resource Name (ARN) of the backup the table was archived to, when applicable
711 /// in the archival reason. If you wish to restore this backup to the same table name, you
712 /// will need to delete the original table.
713 #[serde(skip_serializing_if = "Option::is_none")]
714 pub archival_backup_arn: Option<String>,
715}
716
717impl ArchivalSummary {
718 #[cfg(any(test, feature = "test-support"))]
719 /// Create a fixture instance for testing.
720 pub fn fixture() -> Self {
721 Self {
722 archival_reason: Some("test-archival_reason".into()),
723 archival_backup_arn: Some("test-archival_backup_arn".into()),
724 ..Default::default()
725 }
726 }
727}