
software.amazon.awssdk.services.dynamodb.model.TableDescription Maven / Gradle / Ivy
/*
* Copyright 2013-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.dynamodb.model;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.core.protocol.ProtocolMarshaller;
import software.amazon.awssdk.core.protocol.StructuredPojo;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.services.dynamodb.transform.TableDescriptionMarshaller;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Represents the properties of a table.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class TableDescription implements StructuredPojo, ToCopyableBuilder {
private final List attributeDefinitions;
private final String tableName;
private final List keySchema;
private final String tableStatus;
private final Instant creationDateTime;
private final ProvisionedThroughputDescription provisionedThroughput;
private final Long tableSizeBytes;
private final Long itemCount;
private final String tableArn;
private final String tableId;
private final List localSecondaryIndexes;
private final List globalSecondaryIndexes;
private final StreamSpecification streamSpecification;
private final String latestStreamLabel;
private final String latestStreamArn;
private final RestoreSummary restoreSummary;
private final SSEDescription sseDescription;
private TableDescription(BuilderImpl builder) {
this.attributeDefinitions = builder.attributeDefinitions;
this.tableName = builder.tableName;
this.keySchema = builder.keySchema;
this.tableStatus = builder.tableStatus;
this.creationDateTime = builder.creationDateTime;
this.provisionedThroughput = builder.provisionedThroughput;
this.tableSizeBytes = builder.tableSizeBytes;
this.itemCount = builder.itemCount;
this.tableArn = builder.tableArn;
this.tableId = builder.tableId;
this.localSecondaryIndexes = builder.localSecondaryIndexes;
this.globalSecondaryIndexes = builder.globalSecondaryIndexes;
this.streamSpecification = builder.streamSpecification;
this.latestStreamLabel = builder.latestStreamLabel;
this.latestStreamArn = builder.latestStreamArn;
this.restoreSummary = builder.restoreSummary;
this.sseDescription = builder.sseDescription;
}
/**
*
* An array of AttributeDefinition
objects. Each of these objects describes one attribute in the table
* and index key schema.
*
*
* Each AttributeDefinition
object in this array is composed of:
*
*
* -
*
* AttributeName
- The name of the attribute.
*
*
* -
*
* AttributeType
- The data type for the attribute.
*
*
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return An array of AttributeDefinition
objects. Each of these objects describes one attribute in
* the table and index key schema.
*
* Each AttributeDefinition
object in this array is composed of:
*
*
* -
*
* AttributeName
- The name of the attribute.
*
*
* -
*
* AttributeType
- The data type for the attribute.
*
*
*/
public List attributeDefinitions() {
return attributeDefinitions;
}
/**
*
* The name of the table.
*
*
* @return The name of the table.
*/
public String tableName() {
return tableName;
}
/**
*
* The primary key structure for the table. Each KeySchemaElement
consists of:
*
*
* -
*
* AttributeName
- The name of the attribute.
*
*
* -
*
* KeyType
- The role of the attribute:
*
*
* -
*
* HASH
- partition key
*
*
* -
*
* RANGE
- sort key
*
*
*
*
*
* The partition key of an item is also known as its hash attribute. The term "hash attribute" derives from
* DynamoDB' usage of an internal hash function to evenly distribute data items across partitions, based on their
* partition key values.
*
*
* The sort key of an item is also known as its range attribute. 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.
*
*
*
*
* For more information about primary keys, see Primary
* Key in the Amazon DynamoDB Developer Guide.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return The primary key structure for the table. Each KeySchemaElement
consists of:
*
* -
*
* AttributeName
- The name of the attribute.
*
*
* -
*
* KeyType
- The role of the attribute:
*
*
* -
*
* HASH
- partition key
*
*
* -
*
* RANGE
- sort key
*
*
*
*
*
* The partition key of an item is also known as its hash attribute. The term "hash attribute"
* derives from DynamoDB' usage of an internal hash function to evenly distribute data items across
* partitions, based on their partition key values.
*
*
* The sort key of an item is also known as its range attribute. 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.
*
*
*
*
* For more information about primary keys, see Primary Key in the Amazon DynamoDB Developer Guide.
*/
public List keySchema() {
return keySchema;
}
/**
*
* The current state of the table:
*
*
* -
*
* CREATING
- The table is being created.
*
*
* -
*
* UPDATING
- The table is being updated.
*
*
* -
*
* DELETING
- The table is being deleted.
*
*
* -
*
* ACTIVE
- The table is ready for use.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #tableStatus} will
* return {@link TableStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #tableStatusAsString}.
*
*
* @return The current state of the table:
*
* -
*
* CREATING
- The table is being created.
*
*
* -
*
* UPDATING
- The table is being updated.
*
*
* -
*
* DELETING
- The table is being deleted.
*
*
* -
*
* ACTIVE
- The table is ready for use.
*
*
* @see TableStatus
*/
public TableStatus tableStatus() {
return TableStatus.fromValue(tableStatus);
}
/**
*
* The current state of the table:
*
*
* -
*
* CREATING
- The table is being created.
*
*
* -
*
* UPDATING
- The table is being updated.
*
*
* -
*
* DELETING
- The table is being deleted.
*
*
* -
*
* ACTIVE
- The table is ready for use.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #tableStatus} will
* return {@link TableStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #tableStatusAsString}.
*
*
* @return The current state of the table:
*
* -
*
* CREATING
- The table is being created.
*
*
* -
*
* UPDATING
- The table is being updated.
*
*
* -
*
* DELETING
- The table is being deleted.
*
*
* -
*
* ACTIVE
- The table is ready for use.
*
*
* @see TableStatus
*/
public String tableStatusAsString() {
return tableStatus;
}
/**
*
* The date and time when the table was created, in UNIX epoch time
* format.
*
*
* @return The date and time when the table was created, in UNIX epoch
* time format.
*/
public Instant creationDateTime() {
return creationDateTime;
}
/**
*
* The provisioned throughput settings for the table, consisting of read and write capacity units, along with data
* about increases and decreases.
*
*
* @return The provisioned throughput settings for the table, consisting of read and write capacity units, along
* with data about increases and decreases.
*/
public ProvisionedThroughputDescription provisionedThroughput() {
return provisionedThroughput;
}
/**
*
* The total size of the specified table, in bytes. DynamoDB updates this value approximately every six hours.
* Recent changes might not be reflected in this value.
*
*
* @return The total size of the specified table, in bytes. DynamoDB updates this value approximately every six
* hours. Recent changes might not be reflected in this value.
*/
public Long tableSizeBytes() {
return tableSizeBytes;
}
/**
*
* The number of items in the specified table. DynamoDB updates this value approximately every six hours. Recent
* changes might not be reflected in this value.
*
*
* @return The number of items in the specified table. DynamoDB updates this value approximately every six hours.
* Recent changes might not be reflected in this value.
*/
public Long itemCount() {
return itemCount;
}
/**
*
* The Amazon Resource Name (ARN) that uniquely identifies the table.
*
*
* @return The Amazon Resource Name (ARN) that uniquely identifies the table.
*/
public String tableArn() {
return tableArn;
}
/**
*
* Unique identifier for the table for which the backup was created.
*
*
* @return Unique identifier for the table for which the backup was created.
*/
public String tableId() {
return tableId;
}
/**
*
* Represents one or more local secondary indexes on the table. Each index is scoped to a given partition key value.
* Tables with one or more local secondary indexes are subject to an item collection size limit, where the amount of
* data within a given item collection cannot exceed 10 GB. Each element is composed of:
*
*
* -
*
* IndexName
- The name of the local secondary index.
*
*
* -
*
* KeySchema
- Specifies the complete index key schema. The attribute names in the key schema must be
* between 1 and 255 characters (inclusive). The key schema must begin with the same partition key as the table.
*
*
* -
*
* Projection
- 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:
*
*
* -
*
* ProjectionType
- One of the following:
*
*
* -
*
* KEYS_ONLY
- Only the index and primary keys are projected into the index.
*
*
* -
*
* INCLUDE
- Only the specified table attributes are projected into the index. The list of projected
* attributes are in NonKeyAttributes
.
*
*
* -
*
* ALL
- All of the table attributes are projected into the index.
*
*
*
*
* -
*
* NonKeyAttributes
- A list of one or more non-key attribute names that are projected into the
* secondary index. The total count of attributes provided in NonKeyAttributes
, summed across all of
* the secondary indexes, must not exceed 20. If you project the same attribute into two different indexes, this
* counts as two distinct attributes when determining the total.
*
*
*
*
* -
*
* IndexSizeBytes
- Represents the total size of the index, in bytes. DynamoDB updates this value
* approximately every six hours. Recent changes might not be reflected in this value.
*
*
* -
*
* ItemCount
- Represents the number of items in the index. DynamoDB updates this value approximately
* every six hours. Recent changes might not be reflected in this value.
*
*
*
*
* If the table is in the DELETING
state, no information about indexes will be returned.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return Represents one or more local secondary indexes on the table. Each index is scoped to a given partition
* key value. Tables with one or more local secondary indexes are subject to an item collection size limit,
* where the amount of data within a given item collection cannot exceed 10 GB. Each element is composed
* of:
*
* -
*
* IndexName
- The name of the local secondary index.
*
*
* -
*
* KeySchema
- Specifies the complete index key schema. The attribute names in the key schema
* must be between 1 and 255 characters (inclusive). The key schema must begin with the same partition key
* as the table.
*
*
* -
*
* Projection
- 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:
*
*
* -
*
* ProjectionType
- One of the following:
*
*
* -
*
* KEYS_ONLY
- Only the index and primary keys are projected into the index.
*
*
* -
*
* INCLUDE
- Only the specified table attributes are projected into the index. The list of
* projected attributes are in NonKeyAttributes
.
*
*
* -
*
* ALL
- All of the table attributes are projected into the index.
*
*
*
*
* -
*
* NonKeyAttributes
- A list of one or more non-key attribute names that are projected into the
* secondary index. The total count of attributes provided in NonKeyAttributes
, summed across
* all of the secondary indexes, must not exceed 20. If you project the same attribute into two different
* indexes, this counts as two distinct attributes when determining the total.
*
*
*
*
* -
*
* IndexSizeBytes
- Represents the total size of the index, in bytes. DynamoDB updates this
* value approximately every six hours. Recent changes might not be reflected in this value.
*
*
* -
*
* ItemCount
- Represents the number of items in the index. DynamoDB updates this value
* approximately every six hours. Recent changes might not be reflected in this value.
*
*
*
*
* If the table is in the DELETING
state, no information about indexes will be returned.
*/
public List localSecondaryIndexes() {
return localSecondaryIndexes;
}
/**
*
* The global secondary indexes, if any, on the table. Each index is scoped to a given partition key value. Each
* element is composed of:
*
*
* -
*
* Backfilling
- If true, then the index is currently in the backfilling phase. Backfilling occurs only
* when a new global secondary index is added to the table; it is the process by which DynamoDB populates the new
* index with data from the table. (This attribute does not appear for indexes that were created during a
* CreateTable
operation.)
*
*
* -
*
* IndexName
- The name of the global secondary index.
*
*
* -
*
* IndexSizeBytes
- The total size of the global secondary index, in bytes. DynamoDB updates this value
* approximately every six hours. Recent changes might not be reflected in this value.
*
*
* -
*
* IndexStatus
- The current status of the global secondary index:
*
*
* -
*
* CREATING
- The index is being created.
*
*
* -
*
* UPDATING
- The index is being updated.
*
*
* -
*
* DELETING
- The index is being deleted.
*
*
* -
*
* ACTIVE
- The index is ready for use.
*
*
*
*
* -
*
* ItemCount
- The number of items in the global secondary index. DynamoDB updates this value
* approximately every six hours. Recent changes might not be reflected in this value.
*
*
* -
*
* KeySchema
- Specifies the complete index key schema. The attribute names in the key schema must be
* between 1 and 255 characters (inclusive). The key schema must begin with the same partition key as the table.
*
*
* -
*
* Projection
- 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:
*
*
* -
*
* ProjectionType
- One of the following:
*
*
* -
*
* KEYS_ONLY
- Only the index and primary keys are projected into the index.
*
*
* -
*
* INCLUDE
- Only the specified table attributes are projected into the index. The list of projected
* attributes are in NonKeyAttributes
.
*
*
* -
*
* ALL
- All of the table attributes are projected into the index.
*
*
*
*
* -
*
* NonKeyAttributes
- A list of one or more non-key attribute names that are projected into the
* secondary index. The total count of attributes provided in NonKeyAttributes
, summed across all of
* the secondary indexes, must not exceed 20. If you project the same attribute into two different indexes, this
* counts as two distinct attributes when determining the total.
*
*
*
*
* -
*
* ProvisionedThroughput
- The provisioned throughput settings for the global secondary index,
* consisting of read and write capacity units, along with data about increases and decreases.
*
*
*
*
* If the table is in the DELETING
state, no information about indexes will be returned.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return The global secondary indexes, if any, on the table. Each index is scoped to a given partition key value.
* Each element is composed of:
*
* -
*
* Backfilling
- If true, then the index is currently in the backfilling phase. Backfilling
* occurs only when a new global secondary index is added to the table; it is the process by which DynamoDB
* populates the new index with data from the table. (This attribute does not appear for indexes that were
* created during a CreateTable
operation.)
*
*
* -
*
* IndexName
- The name of the global secondary index.
*
*
* -
*
* IndexSizeBytes
- The total size of the global secondary index, in bytes. DynamoDB updates
* this value approximately every six hours. Recent changes might not be reflected in this value.
*
*
* -
*
* IndexStatus
- The current status of the global secondary index:
*
*
* -
*
* CREATING
- The index is being created.
*
*
* -
*
* UPDATING
- The index is being updated.
*
*
* -
*
* DELETING
- The index is being deleted.
*
*
* -
*
* ACTIVE
- The index is ready for use.
*
*
*
*
* -
*
* ItemCount
- The number of items in the global secondary index. DynamoDB updates this value
* approximately every six hours. Recent changes might not be reflected in this value.
*
*
* -
*
* KeySchema
- Specifies the complete index key schema. The attribute names in the key schema
* must be between 1 and 255 characters (inclusive). The key schema must begin with the same partition key
* as the table.
*
*
* -
*
* Projection
- 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:
*
*
* -
*
* ProjectionType
- One of the following:
*
*
* -
*
* KEYS_ONLY
- Only the index and primary keys are projected into the index.
*
*
* -
*
* INCLUDE
- Only the specified table attributes are projected into the index. The list of
* projected attributes are in NonKeyAttributes
.
*
*
* -
*
* ALL
- All of the table attributes are projected into the index.
*
*
*
*
* -
*
* NonKeyAttributes
- A list of one or more non-key attribute names that are projected into the
* secondary index. The total count of attributes provided in NonKeyAttributes
, summed across
* all of the secondary indexes, must not exceed 20. If you project the same attribute into two different
* indexes, this counts as two distinct attributes when determining the total.
*
*
*
*
* -
*
* ProvisionedThroughput
- The provisioned throughput settings for the global secondary index,
* consisting of read and write capacity units, along with data about increases and decreases.
*
*
*
*
* If the table is in the DELETING
state, no information about indexes will be returned.
*/
public List globalSecondaryIndexes() {
return globalSecondaryIndexes;
}
/**
*
* The current DynamoDB Streams configuration for the table.
*
*
* @return The current DynamoDB Streams configuration for the table.
*/
public StreamSpecification streamSpecification() {
return streamSpecification;
}
/**
*
* A timestamp, in ISO 8601 format, for this stream.
*
*
* Note that LatestStreamLabel
is not a unique identifier for the stream, because it is possible that a
* stream from another table might have the same timestamp. However, the combination of the following three elements
* is guaranteed to be unique:
*
*
* -
*
* the AWS customer ID.
*
*
* -
*
* the table name.
*
*
* -
*
* the StreamLabel
.
*
*
*
*
* @return A timestamp, in ISO 8601 format, for this stream.
*
* Note that LatestStreamLabel
is not a unique identifier for the stream, because it is
* possible that a stream from another table might have the same timestamp. However, the combination of the
* following three elements is guaranteed to be unique:
*
*
* -
*
* the AWS customer ID.
*
*
* -
*
* the table name.
*
*
* -
*
* the StreamLabel
.
*
*
*/
public String latestStreamLabel() {
return latestStreamLabel;
}
/**
*
* The Amazon Resource Name (ARN) that uniquely identifies the latest stream for this table.
*
*
* @return The Amazon Resource Name (ARN) that uniquely identifies the latest stream for this table.
*/
public String latestStreamArn() {
return latestStreamArn;
}
/**
*
* Contains details for the restore.
*
*
* @return Contains details for the restore.
*/
public RestoreSummary restoreSummary() {
return restoreSummary;
}
/**
*
* The description of the server-side encryption status on the specified table.
*
*
* @return The description of the server-side encryption status on the specified table.
*/
public SSEDescription sseDescription() {
return sseDescription;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(attributeDefinitions());
hashCode = 31 * hashCode + Objects.hashCode(tableName());
hashCode = 31 * hashCode + Objects.hashCode(keySchema());
hashCode = 31 * hashCode + Objects.hashCode(tableStatusAsString());
hashCode = 31 * hashCode + Objects.hashCode(creationDateTime());
hashCode = 31 * hashCode + Objects.hashCode(provisionedThroughput());
hashCode = 31 * hashCode + Objects.hashCode(tableSizeBytes());
hashCode = 31 * hashCode + Objects.hashCode(itemCount());
hashCode = 31 * hashCode + Objects.hashCode(tableArn());
hashCode = 31 * hashCode + Objects.hashCode(tableId());
hashCode = 31 * hashCode + Objects.hashCode(localSecondaryIndexes());
hashCode = 31 * hashCode + Objects.hashCode(globalSecondaryIndexes());
hashCode = 31 * hashCode + Objects.hashCode(streamSpecification());
hashCode = 31 * hashCode + Objects.hashCode(latestStreamLabel());
hashCode = 31 * hashCode + Objects.hashCode(latestStreamArn());
hashCode = 31 * hashCode + Objects.hashCode(restoreSummary());
hashCode = 31 * hashCode + Objects.hashCode(sseDescription());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof TableDescription)) {
return false;
}
TableDescription other = (TableDescription) obj;
return Objects.equals(attributeDefinitions(), other.attributeDefinitions())
&& Objects.equals(tableName(), other.tableName()) && Objects.equals(keySchema(), other.keySchema())
&& Objects.equals(tableStatusAsString(), other.tableStatusAsString())
&& Objects.equals(creationDateTime(), other.creationDateTime())
&& Objects.equals(provisionedThroughput(), other.provisionedThroughput())
&& Objects.equals(tableSizeBytes(), other.tableSizeBytes()) && Objects.equals(itemCount(), other.itemCount())
&& Objects.equals(tableArn(), other.tableArn()) && Objects.equals(tableId(), other.tableId())
&& Objects.equals(localSecondaryIndexes(), other.localSecondaryIndexes())
&& Objects.equals(globalSecondaryIndexes(), other.globalSecondaryIndexes())
&& Objects.equals(streamSpecification(), other.streamSpecification())
&& Objects.equals(latestStreamLabel(), other.latestStreamLabel())
&& Objects.equals(latestStreamArn(), other.latestStreamArn())
&& Objects.equals(restoreSummary(), other.restoreSummary())
&& Objects.equals(sseDescription(), other.sseDescription());
}
@Override
public String toString() {
return ToString.builder("TableDescription").add("AttributeDefinitions", attributeDefinitions())
.add("TableName", tableName()).add("KeySchema", keySchema()).add("TableStatus", tableStatusAsString())
.add("CreationDateTime", creationDateTime()).add("ProvisionedThroughput", provisionedThroughput())
.add("TableSizeBytes", tableSizeBytes()).add("ItemCount", itemCount()).add("TableArn", tableArn())
.add("TableId", tableId()).add("LocalSecondaryIndexes", localSecondaryIndexes())
.add("GlobalSecondaryIndexes", globalSecondaryIndexes()).add("StreamSpecification", streamSpecification())
.add("LatestStreamLabel", latestStreamLabel()).add("LatestStreamArn", latestStreamArn())
.add("RestoreSummary", restoreSummary()).add("SSEDescription", sseDescription()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "AttributeDefinitions":
return Optional.ofNullable(clazz.cast(attributeDefinitions()));
case "TableName":
return Optional.ofNullable(clazz.cast(tableName()));
case "KeySchema":
return Optional.ofNullable(clazz.cast(keySchema()));
case "TableStatus":
return Optional.ofNullable(clazz.cast(tableStatusAsString()));
case "CreationDateTime":
return Optional.ofNullable(clazz.cast(creationDateTime()));
case "ProvisionedThroughput":
return Optional.ofNullable(clazz.cast(provisionedThroughput()));
case "TableSizeBytes":
return Optional.ofNullable(clazz.cast(tableSizeBytes()));
case "ItemCount":
return Optional.ofNullable(clazz.cast(itemCount()));
case "TableArn":
return Optional.ofNullable(clazz.cast(tableArn()));
case "TableId":
return Optional.ofNullable(clazz.cast(tableId()));
case "LocalSecondaryIndexes":
return Optional.ofNullable(clazz.cast(localSecondaryIndexes()));
case "GlobalSecondaryIndexes":
return Optional.ofNullable(clazz.cast(globalSecondaryIndexes()));
case "StreamSpecification":
return Optional.ofNullable(clazz.cast(streamSpecification()));
case "LatestStreamLabel":
return Optional.ofNullable(clazz.cast(latestStreamLabel()));
case "LatestStreamArn":
return Optional.ofNullable(clazz.cast(latestStreamArn()));
case "RestoreSummary":
return Optional.ofNullable(clazz.cast(restoreSummary()));
case "SSEDescription":
return Optional.ofNullable(clazz.cast(sseDescription()));
default:
return Optional.empty();
}
}
@SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
TableDescriptionMarshaller.getInstance().marshall(this, protocolMarshaller);
}
public interface Builder extends CopyableBuilder {
/**
*
* An array of AttributeDefinition
objects. Each of these objects describes one attribute in the
* table and index key schema.
*
*
* Each AttributeDefinition
object in this array is composed of:
*
*
* -
*
* AttributeName
- The name of the attribute.
*
*
* -
*
* AttributeType
- The data type for the attribute.
*
*
*
*
* @param attributeDefinitions
* An array of AttributeDefinition
objects. Each of these objects describes one attribute in
* the table and index key schema.
*
* Each AttributeDefinition
object in this array is composed of:
*
*
* -
*
* AttributeName
- The name of the attribute.
*
*
* -
*
* AttributeType
- The data type for the attribute.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder attributeDefinitions(Collection attributeDefinitions);
/**
*
* An array of AttributeDefinition
objects. Each of these objects describes one attribute in the
* table and index key schema.
*
*
* Each AttributeDefinition
object in this array is composed of:
*
*
* -
*
* AttributeName
- The name of the attribute.
*
*
* -
*
* AttributeType
- The data type for the attribute.
*
*
*
*
* @param attributeDefinitions
* An array of AttributeDefinition
objects. Each of these objects describes one attribute in
* the table and index key schema.
*
* Each AttributeDefinition
object in this array is composed of:
*
*
* -
*
* AttributeName
- The name of the attribute.
*
*
* -
*
* AttributeType
- The data type for the attribute.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder attributeDefinitions(AttributeDefinition... attributeDefinitions);
/**
*
* An array of AttributeDefinition
objects. Each of these objects describes one attribute in the
* table and index key schema.
*
*
* Each AttributeDefinition
object in this array is composed of:
*
*
* -
*
* AttributeName
- The name of the attribute.
*
*
* -
*
* AttributeType
- The data type for the attribute.
*
*
*
* This is a convenience that creates an instance of the {@link List.Builder} avoiding the
* need to create one manually via {@link List#builder()}.
*
* When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately
* and its result is passed to {@link #attributeDefinitions(List)}.
*
* @param attributeDefinitions
* a consumer that will call methods on {@link List.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #attributeDefinitions(List)
*/
Builder attributeDefinitions(Consumer... attributeDefinitions);
/**
*
* The name of the table.
*
*
* @param tableName
* The name of the table.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tableName(String tableName);
/**
*
* The primary key structure for the table. Each KeySchemaElement
consists of:
*
*
* -
*
* AttributeName
- The name of the attribute.
*
*
* -
*
* KeyType
- The role of the attribute:
*
*
* -
*
* HASH
- partition key
*
*
* -
*
* RANGE
- sort key
*
*
*
*
*
* The partition key of an item is also known as its hash attribute. The term "hash attribute" derives
* from DynamoDB' usage of an internal hash function to evenly distribute data items across partitions, based on
* their partition key values.
*
*
* The sort key of an item is also known as its range attribute. 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.
*
*
*
*
* For more information about primary keys, see Primary Key in the Amazon DynamoDB Developer Guide.
*
*
* @param keySchema
* The primary key structure for the table. Each KeySchemaElement
consists of:
*
* -
*
* AttributeName
- The name of the attribute.
*
*
* -
*
* KeyType
- The role of the attribute:
*
*
* -
*
* HASH
- partition key
*
*
* -
*
* RANGE
- sort key
*
*
*
*
*
* The partition key of an item is also known as its hash attribute. The term "hash attribute"
* derives from DynamoDB' usage of an internal hash function to evenly distribute data items across
* partitions, based on their partition key values.
*
*
* The sort key of an item is also known as its range attribute. 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.
*
*
*
*
* For more information about primary keys, see Primary Key in the Amazon DynamoDB Developer Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder keySchema(Collection keySchema);
/**
*
* The primary key structure for the table. Each KeySchemaElement
consists of:
*
*
* -
*
* AttributeName
- The name of the attribute.
*
*
* -
*
* KeyType
- The role of the attribute:
*
*
* -
*
* HASH
- partition key
*
*
* -
*
* RANGE
- sort key
*
*
*
*
*
* The partition key of an item is also known as its hash attribute. The term "hash attribute" derives
* from DynamoDB' usage of an internal hash function to evenly distribute data items across partitions, based on
* their partition key values.
*
*
* The sort key of an item is also known as its range attribute. 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.
*
*
*
*
* For more information about primary keys, see Primary Key in the Amazon DynamoDB Developer Guide.
*
*
* @param keySchema
* The primary key structure for the table. Each KeySchemaElement
consists of:
*
* -
*
* AttributeName
- The name of the attribute.
*
*
* -
*
* KeyType
- The role of the attribute:
*
*
* -
*
* HASH
- partition key
*
*
* -
*
* RANGE
- sort key
*
*
*
*
*
* The partition key of an item is also known as its hash attribute. The term "hash attribute"
* derives from DynamoDB' usage of an internal hash function to evenly distribute data items across
* partitions, based on their partition key values.
*
*
* The sort key of an item is also known as its range attribute. 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.
*
*
*
*
* For more information about primary keys, see Primary Key in the Amazon DynamoDB Developer Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder keySchema(KeySchemaElement... keySchema);
/**
*
* The primary key structure for the table. Each KeySchemaElement
consists of:
*
*
* -
*
* AttributeName
- The name of the attribute.
*
*
* -
*
* KeyType
- The role of the attribute:
*
*
* -
*
* HASH
- partition key
*
*
* -
*
* RANGE
- sort key
*
*
*
*
*
* The partition key of an item is also known as its hash attribute. The term "hash attribute" derives
* from DynamoDB' usage of an internal hash function to evenly distribute data items across partitions, based on
* their partition key values.
*
*
* The sort key of an item is also known as its range attribute. 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.
*
*
*
*
* For more information about primary keys, see Primary Key in the Amazon DynamoDB Developer Guide.
*
* This is a convenience that creates an instance of the {@link List.Builder} avoiding the
* need to create one manually via {@link List#builder()}.
*
* When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and
* its result is passed to {@link #keySchema(List)}.
*
* @param keySchema
* a consumer that will call methods on {@link List.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #keySchema(List)
*/
Builder keySchema(Consumer... keySchema);
/**
*
* The current state of the table:
*
*
* -
*
* CREATING
- The table is being created.
*
*
* -
*
* UPDATING
- The table is being updated.
*
*
* -
*
* DELETING
- The table is being deleted.
*
*
* -
*
* ACTIVE
- The table is ready for use.
*
*
*
*
* @param tableStatus
* The current state of the table:
*
* -
*
* CREATING
- The table is being created.
*
*
* -
*
* UPDATING
- The table is being updated.
*
*
* -
*
* DELETING
- The table is being deleted.
*
*
* -
*
* ACTIVE
- The table is ready for use.
*
*
* @see TableStatus
* @return Returns a reference to this object so that method calls can be chained together.
* @see TableStatus
*/
Builder tableStatus(String tableStatus);
/**
*
* The current state of the table:
*
*
* -
*
* CREATING
- The table is being created.
*
*
* -
*
* UPDATING
- The table is being updated.
*
*
* -
*
* DELETING
- The table is being deleted.
*
*
* -
*
* ACTIVE
- The table is ready for use.
*
*
*
*
* @param tableStatus
* The current state of the table:
*
* -
*
* CREATING
- The table is being created.
*
*
* -
*
* UPDATING
- The table is being updated.
*
*
* -
*
* DELETING
- The table is being deleted.
*
*
* -
*
* ACTIVE
- The table is ready for use.
*
*
* @see TableStatus
* @return Returns a reference to this object so that method calls can be chained together.
* @see TableStatus
*/
Builder tableStatus(TableStatus tableStatus);
/**
*
* The date and time when the table was created, in UNIX epoch time
* format.
*
*
* @param creationDateTime
* The date and time when the table was created, in UNIX epoch
* time format.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder creationDateTime(Instant creationDateTime);
/**
*
* The provisioned throughput settings for the table, consisting of read and write capacity units, along with
* data about increases and decreases.
*
*
* @param provisionedThroughput
* The provisioned throughput settings for the table, consisting of read and write capacity units, along
* with data about increases and decreases.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder provisionedThroughput(ProvisionedThroughputDescription provisionedThroughput);
/**
*
* The provisioned throughput settings for the table, consisting of read and write capacity units, along with
* data about increases and decreases.
*
* This is a convenience that creates an instance of the {@link ProvisionedThroughputDescription.Builder}
* avoiding the need to create one manually via {@link ProvisionedThroughputDescription#builder()}.
*
* When the {@link Consumer} completes, {@link ProvisionedThroughputDescription.Builder#build()} is called
* immediately and its result is passed to {@link #provisionedThroughput(ProvisionedThroughputDescription)}.
*
* @param provisionedThroughput
* a consumer that will call methods on {@link ProvisionedThroughputDescription.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #provisionedThroughput(ProvisionedThroughputDescription)
*/
default Builder provisionedThroughput(Consumer provisionedThroughput) {
return provisionedThroughput(ProvisionedThroughputDescription.builder().applyMutation(provisionedThroughput).build());
}
/**
*
* The total size of the specified table, in bytes. DynamoDB updates this value approximately every six hours.
* Recent changes might not be reflected in this value.
*
*
* @param tableSizeBytes
* The total size of the specified table, in bytes. DynamoDB updates this value approximately every six
* hours. Recent changes might not be reflected in this value.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tableSizeBytes(Long tableSizeBytes);
/**
*
* The number of items in the specified table. DynamoDB updates this value approximately every six hours. Recent
* changes might not be reflected in this value.
*
*
* @param itemCount
* The number of items in the specified table. DynamoDB updates this value approximately every six hours.
* Recent changes might not be reflected in this value.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder itemCount(Long itemCount);
/**
*
* The Amazon Resource Name (ARN) that uniquely identifies the table.
*
*
* @param tableArn
* The Amazon Resource Name (ARN) that uniquely identifies the table.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tableArn(String tableArn);
/**
*
* Unique identifier for the table for which the backup was created.
*
*
* @param tableId
* Unique identifier for the table for which the backup was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tableId(String tableId);
/**
*
* Represents one or more local secondary indexes on the table. Each index is scoped to a given partition key
* value. Tables with one or more local secondary indexes are subject to an item collection size limit, where
* the amount of data within a given item collection cannot exceed 10 GB. Each element is composed of:
*
*
* -
*
* IndexName
- The name of the local secondary index.
*
*
* -
*
* KeySchema
- Specifies the complete index key schema. The attribute names in the key schema must
* be between 1 and 255 characters (inclusive). The key schema must begin with the same partition key as the
* table.
*
*
* -
*
* Projection
- 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:
*
*
* -
*
* ProjectionType
- One of the following:
*
*
* -
*
* KEYS_ONLY
- Only the index and primary keys are projected into the index.
*
*
* -
*
* INCLUDE
- Only the specified table attributes are projected into the index. The list of
* projected attributes are in NonKeyAttributes
.
*
*
* -
*
* ALL
- All of the table attributes are projected into the index.
*
*
*
*
* -
*
* NonKeyAttributes
- A list of one or more non-key attribute names that are projected into the
* secondary index. The total count of attributes provided in NonKeyAttributes
, summed across all
* of the secondary indexes, must not exceed 20. If you project the same attribute into two different indexes,
* this counts as two distinct attributes when determining the total.
*
*
*
*
* -
*
* IndexSizeBytes
- Represents the total size of the index, in bytes. DynamoDB updates this value
* approximately every six hours. Recent changes might not be reflected in this value.
*
*
* -
*
* ItemCount
- Represents the number of items in the index. DynamoDB updates this value
* approximately every six hours. Recent changes might not be reflected in this value.
*
*
*
*
* If the table is in the DELETING
state, no information about indexes will be returned.
*
*
* @param localSecondaryIndexes
* Represents one or more local secondary indexes on the table. Each index is scoped to a given partition
* key value. Tables with one or more local secondary indexes are subject to an item collection size
* limit, where the amount of data within a given item collection cannot exceed 10 GB. Each element is
* composed of:
*
* -
*
* IndexName
- The name of the local secondary index.
*
*
* -
*
* KeySchema
- Specifies the complete index key schema. The attribute names in the key
* schema must be between 1 and 255 characters (inclusive). The key schema must begin with the same
* partition key as the table.
*
*
* -
*
* Projection
- 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:
*
*
* -
*
* ProjectionType
- One of the following:
*
*
* -
*
* KEYS_ONLY
- Only the index and primary keys are projected into the index.
*
*
* -
*
* INCLUDE
- Only the specified table attributes are projected into the index. The list of
* projected attributes are in NonKeyAttributes
.
*
*
* -
*
* ALL
- All of the table attributes are projected into the index.
*
*
*
*
* -
*
* NonKeyAttributes
- A list of one or more non-key attribute names that are projected into
* the secondary index. The total count of attributes provided in NonKeyAttributes
, summed
* across all of the secondary indexes, must not exceed 20. If you project the same attribute into two
* different indexes, this counts as two distinct attributes when determining the total.
*
*
*
*
* -
*
* IndexSizeBytes
- Represents the total size of the index, in bytes. DynamoDB updates this
* value approximately every six hours. Recent changes might not be reflected in this value.
*
*
* -
*
* ItemCount
- Represents the number of items in the index. DynamoDB updates this value
* approximately every six hours. Recent changes might not be reflected in this value.
*
*
*
*
* If the table is in the DELETING
state, no information about indexes will be returned.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder localSecondaryIndexes(Collection localSecondaryIndexes);
/**
*
* Represents one or more local secondary indexes on the table. Each index is scoped to a given partition key
* value. Tables with one or more local secondary indexes are subject to an item collection size limit, where
* the amount of data within a given item collection cannot exceed 10 GB. Each element is composed of:
*
*
* -
*
* IndexName
- The name of the local secondary index.
*
*
* -
*
* KeySchema
- Specifies the complete index key schema. The attribute names in the key schema must
* be between 1 and 255 characters (inclusive). The key schema must begin with the same partition key as the
* table.
*
*
* -
*
* Projection
- 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:
*
*
* -
*
* ProjectionType
- One of the following:
*
*
* -
*
* KEYS_ONLY
- Only the index and primary keys are projected into the index.
*
*
* -
*
* INCLUDE
- Only the specified table attributes are projected into the index. The list of
* projected attributes are in NonKeyAttributes
.
*
*
* -
*
* ALL
- All of the table attributes are projected into the index.
*
*
*
*
* -
*
* NonKeyAttributes
- A list of one or more non-key attribute names that are projected into the
* secondary index. The total count of attributes provided in NonKeyAttributes
, summed across all
* of the secondary indexes, must not exceed 20. If you project the same attribute into two different indexes,
* this counts as two distinct attributes when determining the total.
*
*
*
*
* -
*
* IndexSizeBytes
- Represents the total size of the index, in bytes. DynamoDB updates this value
* approximately every six hours. Recent changes might not be reflected in this value.
*
*
* -
*
* ItemCount
- Represents the number of items in the index. DynamoDB updates this value
* approximately every six hours. Recent changes might not be reflected in this value.
*
*
*
*
* If the table is in the DELETING
state, no information about indexes will be returned.
*
*
* @param localSecondaryIndexes
* Represents one or more local secondary indexes on the table. Each index is scoped to a given partition
* key value. Tables with one or more local secondary indexes are subject to an item collection size
* limit, where the amount of data within a given item collection cannot exceed 10 GB. Each element is
* composed of:
*
* -
*
* IndexName
- The name of the local secondary index.
*
*
* -
*
* KeySchema
- Specifies the complete index key schema. The attribute names in the key
* schema must be between 1 and 255 characters (inclusive). The key schema must begin with the same
* partition key as the table.
*
*
* -
*
* Projection
- 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:
*
*
* -
*
* ProjectionType
- One of the following:
*
*
* -
*
* KEYS_ONLY
- Only the index and primary keys are projected into the index.
*
*
* -
*
* INCLUDE
- Only the specified table attributes are projected into the index. The list of
* projected attributes are in NonKeyAttributes
.
*
*
* -
*
* ALL
- All of the table attributes are projected into the index.
*
*
*
*
* -
*
* NonKeyAttributes
- A list of one or more non-key attribute names that are projected into
* the secondary index. The total count of attributes provided in NonKeyAttributes
, summed
* across all of the secondary indexes, must not exceed 20. If you project the same attribute into two
* different indexes, this counts as two distinct attributes when determining the total.
*
*
*
*
* -
*
* IndexSizeBytes
- Represents the total size of the index, in bytes. DynamoDB updates this
* value approximately every six hours. Recent changes might not be reflected in this value.
*
*
* -
*
* ItemCount
- Represents the number of items in the index. DynamoDB updates this value
* approximately every six hours. Recent changes might not be reflected in this value.
*
*
*
*
* If the table is in the DELETING
state, no information about indexes will be returned.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder localSecondaryIndexes(LocalSecondaryIndexDescription... localSecondaryIndexes);
/**
*
* Represents one or more local secondary indexes on the table. Each index is scoped to a given partition key
* value. Tables with one or more local secondary indexes are subject to an item collection size limit, where
* the amount of data within a given item collection cannot exceed 10 GB. Each element is composed of:
*
*
* -
*
* IndexName
- The name of the local secondary index.
*
*
* -
*
* KeySchema
- Specifies the complete index key schema. The attribute names in the key schema must
* be between 1 and 255 characters (inclusive). The key schema must begin with the same partition key as the
* table.
*
*
* -
*
* Projection
- 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:
*
*
* -
*
* ProjectionType
- One of the following:
*
*
* -
*
* KEYS_ONLY
- Only the index and primary keys are projected into the index.
*
*
* -
*
* INCLUDE
- Only the specified table attributes are projected into the index. The list of
* projected attributes are in NonKeyAttributes
.
*
*
* -
*
* ALL
- All of the table attributes are projected into the index.
*
*
*
*
* -
*
* NonKeyAttributes
- A list of one or more non-key attribute names that are projected into the
* secondary index. The total count of attributes provided in NonKeyAttributes
, summed across all
* of the secondary indexes, must not exceed 20. If you project the same attribute into two different indexes,
* this counts as two distinct attributes when determining the total.
*
*
*
*
* -
*
* IndexSizeBytes
- Represents the total size of the index, in bytes. DynamoDB updates this value
* approximately every six hours. Recent changes might not be reflected in this value.
*
*
* -
*
* ItemCount
- Represents the number of items in the index. DynamoDB updates this value
* approximately every six hours. Recent changes might not be reflected in this value.
*
*
*
*
* If the table is in the DELETING
state, no information about indexes will be returned.
*
* This is a convenience that creates an instance of the {@link List.Builder}
* avoiding the need to create one manually via {@link List#builder()}.
*
* When the {@link Consumer} completes, {@link List.Builder#build()} is called
* immediately and its result is passed to {@link #localSecondaryIndexes(List)}.
*
* @param localSecondaryIndexes
* a consumer that will call methods on {@link List.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #localSecondaryIndexes(List)
*/
Builder localSecondaryIndexes(Consumer... localSecondaryIndexes);
/**
*
* The global secondary indexes, if any, on the table. Each index is scoped to a given partition key value. Each
* element is composed of:
*
*
* -
*
* Backfilling
- If true, then the index is currently in the backfilling phase. Backfilling occurs
* only when a new global secondary index is added to the table; it is the process by which DynamoDB populates
* the new index with data from the table. (This attribute does not appear for indexes that were created during
* a CreateTable
operation.)
*
*
* -
*
* IndexName
- The name of the global secondary index.
*
*
* -
*
* IndexSizeBytes
- The total size of the global secondary index, in bytes. DynamoDB updates this
* value approximately every six hours. Recent changes might not be reflected in this value.
*
*
* -
*
* IndexStatus
- The current status of the global secondary index:
*
*
* -
*
* CREATING
- The index is being created.
*
*
* -
*
* UPDATING
- The index is being updated.
*
*
* -
*
* DELETING
- The index is being deleted.
*
*
* -
*
* ACTIVE
- The index is ready for use.
*
*
*
*
* -
*
* ItemCount
- The number of items in the global secondary index. DynamoDB updates this value
* approximately every six hours. Recent changes might not be reflected in this value.
*
*
* -
*
* KeySchema
- Specifies the complete index key schema. The attribute names in the key schema must
* be between 1 and 255 characters (inclusive). The key schema must begin with the same partition key as the
* table.
*
*
* -
*
* Projection
- 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:
*
*
* -
*
* ProjectionType
- One of the following:
*
*
* -
*
* KEYS_ONLY
- Only the index and primary keys are projected into the index.
*
*
* -
*
* INCLUDE
- Only the specified table attributes are projected into the index. The list of
* projected attributes are in NonKeyAttributes
.
*
*
* -
*
* ALL
- All of the table attributes are projected into the index.
*
*
*
*
* -
*
* NonKeyAttributes
- A list of one or more non-key attribute names that are projected into the
* secondary index. The total count of attributes provided in NonKeyAttributes
, summed across all
* of the secondary indexes, must not exceed 20. If you project the same attribute into two different indexes,
* this counts as two distinct attributes when determining the total.
*
*
*
*
* -
*
* ProvisionedThroughput
- The provisioned throughput settings for the global secondary index,
* consisting of read and write capacity units, along with data about increases and decreases.
*
*
*
*
* If the table is in the DELETING
state, no information about indexes will be returned.
*
*
* @param globalSecondaryIndexes
* The global secondary indexes, if any, on the table. Each index is scoped to a given partition key
* value. Each element is composed of:
*
* -
*
* Backfilling
- If true, then the index is currently in the backfilling phase. Backfilling
* occurs only when a new global secondary index is added to the table; it is the process by which
* DynamoDB populates the new index with data from the table. (This attribute does not appear for indexes
* that were created during a CreateTable
operation.)
*
*
* -
*
* IndexName
- The name of the global secondary index.
*
*
* -
*
* IndexSizeBytes
- The total size of the global secondary index, in bytes. DynamoDB updates
* this value approximately every six hours. Recent changes might not be reflected in this value.
*
*
* -
*
* IndexStatus
- The current status of the global secondary index:
*
*
* -
*
* CREATING
- The index is being created.
*
*
* -
*
* UPDATING
- The index is being updated.
*
*
* -
*
* DELETING
- The index is being deleted.
*
*
* -
*
* ACTIVE
- The index is ready for use.
*
*
*
*
* -
*
* ItemCount
- The number of items in the global secondary index. DynamoDB updates this
* value approximately every six hours. Recent changes might not be reflected in this value.
*
*
* -
*
* KeySchema
- Specifies the complete index key schema. The attribute names in the key
* schema must be between 1 and 255 characters (inclusive). The key schema must begin with the same
* partition key as the table.
*
*
* -
*
* Projection
- 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:
*
*
* -
*
* ProjectionType
- One of the following:
*
*
* -
*
* KEYS_ONLY
- Only the index and primary keys are projected into the index.
*
*
* -
*
* INCLUDE
- Only the specified table attributes are projected into the index. The list of
* projected attributes are in NonKeyAttributes
.
*
*
* -
*
* ALL
- All of the table attributes are projected into the index.
*
*
*
*
* -
*
* NonKeyAttributes
- A list of one or more non-key attribute names that are projected into
* the secondary index. The total count of attributes provided in NonKeyAttributes
, summed
* across all of the secondary indexes, must not exceed 20. If you project the same attribute into two
* different indexes, this counts as two distinct attributes when determining the total.
*
*
*
*
* -
*
* ProvisionedThroughput
- The provisioned throughput settings for the global secondary
* index, consisting of read and write capacity units, along with data about increases and decreases.
*
*
*
*
* If the table is in the DELETING
state, no information about indexes will be returned.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder globalSecondaryIndexes(Collection globalSecondaryIndexes);
/**
*
* The global secondary indexes, if any, on the table. Each index is scoped to a given partition key value. Each
* element is composed of:
*
*
* -
*
* Backfilling
- If true, then the index is currently in the backfilling phase. Backfilling occurs
* only when a new global secondary index is added to the table; it is the process by which DynamoDB populates
* the new index with data from the table. (This attribute does not appear for indexes that were created during
* a CreateTable
operation.)
*
*
* -
*
* IndexName
- The name of the global secondary index.
*
*
* -
*
* IndexSizeBytes
- The total size of the global secondary index, in bytes. DynamoDB updates this
* value approximately every six hours. Recent changes might not be reflected in this value.
*
*
* -
*
* IndexStatus
- The current status of the global secondary index:
*
*
* -
*
* CREATING
- The index is being created.
*
*
* -
*
* UPDATING
- The index is being updated.
*
*
* -
*
* DELETING
- The index is being deleted.
*
*
* -
*
* ACTIVE
- The index is ready for use.
*
*
*
*
* -
*
* ItemCount
- The number of items in the global secondary index. DynamoDB updates this value
* approximately every six hours. Recent changes might not be reflected in this value.
*
*
* -
*
* KeySchema
- Specifies the complete index key schema. The attribute names in the key schema must
* be between 1 and 255 characters (inclusive). The key schema must begin with the same partition key as the
* table.
*
*
* -
*
* Projection
- 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:
*
*
* -
*
* ProjectionType
- One of the following:
*
*
* -
*
* KEYS_ONLY
- Only the index and primary keys are projected into the index.
*
*
* -
*
* INCLUDE
- Only the specified table attributes are projected into the index. The list of
* projected attributes are in NonKeyAttributes
.
*
*
* -
*
* ALL
- All of the table attributes are projected into the index.
*
*
*
*
* -
*
* NonKeyAttributes
- A list of one or more non-key attribute names that are projected into the
* secondary index. The total count of attributes provided in NonKeyAttributes
, summed across all
* of the secondary indexes, must not exceed 20. If you project the same attribute into two different indexes,
* this counts as two distinct attributes when determining the total.
*
*
*
*
* -
*
* ProvisionedThroughput
- The provisioned throughput settings for the global secondary index,
* consisting of read and write capacity units, along with data about increases and decreases.
*
*
*
*
* If the table is in the DELETING
state, no information about indexes will be returned.
*
*
* @param globalSecondaryIndexes
* The global secondary indexes, if any, on the table. Each index is scoped to a given partition key
* value. Each element is composed of:
*
* -
*
* Backfilling
- If true, then the index is currently in the backfilling phase. Backfilling
* occurs only when a new global secondary index is added to the table; it is the process by which
* DynamoDB populates the new index with data from the table. (This attribute does not appear for indexes
* that were created during a CreateTable
operation.)
*
*
* -
*
* IndexName
- The name of the global secondary index.
*
*
* -
*
* IndexSizeBytes
- The total size of the global secondary index, in bytes. DynamoDB updates
* this value approximately every six hours. Recent changes might not be reflected in this value.
*
*
* -
*
* IndexStatus
- The current status of the global secondary index:
*
*
* -
*
* CREATING
- The index is being created.
*
*
* -
*
* UPDATING
- The index is being updated.
*
*
* -
*
* DELETING
- The index is being deleted.
*
*
* -
*
* ACTIVE
- The index is ready for use.
*
*
*
*
* -
*
* ItemCount
- The number of items in the global secondary index. DynamoDB updates this
* value approximately every six hours. Recent changes might not be reflected in this value.
*
*
* -
*
* KeySchema
- Specifies the complete index key schema. The attribute names in the key
* schema must be between 1 and 255 characters (inclusive). The key schema must begin with the same
* partition key as the table.
*
*
* -
*
* Projection
- 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:
*
*
* -
*
* ProjectionType
- One of the following:
*
*
* -
*
* KEYS_ONLY
- Only the index and primary keys are projected into the index.
*
*
* -
*
* INCLUDE
- Only the specified table attributes are projected into the index. The list of
* projected attributes are in NonKeyAttributes
.
*
*
* -
*
* ALL
- All of the table attributes are projected into the index.
*
*
*
*
* -
*
* NonKeyAttributes
- A list of one or more non-key attribute names that are projected into
* the secondary index. The total count of attributes provided in NonKeyAttributes
, summed
* across all of the secondary indexes, must not exceed 20. If you project the same attribute into two
* different indexes, this counts as two distinct attributes when determining the total.
*
*
*
*
* -
*
* ProvisionedThroughput
- The provisioned throughput settings for the global secondary
* index, consisting of read and write capacity units, along with data about increases and decreases.
*
*
*
*
* If the table is in the DELETING
state, no information about indexes will be returned.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder globalSecondaryIndexes(GlobalSecondaryIndexDescription... globalSecondaryIndexes);
/**
*
* The global secondary indexes, if any, on the table. Each index is scoped to a given partition key value. Each
* element is composed of:
*
*
* -
*
* Backfilling
- If true, then the index is currently in the backfilling phase. Backfilling occurs
* only when a new global secondary index is added to the table; it is the process by which DynamoDB populates
* the new index with data from the table. (This attribute does not appear for indexes that were created during
* a CreateTable
operation.)
*
*
* -
*
* IndexName
- The name of the global secondary index.
*
*
* -
*
* IndexSizeBytes
- The total size of the global secondary index, in bytes. DynamoDB updates this
* value approximately every six hours. Recent changes might not be reflected in this value.
*
*
* -
*
* IndexStatus
- The current status of the global secondary index:
*
*
* -
*
* CREATING
- The index is being created.
*
*
* -
*
* UPDATING
- The index is being updated.
*
*
* -
*
* DELETING
- The index is being deleted.
*
*
* -
*
* ACTIVE
- The index is ready for use.
*
*
*
*
* -
*
* ItemCount
- The number of items in the global secondary index. DynamoDB updates this value
* approximately every six hours. Recent changes might not be reflected in this value.
*
*
* -
*
* KeySchema
- Specifies the complete index key schema. The attribute names in the key schema must
* be between 1 and 255 characters (inclusive). The key schema must begin with the same partition key as the
* table.
*
*
* -
*
* Projection
- 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:
*
*
* -
*
* ProjectionType
- One of the following:
*
*
* -
*
* KEYS_ONLY
- Only the index and primary keys are projected into the index.
*
*
* -
*
* INCLUDE
- Only the specified table attributes are projected into the index. The list of
* projected attributes are in NonKeyAttributes
.
*
*
* -
*
* ALL
- All of the table attributes are projected into the index.
*
*
*
*
* -
*
* NonKeyAttributes
- A list of one or more non-key attribute names that are projected into the
* secondary index. The total count of attributes provided in NonKeyAttributes
, summed across all
* of the secondary indexes, must not exceed 20. If you project the same attribute into two different indexes,
* this counts as two distinct attributes when determining the total.
*
*
*
*
* -
*
* ProvisionedThroughput
- The provisioned throughput settings for the global secondary index,
* consisting of read and write capacity units, along with data about increases and decreases.
*
*
*
*
* If the table is in the DELETING
state, no information about indexes will be returned.
*
* This is a convenience that creates an instance of the {@link List.Builder}
* avoiding the need to create one manually via {@link List#builder()}.
*
* When the {@link Consumer} completes, {@link List.Builder#build()} is called
* immediately and its result is passed to {@link
* #globalSecondaryIndexes(List)}.
*
* @param globalSecondaryIndexes
* a consumer that will call methods on {@link List.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #globalSecondaryIndexes(List)
*/
Builder globalSecondaryIndexes(Consumer... globalSecondaryIndexes);
/**
*
* The current DynamoDB Streams configuration for the table.
*
*
* @param streamSpecification
* The current DynamoDB Streams configuration for the table.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder streamSpecification(StreamSpecification streamSpecification);
/**
*
* The current DynamoDB Streams configuration for the table.
*
* This is a convenience that creates an instance of the {@link StreamSpecification.Builder} avoiding the need
* to create one manually via {@link StreamSpecification#builder()}.
*
* When the {@link Consumer} completes, {@link StreamSpecification.Builder#build()} is called immediately and
* its result is passed to {@link #streamSpecification(StreamSpecification)}.
*
* @param streamSpecification
* a consumer that will call methods on {@link StreamSpecification.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #streamSpecification(StreamSpecification)
*/
default Builder streamSpecification(Consumer streamSpecification) {
return streamSpecification(StreamSpecification.builder().applyMutation(streamSpecification).build());
}
/**
*
* A timestamp, in ISO 8601 format, for this stream.
*
*
* Note that LatestStreamLabel
is not a unique identifier for the stream, because it is possible
* that a stream from another table might have the same timestamp. However, the combination of the following
* three elements is guaranteed to be unique:
*
*
* -
*
* the AWS customer ID.
*
*
* -
*
* the table name.
*
*
* -
*
* the StreamLabel
.
*
*
*
*
* @param latestStreamLabel
* A timestamp, in ISO 8601 format, for this stream.
*
* Note that LatestStreamLabel
is not a unique identifier for the stream, because it is
* possible that a stream from another table might have the same timestamp. However, the combination of
* the following three elements is guaranteed to be unique:
*
*
* -
*
* the AWS customer ID.
*
*
* -
*
* the table name.
*
*
* -
*
* the StreamLabel
.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder latestStreamLabel(String latestStreamLabel);
/**
*
* The Amazon Resource Name (ARN) that uniquely identifies the latest stream for this table.
*
*
* @param latestStreamArn
* The Amazon Resource Name (ARN) that uniquely identifies the latest stream for this table.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder latestStreamArn(String latestStreamArn);
/**
*
* Contains details for the restore.
*
*
* @param restoreSummary
* Contains details for the restore.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder restoreSummary(RestoreSummary restoreSummary);
/**
*
* Contains details for the restore.
*
* This is a convenience that creates an instance of the {@link RestoreSummary.Builder} avoiding the need to
* create one manually via {@link RestoreSummary#builder()}.
*
* When the {@link Consumer} completes, {@link RestoreSummary.Builder#build()} is called immediately and its
* result is passed to {@link #restoreSummary(RestoreSummary)}.
*
* @param restoreSummary
* a consumer that will call methods on {@link RestoreSummary.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #restoreSummary(RestoreSummary)
*/
default Builder restoreSummary(Consumer restoreSummary) {
return restoreSummary(RestoreSummary.builder().applyMutation(restoreSummary).build());
}
/**
*
* The description of the server-side encryption status on the specified table.
*
*
* @param sseDescription
* The description of the server-side encryption status on the specified table.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder sseDescription(SSEDescription sseDescription);
/**
*
* The description of the server-side encryption status on the specified table.
*
* This is a convenience that creates an instance of the {@link SSEDescription.Builder} avoiding the need to
* create one manually via {@link SSEDescription#builder()}.
*
* When the {@link Consumer} completes, {@link SSEDescription.Builder#build()} is called immediately and its
* result is passed to {@link #sseDescription(SSEDescription)}.
*
* @param sseDescription
* a consumer that will call methods on {@link SSEDescription.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #sseDescription(SSEDescription)
*/
default Builder sseDescription(Consumer sseDescription) {
return sseDescription(SSEDescription.builder().applyMutation(sseDescription).build());
}
}
static final class BuilderImpl implements Builder {
private List attributeDefinitions = DefaultSdkAutoConstructList.getInstance();
private String tableName;
private List keySchema = DefaultSdkAutoConstructList.getInstance();
private String tableStatus;
private Instant creationDateTime;
private ProvisionedThroughputDescription provisionedThroughput;
private Long tableSizeBytes;
private Long itemCount;
private String tableArn;
private String tableId;
private List localSecondaryIndexes = DefaultSdkAutoConstructList.getInstance();
private List globalSecondaryIndexes = DefaultSdkAutoConstructList.getInstance();
private StreamSpecification streamSpecification;
private String latestStreamLabel;
private String latestStreamArn;
private RestoreSummary restoreSummary;
private SSEDescription sseDescription;
private BuilderImpl() {
}
private BuilderImpl(TableDescription model) {
attributeDefinitions(model.attributeDefinitions);
tableName(model.tableName);
keySchema(model.keySchema);
tableStatus(model.tableStatus);
creationDateTime(model.creationDateTime);
provisionedThroughput(model.provisionedThroughput);
tableSizeBytes(model.tableSizeBytes);
itemCount(model.itemCount);
tableArn(model.tableArn);
tableId(model.tableId);
localSecondaryIndexes(model.localSecondaryIndexes);
globalSecondaryIndexes(model.globalSecondaryIndexes);
streamSpecification(model.streamSpecification);
latestStreamLabel(model.latestStreamLabel);
latestStreamArn(model.latestStreamArn);
restoreSummary(model.restoreSummary);
sseDescription(model.sseDescription);
}
public final Collection getAttributeDefinitions() {
return attributeDefinitions != null ? attributeDefinitions.stream().map(AttributeDefinition::toBuilder)
.collect(Collectors.toList()) : null;
}
@Override
public final Builder attributeDefinitions(Collection attributeDefinitions) {
this.attributeDefinitions = AttributeDefinitionsCopier.copy(attributeDefinitions);
return this;
}
@Override
@SafeVarargs
public final Builder attributeDefinitions(AttributeDefinition... attributeDefinitions) {
attributeDefinitions(Arrays.asList(attributeDefinitions));
return this;
}
@Override
@SafeVarargs
public final Builder attributeDefinitions(Consumer... attributeDefinitions) {
attributeDefinitions(Stream.of(attributeDefinitions).map(c -> AttributeDefinition.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final void setAttributeDefinitions(Collection attributeDefinitions) {
this.attributeDefinitions = AttributeDefinitionsCopier.copyFromBuilder(attributeDefinitions);
}
public final String getTableName() {
return tableName;
}
@Override
public final Builder tableName(String tableName) {
this.tableName = tableName;
return this;
}
public final void setTableName(String tableName) {
this.tableName = tableName;
}
public final Collection getKeySchema() {
return keySchema != null ? keySchema.stream().map(KeySchemaElement::toBuilder).collect(Collectors.toList()) : null;
}
@Override
public final Builder keySchema(Collection keySchema) {
this.keySchema = KeySchemaCopier.copy(keySchema);
return this;
}
@Override
@SafeVarargs
public final Builder keySchema(KeySchemaElement... keySchema) {
keySchema(Arrays.asList(keySchema));
return this;
}
@Override
@SafeVarargs
public final Builder keySchema(Consumer... keySchema) {
keySchema(Stream.of(keySchema).map(c -> KeySchemaElement.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final void setKeySchema(Collection keySchema) {
this.keySchema = KeySchemaCopier.copyFromBuilder(keySchema);
}
public final String getTableStatus() {
return tableStatus;
}
@Override
public final Builder tableStatus(String tableStatus) {
this.tableStatus = tableStatus;
return this;
}
@Override
public final Builder tableStatus(TableStatus tableStatus) {
this.tableStatus(tableStatus.toString());
return this;
}
public final void setTableStatus(String tableStatus) {
this.tableStatus = tableStatus;
}
public final Instant getCreationDateTime() {
return creationDateTime;
}
@Override
public final Builder creationDateTime(Instant creationDateTime) {
this.creationDateTime = creationDateTime;
return this;
}
public final void setCreationDateTime(Instant creationDateTime) {
this.creationDateTime = creationDateTime;
}
public final ProvisionedThroughputDescription.Builder getProvisionedThroughput() {
return provisionedThroughput != null ? provisionedThroughput.toBuilder() : null;
}
@Override
public final Builder provisionedThroughput(ProvisionedThroughputDescription provisionedThroughput) {
this.provisionedThroughput = provisionedThroughput;
return this;
}
public final void setProvisionedThroughput(ProvisionedThroughputDescription.BuilderImpl provisionedThroughput) {
this.provisionedThroughput = provisionedThroughput != null ? provisionedThroughput.build() : null;
}
public final Long getTableSizeBytes() {
return tableSizeBytes;
}
@Override
public final Builder tableSizeBytes(Long tableSizeBytes) {
this.tableSizeBytes = tableSizeBytes;
return this;
}
public final void setTableSizeBytes(Long tableSizeBytes) {
this.tableSizeBytes = tableSizeBytes;
}
public final Long getItemCount() {
return itemCount;
}
@Override
public final Builder itemCount(Long itemCount) {
this.itemCount = itemCount;
return this;
}
public final void setItemCount(Long itemCount) {
this.itemCount = itemCount;
}
public final String getTableArn() {
return tableArn;
}
@Override
public final Builder tableArn(String tableArn) {
this.tableArn = tableArn;
return this;
}
public final void setTableArn(String tableArn) {
this.tableArn = tableArn;
}
public final String getTableId() {
return tableId;
}
@Override
public final Builder tableId(String tableId) {
this.tableId = tableId;
return this;
}
public final void setTableId(String tableId) {
this.tableId = tableId;
}
public final Collection getLocalSecondaryIndexes() {
return localSecondaryIndexes != null ? localSecondaryIndexes.stream().map(LocalSecondaryIndexDescription::toBuilder)
.collect(Collectors.toList()) : null;
}
@Override
public final Builder localSecondaryIndexes(Collection localSecondaryIndexes) {
this.localSecondaryIndexes = LocalSecondaryIndexDescriptionListCopier.copy(localSecondaryIndexes);
return this;
}
@Override
@SafeVarargs
public final Builder localSecondaryIndexes(LocalSecondaryIndexDescription... localSecondaryIndexes) {
localSecondaryIndexes(Arrays.asList(localSecondaryIndexes));
return this;
}
@Override
@SafeVarargs
public final Builder localSecondaryIndexes(Consumer... localSecondaryIndexes) {
localSecondaryIndexes(Stream.of(localSecondaryIndexes)
.map(c -> LocalSecondaryIndexDescription.builder().applyMutation(c).build()).collect(Collectors.toList()));
return this;
}
public final void setLocalSecondaryIndexes(Collection localSecondaryIndexes) {
this.localSecondaryIndexes = LocalSecondaryIndexDescriptionListCopier.copyFromBuilder(localSecondaryIndexes);
}
public final Collection getGlobalSecondaryIndexes() {
return globalSecondaryIndexes != null ? globalSecondaryIndexes.stream()
.map(GlobalSecondaryIndexDescription::toBuilder).collect(Collectors.toList()) : null;
}
@Override
public final Builder globalSecondaryIndexes(Collection globalSecondaryIndexes) {
this.globalSecondaryIndexes = GlobalSecondaryIndexDescriptionListCopier.copy(globalSecondaryIndexes);
return this;
}
@Override
@SafeVarargs
public final Builder globalSecondaryIndexes(GlobalSecondaryIndexDescription... globalSecondaryIndexes) {
globalSecondaryIndexes(Arrays.asList(globalSecondaryIndexes));
return this;
}
@Override
@SafeVarargs
public final Builder globalSecondaryIndexes(Consumer... globalSecondaryIndexes) {
globalSecondaryIndexes(Stream.of(globalSecondaryIndexes)
.map(c -> GlobalSecondaryIndexDescription.builder().applyMutation(c).build()).collect(Collectors.toList()));
return this;
}
public final void setGlobalSecondaryIndexes(Collection globalSecondaryIndexes) {
this.globalSecondaryIndexes = GlobalSecondaryIndexDescriptionListCopier.copyFromBuilder(globalSecondaryIndexes);
}
public final StreamSpecification.Builder getStreamSpecification() {
return streamSpecification != null ? streamSpecification.toBuilder() : null;
}
@Override
public final Builder streamSpecification(StreamSpecification streamSpecification) {
this.streamSpecification = streamSpecification;
return this;
}
public final void setStreamSpecification(StreamSpecification.BuilderImpl streamSpecification) {
this.streamSpecification = streamSpecification != null ? streamSpecification.build() : null;
}
public final String getLatestStreamLabel() {
return latestStreamLabel;
}
@Override
public final Builder latestStreamLabel(String latestStreamLabel) {
this.latestStreamLabel = latestStreamLabel;
return this;
}
public final void setLatestStreamLabel(String latestStreamLabel) {
this.latestStreamLabel = latestStreamLabel;
}
public final String getLatestStreamArn() {
return latestStreamArn;
}
@Override
public final Builder latestStreamArn(String latestStreamArn) {
this.latestStreamArn = latestStreamArn;
return this;
}
public final void setLatestStreamArn(String latestStreamArn) {
this.latestStreamArn = latestStreamArn;
}
public final RestoreSummary.Builder getRestoreSummary() {
return restoreSummary != null ? restoreSummary.toBuilder() : null;
}
@Override
public final Builder restoreSummary(RestoreSummary restoreSummary) {
this.restoreSummary = restoreSummary;
return this;
}
public final void setRestoreSummary(RestoreSummary.BuilderImpl restoreSummary) {
this.restoreSummary = restoreSummary != null ? restoreSummary.build() : null;
}
public final SSEDescription.Builder getSSEDescription() {
return sseDescription != null ? sseDescription.toBuilder() : null;
}
@Override
public final Builder sseDescription(SSEDescription sseDescription) {
this.sseDescription = sseDescription;
return this;
}
public final void setSSEDescription(SSEDescription.BuilderImpl sseDescription) {
this.sseDescription = sseDescription != null ? sseDescription.build() : null;
}
@Override
public TableDescription build() {
return new TableDescription(this);
}
}
}