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

software.amazon.awssdk.services.costexplorer.model.ESInstanceDetails Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.29.39
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.costexplorer.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;

/**
 * 

* Details about the Amazon ES instances that AWS recommends that you purchase. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ESInstanceDetails implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField INSTANCE_CLASS_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("InstanceClass").getter(getter(ESInstanceDetails::instanceClass)).setter(setter(Builder::instanceClass)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InstanceClass").build()).build(); private static final SdkField INSTANCE_SIZE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("InstanceSize").getter(getter(ESInstanceDetails::instanceSize)).setter(setter(Builder::instanceSize)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InstanceSize").build()).build(); private static final SdkField REGION_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Region") .getter(getter(ESInstanceDetails::region)).setter(setter(Builder::region)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Region").build()).build(); private static final SdkField CURRENT_GENERATION_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("CurrentGeneration").getter(getter(ESInstanceDetails::currentGeneration)) .setter(setter(Builder::currentGeneration)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CurrentGeneration").build()).build(); private static final SdkField SIZE_FLEX_ELIGIBLE_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("SizeFlexEligible").getter(getter(ESInstanceDetails::sizeFlexEligible)) .setter(setter(Builder::sizeFlexEligible)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SizeFlexEligible").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(INSTANCE_CLASS_FIELD, INSTANCE_SIZE_FIELD, REGION_FIELD, CURRENT_GENERATION_FIELD, SIZE_FLEX_ELIGIBLE_FIELD)); private static final long serialVersionUID = 1L; private final String instanceClass; private final String instanceSize; private final String region; private final Boolean currentGeneration; private final Boolean sizeFlexEligible; private ESInstanceDetails(BuilderImpl builder) { this.instanceClass = builder.instanceClass; this.instanceSize = builder.instanceSize; this.region = builder.region; this.currentGeneration = builder.currentGeneration; this.sizeFlexEligible = builder.sizeFlexEligible; } /** *

* The class of instance that AWS recommends. *

* * @return The class of instance that AWS recommends. */ public String instanceClass() { return instanceClass; } /** *

* The size of instance that AWS recommends. *

* * @return The size of instance that AWS recommends. */ public String instanceSize() { return instanceSize; } /** *

* The AWS Region of the recommended reservation. *

* * @return The AWS Region of the recommended reservation. */ public String region() { return region; } /** *

* Whether the recommendation is for a current-generation instance. *

* * @return Whether the recommendation is for a current-generation instance. */ public Boolean currentGeneration() { return currentGeneration; } /** *

* Whether the recommended reservation is size flexible. *

* * @return Whether the recommended reservation is size flexible. */ public Boolean sizeFlexEligible() { return sizeFlexEligible; } @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(instanceClass()); hashCode = 31 * hashCode + Objects.hashCode(instanceSize()); hashCode = 31 * hashCode + Objects.hashCode(region()); hashCode = 31 * hashCode + Objects.hashCode(currentGeneration()); hashCode = 31 * hashCode + Objects.hashCode(sizeFlexEligible()); 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 ESInstanceDetails)) { return false; } ESInstanceDetails other = (ESInstanceDetails) obj; return Objects.equals(instanceClass(), other.instanceClass()) && Objects.equals(instanceSize(), other.instanceSize()) && Objects.equals(region(), other.region()) && Objects.equals(currentGeneration(), other.currentGeneration()) && Objects.equals(sizeFlexEligible(), other.sizeFlexEligible()); } /** * 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("ESInstanceDetails").add("InstanceClass", instanceClass()).add("InstanceSize", instanceSize()) .add("Region", region()).add("CurrentGeneration", currentGeneration()) .add("SizeFlexEligible", sizeFlexEligible()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "InstanceClass": return Optional.ofNullable(clazz.cast(instanceClass())); case "InstanceSize": return Optional.ofNullable(clazz.cast(instanceSize())); case "Region": return Optional.ofNullable(clazz.cast(region())); case "CurrentGeneration": return Optional.ofNullable(clazz.cast(currentGeneration())); case "SizeFlexEligible": return Optional.ofNullable(clazz.cast(sizeFlexEligible())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ESInstanceDetails) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The class of instance that AWS recommends. *

* * @param instanceClass * The class of instance that AWS recommends. * @return Returns a reference to this object so that method calls can be chained together. */ Builder instanceClass(String instanceClass); /** *

* The size of instance that AWS recommends. *

* * @param instanceSize * The size of instance that AWS recommends. * @return Returns a reference to this object so that method calls can be chained together. */ Builder instanceSize(String instanceSize); /** *

* The AWS Region of the recommended reservation. *

* * @param region * The AWS Region of the recommended reservation. * @return Returns a reference to this object so that method calls can be chained together. */ Builder region(String region); /** *

* Whether the recommendation is for a current-generation instance. *

* * @param currentGeneration * Whether the recommendation is for a current-generation instance. * @return Returns a reference to this object so that method calls can be chained together. */ Builder currentGeneration(Boolean currentGeneration); /** *

* Whether the recommended reservation is size flexible. *

* * @param sizeFlexEligible * Whether the recommended reservation is size flexible. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sizeFlexEligible(Boolean sizeFlexEligible); } static final class BuilderImpl implements Builder { private String instanceClass; private String instanceSize; private String region; private Boolean currentGeneration; private Boolean sizeFlexEligible; private BuilderImpl() { } private BuilderImpl(ESInstanceDetails model) { instanceClass(model.instanceClass); instanceSize(model.instanceSize); region(model.region); currentGeneration(model.currentGeneration); sizeFlexEligible(model.sizeFlexEligible); } public final String getInstanceClass() { return instanceClass; } @Override public final Builder instanceClass(String instanceClass) { this.instanceClass = instanceClass; return this; } public final void setInstanceClass(String instanceClass) { this.instanceClass = instanceClass; } public final String getInstanceSize() { return instanceSize; } @Override public final Builder instanceSize(String instanceSize) { this.instanceSize = instanceSize; return this; } public final void setInstanceSize(String instanceSize) { this.instanceSize = instanceSize; } public final String getRegion() { return region; } @Override public final Builder region(String region) { this.region = region; return this; } public final void setRegion(String region) { this.region = region; } public final Boolean getCurrentGeneration() { return currentGeneration; } @Override public final Builder currentGeneration(Boolean currentGeneration) { this.currentGeneration = currentGeneration; return this; } public final void setCurrentGeneration(Boolean currentGeneration) { this.currentGeneration = currentGeneration; } public final Boolean getSizeFlexEligible() { return sizeFlexEligible; } @Override public final Builder sizeFlexEligible(Boolean sizeFlexEligible) { this.sizeFlexEligible = sizeFlexEligible; return this; } public final void setSizeFlexEligible(Boolean sizeFlexEligible) { this.sizeFlexEligible = sizeFlexEligible; } @Override public ESInstanceDetails build() { return new ESInstanceDetails(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy