All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.dynamodb.model.CreateTableRequest Maven / Gradle / Ivy

/*
 * Copyright 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.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Represents the input of a CreateTable operation. *

*/ @Generated("software.amazon.awssdk:codegen") public final class CreateTableRequest extends DynamoDbRequest implements ToCopyableBuilder { private static final SdkField> ATTRIBUTE_DEFINITIONS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("AttributeDefinitions") .getter(getter(CreateTableRequest::attributeDefinitions)) .setter(setter(Builder::attributeDefinitions)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AttributeDefinitions").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(AttributeDefinition::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField TABLE_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("TableName").getter(getter(CreateTableRequest::tableName)).setter(setter(Builder::tableName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TableName").build()).build(); private static final SdkField> KEY_SCHEMA_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("KeySchema") .getter(getter(CreateTableRequest::keySchema)) .setter(setter(Builder::keySchema)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KeySchema").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(KeySchemaElement::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField> LOCAL_SECONDARY_INDEXES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("LocalSecondaryIndexes") .getter(getter(CreateTableRequest::localSecondaryIndexes)) .setter(setter(Builder::localSecondaryIndexes)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LocalSecondaryIndexes").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(LocalSecondaryIndex::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField> GLOBAL_SECONDARY_INDEXES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("GlobalSecondaryIndexes") .getter(getter(CreateTableRequest::globalSecondaryIndexes)) .setter(setter(Builder::globalSecondaryIndexes)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GlobalSecondaryIndexes").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(GlobalSecondaryIndex::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField BILLING_MODE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("BillingMode").getter(getter(CreateTableRequest::billingModeAsString)) .setter(setter(Builder::billingMode)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BillingMode").build()).build(); private static final SdkField PROVISIONED_THROUGHPUT_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("ProvisionedThroughput") .getter(getter(CreateTableRequest::provisionedThroughput)).setter(setter(Builder::provisionedThroughput)) .constructor(ProvisionedThroughput::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProvisionedThroughput").build()) .build(); private static final SdkField STREAM_SPECIFICATION_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("StreamSpecification") .getter(getter(CreateTableRequest::streamSpecification)).setter(setter(Builder::streamSpecification)) .constructor(StreamSpecification::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StreamSpecification").build()) .build(); private static final SdkField SSE_SPECIFICATION_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("SSESpecification") .getter(getter(CreateTableRequest::sseSpecification)).setter(setter(Builder::sseSpecification)) .constructor(SSESpecification::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SSESpecification").build()).build(); private static final SdkField> TAGS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("Tags") .getter(getter(CreateTableRequest::tags)) .setter(setter(Builder::tags)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Tags").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(Tag::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ATTRIBUTE_DEFINITIONS_FIELD, TABLE_NAME_FIELD, KEY_SCHEMA_FIELD, LOCAL_SECONDARY_INDEXES_FIELD, GLOBAL_SECONDARY_INDEXES_FIELD, BILLING_MODE_FIELD, PROVISIONED_THROUGHPUT_FIELD, STREAM_SPECIFICATION_FIELD, SSE_SPECIFICATION_FIELD, TAGS_FIELD)); private final List attributeDefinitions; private final String tableName; private final List keySchema; private final List localSecondaryIndexes; private final List globalSecondaryIndexes; private final String billingMode; private final ProvisionedThroughput provisionedThroughput; private final StreamSpecification streamSpecification; private final SSESpecification sseSpecification; private final List tags; private CreateTableRequest(BuilderImpl builder) { super(builder); this.attributeDefinitions = builder.attributeDefinitions; this.tableName = builder.tableName; this.keySchema = builder.keySchema; this.localSecondaryIndexes = builder.localSecondaryIndexes; this.globalSecondaryIndexes = builder.globalSecondaryIndexes; this.billingMode = builder.billingMode; this.provisionedThroughput = builder.provisionedThroughput; this.streamSpecification = builder.streamSpecification; this.sseSpecification = builder.sseSpecification; this.tags = builder.tags; } /** * Returns true if the AttributeDefinitions property was specified by the sender (it may be empty), or false if the * sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS * service. */ public final boolean hasAttributeDefinitions() { return attributeDefinitions != null && !(attributeDefinitions instanceof SdkAutoConstructList); } /** *

* An array of attributes that describe the key schema for the table and indexes. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* You can use {@link #hasAttributeDefinitions()} to see if a value was sent in this field. *

* * @return An array of attributes that describe the key schema for the table and indexes. */ public final List attributeDefinitions() { return attributeDefinitions; } /** *

* The name of the table to create. *

* * @return The name of the table to create. */ public final String tableName() { return tableName; } /** * Returns true if the KeySchema property was specified by the sender (it may be empty), or false if the sender did * not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service. */ public final boolean hasKeySchema() { return keySchema != null && !(keySchema instanceof SdkAutoConstructList); } /** *

* Specifies the attributes that make up the primary key for a table or an index. The attributes in * KeySchema must also be defined in the AttributeDefinitions array. For more information, * see Data Model in * the Amazon DynamoDB Developer Guide. *

*

* Each KeySchemaElement in the array is composed of: *

*
    *
  • *

    * AttributeName - The name of this key attribute. *

    *
  • *
  • *

    * KeyType - The role that the key attribute will assume: *

    *
      *
    • *

      * 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 * the 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 a simple primary key (partition key), you must provide exactly one element with a KeyType of * HASH. *

*

* For a composite primary key (partition key and sort key), you must provide exactly two elements, in this order: * The first element must have a KeyType of HASH, and the second element must have a * KeyType of RANGE. *

*

* For more information, see Working with Tables in the Amazon DynamoDB Developer Guide. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* You can use {@link #hasKeySchema()} to see if a value was sent in this field. *

* * @return Specifies the attributes that make up the primary key for a table or an index. The attributes in * KeySchema must also be defined in the AttributeDefinitions array. For more * information, see Data Model in * the Amazon DynamoDB Developer Guide.

*

* Each KeySchemaElement in the array is composed of: *

*
    *
  • *

    * AttributeName - The name of this key attribute. *

    *
  • *
  • *

    * KeyType - The role that the key attribute will assume: *

    *
      *
    • *

      * 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 the 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 a simple primary key (partition key), you must provide exactly one element with a * KeyType of HASH. *

*

* For a composite primary key (partition key and sort key), you must provide exactly two elements, in this * order: The first element must have a KeyType of HASH, and the second element * must have a KeyType of RANGE. *

*

* For more information, see Working with Tables in the Amazon DynamoDB Developer Guide. */ public final List keySchema() { return keySchema; } /** * Returns true if the LocalSecondaryIndexes property was specified by the sender (it may be empty), or false if the * sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS * service. */ public final boolean hasLocalSecondaryIndexes() { return localSecondaryIndexes != null && !(localSecondaryIndexes instanceof SdkAutoConstructList); } /** *

* One or more local secondary indexes (the maximum is 5) to be created on the table. Each index is scoped to a * given partition key value. There is a 10 GB size limit per partition key value; otherwise, the size of a local * secondary index is unconstrained. *

*

* Each local secondary index in the array includes the following: *

*
    *
  • *

    * IndexName - The name of the local secondary index. Must be unique only for this table. *

    *

  • *
  • *

    * KeySchema - Specifies the key schema for the local secondary index. 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 is 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 100. If you project the same attribute into two different indexes, this * counts as two distinct attributes when determining the total. *

      *
    • *
    *
  • *
*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* You can use {@link #hasLocalSecondaryIndexes()} to see if a value was sent in this field. *

* * @return One or more local secondary indexes (the maximum is 5) to be created on the table. Each index is scoped * to a given partition key value. There is a 10 GB size limit per partition key value; otherwise, the size * of a local secondary index is unconstrained.

*

* Each local secondary index in the array includes the following: *

*
    *
  • *

    * IndexName - The name of the local secondary index. Must be unique only for this table. *

    *

  • *
  • *

    * KeySchema - Specifies the key schema for the local secondary index. 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 is 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 100. If you project the same attribute into two different * indexes, this counts as two distinct attributes when determining the total. *

      *
    • *
    *
  • */ public final List localSecondaryIndexes() { return localSecondaryIndexes; } /** * Returns true if the GlobalSecondaryIndexes property was specified by the sender (it may be empty), or false if * the sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS * service. */ public final boolean hasGlobalSecondaryIndexes() { return globalSecondaryIndexes != null && !(globalSecondaryIndexes instanceof SdkAutoConstructList); } /** *

    * One or more global secondary indexes (the maximum is 20) to be created on the table. Each global secondary index * in the array includes the following: *

    *
      *
    • *

      * IndexName - The name of the global secondary index. Must be unique only for this table. *

      *

    • *
    • *

      * KeySchema - Specifies the key schema for the global secondary index. *

      *
    • *
    • *

      * 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 is 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 100. 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. *

      *
    • *
    *

    * Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

    *

    * You can use {@link #hasGlobalSecondaryIndexes()} to see if a value was sent in this field. *

    * * @return One or more global secondary indexes (the maximum is 20) to be created on the table. Each global * secondary index in the array includes the following:

    *
      *
    • *

      * IndexName - The name of the global secondary index. Must be unique only for this table. *

      *

    • *
    • *

      * KeySchema - Specifies the key schema for the global secondary index. *

      *
    • *
    • *

      * 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 is 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 100. 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. *

      *
    • */ public final List globalSecondaryIndexes() { return globalSecondaryIndexes; } /** *

      * Controls how you are charged for read and write throughput and how you manage capacity. This setting can be * changed later. *

      *
        *
      • *

        * PROVISIONED - We recommend using PROVISIONED for predictable workloads. * PROVISIONED sets the billing mode to Provisioned Mode. *

        *
      • *
      • *

        * PAY_PER_REQUEST - We recommend using PAY_PER_REQUEST for unpredictable workloads. * PAY_PER_REQUEST sets the billing mode to On-Demand Mode. *

        *
      • *
      *

      * If the service returns an enum value that is not available in the current SDK version, {@link #billingMode} will * return {@link BillingMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #billingModeAsString}. *

      * * @return Controls how you are charged for read and write throughput and how you manage capacity. This setting can * be changed later.

      *
        *
      • *

        * PROVISIONED - We recommend using PROVISIONED for predictable workloads. * PROVISIONED sets the billing mode to Provisioned Mode. *

        *
      • *
      • *

        * PAY_PER_REQUEST - We recommend using PAY_PER_REQUEST for unpredictable * workloads. PAY_PER_REQUEST sets the billing mode to On-Demand Mode. *

        *
      • * @see BillingMode */ public final BillingMode billingMode() { return BillingMode.fromValue(billingMode); } /** *

        * Controls how you are charged for read and write throughput and how you manage capacity. This setting can be * changed later. *

        *
          *
        • *

          * PROVISIONED - We recommend using PROVISIONED for predictable workloads. * PROVISIONED sets the billing mode to Provisioned Mode. *

          *
        • *
        • *

          * PAY_PER_REQUEST - We recommend using PAY_PER_REQUEST for unpredictable workloads. * PAY_PER_REQUEST sets the billing mode to On-Demand Mode. *

          *
        • *
        *

        * If the service returns an enum value that is not available in the current SDK version, {@link #billingMode} will * return {@link BillingMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #billingModeAsString}. *

        * * @return Controls how you are charged for read and write throughput and how you manage capacity. This setting can * be changed later.

        *
          *
        • *

          * PROVISIONED - We recommend using PROVISIONED for predictable workloads. * PROVISIONED sets the billing mode to Provisioned Mode. *

          *
        • *
        • *

          * PAY_PER_REQUEST - We recommend using PAY_PER_REQUEST for unpredictable * workloads. PAY_PER_REQUEST sets the billing mode to On-Demand Mode. *

          *
        • * @see BillingMode */ public final String billingModeAsString() { return billingMode; } /** *

          * Represents the provisioned throughput settings for a specified table or index. The settings can be modified using * the UpdateTable operation. *

          *

          * If you set BillingMode as PROVISIONED, you must specify this property. If you set BillingMode as * PAY_PER_REQUEST, you cannot specify this property. *

          *

          * For current minimum and maximum provisioned throughput values, see Service, Account, and Table * Quotas in the Amazon DynamoDB Developer Guide. *

          * * @return Represents the provisioned throughput settings for a specified table or index. The settings can be * modified using the UpdateTable operation.

          *

          * If you set BillingMode as PROVISIONED, you must specify this property. If you set * BillingMode as PAY_PER_REQUEST, you cannot specify this property. *

          *

          * For current minimum and maximum provisioned throughput values, see Service, Account, and * Table Quotas in the Amazon DynamoDB Developer Guide. */ public final ProvisionedThroughput provisionedThroughput() { return provisionedThroughput; } /** *

          * The settings for DynamoDB Streams on the table. These settings consist of: *

          *
            *
          • *

            * StreamEnabled - Indicates whether DynamoDB Streams is to be enabled (true) or disabled (false). *

            *
          • *
          • *

            * StreamViewType - When an item in the table is modified, StreamViewType determines what * information is written to the table's stream. Valid values for StreamViewType are: *

            *
              *
            • *

              * KEYS_ONLY - Only the key attributes of the modified item are written to the stream. *

              *
            • *
            • *

              * NEW_IMAGE - The entire item, as it appears after it was modified, is written to the stream. *

              *
            • *
            • *

              * OLD_IMAGE - The entire item, as it appeared before it was modified, is written to the stream. *

              *
            • *
            • *

              * NEW_AND_OLD_IMAGES - Both the new and the old item images of the item are written to the stream. *

              *
            • *
            *
          • *
          * * @return The settings for DynamoDB Streams on the table. These settings consist of:

          *
            *
          • *

            * StreamEnabled - Indicates whether DynamoDB Streams is to be enabled (true) or disabled * (false). *

            *
          • *
          • *

            * StreamViewType - When an item in the table is modified, StreamViewType * determines what information is written to the table's stream. Valid values for * StreamViewType are: *

            *
              *
            • *

              * KEYS_ONLY - Only the key attributes of the modified item are written to the stream. *

              *
            • *
            • *

              * NEW_IMAGE - The entire item, as it appears after it was modified, is written to the stream. *

              *
            • *
            • *

              * OLD_IMAGE - The entire item, as it appeared before it was modified, is written to the * stream. *

              *
            • *
            • *

              * NEW_AND_OLD_IMAGES - Both the new and the old item images of the item are written to the * stream. *

              *
            • *
            *
          • */ public final StreamSpecification streamSpecification() { return streamSpecification; } /** *

            * Represents the settings used to enable server-side encryption. *

            * * @return Represents the settings used to enable server-side encryption. */ public final SSESpecification sseSpecification() { return sseSpecification; } /** * Returns true if the Tags property was specified by the sender (it may be empty), or false if the sender did not * specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service. */ public final boolean hasTags() { return tags != null && !(tags instanceof SdkAutoConstructList); } /** *

            * A list of key-value pairs to label the table. For more information, see Tagging for DynamoDB. *

            *

            * Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

            *

            * You can use {@link #hasTags()} to see if a value was sent in this field. *

            * * @return A list of key-value pairs to label the table. For more information, see Tagging for * DynamoDB. */ public final List tags() { return tags; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(hasAttributeDefinitions() ? attributeDefinitions() : null); hashCode = 31 * hashCode + Objects.hashCode(tableName()); hashCode = 31 * hashCode + Objects.hashCode(hasKeySchema() ? keySchema() : null); hashCode = 31 * hashCode + Objects.hashCode(hasLocalSecondaryIndexes() ? localSecondaryIndexes() : null); hashCode = 31 * hashCode + Objects.hashCode(hasGlobalSecondaryIndexes() ? globalSecondaryIndexes() : null); hashCode = 31 * hashCode + Objects.hashCode(billingModeAsString()); hashCode = 31 * hashCode + Objects.hashCode(provisionedThroughput()); hashCode = 31 * hashCode + Objects.hashCode(streamSpecification()); hashCode = 31 * hashCode + Objects.hashCode(sseSpecification()); hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null); return hashCode; } @Override public final boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof CreateTableRequest)) { return false; } CreateTableRequest other = (CreateTableRequest) obj; return hasAttributeDefinitions() == other.hasAttributeDefinitions() && Objects.equals(attributeDefinitions(), other.attributeDefinitions()) && Objects.equals(tableName(), other.tableName()) && hasKeySchema() == other.hasKeySchema() && Objects.equals(keySchema(), other.keySchema()) && hasLocalSecondaryIndexes() == other.hasLocalSecondaryIndexes() && Objects.equals(localSecondaryIndexes(), other.localSecondaryIndexes()) && hasGlobalSecondaryIndexes() == other.hasGlobalSecondaryIndexes() && Objects.equals(globalSecondaryIndexes(), other.globalSecondaryIndexes()) && Objects.equals(billingModeAsString(), other.billingModeAsString()) && Objects.equals(provisionedThroughput(), other.provisionedThroughput()) && Objects.equals(streamSpecification(), other.streamSpecification()) && Objects.equals(sseSpecification(), other.sseSpecification()) && hasTags() == other.hasTags() && Objects.equals(tags(), other.tags()); } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. */ @Override public final String toString() { return ToString.builder("CreateTableRequest") .add("AttributeDefinitions", hasAttributeDefinitions() ? attributeDefinitions() : null) .add("TableName", tableName()).add("KeySchema", hasKeySchema() ? keySchema() : null) .add("LocalSecondaryIndexes", hasLocalSecondaryIndexes() ? localSecondaryIndexes() : null) .add("GlobalSecondaryIndexes", hasGlobalSecondaryIndexes() ? globalSecondaryIndexes() : null) .add("BillingMode", billingModeAsString()).add("ProvisionedThroughput", provisionedThroughput()) .add("StreamSpecification", streamSpecification()).add("SSESpecification", sseSpecification()) .add("Tags", hasTags() ? tags() : null).build(); } public final 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 "LocalSecondaryIndexes": return Optional.ofNullable(clazz.cast(localSecondaryIndexes())); case "GlobalSecondaryIndexes": return Optional.ofNullable(clazz.cast(globalSecondaryIndexes())); case "BillingMode": return Optional.ofNullable(clazz.cast(billingModeAsString())); case "ProvisionedThroughput": return Optional.ofNullable(clazz.cast(provisionedThroughput())); case "StreamSpecification": return Optional.ofNullable(clazz.cast(streamSpecification())); case "SSESpecification": return Optional.ofNullable(clazz.cast(sseSpecification())); case "Tags": return Optional.ofNullable(clazz.cast(tags())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CreateTableRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends DynamoDbRequest.Builder, SdkPojo, CopyableBuilder { /** *

            * An array of attributes that describe the key schema for the table and indexes. *

            * * @param attributeDefinitions * An array of attributes that describe the key schema for the table and indexes. * @return Returns a reference to this object so that method calls can be chained together. */ Builder attributeDefinitions(Collection attributeDefinitions); /** *

            * An array of attributes that describe the key schema for the table and indexes. *

            * * @param attributeDefinitions * An array of attributes that describe the key schema for the table and indexes. * @return Returns a reference to this object so that method calls can be chained together. */ Builder attributeDefinitions(AttributeDefinition... attributeDefinitions); /** *

            * An array of attributes that describe the key schema for the table and indexes. *

            * 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 to create. *

            * * @param tableName * The name of the table to create. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tableName(String tableName); /** *

            * Specifies the attributes that make up the primary key for a table or an index. The attributes in * KeySchema must also be defined in the AttributeDefinitions array. For more * information, see Data Model in the * Amazon DynamoDB Developer Guide. *

            *

            * Each KeySchemaElement in the array is composed of: *

            *
              *
            • *

              * AttributeName - The name of this key attribute. *

              *
            • *
            • *

              * KeyType - The role that the key attribute will assume: *

              *
                *
              • *

                * 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 the 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 a simple primary key (partition key), you must provide exactly one element with a KeyType of * HASH. *

            *

            * For a composite primary key (partition key and sort key), you must provide exactly two elements, in this * order: The first element must have a KeyType of HASH, and the second element must * have a KeyType of RANGE. *

            *

            * For more information, see Working with Tables in the Amazon DynamoDB Developer Guide. *

            * * @param keySchema * Specifies the attributes that make up the primary key for a table or an index. The attributes in * KeySchema must also be defined in the AttributeDefinitions array. For more * information, see Data Model * in the Amazon DynamoDB Developer Guide.

            *

            * Each KeySchemaElement in the array is composed of: *

            *
              *
            • *

              * AttributeName - The name of this key attribute. *

              *
            • *
            • *

              * KeyType - The role that the key attribute will assume: *

              *
                *
              • *

                * 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 the 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 a simple primary key (partition key), you must provide exactly one element with a * KeyType of HASH. *

            *

            * For a composite primary key (partition key and sort key), you must provide exactly two elements, in * this order: The first element must have a KeyType of HASH, and the second * element must have a KeyType of RANGE. *

            *

            * For more information, see Working with Tables 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); /** *

            * Specifies the attributes that make up the primary key for a table or an index. The attributes in * KeySchema must also be defined in the AttributeDefinitions array. For more * information, see Data Model in the * Amazon DynamoDB Developer Guide. *

            *

            * Each KeySchemaElement in the array is composed of: *

            *
              *
            • *

              * AttributeName - The name of this key attribute. *

              *
            • *
            • *

              * KeyType - The role that the key attribute will assume: *

              *
                *
              • *

                * 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 the 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 a simple primary key (partition key), you must provide exactly one element with a KeyType of * HASH. *

            *

            * For a composite primary key (partition key and sort key), you must provide exactly two elements, in this * order: The first element must have a KeyType of HASH, and the second element must * have a KeyType of RANGE. *

            *

            * For more information, see Working with Tables in the Amazon DynamoDB Developer Guide. *

            * * @param keySchema * Specifies the attributes that make up the primary key for a table or an index. The attributes in * KeySchema must also be defined in the AttributeDefinitions array. For more * information, see Data Model * in the Amazon DynamoDB Developer Guide.

            *

            * Each KeySchemaElement in the array is composed of: *

            *
              *
            • *

              * AttributeName - The name of this key attribute. *

              *
            • *
            • *

              * KeyType - The role that the key attribute will assume: *

              *
                *
              • *

                * 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 the 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 a simple primary key (partition key), you must provide exactly one element with a * KeyType of HASH. *

            *

            * For a composite primary key (partition key and sort key), you must provide exactly two elements, in * this order: The first element must have a KeyType of HASH, and the second * element must have a KeyType of RANGE. *

            *

            * For more information, see Working with Tables 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); /** *

            * Specifies the attributes that make up the primary key for a table or an index. The attributes in * KeySchema must also be defined in the AttributeDefinitions array. For more * information, see Data Model in the * Amazon DynamoDB Developer Guide. *

            *

            * Each KeySchemaElement in the array is composed of: *

            *
              *
            • *

              * AttributeName - The name of this key attribute. *

              *
            • *
            • *

              * KeyType - The role that the key attribute will assume: *

              *
                *
              • *

                * 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 the 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 a simple primary key (partition key), you must provide exactly one element with a KeyType of * HASH. *

            *

            * For a composite primary key (partition key and sort key), you must provide exactly two elements, in this * order: The first element must have a KeyType of HASH, and the second element must * have a KeyType of RANGE. *

            *

            * For more information, see Working with Tables 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); /** *

            * One or more local secondary indexes (the maximum is 5) to be created on the table. Each index is scoped to a * given partition key value. There is a 10 GB size limit per partition key value; otherwise, the size of a * local secondary index is unconstrained. *

            *

            * Each local secondary index in the array includes the following: *

            *
              *
            • *

              * IndexName - The name of the local secondary index. Must be unique only for this table. *

              *

            • *
            • *

              * KeySchema - Specifies the key schema for the local secondary index. 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 is 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 100. If you project the same attribute into two different indexes, * this counts as two distinct attributes when determining the total. *

                *
              • *
              *
            • *
            * * @param localSecondaryIndexes * One or more local secondary indexes (the maximum is 5) to be created on the table. Each index is * scoped to a given partition key value. There is a 10 GB size limit per partition key value; otherwise, * the size of a local secondary index is unconstrained.

            *

            * Each local secondary index in the array includes the following: *

            *
              *
            • *

              * IndexName - The name of the local secondary index. Must be unique only for this table. *

              *

            • *
            • *

              * KeySchema - Specifies the key schema for the local secondary index. 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 is 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 100. If you project the same attribute into two * different indexes, this counts as two distinct attributes when determining the total. *

                *
              • *
              *
            • * @return Returns a reference to this object so that method calls can be chained together. */ Builder localSecondaryIndexes(Collection localSecondaryIndexes); /** *

              * One or more local secondary indexes (the maximum is 5) to be created on the table. Each index is scoped to a * given partition key value. There is a 10 GB size limit per partition key value; otherwise, the size of a * local secondary index is unconstrained. *

              *

              * Each local secondary index in the array includes the following: *

              *
                *
              • *

                * IndexName - The name of the local secondary index. Must be unique only for this table. *

                *

              • *
              • *

                * KeySchema - Specifies the key schema for the local secondary index. 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 is 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 100. If you project the same attribute into two different indexes, * this counts as two distinct attributes when determining the total. *

                  *
                • *
                *
              • *
              * * @param localSecondaryIndexes * One or more local secondary indexes (the maximum is 5) to be created on the table. Each index is * scoped to a given partition key value. There is a 10 GB size limit per partition key value; otherwise, * the size of a local secondary index is unconstrained.

              *

              * Each local secondary index in the array includes the following: *

              *
                *
              • *

                * IndexName - The name of the local secondary index. Must be unique only for this table. *

                *

              • *
              • *

                * KeySchema - Specifies the key schema for the local secondary index. 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 is 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 100. If you project the same attribute into two * different indexes, this counts as two distinct attributes when determining the total. *

                  *
                • *
                *
              • * @return Returns a reference to this object so that method calls can be chained together. */ Builder localSecondaryIndexes(LocalSecondaryIndex... localSecondaryIndexes); /** *

                * One or more local secondary indexes (the maximum is 5) to be created on the table. Each index is scoped to a * given partition key value. There is a 10 GB size limit per partition key value; otherwise, the size of a * local secondary index is unconstrained. *

                *

                * Each local secondary index in the array includes the following: *

                *
                  *
                • *

                  * IndexName - The name of the local secondary index. Must be unique only for this table. *

                  *

                • *
                • *

                  * KeySchema - Specifies the key schema for the local secondary index. 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 is 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 100. If you project the same attribute into two different indexes, * this counts as two distinct attributes when determining the total. *

                    *
                  • *
                  *
                • *
                * 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); /** *

                * One or more global secondary indexes (the maximum is 20) to be created on the table. Each global secondary * index in the array includes the following: *

                *
                  *
                • *

                  * IndexName - The name of the global secondary index. Must be unique only for this table. *

                  *

                • *
                • *

                  * KeySchema - Specifies the key schema for the global secondary index. *

                  *
                • *
                • *

                  * 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 is 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 100. 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. *

                  *
                • *
                * * @param globalSecondaryIndexes * One or more global secondary indexes (the maximum is 20) to be created on the table. Each global * secondary index in the array includes the following:

                *
                  *
                • *

                  * IndexName - The name of the global secondary index. Must be unique only for this table. *

                  *

                • *
                • *

                  * KeySchema - Specifies the key schema for the global secondary index. *

                  *
                • *
                • *

                  * 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 is 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 100. 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. *

                  *
                • * @return Returns a reference to this object so that method calls can be chained together. */ Builder globalSecondaryIndexes(Collection globalSecondaryIndexes); /** *

                  * One or more global secondary indexes (the maximum is 20) to be created on the table. Each global secondary * index in the array includes the following: *

                  *
                    *
                  • *

                    * IndexName - The name of the global secondary index. Must be unique only for this table. *

                    *

                  • *
                  • *

                    * KeySchema - Specifies the key schema for the global secondary index. *

                    *
                  • *
                  • *

                    * 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 is 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 100. 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. *

                    *
                  • *
                  * * @param globalSecondaryIndexes * One or more global secondary indexes (the maximum is 20) to be created on the table. Each global * secondary index in the array includes the following:

                  *
                    *
                  • *

                    * IndexName - The name of the global secondary index. Must be unique only for this table. *

                    *

                  • *
                  • *

                    * KeySchema - Specifies the key schema for the global secondary index. *

                    *
                  • *
                  • *

                    * 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 is 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 100. 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. *

                    *
                  • * @return Returns a reference to this object so that method calls can be chained together. */ Builder globalSecondaryIndexes(GlobalSecondaryIndex... globalSecondaryIndexes); /** *

                    * One or more global secondary indexes (the maximum is 20) to be created on the table. Each global secondary * index in the array includes the following: *

                    *
                      *
                    • *

                      * IndexName - The name of the global secondary index. Must be unique only for this table. *

                      *

                    • *
                    • *

                      * KeySchema - Specifies the key schema for the global secondary index. *

                      *
                    • *
                    • *

                      * 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 is 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 100. 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. *

                      *
                    • *
                    * 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); /** *

                    * Controls how you are charged for read and write throughput and how you manage capacity. This setting can be * changed later. *

                    *
                      *
                    • *

                      * PROVISIONED - We recommend using PROVISIONED for predictable workloads. * PROVISIONED sets the billing mode to Provisioned Mode. *

                      *
                    • *
                    • *

                      * PAY_PER_REQUEST - We recommend using PAY_PER_REQUEST for unpredictable workloads. * PAY_PER_REQUEST sets the billing mode to On-Demand Mode. *

                      *
                    • *
                    * * @param billingMode * Controls how you are charged for read and write throughput and how you manage capacity. This setting * can be changed later.

                    *
                      *
                    • *

                      * PROVISIONED - We recommend using PROVISIONED for predictable workloads. * PROVISIONED sets the billing mode to Provisioned Mode. *

                      *
                    • *
                    • *

                      * PAY_PER_REQUEST - We recommend using PAY_PER_REQUEST for unpredictable * workloads. PAY_PER_REQUEST sets the billing mode to On-Demand Mode. *

                      *
                    • * @see BillingMode * @return Returns a reference to this object so that method calls can be chained together. * @see BillingMode */ Builder billingMode(String billingMode); /** *

                      * Controls how you are charged for read and write throughput and how you manage capacity. This setting can be * changed later. *

                      *
                        *
                      • *

                        * PROVISIONED - We recommend using PROVISIONED for predictable workloads. * PROVISIONED sets the billing mode to Provisioned Mode. *

                        *
                      • *
                      • *

                        * PAY_PER_REQUEST - We recommend using PAY_PER_REQUEST for unpredictable workloads. * PAY_PER_REQUEST sets the billing mode to On-Demand Mode. *

                        *
                      • *
                      * * @param billingMode * Controls how you are charged for read and write throughput and how you manage capacity. This setting * can be changed later.

                      *
                        *
                      • *

                        * PROVISIONED - We recommend using PROVISIONED for predictable workloads. * PROVISIONED sets the billing mode to Provisioned Mode. *

                        *
                      • *
                      • *

                        * PAY_PER_REQUEST - We recommend using PAY_PER_REQUEST for unpredictable * workloads. PAY_PER_REQUEST sets the billing mode to On-Demand Mode. *

                        *
                      • * @see BillingMode * @return Returns a reference to this object so that method calls can be chained together. * @see BillingMode */ Builder billingMode(BillingMode billingMode); /** *

                        * Represents the provisioned throughput settings for a specified table or index. The settings can be modified * using the UpdateTable operation. *

                        *

                        * If you set BillingMode as PROVISIONED, you must specify this property. If you set BillingMode as * PAY_PER_REQUEST, you cannot specify this property. *

                        *

                        * For current minimum and maximum provisioned throughput values, see Service, Account, and * Table Quotas in the Amazon DynamoDB Developer Guide. *

                        * * @param provisionedThroughput * Represents the provisioned throughput settings for a specified table or index. The settings can be * modified using the UpdateTable operation.

                        *

                        * If you set BillingMode as PROVISIONED, you must specify this property. If you set * BillingMode as PAY_PER_REQUEST, you cannot specify this property. *

                        *

                        * For current minimum and maximum provisioned throughput values, see Service, Account, * and Table Quotas in the Amazon DynamoDB Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder provisionedThroughput(ProvisionedThroughput provisionedThroughput); /** *

                        * Represents the provisioned throughput settings for a specified table or index. The settings can be modified * using the UpdateTable operation. *

                        *

                        * If you set BillingMode as PROVISIONED, you must specify this property. If you set BillingMode as * PAY_PER_REQUEST, you cannot specify this property. *

                        *

                        * For current minimum and maximum provisioned throughput values, see Service, Account, and * Table Quotas in the Amazon DynamoDB Developer Guide. *

                        * This is a convenience that creates an instance of the {@link ProvisionedThroughput.Builder} avoiding the need * to create one manually via {@link ProvisionedThroughput#builder()}. * * When the {@link Consumer} completes, {@link ProvisionedThroughput.Builder#build()} is called immediately and * its result is passed to {@link #provisionedThroughput(ProvisionedThroughput)}. * * @param provisionedThroughput * a consumer that will call methods on {@link ProvisionedThroughput.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #provisionedThroughput(ProvisionedThroughput) */ default Builder provisionedThroughput(Consumer provisionedThroughput) { return provisionedThroughput(ProvisionedThroughput.builder().applyMutation(provisionedThroughput).build()); } /** *

                        * The settings for DynamoDB Streams on the table. These settings consist of: *

                        *
                          *
                        • *

                          * StreamEnabled - Indicates whether DynamoDB Streams is to be enabled (true) or disabled (false). *

                          *
                        • *
                        • *

                          * StreamViewType - When an item in the table is modified, StreamViewType determines * what information is written to the table's stream. Valid values for StreamViewType are: *

                          *
                            *
                          • *

                            * KEYS_ONLY - Only the key attributes of the modified item are written to the stream. *

                            *
                          • *
                          • *

                            * NEW_IMAGE - The entire item, as it appears after it was modified, is written to the stream. *

                            *
                          • *
                          • *

                            * OLD_IMAGE - The entire item, as it appeared before it was modified, is written to the stream. *

                            *
                          • *
                          • *

                            * NEW_AND_OLD_IMAGES - Both the new and the old item images of the item are written to the stream. *

                            *
                          • *
                          *
                        • *
                        * * @param streamSpecification * The settings for DynamoDB Streams on the table. These settings consist of:

                        *
                          *
                        • *

                          * StreamEnabled - Indicates whether DynamoDB Streams is to be enabled (true) or disabled * (false). *

                          *
                        • *
                        • *

                          * StreamViewType - When an item in the table is modified, StreamViewType * determines what information is written to the table's stream. Valid values for * StreamViewType are: *

                          *
                            *
                          • *

                            * KEYS_ONLY - Only the key attributes of the modified item are written to the stream. *

                            *
                          • *
                          • *

                            * NEW_IMAGE - The entire item, as it appears after it was modified, is written to the * stream. *

                            *
                          • *
                          • *

                            * OLD_IMAGE - The entire item, as it appeared before it was modified, is written to the * stream. *

                            *
                          • *
                          • *

                            * NEW_AND_OLD_IMAGES - Both the new and the old item images of the item are written to the * stream. *

                            *
                          • *
                          *
                        • * @return Returns a reference to this object so that method calls can be chained together. */ Builder streamSpecification(StreamSpecification streamSpecification); /** *

                          * The settings for DynamoDB Streams on the table. These settings consist of: *

                          *
                            *
                          • *

                            * StreamEnabled - Indicates whether DynamoDB Streams is to be enabled (true) or disabled (false). *

                            *
                          • *
                          • *

                            * StreamViewType - When an item in the table is modified, StreamViewType determines * what information is written to the table's stream. Valid values for StreamViewType are: *

                            *
                              *
                            • *

                              * KEYS_ONLY - Only the key attributes of the modified item are written to the stream. *

                              *
                            • *
                            • *

                              * NEW_IMAGE - The entire item, as it appears after it was modified, is written to the stream. *

                              *
                            • *
                            • *

                              * OLD_IMAGE - The entire item, as it appeared before it was modified, is written to the stream. *

                              *
                            • *
                            • *

                              * NEW_AND_OLD_IMAGES - Both the new and the old item images of the item are written to the stream. *

                              *
                            • *
                            *
                          • *
                          * 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()); } /** *

                          * Represents the settings used to enable server-side encryption. *

                          * * @param sseSpecification * Represents the settings used to enable server-side encryption. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sseSpecification(SSESpecification sseSpecification); /** *

                          * Represents the settings used to enable server-side encryption. *

                          * This is a convenience that creates an instance of the {@link SSESpecification.Builder} avoiding the need to * create one manually via {@link SSESpecification#builder()}. * * When the {@link Consumer} completes, {@link SSESpecification.Builder#build()} is called immediately and its * result is passed to {@link #sseSpecification(SSESpecification)}. * * @param sseSpecification * a consumer that will call methods on {@link SSESpecification.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #sseSpecification(SSESpecification) */ default Builder sseSpecification(Consumer sseSpecification) { return sseSpecification(SSESpecification.builder().applyMutation(sseSpecification).build()); } /** *

                          * A list of key-value pairs to label the table. For more information, see Tagging for * DynamoDB. *

                          * * @param tags * A list of key-value pairs to label the table. For more information, see Tagging for * DynamoDB. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Collection tags); /** *

                          * A list of key-value pairs to label the table. For more information, see Tagging for * DynamoDB. *

                          * * @param tags * A list of key-value pairs to label the table. For more information, see Tagging for * DynamoDB. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Tag... tags); /** *

                          * A list of key-value pairs to label the table. For more information, see Tagging for * DynamoDB. *

                          * 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 #tags(List)}. * * @param tags * 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 #tags(List) */ Builder tags(Consumer... tags); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends DynamoDbRequest.BuilderImpl implements Builder { private List attributeDefinitions = DefaultSdkAutoConstructList.getInstance(); private String tableName; private List keySchema = DefaultSdkAutoConstructList.getInstance(); private List localSecondaryIndexes = DefaultSdkAutoConstructList.getInstance(); private List globalSecondaryIndexes = DefaultSdkAutoConstructList.getInstance(); private String billingMode; private ProvisionedThroughput provisionedThroughput; private StreamSpecification streamSpecification; private SSESpecification sseSpecification; private List tags = DefaultSdkAutoConstructList.getInstance(); private BuilderImpl() { } private BuilderImpl(CreateTableRequest model) { super(model); attributeDefinitions(model.attributeDefinitions); tableName(model.tableName); keySchema(model.keySchema); localSecondaryIndexes(model.localSecondaryIndexes); globalSecondaryIndexes(model.globalSecondaryIndexes); billingMode(model.billingMode); provisionedThroughput(model.provisionedThroughput); streamSpecification(model.streamSpecification); sseSpecification(model.sseSpecification); tags(model.tags); } public final Collection getAttributeDefinitions() { if (attributeDefinitions instanceof SdkAutoConstructList) { return null; } 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() { if (keySchema instanceof SdkAutoConstructList) { return null; } 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 Collection getLocalSecondaryIndexes() { if (localSecondaryIndexes instanceof SdkAutoConstructList) { return null; } return localSecondaryIndexes != null ? localSecondaryIndexes.stream().map(LocalSecondaryIndex::toBuilder) .collect(Collectors.toList()) : null; } @Override public final Builder localSecondaryIndexes(Collection localSecondaryIndexes) { this.localSecondaryIndexes = LocalSecondaryIndexListCopier.copy(localSecondaryIndexes); return this; } @Override @SafeVarargs public final Builder localSecondaryIndexes(LocalSecondaryIndex... localSecondaryIndexes) { localSecondaryIndexes(Arrays.asList(localSecondaryIndexes)); return this; } @Override @SafeVarargs public final Builder localSecondaryIndexes(Consumer... localSecondaryIndexes) { localSecondaryIndexes(Stream.of(localSecondaryIndexes) .map(c -> LocalSecondaryIndex.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final void setLocalSecondaryIndexes(Collection localSecondaryIndexes) { this.localSecondaryIndexes = LocalSecondaryIndexListCopier.copyFromBuilder(localSecondaryIndexes); } public final Collection getGlobalSecondaryIndexes() { if (globalSecondaryIndexes instanceof SdkAutoConstructList) { return null; } return globalSecondaryIndexes != null ? globalSecondaryIndexes.stream().map(GlobalSecondaryIndex::toBuilder) .collect(Collectors.toList()) : null; } @Override public final Builder globalSecondaryIndexes(Collection globalSecondaryIndexes) { this.globalSecondaryIndexes = GlobalSecondaryIndexListCopier.copy(globalSecondaryIndexes); return this; } @Override @SafeVarargs public final Builder globalSecondaryIndexes(GlobalSecondaryIndex... globalSecondaryIndexes) { globalSecondaryIndexes(Arrays.asList(globalSecondaryIndexes)); return this; } @Override @SafeVarargs public final Builder globalSecondaryIndexes(Consumer... globalSecondaryIndexes) { globalSecondaryIndexes(Stream.of(globalSecondaryIndexes) .map(c -> GlobalSecondaryIndex.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final void setGlobalSecondaryIndexes(Collection globalSecondaryIndexes) { this.globalSecondaryIndexes = GlobalSecondaryIndexListCopier.copyFromBuilder(globalSecondaryIndexes); } public final String getBillingMode() { return billingMode; } @Override public final Builder billingMode(String billingMode) { this.billingMode = billingMode; return this; } @Override public final Builder billingMode(BillingMode billingMode) { this.billingMode(billingMode == null ? null : billingMode.toString()); return this; } public final void setBillingMode(String billingMode) { this.billingMode = billingMode; } public final ProvisionedThroughput.Builder getProvisionedThroughput() { return provisionedThroughput != null ? provisionedThroughput.toBuilder() : null; } @Override public final Builder provisionedThroughput(ProvisionedThroughput provisionedThroughput) { this.provisionedThroughput = provisionedThroughput; return this; } public final void setProvisionedThroughput(ProvisionedThroughput.BuilderImpl provisionedThroughput) { this.provisionedThroughput = provisionedThroughput != null ? provisionedThroughput.build() : null; } 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 SSESpecification.Builder getSseSpecification() { return sseSpecification != null ? sseSpecification.toBuilder() : null; } @Override public final Builder sseSpecification(SSESpecification sseSpecification) { this.sseSpecification = sseSpecification; return this; } public final void setSseSpecification(SSESpecification.BuilderImpl sseSpecification) { this.sseSpecification = sseSpecification != null ? sseSpecification.build() : null; } public final Collection getTags() { if (tags instanceof SdkAutoConstructList) { return null; } return tags != null ? tags.stream().map(Tag::toBuilder).collect(Collectors.toList()) : null; } @Override public final Builder tags(Collection tags) { this.tags = TagListCopier.copy(tags); return this; } @Override @SafeVarargs public final Builder tags(Tag... tags) { tags(Arrays.asList(tags)); return this; } @Override @SafeVarargs public final Builder tags(Consumer... tags) { tags(Stream.of(tags).map(c -> Tag.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final void setTags(Collection tags) { this.tags = TagListCopier.copyFromBuilder(tags); } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public CreateTableRequest build() { return new CreateTableRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy