software.amazon.awssdk.services.rds.model.CreateDbShardGroupRequest Maven / Gradle / Ivy
Show all versions of rds 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.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 extends Builder> 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