software.amazon.awssdk.services.dax.model.UpdateClusterRequest Maven / Gradle / Ivy
Show all versions of dax Show documentation
/*
* 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 extends Builder> 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