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

software.amazon.awssdk.services.costexplorer.model.InstanceDetails 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.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.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.Consumer;
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 reservations that Amazon Web Services recommends that you purchase. *

*/ @Generated("software.amazon.awssdk:codegen") public final class InstanceDetails implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField EC2_INSTANCE_DETAILS_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("EC2InstanceDetails") .getter(getter(InstanceDetails::ec2InstanceDetails)).setter(setter(Builder::ec2InstanceDetails)) .constructor(EC2InstanceDetails::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EC2InstanceDetails").build()) .build(); private static final SdkField RDS_INSTANCE_DETAILS_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("RDSInstanceDetails") .getter(getter(InstanceDetails::rdsInstanceDetails)).setter(setter(Builder::rdsInstanceDetails)) .constructor(RDSInstanceDetails::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RDSInstanceDetails").build()) .build(); private static final SdkField REDSHIFT_INSTANCE_DETAILS_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("RedshiftInstanceDetails") .getter(getter(InstanceDetails::redshiftInstanceDetails)).setter(setter(Builder::redshiftInstanceDetails)) .constructor(RedshiftInstanceDetails::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RedshiftInstanceDetails").build()) .build(); private static final SdkField ELASTI_CACHE_INSTANCE_DETAILS_FIELD = SdkField . builder(MarshallingType.SDK_POJO) .memberName("ElastiCacheInstanceDetails") .getter(getter(InstanceDetails::elastiCacheInstanceDetails)) .setter(setter(Builder::elastiCacheInstanceDetails)) .constructor(ElastiCacheInstanceDetails::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ElastiCacheInstanceDetails").build()) .build(); private static final SdkField ES_INSTANCE_DETAILS_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("ESInstanceDetails") .getter(getter(InstanceDetails::esInstanceDetails)).setter(setter(Builder::esInstanceDetails)) .constructor(ESInstanceDetails::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ESInstanceDetails").build()).build(); private static final SdkField MEMORY_DB_INSTANCE_DETAILS_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("MemoryDBInstanceDetails") .getter(getter(InstanceDetails::memoryDBInstanceDetails)).setter(setter(Builder::memoryDBInstanceDetails)) .constructor(MemoryDBInstanceDetails::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MemoryDBInstanceDetails").build()) .build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(EC2_INSTANCE_DETAILS_FIELD, RDS_INSTANCE_DETAILS_FIELD, REDSHIFT_INSTANCE_DETAILS_FIELD, ELASTI_CACHE_INSTANCE_DETAILS_FIELD, ES_INSTANCE_DETAILS_FIELD, MEMORY_DB_INSTANCE_DETAILS_FIELD)); private static final long serialVersionUID = 1L; private final EC2InstanceDetails ec2InstanceDetails; private final RDSInstanceDetails rdsInstanceDetails; private final RedshiftInstanceDetails redshiftInstanceDetails; private final ElastiCacheInstanceDetails elastiCacheInstanceDetails; private final ESInstanceDetails esInstanceDetails; private final MemoryDBInstanceDetails memoryDBInstanceDetails; private InstanceDetails(BuilderImpl builder) { this.ec2InstanceDetails = builder.ec2InstanceDetails; this.rdsInstanceDetails = builder.rdsInstanceDetails; this.redshiftInstanceDetails = builder.redshiftInstanceDetails; this.elastiCacheInstanceDetails = builder.elastiCacheInstanceDetails; this.esInstanceDetails = builder.esInstanceDetails; this.memoryDBInstanceDetails = builder.memoryDBInstanceDetails; } /** *

* The Amazon EC2 reservations that Amazon Web Services recommends that you purchase. *

* * @return The Amazon EC2 reservations that Amazon Web Services recommends that you purchase. */ public final EC2InstanceDetails ec2InstanceDetails() { return ec2InstanceDetails; } /** *

* The Amazon RDS reservations that Amazon Web Services recommends that you purchase. *

* * @return The Amazon RDS reservations that Amazon Web Services recommends that you purchase. */ public final RDSInstanceDetails rdsInstanceDetails() { return rdsInstanceDetails; } /** *

* The Amazon Redshift reservations that Amazon Web Services recommends that you purchase. *

* * @return The Amazon Redshift reservations that Amazon Web Services recommends that you purchase. */ public final RedshiftInstanceDetails redshiftInstanceDetails() { return redshiftInstanceDetails; } /** *

* The ElastiCache reservations that Amazon Web Services recommends that you purchase. *

* * @return The ElastiCache reservations that Amazon Web Services recommends that you purchase. */ public final ElastiCacheInstanceDetails elastiCacheInstanceDetails() { return elastiCacheInstanceDetails; } /** *

* The Amazon OpenSearch Service reservations that Amazon Web Services recommends that you purchase. *

* * @return The Amazon OpenSearch Service reservations that Amazon Web Services recommends that you purchase. */ public final ESInstanceDetails esInstanceDetails() { return esInstanceDetails; } /** *

* The MemoryDB reservations that Amazon Web Services recommends that you purchase. *

* * @return The MemoryDB reservations that Amazon Web Services recommends that you purchase. */ public final MemoryDBInstanceDetails memoryDBInstanceDetails() { return memoryDBInstanceDetails; } @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(ec2InstanceDetails()); hashCode = 31 * hashCode + Objects.hashCode(rdsInstanceDetails()); hashCode = 31 * hashCode + Objects.hashCode(redshiftInstanceDetails()); hashCode = 31 * hashCode + Objects.hashCode(elastiCacheInstanceDetails()); hashCode = 31 * hashCode + Objects.hashCode(esInstanceDetails()); hashCode = 31 * hashCode + Objects.hashCode(memoryDBInstanceDetails()); 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 InstanceDetails)) { return false; } InstanceDetails other = (InstanceDetails) obj; return Objects.equals(ec2InstanceDetails(), other.ec2InstanceDetails()) && Objects.equals(rdsInstanceDetails(), other.rdsInstanceDetails()) && Objects.equals(redshiftInstanceDetails(), other.redshiftInstanceDetails()) && Objects.equals(elastiCacheInstanceDetails(), other.elastiCacheInstanceDetails()) && Objects.equals(esInstanceDetails(), other.esInstanceDetails()) && Objects.equals(memoryDBInstanceDetails(), other.memoryDBInstanceDetails()); } /** * 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("InstanceDetails").add("EC2InstanceDetails", ec2InstanceDetails()) .add("RDSInstanceDetails", rdsInstanceDetails()).add("RedshiftInstanceDetails", redshiftInstanceDetails()) .add("ElastiCacheInstanceDetails", elastiCacheInstanceDetails()).add("ESInstanceDetails", esInstanceDetails()) .add("MemoryDBInstanceDetails", memoryDBInstanceDetails()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "EC2InstanceDetails": return Optional.ofNullable(clazz.cast(ec2InstanceDetails())); case "RDSInstanceDetails": return Optional.ofNullable(clazz.cast(rdsInstanceDetails())); case "RedshiftInstanceDetails": return Optional.ofNullable(clazz.cast(redshiftInstanceDetails())); case "ElastiCacheInstanceDetails": return Optional.ofNullable(clazz.cast(elastiCacheInstanceDetails())); case "ESInstanceDetails": return Optional.ofNullable(clazz.cast(esInstanceDetails())); case "MemoryDBInstanceDetails": return Optional.ofNullable(clazz.cast(memoryDBInstanceDetails())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((InstanceDetails) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The Amazon EC2 reservations that Amazon Web Services recommends that you purchase. *

* * @param ec2InstanceDetails * The Amazon EC2 reservations that Amazon Web Services recommends that you purchase. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ec2InstanceDetails(EC2InstanceDetails ec2InstanceDetails); /** *

* The Amazon EC2 reservations that Amazon Web Services recommends that you purchase. *

* This is a convenience method that creates an instance of the {@link EC2InstanceDetails.Builder} avoiding the * need to create one manually via {@link EC2InstanceDetails#builder()}. * *

* When the {@link Consumer} completes, {@link EC2InstanceDetails.Builder#build()} is called immediately and its * result is passed to {@link #ec2InstanceDetails(EC2InstanceDetails)}. * * @param ec2InstanceDetails * a consumer that will call methods on {@link EC2InstanceDetails.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #ec2InstanceDetails(EC2InstanceDetails) */ default Builder ec2InstanceDetails(Consumer ec2InstanceDetails) { return ec2InstanceDetails(EC2InstanceDetails.builder().applyMutation(ec2InstanceDetails).build()); } /** *

* The Amazon RDS reservations that Amazon Web Services recommends that you purchase. *

* * @param rdsInstanceDetails * The Amazon RDS reservations that Amazon Web Services recommends that you purchase. * @return Returns a reference to this object so that method calls can be chained together. */ Builder rdsInstanceDetails(RDSInstanceDetails rdsInstanceDetails); /** *

* The Amazon RDS reservations that Amazon Web Services recommends that you purchase. *

* This is a convenience method that creates an instance of the {@link RDSInstanceDetails.Builder} avoiding the * need to create one manually via {@link RDSInstanceDetails#builder()}. * *

* When the {@link Consumer} completes, {@link RDSInstanceDetails.Builder#build()} is called immediately and its * result is passed to {@link #rdsInstanceDetails(RDSInstanceDetails)}. * * @param rdsInstanceDetails * a consumer that will call methods on {@link RDSInstanceDetails.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #rdsInstanceDetails(RDSInstanceDetails) */ default Builder rdsInstanceDetails(Consumer rdsInstanceDetails) { return rdsInstanceDetails(RDSInstanceDetails.builder().applyMutation(rdsInstanceDetails).build()); } /** *

* The Amazon Redshift reservations that Amazon Web Services recommends that you purchase. *

* * @param redshiftInstanceDetails * The Amazon Redshift reservations that Amazon Web Services recommends that you purchase. * @return Returns a reference to this object so that method calls can be chained together. */ Builder redshiftInstanceDetails(RedshiftInstanceDetails redshiftInstanceDetails); /** *

* The Amazon Redshift reservations that Amazon Web Services recommends that you purchase. *

* This is a convenience method that creates an instance of the {@link RedshiftInstanceDetails.Builder} avoiding * the need to create one manually via {@link RedshiftInstanceDetails#builder()}. * *

* When the {@link Consumer} completes, {@link RedshiftInstanceDetails.Builder#build()} is called immediately * and its result is passed to {@link #redshiftInstanceDetails(RedshiftInstanceDetails)}. * * @param redshiftInstanceDetails * a consumer that will call methods on {@link RedshiftInstanceDetails.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #redshiftInstanceDetails(RedshiftInstanceDetails) */ default Builder redshiftInstanceDetails(Consumer redshiftInstanceDetails) { return redshiftInstanceDetails(RedshiftInstanceDetails.builder().applyMutation(redshiftInstanceDetails).build()); } /** *

* The ElastiCache reservations that Amazon Web Services recommends that you purchase. *

* * @param elastiCacheInstanceDetails * The ElastiCache reservations that Amazon Web Services recommends that you purchase. * @return Returns a reference to this object so that method calls can be chained together. */ Builder elastiCacheInstanceDetails(ElastiCacheInstanceDetails elastiCacheInstanceDetails); /** *

* The ElastiCache reservations that Amazon Web Services recommends that you purchase. *

* This is a convenience method that creates an instance of the {@link ElastiCacheInstanceDetails.Builder} * avoiding the need to create one manually via {@link ElastiCacheInstanceDetails#builder()}. * *

* When the {@link Consumer} completes, {@link ElastiCacheInstanceDetails.Builder#build()} is called immediately * and its result is passed to {@link #elastiCacheInstanceDetails(ElastiCacheInstanceDetails)}. * * @param elastiCacheInstanceDetails * a consumer that will call methods on {@link ElastiCacheInstanceDetails.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #elastiCacheInstanceDetails(ElastiCacheInstanceDetails) */ default Builder elastiCacheInstanceDetails(Consumer elastiCacheInstanceDetails) { return elastiCacheInstanceDetails(ElastiCacheInstanceDetails.builder().applyMutation(elastiCacheInstanceDetails) .build()); } /** *

* The Amazon OpenSearch Service reservations that Amazon Web Services recommends that you purchase. *

* * @param esInstanceDetails * The Amazon OpenSearch Service reservations that Amazon Web Services recommends that you purchase. * @return Returns a reference to this object so that method calls can be chained together. */ Builder esInstanceDetails(ESInstanceDetails esInstanceDetails); /** *

* The Amazon OpenSearch Service reservations that Amazon Web Services recommends that you purchase. *

* This is a convenience method that creates an instance of the {@link ESInstanceDetails.Builder} avoiding the * need to create one manually via {@link ESInstanceDetails#builder()}. * *

* When the {@link Consumer} completes, {@link ESInstanceDetails.Builder#build()} is called immediately and its * result is passed to {@link #esInstanceDetails(ESInstanceDetails)}. * * @param esInstanceDetails * a consumer that will call methods on {@link ESInstanceDetails.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #esInstanceDetails(ESInstanceDetails) */ default Builder esInstanceDetails(Consumer esInstanceDetails) { return esInstanceDetails(ESInstanceDetails.builder().applyMutation(esInstanceDetails).build()); } /** *

* The MemoryDB reservations that Amazon Web Services recommends that you purchase. *

* * @param memoryDBInstanceDetails * The MemoryDB reservations that Amazon Web Services recommends that you purchase. * @return Returns a reference to this object so that method calls can be chained together. */ Builder memoryDBInstanceDetails(MemoryDBInstanceDetails memoryDBInstanceDetails); /** *

* The MemoryDB reservations that Amazon Web Services recommends that you purchase. *

* This is a convenience method that creates an instance of the {@link MemoryDBInstanceDetails.Builder} avoiding * the need to create one manually via {@link MemoryDBInstanceDetails#builder()}. * *

* When the {@link Consumer} completes, {@link MemoryDBInstanceDetails.Builder#build()} is called immediately * and its result is passed to {@link #memoryDBInstanceDetails(MemoryDBInstanceDetails)}. * * @param memoryDBInstanceDetails * a consumer that will call methods on {@link MemoryDBInstanceDetails.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #memoryDBInstanceDetails(MemoryDBInstanceDetails) */ default Builder memoryDBInstanceDetails(Consumer memoryDBInstanceDetails) { return memoryDBInstanceDetails(MemoryDBInstanceDetails.builder().applyMutation(memoryDBInstanceDetails).build()); } } static final class BuilderImpl implements Builder { private EC2InstanceDetails ec2InstanceDetails; private RDSInstanceDetails rdsInstanceDetails; private RedshiftInstanceDetails redshiftInstanceDetails; private ElastiCacheInstanceDetails elastiCacheInstanceDetails; private ESInstanceDetails esInstanceDetails; private MemoryDBInstanceDetails memoryDBInstanceDetails; private BuilderImpl() { } private BuilderImpl(InstanceDetails model) { ec2InstanceDetails(model.ec2InstanceDetails); rdsInstanceDetails(model.rdsInstanceDetails); redshiftInstanceDetails(model.redshiftInstanceDetails); elastiCacheInstanceDetails(model.elastiCacheInstanceDetails); esInstanceDetails(model.esInstanceDetails); memoryDBInstanceDetails(model.memoryDBInstanceDetails); } public final EC2InstanceDetails.Builder getEc2InstanceDetails() { return ec2InstanceDetails != null ? ec2InstanceDetails.toBuilder() : null; } public final void setEc2InstanceDetails(EC2InstanceDetails.BuilderImpl ec2InstanceDetails) { this.ec2InstanceDetails = ec2InstanceDetails != null ? ec2InstanceDetails.build() : null; } @Override public final Builder ec2InstanceDetails(EC2InstanceDetails ec2InstanceDetails) { this.ec2InstanceDetails = ec2InstanceDetails; return this; } public final RDSInstanceDetails.Builder getRdsInstanceDetails() { return rdsInstanceDetails != null ? rdsInstanceDetails.toBuilder() : null; } public final void setRdsInstanceDetails(RDSInstanceDetails.BuilderImpl rdsInstanceDetails) { this.rdsInstanceDetails = rdsInstanceDetails != null ? rdsInstanceDetails.build() : null; } @Override public final Builder rdsInstanceDetails(RDSInstanceDetails rdsInstanceDetails) { this.rdsInstanceDetails = rdsInstanceDetails; return this; } public final RedshiftInstanceDetails.Builder getRedshiftInstanceDetails() { return redshiftInstanceDetails != null ? redshiftInstanceDetails.toBuilder() : null; } public final void setRedshiftInstanceDetails(RedshiftInstanceDetails.BuilderImpl redshiftInstanceDetails) { this.redshiftInstanceDetails = redshiftInstanceDetails != null ? redshiftInstanceDetails.build() : null; } @Override public final Builder redshiftInstanceDetails(RedshiftInstanceDetails redshiftInstanceDetails) { this.redshiftInstanceDetails = redshiftInstanceDetails; return this; } public final ElastiCacheInstanceDetails.Builder getElastiCacheInstanceDetails() { return elastiCacheInstanceDetails != null ? elastiCacheInstanceDetails.toBuilder() : null; } public final void setElastiCacheInstanceDetails(ElastiCacheInstanceDetails.BuilderImpl elastiCacheInstanceDetails) { this.elastiCacheInstanceDetails = elastiCacheInstanceDetails != null ? elastiCacheInstanceDetails.build() : null; } @Override public final Builder elastiCacheInstanceDetails(ElastiCacheInstanceDetails elastiCacheInstanceDetails) { this.elastiCacheInstanceDetails = elastiCacheInstanceDetails; return this; } public final ESInstanceDetails.Builder getEsInstanceDetails() { return esInstanceDetails != null ? esInstanceDetails.toBuilder() : null; } public final void setEsInstanceDetails(ESInstanceDetails.BuilderImpl esInstanceDetails) { this.esInstanceDetails = esInstanceDetails != null ? esInstanceDetails.build() : null; } @Override public final Builder esInstanceDetails(ESInstanceDetails esInstanceDetails) { this.esInstanceDetails = esInstanceDetails; return this; } public final MemoryDBInstanceDetails.Builder getMemoryDBInstanceDetails() { return memoryDBInstanceDetails != null ? memoryDBInstanceDetails.toBuilder() : null; } public final void setMemoryDBInstanceDetails(MemoryDBInstanceDetails.BuilderImpl memoryDBInstanceDetails) { this.memoryDBInstanceDetails = memoryDBInstanceDetails != null ? memoryDBInstanceDetails.build() : null; } @Override public final Builder memoryDBInstanceDetails(MemoryDBInstanceDetails memoryDBInstanceDetails) { this.memoryDBInstanceDetails = memoryDBInstanceDetails; return this; } @Override public InstanceDetails build() { return new InstanceDetails(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy