software.amazon.awssdk.services.rds.model.CreateDbShardGroupResponse 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.Function;
import software.amazon.awssdk.annotations.Generated;
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 CreateDbShardGroupResponse extends RdsResponse implements
ToCopyableBuilder {
private static final SdkField DB_SHARD_GROUP_RESOURCE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DBShardGroupResourceId").getter(getter(CreateDbShardGroupResponse::dbShardGroupResourceId))
.setter(setter(Builder::dbShardGroupResourceId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DBShardGroupResourceId").build())
.build();
private static final SdkField DB_SHARD_GROUP_IDENTIFIER_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DBShardGroupIdentifier").getter(getter(CreateDbShardGroupResponse::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(CreateDbShardGroupResponse::dbClusterIdentifier))
.setter(setter(Builder::dbClusterIdentifier))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DBClusterIdentifier").build())
.build();
private static final SdkField MAX_ACU_FIELD = SdkField. builder(MarshallingType.DOUBLE).memberName("MaxACU")
.getter(getter(CreateDbShardGroupResponse::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(CreateDbShardGroupResponse::minACU)).setter(setter(Builder::minACU))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MinACU").build()).build();
private static final SdkField COMPUTE_REDUNDANCY_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("ComputeRedundancy").getter(getter(CreateDbShardGroupResponse::computeRedundancy))
.setter(setter(Builder::computeRedundancy))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ComputeRedundancy").build()).build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status")
.getter(getter(CreateDbShardGroupResponse::status)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build();
private static final SdkField PUBLICLY_ACCESSIBLE_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("PubliclyAccessible").getter(getter(CreateDbShardGroupResponse::publiclyAccessible))
.setter(setter(Builder::publiclyAccessible))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PubliclyAccessible").build())
.build();
private static final SdkField ENDPOINT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Endpoint").getter(getter(CreateDbShardGroupResponse::endpoint)).setter(setter(Builder::endpoint))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Endpoint").build()).build();
private static final SdkField DB_SHARD_GROUP_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DBShardGroupArn").getter(getter(CreateDbShardGroupResponse::dbShardGroupArn))
.setter(setter(Builder::dbShardGroupArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DBShardGroupArn").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
DB_SHARD_GROUP_RESOURCE_ID_FIELD, DB_SHARD_GROUP_IDENTIFIER_FIELD, DB_CLUSTER_IDENTIFIER_FIELD, MAX_ACU_FIELD,
MIN_ACU_FIELD, COMPUTE_REDUNDANCY_FIELD, STATUS_FIELD, PUBLICLY_ACCESSIBLE_FIELD, ENDPOINT_FIELD,
DB_SHARD_GROUP_ARN_FIELD));
private final String dbShardGroupResourceId;
private final String dbShardGroupIdentifier;
private final String dbClusterIdentifier;
private final Double maxACU;
private final Double minACU;
private final Integer computeRedundancy;
private final String status;
private final Boolean publiclyAccessible;
private final String endpoint;
private final String dbShardGroupArn;
private CreateDbShardGroupResponse(BuilderImpl builder) {
super(builder);
this.dbShardGroupResourceId = builder.dbShardGroupResourceId;
this.dbShardGroupIdentifier = builder.dbShardGroupIdentifier;
this.dbClusterIdentifier = builder.dbClusterIdentifier;
this.maxACU = builder.maxACU;
this.minACU = builder.minACU;
this.computeRedundancy = builder.computeRedundancy;
this.status = builder.status;
this.publiclyAccessible = builder.publiclyAccessible;
this.endpoint = builder.endpoint;
this.dbShardGroupArn = builder.dbShardGroupArn;
}
/**
*
* The Amazon Web Services Region-unique, immutable identifier for the DB shard group.
*
*
* @return The Amazon Web Services Region-unique, immutable identifier for the DB shard group.
*/
public final String dbShardGroupResourceId() {
return dbShardGroupResourceId;
}
/**
*
* 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;
}
/**
*
* 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 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 status of the DB shard group.
*
*
* @return The status of the DB shard group.
*/
public final String status() {
return status;
}
/**
*
* Indicates 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 isn't 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.
*
*
* For more information, see CreateDBShardGroup.
*
*
* This setting is only for Aurora Limitless Database.
*
*
* @return Indicates 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 isn't 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.
*
*
* For more information, see CreateDBShardGroup.
*
*
* This setting is only for Aurora Limitless Database.
*/
public final Boolean publiclyAccessible() {
return publiclyAccessible;
}
/**
*
* The connection endpoint for the DB shard group.
*
*
* @return The connection endpoint for the DB shard group.
*/
public final String endpoint() {
return endpoint;
}
/**
*
* The Amazon Resource Name (ARN) for the DB shard group.
*
*
* @return The Amazon Resource Name (ARN) for the DB shard group.
*/
public final String dbShardGroupArn() {
return dbShardGroupArn;
}
@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(dbShardGroupResourceId());
hashCode = 31 * hashCode + Objects.hashCode(dbShardGroupIdentifier());
hashCode = 31 * hashCode + Objects.hashCode(dbClusterIdentifier());
hashCode = 31 * hashCode + Objects.hashCode(maxACU());
hashCode = 31 * hashCode + Objects.hashCode(minACU());
hashCode = 31 * hashCode + Objects.hashCode(computeRedundancy());
hashCode = 31 * hashCode + Objects.hashCode(status());
hashCode = 31 * hashCode + Objects.hashCode(publiclyAccessible());
hashCode = 31 * hashCode + Objects.hashCode(endpoint());
hashCode = 31 * hashCode + Objects.hashCode(dbShardGroupArn());
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 CreateDbShardGroupResponse)) {
return false;
}
CreateDbShardGroupResponse other = (CreateDbShardGroupResponse) obj;
return Objects.equals(dbShardGroupResourceId(), other.dbShardGroupResourceId())
&& Objects.equals(dbShardGroupIdentifier(), other.dbShardGroupIdentifier())
&& Objects.equals(dbClusterIdentifier(), other.dbClusterIdentifier()) && Objects.equals(maxACU(), other.maxACU())
&& Objects.equals(minACU(), other.minACU()) && Objects.equals(computeRedundancy(), other.computeRedundancy())
&& Objects.equals(status(), other.status()) && Objects.equals(publiclyAccessible(), other.publiclyAccessible())
&& Objects.equals(endpoint(), other.endpoint()) && Objects.equals(dbShardGroupArn(), other.dbShardGroupArn());
}
/**
* 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("CreateDbShardGroupResponse").add("DBShardGroupResourceId", dbShardGroupResourceId())
.add("DBShardGroupIdentifier", dbShardGroupIdentifier()).add("DBClusterIdentifier", dbClusterIdentifier())
.add("MaxACU", maxACU()).add("MinACU", minACU()).add("ComputeRedundancy", computeRedundancy())
.add("Status", status()).add("PubliclyAccessible", publiclyAccessible()).add("Endpoint", endpoint())
.add("DBShardGroupArn", dbShardGroupArn()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "DBShardGroupResourceId":
return Optional.ofNullable(clazz.cast(dbShardGroupResourceId()));
case "DBShardGroupIdentifier":
return Optional.ofNullable(clazz.cast(dbShardGroupIdentifier()));
case "DBClusterIdentifier":
return Optional.ofNullable(clazz.cast(dbClusterIdentifier()));
case "MaxACU":
return Optional.ofNullable(clazz.cast(maxACU()));
case "MinACU":
return Optional.ofNullable(clazz.cast(minACU()));
case "ComputeRedundancy":
return Optional.ofNullable(clazz.cast(computeRedundancy()));
case "Status":
return Optional.ofNullable(clazz.cast(status()));
case "PubliclyAccessible":
return Optional.ofNullable(clazz.cast(publiclyAccessible()));
case "Endpoint":
return Optional.ofNullable(clazz.cast(endpoint()));
case "DBShardGroupArn":
return Optional.ofNullable(clazz.cast(dbShardGroupArn()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function