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

software.amazon.awssdk.services.opsworks.model.VolumeConfiguration 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.30.1
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 Amazon EBS volume configuration. *

*/ @Generated("software.amazon.awssdk:codegen") public final class VolumeConfiguration implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField MOUNT_POINT_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("MountPoint").getter(getter(VolumeConfiguration::mountPoint)).setter(setter(Builder::mountPoint)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MountPoint").build()).build(); private static final SdkField RAID_LEVEL_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("RaidLevel").getter(getter(VolumeConfiguration::raidLevel)).setter(setter(Builder::raidLevel)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RaidLevel").build()).build(); private static final SdkField NUMBER_OF_DISKS_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("NumberOfDisks").getter(getter(VolumeConfiguration::numberOfDisks)) .setter(setter(Builder::numberOfDisks)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NumberOfDisks").build()).build(); private static final SdkField SIZE_FIELD = SdkField. builder(MarshallingType.INTEGER).memberName("Size") .getter(getter(VolumeConfiguration::size)).setter(setter(Builder::size)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Size").build()).build(); private static final SdkField VOLUME_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("VolumeType").getter(getter(VolumeConfiguration::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(VolumeConfiguration::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(VolumeConfiguration::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(MOUNT_POINT_FIELD, RAID_LEVEL_FIELD, NUMBER_OF_DISKS_FIELD, SIZE_FIELD, VOLUME_TYPE_FIELD, IOPS_FIELD, ENCRYPTED_FIELD)); private static final long serialVersionUID = 1L; private final String mountPoint; private final Integer raidLevel; private final Integer numberOfDisks; private final Integer size; private final String volumeType; private final Integer iops; private final Boolean encrypted; private VolumeConfiguration(BuilderImpl builder) { this.mountPoint = builder.mountPoint; this.raidLevel = builder.raidLevel; this.numberOfDisks = builder.numberOfDisks; this.size = builder.size; this.volumeType = builder.volumeType; this.iops = builder.iops; this.encrypted = builder.encrypted; } /** *

* The volume mount point. For example "/dev/sdh". *

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

* The volume RAID level. *

* * @return The volume RAID level. */ public final Integer raidLevel() { return raidLevel; } /** *

* The number of disks in the volume. *

* * @return The number of disks in the volume. */ public final Integer numberOfDisks() { return numberOfDisks; } /** *

* The volume size. *

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

* 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 500 GiB and a maximum size of 16384 GiB. *

    *
  • *
  • *

    * sc1 - Cold HDD. Cold HDD volumes must have a minimum size of 500 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 500 GiB and a maximum size of 16384 GiB. *

    *
  • *
  • *

    * sc1 - Cold HDD. Cold HDD volumes must have a minimum size of 500 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(mountPoint()); hashCode = 31 * hashCode + Objects.hashCode(raidLevel()); hashCode = 31 * hashCode + Objects.hashCode(numberOfDisks()); hashCode = 31 * hashCode + Objects.hashCode(size()); 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 VolumeConfiguration)) { return false; } VolumeConfiguration other = (VolumeConfiguration) obj; return Objects.equals(mountPoint(), other.mountPoint()) && Objects.equals(raidLevel(), other.raidLevel()) && Objects.equals(numberOfDisks(), other.numberOfDisks()) && Objects.equals(size(), other.size()) && 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("VolumeConfiguration").add("MountPoint", mountPoint()).add("RaidLevel", raidLevel()) .add("NumberOfDisks", numberOfDisks()).add("Size", size()).add("VolumeType", volumeType()).add("Iops", iops()) .add("Encrypted", encrypted()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "MountPoint": return Optional.ofNullable(clazz.cast(mountPoint())); case "RaidLevel": return Optional.ofNullable(clazz.cast(raidLevel())); case "NumberOfDisks": return Optional.ofNullable(clazz.cast(numberOfDisks())); case "Size": return Optional.ofNullable(clazz.cast(size())); 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((VolumeConfiguration) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

    * The volume mount point. For example "/dev/sdh". *

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

    * The volume RAID level. *

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

    * The number of disks in the volume. *

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

    * 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 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 500 GiB and a maximum size of 16384 GiB. *

      *
    • *
    • *

      * sc1 - Cold HDD. Cold HDD volumes must have a minimum size of 500 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 500 GiB and a maximum size of 16384 GiB. *

      *
    • *
    • *

      * sc1 - Cold HDD. Cold HDD volumes must have a minimum size of 500 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 mountPoint; private Integer raidLevel; private Integer numberOfDisks; private Integer size; private String volumeType; private Integer iops; private Boolean encrypted; private BuilderImpl() { } private BuilderImpl(VolumeConfiguration model) { mountPoint(model.mountPoint); raidLevel(model.raidLevel); numberOfDisks(model.numberOfDisks); size(model.size); volumeType(model.volumeType); iops(model.iops); encrypted(model.encrypted); } 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 Integer getRaidLevel() { return raidLevel; } public final void setRaidLevel(Integer raidLevel) { this.raidLevel = raidLevel; } @Override public final Builder raidLevel(Integer raidLevel) { this.raidLevel = raidLevel; return this; } public final Integer getNumberOfDisks() { return numberOfDisks; } public final void setNumberOfDisks(Integer numberOfDisks) { this.numberOfDisks = numberOfDisks; } @Override public final Builder numberOfDisks(Integer numberOfDisks) { this.numberOfDisks = numberOfDisks; 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 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 VolumeConfiguration build() { return new VolumeConfiguration(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy