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

software.amazon.awssdk.services.opsworks.model.Volume Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS OpsWorks module holds the client classes that are used for communicating with AWS OpsWorks Service

There is a newer version: 2.28.4
Show newest version
/*
 * 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.opsworks.model;

import java.io.Serializable;
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;

/**
 * 

* Describes an instance's Amazon EBS volume. *

*/ @Generated("software.amazon.awssdk:codegen") public final class Volume implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField VOLUME_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("VolumeId").getter(getter(Volume::volumeId)).setter(setter(Builder::volumeId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VolumeId").build()).build(); private static final SdkField EC2_VOLUME_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("Ec2VolumeId").getter(getter(Volume::ec2VolumeId)).setter(setter(Builder::ec2VolumeId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Ec2VolumeId").build()).build(); private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name") .getter(getter(Volume::name)).setter(setter(Builder::name)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build(); private static final SdkField RAID_ARRAY_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("RaidArrayId").getter(getter(Volume::raidArrayId)).setter(setter(Builder::raidArrayId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RaidArrayId").build()).build(); private static final SdkField INSTANCE_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("InstanceId").getter(getter(Volume::instanceId)).setter(setter(Builder::instanceId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InstanceId").build()).build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status") .getter(getter(Volume::status)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build(); private static final SdkField SIZE_FIELD = SdkField. builder(MarshallingType.INTEGER).memberName("Size") .getter(getter(Volume::size)).setter(setter(Builder::size)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Size").build()).build(); private static final SdkField DEVICE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Device") .getter(getter(Volume::device)).setter(setter(Builder::device)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Device").build()).build(); private static final SdkField MOUNT_POINT_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("MountPoint").getter(getter(Volume::mountPoint)).setter(setter(Builder::mountPoint)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MountPoint").build()).build(); private static final SdkField REGION_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Region") .getter(getter(Volume::region)).setter(setter(Builder::region)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Region").build()).build(); private static final SdkField AVAILABILITY_ZONE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("AvailabilityZone").getter(getter(Volume::availabilityZone)).setter(setter(Builder::availabilityZone)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AvailabilityZone").build()).build(); private static final SdkField VOLUME_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("VolumeType").getter(getter(Volume::volumeType)).setter(setter(Builder::volumeType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VolumeType").build()).build(); private static final SdkField IOPS_FIELD = SdkField. builder(MarshallingType.INTEGER).memberName("Iops") .getter(getter(Volume::iops)).setter(setter(Builder::iops)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Iops").build()).build(); private static final SdkField ENCRYPTED_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("Encrypted").getter(getter(Volume::encrypted)).setter(setter(Builder::encrypted)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Encrypted").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(VOLUME_ID_FIELD, EC2_VOLUME_ID_FIELD, NAME_FIELD, RAID_ARRAY_ID_FIELD, INSTANCE_ID_FIELD, STATUS_FIELD, SIZE_FIELD, DEVICE_FIELD, MOUNT_POINT_FIELD, REGION_FIELD, AVAILABILITY_ZONE_FIELD, VOLUME_TYPE_FIELD, IOPS_FIELD, ENCRYPTED_FIELD)); private static final long serialVersionUID = 1L; private final String volumeId; private final String ec2VolumeId; private final String name; private final String raidArrayId; private final String instanceId; private final String status; private final Integer size; private final String device; private final String mountPoint; private final String region; private final String availabilityZone; private final String volumeType; private final Integer iops; private final Boolean encrypted; private Volume(BuilderImpl builder) { this.volumeId = builder.volumeId; this.ec2VolumeId = builder.ec2VolumeId; this.name = builder.name; this.raidArrayId = builder.raidArrayId; this.instanceId = builder.instanceId; this.status = builder.status; this.size = builder.size; this.device = builder.device; this.mountPoint = builder.mountPoint; this.region = builder.region; this.availabilityZone = builder.availabilityZone; this.volumeType = builder.volumeType; this.iops = builder.iops; this.encrypted = builder.encrypted; } /** *

* The volume ID. *

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

* The Amazon EC2 volume ID. *

* * @return The Amazon EC2 volume ID. */ public final String ec2VolumeId() { return ec2VolumeId; } /** *

* The volume name. Volume names are a maximum of 128 characters. *

* * @return The volume name. Volume names are a maximum of 128 characters. */ public final String name() { return name; } /** *

* The RAID array ID. *

* * @return The RAID array ID. */ public final String raidArrayId() { return raidArrayId; } /** *

* The instance ID. *

* * @return The instance ID. */ public final String instanceId() { return instanceId; } /** *

* The value returned by DescribeVolumes. *

* * @return The value returned by DescribeVolumes. */ public final String status() { return status; } /** *

* The volume size. *

* * @return The volume size. */ public final Integer size() { return size; } /** *

* The device name. *

* * @return The device name. */ public final String device() { return device; } /** *

* The volume mount point. For example, "/mnt/disk1". *

* * @return The volume mount point. For example, "/mnt/disk1". */ public final String mountPoint() { return mountPoint; } /** *

* The Amazon Web Services Region. For more information about Amazon Web Services Regions, see Regions and Endpoints. *

* * @return The Amazon Web Services Region. For more information about Amazon Web Services Regions, see Regions and Endpoints. */ public final String region() { return region; } /** *

* The volume Availability Zone. For more information, see Regions and Endpoints. *

* * @return The volume Availability Zone. For more information, see Regions and Endpoints. */ public final String availabilityZone() { return availabilityZone; } /** *

* The volume type. For more information, see Amazon EBS Volume Types. *

*
    *
  • *

    * standard - Magnetic. Magnetic volumes must have a minimum size of 1 GiB and a maximum size of 1024 * GiB. *

    *
  • *
  • *

    * io1 - Provisioned IOPS (SSD). PIOPS volumes must have a minimum size of 4 GiB and a maximum size of * 16384 GiB. *

    *
  • *
  • *

    * gp2 - General Purpose (SSD). General purpose volumes must have a minimum size of 1 GiB and a maximum * size of 16384 GiB. *

    *
  • *
  • *

    * st1 - Throughput Optimized hard disk drive (HDD). Throughput optimized HDD volumes must have a * minimum size of 125 GiB and a maximum size of 16384 GiB. *

    *
  • *
  • *

    * sc1 - Cold HDD. Cold HDD volumes must have a minimum size of 125 GiB and a maximum size of 16384 * GiB. *

    *
  • *
* * @return The volume type. For more information, see Amazon EBS Volume * Types.

*
    *
  • *

    * standard - Magnetic. Magnetic volumes must have a minimum size of 1 GiB and a maximum size * of 1024 GiB. *

    *
  • *
  • *

    * io1 - Provisioned IOPS (SSD). PIOPS volumes must have a minimum size of 4 GiB and a maximum * size of 16384 GiB. *

    *
  • *
  • *

    * gp2 - General Purpose (SSD). General purpose volumes must have a minimum size of 1 GiB and a * maximum size of 16384 GiB. *

    *
  • *
  • *

    * st1 - Throughput Optimized hard disk drive (HDD). Throughput optimized HDD volumes must have * a minimum size of 125 GiB and a maximum size of 16384 GiB. *

    *
  • *
  • *

    * sc1 - Cold HDD. Cold HDD volumes must have a minimum size of 125 GiB and a maximum size of * 16384 GiB. *

    *
  • */ public final String volumeType() { return volumeType; } /** *

    * For PIOPS volumes, the IOPS per disk. *

    * * @return For PIOPS volumes, the IOPS per disk. */ public final Integer iops() { return iops; } /** *

    * Specifies whether an Amazon EBS volume is encrypted. For more information, see Amazon EBS Encryption. *

    * * @return Specifies whether an Amazon EBS volume is encrypted. For more information, see Amazon EBS Encryption. */ public final Boolean encrypted() { return encrypted; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(volumeId()); hashCode = 31 * hashCode + Objects.hashCode(ec2VolumeId()); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(raidArrayId()); hashCode = 31 * hashCode + Objects.hashCode(instanceId()); hashCode = 31 * hashCode + Objects.hashCode(status()); hashCode = 31 * hashCode + Objects.hashCode(size()); hashCode = 31 * hashCode + Objects.hashCode(device()); hashCode = 31 * hashCode + Objects.hashCode(mountPoint()); hashCode = 31 * hashCode + Objects.hashCode(region()); hashCode = 31 * hashCode + Objects.hashCode(availabilityZone()); hashCode = 31 * hashCode + Objects.hashCode(volumeType()); hashCode = 31 * hashCode + Objects.hashCode(iops()); hashCode = 31 * hashCode + Objects.hashCode(encrypted()); 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 Volume)) { return false; } Volume other = (Volume) obj; return Objects.equals(volumeId(), other.volumeId()) && Objects.equals(ec2VolumeId(), other.ec2VolumeId()) && Objects.equals(name(), other.name()) && Objects.equals(raidArrayId(), other.raidArrayId()) && Objects.equals(instanceId(), other.instanceId()) && Objects.equals(status(), other.status()) && Objects.equals(size(), other.size()) && Objects.equals(device(), other.device()) && Objects.equals(mountPoint(), other.mountPoint()) && Objects.equals(region(), other.region()) && Objects.equals(availabilityZone(), other.availabilityZone()) && Objects.equals(volumeType(), other.volumeType()) && Objects.equals(iops(), other.iops()) && Objects.equals(encrypted(), other.encrypted()); } /** * 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("Volume").add("VolumeId", volumeId()).add("Ec2VolumeId", ec2VolumeId()).add("Name", name()) .add("RaidArrayId", raidArrayId()).add("InstanceId", instanceId()).add("Status", status()).add("Size", size()) .add("Device", device()).add("MountPoint", mountPoint()).add("Region", region()) .add("AvailabilityZone", availabilityZone()).add("VolumeType", volumeType()).add("Iops", iops()) .add("Encrypted", encrypted()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "VolumeId": return Optional.ofNullable(clazz.cast(volumeId())); case "Ec2VolumeId": return Optional.ofNullable(clazz.cast(ec2VolumeId())); case "Name": return Optional.ofNullable(clazz.cast(name())); case "RaidArrayId": return Optional.ofNullable(clazz.cast(raidArrayId())); case "InstanceId": return Optional.ofNullable(clazz.cast(instanceId())); case "Status": return Optional.ofNullable(clazz.cast(status())); case "Size": return Optional.ofNullable(clazz.cast(size())); case "Device": return Optional.ofNullable(clazz.cast(device())); case "MountPoint": return Optional.ofNullable(clazz.cast(mountPoint())); case "Region": return Optional.ofNullable(clazz.cast(region())); case "AvailabilityZone": return Optional.ofNullable(clazz.cast(availabilityZone())); case "VolumeType": return Optional.ofNullable(clazz.cast(volumeType())); case "Iops": return Optional.ofNullable(clazz.cast(iops())); case "Encrypted": return Optional.ofNullable(clazz.cast(encrypted())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((Volume) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

    * The volume ID. *

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

    * The Amazon EC2 volume ID. *

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

    * The volume name. Volume names are a maximum of 128 characters. *

    * * @param name * The volume name. Volume names are a maximum of 128 characters. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); /** *

    * The RAID array ID. *

    * * @param raidArrayId * The RAID array ID. * @return Returns a reference to this object so that method calls can be chained together. */ Builder raidArrayId(String raidArrayId); /** *

    * The instance ID. *

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

    * The value returned by DescribeVolumes. *

    * * @param status * The value returned by DescribeVolumes. * @return Returns a reference to this object so that method calls can be chained together. */ Builder status(String status); /** *

    * The volume size. *

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

    * The device name. *

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

    * The volume mount point. For example, "/mnt/disk1". *

    * * @param mountPoint * The volume mount point. For example, "/mnt/disk1". * @return Returns a reference to this object so that method calls can be chained together. */ Builder mountPoint(String mountPoint); /** *

    * The Amazon Web Services Region. For more information about Amazon Web Services Regions, see Regions and Endpoints. *

    * * @param region * The Amazon Web Services Region. For more information about Amazon Web Services Regions, see Regions and Endpoints. * @return Returns a reference to this object so that method calls can be chained together. */ Builder region(String region); /** *

    * The volume Availability Zone. For more information, see Regions and Endpoints. *

    * * @param availabilityZone * The volume Availability Zone. For more information, see Regions and Endpoints. * @return Returns a reference to this object so that method calls can be chained together. */ Builder availabilityZone(String availabilityZone); /** *

    * The volume type. For more information, see Amazon EBS Volume Types. *

    *
      *
    • *

      * standard - Magnetic. Magnetic volumes must have a minimum size of 1 GiB and a maximum size of * 1024 GiB. *

      *
    • *
    • *

      * io1 - Provisioned IOPS (SSD). PIOPS volumes must have a minimum size of 4 GiB and a maximum size * of 16384 GiB. *

      *
    • *
    • *

      * gp2 - General Purpose (SSD). General purpose volumes must have a minimum size of 1 GiB and a * maximum size of 16384 GiB. *

      *
    • *
    • *

      * st1 - Throughput Optimized hard disk drive (HDD). Throughput optimized HDD volumes must have a * minimum size of 125 GiB and a maximum size of 16384 GiB. *

      *
    • *
    • *

      * sc1 - Cold HDD. Cold HDD volumes must have a minimum size of 125 GiB and a maximum size of 16384 * GiB. *

      *
    • *
    * * @param volumeType * The volume type. For more information, see Amazon EBS Volume * Types.

    *
      *
    • *

      * standard - Magnetic. Magnetic volumes must have a minimum size of 1 GiB and a maximum * size of 1024 GiB. *

      *
    • *
    • *

      * io1 - Provisioned IOPS (SSD). PIOPS volumes must have a minimum size of 4 GiB and a * maximum size of 16384 GiB. *

      *
    • *
    • *

      * gp2 - General Purpose (SSD). General purpose volumes must have a minimum size of 1 GiB * and a maximum size of 16384 GiB. *

      *
    • *
    • *

      * st1 - Throughput Optimized hard disk drive (HDD). Throughput optimized HDD volumes must * have a minimum size of 125 GiB and a maximum size of 16384 GiB. *

      *
    • *
    • *

      * sc1 - Cold HDD. Cold HDD volumes must have a minimum size of 125 GiB and a maximum size * of 16384 GiB. *

      *
    • * @return Returns a reference to this object so that method calls can be chained together. */ Builder volumeType(String volumeType); /** *

      * For PIOPS volumes, the IOPS per disk. *

      * * @param iops * For PIOPS volumes, the IOPS per disk. * @return Returns a reference to this object so that method calls can be chained together. */ Builder iops(Integer iops); /** *

      * Specifies whether an Amazon EBS volume is encrypted. For more information, see Amazon EBS Encryption. *

      * * @param encrypted * Specifies whether an Amazon EBS volume is encrypted. For more information, see Amazon EBS * Encryption. * @return Returns a reference to this object so that method calls can be chained together. */ Builder encrypted(Boolean encrypted); } static final class BuilderImpl implements Builder { private String volumeId; private String ec2VolumeId; private String name; private String raidArrayId; private String instanceId; private String status; private Integer size; private String device; private String mountPoint; private String region; private String availabilityZone; private String volumeType; private Integer iops; private Boolean encrypted; private BuilderImpl() { } private BuilderImpl(Volume model) { volumeId(model.volumeId); ec2VolumeId(model.ec2VolumeId); name(model.name); raidArrayId(model.raidArrayId); instanceId(model.instanceId); status(model.status); size(model.size); device(model.device); mountPoint(model.mountPoint); region(model.region); availabilityZone(model.availabilityZone); volumeType(model.volumeType); iops(model.iops); encrypted(model.encrypted); } public final String getVolumeId() { return volumeId; } public final void setVolumeId(String volumeId) { this.volumeId = volumeId; } @Override public final Builder volumeId(String volumeId) { this.volumeId = volumeId; return this; } public final String getEc2VolumeId() { return ec2VolumeId; } public final void setEc2VolumeId(String ec2VolumeId) { this.ec2VolumeId = ec2VolumeId; } @Override public final Builder ec2VolumeId(String ec2VolumeId) { this.ec2VolumeId = ec2VolumeId; return this; } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override public final Builder name(String name) { this.name = name; return this; } public final String getRaidArrayId() { return raidArrayId; } public final void setRaidArrayId(String raidArrayId) { this.raidArrayId = raidArrayId; } @Override public final Builder raidArrayId(String raidArrayId) { this.raidArrayId = raidArrayId; return this; } public final String getInstanceId() { return instanceId; } public final void setInstanceId(String instanceId) { this.instanceId = instanceId; } @Override public final Builder instanceId(String instanceId) { this.instanceId = instanceId; return this; } public final String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override public final Builder status(String status) { this.status = status; return this; } public final Integer getSize() { return size; } public final void setSize(Integer size) { this.size = size; } @Override public final Builder size(Integer size) { this.size = size; return this; } public final String getDevice() { return device; } public final void setDevice(String device) { this.device = device; } @Override public final Builder device(String device) { this.device = device; return this; } public final String getMountPoint() { return mountPoint; } public final void setMountPoint(String mountPoint) { this.mountPoint = mountPoint; } @Override public final Builder mountPoint(String mountPoint) { this.mountPoint = mountPoint; return this; } public final String getRegion() { return region; } public final void setRegion(String region) { this.region = region; } @Override public final Builder region(String region) { this.region = region; return this; } public final String getAvailabilityZone() { return availabilityZone; } public final void setAvailabilityZone(String availabilityZone) { this.availabilityZone = availabilityZone; } @Override public final Builder availabilityZone(String availabilityZone) { this.availabilityZone = availabilityZone; return this; } public final String getVolumeType() { return volumeType; } public final void setVolumeType(String volumeType) { this.volumeType = volumeType; } @Override public final Builder volumeType(String volumeType) { this.volumeType = volumeType; return this; } public final Integer getIops() { return iops; } public final void setIops(Integer iops) { this.iops = iops; } @Override public final Builder iops(Integer iops) { this.iops = iops; return this; } public final Boolean getEncrypted() { return encrypted; } public final void setEncrypted(Boolean encrypted) { this.encrypted = encrypted; } @Override public final Builder encrypted(Boolean encrypted) { this.encrypted = encrypted; return this; } @Override public Volume build() { return new Volume(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy