
software.amazon.awssdk.services.storagegateway.model.TapeArchive Maven / Gradle / Ivy
/*
* 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.storagegateway.model;
import java.beans.Transient;
import java.io.Serializable;
import java.time.Instant;
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;
/**
*
* Represents a virtual tape that is archived in the virtual tape shelf (VTS).
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class TapeArchive implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField TAPE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TapeARN").getter(getter(TapeArchive::tapeARN)).setter(setter(Builder::tapeARN))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TapeARN").build()).build();
private static final SdkField TAPE_BARCODE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TapeBarcode").getter(getter(TapeArchive::tapeBarcode)).setter(setter(Builder::tapeBarcode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TapeBarcode").build()).build();
private static final SdkField TAPE_CREATED_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("TapeCreatedDate").getter(getter(TapeArchive::tapeCreatedDate)).setter(setter(Builder::tapeCreatedDate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TapeCreatedDate").build()).build();
private static final SdkField TAPE_SIZE_IN_BYTES_FIELD = SdkField. builder(MarshallingType.LONG)
.memberName("TapeSizeInBytes").getter(getter(TapeArchive::tapeSizeInBytes)).setter(setter(Builder::tapeSizeInBytes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TapeSizeInBytes").build()).build();
private static final SdkField COMPLETION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("CompletionTime").getter(getter(TapeArchive::completionTime)).setter(setter(Builder::completionTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CompletionTime").build()).build();
private static final SdkField RETRIEVED_TO_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RetrievedTo").getter(getter(TapeArchive::retrievedTo)).setter(setter(Builder::retrievedTo))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RetrievedTo").build()).build();
private static final SdkField TAPE_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TapeStatus").getter(getter(TapeArchive::tapeStatus)).setter(setter(Builder::tapeStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TapeStatus").build()).build();
private static final SdkField TAPE_USED_IN_BYTES_FIELD = SdkField. builder(MarshallingType.LONG)
.memberName("TapeUsedInBytes").getter(getter(TapeArchive::tapeUsedInBytes)).setter(setter(Builder::tapeUsedInBytes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TapeUsedInBytes").build()).build();
private static final SdkField KMS_KEY_FIELD = SdkField. builder(MarshallingType.STRING).memberName("KMSKey")
.getter(getter(TapeArchive::kmsKey)).setter(setter(Builder::kmsKey))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KMSKey").build()).build();
private static final SdkField POOL_ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("PoolId")
.getter(getter(TapeArchive::poolId)).setter(setter(Builder::poolId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PoolId").build()).build();
private static final SdkField WORM_FIELD = SdkField. builder(MarshallingType.BOOLEAN).memberName("Worm")
.getter(getter(TapeArchive::worm)).setter(setter(Builder::worm))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Worm").build()).build();
private static final SdkField RETENTION_START_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("RetentionStartDate").getter(getter(TapeArchive::retentionStartDate))
.setter(setter(Builder::retentionStartDate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RetentionStartDate").build())
.build();
private static final SdkField POOL_ENTRY_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("PoolEntryDate").getter(getter(TapeArchive::poolEntryDate)).setter(setter(Builder::poolEntryDate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PoolEntryDate").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(TAPE_ARN_FIELD,
TAPE_BARCODE_FIELD, TAPE_CREATED_DATE_FIELD, TAPE_SIZE_IN_BYTES_FIELD, COMPLETION_TIME_FIELD, RETRIEVED_TO_FIELD,
TAPE_STATUS_FIELD, TAPE_USED_IN_BYTES_FIELD, KMS_KEY_FIELD, POOL_ID_FIELD, WORM_FIELD, RETENTION_START_DATE_FIELD,
POOL_ENTRY_DATE_FIELD));
private static final long serialVersionUID = 1L;
private final String tapeARN;
private final String tapeBarcode;
private final Instant tapeCreatedDate;
private final Long tapeSizeInBytes;
private final Instant completionTime;
private final String retrievedTo;
private final String tapeStatus;
private final Long tapeUsedInBytes;
private final String kmsKey;
private final String poolId;
private final Boolean worm;
private final Instant retentionStartDate;
private final Instant poolEntryDate;
private TapeArchive(BuilderImpl builder) {
this.tapeARN = builder.tapeARN;
this.tapeBarcode = builder.tapeBarcode;
this.tapeCreatedDate = builder.tapeCreatedDate;
this.tapeSizeInBytes = builder.tapeSizeInBytes;
this.completionTime = builder.completionTime;
this.retrievedTo = builder.retrievedTo;
this.tapeStatus = builder.tapeStatus;
this.tapeUsedInBytes = builder.tapeUsedInBytes;
this.kmsKey = builder.kmsKey;
this.poolId = builder.poolId;
this.worm = builder.worm;
this.retentionStartDate = builder.retentionStartDate;
this.poolEntryDate = builder.poolEntryDate;
}
/**
*
* The Amazon Resource Name (ARN) of an archived virtual tape.
*
*
* @return The Amazon Resource Name (ARN) of an archived virtual tape.
*/
public final String tapeARN() {
return tapeARN;
}
/**
*
* The barcode that identifies the archived virtual tape.
*
*
* @return The barcode that identifies the archived virtual tape.
*/
public final String tapeBarcode() {
return tapeBarcode;
}
/**
*
* The date the virtual tape was created.
*
*
* @return The date the virtual tape was created.
*/
public final Instant tapeCreatedDate() {
return tapeCreatedDate;
}
/**
*
* The size, in bytes, of the archived virtual tape.
*
*
* @return The size, in bytes, of the archived virtual tape.
*/
public final Long tapeSizeInBytes() {
return tapeSizeInBytes;
}
/**
*
* The time that the archiving of the virtual tape was completed.
*
*
* The default timestamp format is in the ISO8601 extended YYYY-MM-DD'T'HH:MM:SS'Z' format.
*
*
* @return The time that the archiving of the virtual tape was completed.
*
* The default timestamp format is in the ISO8601 extended YYYY-MM-DD'T'HH:MM:SS'Z' format.
*/
public final Instant completionTime() {
return completionTime;
}
/**
*
* The Amazon Resource Name (ARN) of the tape gateway that the virtual tape is being retrieved to.
*
*
* The virtual tape is retrieved from the virtual tape shelf (VTS).
*
*
* @return The Amazon Resource Name (ARN) of the tape gateway that the virtual tape is being retrieved to.
*
* The virtual tape is retrieved from the virtual tape shelf (VTS).
*/
public final String retrievedTo() {
return retrievedTo;
}
/**
*
* The current state of the archived virtual tape.
*
*
* @return The current state of the archived virtual tape.
*/
public final String tapeStatus() {
return tapeStatus;
}
/**
*
* The size, in bytes, of data stored on the virtual tape.
*
*
*
* This value is not available for tapes created prior to May 13, 2015.
*
*
*
* @return The size, in bytes, of data stored on the virtual tape.
*
* This value is not available for tapes created prior to May 13, 2015.
*
*/
public final Long tapeUsedInBytes() {
return tapeUsedInBytes;
}
/**
* Returns the value of the KMSKey property for this object.
*
* @return The value of the KMSKey property for this object.
*/
public final String kmsKey() {
return kmsKey;
}
/**
*
* The ID of the pool that was used to archive the tape. The tapes in this pool are archived in the S3 storage class
* that is associated with the pool.
*
*
* Valid Values: GLACIER
| DEEP_ARCHIVE
*
*
* @return The ID of the pool that was used to archive the tape. The tapes in this pool are archived in the S3
* storage class that is associated with the pool.
*
* Valid Values: GLACIER
| DEEP_ARCHIVE
*/
public final String poolId() {
return poolId;
}
/**
*
* Set to true
if the archived tape is stored as write-once-read-many (WORM).
*
*
* @return Set to true
if the archived tape is stored as write-once-read-many (WORM).
*/
public final Boolean worm() {
return worm;
}
/**
*
* If the archived tape is subject to tape retention lock, the date that the archived tape started being retained.
*
*
* @return If the archived tape is subject to tape retention lock, the date that the archived tape started being
* retained.
*/
public final Instant retentionStartDate() {
return retentionStartDate;
}
/**
*
* The time that the tape entered the custom tape pool.
*
*
* The default timestamp format is in the ISO8601 extended YYYY-MM-DD'T'HH:MM:SS'Z' format.
*
*
* @return The time that the tape entered the custom tape pool.
*
* The default timestamp format is in the ISO8601 extended YYYY-MM-DD'T'HH:MM:SS'Z' format.
*/
public final Instant poolEntryDate() {
return poolEntryDate;
}
@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 + Objects.hashCode(tapeARN());
hashCode = 31 * hashCode + Objects.hashCode(tapeBarcode());
hashCode = 31 * hashCode + Objects.hashCode(tapeCreatedDate());
hashCode = 31 * hashCode + Objects.hashCode(tapeSizeInBytes());
hashCode = 31 * hashCode + Objects.hashCode(completionTime());
hashCode = 31 * hashCode + Objects.hashCode(retrievedTo());
hashCode = 31 * hashCode + Objects.hashCode(tapeStatus());
hashCode = 31 * hashCode + Objects.hashCode(tapeUsedInBytes());
hashCode = 31 * hashCode + Objects.hashCode(kmsKey());
hashCode = 31 * hashCode + Objects.hashCode(poolId());
hashCode = 31 * hashCode + Objects.hashCode(worm());
hashCode = 31 * hashCode + Objects.hashCode(retentionStartDate());
hashCode = 31 * hashCode + Objects.hashCode(poolEntryDate());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof TapeArchive)) {
return false;
}
TapeArchive other = (TapeArchive) obj;
return Objects.equals(tapeARN(), other.tapeARN()) && Objects.equals(tapeBarcode(), other.tapeBarcode())
&& Objects.equals(tapeCreatedDate(), other.tapeCreatedDate())
&& Objects.equals(tapeSizeInBytes(), other.tapeSizeInBytes())
&& Objects.equals(completionTime(), other.completionTime()) && Objects.equals(retrievedTo(), other.retrievedTo())
&& Objects.equals(tapeStatus(), other.tapeStatus()) && Objects.equals(tapeUsedInBytes(), other.tapeUsedInBytes())
&& Objects.equals(kmsKey(), other.kmsKey()) && Objects.equals(poolId(), other.poolId())
&& Objects.equals(worm(), other.worm()) && Objects.equals(retentionStartDate(), other.retentionStartDate())
&& Objects.equals(poolEntryDate(), other.poolEntryDate());
}
/**
* 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("TapeArchive").add("TapeARN", tapeARN()).add("TapeBarcode", tapeBarcode())
.add("TapeCreatedDate", tapeCreatedDate()).add("TapeSizeInBytes", tapeSizeInBytes())
.add("CompletionTime", completionTime()).add("RetrievedTo", retrievedTo()).add("TapeStatus", tapeStatus())
.add("TapeUsedInBytes", tapeUsedInBytes()).add("KMSKey", kmsKey()).add("PoolId", poolId()).add("Worm", worm())
.add("RetentionStartDate", retentionStartDate()).add("PoolEntryDate", poolEntryDate()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "TapeARN":
return Optional.ofNullable(clazz.cast(tapeARN()));
case "TapeBarcode":
return Optional.ofNullable(clazz.cast(tapeBarcode()));
case "TapeCreatedDate":
return Optional.ofNullable(clazz.cast(tapeCreatedDate()));
case "TapeSizeInBytes":
return Optional.ofNullable(clazz.cast(tapeSizeInBytes()));
case "CompletionTime":
return Optional.ofNullable(clazz.cast(completionTime()));
case "RetrievedTo":
return Optional.ofNullable(clazz.cast(retrievedTo()));
case "TapeStatus":
return Optional.ofNullable(clazz.cast(tapeStatus()));
case "TapeUsedInBytes":
return Optional.ofNullable(clazz.cast(tapeUsedInBytes()));
case "KMSKey":
return Optional.ofNullable(clazz.cast(kmsKey()));
case "PoolId":
return Optional.ofNullable(clazz.cast(poolId()));
case "Worm":
return Optional.ofNullable(clazz.cast(worm()));
case "RetentionStartDate":
return Optional.ofNullable(clazz.cast(retentionStartDate()));
case "PoolEntryDate":
return Optional.ofNullable(clazz.cast(poolEntryDate()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
*
* The default timestamp format is in the ISO8601 extended YYYY-MM-DD'T'HH:MM:SS'Z' format.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder completionTime(Instant completionTime);
/**
*
* The Amazon Resource Name (ARN) of the tape gateway that the virtual tape is being retrieved to.
*
*
* The virtual tape is retrieved from the virtual tape shelf (VTS).
*
*
* @param retrievedTo
* The Amazon Resource Name (ARN) of the tape gateway that the virtual tape is being retrieved to.
*
* The virtual tape is retrieved from the virtual tape shelf (VTS).
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder retrievedTo(String retrievedTo);
/**
*
* The current state of the archived virtual tape.
*
*
* @param tapeStatus
* The current state of the archived virtual tape.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tapeStatus(String tapeStatus);
/**
*
* The size, in bytes, of data stored on the virtual tape.
*
*
*
* This value is not available for tapes created prior to May 13, 2015.
*
*
*
* @param tapeUsedInBytes
* The size, in bytes, of data stored on the virtual tape.
*
* This value is not available for tapes created prior to May 13, 2015.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tapeUsedInBytes(Long tapeUsedInBytes);
/**
* Sets the value of the KMSKey property for this object.
*
* @param kmsKey
* The new value for the KMSKey property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder kmsKey(String kmsKey);
/**
*
* The ID of the pool that was used to archive the tape. The tapes in this pool are archived in the S3 storage
* class that is associated with the pool.
*
*
* Valid Values: GLACIER
| DEEP_ARCHIVE
*
*
* @param poolId
* The ID of the pool that was used to archive the tape. The tapes in this pool are archived in the S3
* storage class that is associated with the pool.
*
* Valid Values: GLACIER
| DEEP_ARCHIVE
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder poolId(String poolId);
/**
*
* Set to true
if the archived tape is stored as write-once-read-many (WORM).
*
*
* @param worm
* Set to true
if the archived tape is stored as write-once-read-many (WORM).
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder worm(Boolean worm);
/**
*
* If the archived tape is subject to tape retention lock, the date that the archived tape started being
* retained.
*
*
* @param retentionStartDate
* If the archived tape is subject to tape retention lock, the date that the archived tape started being
* retained.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder retentionStartDate(Instant retentionStartDate);
/**
*
* The time that the tape entered the custom tape pool.
*
*
* The default timestamp format is in the ISO8601 extended YYYY-MM-DD'T'HH:MM:SS'Z' format.
*
*
* @param poolEntryDate
* The time that the tape entered the custom tape pool.
*
* The default timestamp format is in the ISO8601 extended YYYY-MM-DD'T'HH:MM:SS'Z' format.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder poolEntryDate(Instant poolEntryDate);
}
static final class BuilderImpl implements Builder {
private String tapeARN;
private String tapeBarcode;
private Instant tapeCreatedDate;
private Long tapeSizeInBytes;
private Instant completionTime;
private String retrievedTo;
private String tapeStatus;
private Long tapeUsedInBytes;
private String kmsKey;
private String poolId;
private Boolean worm;
private Instant retentionStartDate;
private Instant poolEntryDate;
private BuilderImpl() {
}
private BuilderImpl(TapeArchive model) {
tapeARN(model.tapeARN);
tapeBarcode(model.tapeBarcode);
tapeCreatedDate(model.tapeCreatedDate);
tapeSizeInBytes(model.tapeSizeInBytes);
completionTime(model.completionTime);
retrievedTo(model.retrievedTo);
tapeStatus(model.tapeStatus);
tapeUsedInBytes(model.tapeUsedInBytes);
kmsKey(model.kmsKey);
poolId(model.poolId);
worm(model.worm);
retentionStartDate(model.retentionStartDate);
poolEntryDate(model.poolEntryDate);
}
public final String getTapeARN() {
return tapeARN;
}
public final void setTapeARN(String tapeARN) {
this.tapeARN = tapeARN;
}
@Override
@Transient
public final Builder tapeARN(String tapeARN) {
this.tapeARN = tapeARN;
return this;
}
public final String getTapeBarcode() {
return tapeBarcode;
}
public final void setTapeBarcode(String tapeBarcode) {
this.tapeBarcode = tapeBarcode;
}
@Override
@Transient
public final Builder tapeBarcode(String tapeBarcode) {
this.tapeBarcode = tapeBarcode;
return this;
}
public final Instant getTapeCreatedDate() {
return tapeCreatedDate;
}
public final void setTapeCreatedDate(Instant tapeCreatedDate) {
this.tapeCreatedDate = tapeCreatedDate;
}
@Override
@Transient
public final Builder tapeCreatedDate(Instant tapeCreatedDate) {
this.tapeCreatedDate = tapeCreatedDate;
return this;
}
public final Long getTapeSizeInBytes() {
return tapeSizeInBytes;
}
public final void setTapeSizeInBytes(Long tapeSizeInBytes) {
this.tapeSizeInBytes = tapeSizeInBytes;
}
@Override
@Transient
public final Builder tapeSizeInBytes(Long tapeSizeInBytes) {
this.tapeSizeInBytes = tapeSizeInBytes;
return this;
}
public final Instant getCompletionTime() {
return completionTime;
}
public final void setCompletionTime(Instant completionTime) {
this.completionTime = completionTime;
}
@Override
@Transient
public final Builder completionTime(Instant completionTime) {
this.completionTime = completionTime;
return this;
}
public final String getRetrievedTo() {
return retrievedTo;
}
public final void setRetrievedTo(String retrievedTo) {
this.retrievedTo = retrievedTo;
}
@Override
@Transient
public final Builder retrievedTo(String retrievedTo) {
this.retrievedTo = retrievedTo;
return this;
}
public final String getTapeStatus() {
return tapeStatus;
}
public final void setTapeStatus(String tapeStatus) {
this.tapeStatus = tapeStatus;
}
@Override
@Transient
public final Builder tapeStatus(String tapeStatus) {
this.tapeStatus = tapeStatus;
return this;
}
public final Long getTapeUsedInBytes() {
return tapeUsedInBytes;
}
public final void setTapeUsedInBytes(Long tapeUsedInBytes) {
this.tapeUsedInBytes = tapeUsedInBytes;
}
@Override
@Transient
public final Builder tapeUsedInBytes(Long tapeUsedInBytes) {
this.tapeUsedInBytes = tapeUsedInBytes;
return this;
}
public final String getKmsKey() {
return kmsKey;
}
public final void setKmsKey(String kmsKey) {
this.kmsKey = kmsKey;
}
@Override
@Transient
public final Builder kmsKey(String kmsKey) {
this.kmsKey = kmsKey;
return this;
}
public final String getPoolId() {
return poolId;
}
public final void setPoolId(String poolId) {
this.poolId = poolId;
}
@Override
@Transient
public final Builder poolId(String poolId) {
this.poolId = poolId;
return this;
}
public final Boolean getWorm() {
return worm;
}
public final void setWorm(Boolean worm) {
this.worm = worm;
}
@Override
@Transient
public final Builder worm(Boolean worm) {
this.worm = worm;
return this;
}
public final Instant getRetentionStartDate() {
return retentionStartDate;
}
public final void setRetentionStartDate(Instant retentionStartDate) {
this.retentionStartDate = retentionStartDate;
}
@Override
@Transient
public final Builder retentionStartDate(Instant retentionStartDate) {
this.retentionStartDate = retentionStartDate;
return this;
}
public final Instant getPoolEntryDate() {
return poolEntryDate;
}
public final void setPoolEntryDate(Instant poolEntryDate) {
this.poolEntryDate = poolEntryDate;
}
@Override
@Transient
public final Builder poolEntryDate(Instant poolEntryDate) {
this.poolEntryDate = poolEntryDate;
return this;
}
@Override
public TapeArchive build() {
return new TapeArchive(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}