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

software.amazon.awssdk.services.rds.model.CreateGlobalClusterRequest Maven / Gradle / Ivy

Go to download

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

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.rds.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 java.util.stream.Collectors;
import java.util.stream.Stream;
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 CreateGlobalClusterRequest extends RdsRequest implements
        ToCopyableBuilder {
    private static final SdkField GLOBAL_CLUSTER_IDENTIFIER_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("GlobalClusterIdentifier").getter(getter(CreateGlobalClusterRequest::globalClusterIdentifier))
            .setter(setter(Builder::globalClusterIdentifier))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GlobalClusterIdentifier").build())
            .build();

    private static final SdkField SOURCE_DB_CLUSTER_IDENTIFIER_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("SourceDBClusterIdentifier").getter(getter(CreateGlobalClusterRequest::sourceDBClusterIdentifier))
            .setter(setter(Builder::sourceDBClusterIdentifier))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceDBClusterIdentifier").build())
            .build();

    private static final SdkField ENGINE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Engine")
            .getter(getter(CreateGlobalClusterRequest::engine)).setter(setter(Builder::engine))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Engine").build()).build();

    private static final SdkField ENGINE_VERSION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("EngineVersion").getter(getter(CreateGlobalClusterRequest::engineVersion))
            .setter(setter(Builder::engineVersion))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EngineVersion").build()).build();

    private static final SdkField ENGINE_LIFECYCLE_SUPPORT_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("EngineLifecycleSupport").getter(getter(CreateGlobalClusterRequest::engineLifecycleSupport))
            .setter(setter(Builder::engineLifecycleSupport))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EngineLifecycleSupport").build())
            .build();

    private static final SdkField DELETION_PROTECTION_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
            .memberName("DeletionProtection").getter(getter(CreateGlobalClusterRequest::deletionProtection))
            .setter(setter(Builder::deletionProtection))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeletionProtection").build())
            .build();

    private static final SdkField DATABASE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("DatabaseName").getter(getter(CreateGlobalClusterRequest::databaseName))
            .setter(setter(Builder::databaseName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DatabaseName").build()).build();

    private static final SdkField STORAGE_ENCRYPTED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
            .memberName("StorageEncrypted").getter(getter(CreateGlobalClusterRequest::storageEncrypted))
            .setter(setter(Builder::storageEncrypted))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StorageEncrypted").build()).build();

    private static final SdkField> TAGS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("Tags")
            .getter(getter(CreateGlobalClusterRequest::tags))
            .setter(setter(Builder::tags))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Tags").build(),
                    ListTrait
                            .builder()
                            .memberLocationName("Tag")
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(Tag::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("Tag").build()).build()).build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
            GLOBAL_CLUSTER_IDENTIFIER_FIELD, SOURCE_DB_CLUSTER_IDENTIFIER_FIELD, ENGINE_FIELD, ENGINE_VERSION_FIELD,
            ENGINE_LIFECYCLE_SUPPORT_FIELD, DELETION_PROTECTION_FIELD, DATABASE_NAME_FIELD, STORAGE_ENCRYPTED_FIELD, TAGS_FIELD));

    private final String globalClusterIdentifier;

    private final String sourceDBClusterIdentifier;

    private final String engine;

    private final String engineVersion;

    private final String engineLifecycleSupport;

    private final Boolean deletionProtection;

    private final String databaseName;

    private final Boolean storageEncrypted;

    private final List tags;

    private CreateGlobalClusterRequest(BuilderImpl builder) {
        super(builder);
        this.globalClusterIdentifier = builder.globalClusterIdentifier;
        this.sourceDBClusterIdentifier = builder.sourceDBClusterIdentifier;
        this.engine = builder.engine;
        this.engineVersion = builder.engineVersion;
        this.engineLifecycleSupport = builder.engineLifecycleSupport;
        this.deletionProtection = builder.deletionProtection;
        this.databaseName = builder.databaseName;
        this.storageEncrypted = builder.storageEncrypted;
        this.tags = builder.tags;
    }

    /**
     * 

* The cluster identifier for this global database cluster. This parameter is stored as a lowercase string. *

* * @return The cluster identifier for this global database cluster. This parameter is stored as a lowercase string. */ public final String globalClusterIdentifier() { return globalClusterIdentifier; } /** *

* The Amazon Resource Name (ARN) to use as the primary cluster of the global database. *

*

* If you provide a value for this parameter, don't specify values for the following settings because Amazon Aurora * uses the values from the specified source DB cluster: *

*
    *
  • *

    * DatabaseName *

    *
  • *
  • *

    * Engine *

    *
  • *
  • *

    * EngineVersion *

    *
  • *
  • *

    * StorageEncrypted *

    *
  • *
* * @return The Amazon Resource Name (ARN) to use as the primary cluster of the global database.

*

* If you provide a value for this parameter, don't specify values for the following settings because Amazon * Aurora uses the values from the specified source DB cluster: *

*
    *
  • *

    * DatabaseName *

    *
  • *
  • *

    * Engine *

    *
  • *
  • *

    * EngineVersion *

    *
  • *
  • *

    * StorageEncrypted *

    *
  • */ public final String sourceDBClusterIdentifier() { return sourceDBClusterIdentifier; } /** *

    * The database engine to use for this global database cluster. *

    *

    * Valid Values: aurora-mysql | aurora-postgresql *

    *

    * Constraints: *

    *
      *
    • *

      * Can't be specified if SourceDBClusterIdentifier is specified. In this case, Amazon Aurora uses the * engine of the source DB cluster. *

      *
    • *
    * * @return The database engine to use for this global database cluster.

    *

    * Valid Values: aurora-mysql | aurora-postgresql *

    *

    * Constraints: *

    *
      *
    • *

      * Can't be specified if SourceDBClusterIdentifier is specified. In this case, Amazon Aurora * uses the engine of the source DB cluster. *

      *
    • */ public final String engine() { return engine; } /** *

      * The engine version to use for this global database cluster. *

      *

      * Constraints: *

      *
        *
      • *

        * Can't be specified if SourceDBClusterIdentifier is specified. In this case, Amazon Aurora uses the * engine version of the source DB cluster. *

        *
      • *
      * * @return The engine version to use for this global database cluster.

      *

      * Constraints: *

      *
        *
      • *

        * Can't be specified if SourceDBClusterIdentifier is specified. In this case, Amazon Aurora * uses the engine version of the source DB cluster. *

        *
      • */ public final String engineVersion() { return engineVersion; } /** *

        * The life cycle type for this global database cluster. *

        * *

        * By default, this value is set to open-source-rds-extended-support, which enrolls your global cluster * into Amazon RDS Extended Support. At the end of standard support, you can avoid charges for Extended Support by * setting the value to open-source-rds-extended-support-disabled. In this case, creating the global * cluster will fail if the DB major version is past its end of standard support date. *

        *
        *

        * This setting only applies to Aurora PostgreSQL-based global databases. *

        *

        * You can use this setting to enroll your global cluster into Amazon RDS Extended Support. With RDS Extended * Support, you can run the selected major engine version on your global cluster past the end of standard support * for that engine version. For more information, see Using Amazon RDS * Extended Support in the Amazon Aurora User Guide. *

        *

        * Valid Values: open-source-rds-extended-support | open-source-rds-extended-support-disabled *

        *

        * Default: open-source-rds-extended-support *

        * * @return The life cycle type for this global database cluster.

        *

        * By default, this value is set to open-source-rds-extended-support, which enrolls your global * cluster into Amazon RDS Extended Support. At the end of standard support, you can avoid charges for * Extended Support by setting the value to open-source-rds-extended-support-disabled. In this * case, creating the global cluster will fail if the DB major version is past its end of standard support * date. *

        *
        *

        * This setting only applies to Aurora PostgreSQL-based global databases. *

        *

        * You can use this setting to enroll your global cluster into Amazon RDS Extended Support. With RDS * Extended Support, you can run the selected major engine version on your global cluster past the end of * standard support for that engine version. For more information, see Using Amazon * RDS Extended Support in the Amazon Aurora User Guide. *

        *

        * Valid Values: open-source-rds-extended-support | open-source-rds-extended-support-disabled *

        *

        * Default: open-source-rds-extended-support */ public final String engineLifecycleSupport() { return engineLifecycleSupport; } /** *

        * Specifies whether to enable deletion protection for the new global database cluster. The global database can't be * deleted when deletion protection is enabled. *

        * * @return Specifies whether to enable deletion protection for the new global database cluster. The global database * can't be deleted when deletion protection is enabled. */ public final Boolean deletionProtection() { return deletionProtection; } /** *

        * The name for your database of up to 64 alphanumeric characters. If you don't specify a name, Amazon Aurora * doesn't create a database in the global database cluster. *

        *

        * Constraints: *

        *
          *
        • *

          * Can't be specified if SourceDBClusterIdentifier is specified. In this case, Amazon Aurora uses the * database name from the source DB cluster. *

          *
        • *
        * * @return The name for your database of up to 64 alphanumeric characters. If you don't specify a name, Amazon * Aurora doesn't create a database in the global database cluster.

        *

        * Constraints: *

        *
          *
        • *

          * Can't be specified if SourceDBClusterIdentifier is specified. In this case, Amazon Aurora * uses the database name from the source DB cluster. *

          *
        • */ public final String databaseName() { return databaseName; } /** *

          * Specifies whether to enable storage encryption for the new global database cluster. *

          *

          * Constraints: *

          *
            *
          • *

            * Can't be specified if SourceDBClusterIdentifier is specified. In this case, Amazon Aurora uses the * setting from the source DB cluster. *

            *
          • *
          * * @return Specifies whether to enable storage encryption for the new global database cluster.

          *

          * Constraints: *

          *
            *
          • *

            * Can't be specified if SourceDBClusterIdentifier is specified. In this case, Amazon Aurora * uses the setting from the source DB cluster. *

            *
          • */ public final Boolean storageEncrypted() { return storageEncrypted; } /** * For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that * the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful * because the SDK will never return a null collection or map, but you may need to differentiate between the service * returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true * if a value for the property was specified in the request builder, and false if a value was not specified. */ public final boolean hasTags() { return tags != null && !(tags instanceof SdkAutoConstructList); } /** *

            * Tags to assign to the global cluster. *

            *

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

            *

            * This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasTags} method. *

            * * @return Tags to assign to the global cluster. */ public final List tags() { return tags; } @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(globalClusterIdentifier()); hashCode = 31 * hashCode + Objects.hashCode(sourceDBClusterIdentifier()); hashCode = 31 * hashCode + Objects.hashCode(engine()); hashCode = 31 * hashCode + Objects.hashCode(engineVersion()); hashCode = 31 * hashCode + Objects.hashCode(engineLifecycleSupport()); hashCode = 31 * hashCode + Objects.hashCode(deletionProtection()); hashCode = 31 * hashCode + Objects.hashCode(databaseName()); hashCode = 31 * hashCode + Objects.hashCode(storageEncrypted()); hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : 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 CreateGlobalClusterRequest)) { return false; } CreateGlobalClusterRequest other = (CreateGlobalClusterRequest) obj; return Objects.equals(globalClusterIdentifier(), other.globalClusterIdentifier()) && Objects.equals(sourceDBClusterIdentifier(), other.sourceDBClusterIdentifier()) && Objects.equals(engine(), other.engine()) && Objects.equals(engineVersion(), other.engineVersion()) && Objects.equals(engineLifecycleSupport(), other.engineLifecycleSupport()) && Objects.equals(deletionProtection(), other.deletionProtection()) && Objects.equals(databaseName(), other.databaseName()) && Objects.equals(storageEncrypted(), other.storageEncrypted()) && hasTags() == other.hasTags() && Objects.equals(tags(), other.tags()); } /** * 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("CreateGlobalClusterRequest").add("GlobalClusterIdentifier", globalClusterIdentifier()) .add("SourceDBClusterIdentifier", sourceDBClusterIdentifier()).add("Engine", engine()) .add("EngineVersion", engineVersion()).add("EngineLifecycleSupport", engineLifecycleSupport()) .add("DeletionProtection", deletionProtection()).add("DatabaseName", databaseName()) .add("StorageEncrypted", storageEncrypted()).add("Tags", hasTags() ? tags() : null).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "GlobalClusterIdentifier": return Optional.ofNullable(clazz.cast(globalClusterIdentifier())); case "SourceDBClusterIdentifier": return Optional.ofNullable(clazz.cast(sourceDBClusterIdentifier())); case "Engine": return Optional.ofNullable(clazz.cast(engine())); case "EngineVersion": return Optional.ofNullable(clazz.cast(engineVersion())); case "EngineLifecycleSupport": return Optional.ofNullable(clazz.cast(engineLifecycleSupport())); case "DeletionProtection": return Optional.ofNullable(clazz.cast(deletionProtection())); case "DatabaseName": return Optional.ofNullable(clazz.cast(databaseName())); case "StorageEncrypted": return Optional.ofNullable(clazz.cast(storageEncrypted())); case "Tags": return Optional.ofNullable(clazz.cast(tags())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CreateGlobalClusterRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends RdsRequest.Builder, SdkPojo, CopyableBuilder { /** *

            * The cluster identifier for this global database cluster. This parameter is stored as a lowercase string. *

            * * @param globalClusterIdentifier * The cluster identifier for this global database cluster. This parameter is stored as a lowercase * string. * @return Returns a reference to this object so that method calls can be chained together. */ Builder globalClusterIdentifier(String globalClusterIdentifier); /** *

            * The Amazon Resource Name (ARN) to use as the primary cluster of the global database. *

            *

            * If you provide a value for this parameter, don't specify values for the following settings because Amazon * Aurora uses the values from the specified source DB cluster: *

            *
              *
            • *

              * DatabaseName *

              *
            • *
            • *

              * Engine *

              *
            • *
            • *

              * EngineVersion *

              *
            • *
            • *

              * StorageEncrypted *

              *
            • *
            * * @param sourceDBClusterIdentifier * The Amazon Resource Name (ARN) to use as the primary cluster of the global database.

            *

            * If you provide a value for this parameter, don't specify values for the following settings because * Amazon Aurora uses the values from the specified source DB cluster: *

            *
              *
            • *

              * DatabaseName *

              *
            • *
            • *

              * Engine *

              *
            • *
            • *

              * EngineVersion *

              *
            • *
            • *

              * StorageEncrypted *

              *
            • * @return Returns a reference to this object so that method calls can be chained together. */ Builder sourceDBClusterIdentifier(String sourceDBClusterIdentifier); /** *

              * The database engine to use for this global database cluster. *

              *

              * Valid Values: aurora-mysql | aurora-postgresql *

              *

              * Constraints: *

              *
                *
              • *

                * Can't be specified if SourceDBClusterIdentifier is specified. In this case, Amazon Aurora uses * the engine of the source DB cluster. *

                *
              • *
              * * @param engine * The database engine to use for this global database cluster.

              *

              * Valid Values: aurora-mysql | aurora-postgresql *

              *

              * Constraints: *

              *
                *
              • *

                * Can't be specified if SourceDBClusterIdentifier is specified. In this case, Amazon Aurora * uses the engine of the source DB cluster. *

                *
              • * @return Returns a reference to this object so that method calls can be chained together. */ Builder engine(String engine); /** *

                * The engine version to use for this global database cluster. *

                *

                * Constraints: *

                *
                  *
                • *

                  * Can't be specified if SourceDBClusterIdentifier is specified. In this case, Amazon Aurora uses * the engine version of the source DB cluster. *

                  *
                • *
                * * @param engineVersion * The engine version to use for this global database cluster.

                *

                * Constraints: *

                *
                  *
                • *

                  * Can't be specified if SourceDBClusterIdentifier is specified. In this case, Amazon Aurora * uses the engine version of the source DB cluster. *

                  *
                • * @return Returns a reference to this object so that method calls can be chained together. */ Builder engineVersion(String engineVersion); /** *

                  * The life cycle type for this global database cluster. *

                  * *

                  * By default, this value is set to open-source-rds-extended-support, which enrolls your global * cluster into Amazon RDS Extended Support. At the end of standard support, you can avoid charges for Extended * Support by setting the value to open-source-rds-extended-support-disabled. In this case, * creating the global cluster will fail if the DB major version is past its end of standard support date. *

                  *
                  *

                  * This setting only applies to Aurora PostgreSQL-based global databases. *

                  *

                  * You can use this setting to enroll your global cluster into Amazon RDS Extended Support. With RDS Extended * Support, you can run the selected major engine version on your global cluster past the end of standard * support for that engine version. For more information, see Using Amazon RDS * Extended Support in the Amazon Aurora User Guide. *

                  *

                  * Valid Values: open-source-rds-extended-support | open-source-rds-extended-support-disabled *

                  *

                  * Default: open-source-rds-extended-support *

                  * * @param engineLifecycleSupport * The life cycle type for this global database cluster.

                  *

                  * By default, this value is set to open-source-rds-extended-support, which enrolls your * global cluster into Amazon RDS Extended Support. At the end of standard support, you can avoid charges * for Extended Support by setting the value to open-source-rds-extended-support-disabled. * In this case, creating the global cluster will fail if the DB major version is past its end of * standard support date. *

                  *
                  *

                  * This setting only applies to Aurora PostgreSQL-based global databases. *

                  *

                  * You can use this setting to enroll your global cluster into Amazon RDS Extended Support. With RDS * Extended Support, you can run the selected major engine version on your global cluster past the end of * standard support for that engine version. For more information, see Using Amazon * RDS Extended Support in the Amazon Aurora User Guide. *

                  *

                  * Valid Values: * open-source-rds-extended-support | open-source-rds-extended-support-disabled *

                  *

                  * Default: open-source-rds-extended-support * @return Returns a reference to this object so that method calls can be chained together. */ Builder engineLifecycleSupport(String engineLifecycleSupport); /** *

                  * Specifies whether to enable deletion protection for the new global database cluster. The global database * can't be deleted when deletion protection is enabled. *

                  * * @param deletionProtection * Specifies whether to enable deletion protection for the new global database cluster. The global * database can't be deleted when deletion protection is enabled. * @return Returns a reference to this object so that method calls can be chained together. */ Builder deletionProtection(Boolean deletionProtection); /** *

                  * The name for your database of up to 64 alphanumeric characters. If you don't specify a name, Amazon Aurora * doesn't create a database in the global database cluster. *

                  *

                  * Constraints: *

                  *
                    *
                  • *

                    * Can't be specified if SourceDBClusterIdentifier is specified. In this case, Amazon Aurora uses * the database name from the source DB cluster. *

                    *
                  • *
                  * * @param databaseName * The name for your database of up to 64 alphanumeric characters. If you don't specify a name, Amazon * Aurora doesn't create a database in the global database cluster.

                  *

                  * Constraints: *

                  *
                    *
                  • *

                    * Can't be specified if SourceDBClusterIdentifier is specified. In this case, Amazon Aurora * uses the database name from the source DB cluster. *

                    *
                  • * @return Returns a reference to this object so that method calls can be chained together. */ Builder databaseName(String databaseName); /** *

                    * Specifies whether to enable storage encryption for the new global database cluster. *

                    *

                    * Constraints: *

                    *
                      *
                    • *

                      * Can't be specified if SourceDBClusterIdentifier is specified. In this case, Amazon Aurora uses * the setting from the source DB cluster. *

                      *
                    • *
                    * * @param storageEncrypted * Specifies whether to enable storage encryption for the new global database cluster.

                    *

                    * Constraints: *

                    *
                      *
                    • *

                      * Can't be specified if SourceDBClusterIdentifier is specified. In this case, Amazon Aurora * uses the setting from the source DB cluster. *

                      *
                    • * @return Returns a reference to this object so that method calls can be chained together. */ Builder storageEncrypted(Boolean storageEncrypted); /** *

                      * Tags to assign to the global cluster. *

                      * * @param tags * Tags to assign to the global cluster. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Collection tags); /** *

                      * Tags to assign to the global cluster. *

                      * * @param tags * Tags to assign to the global cluster. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Tag... tags); /** *

                      * Tags to assign to the global cluster. *

                      * This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.rds.model.Tag.Builder} avoiding the need to create one manually via * {@link software.amazon.awssdk.services.rds.model.Tag#builder()}. * *

                      * When the {@link Consumer} completes, {@link software.amazon.awssdk.services.rds.model.Tag.Builder#build()} is * called immediately and its result is passed to {@link #tags(List)}. * * @param tags * a consumer that will call methods on {@link software.amazon.awssdk.services.rds.model.Tag.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #tags(java.util.Collection) */ Builder tags(Consumer... tags); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends RdsRequest.BuilderImpl implements Builder { private String globalClusterIdentifier; private String sourceDBClusterIdentifier; private String engine; private String engineVersion; private String engineLifecycleSupport; private Boolean deletionProtection; private String databaseName; private Boolean storageEncrypted; private List tags = DefaultSdkAutoConstructList.getInstance(); private BuilderImpl() { } private BuilderImpl(CreateGlobalClusterRequest model) { super(model); globalClusterIdentifier(model.globalClusterIdentifier); sourceDBClusterIdentifier(model.sourceDBClusterIdentifier); engine(model.engine); engineVersion(model.engineVersion); engineLifecycleSupport(model.engineLifecycleSupport); deletionProtection(model.deletionProtection); databaseName(model.databaseName); storageEncrypted(model.storageEncrypted); tags(model.tags); } public final String getGlobalClusterIdentifier() { return globalClusterIdentifier; } public final void setGlobalClusterIdentifier(String globalClusterIdentifier) { this.globalClusterIdentifier = globalClusterIdentifier; } @Override public final Builder globalClusterIdentifier(String globalClusterIdentifier) { this.globalClusterIdentifier = globalClusterIdentifier; return this; } public final String getSourceDBClusterIdentifier() { return sourceDBClusterIdentifier; } public final void setSourceDBClusterIdentifier(String sourceDBClusterIdentifier) { this.sourceDBClusterIdentifier = sourceDBClusterIdentifier; } @Override public final Builder sourceDBClusterIdentifier(String sourceDBClusterIdentifier) { this.sourceDBClusterIdentifier = sourceDBClusterIdentifier; return this; } public final String getEngine() { return engine; } public final void setEngine(String engine) { this.engine = engine; } @Override public final Builder engine(String engine) { this.engine = engine; 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 getEngineLifecycleSupport() { return engineLifecycleSupport; } public final void setEngineLifecycleSupport(String engineLifecycleSupport) { this.engineLifecycleSupport = engineLifecycleSupport; } @Override public final Builder engineLifecycleSupport(String engineLifecycleSupport) { this.engineLifecycleSupport = engineLifecycleSupport; return this; } public final Boolean getDeletionProtection() { return deletionProtection; } public final void setDeletionProtection(Boolean deletionProtection) { this.deletionProtection = deletionProtection; } @Override public final Builder deletionProtection(Boolean deletionProtection) { this.deletionProtection = deletionProtection; return this; } public final String getDatabaseName() { return databaseName; } public final void setDatabaseName(String databaseName) { this.databaseName = databaseName; } @Override public final Builder databaseName(String databaseName) { this.databaseName = databaseName; return this; } public final Boolean getStorageEncrypted() { return storageEncrypted; } public final void setStorageEncrypted(Boolean storageEncrypted) { this.storageEncrypted = storageEncrypted; } @Override public final Builder storageEncrypted(Boolean storageEncrypted) { this.storageEncrypted = storageEncrypted; return this; } public final List getTags() { List result = TagListCopier.copyToBuilder(this.tags); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setTags(Collection tags) { this.tags = TagListCopier.copyFromBuilder(tags); } @Override public final Builder tags(Collection tags) { this.tags = TagListCopier.copy(tags); return this; } @Override @SafeVarargs public final Builder tags(Tag... tags) { tags(Arrays.asList(tags)); return this; } @Override @SafeVarargs public final Builder tags(Consumer... tags) { tags(Stream.of(tags).map(c -> Tag.builder().applyMutation(c).build()).collect(Collectors.toList())); 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 CreateGlobalClusterRequest build() { return new CreateGlobalClusterRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy