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

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

Go to download

The AWS Java SDK for Amazon DynamoDB module holds the client classes that are used for communicating with Amazon DynamoDB Service

There is a newer version: 2.30.1
Show newest version
/*
 * 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 an UpdateTable operation. *

*/ @Generated("software.amazon.awssdk:codegen") public final class UpdateTableRequest extends DynamoDbRequest implements ToCopyableBuilder { private static final SdkField> ATTRIBUTE_DEFINITIONS_FIELD = SdkField .> builder(MarshallingType.LIST) .getter(getter(UpdateTableRequest::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) .getter(getter(UpdateTableRequest::tableName)).setter(setter(Builder::tableName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TableName").build()).build(); private static final SdkField BILLING_MODE_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(UpdateTableRequest::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).getter(getter(UpdateTableRequest::provisionedThroughput)) .setter(setter(Builder::provisionedThroughput)).constructor(ProvisionedThroughput::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProvisionedThroughput").build()) .build(); private static final SdkField> GLOBAL_SECONDARY_INDEX_UPDATES_FIELD = SdkField .> builder(MarshallingType.LIST) .getter(getter(UpdateTableRequest::globalSecondaryIndexUpdates)) .setter(setter(Builder::globalSecondaryIndexUpdates)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GlobalSecondaryIndexUpdates") .build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(GlobalSecondaryIndexUpdate::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField STREAM_SPECIFICATION_FIELD = SdkField . builder(MarshallingType.SDK_POJO).getter(getter(UpdateTableRequest::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).getter(getter(UpdateTableRequest::sseSpecification)) .setter(setter(Builder::sseSpecification)).constructor(SSESpecification::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SSESpecification").build()).build(); private static final SdkField> REPLICA_UPDATES_FIELD = SdkField .> builder(MarshallingType.LIST) .getter(getter(UpdateTableRequest::replicaUpdates)) .setter(setter(Builder::replicaUpdates)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReplicaUpdates").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(ReplicationGroupUpdate::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, BILLING_MODE_FIELD, PROVISIONED_THROUGHPUT_FIELD, GLOBAL_SECONDARY_INDEX_UPDATES_FIELD, STREAM_SPECIFICATION_FIELD, SSE_SPECIFICATION_FIELD, REPLICA_UPDATES_FIELD)); private final List attributeDefinitions; private final String tableName; private final String billingMode; private final ProvisionedThroughput provisionedThroughput; private final List globalSecondaryIndexUpdates; private final StreamSpecification streamSpecification; private final SSESpecification sseSpecification; private final List replicaUpdates; private UpdateTableRequest(BuilderImpl builder) { super(builder); this.attributeDefinitions = builder.attributeDefinitions; this.tableName = builder.tableName; this.billingMode = builder.billingMode; this.provisionedThroughput = builder.provisionedThroughput; this.globalSecondaryIndexUpdates = builder.globalSecondaryIndexUpdates; this.streamSpecification = builder.streamSpecification; this.sseSpecification = builder.sseSpecification; this.replicaUpdates = builder.replicaUpdates; } /** * 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 boolean hasAttributeDefinitions() { return attributeDefinitions != null && !(attributeDefinitions instanceof SdkAutoConstructList); } /** *

* An array of attributes that describe the key schema for the table and indexes. If you are adding a new global * secondary index to the table, AttributeDefinitions must include the key element(s) of the new index. *

*

* 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. If you are adding a new * global secondary index to the table, AttributeDefinitions must include the key element(s) of * the new index. */ public List attributeDefinitions() { return attributeDefinitions; } /** *

* The name of the table to be updated. *

* * @return The name of the table to be updated. */ public String tableName() { return tableName; } /** *

* Controls how you are charged for read and write throughput and how you manage capacity. When switching from * pay-per-request to provisioned capacity, initial provisioned capacity values must be set. The initial provisioned * capacity values are estimated based on the consumed read and write capacity of your table and global secondary * indexes over the past 30 minutes. *

*
    *
  • *

    * 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. When switching * from pay-per-request to provisioned capacity, initial provisioned capacity values must be set. The * initial provisioned capacity values are estimated based on the consumed read and write capacity of your * table and global secondary indexes over the past 30 minutes.

*
    *
  • *

    * 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 BillingMode billingMode() { return BillingMode.fromValue(billingMode); } /** *

    * Controls how you are charged for read and write throughput and how you manage capacity. When switching from * pay-per-request to provisioned capacity, initial provisioned capacity values must be set. The initial provisioned * capacity values are estimated based on the consumed read and write capacity of your table and global secondary * indexes over the past 30 minutes. *

    *
      *
    • *

      * 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. When switching * from pay-per-request to provisioned capacity, initial provisioned capacity values must be set. The * initial provisioned capacity values are estimated based on the consumed read and write capacity of your * table and global secondary indexes over the past 30 minutes.

    *
      *
    • *

      * 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 String billingModeAsString() { return billingMode; } /** *

      * The new provisioned throughput settings for the specified table or index. *

      * * @return The new provisioned throughput settings for the specified table or index. */ public ProvisionedThroughput provisionedThroughput() { return provisionedThroughput; } /** * Returns true if the GlobalSecondaryIndexUpdates 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 boolean hasGlobalSecondaryIndexUpdates() { return globalSecondaryIndexUpdates != null && !(globalSecondaryIndexUpdates instanceof SdkAutoConstructList); } /** *

      * An array of one or more global secondary indexes for the table. For each index in the array, you can request one * action: *

      *
        *
      • *

        * Create - add a new global secondary index to the table. *

        *
      • *
      • *

        * Update - modify the provisioned throughput settings of an existing global secondary index. *

        *
      • *
      • *

        * Delete - remove a global secondary index from the table. *

        *
      • *
      *

      * You can create or delete only one global secondary index per UpdateTable operation. *

      *

      * For more information, see Managing Global * Secondary Indexes in the Amazon DynamoDB Developer Guide. *

      *

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

      *

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

      * * @return An array of one or more global secondary indexes for the table. For each index in the array, you can * request one action:

      *
        *
      • *

        * Create - add a new global secondary index to the table. *

        *
      • *
      • *

        * Update - modify the provisioned throughput settings of an existing global secondary index. *

        *
      • *
      • *

        * Delete - remove a global secondary index from the table. *

        *
      • *
      *

      * You can create or delete only one global secondary index per UpdateTable operation. *

      *

      * For more information, see Managing * Global Secondary Indexes in the Amazon DynamoDB Developer Guide. */ public List globalSecondaryIndexUpdates() { return globalSecondaryIndexUpdates; } /** *

      * Represents the DynamoDB Streams configuration for the table. *

      * *

      * You receive a ResourceInUseException if you try to enable a stream on a table that already has a * stream, or if you try to disable a stream on a table that doesn't have a stream. *

      *
      * * @return Represents the DynamoDB Streams configuration for the table.

      *

      * You receive a ResourceInUseException if you try to enable a stream on a table that already * has a stream, or if you try to disable a stream on a table that doesn't have a stream. *

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

      * The new server-side encryption settings for the specified table. *

      * * @return The new server-side encryption settings for the specified table. */ public SSESpecification sseSpecification() { return sseSpecification; } /** * Returns true if the ReplicaUpdates 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 boolean hasReplicaUpdates() { return replicaUpdates != null && !(replicaUpdates instanceof SdkAutoConstructList); } /** *

      * A list of replica update actions (create, delete, or update) for the table. *

      * *

      * This property only applies to Version * 2019.11.21 of global tables. *

      *
      *

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

      *

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

      * * @return A list of replica update actions (create, delete, or update) for the table.

      *

      * This property only applies to Version * 2019.11.21 of global tables. *

      */ public List replicaUpdates() { return replicaUpdates; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(attributeDefinitions()); hashCode = 31 * hashCode + Objects.hashCode(tableName()); hashCode = 31 * hashCode + Objects.hashCode(billingModeAsString()); hashCode = 31 * hashCode + Objects.hashCode(provisionedThroughput()); hashCode = 31 * hashCode + Objects.hashCode(globalSecondaryIndexUpdates()); hashCode = 31 * hashCode + Objects.hashCode(streamSpecification()); hashCode = 31 * hashCode + Objects.hashCode(sseSpecification()); hashCode = 31 * hashCode + Objects.hashCode(replicaUpdates()); return hashCode; } @Override public boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof UpdateTableRequest)) { return false; } UpdateTableRequest other = (UpdateTableRequest) obj; return Objects.equals(attributeDefinitions(), other.attributeDefinitions()) && Objects.equals(tableName(), other.tableName()) && Objects.equals(billingModeAsString(), other.billingModeAsString()) && Objects.equals(provisionedThroughput(), other.provisionedThroughput()) && Objects.equals(globalSecondaryIndexUpdates(), other.globalSecondaryIndexUpdates()) && Objects.equals(streamSpecification(), other.streamSpecification()) && Objects.equals(sseSpecification(), other.sseSpecification()) && Objects.equals(replicaUpdates(), other.replicaUpdates()); } /** * 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 String toString() { return ToString.builder("UpdateTableRequest").add("AttributeDefinitions", attributeDefinitions()) .add("TableName", tableName()).add("BillingMode", billingModeAsString()) .add("ProvisionedThroughput", provisionedThroughput()) .add("GlobalSecondaryIndexUpdates", globalSecondaryIndexUpdates()) .add("StreamSpecification", streamSpecification()).add("SSESpecification", sseSpecification()) .add("ReplicaUpdates", replicaUpdates()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "AttributeDefinitions": return Optional.ofNullable(clazz.cast(attributeDefinitions())); case "TableName": return Optional.ofNullable(clazz.cast(tableName())); case "BillingMode": return Optional.ofNullable(clazz.cast(billingModeAsString())); case "ProvisionedThroughput": return Optional.ofNullable(clazz.cast(provisionedThroughput())); case "GlobalSecondaryIndexUpdates": return Optional.ofNullable(clazz.cast(globalSecondaryIndexUpdates())); case "StreamSpecification": return Optional.ofNullable(clazz.cast(streamSpecification())); case "SSESpecification": return Optional.ofNullable(clazz.cast(sseSpecification())); case "ReplicaUpdates": return Optional.ofNullable(clazz.cast(replicaUpdates())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((UpdateTableRequest) 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. If you are adding a new global * secondary index to the table, AttributeDefinitions must include the key element(s) of the new * index. *

      * * @param attributeDefinitions * An array of attributes that describe the key schema for the table and indexes. If you are adding a new * global secondary index to the table, AttributeDefinitions must include the key element(s) * of the new index. * @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. If you are adding a new global * secondary index to the table, AttributeDefinitions must include the key element(s) of the new * index. *

      * * @param attributeDefinitions * An array of attributes that describe the key schema for the table and indexes. If you are adding a new * global secondary index to the table, AttributeDefinitions must include the key element(s) * of the new index. * @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. If you are adding a new global * secondary index to the table, AttributeDefinitions must include the key element(s) of the new * index. *

      * 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 be updated. *

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

      * Controls how you are charged for read and write throughput and how you manage capacity. When switching from * pay-per-request to provisioned capacity, initial provisioned capacity values must be set. The initial * provisioned capacity values are estimated based on the consumed read and write capacity of your table and * global secondary indexes over the past 30 minutes. *

      *
        *
      • *

        * 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. When switching * from pay-per-request to provisioned capacity, initial provisioned capacity values must be set. The * initial provisioned capacity values are estimated based on the consumed read and write capacity of * your table and global secondary indexes over the past 30 minutes.

      *
        *
      • *

        * 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. When switching from * pay-per-request to provisioned capacity, initial provisioned capacity values must be set. The initial * provisioned capacity values are estimated based on the consumed read and write capacity of your table and * global secondary indexes over the past 30 minutes. *

        *
          *
        • *

          * 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. When switching * from pay-per-request to provisioned capacity, initial provisioned capacity values must be set. The * initial provisioned capacity values are estimated based on the consumed read and write capacity of * your table and global secondary indexes over the past 30 minutes.

        *
          *
        • *

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

          * The new provisioned throughput settings for the specified table or index. *

          * * @param provisionedThroughput * The new provisioned throughput settings for the specified table or index. * @return Returns a reference to this object so that method calls can be chained together. */ Builder provisionedThroughput(ProvisionedThroughput provisionedThroughput); /** *

          * The new provisioned throughput settings for the specified table or index. *

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

          * An array of one or more global secondary indexes for the table. For each index in the array, you can request * one action: *

          *
            *
          • *

            * Create - add a new global secondary index to the table. *

            *
          • *
          • *

            * Update - modify the provisioned throughput settings of an existing global secondary index. *

            *
          • *
          • *

            * Delete - remove a global secondary index from the table. *

            *
          • *
          *

          * You can create or delete only one global secondary index per UpdateTable operation. *

          *

          * For more information, see Managing Global * Secondary Indexes in the Amazon DynamoDB Developer Guide. *

          * * @param globalSecondaryIndexUpdates * An array of one or more global secondary indexes for the table. For each index in the array, you can * request one action:

          *
            *
          • *

            * Create - add a new global secondary index to the table. *

            *
          • *
          • *

            * Update - modify the provisioned throughput settings of an existing global secondary * index. *

            *
          • *
          • *

            * Delete - remove a global secondary index from the table. *

            *
          • *
          *

          * You can create or delete only one global secondary index per UpdateTable operation. *

          *

          * For more information, see Managing * Global Secondary Indexes in the Amazon DynamoDB Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder globalSecondaryIndexUpdates(Collection globalSecondaryIndexUpdates); /** *

          * An array of one or more global secondary indexes for the table. For each index in the array, you can request * one action: *

          *
            *
          • *

            * Create - add a new global secondary index to the table. *

            *
          • *
          • *

            * Update - modify the provisioned throughput settings of an existing global secondary index. *

            *
          • *
          • *

            * Delete - remove a global secondary index from the table. *

            *
          • *
          *

          * You can create or delete only one global secondary index per UpdateTable operation. *

          *

          * For more information, see Managing Global * Secondary Indexes in the Amazon DynamoDB Developer Guide. *

          * * @param globalSecondaryIndexUpdates * An array of one or more global secondary indexes for the table. For each index in the array, you can * request one action:

          *
            *
          • *

            * Create - add a new global secondary index to the table. *

            *
          • *
          • *

            * Update - modify the provisioned throughput settings of an existing global secondary * index. *

            *
          • *
          • *

            * Delete - remove a global secondary index from the table. *

            *
          • *
          *

          * You can create or delete only one global secondary index per UpdateTable operation. *

          *

          * For more information, see Managing * Global Secondary Indexes in the Amazon DynamoDB Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder globalSecondaryIndexUpdates(GlobalSecondaryIndexUpdate... globalSecondaryIndexUpdates); /** *

          * An array of one or more global secondary indexes for the table. For each index in the array, you can request * one action: *

          *
            *
          • *

            * Create - add a new global secondary index to the table. *

            *
          • *
          • *

            * Update - modify the provisioned throughput settings of an existing global secondary index. *

            *
          • *
          • *

            * Delete - remove a global secondary index from the table. *

            *
          • *
          *

          * You can create or delete only one global secondary index per UpdateTable operation. *

          *

          * For more information, see Managing Global * Secondary Indexes 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 * #globalSecondaryIndexUpdates(List)}. * * @param globalSecondaryIndexUpdates * 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 #globalSecondaryIndexUpdates(List) */ Builder globalSecondaryIndexUpdates(Consumer... globalSecondaryIndexUpdates); /** *

          * Represents the DynamoDB Streams configuration for the table. *

          * *

          * You receive a ResourceInUseException if you try to enable a stream on a table that already has a * stream, or if you try to disable a stream on a table that doesn't have a stream. *

          *
          * * @param streamSpecification * Represents the DynamoDB Streams configuration for the table.

          *

          * You receive a ResourceInUseException if you try to enable a stream on a table that * already has a stream, or if you try to disable a stream on a table that doesn't have a stream. *

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

          * Represents the DynamoDB Streams configuration for the table. *

          * *

          * You receive a ResourceInUseException if you try to enable a stream on a table that already has a * stream, or if you try to disable a stream on a table that doesn't have a 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()); } /** *

          * The new server-side encryption settings for the specified table. *

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

          * The new server-side encryption settings for the specified table. *

          * 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 replica update actions (create, delete, or update) for the table. *

          * *

          * This property only applies to Version * 2019.11.21 of global tables. *

          *
          * * @param replicaUpdates * A list of replica update actions (create, delete, or update) for the table.

          *

          * This property only applies to Version * 2019.11.21 of global tables. *

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

          * A list of replica update actions (create, delete, or update) for the table. *

          * *

          * This property only applies to Version * 2019.11.21 of global tables. *

          *
          * * @param replicaUpdates * A list of replica update actions (create, delete, or update) for the table.

          *

          * This property only applies to Version * 2019.11.21 of global tables. *

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

          * A list of replica update actions (create, delete, or update) for the table. *

          * *

          * This property only applies to Version * 2019.11.21 of global tables. *

          *
          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 #replicaUpdates(List)}. * * @param replicaUpdates * 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 #replicaUpdates(List) */ Builder replicaUpdates(Consumer... replicaUpdates); @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 String billingMode; private ProvisionedThroughput provisionedThroughput; private List globalSecondaryIndexUpdates = DefaultSdkAutoConstructList.getInstance(); private StreamSpecification streamSpecification; private SSESpecification sseSpecification; private List replicaUpdates = DefaultSdkAutoConstructList.getInstance(); private BuilderImpl() { } private BuilderImpl(UpdateTableRequest model) { super(model); attributeDefinitions(model.attributeDefinitions); tableName(model.tableName); billingMode(model.billingMode); provisionedThroughput(model.provisionedThroughput); globalSecondaryIndexUpdates(model.globalSecondaryIndexUpdates); streamSpecification(model.streamSpecification); sseSpecification(model.sseSpecification); replicaUpdates(model.replicaUpdates); } public final Collection getAttributeDefinitions() { return attributeDefinitions != null ? attributeDefinitions.stream().map(AttributeDefinition::toBuilder) .collect(Collectors.toList()) : null; } @Override public final Builder attributeDefinitions(Collection attributeDefinitions) { this.attributeDefinitions = AttributeDefinitionsCopier.copy(attributeDefinitions); return this; } @Override @SafeVarargs public final Builder attributeDefinitions(AttributeDefinition... attributeDefinitions) { attributeDefinitions(Arrays.asList(attributeDefinitions)); return this; } @Override @SafeVarargs public final Builder attributeDefinitions(Consumer... attributeDefinitions) { attributeDefinitions(Stream.of(attributeDefinitions).map(c -> AttributeDefinition.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final void setAttributeDefinitions(Collection attributeDefinitions) { this.attributeDefinitions = AttributeDefinitionsCopier.copyFromBuilder(attributeDefinitions); } public final String getTableName() { return tableName; } @Override public final Builder tableName(String tableName) { this.tableName = tableName; return this; } public final void setTableName(String tableName) { this.tableName = tableName; } public final 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 Collection getGlobalSecondaryIndexUpdates() { return globalSecondaryIndexUpdates != null ? globalSecondaryIndexUpdates.stream() .map(GlobalSecondaryIndexUpdate::toBuilder).collect(Collectors.toList()) : null; } @Override public final Builder globalSecondaryIndexUpdates(Collection globalSecondaryIndexUpdates) { this.globalSecondaryIndexUpdates = GlobalSecondaryIndexUpdateListCopier.copy(globalSecondaryIndexUpdates); return this; } @Override @SafeVarargs public final Builder globalSecondaryIndexUpdates(GlobalSecondaryIndexUpdate... globalSecondaryIndexUpdates) { globalSecondaryIndexUpdates(Arrays.asList(globalSecondaryIndexUpdates)); return this; } @Override @SafeVarargs public final Builder globalSecondaryIndexUpdates( Consumer... globalSecondaryIndexUpdates) { globalSecondaryIndexUpdates(Stream.of(globalSecondaryIndexUpdates) .map(c -> GlobalSecondaryIndexUpdate.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final void setGlobalSecondaryIndexUpdates( Collection globalSecondaryIndexUpdates) { this.globalSecondaryIndexUpdates = GlobalSecondaryIndexUpdateListCopier.copyFromBuilder(globalSecondaryIndexUpdates); } 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 getReplicaUpdates() { return replicaUpdates != null ? replicaUpdates.stream().map(ReplicationGroupUpdate::toBuilder) .collect(Collectors.toList()) : null; } @Override public final Builder replicaUpdates(Collection replicaUpdates) { this.replicaUpdates = ReplicationGroupUpdateListCopier.copy(replicaUpdates); return this; } @Override @SafeVarargs public final Builder replicaUpdates(ReplicationGroupUpdate... replicaUpdates) { replicaUpdates(Arrays.asList(replicaUpdates)); return this; } @Override @SafeVarargs public final Builder replicaUpdates(Consumer... replicaUpdates) { replicaUpdates(Stream.of(replicaUpdates).map(c -> ReplicationGroupUpdate.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final void setReplicaUpdates(Collection replicaUpdates) { this.replicaUpdates = ReplicationGroupUpdateListCopier.copyFromBuilder(replicaUpdates); } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public UpdateTableRequest build() { return new UpdateTableRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy