software.amazon.awssdk.services.redshift.model.Snapshot Maven / Gradle / Ivy
/*
* Copyright 2014-2019 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.redshift.model;
import java.io.Serializable;
import java.time.Instant;
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.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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Describes a snapshot.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class Snapshot implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField SNAPSHOT_IDENTIFIER_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Snapshot::snapshotIdentifier)).setter(setter(Builder::snapshotIdentifier))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SnapshotIdentifier").build())
.build();
private static final SdkField CLUSTER_IDENTIFIER_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Snapshot::clusterIdentifier)).setter(setter(Builder::clusterIdentifier))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ClusterIdentifier").build()).build();
private static final SdkField SNAPSHOT_CREATE_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.getter(getter(Snapshot::snapshotCreateTime)).setter(setter(Builder::snapshotCreateTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SnapshotCreateTime").build())
.build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Snapshot::status)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build();
private static final SdkField PORT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.getter(getter(Snapshot::port)).setter(setter(Builder::port))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Port").build()).build();
private static final SdkField AVAILABILITY_ZONE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Snapshot::availabilityZone)).setter(setter(Builder::availabilityZone))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AvailabilityZone").build()).build();
private static final SdkField CLUSTER_CREATE_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.getter(getter(Snapshot::clusterCreateTime)).setter(setter(Builder::clusterCreateTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ClusterCreateTime").build()).build();
private static final SdkField MASTER_USERNAME_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Snapshot::masterUsername)).setter(setter(Builder::masterUsername))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MasterUsername").build()).build();
private static final SdkField CLUSTER_VERSION_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Snapshot::clusterVersion)).setter(setter(Builder::clusterVersion))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ClusterVersion").build()).build();
private static final SdkField SNAPSHOT_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Snapshot::snapshotType)).setter(setter(Builder::snapshotType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SnapshotType").build()).build();
private static final SdkField NODE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Snapshot::nodeType)).setter(setter(Builder::nodeType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NodeType").build()).build();
private static final SdkField NUMBER_OF_NODES_FIELD = SdkField. builder(MarshallingType.INTEGER)
.getter(getter(Snapshot::numberOfNodes)).setter(setter(Builder::numberOfNodes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NumberOfNodes").build()).build();
private static final SdkField DB_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Snapshot::dbName)).setter(setter(Builder::dbName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DBName").build()).build();
private static final SdkField VPC_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Snapshot::vpcId)).setter(setter(Builder::vpcId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VpcId").build()).build();
private static final SdkField ENCRYPTED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.getter(getter(Snapshot::encrypted)).setter(setter(Builder::encrypted))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Encrypted").build()).build();
private static final SdkField KMS_KEY_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Snapshot::kmsKeyId)).setter(setter(Builder::kmsKeyId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KmsKeyId").build()).build();
private static final SdkField ENCRYPTED_WITH_HSM_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.getter(getter(Snapshot::encryptedWithHSM)).setter(setter(Builder::encryptedWithHSM))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EncryptedWithHSM").build()).build();
private static final SdkField> ACCOUNTS_WITH_RESTORE_ACCESS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.getter(getter(Snapshot::accountsWithRestoreAccess))
.setter(setter(Builder::accountsWithRestoreAccess))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AccountsWithRestoreAccess").build(),
ListTrait
.builder()
.memberLocationName("AccountWithRestoreAccess")
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(AccountWithRestoreAccess::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("AccountWithRestoreAccess").build()).build()).build()).build();
private static final SdkField OWNER_ACCOUNT_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Snapshot::ownerAccount)).setter(setter(Builder::ownerAccount))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OwnerAccount").build()).build();
private static final SdkField TOTAL_BACKUP_SIZE_IN_MEGA_BYTES_FIELD = SdkField
. builder(MarshallingType.DOUBLE)
.getter(getter(Snapshot::totalBackupSizeInMegaBytes))
.setter(setter(Builder::totalBackupSizeInMegaBytes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TotalBackupSizeInMegaBytes").build())
.build();
private static final SdkField ACTUAL_INCREMENTAL_BACKUP_SIZE_IN_MEGA_BYTES_FIELD = SdkField
. builder(MarshallingType.DOUBLE)
.getter(getter(Snapshot::actualIncrementalBackupSizeInMegaBytes))
.setter(setter(Builder::actualIncrementalBackupSizeInMegaBytes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("ActualIncrementalBackupSizeInMegaBytes").build()).build();
private static final SdkField BACKUP_PROGRESS_IN_MEGA_BYTES_FIELD = SdkField. builder(MarshallingType.DOUBLE)
.getter(getter(Snapshot::backupProgressInMegaBytes)).setter(setter(Builder::backupProgressInMegaBytes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BackupProgressInMegaBytes").build())
.build();
private static final SdkField CURRENT_BACKUP_RATE_IN_MEGA_BYTES_PER_SECOND_FIELD = SdkField
. builder(MarshallingType.DOUBLE)
.getter(getter(Snapshot::currentBackupRateInMegaBytesPerSecond))
.setter(setter(Builder::currentBackupRateInMegaBytesPerSecond))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("CurrentBackupRateInMegaBytesPerSecond").build()).build();
private static final SdkField ESTIMATED_SECONDS_TO_COMPLETION_FIELD = SdkField
. builder(MarshallingType.LONG)
.getter(getter(Snapshot::estimatedSecondsToCompletion))
.setter(setter(Builder::estimatedSecondsToCompletion))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EstimatedSecondsToCompletion")
.build()).build();
private static final SdkField ELAPSED_TIME_IN_SECONDS_FIELD = SdkField. builder(MarshallingType.LONG)
.getter(getter(Snapshot::elapsedTimeInSeconds)).setter(setter(Builder::elapsedTimeInSeconds))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ElapsedTimeInSeconds").build())
.build();
private static final SdkField SOURCE_REGION_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Snapshot::sourceRegion)).setter(setter(Builder::sourceRegion))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceRegion").build()).build();
private static final SdkField> TAGS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.getter(getter(Snapshot::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> RESTORABLE_NODE_TYPES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.getter(getter(Snapshot::restorableNodeTypes))
.setter(setter(Builder::restorableNodeTypes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RestorableNodeTypes").build(),
ListTrait
.builder()
.memberLocationName("NodeType")
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("NodeType").build()).build()).build()).build();
private static final SdkField ENHANCED_VPC_ROUTING_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.getter(getter(Snapshot::enhancedVpcRouting)).setter(setter(Builder::enhancedVpcRouting))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EnhancedVpcRouting").build())
.build();
private static final SdkField MAINTENANCE_TRACK_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Snapshot::maintenanceTrackName)).setter(setter(Builder::maintenanceTrackName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaintenanceTrackName").build())
.build();
private static final SdkField MANUAL_SNAPSHOT_RETENTION_PERIOD_FIELD = SdkField
. builder(MarshallingType.INTEGER)
.getter(getter(Snapshot::manualSnapshotRetentionPeriod))
.setter(setter(Builder::manualSnapshotRetentionPeriod))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ManualSnapshotRetentionPeriod")
.build()).build();
private static final SdkField MANUAL_SNAPSHOT_REMAINING_DAYS_FIELD = SdkField
. builder(MarshallingType.INTEGER)
.getter(getter(Snapshot::manualSnapshotRemainingDays))
.setter(setter(Builder::manualSnapshotRemainingDays))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ManualSnapshotRemainingDays")
.build()).build();
private static final SdkField SNAPSHOT_RETENTION_START_TIME_FIELD = SdkField
. builder(MarshallingType.INSTANT)
.getter(getter(Snapshot::snapshotRetentionStartTime))
.setter(setter(Builder::snapshotRetentionStartTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SnapshotRetentionStartTime").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(SNAPSHOT_IDENTIFIER_FIELD,
CLUSTER_IDENTIFIER_FIELD, SNAPSHOT_CREATE_TIME_FIELD, STATUS_FIELD, PORT_FIELD, AVAILABILITY_ZONE_FIELD,
CLUSTER_CREATE_TIME_FIELD, MASTER_USERNAME_FIELD, CLUSTER_VERSION_FIELD, SNAPSHOT_TYPE_FIELD, NODE_TYPE_FIELD,
NUMBER_OF_NODES_FIELD, DB_NAME_FIELD, VPC_ID_FIELD, ENCRYPTED_FIELD, KMS_KEY_ID_FIELD, ENCRYPTED_WITH_HSM_FIELD,
ACCOUNTS_WITH_RESTORE_ACCESS_FIELD, OWNER_ACCOUNT_FIELD, TOTAL_BACKUP_SIZE_IN_MEGA_BYTES_FIELD,
ACTUAL_INCREMENTAL_BACKUP_SIZE_IN_MEGA_BYTES_FIELD, BACKUP_PROGRESS_IN_MEGA_BYTES_FIELD,
CURRENT_BACKUP_RATE_IN_MEGA_BYTES_PER_SECOND_FIELD, ESTIMATED_SECONDS_TO_COMPLETION_FIELD,
ELAPSED_TIME_IN_SECONDS_FIELD, SOURCE_REGION_FIELD, TAGS_FIELD, RESTORABLE_NODE_TYPES_FIELD,
ENHANCED_VPC_ROUTING_FIELD, MAINTENANCE_TRACK_NAME_FIELD, MANUAL_SNAPSHOT_RETENTION_PERIOD_FIELD,
MANUAL_SNAPSHOT_REMAINING_DAYS_FIELD, SNAPSHOT_RETENTION_START_TIME_FIELD));
private static final long serialVersionUID = 1L;
private final String snapshotIdentifier;
private final String clusterIdentifier;
private final Instant snapshotCreateTime;
private final String status;
private final Integer port;
private final String availabilityZone;
private final Instant clusterCreateTime;
private final String masterUsername;
private final String clusterVersion;
private final String snapshotType;
private final String nodeType;
private final Integer numberOfNodes;
private final String dbName;
private final String vpcId;
private final Boolean encrypted;
private final String kmsKeyId;
private final Boolean encryptedWithHSM;
private final List accountsWithRestoreAccess;
private final String ownerAccount;
private final Double totalBackupSizeInMegaBytes;
private final Double actualIncrementalBackupSizeInMegaBytes;
private final Double backupProgressInMegaBytes;
private final Double currentBackupRateInMegaBytesPerSecond;
private final Long estimatedSecondsToCompletion;
private final Long elapsedTimeInSeconds;
private final String sourceRegion;
private final List tags;
private final List restorableNodeTypes;
private final Boolean enhancedVpcRouting;
private final String maintenanceTrackName;
private final Integer manualSnapshotRetentionPeriod;
private final Integer manualSnapshotRemainingDays;
private final Instant snapshotRetentionStartTime;
private Snapshot(BuilderImpl builder) {
this.snapshotIdentifier = builder.snapshotIdentifier;
this.clusterIdentifier = builder.clusterIdentifier;
this.snapshotCreateTime = builder.snapshotCreateTime;
this.status = builder.status;
this.port = builder.port;
this.availabilityZone = builder.availabilityZone;
this.clusterCreateTime = builder.clusterCreateTime;
this.masterUsername = builder.masterUsername;
this.clusterVersion = builder.clusterVersion;
this.snapshotType = builder.snapshotType;
this.nodeType = builder.nodeType;
this.numberOfNodes = builder.numberOfNodes;
this.dbName = builder.dbName;
this.vpcId = builder.vpcId;
this.encrypted = builder.encrypted;
this.kmsKeyId = builder.kmsKeyId;
this.encryptedWithHSM = builder.encryptedWithHSM;
this.accountsWithRestoreAccess = builder.accountsWithRestoreAccess;
this.ownerAccount = builder.ownerAccount;
this.totalBackupSizeInMegaBytes = builder.totalBackupSizeInMegaBytes;
this.actualIncrementalBackupSizeInMegaBytes = builder.actualIncrementalBackupSizeInMegaBytes;
this.backupProgressInMegaBytes = builder.backupProgressInMegaBytes;
this.currentBackupRateInMegaBytesPerSecond = builder.currentBackupRateInMegaBytesPerSecond;
this.estimatedSecondsToCompletion = builder.estimatedSecondsToCompletion;
this.elapsedTimeInSeconds = builder.elapsedTimeInSeconds;
this.sourceRegion = builder.sourceRegion;
this.tags = builder.tags;
this.restorableNodeTypes = builder.restorableNodeTypes;
this.enhancedVpcRouting = builder.enhancedVpcRouting;
this.maintenanceTrackName = builder.maintenanceTrackName;
this.manualSnapshotRetentionPeriod = builder.manualSnapshotRetentionPeriod;
this.manualSnapshotRemainingDays = builder.manualSnapshotRemainingDays;
this.snapshotRetentionStartTime = builder.snapshotRetentionStartTime;
}
/**
*
* The snapshot identifier that is provided in the request.
*
*
* @return The snapshot identifier that is provided in the request.
*/
public String snapshotIdentifier() {
return snapshotIdentifier;
}
/**
*
* The identifier of the cluster for which the snapshot was taken.
*
*
* @return The identifier of the cluster for which the snapshot was taken.
*/
public String clusterIdentifier() {
return clusterIdentifier;
}
/**
*
* The time (in UTC format) when Amazon Redshift began the snapshot. A snapshot contains a copy of the cluster data
* as of this exact time.
*
*
* @return The time (in UTC format) when Amazon Redshift began the snapshot. A snapshot contains a copy of the
* cluster data as of this exact time.
*/
public Instant snapshotCreateTime() {
return snapshotCreateTime;
}
/**
*
* The snapshot status. The value of the status depends on the API operation used:
*
*
* -
*
* CreateClusterSnapshot and CopyClusterSnapshot returns status as "creating".
*
*
* -
*
* DescribeClusterSnapshots returns status as "creating", "available", "final snapshot", or "failed".
*
*
* -
*
* DeleteClusterSnapshot returns status as "deleted".
*
*
*
*
* @return The snapshot status. The value of the status depends on the API operation used:
*
* -
*
* CreateClusterSnapshot and CopyClusterSnapshot returns status as "creating".
*
*
* -
*
* DescribeClusterSnapshots returns status as "creating", "available", "final snapshot", or "failed".
*
*
* -
*
* DeleteClusterSnapshot returns status as "deleted".
*
*
*/
public String status() {
return status;
}
/**
*
* The port that the cluster is listening on.
*
*
* @return The port that the cluster is listening on.
*/
public Integer port() {
return port;
}
/**
*
* The Availability Zone in which the cluster was created.
*
*
* @return The Availability Zone in which the cluster was created.
*/
public String availabilityZone() {
return availabilityZone;
}
/**
*
* The time (UTC) when the cluster was originally created.
*
*
* @return The time (UTC) when the cluster was originally created.
*/
public Instant clusterCreateTime() {
return clusterCreateTime;
}
/**
*
* The master user name for the cluster.
*
*
* @return The master user name for the cluster.
*/
public String masterUsername() {
return masterUsername;
}
/**
*
* The version ID of the Amazon Redshift engine that is running on the cluster.
*
*
* @return The version ID of the Amazon Redshift engine that is running on the cluster.
*/
public String clusterVersion() {
return clusterVersion;
}
/**
*
* The snapshot type. Snapshots created using CreateClusterSnapshot and CopyClusterSnapshot are of
* type "manual".
*
*
* @return The snapshot type. Snapshots created using CreateClusterSnapshot and CopyClusterSnapshot
* are of type "manual".
*/
public String snapshotType() {
return snapshotType;
}
/**
*
* The node type of the nodes in the cluster.
*
*
* @return The node type of the nodes in the cluster.
*/
public String nodeType() {
return nodeType;
}
/**
*
* The number of nodes in the cluster.
*
*
* @return The number of nodes in the cluster.
*/
public Integer numberOfNodes() {
return numberOfNodes;
}
/**
*
* The name of the database that was created when the cluster was created.
*
*
* @return The name of the database that was created when the cluster was created.
*/
public String dbName() {
return dbName;
}
/**
*
* The VPC identifier of the cluster if the snapshot is from a cluster in a VPC. Otherwise, this field is not in the
* output.
*
*
* @return The VPC identifier of the cluster if the snapshot is from a cluster in a VPC. Otherwise, this field is
* not in the output.
*/
public String vpcId() {
return vpcId;
}
/**
*
* If true
, the data in the snapshot is encrypted at rest.
*
*
* @return If true
, the data in the snapshot is encrypted at rest.
*/
public Boolean encrypted() {
return encrypted;
}
/**
*
* The AWS Key Management Service (KMS) key ID of the encryption key that was used to encrypt data in the cluster
* from which the snapshot was taken.
*
*
* @return The AWS Key Management Service (KMS) key ID of the encryption key that was used to encrypt data in the
* cluster from which the snapshot was taken.
*/
public String kmsKeyId() {
return kmsKeyId;
}
/**
*
* A boolean that indicates whether the snapshot data is encrypted using the HSM keys of the source cluster.
* true
indicates that the data is encrypted using HSM keys.
*
*
* @return A boolean that indicates whether the snapshot data is encrypted using the HSM keys of the source cluster.
* true
indicates that the data is encrypted using HSM keys.
*/
public Boolean encryptedWithHSM() {
return encryptedWithHSM;
}
/**
*
* A list of the AWS customer accounts authorized to restore the snapshot. Returns null
if no accounts
* are authorized. Visible only to the snapshot owner.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return A list of the AWS customer accounts authorized to restore the snapshot. Returns null
if no
* accounts are authorized. Visible only to the snapshot owner.
*/
public List accountsWithRestoreAccess() {
return accountsWithRestoreAccess;
}
/**
*
* For manual snapshots, the AWS customer account used to create or copy the snapshot. For automatic snapshots, the
* owner of the cluster. The owner can perform all snapshot actions, such as sharing a manual snapshot.
*
*
* @return For manual snapshots, the AWS customer account used to create or copy the snapshot. For automatic
* snapshots, the owner of the cluster. The owner can perform all snapshot actions, such as sharing a manual
* snapshot.
*/
public String ownerAccount() {
return ownerAccount;
}
/**
*
* The size of the complete set of backup data that would be used to restore the cluster.
*
*
* @return The size of the complete set of backup data that would be used to restore the cluster.
*/
public Double totalBackupSizeInMegaBytes() {
return totalBackupSizeInMegaBytes;
}
/**
*
* The size of the incremental backup.
*
*
* @return The size of the incremental backup.
*/
public Double actualIncrementalBackupSizeInMegaBytes() {
return actualIncrementalBackupSizeInMegaBytes;
}
/**
*
* The number of megabytes that have been transferred to the snapshot backup.
*
*
* @return The number of megabytes that have been transferred to the snapshot backup.
*/
public Double backupProgressInMegaBytes() {
return backupProgressInMegaBytes;
}
/**
*
* The number of megabytes per second being transferred to the snapshot backup. Returns 0
for a
* completed backup.
*
*
* @return The number of megabytes per second being transferred to the snapshot backup. Returns 0
for a
* completed backup.
*/
public Double currentBackupRateInMegaBytesPerSecond() {
return currentBackupRateInMegaBytesPerSecond;
}
/**
*
* The estimate of the time remaining before the snapshot backup will complete. Returns 0
for a
* completed backup.
*
*
* @return The estimate of the time remaining before the snapshot backup will complete. Returns 0
for a
* completed backup.
*/
public Long estimatedSecondsToCompletion() {
return estimatedSecondsToCompletion;
}
/**
*
* The amount of time an in-progress snapshot backup has been running, or the amount of time it took a completed
* backup to finish.
*
*
* @return The amount of time an in-progress snapshot backup has been running, or the amount of time it took a
* completed backup to finish.
*/
public Long elapsedTimeInSeconds() {
return elapsedTimeInSeconds;
}
/**
*
* The source region from which the snapshot was copied.
*
*
* @return The source region from which the snapshot was copied.
*/
public String sourceRegion() {
return sourceRegion;
}
/**
*
* The list of tags for the cluster snapshot.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return The list of tags for the cluster snapshot.
*/
public List tags() {
return tags;
}
/**
*
* The list of node types that this cluster snapshot is able to restore into.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return The list of node types that this cluster snapshot is able to restore into.
*/
public List restorableNodeTypes() {
return restorableNodeTypes;
}
/**
*
* An option that specifies whether to create the cluster with enhanced VPC routing enabled. To create a cluster
* that uses enhanced VPC routing, the cluster must be in a VPC. For more information, see Enhanced VPC Routing in the
* Amazon Redshift Cluster Management Guide.
*
*
* If this option is true
, enhanced VPC routing is enabled.
*
*
* Default: false
*
*
* @return An option that specifies whether to create the cluster with enhanced VPC routing enabled. To create a
* cluster that uses enhanced VPC routing, the cluster must be in a VPC. For more information, see Enhanced VPC
* Routing in the Amazon Redshift Cluster Management Guide.
*
* If this option is true
, enhanced VPC routing is enabled.
*
*
* Default: false
*/
public Boolean enhancedVpcRouting() {
return enhancedVpcRouting;
}
/**
*
* The name of the maintenance track for the snapshot.
*
*
* @return The name of the maintenance track for the snapshot.
*/
public String maintenanceTrackName() {
return maintenanceTrackName;
}
/**
*
* The number of days that a manual snapshot is retained. If the value is -1, the manual snapshot is retained
* indefinitely.
*
*
* The value must be either -1 or an integer between 1 and 3,653.
*
*
* @return The number of days that a manual snapshot is retained. If the value is -1, the manual snapshot is
* retained indefinitely.
*
* The value must be either -1 or an integer between 1 and 3,653.
*/
public Integer manualSnapshotRetentionPeriod() {
return manualSnapshotRetentionPeriod;
}
/**
*
* The number of days until a manual snapshot will pass its retention period.
*
*
* @return The number of days until a manual snapshot will pass its retention period.
*/
public Integer manualSnapshotRemainingDays() {
return manualSnapshotRemainingDays;
}
/**
*
* A timestamp representing the start of the retention period for the snapshot.
*
*
* @return A timestamp representing the start of the retention period for the snapshot.
*/
public Instant snapshotRetentionStartTime() {
return snapshotRetentionStartTime;
}
@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 int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(snapshotIdentifier());
hashCode = 31 * hashCode + Objects.hashCode(clusterIdentifier());
hashCode = 31 * hashCode + Objects.hashCode(snapshotCreateTime());
hashCode = 31 * hashCode + Objects.hashCode(status());
hashCode = 31 * hashCode + Objects.hashCode(port());
hashCode = 31 * hashCode + Objects.hashCode(availabilityZone());
hashCode = 31 * hashCode + Objects.hashCode(clusterCreateTime());
hashCode = 31 * hashCode + Objects.hashCode(masterUsername());
hashCode = 31 * hashCode + Objects.hashCode(clusterVersion());
hashCode = 31 * hashCode + Objects.hashCode(snapshotType());
hashCode = 31 * hashCode + Objects.hashCode(nodeType());
hashCode = 31 * hashCode + Objects.hashCode(numberOfNodes());
hashCode = 31 * hashCode + Objects.hashCode(dbName());
hashCode = 31 * hashCode + Objects.hashCode(vpcId());
hashCode = 31 * hashCode + Objects.hashCode(encrypted());
hashCode = 31 * hashCode + Objects.hashCode(kmsKeyId());
hashCode = 31 * hashCode + Objects.hashCode(encryptedWithHSM());
hashCode = 31 * hashCode + Objects.hashCode(accountsWithRestoreAccess());
hashCode = 31 * hashCode + Objects.hashCode(ownerAccount());
hashCode = 31 * hashCode + Objects.hashCode(totalBackupSizeInMegaBytes());
hashCode = 31 * hashCode + Objects.hashCode(actualIncrementalBackupSizeInMegaBytes());
hashCode = 31 * hashCode + Objects.hashCode(backupProgressInMegaBytes());
hashCode = 31 * hashCode + Objects.hashCode(currentBackupRateInMegaBytesPerSecond());
hashCode = 31 * hashCode + Objects.hashCode(estimatedSecondsToCompletion());
hashCode = 31 * hashCode + Objects.hashCode(elapsedTimeInSeconds());
hashCode = 31 * hashCode + Objects.hashCode(sourceRegion());
hashCode = 31 * hashCode + Objects.hashCode(tags());
hashCode = 31 * hashCode + Objects.hashCode(restorableNodeTypes());
hashCode = 31 * hashCode + Objects.hashCode(enhancedVpcRouting());
hashCode = 31 * hashCode + Objects.hashCode(maintenanceTrackName());
hashCode = 31 * hashCode + Objects.hashCode(manualSnapshotRetentionPeriod());
hashCode = 31 * hashCode + Objects.hashCode(manualSnapshotRemainingDays());
hashCode = 31 * hashCode + Objects.hashCode(snapshotRetentionStartTime());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof Snapshot)) {
return false;
}
Snapshot other = (Snapshot) obj;
return Objects.equals(snapshotIdentifier(), other.snapshotIdentifier())
&& Objects.equals(clusterIdentifier(), other.clusterIdentifier())
&& Objects.equals(snapshotCreateTime(), other.snapshotCreateTime()) && Objects.equals(status(), other.status())
&& Objects.equals(port(), other.port()) && Objects.equals(availabilityZone(), other.availabilityZone())
&& Objects.equals(clusterCreateTime(), other.clusterCreateTime())
&& Objects.equals(masterUsername(), other.masterUsername())
&& Objects.equals(clusterVersion(), other.clusterVersion())
&& Objects.equals(snapshotType(), other.snapshotType()) && Objects.equals(nodeType(), other.nodeType())
&& Objects.equals(numberOfNodes(), other.numberOfNodes()) && Objects.equals(dbName(), other.dbName())
&& Objects.equals(vpcId(), other.vpcId()) && Objects.equals(encrypted(), other.encrypted())
&& Objects.equals(kmsKeyId(), other.kmsKeyId()) && Objects.equals(encryptedWithHSM(), other.encryptedWithHSM())
&& Objects.equals(accountsWithRestoreAccess(), other.accountsWithRestoreAccess())
&& Objects.equals(ownerAccount(), other.ownerAccount())
&& Objects.equals(totalBackupSizeInMegaBytes(), other.totalBackupSizeInMegaBytes())
&& Objects.equals(actualIncrementalBackupSizeInMegaBytes(), other.actualIncrementalBackupSizeInMegaBytes())
&& Objects.equals(backupProgressInMegaBytes(), other.backupProgressInMegaBytes())
&& Objects.equals(currentBackupRateInMegaBytesPerSecond(), other.currentBackupRateInMegaBytesPerSecond())
&& Objects.equals(estimatedSecondsToCompletion(), other.estimatedSecondsToCompletion())
&& Objects.equals(elapsedTimeInSeconds(), other.elapsedTimeInSeconds())
&& Objects.equals(sourceRegion(), other.sourceRegion()) && Objects.equals(tags(), other.tags())
&& Objects.equals(restorableNodeTypes(), other.restorableNodeTypes())
&& Objects.equals(enhancedVpcRouting(), other.enhancedVpcRouting())
&& Objects.equals(maintenanceTrackName(), other.maintenanceTrackName())
&& Objects.equals(manualSnapshotRetentionPeriod(), other.manualSnapshotRetentionPeriod())
&& Objects.equals(manualSnapshotRemainingDays(), other.manualSnapshotRemainingDays())
&& Objects.equals(snapshotRetentionStartTime(), other.snapshotRetentionStartTime());
}
/**
* 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 String toString() {
return ToString.builder("Snapshot").add("SnapshotIdentifier", snapshotIdentifier())
.add("ClusterIdentifier", clusterIdentifier()).add("SnapshotCreateTime", snapshotCreateTime())
.add("Status", status()).add("Port", port()).add("AvailabilityZone", availabilityZone())
.add("ClusterCreateTime", clusterCreateTime()).add("MasterUsername", masterUsername())
.add("ClusterVersion", clusterVersion()).add("SnapshotType", snapshotType()).add("NodeType", nodeType())
.add("NumberOfNodes", numberOfNodes()).add("DBName", dbName()).add("VpcId", vpcId())
.add("Encrypted", encrypted()).add("KmsKeyId", kmsKeyId()).add("EncryptedWithHSM", encryptedWithHSM())
.add("AccountsWithRestoreAccess", accountsWithRestoreAccess()).add("OwnerAccount", ownerAccount())
.add("TotalBackupSizeInMegaBytes", totalBackupSizeInMegaBytes())
.add("ActualIncrementalBackupSizeInMegaBytes", actualIncrementalBackupSizeInMegaBytes())
.add("BackupProgressInMegaBytes", backupProgressInMegaBytes())
.add("CurrentBackupRateInMegaBytesPerSecond", currentBackupRateInMegaBytesPerSecond())
.add("EstimatedSecondsToCompletion", estimatedSecondsToCompletion())
.add("ElapsedTimeInSeconds", elapsedTimeInSeconds()).add("SourceRegion", sourceRegion()).add("Tags", tags())
.add("RestorableNodeTypes", restorableNodeTypes()).add("EnhancedVpcRouting", enhancedVpcRouting())
.add("MaintenanceTrackName", maintenanceTrackName())
.add("ManualSnapshotRetentionPeriod", manualSnapshotRetentionPeriod())
.add("ManualSnapshotRemainingDays", manualSnapshotRemainingDays())
.add("SnapshotRetentionStartTime", snapshotRetentionStartTime()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "SnapshotIdentifier":
return Optional.ofNullable(clazz.cast(snapshotIdentifier()));
case "ClusterIdentifier":
return Optional.ofNullable(clazz.cast(clusterIdentifier()));
case "SnapshotCreateTime":
return Optional.ofNullable(clazz.cast(snapshotCreateTime()));
case "Status":
return Optional.ofNullable(clazz.cast(status()));
case "Port":
return Optional.ofNullable(clazz.cast(port()));
case "AvailabilityZone":
return Optional.ofNullable(clazz.cast(availabilityZone()));
case "ClusterCreateTime":
return Optional.ofNullable(clazz.cast(clusterCreateTime()));
case "MasterUsername":
return Optional.ofNullable(clazz.cast(masterUsername()));
case "ClusterVersion":
return Optional.ofNullable(clazz.cast(clusterVersion()));
case "SnapshotType":
return Optional.ofNullable(clazz.cast(snapshotType()));
case "NodeType":
return Optional.ofNullable(clazz.cast(nodeType()));
case "NumberOfNodes":
return Optional.ofNullable(clazz.cast(numberOfNodes()));
case "DBName":
return Optional.ofNullable(clazz.cast(dbName()));
case "VpcId":
return Optional.ofNullable(clazz.cast(vpcId()));
case "Encrypted":
return Optional.ofNullable(clazz.cast(encrypted()));
case "KmsKeyId":
return Optional.ofNullable(clazz.cast(kmsKeyId()));
case "EncryptedWithHSM":
return Optional.ofNullable(clazz.cast(encryptedWithHSM()));
case "AccountsWithRestoreAccess":
return Optional.ofNullable(clazz.cast(accountsWithRestoreAccess()));
case "OwnerAccount":
return Optional.ofNullable(clazz.cast(ownerAccount()));
case "TotalBackupSizeInMegaBytes":
return Optional.ofNullable(clazz.cast(totalBackupSizeInMegaBytes()));
case "ActualIncrementalBackupSizeInMegaBytes":
return Optional.ofNullable(clazz.cast(actualIncrementalBackupSizeInMegaBytes()));
case "BackupProgressInMegaBytes":
return Optional.ofNullable(clazz.cast(backupProgressInMegaBytes()));
case "CurrentBackupRateInMegaBytesPerSecond":
return Optional.ofNullable(clazz.cast(currentBackupRateInMegaBytesPerSecond()));
case "EstimatedSecondsToCompletion":
return Optional.ofNullable(clazz.cast(estimatedSecondsToCompletion()));
case "ElapsedTimeInSeconds":
return Optional.ofNullable(clazz.cast(elapsedTimeInSeconds()));
case "SourceRegion":
return Optional.ofNullable(clazz.cast(sourceRegion()));
case "Tags":
return Optional.ofNullable(clazz.cast(tags()));
case "RestorableNodeTypes":
return Optional.ofNullable(clazz.cast(restorableNodeTypes()));
case "EnhancedVpcRouting":
return Optional.ofNullable(clazz.cast(enhancedVpcRouting()));
case "MaintenanceTrackName":
return Optional.ofNullable(clazz.cast(maintenanceTrackName()));
case "ManualSnapshotRetentionPeriod":
return Optional.ofNullable(clazz.cast(manualSnapshotRetentionPeriod()));
case "ManualSnapshotRemainingDays":
return Optional.ofNullable(clazz.cast(manualSnapshotRemainingDays()));
case "SnapshotRetentionStartTime":
return Optional.ofNullable(clazz.cast(snapshotRetentionStartTime()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function