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

software.amazon.awssdk.services.opensearch.model.EBSOptions Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Open Search module holds the client classes that are used for communicating with Open Search.

The 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.opensearch.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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;

/**
 * 

* Container for the parameters required to enable EBS-based storage for an OpenSearch Service domain. *

*/ @Generated("software.amazon.awssdk:codegen") public final class EBSOptions implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField EBS_ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("EBSEnabled").getter(getter(EBSOptions::ebsEnabled)).setter(setter(Builder::ebsEnabled)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EBSEnabled").build()).build(); private static final SdkField VOLUME_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("VolumeType").getter(getter(EBSOptions::volumeTypeAsString)).setter(setter(Builder::volumeType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VolumeType").build()).build(); private static final SdkField VOLUME_SIZE_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("VolumeSize").getter(getter(EBSOptions::volumeSize)).setter(setter(Builder::volumeSize)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VolumeSize").build()).build(); private static final SdkField IOPS_FIELD = SdkField. builder(MarshallingType.INTEGER).memberName("Iops") .getter(getter(EBSOptions::iops)).setter(setter(Builder::iops)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Iops").build()).build(); private static final SdkField THROUGHPUT_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("Throughput").getter(getter(EBSOptions::throughput)).setter(setter(Builder::throughput)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Throughput").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(EBS_ENABLED_FIELD, VOLUME_TYPE_FIELD, VOLUME_SIZE_FIELD, IOPS_FIELD, THROUGHPUT_FIELD)); private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer(); private static final long serialVersionUID = 1L; private final Boolean ebsEnabled; private final String volumeType; private final Integer volumeSize; private final Integer iops; private final Integer throughput; private EBSOptions(BuilderImpl builder) { this.ebsEnabled = builder.ebsEnabled; this.volumeType = builder.volumeType; this.volumeSize = builder.volumeSize; this.iops = builder.iops; this.throughput = builder.throughput; } /** *

* Indicates whether EBS volumes are attached to data nodes in an OpenSearch Service domain. *

* * @return Indicates whether EBS volumes are attached to data nodes in an OpenSearch Service domain. */ public final Boolean ebsEnabled() { return ebsEnabled; } /** *

* Specifies the type of EBS volumes attached to data nodes. *

*

* 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 Specifies the type of EBS volumes attached to data nodes. * @see VolumeType */ public final VolumeType volumeType() { return VolumeType.fromValue(volumeType); } /** *

* Specifies the type of EBS volumes attached to data nodes. *

*

* 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 Specifies the type of EBS volumes attached to data nodes. * @see VolumeType */ public final String volumeTypeAsString() { return volumeType; } /** *

* Specifies the size (in GiB) of EBS volumes attached to data nodes. *

* * @return Specifies the size (in GiB) of EBS volumes attached to data nodes. */ public final Integer volumeSize() { return volumeSize; } /** *

* Specifies the baseline input/output (I/O) performance of EBS volumes attached to data nodes. Applicable only for * the gp3 and provisioned IOPS EBS volume types. *

* * @return Specifies the baseline input/output (I/O) performance of EBS volumes attached to data nodes. Applicable * only for the gp3 and provisioned IOPS EBS volume types. */ public final Integer iops() { return iops; } /** *

* Specifies the throughput (in MiB/s) of the EBS volumes attached to data nodes. Applicable only for the * gp3 volume type. *

* * @return Specifies the throughput (in MiB/s) of the EBS volumes attached to data nodes. Applicable only for the * gp3 volume type. */ public final Integer throughput() { return throughput; } @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(ebsEnabled()); hashCode = 31 * hashCode + Objects.hashCode(volumeTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(volumeSize()); hashCode = 31 * hashCode + Objects.hashCode(iops()); hashCode = 31 * hashCode + Objects.hashCode(throughput()); 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 EBSOptions)) { return false; } EBSOptions other = (EBSOptions) obj; return Objects.equals(ebsEnabled(), other.ebsEnabled()) && Objects.equals(volumeTypeAsString(), other.volumeTypeAsString()) && Objects.equals(volumeSize(), other.volumeSize()) && Objects.equals(iops(), other.iops()) && Objects.equals(throughput(), other.throughput()); } /** * 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("EBSOptions").add("EBSEnabled", ebsEnabled()).add("VolumeType", volumeTypeAsString()) .add("VolumeSize", volumeSize()).add("Iops", iops()).add("Throughput", throughput()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "EBSEnabled": return Optional.ofNullable(clazz.cast(ebsEnabled())); case "VolumeType": return Optional.ofNullable(clazz.cast(volumeTypeAsString())); case "VolumeSize": return Optional.ofNullable(clazz.cast(volumeSize())); case "Iops": return Optional.ofNullable(clazz.cast(iops())); case "Throughput": return Optional.ofNullable(clazz.cast(throughput())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } @Override public final Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } private static Map> memberNameToFieldInitializer() { Map> map = new HashMap<>(); map.put("EBSEnabled", EBS_ENABLED_FIELD); map.put("VolumeType", VOLUME_TYPE_FIELD); map.put("VolumeSize", VOLUME_SIZE_FIELD); map.put("Iops", IOPS_FIELD); map.put("Throughput", THROUGHPUT_FIELD); return Collections.unmodifiableMap(map); } private static Function getter(Function g) { return obj -> g.apply((EBSOptions) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* Indicates whether EBS volumes are attached to data nodes in an OpenSearch Service domain. *

* * @param ebsEnabled * Indicates whether EBS volumes are attached to data nodes in an OpenSearch Service domain. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ebsEnabled(Boolean ebsEnabled); /** *

* Specifies the type of EBS volumes attached to data nodes. *

* * @param volumeType * Specifies the type of EBS volumes attached to data nodes. * @see VolumeType * @return Returns a reference to this object so that method calls can be chained together. * @see VolumeType */ Builder volumeType(String volumeType); /** *

* Specifies the type of EBS volumes attached to data nodes. *

* * @param volumeType * Specifies the type of EBS volumes attached to data nodes. * @see VolumeType * @return Returns a reference to this object so that method calls can be chained together. * @see VolumeType */ Builder volumeType(VolumeType volumeType); /** *

* Specifies the size (in GiB) of EBS volumes attached to data nodes. *

* * @param volumeSize * Specifies the size (in GiB) of EBS volumes attached to data nodes. * @return Returns a reference to this object so that method calls can be chained together. */ Builder volumeSize(Integer volumeSize); /** *

* Specifies the baseline input/output (I/O) performance of EBS volumes attached to data nodes. Applicable only * for the gp3 and provisioned IOPS EBS volume types. *

* * @param iops * Specifies the baseline input/output (I/O) performance of EBS volumes attached to data nodes. * Applicable only for the gp3 and provisioned IOPS EBS volume types. * @return Returns a reference to this object so that method calls can be chained together. */ Builder iops(Integer iops); /** *

* Specifies the throughput (in MiB/s) of the EBS volumes attached to data nodes. Applicable only for the * gp3 volume type. *

* * @param throughput * Specifies the throughput (in MiB/s) of the EBS volumes attached to data nodes. Applicable only for the * gp3 volume type. * @return Returns a reference to this object so that method calls can be chained together. */ Builder throughput(Integer throughput); } static final class BuilderImpl implements Builder { private Boolean ebsEnabled; private String volumeType; private Integer volumeSize; private Integer iops; private Integer throughput; private BuilderImpl() { } private BuilderImpl(EBSOptions model) { ebsEnabled(model.ebsEnabled); volumeType(model.volumeType); volumeSize(model.volumeSize); iops(model.iops); throughput(model.throughput); } public final Boolean getEbsEnabled() { return ebsEnabled; } public final void setEbsEnabled(Boolean ebsEnabled) { this.ebsEnabled = ebsEnabled; } @Override public final Builder ebsEnabled(Boolean ebsEnabled) { this.ebsEnabled = ebsEnabled; 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; } @Override public final Builder volumeType(VolumeType volumeType) { this.volumeType(volumeType == null ? null : volumeType.toString()); return this; } public final Integer getVolumeSize() { return volumeSize; } public final void setVolumeSize(Integer volumeSize) { this.volumeSize = volumeSize; } @Override public final Builder volumeSize(Integer volumeSize) { this.volumeSize = volumeSize; 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 Integer getThroughput() { return throughput; } public final void setThroughput(Integer throughput) { this.throughput = throughput; } @Override public final Builder throughput(Integer throughput) { this.throughput = throughput; return this; } @Override public EBSOptions build() { return new EBSOptions(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy