software.amazon.awssdk.services.costexplorer.model.InstanceDetails Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of costexplorer Show documentation
Show all versions of costexplorer Show documentation
The AWS Java SDK for AWS Cost Explorer module holds the client classes that are used for communicating
with AWS Cost Explorer Service
/*
* 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 instances that AWS 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 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));
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 InstanceDetails(BuilderImpl builder) {
this.ec2InstanceDetails = builder.ec2InstanceDetails;
this.rdsInstanceDetails = builder.rdsInstanceDetails;
this.redshiftInstanceDetails = builder.redshiftInstanceDetails;
this.elastiCacheInstanceDetails = builder.elastiCacheInstanceDetails;
this.esInstanceDetails = builder.esInstanceDetails;
}
/**
*
* The Amazon EC2 instances that AWS recommends that you purchase.
*
*
* @return The Amazon EC2 instances that AWS recommends that you purchase.
*/
public EC2InstanceDetails ec2InstanceDetails() {
return ec2InstanceDetails;
}
/**
*
* The Amazon RDS instances that AWS recommends that you purchase.
*
*
* @return The Amazon RDS instances that AWS recommends that you purchase.
*/
public RDSInstanceDetails rdsInstanceDetails() {
return rdsInstanceDetails;
}
/**
*
* The Amazon Redshift instances that AWS recommends that you purchase.
*
*
* @return The Amazon Redshift instances that AWS recommends that you purchase.
*/
public RedshiftInstanceDetails redshiftInstanceDetails() {
return redshiftInstanceDetails;
}
/**
*
* The ElastiCache instances that AWS recommends that you purchase.
*
*
* @return The ElastiCache instances that AWS recommends that you purchase.
*/
public ElastiCacheInstanceDetails elastiCacheInstanceDetails() {
return elastiCacheInstanceDetails;
}
/**
*
* The Amazon ES instances that AWS recommends that you purchase.
*
*
* @return The Amazon ES instances that AWS recommends that you purchase.
*/
public ESInstanceDetails esInstanceDetails() {
return esInstanceDetails;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public 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());
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 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());
}
/**
* 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("InstanceDetails").add("EC2InstanceDetails", ec2InstanceDetails())
.add("RDSInstanceDetails", rdsInstanceDetails()).add("RedshiftInstanceDetails", redshiftInstanceDetails())
.add("ElastiCacheInstanceDetails", elastiCacheInstanceDetails()).add("ESInstanceDetails", esInstanceDetails())
.build();
}
public 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()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy