software.amazon.awssdk.services.neptune.model.RestoreDbClusterFromSnapshotRequest Maven / Gradle / Ivy
Show all versions of neptune 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.neptune.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 RestoreDbClusterFromSnapshotRequest extends NeptuneRequest implements
ToCopyableBuilder {
private static final SdkField> AVAILABILITY_ZONES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("AvailabilityZones")
.getter(getter(RestoreDbClusterFromSnapshotRequest::availabilityZones))
.setter(setter(Builder::availabilityZones))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AvailabilityZones").build(),
ListTrait
.builder()
.memberLocationName("AvailabilityZone")
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("AvailabilityZone").build()).build()).build()).build();
private static final SdkField DB_CLUSTER_IDENTIFIER_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DBClusterIdentifier").getter(getter(RestoreDbClusterFromSnapshotRequest::dbClusterIdentifier))
.setter(setter(Builder::dbClusterIdentifier))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DBClusterIdentifier").build())
.build();
private static final SdkField SNAPSHOT_IDENTIFIER_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SnapshotIdentifier").getter(getter(RestoreDbClusterFromSnapshotRequest::snapshotIdentifier))
.setter(setter(Builder::snapshotIdentifier))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SnapshotIdentifier").build())
.build();
private static final SdkField ENGINE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Engine")
.getter(getter(RestoreDbClusterFromSnapshotRequest::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(RestoreDbClusterFromSnapshotRequest::engineVersion))
.setter(setter(Builder::engineVersion))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EngineVersion").build()).build();
private static final SdkField PORT_FIELD = SdkField. builder(MarshallingType.INTEGER).memberName("Port")
.getter(getter(RestoreDbClusterFromSnapshotRequest::port)).setter(setter(Builder::port))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Port").build()).build();
private static final SdkField DB_SUBNET_GROUP_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DBSubnetGroupName").getter(getter(RestoreDbClusterFromSnapshotRequest::dbSubnetGroupName))
.setter(setter(Builder::dbSubnetGroupName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DBSubnetGroupName").build()).build();
private static final SdkField DATABASE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DatabaseName").getter(getter(RestoreDbClusterFromSnapshotRequest::databaseName))
.setter(setter(Builder::databaseName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DatabaseName").build()).build();
private static final SdkField OPTION_GROUP_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("OptionGroupName").getter(getter(RestoreDbClusterFromSnapshotRequest::optionGroupName))
.setter(setter(Builder::optionGroupName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OptionGroupName").build()).build();
private static final SdkField> VPC_SECURITY_GROUP_IDS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("VpcSecurityGroupIds")
.getter(getter(RestoreDbClusterFromSnapshotRequest::vpcSecurityGroupIds))
.setter(setter(Builder::vpcSecurityGroupIds))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VpcSecurityGroupIds").build(),
ListTrait
.builder()
.memberLocationName("VpcSecurityGroupId")
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("VpcSecurityGroupId").build()).build()).build()).build();
private static final SdkField> TAGS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Tags")
.getter(getter(RestoreDbClusterFromSnapshotRequest::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 SdkField KMS_KEY_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("KmsKeyId").getter(getter(RestoreDbClusterFromSnapshotRequest::kmsKeyId))
.setter(setter(Builder::kmsKeyId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KmsKeyId").build()).build();
private static final SdkField ENABLE_IAM_DATABASE_AUTHENTICATION_FIELD = SdkField
. builder(MarshallingType.BOOLEAN)
.memberName("EnableIAMDatabaseAuthentication")
.getter(getter(RestoreDbClusterFromSnapshotRequest::enableIAMDatabaseAuthentication))
.setter(setter(Builder::enableIAMDatabaseAuthentication))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EnableIAMDatabaseAuthentication")
.build()).build();
private static final SdkField> ENABLE_CLOUDWATCH_LOGS_EXPORTS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("EnableCloudwatchLogsExports")
.getter(getter(RestoreDbClusterFromSnapshotRequest::enableCloudwatchLogsExports))
.setter(setter(Builder::enableCloudwatchLogsExports))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EnableCloudwatchLogsExports")
.build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField DB_CLUSTER_PARAMETER_GROUP_NAME_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("DBClusterParameterGroupName")
.getter(getter(RestoreDbClusterFromSnapshotRequest::dbClusterParameterGroupName))
.setter(setter(Builder::dbClusterParameterGroupName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DBClusterParameterGroupName")
.build()).build();
private static final SdkField DELETION_PROTECTION_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("DeletionProtection").getter(getter(RestoreDbClusterFromSnapshotRequest::deletionProtection))
.setter(setter(Builder::deletionProtection))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeletionProtection").build())
.build();
private static final SdkField COPY_TAGS_TO_SNAPSHOT_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("CopyTagsToSnapshot").getter(getter(RestoreDbClusterFromSnapshotRequest::copyTagsToSnapshot))
.setter(setter(Builder::copyTagsToSnapshot))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CopyTagsToSnapshot").build())
.build();
private static final SdkField SERVERLESS_V2_SCALING_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("ServerlessV2ScalingConfiguration")
.getter(getter(RestoreDbClusterFromSnapshotRequest::serverlessV2ScalingConfiguration))
.setter(setter(Builder::serverlessV2ScalingConfiguration))
.constructor(ServerlessV2ScalingConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ServerlessV2ScalingConfiguration")
.build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(AVAILABILITY_ZONES_FIELD,
DB_CLUSTER_IDENTIFIER_FIELD, SNAPSHOT_IDENTIFIER_FIELD, ENGINE_FIELD, ENGINE_VERSION_FIELD, PORT_FIELD,
DB_SUBNET_GROUP_NAME_FIELD, DATABASE_NAME_FIELD, OPTION_GROUP_NAME_FIELD, VPC_SECURITY_GROUP_IDS_FIELD, TAGS_FIELD,
KMS_KEY_ID_FIELD, ENABLE_IAM_DATABASE_AUTHENTICATION_FIELD, ENABLE_CLOUDWATCH_LOGS_EXPORTS_FIELD,
DB_CLUSTER_PARAMETER_GROUP_NAME_FIELD, DELETION_PROTECTION_FIELD, COPY_TAGS_TO_SNAPSHOT_FIELD,
SERVERLESS_V2_SCALING_CONFIGURATION_FIELD));
private final List availabilityZones;
private final String dbClusterIdentifier;
private final String snapshotIdentifier;
private final String engine;
private final String engineVersion;
private final Integer port;
private final String dbSubnetGroupName;
private final String databaseName;
private final String optionGroupName;
private final List vpcSecurityGroupIds;
private final List tags;
private final String kmsKeyId;
private final Boolean enableIAMDatabaseAuthentication;
private final List enableCloudwatchLogsExports;
private final String dbClusterParameterGroupName;
private final Boolean deletionProtection;
private final Boolean copyTagsToSnapshot;
private final ServerlessV2ScalingConfiguration serverlessV2ScalingConfiguration;
private RestoreDbClusterFromSnapshotRequest(BuilderImpl builder) {
super(builder);
this.availabilityZones = builder.availabilityZones;
this.dbClusterIdentifier = builder.dbClusterIdentifier;
this.snapshotIdentifier = builder.snapshotIdentifier;
this.engine = builder.engine;
this.engineVersion = builder.engineVersion;
this.port = builder.port;
this.dbSubnetGroupName = builder.dbSubnetGroupName;
this.databaseName = builder.databaseName;
this.optionGroupName = builder.optionGroupName;
this.vpcSecurityGroupIds = builder.vpcSecurityGroupIds;
this.tags = builder.tags;
this.kmsKeyId = builder.kmsKeyId;
this.enableIAMDatabaseAuthentication = builder.enableIAMDatabaseAuthentication;
this.enableCloudwatchLogsExports = builder.enableCloudwatchLogsExports;
this.dbClusterParameterGroupName = builder.dbClusterParameterGroupName;
this.deletionProtection = builder.deletionProtection;
this.copyTagsToSnapshot = builder.copyTagsToSnapshot;
this.serverlessV2ScalingConfiguration = builder.serverlessV2ScalingConfiguration;
}
/**
* For responses, this returns true if the service returned a value for the AvailabilityZones 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 hasAvailabilityZones() {
return availabilityZones != null && !(availabilityZones instanceof SdkAutoConstructList);
}
/**
*
* Provides the list of EC2 Availability Zones that instances in the restored DB cluster can be created in.
*
*
* 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 #hasAvailabilityZones} method.
*
*
* @return Provides the list of EC2 Availability Zones that instances in the restored DB cluster can be created in.
*/
public final List availabilityZones() {
return availabilityZones;
}
/**
*
* The name of the DB cluster to create from the DB snapshot or DB cluster snapshot. This parameter isn't
* case-sensitive.
*
*
* Constraints:
*
*
* -
*
* Must contain from 1 to 63 letters, numbers, or hyphens
*
*
* -
*
* First character must be a letter
*
*
* -
*
* Cannot end with a hyphen or contain two consecutive hyphens
*
*
*
*
* Example: my-snapshot-id
*
*
* @return The name of the DB cluster to create from the DB snapshot or DB cluster snapshot. This parameter isn't
* case-sensitive.
*
* Constraints:
*
*
* -
*
* Must contain from 1 to 63 letters, numbers, or hyphens
*
*
* -
*
* First character must be a letter
*
*
* -
*
* Cannot end with a hyphen or contain two consecutive hyphens
*
*
*
*
* Example: my-snapshot-id
*/
public final String dbClusterIdentifier() {
return dbClusterIdentifier;
}
/**
*
* The identifier for the DB snapshot or DB cluster snapshot to restore from.
*
*
* You can use either the name or the Amazon Resource Name (ARN) to specify a DB cluster snapshot. However, you can
* use only the ARN to specify a DB snapshot.
*
*
* Constraints:
*
*
* -
*
* Must match the identifier of an existing Snapshot.
*
*
*
*
* @return The identifier for the DB snapshot or DB cluster snapshot to restore from.
*
* You can use either the name or the Amazon Resource Name (ARN) to specify a DB cluster snapshot. However,
* you can use only the ARN to specify a DB snapshot.
*
*
* Constraints:
*
*
* -
*
* Must match the identifier of an existing Snapshot.
*
*
*/
public final String snapshotIdentifier() {
return snapshotIdentifier;
}
/**
*
* The database engine to use for the new DB cluster.
*
*
* Default: The same as source
*
*
* Constraint: Must be compatible with the engine of the source
*
*
* @return The database engine to use for the new DB cluster.
*
* Default: The same as source
*
*
* Constraint: Must be compatible with the engine of the source
*/
public final String engine() {
return engine;
}
/**
*
* The version of the database engine to use for the new DB cluster.
*
*
* @return The version of the database engine to use for the new DB cluster.
*/
public final String engineVersion() {
return engineVersion;
}
/**
*
* The port number on which the new DB cluster accepts connections.
*
*
* Constraints: Value must be 1150-65535
*
*
* Default: The same port as the original DB cluster.
*
*
* @return The port number on which the new DB cluster accepts connections.
*
* Constraints: Value must be 1150-65535
*
*
* Default: The same port as the original DB cluster.
*/
public final Integer port() {
return port;
}
/**
*
* The name of the DB subnet group to use for the new DB cluster.
*
*
* Constraints: If supplied, must match the name of an existing DBSubnetGroup.
*
*
* Example: mySubnetgroup
*
*
* @return The name of the DB subnet group to use for the new DB cluster.
*
* Constraints: If supplied, must match the name of an existing DBSubnetGroup.
*
*
* Example: mySubnetgroup
*/
public final String dbSubnetGroupName() {
return dbSubnetGroupName;
}
/**
*
* Not supported.
*
*
* @return Not supported.
*/
public final String databaseName() {
return databaseName;
}
/**
*
* (Not supported by Neptune)
*
*
* @return (Not supported by Neptune)
*/
public final String optionGroupName() {
return optionGroupName;
}
/**
* For responses, this returns true if the service returned a value for the VpcSecurityGroupIds 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 hasVpcSecurityGroupIds() {
return vpcSecurityGroupIds != null && !(vpcSecurityGroupIds instanceof SdkAutoConstructList);
}
/**
*
* A list of VPC security groups that the new DB cluster will belong to.
*
*
* 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 #hasVpcSecurityGroupIds} method.
*
*
* @return A list of VPC security groups that the new DB cluster will belong to.
*/
public final List vpcSecurityGroupIds() {
return vpcSecurityGroupIds;
}
/**
* 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);
}
/**
*
* The tags to be assigned to the restored DB 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 The tags to be assigned to the restored DB cluster.
*/
public final List tags() {
return tags;
}
/**
*
* The Amazon KMS key identifier to use when restoring an encrypted DB cluster from a DB snapshot or DB cluster
* snapshot.
*
*
* The KMS key identifier is the Amazon Resource Name (ARN) for the KMS encryption key. If you are restoring a DB
* cluster with the same Amazon account that owns the KMS encryption key used to encrypt the new DB cluster, then
* you can use the KMS key alias instead of the ARN for the KMS encryption key.
*
*
* If you do not specify a value for the KmsKeyId
parameter, then the following will occur:
*
*
* -
*
* If the DB snapshot or DB cluster snapshot in SnapshotIdentifier
is encrypted, then the restored DB
* cluster is encrypted using the KMS key that was used to encrypt the DB snapshot or DB cluster snapshot.
*
*
* -
*
* If the DB snapshot or DB cluster snapshot in SnapshotIdentifier
is not encrypted, then the restored
* DB cluster is not encrypted.
*
*
*
*
* @return The Amazon KMS key identifier to use when restoring an encrypted DB cluster from a DB snapshot or DB
* cluster snapshot.
*
* The KMS key identifier is the Amazon Resource Name (ARN) for the KMS encryption key. If you are restoring
* a DB cluster with the same Amazon account that owns the KMS encryption key used to encrypt the new DB
* cluster, then you can use the KMS key alias instead of the ARN for the KMS encryption key.
*
*
* If you do not specify a value for the KmsKeyId
parameter, then the following will occur:
*
*
* -
*
* If the DB snapshot or DB cluster snapshot in SnapshotIdentifier
is encrypted, then the
* restored DB cluster is encrypted using the KMS key that was used to encrypt the DB snapshot or DB cluster
* snapshot.
*
*
* -
*
* If the DB snapshot or DB cluster snapshot in SnapshotIdentifier
is not encrypted, then the
* restored DB cluster is not encrypted.
*
*
*/
public final String kmsKeyId() {
return kmsKeyId;
}
/**
*
* True to enable mapping of Amazon Identity and Access Management (IAM) accounts to database accounts, and
* otherwise false.
*
*
* Default: false
*
*
* @return True to enable mapping of Amazon Identity and Access Management (IAM) accounts to database accounts, and
* otherwise false.
*
* Default: false
*/
public final Boolean enableIAMDatabaseAuthentication() {
return enableIAMDatabaseAuthentication;
}
/**
* For responses, this returns true if the service returned a value for the EnableCloudwatchLogsExports 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 hasEnableCloudwatchLogsExports() {
return enableCloudwatchLogsExports != null && !(enableCloudwatchLogsExports instanceof SdkAutoConstructList);
}
/**
*
* The list of logs that the restored DB cluster is to export to Amazon CloudWatch Logs.
*
*
* 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 #hasEnableCloudwatchLogsExports} method.
*
*
* @return The list of logs that the restored DB cluster is to export to Amazon CloudWatch Logs.
*/
public final List enableCloudwatchLogsExports() {
return enableCloudwatchLogsExports;
}
/**
*
* The name of the DB cluster parameter group to associate with the new DB cluster.
*
*
* Constraints:
*
*
* -
*
* If supplied, must match the name of an existing DBClusterParameterGroup.
*
*
*
*
* @return The name of the DB cluster parameter group to associate with the new DB cluster.
*
* Constraints:
*
*
* -
*
* If supplied, must match the name of an existing DBClusterParameterGroup.
*
*
*/
public final String dbClusterParameterGroupName() {
return dbClusterParameterGroupName;
}
/**
*
* A value that indicates whether the DB cluster has deletion protection enabled. The database can't be deleted when
* deletion protection is enabled. By default, deletion protection is disabled.
*
*
* @return A value that indicates whether the DB cluster has deletion protection enabled. The database can't be
* deleted when deletion protection is enabled. By default, deletion protection is disabled.
*/
public final Boolean deletionProtection() {
return deletionProtection;
}
/**
*
* If set to true
, tags are copied to any snapshot of the restored DB cluster that is created.
*
*
* @return If set to true
, tags are copied to any snapshot of the restored DB cluster that is
* created.
*/
public final Boolean copyTagsToSnapshot() {
return copyTagsToSnapshot;
}
/**
* Returns the value of the ServerlessV2ScalingConfiguration property for this object.
*
* @return The value of the ServerlessV2ScalingConfiguration property for this object.
*/
public final ServerlessV2ScalingConfiguration serverlessV2ScalingConfiguration() {
return serverlessV2ScalingConfiguration;
}
@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(hasAvailabilityZones() ? availabilityZones() : null);
hashCode = 31 * hashCode + Objects.hashCode(dbClusterIdentifier());
hashCode = 31 * hashCode + Objects.hashCode(snapshotIdentifier());
hashCode = 31 * hashCode + Objects.hashCode(engine());
hashCode = 31 * hashCode + Objects.hashCode(engineVersion());
hashCode = 31 * hashCode + Objects.hashCode(port());
hashCode = 31 * hashCode + Objects.hashCode(dbSubnetGroupName());
hashCode = 31 * hashCode + Objects.hashCode(databaseName());
hashCode = 31 * hashCode + Objects.hashCode(optionGroupName());
hashCode = 31 * hashCode + Objects.hashCode(hasVpcSecurityGroupIds() ? vpcSecurityGroupIds() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null);
hashCode = 31 * hashCode + Objects.hashCode(kmsKeyId());
hashCode = 31 * hashCode + Objects.hashCode(enableIAMDatabaseAuthentication());
hashCode = 31 * hashCode + Objects.hashCode(hasEnableCloudwatchLogsExports() ? enableCloudwatchLogsExports() : null);
hashCode = 31 * hashCode + Objects.hashCode(dbClusterParameterGroupName());
hashCode = 31 * hashCode + Objects.hashCode(deletionProtection());
hashCode = 31 * hashCode + Objects.hashCode(copyTagsToSnapshot());
hashCode = 31 * hashCode + Objects.hashCode(serverlessV2ScalingConfiguration());
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 RestoreDbClusterFromSnapshotRequest)) {
return false;
}
RestoreDbClusterFromSnapshotRequest other = (RestoreDbClusterFromSnapshotRequest) obj;
return hasAvailabilityZones() == other.hasAvailabilityZones()
&& Objects.equals(availabilityZones(), other.availabilityZones())
&& Objects.equals(dbClusterIdentifier(), other.dbClusterIdentifier())
&& Objects.equals(snapshotIdentifier(), other.snapshotIdentifier()) && Objects.equals(engine(), other.engine())
&& Objects.equals(engineVersion(), other.engineVersion()) && Objects.equals(port(), other.port())
&& Objects.equals(dbSubnetGroupName(), other.dbSubnetGroupName())
&& Objects.equals(databaseName(), other.databaseName())
&& Objects.equals(optionGroupName(), other.optionGroupName())
&& hasVpcSecurityGroupIds() == other.hasVpcSecurityGroupIds()
&& Objects.equals(vpcSecurityGroupIds(), other.vpcSecurityGroupIds()) && hasTags() == other.hasTags()
&& Objects.equals(tags(), other.tags()) && Objects.equals(kmsKeyId(), other.kmsKeyId())
&& Objects.equals(enableIAMDatabaseAuthentication(), other.enableIAMDatabaseAuthentication())
&& hasEnableCloudwatchLogsExports() == other.hasEnableCloudwatchLogsExports()
&& Objects.equals(enableCloudwatchLogsExports(), other.enableCloudwatchLogsExports())
&& Objects.equals(dbClusterParameterGroupName(), other.dbClusterParameterGroupName())
&& Objects.equals(deletionProtection(), other.deletionProtection())
&& Objects.equals(copyTagsToSnapshot(), other.copyTagsToSnapshot())
&& Objects.equals(serverlessV2ScalingConfiguration(), other.serverlessV2ScalingConfiguration());
}
/**
* 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("RestoreDbClusterFromSnapshotRequest")
.add("AvailabilityZones", hasAvailabilityZones() ? availabilityZones() : null)
.add("DBClusterIdentifier", dbClusterIdentifier()).add("SnapshotIdentifier", snapshotIdentifier())
.add("Engine", engine()).add("EngineVersion", engineVersion()).add("Port", port())
.add("DBSubnetGroupName", dbSubnetGroupName()).add("DatabaseName", databaseName())
.add("OptionGroupName", optionGroupName())
.add("VpcSecurityGroupIds", hasVpcSecurityGroupIds() ? vpcSecurityGroupIds() : null)
.add("Tags", hasTags() ? tags() : null).add("KmsKeyId", kmsKeyId())
.add("EnableIAMDatabaseAuthentication", enableIAMDatabaseAuthentication())
.add("EnableCloudwatchLogsExports", hasEnableCloudwatchLogsExports() ? enableCloudwatchLogsExports() : null)
.add("DBClusterParameterGroupName", dbClusterParameterGroupName())
.add("DeletionProtection", deletionProtection()).add("CopyTagsToSnapshot", copyTagsToSnapshot())
.add("ServerlessV2ScalingConfiguration", serverlessV2ScalingConfiguration()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "AvailabilityZones":
return Optional.ofNullable(clazz.cast(availabilityZones()));
case "DBClusterIdentifier":
return Optional.ofNullable(clazz.cast(dbClusterIdentifier()));
case "SnapshotIdentifier":
return Optional.ofNullable(clazz.cast(snapshotIdentifier()));
case "Engine":
return Optional.ofNullable(clazz.cast(engine()));
case "EngineVersion":
return Optional.ofNullable(clazz.cast(engineVersion()));
case "Port":
return Optional.ofNullable(clazz.cast(port()));
case "DBSubnetGroupName":
return Optional.ofNullable(clazz.cast(dbSubnetGroupName()));
case "DatabaseName":
return Optional.ofNullable(clazz.cast(databaseName()));
case "OptionGroupName":
return Optional.ofNullable(clazz.cast(optionGroupName()));
case "VpcSecurityGroupIds":
return Optional.ofNullable(clazz.cast(vpcSecurityGroupIds()));
case "Tags":
return Optional.ofNullable(clazz.cast(tags()));
case "KmsKeyId":
return Optional.ofNullable(clazz.cast(kmsKeyId()));
case "EnableIAMDatabaseAuthentication":
return Optional.ofNullable(clazz.cast(enableIAMDatabaseAuthentication()));
case "EnableCloudwatchLogsExports":
return Optional.ofNullable(clazz.cast(enableCloudwatchLogsExports()));
case "DBClusterParameterGroupName":
return Optional.ofNullable(clazz.cast(dbClusterParameterGroupName()));
case "DeletionProtection":
return Optional.ofNullable(clazz.cast(deletionProtection()));
case "CopyTagsToSnapshot":
return Optional.ofNullable(clazz.cast(copyTagsToSnapshot()));
case "ServerlessV2ScalingConfiguration":
return Optional.ofNullable(clazz.cast(serverlessV2ScalingConfiguration()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function