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

software.amazon.awssdk.services.dax.model.UpdateClusterRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon DynamoDB Accelerator (DAX) module holds the client classes that are used for communicating with Amazon DynamoDB Accelerator (DAX).

There is a newer version: 2.29.15
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.dax.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 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;

/**
 */
@Generated("software.amazon.awssdk:codegen")
public final class UpdateClusterRequest extends DaxRequest implements
        ToCopyableBuilder {
    private static final SdkField CLUSTER_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ClusterName").getter(getter(UpdateClusterRequest::clusterName)).setter(setter(Builder::clusterName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ClusterName").build()).build();

    private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("Description").getter(getter(UpdateClusterRequest::description)).setter(setter(Builder::description))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();

    private static final SdkField PREFERRED_MAINTENANCE_WINDOW_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("PreferredMaintenanceWindow")
            .getter(getter(UpdateClusterRequest::preferredMaintenanceWindow))
            .setter(setter(Builder::preferredMaintenanceWindow))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PreferredMaintenanceWindow").build())
            .build();

    private static final SdkField NOTIFICATION_TOPIC_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("NotificationTopicArn").getter(getter(UpdateClusterRequest::notificationTopicArn))
            .setter(setter(Builder::notificationTopicArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NotificationTopicArn").build())
            .build();

    private static final SdkField NOTIFICATION_TOPIC_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("NotificationTopicStatus").getter(getter(UpdateClusterRequest::notificationTopicStatus))
            .setter(setter(Builder::notificationTopicStatus))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NotificationTopicStatus").build())
            .build();

    private static final SdkField PARAMETER_GROUP_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ParameterGroupName").getter(getter(UpdateClusterRequest::parameterGroupName))
            .setter(setter(Builder::parameterGroupName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ParameterGroupName").build())
            .build();

    private static final SdkField> SECURITY_GROUP_IDS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("SecurityGroupIds")
            .getter(getter(UpdateClusterRequest::securityGroupIds))
            .setter(setter(Builder::securityGroupIds))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SecurityGroupIds").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CLUSTER_NAME_FIELD,
            DESCRIPTION_FIELD, PREFERRED_MAINTENANCE_WINDOW_FIELD, NOTIFICATION_TOPIC_ARN_FIELD, NOTIFICATION_TOPIC_STATUS_FIELD,
            PARAMETER_GROUP_NAME_FIELD, SECURITY_GROUP_IDS_FIELD));

    private final String clusterName;

    private final String description;

    private final String preferredMaintenanceWindow;

    private final String notificationTopicArn;

    private final String notificationTopicStatus;

    private final String parameterGroupName;

    private final List securityGroupIds;

    private UpdateClusterRequest(BuilderImpl builder) {
        super(builder);
        this.clusterName = builder.clusterName;
        this.description = builder.description;
        this.preferredMaintenanceWindow = builder.preferredMaintenanceWindow;
        this.notificationTopicArn = builder.notificationTopicArn;
        this.notificationTopicStatus = builder.notificationTopicStatus;
        this.parameterGroupName = builder.parameterGroupName;
        this.securityGroupIds = builder.securityGroupIds;
    }

    /**
     * 

* The name of the DAX cluster to be modified. *

* * @return The name of the DAX cluster to be modified. */ public final String clusterName() { return clusterName; } /** *

* A description of the changes being made to the cluster. *

* * @return A description of the changes being made to the cluster. */ public final String description() { return description; } /** *

* A range of time when maintenance of DAX cluster software will be performed. For example: * sun:01:00-sun:09:00. Cluster maintenance normally takes less than 30 minutes, and is performed * automatically within the maintenance window. *

* * @return A range of time when maintenance of DAX cluster software will be performed. For example: * sun:01:00-sun:09:00. Cluster maintenance normally takes less than 30 minutes, and is * performed automatically within the maintenance window. */ public final String preferredMaintenanceWindow() { return preferredMaintenanceWindow; } /** *

* The Amazon Resource Name (ARN) that identifies the topic. *

* * @return The Amazon Resource Name (ARN) that identifies the topic. */ public final String notificationTopicArn() { return notificationTopicArn; } /** *

* The current state of the topic. *

* * @return The current state of the topic. */ public final String notificationTopicStatus() { return notificationTopicStatus; } /** *

* The name of a parameter group for this cluster. *

* * @return The name of a parameter group for this cluster. */ public final String parameterGroupName() { return parameterGroupName; } /** * Returns true if the SecurityGroupIds 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 hasSecurityGroupIds() { return securityGroupIds != null && !(securityGroupIds instanceof SdkAutoConstructList); } /** *

* A list of user-specified security group IDs to be assigned to each node in the DAX cluster. If this parameter is * not specified, DAX assigns the default VPC security group to each node. *

*

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

*

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

* * @return A list of user-specified security group IDs to be assigned to each node in the DAX cluster. If this * parameter is not specified, DAX assigns the default VPC security group to each node. */ public final List securityGroupIds() { return securityGroupIds; } @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(clusterName()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(preferredMaintenanceWindow()); hashCode = 31 * hashCode + Objects.hashCode(notificationTopicArn()); hashCode = 31 * hashCode + Objects.hashCode(notificationTopicStatus()); hashCode = 31 * hashCode + Objects.hashCode(parameterGroupName()); hashCode = 31 * hashCode + Objects.hashCode(hasSecurityGroupIds() ? securityGroupIds() : 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 UpdateClusterRequest)) { return false; } UpdateClusterRequest other = (UpdateClusterRequest) obj; return Objects.equals(clusterName(), other.clusterName()) && Objects.equals(description(), other.description()) && Objects.equals(preferredMaintenanceWindow(), other.preferredMaintenanceWindow()) && Objects.equals(notificationTopicArn(), other.notificationTopicArn()) && Objects.equals(notificationTopicStatus(), other.notificationTopicStatus()) && Objects.equals(parameterGroupName(), other.parameterGroupName()) && hasSecurityGroupIds() == other.hasSecurityGroupIds() && Objects.equals(securityGroupIds(), other.securityGroupIds()); } /** * 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("UpdateClusterRequest").add("ClusterName", clusterName()).add("Description", description()) .add("PreferredMaintenanceWindow", preferredMaintenanceWindow()) .add("NotificationTopicArn", notificationTopicArn()).add("NotificationTopicStatus", notificationTopicStatus()) .add("ParameterGroupName", parameterGroupName()) .add("SecurityGroupIds", hasSecurityGroupIds() ? securityGroupIds() : null).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ClusterName": return Optional.ofNullable(clazz.cast(clusterName())); case "Description": return Optional.ofNullable(clazz.cast(description())); case "PreferredMaintenanceWindow": return Optional.ofNullable(clazz.cast(preferredMaintenanceWindow())); case "NotificationTopicArn": return Optional.ofNullable(clazz.cast(notificationTopicArn())); case "NotificationTopicStatus": return Optional.ofNullable(clazz.cast(notificationTopicStatus())); case "ParameterGroupName": return Optional.ofNullable(clazz.cast(parameterGroupName())); case "SecurityGroupIds": return Optional.ofNullable(clazz.cast(securityGroupIds())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((UpdateClusterRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends DaxRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The name of the DAX cluster to be modified. *

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

* A description of the changes being made to the cluster. *

* * @param description * A description of the changes being made to the cluster. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

* A range of time when maintenance of DAX cluster software will be performed. For example: * sun:01:00-sun:09:00. Cluster maintenance normally takes less than 30 minutes, and is performed * automatically within the maintenance window. *

* * @param preferredMaintenanceWindow * A range of time when maintenance of DAX cluster software will be performed. For example: * sun:01:00-sun:09:00. Cluster maintenance normally takes less than 30 minutes, and is * performed automatically within the maintenance window. * @return Returns a reference to this object so that method calls can be chained together. */ Builder preferredMaintenanceWindow(String preferredMaintenanceWindow); /** *

* The Amazon Resource Name (ARN) that identifies the topic. *

* * @param notificationTopicArn * The Amazon Resource Name (ARN) that identifies the topic. * @return Returns a reference to this object so that method calls can be chained together. */ Builder notificationTopicArn(String notificationTopicArn); /** *

* The current state of the topic. *

* * @param notificationTopicStatus * The current state of the topic. * @return Returns a reference to this object so that method calls can be chained together. */ Builder notificationTopicStatus(String notificationTopicStatus); /** *

* The name of a parameter group for this cluster. *

* * @param parameterGroupName * The name of a parameter group for this cluster. * @return Returns a reference to this object so that method calls can be chained together. */ Builder parameterGroupName(String parameterGroupName); /** *

* A list of user-specified security group IDs to be assigned to each node in the DAX cluster. If this parameter * is not specified, DAX assigns the default VPC security group to each node. *

* * @param securityGroupIds * A list of user-specified security group IDs to be assigned to each node in the DAX cluster. If this * parameter is not specified, DAX assigns the default VPC security group to each node. * @return Returns a reference to this object so that method calls can be chained together. */ Builder securityGroupIds(Collection securityGroupIds); /** *

* A list of user-specified security group IDs to be assigned to each node in the DAX cluster. If this parameter * is not specified, DAX assigns the default VPC security group to each node. *

* * @param securityGroupIds * A list of user-specified security group IDs to be assigned to each node in the DAX cluster. If this * parameter is not specified, DAX assigns the default VPC security group to each node. * @return Returns a reference to this object so that method calls can be chained together. */ Builder securityGroupIds(String... securityGroupIds); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends DaxRequest.BuilderImpl implements Builder { private String clusterName; private String description; private String preferredMaintenanceWindow; private String notificationTopicArn; private String notificationTopicStatus; private String parameterGroupName; private List securityGroupIds = DefaultSdkAutoConstructList.getInstance(); private BuilderImpl() { } private BuilderImpl(UpdateClusterRequest model) { super(model); clusterName(model.clusterName); description(model.description); preferredMaintenanceWindow(model.preferredMaintenanceWindow); notificationTopicArn(model.notificationTopicArn); notificationTopicStatus(model.notificationTopicStatus); parameterGroupName(model.parameterGroupName); securityGroupIds(model.securityGroupIds); } public final String getClusterName() { return clusterName; } @Override public final Builder clusterName(String clusterName) { this.clusterName = clusterName; return this; } public final void setClusterName(String clusterName) { this.clusterName = clusterName; } public final String getDescription() { return description; } @Override public final Builder description(String description) { this.description = description; return this; } public final void setDescription(String description) { this.description = description; } public final String getPreferredMaintenanceWindow() { return preferredMaintenanceWindow; } @Override public final Builder preferredMaintenanceWindow(String preferredMaintenanceWindow) { this.preferredMaintenanceWindow = preferredMaintenanceWindow; return this; } public final void setPreferredMaintenanceWindow(String preferredMaintenanceWindow) { this.preferredMaintenanceWindow = preferredMaintenanceWindow; } public final String getNotificationTopicArn() { return notificationTopicArn; } @Override public final Builder notificationTopicArn(String notificationTopicArn) { this.notificationTopicArn = notificationTopicArn; return this; } public final void setNotificationTopicArn(String notificationTopicArn) { this.notificationTopicArn = notificationTopicArn; } public final String getNotificationTopicStatus() { return notificationTopicStatus; } @Override public final Builder notificationTopicStatus(String notificationTopicStatus) { this.notificationTopicStatus = notificationTopicStatus; return this; } public final void setNotificationTopicStatus(String notificationTopicStatus) { this.notificationTopicStatus = notificationTopicStatus; } public final String getParameterGroupName() { return parameterGroupName; } @Override public final Builder parameterGroupName(String parameterGroupName) { this.parameterGroupName = parameterGroupName; return this; } public final void setParameterGroupName(String parameterGroupName) { this.parameterGroupName = parameterGroupName; } public final Collection getSecurityGroupIds() { if (securityGroupIds instanceof SdkAutoConstructList) { return null; } return securityGroupIds; } @Override public final Builder securityGroupIds(Collection securityGroupIds) { this.securityGroupIds = SecurityGroupIdentifierListCopier.copy(securityGroupIds); return this; } @Override @SafeVarargs public final Builder securityGroupIds(String... securityGroupIds) { securityGroupIds(Arrays.asList(securityGroupIds)); return this; } public final void setSecurityGroupIds(Collection securityGroupIds) { this.securityGroupIds = SecurityGroupIdentifierListCopier.copy(securityGroupIds); } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public UpdateClusterRequest build() { return new UpdateClusterRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy