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

software.amazon.awssdk.services.elasticache.model.ModifyGlobalReplicationGroupRequest Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.29.39
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.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 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 getter(Function g) { return obj -> g.apply((ModifyGlobalReplicationGroupRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends ElastiCacheRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The name of the Global datastore *

* * @param globalReplicationGroupId * The name of the Global datastore * @return Returns a reference to this object so that method calls can be chained together. */ Builder globalReplicationGroupId(String 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. *

* * @param applyImmediately * 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 Returns a reference to this object so that method calls can be chained together. */ Builder applyImmediately(Boolean applyImmediately); /** *

* A valid cache node type that you want to scale this Global datastore to. *

* * @param cacheNodeType * A valid cache node type that you want to scale this Global datastore to. * @return Returns a reference to this object so that method calls can be chained together. */ Builder cacheNodeType(String cacheNodeType); /** *

* The upgraded version of the cache engine to be run on the clusters in the Global datastore. *

* * @param engineVersion * The upgraded version of the cache engine to be run on the clusters in the Global datastore. * @return Returns a reference to this object so that method calls can be chained together. */ Builder engineVersion(String 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. *

* * @param cacheParameterGroupName * 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 Returns a reference to this object so that method calls can be chained together. */ Builder cacheParameterGroupName(String cacheParameterGroupName); /** *

* A description of the Global datastore *

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

* Determines whether a read replica is automatically promoted to read/write primary if the existing primary * encounters a failure. *

* * @param automaticFailoverEnabled * Determines whether a read replica is automatically promoted to read/write primary if the existing * primary encounters a failure. * @return Returns a reference to this object so that method calls can be chained together. */ Builder automaticFailoverEnabled(Boolean automaticFailoverEnabled); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends ElastiCacheRequest.BuilderImpl implements Builder { private String globalReplicationGroupId; private Boolean applyImmediately; private String cacheNodeType; private String engineVersion; private String cacheParameterGroupName; private String globalReplicationGroupDescription; private Boolean automaticFailoverEnabled; private BuilderImpl() { } private BuilderImpl(ModifyGlobalReplicationGroupRequest model) { super(model); globalReplicationGroupId(model.globalReplicationGroupId); applyImmediately(model.applyImmediately); cacheNodeType(model.cacheNodeType); engineVersion(model.engineVersion); cacheParameterGroupName(model.cacheParameterGroupName); globalReplicationGroupDescription(model.globalReplicationGroupDescription); automaticFailoverEnabled(model.automaticFailoverEnabled); } public final String getGlobalReplicationGroupId() { return globalReplicationGroupId; } public final void setGlobalReplicationGroupId(String globalReplicationGroupId) { this.globalReplicationGroupId = globalReplicationGroupId; } @Override public final Builder globalReplicationGroupId(String globalReplicationGroupId) { this.globalReplicationGroupId = globalReplicationGroupId; return this; } public final Boolean getApplyImmediately() { return applyImmediately; } public final void setApplyImmediately(Boolean applyImmediately) { this.applyImmediately = applyImmediately; } @Override public final Builder applyImmediately(Boolean applyImmediately) { this.applyImmediately = applyImmediately; return this; } public final String getCacheNodeType() { return cacheNodeType; } public final void setCacheNodeType(String cacheNodeType) { this.cacheNodeType = cacheNodeType; } @Override public final Builder cacheNodeType(String cacheNodeType) { this.cacheNodeType = cacheNodeType; return this; } public final String getEngineVersion() { return engineVersion; } public final void setEngineVersion(String engineVersion) { this.engineVersion = engineVersion; } @Override public final Builder engineVersion(String engineVersion) { this.engineVersion = engineVersion; return this; } public final String getCacheParameterGroupName() { return cacheParameterGroupName; } public final void setCacheParameterGroupName(String cacheParameterGroupName) { this.cacheParameterGroupName = cacheParameterGroupName; } @Override public final Builder cacheParameterGroupName(String cacheParameterGroupName) { this.cacheParameterGroupName = cacheParameterGroupName; return this; } public final String getGlobalReplicationGroupDescription() { return globalReplicationGroupDescription; } public final void setGlobalReplicationGroupDescription(String globalReplicationGroupDescription) { this.globalReplicationGroupDescription = globalReplicationGroupDescription; } @Override public final Builder globalReplicationGroupDescription(String globalReplicationGroupDescription) { this.globalReplicationGroupDescription = globalReplicationGroupDescription; return this; } public final Boolean getAutomaticFailoverEnabled() { return automaticFailoverEnabled; } public final void setAutomaticFailoverEnabled(Boolean automaticFailoverEnabled) { this.automaticFailoverEnabled = automaticFailoverEnabled; } @Override public final Builder automaticFailoverEnabled(Boolean automaticFailoverEnabled) { this.automaticFailoverEnabled = automaticFailoverEnabled; return this; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public ModifyGlobalReplicationGroupRequest build() { return new ModifyGlobalReplicationGroupRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy