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

software.amazon.awssdk.services.elasticache.model.CreateGlobalReplicationGroupRequest 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 CreateGlobalReplicationGroupRequest extends ElastiCacheRequest implements
        ToCopyableBuilder {
    private static final SdkField GLOBAL_REPLICATION_GROUP_ID_SUFFIX_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("GlobalReplicationGroupIdSuffix")
            .getter(getter(CreateGlobalReplicationGroupRequest::globalReplicationGroupIdSuffix))
            .setter(setter(Builder::globalReplicationGroupIdSuffix))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GlobalReplicationGroupIdSuffix")
                    .build()).build();

    private static final SdkField GLOBAL_REPLICATION_GROUP_DESCRIPTION_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("GlobalReplicationGroupDescription")
            .getter(getter(CreateGlobalReplicationGroupRequest::globalReplicationGroupDescription))
            .setter(setter(Builder::globalReplicationGroupDescription))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GlobalReplicationGroupDescription")
                    .build()).build();

    private static final SdkField PRIMARY_REPLICATION_GROUP_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("PrimaryReplicationGroupId")
            .getter(getter(CreateGlobalReplicationGroupRequest::primaryReplicationGroupId))
            .setter(setter(Builder::primaryReplicationGroupId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PrimaryReplicationGroupId").build())
            .build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
            GLOBAL_REPLICATION_GROUP_ID_SUFFIX_FIELD, GLOBAL_REPLICATION_GROUP_DESCRIPTION_FIELD,
            PRIMARY_REPLICATION_GROUP_ID_FIELD));

    private final String globalReplicationGroupIdSuffix;

    private final String globalReplicationGroupDescription;

    private final String primaryReplicationGroupId;

    private CreateGlobalReplicationGroupRequest(BuilderImpl builder) {
        super(builder);
        this.globalReplicationGroupIdSuffix = builder.globalReplicationGroupIdSuffix;
        this.globalReplicationGroupDescription = builder.globalReplicationGroupDescription;
        this.primaryReplicationGroupId = builder.primaryReplicationGroupId;
    }

    /**
     * 

* The suffix name of a Global Datastore. Amazon ElastiCache automatically applies a prefix to the Global Datastore * ID when it is created. Each AWS Region has its own prefix. For instance, a Global Datastore ID created in the * US-West-1 region will begin with "dsdfu" along with the suffix name you provide. The suffix, combined with the * auto-generated prefix, guarantees uniqueness of the Global Datastore name across multiple regions. *

*

* For a full list of AWS Regions and their respective Global Datastore iD prefixes, see Using the AWS * CLI with Global Datastores . *

* * @return The suffix name of a Global Datastore. Amazon ElastiCache automatically applies a prefix to the Global * Datastore ID when it is created. Each AWS Region has its own prefix. For instance, a Global Datastore ID * created in the US-West-1 region will begin with "dsdfu" along with the suffix name you provide. The * suffix, combined with the auto-generated prefix, guarantees uniqueness of the Global Datastore name * across multiple regions.

*

* For a full list of AWS Regions and their respective Global Datastore iD prefixes, see Using * the AWS CLI with Global Datastores . */ public final String globalReplicationGroupIdSuffix() { return globalReplicationGroupIdSuffix; } /** *

* Provides details of the Global Datastore *

* * @return Provides details of the Global Datastore */ public final String globalReplicationGroupDescription() { return globalReplicationGroupDescription; } /** *

* The name of the primary cluster that accepts writes and will replicate updates to the secondary cluster. *

* * @return The name of the primary cluster that accepts writes and will replicate updates to the secondary cluster. */ public final String primaryReplicationGroupId() { return primaryReplicationGroupId; } @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(globalReplicationGroupIdSuffix()); hashCode = 31 * hashCode + Objects.hashCode(globalReplicationGroupDescription()); hashCode = 31 * hashCode + Objects.hashCode(primaryReplicationGroupId()); 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 CreateGlobalReplicationGroupRequest)) { return false; } CreateGlobalReplicationGroupRequest other = (CreateGlobalReplicationGroupRequest) obj; return Objects.equals(globalReplicationGroupIdSuffix(), other.globalReplicationGroupIdSuffix()) && Objects.equals(globalReplicationGroupDescription(), other.globalReplicationGroupDescription()) && Objects.equals(primaryReplicationGroupId(), other.primaryReplicationGroupId()); } /** * 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("CreateGlobalReplicationGroupRequest") .add("GlobalReplicationGroupIdSuffix", globalReplicationGroupIdSuffix()) .add("GlobalReplicationGroupDescription", globalReplicationGroupDescription()) .add("PrimaryReplicationGroupId", primaryReplicationGroupId()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "GlobalReplicationGroupIdSuffix": return Optional.ofNullable(clazz.cast(globalReplicationGroupIdSuffix())); case "GlobalReplicationGroupDescription": return Optional.ofNullable(clazz.cast(globalReplicationGroupDescription())); case "PrimaryReplicationGroupId": return Optional.ofNullable(clazz.cast(primaryReplicationGroupId())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CreateGlobalReplicationGroupRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends ElastiCacheRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The suffix name of a Global Datastore. Amazon ElastiCache automatically applies a prefix to the Global * Datastore ID when it is created. Each AWS Region has its own prefix. For instance, a Global Datastore ID * created in the US-West-1 region will begin with "dsdfu" along with the suffix name you provide. The suffix, * combined with the auto-generated prefix, guarantees uniqueness of the Global Datastore name across multiple * regions. *

*

* For a full list of AWS Regions and their respective Global Datastore iD prefixes, see Using the * AWS CLI with Global Datastores . *

* * @param globalReplicationGroupIdSuffix * The suffix name of a Global Datastore. Amazon ElastiCache automatically applies a prefix to the Global * Datastore ID when it is created. Each AWS Region has its own prefix. For instance, a Global Datastore * ID created in the US-West-1 region will begin with "dsdfu" along with the suffix name you provide. The * suffix, combined with the auto-generated prefix, guarantees uniqueness of the Global Datastore name * across multiple regions.

*

* For a full list of AWS Regions and their respective Global Datastore iD prefixes, see Using the AWS CLI with Global Datastores . * @return Returns a reference to this object so that method calls can be chained together. */ Builder globalReplicationGroupIdSuffix(String globalReplicationGroupIdSuffix); /** *

* Provides details of the Global Datastore *

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

* The name of the primary cluster that accepts writes and will replicate updates to the secondary cluster. *

* * @param primaryReplicationGroupId * The name of the primary cluster that accepts writes and will replicate updates to the secondary * cluster. * @return Returns a reference to this object so that method calls can be chained together. */ Builder primaryReplicationGroupId(String primaryReplicationGroupId); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends ElastiCacheRequest.BuilderImpl implements Builder { private String globalReplicationGroupIdSuffix; private String globalReplicationGroupDescription; private String primaryReplicationGroupId; private BuilderImpl() { } private BuilderImpl(CreateGlobalReplicationGroupRequest model) { super(model); globalReplicationGroupIdSuffix(model.globalReplicationGroupIdSuffix); globalReplicationGroupDescription(model.globalReplicationGroupDescription); primaryReplicationGroupId(model.primaryReplicationGroupId); } public final String getGlobalReplicationGroupIdSuffix() { return globalReplicationGroupIdSuffix; } @Override public final Builder globalReplicationGroupIdSuffix(String globalReplicationGroupIdSuffix) { this.globalReplicationGroupIdSuffix = globalReplicationGroupIdSuffix; return this; } public final void setGlobalReplicationGroupIdSuffix(String globalReplicationGroupIdSuffix) { this.globalReplicationGroupIdSuffix = globalReplicationGroupIdSuffix; } public final String getGlobalReplicationGroupDescription() { return globalReplicationGroupDescription; } @Override public final Builder globalReplicationGroupDescription(String globalReplicationGroupDescription) { this.globalReplicationGroupDescription = globalReplicationGroupDescription; return this; } public final void setGlobalReplicationGroupDescription(String globalReplicationGroupDescription) { this.globalReplicationGroupDescription = globalReplicationGroupDescription; } public final String getPrimaryReplicationGroupId() { return primaryReplicationGroupId; } @Override public final Builder primaryReplicationGroupId(String primaryReplicationGroupId) { this.primaryReplicationGroupId = primaryReplicationGroupId; return this; } public final void setPrimaryReplicationGroupId(String primaryReplicationGroupId) { this.primaryReplicationGroupId = primaryReplicationGroupId; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public CreateGlobalReplicationGroupRequest build() { return new CreateGlobalReplicationGroupRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy