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

software.amazon.awssdk.services.rds.model.CreateDbShardGroupRequest 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.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 CreateDbShardGroupRequest extends RdsRequest implements
        ToCopyableBuilder {
    private static final SdkField DB_SHARD_GROUP_IDENTIFIER_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("DBShardGroupIdentifier").getter(getter(CreateDbShardGroupRequest::dbShardGroupIdentifier))
            .setter(setter(Builder::dbShardGroupIdentifier))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DBShardGroupIdentifier").build())
            .build();

    private static final SdkField DB_CLUSTER_IDENTIFIER_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("DBClusterIdentifier").getter(getter(CreateDbShardGroupRequest::dbClusterIdentifier))
            .setter(setter(Builder::dbClusterIdentifier))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DBClusterIdentifier").build())
            .build();

    private static final SdkField COMPUTE_REDUNDANCY_FIELD = SdkField. builder(MarshallingType.INTEGER)
            .memberName("ComputeRedundancy").getter(getter(CreateDbShardGroupRequest::computeRedundancy))
            .setter(setter(Builder::computeRedundancy))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ComputeRedundancy").build()).build();

    private static final SdkField MAX_ACU_FIELD = SdkField. builder(MarshallingType.DOUBLE).memberName("MaxACU")
            .getter(getter(CreateDbShardGroupRequest::maxACU)).setter(setter(Builder::maxACU))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaxACU").build()).build();

    private static final SdkField MIN_ACU_FIELD = SdkField. builder(MarshallingType.DOUBLE).memberName("MinACU")
            .getter(getter(CreateDbShardGroupRequest::minACU)).setter(setter(Builder::minACU))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MinACU").build()).build();

    private static final SdkField PUBLICLY_ACCESSIBLE_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
            .memberName("PubliclyAccessible").getter(getter(CreateDbShardGroupRequest::publiclyAccessible))
            .setter(setter(Builder::publiclyAccessible))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PubliclyAccessible").build())
            .build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
            DB_SHARD_GROUP_IDENTIFIER_FIELD, DB_CLUSTER_IDENTIFIER_FIELD, COMPUTE_REDUNDANCY_FIELD, MAX_ACU_FIELD, MIN_ACU_FIELD,
            PUBLICLY_ACCESSIBLE_FIELD));

    private final String dbShardGroupIdentifier;

    private final String dbClusterIdentifier;

    private final Integer computeRedundancy;

    private final Double maxACU;

    private final Double minACU;

    private final Boolean publiclyAccessible;

    private CreateDbShardGroupRequest(BuilderImpl builder) {
        super(builder);
        this.dbShardGroupIdentifier = builder.dbShardGroupIdentifier;
        this.dbClusterIdentifier = builder.dbClusterIdentifier;
        this.computeRedundancy = builder.computeRedundancy;
        this.maxACU = builder.maxACU;
        this.minACU = builder.minACU;
        this.publiclyAccessible = builder.publiclyAccessible;
    }

    /**
     * 

* The name of the DB shard group. *

* * @return The name of the DB shard group. */ public final String dbShardGroupIdentifier() { return dbShardGroupIdentifier; } /** *

* The name of the primary DB cluster for the DB shard group. *

* * @return The name of the primary DB cluster for the DB shard group. */ public final String dbClusterIdentifier() { return dbClusterIdentifier; } /** *

* Specifies whether to create standby DB shard groups for the DB shard group. Valid values are the following: *

*
    *
  • *

    * 0 - Creates a DB shard group without a standby DB shard group. This is the default value. *

    *
  • *
  • *

    * 1 - Creates a DB shard group with a standby DB shard group in a different Availability Zone (AZ). *

    *
  • *
  • *

    * 2 - Creates a DB shard group with two standby DB shard groups in two different AZs. *

    *
  • *
* * @return Specifies whether to create standby DB shard groups for the DB shard group. Valid values are the * following:

*
    *
  • *

    * 0 - Creates a DB shard group without a standby DB shard group. This is the default value. *

    *
  • *
  • *

    * 1 - Creates a DB shard group with a standby DB shard group in a different Availability Zone (AZ). *

    *
  • *
  • *

    * 2 - Creates a DB shard group with two standby DB shard groups in two different AZs. *

    *
  • */ public final Integer computeRedundancy() { return computeRedundancy; } /** *

    * The maximum capacity of the DB shard group in Aurora capacity units (ACUs). *

    * * @return The maximum capacity of the DB shard group in Aurora capacity units (ACUs). */ public final Double maxACU() { return maxACU; } /** *

    * The minimum capacity of the DB shard group in Aurora capacity units (ACUs). *

    * * @return The minimum capacity of the DB shard group in Aurora capacity units (ACUs). */ public final Double minACU() { return minACU; } /** *

    * Specifies whether the DB shard group is publicly accessible. *

    *

    * When the DB shard group is publicly accessible, its Domain Name System (DNS) endpoint resolves to the private IP * address from within the DB shard group's virtual private cloud (VPC). It resolves to the public IP address from * outside of the DB shard group's VPC. Access to the DB shard group is ultimately controlled by the security group * it uses. That public access is not permitted if the security group assigned to the DB shard group doesn't permit * it. *

    *

    * When the DB shard group isn't publicly accessible, it is an internal DB shard group with a DNS name that resolves * to a private IP address. *

    *

    * Default: The default behavior varies depending on whether DBSubnetGroupName is specified. *

    *

    * If DBSubnetGroupName isn't specified, and PubliclyAccessible isn't specified, the * following applies: *

    *
      *
    • *

      * If the default VPC in the target Region doesn’t have an internet gateway attached to it, the DB shard group is * private. *

      *
    • *
    • *

      * If the default VPC in the target Region has an internet gateway attached to it, the DB shard group is public. *

      *
    • *
    *

    * If DBSubnetGroupName is specified, and PubliclyAccessible isn't specified, the * following applies: *

    *
      *
    • *

      * If the subnets are part of a VPC that doesn’t have an internet gateway attached to it, the DB shard group is * private. *

      *
    • *
    • *

      * If the subnets are part of a VPC that has an internet gateway attached to it, the DB shard group is public. *

      *
    • *
    * * @return Specifies whether the DB shard group is publicly accessible.

    *

    * When the DB shard group is publicly accessible, its Domain Name System (DNS) endpoint resolves to the * private IP address from within the DB shard group's virtual private cloud (VPC). It resolves to the * public IP address from outside of the DB shard group's VPC. Access to the DB shard group is ultimately * controlled by the security group it uses. That public access is not permitted if the security group * assigned to the DB shard group doesn't permit it. *

    *

    * When the DB shard group isn't publicly accessible, it is an internal DB shard group with a DNS name that * resolves to a private IP address. *

    *

    * Default: The default behavior varies depending on whether DBSubnetGroupName is specified. *

    *

    * If DBSubnetGroupName isn't specified, and PubliclyAccessible isn't specified, * the following applies: *

    *
      *
    • *

      * If the default VPC in the target Region doesn’t have an internet gateway attached to it, the DB shard * group is private. *

      *
    • *
    • *

      * If the default VPC in the target Region has an internet gateway attached to it, the DB shard group is * public. *

      *
    • *
    *

    * If DBSubnetGroupName is specified, and PubliclyAccessible isn't specified, the * following applies: *

    *
      *
    • *

      * If the subnets are part of a VPC that doesn’t have an internet gateway attached to it, the DB shard group * is private. *

      *
    • *
    • *

      * If the subnets are part of a VPC that has an internet gateway attached to it, the DB shard group is * public. *

      *
    • */ public final Boolean publiclyAccessible() { return publiclyAccessible; } @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(dbShardGroupIdentifier()); hashCode = 31 * hashCode + Objects.hashCode(dbClusterIdentifier()); hashCode = 31 * hashCode + Objects.hashCode(computeRedundancy()); hashCode = 31 * hashCode + Objects.hashCode(maxACU()); hashCode = 31 * hashCode + Objects.hashCode(minACU()); hashCode = 31 * hashCode + Objects.hashCode(publiclyAccessible()); 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 CreateDbShardGroupRequest)) { return false; } CreateDbShardGroupRequest other = (CreateDbShardGroupRequest) obj; return Objects.equals(dbShardGroupIdentifier(), other.dbShardGroupIdentifier()) && Objects.equals(dbClusterIdentifier(), other.dbClusterIdentifier()) && Objects.equals(computeRedundancy(), other.computeRedundancy()) && Objects.equals(maxACU(), other.maxACU()) && Objects.equals(minACU(), other.minACU()) && Objects.equals(publiclyAccessible(), other.publiclyAccessible()); } /** * 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("CreateDbShardGroupRequest").add("DBShardGroupIdentifier", dbShardGroupIdentifier()) .add("DBClusterIdentifier", dbClusterIdentifier()).add("ComputeRedundancy", computeRedundancy()) .add("MaxACU", maxACU()).add("MinACU", minACU()).add("PubliclyAccessible", publiclyAccessible()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "DBShardGroupIdentifier": return Optional.ofNullable(clazz.cast(dbShardGroupIdentifier())); case "DBClusterIdentifier": return Optional.ofNullable(clazz.cast(dbClusterIdentifier())); case "ComputeRedundancy": return Optional.ofNullable(clazz.cast(computeRedundancy())); case "MaxACU": return Optional.ofNullable(clazz.cast(maxACU())); case "MinACU": return Optional.ofNullable(clazz.cast(minACU())); case "PubliclyAccessible": return Optional.ofNullable(clazz.cast(publiclyAccessible())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CreateDbShardGroupRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends RdsRequest.Builder, SdkPojo, CopyableBuilder { /** *

      * The name of the DB shard group. *

      * * @param dbShardGroupIdentifier * The name of the DB shard group. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dbShardGroupIdentifier(String dbShardGroupIdentifier); /** *

      * The name of the primary DB cluster for the DB shard group. *

      * * @param dbClusterIdentifier * The name of the primary DB cluster for the DB shard group. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dbClusterIdentifier(String dbClusterIdentifier); /** *

      * Specifies whether to create standby DB shard groups for the DB shard group. Valid values are the following: *

      *
        *
      • *

        * 0 - Creates a DB shard group without a standby DB shard group. This is the default value. *

        *
      • *
      • *

        * 1 - Creates a DB shard group with a standby DB shard group in a different Availability Zone (AZ). *

        *
      • *
      • *

        * 2 - Creates a DB shard group with two standby DB shard groups in two different AZs. *

        *
      • *
      * * @param computeRedundancy * Specifies whether to create standby DB shard groups for the DB shard group. Valid values are the * following:

      *
        *
      • *

        * 0 - Creates a DB shard group without a standby DB shard group. This is the default value. *

        *
      • *
      • *

        * 1 - Creates a DB shard group with a standby DB shard group in a different Availability Zone (AZ). *

        *
      • *
      • *

        * 2 - Creates a DB shard group with two standby DB shard groups in two different AZs. *

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

        * The maximum capacity of the DB shard group in Aurora capacity units (ACUs). *

        * * @param maxACU * The maximum capacity of the DB shard group in Aurora capacity units (ACUs). * @return Returns a reference to this object so that method calls can be chained together. */ Builder maxACU(Double maxACU); /** *

        * The minimum capacity of the DB shard group in Aurora capacity units (ACUs). *

        * * @param minACU * The minimum capacity of the DB shard group in Aurora capacity units (ACUs). * @return Returns a reference to this object so that method calls can be chained together. */ Builder minACU(Double minACU); /** *

        * Specifies whether the DB shard group is publicly accessible. *

        *

        * When the DB shard group is publicly accessible, its Domain Name System (DNS) endpoint resolves to the private * IP address from within the DB shard group's virtual private cloud (VPC). It resolves to the public IP address * from outside of the DB shard group's VPC. Access to the DB shard group is ultimately controlled by the * security group it uses. That public access is not permitted if the security group assigned to the DB shard * group doesn't permit it. *

        *

        * When the DB shard group isn't publicly accessible, it is an internal DB shard group with a DNS name that * resolves to a private IP address. *

        *

        * Default: The default behavior varies depending on whether DBSubnetGroupName is specified. *

        *

        * If DBSubnetGroupName isn't specified, and PubliclyAccessible isn't specified, the * following applies: *

        *
          *
        • *

          * If the default VPC in the target Region doesn’t have an internet gateway attached to it, the DB shard group * is private. *

          *
        • *
        • *

          * If the default VPC in the target Region has an internet gateway attached to it, the DB shard group is public. *

          *
        • *
        *

        * If DBSubnetGroupName is specified, and PubliclyAccessible isn't specified, the * following applies: *

        *
          *
        • *

          * If the subnets are part of a VPC that doesn’t have an internet gateway attached to it, the DB shard group is * private. *

          *
        • *
        • *

          * If the subnets are part of a VPC that has an internet gateway attached to it, the DB shard group is public. *

          *
        • *
        * * @param publiclyAccessible * Specifies whether the DB shard group is publicly accessible.

        *

        * When the DB shard group is publicly accessible, its Domain Name System (DNS) endpoint resolves to the * private IP address from within the DB shard group's virtual private cloud (VPC). It resolves to the * public IP address from outside of the DB shard group's VPC. Access to the DB shard group is ultimately * controlled by the security group it uses. That public access is not permitted if the security group * assigned to the DB shard group doesn't permit it. *

        *

        * When the DB shard group isn't publicly accessible, it is an internal DB shard group with a DNS name * that resolves to a private IP address. *

        *

        * Default: The default behavior varies depending on whether DBSubnetGroupName is specified. *

        *

        * If DBSubnetGroupName isn't specified, and PubliclyAccessible isn't * specified, the following applies: *

        *
          *
        • *

          * If the default VPC in the target Region doesn’t have an internet gateway attached to it, the DB shard * group is private. *

          *
        • *
        • *

          * If the default VPC in the target Region has an internet gateway attached to it, the DB shard group is * public. *

          *
        • *
        *

        * If DBSubnetGroupName is specified, and PubliclyAccessible isn't specified, * the following applies: *

        *
          *
        • *

          * If the subnets are part of a VPC that doesn’t have an internet gateway attached to it, the DB shard * group is private. *

          *
        • *
        • *

          * If the subnets are part of a VPC that has an internet gateway attached to it, the DB shard group is * public. *

          *
        • * @return Returns a reference to this object so that method calls can be chained together. */ Builder publiclyAccessible(Boolean publiclyAccessible); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends RdsRequest.BuilderImpl implements Builder { private String dbShardGroupIdentifier; private String dbClusterIdentifier; private Integer computeRedundancy; private Double maxACU; private Double minACU; private Boolean publiclyAccessible; private BuilderImpl() { } private BuilderImpl(CreateDbShardGroupRequest model) { super(model); dbShardGroupIdentifier(model.dbShardGroupIdentifier); dbClusterIdentifier(model.dbClusterIdentifier); computeRedundancy(model.computeRedundancy); maxACU(model.maxACU); minACU(model.minACU); publiclyAccessible(model.publiclyAccessible); } public final String getDbShardGroupIdentifier() { return dbShardGroupIdentifier; } public final void setDbShardGroupIdentifier(String dbShardGroupIdentifier) { this.dbShardGroupIdentifier = dbShardGroupIdentifier; } @Override public final Builder dbShardGroupIdentifier(String dbShardGroupIdentifier) { this.dbShardGroupIdentifier = dbShardGroupIdentifier; return this; } public final String getDbClusterIdentifier() { return dbClusterIdentifier; } public final void setDbClusterIdentifier(String dbClusterIdentifier) { this.dbClusterIdentifier = dbClusterIdentifier; } @Override public final Builder dbClusterIdentifier(String dbClusterIdentifier) { this.dbClusterIdentifier = dbClusterIdentifier; return this; } public final Integer getComputeRedundancy() { return computeRedundancy; } public final void setComputeRedundancy(Integer computeRedundancy) { this.computeRedundancy = computeRedundancy; } @Override public final Builder computeRedundancy(Integer computeRedundancy) { this.computeRedundancy = computeRedundancy; return this; } public final Double getMaxACU() { return maxACU; } public final void setMaxACU(Double maxACU) { this.maxACU = maxACU; } @Override public final Builder maxACU(Double maxACU) { this.maxACU = maxACU; return this; } public final Double getMinACU() { return minACU; } public final void setMinACU(Double minACU) { this.minACU = minACU; } @Override public final Builder minACU(Double minACU) { this.minACU = minACU; return this; } public final Boolean getPubliclyAccessible() { return publiclyAccessible; } public final void setPubliclyAccessible(Boolean publiclyAccessible) { this.publiclyAccessible = publiclyAccessible; } @Override public final Builder publiclyAccessible(Boolean publiclyAccessible) { this.publiclyAccessible = publiclyAccessible; 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 CreateDbShardGroupRequest build() { return new CreateDbShardGroupRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy