All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.ec2.model.Snapshot 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.ec2.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.core.util.SdkAutoConstructList;
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 DATA_ENCRYPTION_KEY_ID_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("DataEncryptionKeyId") .getter(getter(Snapshot::dataEncryptionKeyId)) .setter(setter(Builder::dataEncryptionKeyId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DataEncryptionKeyId") .unmarshallLocationName("dataEncryptionKeyId").build()).build(); private static final SdkField DESCRIPTION_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("Description") .getter(getter(Snapshot::description)) .setter(setter(Builder::description)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description") .unmarshallLocationName("description").build()).build(); private static final SdkField ENCRYPTED_FIELD = SdkField . builder(MarshallingType.BOOLEAN) .memberName("Encrypted") .getter(getter(Snapshot::encrypted)) .setter(setter(Builder::encrypted)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Encrypted") .unmarshallLocationName("encrypted").build()).build(); private static final SdkField KMS_KEY_ID_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("KmsKeyId") .getter(getter(Snapshot::kmsKeyId)) .setter(setter(Builder::kmsKeyId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KmsKeyId") .unmarshallLocationName("kmsKeyId").build()).build(); private static final SdkField OWNER_ID_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("OwnerId") .getter(getter(Snapshot::ownerId)) .setter(setter(Builder::ownerId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OwnerId") .unmarshallLocationName("ownerId").build()).build(); private static final SdkField PROGRESS_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("Progress") .getter(getter(Snapshot::progress)) .setter(setter(Builder::progress)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Progress") .unmarshallLocationName("progress").build()).build(); private static final SdkField SNAPSHOT_ID_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("SnapshotId") .getter(getter(Snapshot::snapshotId)) .setter(setter(Builder::snapshotId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SnapshotId") .unmarshallLocationName("snapshotId").build()).build(); private static final SdkField START_TIME_FIELD = SdkField . builder(MarshallingType.INSTANT) .memberName("StartTime") .getter(getter(Snapshot::startTime)) .setter(setter(Builder::startTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StartTime") .unmarshallLocationName("startTime").build()).build(); private static final SdkField STATE_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("State") .getter(getter(Snapshot::stateAsString)) .setter(setter(Builder::state)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status") .unmarshallLocationName("status").build()).build(); private static final SdkField STATE_MESSAGE_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("StateMessage") .getter(getter(Snapshot::stateMessage)) .setter(setter(Builder::stateMessage)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StatusMessage") .unmarshallLocationName("statusMessage").build()).build(); private static final SdkField VOLUME_ID_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("VolumeId") .getter(getter(Snapshot::volumeId)) .setter(setter(Builder::volumeId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VolumeId") .unmarshallLocationName("volumeId").build()).build(); private static final SdkField VOLUME_SIZE_FIELD = SdkField . builder(MarshallingType.INTEGER) .memberName("VolumeSize") .getter(getter(Snapshot::volumeSize)) .setter(setter(Builder::volumeSize)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VolumeSize") .unmarshallLocationName("volumeSize").build()).build(); private static final SdkField OWNER_ALIAS_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("OwnerAlias") .getter(getter(Snapshot::ownerAlias)) .setter(setter(Builder::ownerAlias)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OwnerAlias") .unmarshallLocationName("ownerAlias").build()).build(); private static final SdkField> TAGS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("Tags") .getter(getter(Snapshot::tags)) .setter(setter(Builder::tags)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TagSet") .unmarshallLocationName("tagSet").build(), ListTrait .builder() .memberLocationName("item") .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(Tag::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("Item").unmarshallLocationName("item").build()).build()) .build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays .asList(DATA_ENCRYPTION_KEY_ID_FIELD, DESCRIPTION_FIELD, ENCRYPTED_FIELD, KMS_KEY_ID_FIELD, OWNER_ID_FIELD, PROGRESS_FIELD, SNAPSHOT_ID_FIELD, START_TIME_FIELD, STATE_FIELD, STATE_MESSAGE_FIELD, VOLUME_ID_FIELD, VOLUME_SIZE_FIELD, OWNER_ALIAS_FIELD, TAGS_FIELD)); private static final long serialVersionUID = 1L; private final String dataEncryptionKeyId; private final String description; private final Boolean encrypted; private final String kmsKeyId; private final String ownerId; private final String progress; private final String snapshotId; private final Instant startTime; private final String state; private final String stateMessage; private final String volumeId; private final Integer volumeSize; private final String ownerAlias; private final List tags; private Snapshot(BuilderImpl builder) { this.dataEncryptionKeyId = builder.dataEncryptionKeyId; this.description = builder.description; this.encrypted = builder.encrypted; this.kmsKeyId = builder.kmsKeyId; this.ownerId = builder.ownerId; this.progress = builder.progress; this.snapshotId = builder.snapshotId; this.startTime = builder.startTime; this.state = builder.state; this.stateMessage = builder.stateMessage; this.volumeId = builder.volumeId; this.volumeSize = builder.volumeSize; this.ownerAlias = builder.ownerAlias; this.tags = builder.tags; } /** *

* The data encryption key identifier for the snapshot. This value is a unique identifier that corresponds to the * data encryption key that was used to encrypt the original volume or snapshot copy. Because data encryption keys * are inherited by volumes created from snapshots, and vice versa, if snapshots share the same data encryption key * identifier, then they belong to the same volume/snapshot lineage. This parameter is only returned by * DescribeSnapshots. *

* * @return The data encryption key identifier for the snapshot. This value is a unique identifier that corresponds * to the data encryption key that was used to encrypt the original volume or snapshot copy. Because data * encryption keys are inherited by volumes created from snapshots, and vice versa, if snapshots share the * same data encryption key identifier, then they belong to the same volume/snapshot lineage. This parameter * is only returned by DescribeSnapshots. */ public String dataEncryptionKeyId() { return dataEncryptionKeyId; } /** *

* The description for the snapshot. *

* * @return The description for the snapshot. */ public String description() { return description; } /** *

* Indicates whether the snapshot is encrypted. *

* * @return Indicates whether the snapshot is encrypted. */ public Boolean encrypted() { return encrypted; } /** *

* The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) customer master key (CMK) that was * used to protect the volume encryption key for the parent volume. *

* * @return The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) customer master key (CMK) that * was used to protect the volume encryption key for the parent volume. */ public String kmsKeyId() { return kmsKeyId; } /** *

* The AWS account ID of the EBS snapshot owner. *

* * @return The AWS account ID of the EBS snapshot owner. */ public String ownerId() { return ownerId; } /** *

* The progress of the snapshot, as a percentage. *

* * @return The progress of the snapshot, as a percentage. */ public String progress() { return progress; } /** *

* The ID of the snapshot. Each snapshot receives a unique identifier when it is created. *

* * @return The ID of the snapshot. Each snapshot receives a unique identifier when it is created. */ public String snapshotId() { return snapshotId; } /** *

* The time stamp when the snapshot was initiated. *

* * @return The time stamp when the snapshot was initiated. */ public Instant startTime() { return startTime; } /** *

* The snapshot state. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #state} will return * {@link SnapshotState#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #stateAsString}. *

* * @return The snapshot state. * @see SnapshotState */ public SnapshotState state() { return SnapshotState.fromValue(state); } /** *

* The snapshot state. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #state} will return * {@link SnapshotState#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #stateAsString}. *

* * @return The snapshot state. * @see SnapshotState */ public String stateAsString() { return state; } /** *

* Encrypted Amazon EBS snapshots are copied asynchronously. If a snapshot copy operation fails (for example, if the * proper AWS Key Management Service (AWS KMS) permissions are not obtained) this field displays error state details * to help you diagnose why the error occurred. This parameter is only returned by DescribeSnapshots. *

* * @return Encrypted Amazon EBS snapshots are copied asynchronously. If a snapshot copy operation fails (for * example, if the proper AWS Key Management Service (AWS KMS) permissions are not obtained) this field * displays error state details to help you diagnose why the error occurred. This parameter is only returned * by DescribeSnapshots. */ public String stateMessage() { return stateMessage; } /** *

* The ID of the volume that was used to create the snapshot. Snapshots created by the CopySnapshot action * have an arbitrary volume ID that should not be used for any purpose. *

* * @return The ID of the volume that was used to create the snapshot. Snapshots created by the CopySnapshot * action have an arbitrary volume ID that should not be used for any purpose. */ public String volumeId() { return volumeId; } /** *

* The size of the volume, in GiB. *

* * @return The size of the volume, in GiB. */ public Integer volumeSize() { return volumeSize; } /** *

* The AWS owner alias, as maintained by Amazon. The possible values are: amazon | self | * all | aws-marketplace | microsoft. This AWS owner alias is not to be * confused with the user-configured AWS account alias, which is set from the IAM console. *

* * @return The AWS owner alias, as maintained by Amazon. The possible values are: amazon | * self | all | aws-marketplace | microsoft. This AWS * owner alias is not to be confused with the user-configured AWS account alias, which is set from the IAM * console. */ public String ownerAlias() { return ownerAlias; } /** * Returns true if the Tags property was specified by the sender (it may be empty), or false if the sender did not * specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service. */ public boolean hasTags() { return tags != null && !(tags instanceof SdkAutoConstructList); } /** *

* Any tags assigned to the snapshot. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* You can use {@link #hasTags()} to see if a value was sent in this field. *

* * @return Any tags assigned to the snapshot. */ public List tags() { return tags; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(dataEncryptionKeyId()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(encrypted()); hashCode = 31 * hashCode + Objects.hashCode(kmsKeyId()); hashCode = 31 * hashCode + Objects.hashCode(ownerId()); hashCode = 31 * hashCode + Objects.hashCode(progress()); hashCode = 31 * hashCode + Objects.hashCode(snapshotId()); hashCode = 31 * hashCode + Objects.hashCode(startTime()); hashCode = 31 * hashCode + Objects.hashCode(stateAsString()); hashCode = 31 * hashCode + Objects.hashCode(stateMessage()); hashCode = 31 * hashCode + Objects.hashCode(volumeId()); hashCode = 31 * hashCode + Objects.hashCode(volumeSize()); hashCode = 31 * hashCode + Objects.hashCode(ownerAlias()); hashCode = 31 * hashCode + Objects.hashCode(tags()); return hashCode; } @Override public boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public boolean equalsBySdkFields(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(dataEncryptionKeyId(), other.dataEncryptionKeyId()) && Objects.equals(description(), other.description()) && Objects.equals(encrypted(), other.encrypted()) && Objects.equals(kmsKeyId(), other.kmsKeyId()) && Objects.equals(ownerId(), other.ownerId()) && Objects.equals(progress(), other.progress()) && Objects.equals(snapshotId(), other.snapshotId()) && Objects.equals(startTime(), other.startTime()) && Objects.equals(stateAsString(), other.stateAsString()) && Objects.equals(stateMessage(), other.stateMessage()) && Objects.equals(volumeId(), other.volumeId()) && Objects.equals(volumeSize(), other.volumeSize()) && Objects.equals(ownerAlias(), other.ownerAlias()) && Objects.equals(tags(), other.tags()); } /** * 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("DataEncryptionKeyId", dataEncryptionKeyId()).add("Description", description()) .add("Encrypted", encrypted()).add("KmsKeyId", kmsKeyId()).add("OwnerId", ownerId()).add("Progress", progress()) .add("SnapshotId", snapshotId()).add("StartTime", startTime()).add("State", stateAsString()) .add("StateMessage", stateMessage()).add("VolumeId", volumeId()).add("VolumeSize", volumeSize()) .add("OwnerAlias", ownerAlias()).add("Tags", tags()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "DataEncryptionKeyId": return Optional.ofNullable(clazz.cast(dataEncryptionKeyId())); case "Description": return Optional.ofNullable(clazz.cast(description())); case "Encrypted": return Optional.ofNullable(clazz.cast(encrypted())); case "KmsKeyId": return Optional.ofNullable(clazz.cast(kmsKeyId())); case "OwnerId": return Optional.ofNullable(clazz.cast(ownerId())); case "Progress": return Optional.ofNullable(clazz.cast(progress())); case "SnapshotId": return Optional.ofNullable(clazz.cast(snapshotId())); case "StartTime": return Optional.ofNullable(clazz.cast(startTime())); case "State": return Optional.ofNullable(clazz.cast(stateAsString())); case "StateMessage": return Optional.ofNullable(clazz.cast(stateMessage())); case "VolumeId": return Optional.ofNullable(clazz.cast(volumeId())); case "VolumeSize": return Optional.ofNullable(clazz.cast(volumeSize())); case "OwnerAlias": return Optional.ofNullable(clazz.cast(ownerAlias())); case "Tags": return Optional.ofNullable(clazz.cast(tags())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((Snapshot) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The data encryption key identifier for the snapshot. This value is a unique identifier that corresponds to * the data encryption key that was used to encrypt the original volume or snapshot copy. Because data * encryption keys are inherited by volumes created from snapshots, and vice versa, if snapshots share the same * data encryption key identifier, then they belong to the same volume/snapshot lineage. This parameter is only * returned by DescribeSnapshots. *

* * @param dataEncryptionKeyId * The data encryption key identifier for the snapshot. This value is a unique identifier that * corresponds to the data encryption key that was used to encrypt the original volume or snapshot copy. * Because data encryption keys are inherited by volumes created from snapshots, and vice versa, if * snapshots share the same data encryption key identifier, then they belong to the same volume/snapshot * lineage. This parameter is only returned by DescribeSnapshots. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dataEncryptionKeyId(String dataEncryptionKeyId); /** *

* The description for the snapshot. *

* * @param description * The description for the snapshot. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

* Indicates whether the snapshot is encrypted. *

* * @param encrypted * Indicates whether the snapshot is encrypted. * @return Returns a reference to this object so that method calls can be chained together. */ Builder encrypted(Boolean encrypted); /** *

* The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) customer master key (CMK) that was * used to protect the volume encryption key for the parent volume. *

* * @param kmsKeyId * The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) customer master key (CMK) * that was used to protect the volume encryption key for the parent volume. * @return Returns a reference to this object so that method calls can be chained together. */ Builder kmsKeyId(String kmsKeyId); /** *

* The AWS account ID of the EBS snapshot owner. *

* * @param ownerId * The AWS account ID of the EBS snapshot owner. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ownerId(String ownerId); /** *

* The progress of the snapshot, as a percentage. *

* * @param progress * The progress of the snapshot, as a percentage. * @return Returns a reference to this object so that method calls can be chained together. */ Builder progress(String progress); /** *

* The ID of the snapshot. Each snapshot receives a unique identifier when it is created. *

* * @param snapshotId * The ID of the snapshot. Each snapshot receives a unique identifier when it is created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder snapshotId(String snapshotId); /** *

* The time stamp when the snapshot was initiated. *

* * @param startTime * The time stamp when the snapshot was initiated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder startTime(Instant startTime); /** *

* The snapshot state. *

* * @param state * The snapshot state. * @see SnapshotState * @return Returns a reference to this object so that method calls can be chained together. * @see SnapshotState */ Builder state(String state); /** *

* The snapshot state. *

* * @param state * The snapshot state. * @see SnapshotState * @return Returns a reference to this object so that method calls can be chained together. * @see SnapshotState */ Builder state(SnapshotState state); /** *

* Encrypted Amazon EBS snapshots are copied asynchronously. If a snapshot copy operation fails (for example, if * the proper AWS Key Management Service (AWS KMS) permissions are not obtained) this field displays error state * details to help you diagnose why the error occurred. This parameter is only returned by * DescribeSnapshots. *

* * @param stateMessage * Encrypted Amazon EBS snapshots are copied asynchronously. If a snapshot copy operation fails (for * example, if the proper AWS Key Management Service (AWS KMS) permissions are not obtained) this field * displays error state details to help you diagnose why the error occurred. This parameter is only * returned by DescribeSnapshots. * @return Returns a reference to this object so that method calls can be chained together. */ Builder stateMessage(String stateMessage); /** *

* The ID of the volume that was used to create the snapshot. Snapshots created by the CopySnapshot * action have an arbitrary volume ID that should not be used for any purpose. *

* * @param volumeId * The ID of the volume that was used to create the snapshot. Snapshots created by the * CopySnapshot action have an arbitrary volume ID that should not be used for any purpose. * @return Returns a reference to this object so that method calls can be chained together. */ Builder volumeId(String volumeId); /** *

* The size of the volume, in GiB. *

* * @param volumeSize * The size of the volume, in GiB. * @return Returns a reference to this object so that method calls can be chained together. */ Builder volumeSize(Integer volumeSize); /** *

* The AWS owner alias, as maintained by Amazon. The possible values are: amazon | * self | all | aws-marketplace | microsoft. This AWS owner * alias is not to be confused with the user-configured AWS account alias, which is set from the IAM console. *

* * @param ownerAlias * The AWS owner alias, as maintained by Amazon. The possible values are: amazon | * self | all | aws-marketplace | microsoft. This AWS * owner alias is not to be confused with the user-configured AWS account alias, which is set from the * IAM console. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ownerAlias(String ownerAlias); /** *

* Any tags assigned to the snapshot. *

* * @param tags * Any tags assigned to the snapshot. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Collection tags); /** *

* Any tags assigned to the snapshot. *

* * @param tags * Any tags assigned to the snapshot. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Tag... tags); /** *

* Any tags assigned to the snapshot. *

* This is a convenience that creates an instance of the {@link List.Builder} avoiding the need to create * one manually via {@link List#builder()}. * * When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and its result * is passed to {@link #tags(List)}. * * @param tags * a consumer that will call methods on {@link List.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #tags(List) */ Builder tags(Consumer... tags); } static final class BuilderImpl implements Builder { private String dataEncryptionKeyId; private String description; private Boolean encrypted; private String kmsKeyId; private String ownerId; private String progress; private String snapshotId; private Instant startTime; private String state; private String stateMessage; private String volumeId; private Integer volumeSize; private String ownerAlias; private List tags = DefaultSdkAutoConstructList.getInstance(); private BuilderImpl() { } private BuilderImpl(Snapshot model) { dataEncryptionKeyId(model.dataEncryptionKeyId); description(model.description); encrypted(model.encrypted); kmsKeyId(model.kmsKeyId); ownerId(model.ownerId); progress(model.progress); snapshotId(model.snapshotId); startTime(model.startTime); state(model.state); stateMessage(model.stateMessage); volumeId(model.volumeId); volumeSize(model.volumeSize); ownerAlias(model.ownerAlias); tags(model.tags); } public final String getDataEncryptionKeyId() { return dataEncryptionKeyId; } @Override public final Builder dataEncryptionKeyId(String dataEncryptionKeyId) { this.dataEncryptionKeyId = dataEncryptionKeyId; return this; } public final void setDataEncryptionKeyId(String dataEncryptionKeyId) { this.dataEncryptionKeyId = dataEncryptionKeyId; } public final String getDescription() { return description; } @Override public final Builder description(String description) { this.description = description; return this; } public final void setDescription(String description) { this.description = description; } public final Boolean getEncrypted() { return encrypted; } @Override public final Builder encrypted(Boolean encrypted) { this.encrypted = encrypted; return this; } public final void setEncrypted(Boolean encrypted) { this.encrypted = encrypted; } public final String getKmsKeyId() { return kmsKeyId; } @Override public final Builder kmsKeyId(String kmsKeyId) { this.kmsKeyId = kmsKeyId; return this; } public final void setKmsKeyId(String kmsKeyId) { this.kmsKeyId = kmsKeyId; } public final String getOwnerId() { return ownerId; } @Override public final Builder ownerId(String ownerId) { this.ownerId = ownerId; return this; } public final void setOwnerId(String ownerId) { this.ownerId = ownerId; } public final String getProgress() { return progress; } @Override public final Builder progress(String progress) { this.progress = progress; return this; } public final void setProgress(String progress) { this.progress = progress; } public final String getSnapshotId() { return snapshotId; } @Override public final Builder snapshotId(String snapshotId) { this.snapshotId = snapshotId; return this; } public final void setSnapshotId(String snapshotId) { this.snapshotId = snapshotId; } public final Instant getStartTime() { return startTime; } @Override public final Builder startTime(Instant startTime) { this.startTime = startTime; return this; } public final void setStartTime(Instant startTime) { this.startTime = startTime; } public final String getState() { return state; } @Override public final Builder state(String state) { this.state = state; return this; } @Override public final Builder state(SnapshotState state) { this.state(state == null ? null : state.toString()); return this; } public final void setState(String state) { this.state = state; } public final String getStateMessage() { return stateMessage; } @Override public final Builder stateMessage(String stateMessage) { this.stateMessage = stateMessage; return this; } public final void setStateMessage(String stateMessage) { this.stateMessage = stateMessage; } public final String getVolumeId() { return volumeId; } @Override public final Builder volumeId(String volumeId) { this.volumeId = volumeId; return this; } public final void setVolumeId(String volumeId) { this.volumeId = volumeId; } public final Integer getVolumeSize() { return volumeSize; } @Override public final Builder volumeSize(Integer volumeSize) { this.volumeSize = volumeSize; return this; } public final void setVolumeSize(Integer volumeSize) { this.volumeSize = volumeSize; } public final String getOwnerAlias() { return ownerAlias; } @Override public final Builder ownerAlias(String ownerAlias) { this.ownerAlias = ownerAlias; return this; } public final void setOwnerAlias(String ownerAlias) { this.ownerAlias = ownerAlias; } public final Collection getTags() { return tags != null ? tags.stream().map(Tag::toBuilder).collect(Collectors.toList()) : null; } @Override public final Builder tags(Collection tags) { this.tags = TagListCopier.copy(tags); return this; } @Override @SafeVarargs public final Builder tags(Tag... tags) { tags(Arrays.asList(tags)); return this; } @Override @SafeVarargs public final Builder tags(Consumer... tags) { tags(Stream.of(tags).map(c -> Tag.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final void setTags(Collection tags) { this.tags = TagListCopier.copyFromBuilder(tags); } @Override public Snapshot build() { return new Snapshot(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy