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

software.amazon.awssdk.services.ec2.model.CreateVolumeResponse 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.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 volume. *

*/ @Generated("software.amazon.awssdk:codegen") public final class CreateVolumeResponse extends Ec2Response implements ToCopyableBuilder { private static final SdkField> ATTACHMENTS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("Attachments") .getter(getter(CreateVolumeResponse::attachments)) .setter(setter(Builder::attachments)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AttachmentSet") .unmarshallLocationName("attachmentSet").build(), ListTrait .builder() .memberLocationName("item") .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(VolumeAttachment::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("Item").unmarshallLocationName("item").build()).build()) .build()).build(); private static final SdkField AVAILABILITY_ZONE_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("AvailabilityZone") .getter(getter(CreateVolumeResponse::availabilityZone)) .setter(setter(Builder::availabilityZone)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AvailabilityZone") .unmarshallLocationName("availabilityZone").build()).build(); private static final SdkField CREATE_TIME_FIELD = SdkField . builder(MarshallingType.INSTANT) .memberName("CreateTime") .getter(getter(CreateVolumeResponse::createTime)) .setter(setter(Builder::createTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreateTime") .unmarshallLocationName("createTime").build()).build(); private static final SdkField ENCRYPTED_FIELD = SdkField . builder(MarshallingType.BOOLEAN) .memberName("Encrypted") .getter(getter(CreateVolumeResponse::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(CreateVolumeResponse::kmsKeyId)) .setter(setter(Builder::kmsKeyId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KmsKeyId") .unmarshallLocationName("kmsKeyId").build()).build(); private static final SdkField OUTPOST_ARN_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("OutpostArn") .getter(getter(CreateVolumeResponse::outpostArn)) .setter(setter(Builder::outpostArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OutpostArn") .unmarshallLocationName("outpostArn").build()).build(); private static final SdkField SIZE_FIELD = SdkField . builder(MarshallingType.INTEGER) .memberName("Size") .getter(getter(CreateVolumeResponse::size)) .setter(setter(Builder::size)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Size") .unmarshallLocationName("size").build()).build(); private static final SdkField SNAPSHOT_ID_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("SnapshotId") .getter(getter(CreateVolumeResponse::snapshotId)) .setter(setter(Builder::snapshotId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SnapshotId") .unmarshallLocationName("snapshotId").build()).build(); private static final SdkField STATE_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("State") .getter(getter(CreateVolumeResponse::stateAsString)) .setter(setter(Builder::state)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status") .unmarshallLocationName("status").build()).build(); private static final SdkField VOLUME_ID_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("VolumeId") .getter(getter(CreateVolumeResponse::volumeId)) .setter(setter(Builder::volumeId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VolumeId") .unmarshallLocationName("volumeId").build()).build(); private static final SdkField IOPS_FIELD = SdkField . builder(MarshallingType.INTEGER) .memberName("Iops") .getter(getter(CreateVolumeResponse::iops)) .setter(setter(Builder::iops)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Iops") .unmarshallLocationName("iops").build()).build(); private static final SdkField> TAGS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("Tags") .getter(getter(CreateVolumeResponse::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 SdkField VOLUME_TYPE_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("VolumeType") .getter(getter(CreateVolumeResponse::volumeTypeAsString)) .setter(setter(Builder::volumeType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VolumeType") .unmarshallLocationName("volumeType").build()).build(); private static final SdkField FAST_RESTORED_FIELD = SdkField . builder(MarshallingType.BOOLEAN) .memberName("FastRestored") .getter(getter(CreateVolumeResponse::fastRestored)) .setter(setter(Builder::fastRestored)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FastRestored") .unmarshallLocationName("fastRestored").build()).build(); private static final SdkField MULTI_ATTACH_ENABLED_FIELD = SdkField . builder(MarshallingType.BOOLEAN) .memberName("MultiAttachEnabled") .getter(getter(CreateVolumeResponse::multiAttachEnabled)) .setter(setter(Builder::multiAttachEnabled)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MultiAttachEnabled") .unmarshallLocationName("multiAttachEnabled").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ATTACHMENTS_FIELD, AVAILABILITY_ZONE_FIELD, CREATE_TIME_FIELD, ENCRYPTED_FIELD, KMS_KEY_ID_FIELD, OUTPOST_ARN_FIELD, SIZE_FIELD, SNAPSHOT_ID_FIELD, STATE_FIELD, VOLUME_ID_FIELD, IOPS_FIELD, TAGS_FIELD, VOLUME_TYPE_FIELD, FAST_RESTORED_FIELD, MULTI_ATTACH_ENABLED_FIELD)); private final List attachments; private final String availabilityZone; private final Instant createTime; private final Boolean encrypted; private final String kmsKeyId; private final String outpostArn; private final Integer size; private final String snapshotId; private final String state; private final String volumeId; private final Integer iops; private final List tags; private final String volumeType; private final Boolean fastRestored; private final Boolean multiAttachEnabled; private CreateVolumeResponse(BuilderImpl builder) { super(builder); this.attachments = builder.attachments; this.availabilityZone = builder.availabilityZone; this.createTime = builder.createTime; this.encrypted = builder.encrypted; this.kmsKeyId = builder.kmsKeyId; this.outpostArn = builder.outpostArn; this.size = builder.size; this.snapshotId = builder.snapshotId; this.state = builder.state; this.volumeId = builder.volumeId; this.iops = builder.iops; this.tags = builder.tags; this.volumeType = builder.volumeType; this.fastRestored = builder.fastRestored; this.multiAttachEnabled = builder.multiAttachEnabled; } /** * Returns true if the Attachments 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 hasAttachments() { return attachments != null && !(attachments instanceof SdkAutoConstructList); } /** *

* Information about the volume attachments. *

*

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

*

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

* * @return Information about the volume attachments. */ public List attachments() { return attachments; } /** *

* The Availability Zone for the volume. *

* * @return The Availability Zone for the volume. */ public String availabilityZone() { return availabilityZone; } /** *

* The time stamp when volume creation was initiated. *

* * @return The time stamp when volume creation was initiated. */ public Instant createTime() { return createTime; } /** *

* Indicates whether the volume is encrypted. *

* * @return Indicates whether the volume 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 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 volume. */ public String kmsKeyId() { return kmsKeyId; } /** *

* The Amazon Resource Name (ARN) of the Outpost. *

* * @return The Amazon Resource Name (ARN) of the Outpost. */ public String outpostArn() { return outpostArn; } /** *

* The size of the volume, in GiBs. *

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

* The snapshot from which the volume was created, if applicable. *

* * @return The snapshot from which the volume was created, if applicable. */ public String snapshotId() { return snapshotId; } /** *

* The volume state. *

*

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

* * @return The volume state. * @see VolumeState */ public VolumeState state() { return VolumeState.fromValue(state); } /** *

* The volume state. *

*

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

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

* The ID of the volume. *

* * @return The ID of the volume. */ public String volumeId() { return volumeId; } /** *

* The number of I/O operations per second (IOPS) that the volume supports. For Provisioned IOPS SSD volumes, this * represents the number of IOPS that are provisioned for the volume. For General Purpose SSD volumes, this * represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for * bursting. For more information, see Amazon EBS volume types in the * Amazon Elastic Compute Cloud User Guide. *

*

* Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000 IOPS for io1 * and io2 volumes, in most Regions. The maximum IOPS for io1 and io2 of * 64,000 is guaranteed only on Nitro-based * instances. Other instance families guarantee performance up to 32,000 IOPS. *

*

* Condition: This parameter is required for requests to create io1 and io2 volumes; it is * not used in requests to create gp2, st1, sc1, or standard * volumes. *

* * @return The number of I/O operations per second (IOPS) that the volume supports. For Provisioned IOPS SSD * volumes, this represents the number of IOPS that are provisioned for the volume. For General Purpose SSD * volumes, this represents the baseline performance of the volume and the rate at which the volume * accumulates I/O credits for bursting. For more information, see Amazon EBS volume * types in the Amazon Elastic Compute Cloud User Guide.

*

* Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000 IOPS for * io1 and io2 volumes, in most Regions. The maximum IOPS for io1 and * io2 of 64,000 is guaranteed only on Nitro-based instances. Other instance families guarantee performance up to 32,000 IOPS. *

*

* Condition: This parameter is required for requests to create io1 and io2 * volumes; it is not used in requests to create gp2, st1, sc1, or * standard volumes. */ public Integer iops() { return iops; } /** * 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 volume. *

*

* 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 volume. */ public List tags() { return tags; } /** *

* The volume type. This can be gp2 for General Purpose SSD, io1 or io2 for * Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or * standard for Magnetic volumes. *

*

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

* * @return The volume type. This can be gp2 for General Purpose SSD, io1 or * io2 for Provisioned IOPS SSD, st1 for Throughput Optimized HDD, * sc1 for Cold HDD, or standard for Magnetic volumes. * @see VolumeType */ public VolumeType volumeType() { return VolumeType.fromValue(volumeType); } /** *

* The volume type. This can be gp2 for General Purpose SSD, io1 or io2 for * Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or * standard for Magnetic volumes. *

*

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

* * @return The volume type. This can be gp2 for General Purpose SSD, io1 or * io2 for Provisioned IOPS SSD, st1 for Throughput Optimized HDD, * sc1 for Cold HDD, or standard for Magnetic volumes. * @see VolumeType */ public String volumeTypeAsString() { return volumeType; } /** *

* Indicates whether the volume was created using fast snapshot restore. *

* * @return Indicates whether the volume was created using fast snapshot restore. */ public Boolean fastRestored() { return fastRestored; } /** *

* Indicates whether Amazon EBS Multi-Attach is enabled. *

* * @return Indicates whether Amazon EBS Multi-Attach is enabled. */ public Boolean multiAttachEnabled() { return multiAttachEnabled; } @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 + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(attachments()); hashCode = 31 * hashCode + Objects.hashCode(availabilityZone()); hashCode = 31 * hashCode + Objects.hashCode(createTime()); hashCode = 31 * hashCode + Objects.hashCode(encrypted()); hashCode = 31 * hashCode + Objects.hashCode(kmsKeyId()); hashCode = 31 * hashCode + Objects.hashCode(outpostArn()); hashCode = 31 * hashCode + Objects.hashCode(size()); hashCode = 31 * hashCode + Objects.hashCode(snapshotId()); hashCode = 31 * hashCode + Objects.hashCode(stateAsString()); hashCode = 31 * hashCode + Objects.hashCode(volumeId()); hashCode = 31 * hashCode + Objects.hashCode(iops()); hashCode = 31 * hashCode + Objects.hashCode(tags()); hashCode = 31 * hashCode + Objects.hashCode(volumeTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(fastRestored()); hashCode = 31 * hashCode + Objects.hashCode(multiAttachEnabled()); return hashCode; } @Override public boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof CreateVolumeResponse)) { return false; } CreateVolumeResponse other = (CreateVolumeResponse) obj; return Objects.equals(attachments(), other.attachments()) && Objects.equals(availabilityZone(), other.availabilityZone()) && Objects.equals(createTime(), other.createTime()) && Objects.equals(encrypted(), other.encrypted()) && Objects.equals(kmsKeyId(), other.kmsKeyId()) && Objects.equals(outpostArn(), other.outpostArn()) && Objects.equals(size(), other.size()) && Objects.equals(snapshotId(), other.snapshotId()) && Objects.equals(stateAsString(), other.stateAsString()) && Objects.equals(volumeId(), other.volumeId()) && Objects.equals(iops(), other.iops()) && Objects.equals(tags(), other.tags()) && Objects.equals(volumeTypeAsString(), other.volumeTypeAsString()) && Objects.equals(fastRestored(), other.fastRestored()) && Objects.equals(multiAttachEnabled(), other.multiAttachEnabled()); } /** * 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("CreateVolumeResponse").add("Attachments", attachments()) .add("AvailabilityZone", availabilityZone()).add("CreateTime", createTime()).add("Encrypted", encrypted()) .add("KmsKeyId", kmsKeyId()).add("OutpostArn", outpostArn()).add("Size", size()).add("SnapshotId", snapshotId()) .add("State", stateAsString()).add("VolumeId", volumeId()).add("Iops", iops()).add("Tags", tags()) .add("VolumeType", volumeTypeAsString()).add("FastRestored", fastRestored()) .add("MultiAttachEnabled", multiAttachEnabled()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Attachments": return Optional.ofNullable(clazz.cast(attachments())); case "AvailabilityZone": return Optional.ofNullable(clazz.cast(availabilityZone())); case "CreateTime": return Optional.ofNullable(clazz.cast(createTime())); case "Encrypted": return Optional.ofNullable(clazz.cast(encrypted())); case "KmsKeyId": return Optional.ofNullable(clazz.cast(kmsKeyId())); case "OutpostArn": return Optional.ofNullable(clazz.cast(outpostArn())); case "Size": return Optional.ofNullable(clazz.cast(size())); case "SnapshotId": return Optional.ofNullable(clazz.cast(snapshotId())); case "State": return Optional.ofNullable(clazz.cast(stateAsString())); case "VolumeId": return Optional.ofNullable(clazz.cast(volumeId())); case "Iops": return Optional.ofNullable(clazz.cast(iops())); case "Tags": return Optional.ofNullable(clazz.cast(tags())); case "VolumeType": return Optional.ofNullable(clazz.cast(volumeTypeAsString())); case "FastRestored": return Optional.ofNullable(clazz.cast(fastRestored())); case "MultiAttachEnabled": return Optional.ofNullable(clazz.cast(multiAttachEnabled())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CreateVolumeResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends Ec2Response.Builder, SdkPojo, CopyableBuilder { /** *

* Information about the volume attachments. *

* * @param attachments * Information about the volume attachments. * @return Returns a reference to this object so that method calls can be chained together. */ Builder attachments(Collection attachments); /** *

* Information about the volume attachments. *

* * @param attachments * Information about the volume attachments. * @return Returns a reference to this object so that method calls can be chained together. */ Builder attachments(VolumeAttachment... attachments); /** *

* Information about the volume attachments. *

* 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 #attachments(List)}. * * @param attachments * 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 #attachments(List) */ Builder attachments(Consumer... attachments); /** *

* The Availability Zone for the volume. *

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

* The time stamp when volume creation was initiated. *

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

* Indicates whether the volume is encrypted. *

* * @param encrypted * Indicates whether the volume 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 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 volume. * @return Returns a reference to this object so that method calls can be chained together. */ Builder kmsKeyId(String kmsKeyId); /** *

* The Amazon Resource Name (ARN) of the Outpost. *

* * @param outpostArn * The Amazon Resource Name (ARN) of the Outpost. * @return Returns a reference to this object so that method calls can be chained together. */ Builder outpostArn(String outpostArn); /** *

* The size of the volume, in GiBs. *

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

* The snapshot from which the volume was created, if applicable. *

* * @param snapshotId * The snapshot from which the volume was created, if applicable. * @return Returns a reference to this object so that method calls can be chained together. */ Builder snapshotId(String snapshotId); /** *

* The volume state. *

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

* The volume state. *

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

* The ID of the volume. *

* * @param volumeId * The ID of the volume. * @return Returns a reference to this object so that method calls can be chained together. */ Builder volumeId(String volumeId); /** *

* The number of I/O operations per second (IOPS) that the volume supports. For Provisioned IOPS SSD volumes, * this represents the number of IOPS that are provisioned for the volume. For General Purpose SSD volumes, this * represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits * for bursting. For more information, see Amazon EBS volume types in * the Amazon Elastic Compute Cloud User Guide. *

*

* Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000 IOPS for * io1 and io2 volumes, in most Regions. The maximum IOPS for io1 and * io2 of 64,000 is guaranteed only on Nitro-based instances. Other instance families guarantee performance up to 32,000 IOPS. *

*

* Condition: This parameter is required for requests to create io1 and io2 volumes; * it is not used in requests to create gp2, st1, sc1, or * standard volumes. *

* * @param iops * The number of I/O operations per second (IOPS) that the volume supports. For Provisioned IOPS SSD * volumes, this represents the number of IOPS that are provisioned for the volume. For General Purpose * SSD volumes, this represents the baseline performance of the volume and the rate at which the volume * accumulates I/O credits for bursting. For more information, see Amazon EBS volume * types in the Amazon Elastic Compute Cloud User Guide.

*

* Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000 IOPS for * io1 and io2 volumes, in most Regions. The maximum IOPS for io1 * and io2 of 64,000 is guaranteed only on Nitro-based instances. Other instance families guarantee performance up to 32,000 IOPS. *

*

* Condition: This parameter is required for requests to create io1 and io2 * volumes; it is not used in requests to create gp2, st1, sc1, or * standard volumes. * @return Returns a reference to this object so that method calls can be chained together. */ Builder iops(Integer iops); /** *

* Any tags assigned to the volume. *

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

* Any tags assigned to the volume. *

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

* Any tags assigned to the volume. *

* 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); /** *

* The volume type. This can be gp2 for General Purpose SSD, io1 or io2 * for Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or * standard for Magnetic volumes. *

* * @param volumeType * The volume type. This can be gp2 for General Purpose SSD, io1 or * io2 for Provisioned IOPS SSD, st1 for Throughput Optimized HDD, * sc1 for Cold HDD, or standard for Magnetic volumes. * @see VolumeType * @return Returns a reference to this object so that method calls can be chained together. * @see VolumeType */ Builder volumeType(String volumeType); /** *

* The volume type. This can be gp2 for General Purpose SSD, io1 or io2 * for Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or * standard for Magnetic volumes. *

* * @param volumeType * The volume type. This can be gp2 for General Purpose SSD, io1 or * io2 for Provisioned IOPS SSD, st1 for Throughput Optimized HDD, * sc1 for Cold HDD, or standard for Magnetic volumes. * @see VolumeType * @return Returns a reference to this object so that method calls can be chained together. * @see VolumeType */ Builder volumeType(VolumeType volumeType); /** *

* Indicates whether the volume was created using fast snapshot restore. *

* * @param fastRestored * Indicates whether the volume was created using fast snapshot restore. * @return Returns a reference to this object so that method calls can be chained together. */ Builder fastRestored(Boolean fastRestored); /** *

* Indicates whether Amazon EBS Multi-Attach is enabled. *

* * @param multiAttachEnabled * Indicates whether Amazon EBS Multi-Attach is enabled. * @return Returns a reference to this object so that method calls can be chained together. */ Builder multiAttachEnabled(Boolean multiAttachEnabled); } static final class BuilderImpl extends Ec2Response.BuilderImpl implements Builder { private List attachments = DefaultSdkAutoConstructList.getInstance(); private String availabilityZone; private Instant createTime; private Boolean encrypted; private String kmsKeyId; private String outpostArn; private Integer size; private String snapshotId; private String state; private String volumeId; private Integer iops; private List tags = DefaultSdkAutoConstructList.getInstance(); private String volumeType; private Boolean fastRestored; private Boolean multiAttachEnabled; private BuilderImpl() { } private BuilderImpl(CreateVolumeResponse model) { super(model); attachments(model.attachments); availabilityZone(model.availabilityZone); createTime(model.createTime); encrypted(model.encrypted); kmsKeyId(model.kmsKeyId); outpostArn(model.outpostArn); size(model.size); snapshotId(model.snapshotId); state(model.state); volumeId(model.volumeId); iops(model.iops); tags(model.tags); volumeType(model.volumeType); fastRestored(model.fastRestored); multiAttachEnabled(model.multiAttachEnabled); } public final Collection getAttachments() { return attachments != null ? attachments.stream().map(VolumeAttachment::toBuilder).collect(Collectors.toList()) : null; } @Override public final Builder attachments(Collection attachments) { this.attachments = VolumeAttachmentListCopier.copy(attachments); return this; } @Override @SafeVarargs public final Builder attachments(VolumeAttachment... attachments) { attachments(Arrays.asList(attachments)); return this; } @Override @SafeVarargs public final Builder attachments(Consumer... attachments) { attachments(Stream.of(attachments).map(c -> VolumeAttachment.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final void setAttachments(Collection attachments) { this.attachments = VolumeAttachmentListCopier.copyFromBuilder(attachments); } public final String getAvailabilityZone() { return availabilityZone; } @Override public final Builder availabilityZone(String availabilityZone) { this.availabilityZone = availabilityZone; return this; } public final void setAvailabilityZone(String availabilityZone) { this.availabilityZone = availabilityZone; } public final Instant getCreateTime() { return createTime; } @Override public final Builder createTime(Instant createTime) { this.createTime = createTime; return this; } public final void setCreateTime(Instant createTime) { this.createTime = createTime; } 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 getOutpostArn() { return outpostArn; } @Override public final Builder outpostArn(String outpostArn) { this.outpostArn = outpostArn; return this; } public final void setOutpostArn(String outpostArn) { this.outpostArn = outpostArn; } public final Integer getSize() { return size; } @Override public final Builder size(Integer size) { this.size = size; return this; } public final void setSize(Integer size) { this.size = size; } 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 String getState() { return state; } @Override public final Builder state(String state) { this.state = state; return this; } @Override public final Builder state(VolumeState state) { this.state(state == null ? null : state.toString()); return this; } public final void setState(String state) { this.state = state; } 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 getIops() { return iops; } @Override public final Builder iops(Integer iops) { this.iops = iops; return this; } public final void setIops(Integer iops) { this.iops = iops; } 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); } public final String getVolumeType() { return volumeType; } @Override public final Builder volumeType(String volumeType) { this.volumeType = volumeType; return this; } @Override public final Builder volumeType(VolumeType volumeType) { this.volumeType(volumeType == null ? null : volumeType.toString()); return this; } public final void setVolumeType(String volumeType) { this.volumeType = volumeType; } public final Boolean getFastRestored() { return fastRestored; } @Override public final Builder fastRestored(Boolean fastRestored) { this.fastRestored = fastRestored; return this; } public final void setFastRestored(Boolean fastRestored) { this.fastRestored = fastRestored; } public final Boolean getMultiAttachEnabled() { return multiAttachEnabled; } @Override public final Builder multiAttachEnabled(Boolean multiAttachEnabled) { this.multiAttachEnabled = multiAttachEnabled; return this; } public final void setMultiAttachEnabled(Boolean multiAttachEnabled) { this.multiAttachEnabled = multiAttachEnabled; } @Override public CreateVolumeResponse build() { return new CreateVolumeResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy