software.amazon.awssdk.services.elasticache.model.ModifyGlobalReplicationGroupRequest Maven / Gradle / Ivy
Show all versions of elasticache 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.elasticache.model;
import java.util.Arrays;
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.LocationTrait;
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 ModifyGlobalReplicationGroupRequest extends ElastiCacheRequest implements
ToCopyableBuilder {
private static final SdkField GLOBAL_REPLICATION_GROUP_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("GlobalReplicationGroupId").getter(getter(ModifyGlobalReplicationGroupRequest::globalReplicationGroupId))
.setter(setter(Builder::globalReplicationGroupId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GlobalReplicationGroupId").build())
.build();
private static final SdkField APPLY_IMMEDIATELY_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("ApplyImmediately").getter(getter(ModifyGlobalReplicationGroupRequest::applyImmediately))
.setter(setter(Builder::applyImmediately))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ApplyImmediately").build()).build();
private static final SdkField CACHE_NODE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CacheNodeType").getter(getter(ModifyGlobalReplicationGroupRequest::cacheNodeType))
.setter(setter(Builder::cacheNodeType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CacheNodeType").build()).build();
private static final SdkField ENGINE_VERSION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EngineVersion").getter(getter(ModifyGlobalReplicationGroupRequest::engineVersion))
.setter(setter(Builder::engineVersion))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EngineVersion").build()).build();
private static final SdkField CACHE_PARAMETER_GROUP_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CacheParameterGroupName").getter(getter(ModifyGlobalReplicationGroupRequest::cacheParameterGroupName))
.setter(setter(Builder::cacheParameterGroupName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CacheParameterGroupName").build())
.build();
private static final SdkField GLOBAL_REPLICATION_GROUP_DESCRIPTION_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("GlobalReplicationGroupDescription")
.getter(getter(ModifyGlobalReplicationGroupRequest::globalReplicationGroupDescription))
.setter(setter(Builder::globalReplicationGroupDescription))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GlobalReplicationGroupDescription")
.build()).build();
private static final SdkField AUTOMATIC_FAILOVER_ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("AutomaticFailoverEnabled").getter(getter(ModifyGlobalReplicationGroupRequest::automaticFailoverEnabled))
.setter(setter(Builder::automaticFailoverEnabled))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AutomaticFailoverEnabled").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
GLOBAL_REPLICATION_GROUP_ID_FIELD, APPLY_IMMEDIATELY_FIELD, CACHE_NODE_TYPE_FIELD, ENGINE_VERSION_FIELD,
CACHE_PARAMETER_GROUP_NAME_FIELD, GLOBAL_REPLICATION_GROUP_DESCRIPTION_FIELD, AUTOMATIC_FAILOVER_ENABLED_FIELD));
private final String globalReplicationGroupId;
private final Boolean applyImmediately;
private final String cacheNodeType;
private final String engineVersion;
private final String cacheParameterGroupName;
private final String globalReplicationGroupDescription;
private final Boolean automaticFailoverEnabled;
private ModifyGlobalReplicationGroupRequest(BuilderImpl builder) {
super(builder);
this.globalReplicationGroupId = builder.globalReplicationGroupId;
this.applyImmediately = builder.applyImmediately;
this.cacheNodeType = builder.cacheNodeType;
this.engineVersion = builder.engineVersion;
this.cacheParameterGroupName = builder.cacheParameterGroupName;
this.globalReplicationGroupDescription = builder.globalReplicationGroupDescription;
this.automaticFailoverEnabled = builder.automaticFailoverEnabled;
}
/**
*
* The name of the Global datastore
*
*
* @return The name of the Global datastore
*/
public final String globalReplicationGroupId() {
return globalReplicationGroupId;
}
/**
*
* This parameter causes the modifications in this request and any pending modifications to be applied,
* asynchronously and as soon as possible. Modifications to Global Replication Groups cannot be requested to be
* applied in PreferredMaintenceWindow.
*
*
* @return This parameter causes the modifications in this request and any pending modifications to be applied,
* asynchronously and as soon as possible. Modifications to Global Replication Groups cannot be requested to
* be applied in PreferredMaintenceWindow.
*/
public final Boolean applyImmediately() {
return applyImmediately;
}
/**
*
* A valid cache node type that you want to scale this Global datastore to.
*
*
* @return A valid cache node type that you want to scale this Global datastore to.
*/
public final String cacheNodeType() {
return cacheNodeType;
}
/**
*
* The upgraded version of the cache engine to be run on the clusters in the Global datastore.
*
*
* @return The upgraded version of the cache engine to be run on the clusters in the Global datastore.
*/
public final String engineVersion() {
return engineVersion;
}
/**
*
* The name of the cache parameter group to use with the Global datastore. It must be compatible with the major
* engine version used by the Global datastore.
*
*
* @return The name of the cache parameter group to use with the Global datastore. It must be compatible with the
* major engine version used by the Global datastore.
*/
public final String cacheParameterGroupName() {
return cacheParameterGroupName;
}
/**
*
* A description of the Global datastore
*
*
* @return A description of the Global datastore
*/
public final String globalReplicationGroupDescription() {
return globalReplicationGroupDescription;
}
/**
*
* Determines whether a read replica is automatically promoted to read/write primary if the existing primary
* encounters a failure.
*
*
* @return Determines whether a read replica is automatically promoted to read/write primary if the existing primary
* encounters a failure.
*/
public final Boolean automaticFailoverEnabled() {
return automaticFailoverEnabled;
}
@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(globalReplicationGroupId());
hashCode = 31 * hashCode + Objects.hashCode(applyImmediately());
hashCode = 31 * hashCode + Objects.hashCode(cacheNodeType());
hashCode = 31 * hashCode + Objects.hashCode(engineVersion());
hashCode = 31 * hashCode + Objects.hashCode(cacheParameterGroupName());
hashCode = 31 * hashCode + Objects.hashCode(globalReplicationGroupDescription());
hashCode = 31 * hashCode + Objects.hashCode(automaticFailoverEnabled());
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 ModifyGlobalReplicationGroupRequest)) {
return false;
}
ModifyGlobalReplicationGroupRequest other = (ModifyGlobalReplicationGroupRequest) obj;
return Objects.equals(globalReplicationGroupId(), other.globalReplicationGroupId())
&& Objects.equals(applyImmediately(), other.applyImmediately())
&& Objects.equals(cacheNodeType(), other.cacheNodeType())
&& Objects.equals(engineVersion(), other.engineVersion())
&& Objects.equals(cacheParameterGroupName(), other.cacheParameterGroupName())
&& Objects.equals(globalReplicationGroupDescription(), other.globalReplicationGroupDescription())
&& Objects.equals(automaticFailoverEnabled(), other.automaticFailoverEnabled());
}
/**
* 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("ModifyGlobalReplicationGroupRequest")
.add("GlobalReplicationGroupId", globalReplicationGroupId()).add("ApplyImmediately", applyImmediately())
.add("CacheNodeType", cacheNodeType()).add("EngineVersion", engineVersion())
.add("CacheParameterGroupName", cacheParameterGroupName())
.add("GlobalReplicationGroupDescription", globalReplicationGroupDescription())
.add("AutomaticFailoverEnabled", automaticFailoverEnabled()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "GlobalReplicationGroupId":
return Optional.ofNullable(clazz.cast(globalReplicationGroupId()));
case "ApplyImmediately":
return Optional.ofNullable(clazz.cast(applyImmediately()));
case "CacheNodeType":
return Optional.ofNullable(clazz.cast(cacheNodeType()));
case "EngineVersion":
return Optional.ofNullable(clazz.cast(engineVersion()));
case "CacheParameterGroupName":
return Optional.ofNullable(clazz.cast(cacheParameterGroupName()));
case "GlobalReplicationGroupDescription":
return Optional.ofNullable(clazz.cast(globalReplicationGroupDescription()));
case "AutomaticFailoverEnabled":
return Optional.ofNullable(clazz.cast(automaticFailoverEnabled()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function