software.amazon.awssdk.services.costexplorer.model.SavingsPlansPurchaseRecommendationMetadata 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.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;
/**
*
* Metadata about your Savings Plans Purchase Recommendations.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class SavingsPlansPurchaseRecommendationMetadata implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField RECOMMENDATION_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RecommendationId").getter(getter(SavingsPlansPurchaseRecommendationMetadata::recommendationId))
.setter(setter(Builder::recommendationId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RecommendationId").build()).build();
private static final SdkField GENERATION_TIMESTAMP_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("GenerationTimestamp").getter(getter(SavingsPlansPurchaseRecommendationMetadata::generationTimestamp))
.setter(setter(Builder::generationTimestamp))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GenerationTimestamp").build())
.build();
private static final SdkField ADDITIONAL_METADATA_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AdditionalMetadata").getter(getter(SavingsPlansPurchaseRecommendationMetadata::additionalMetadata))
.setter(setter(Builder::additionalMetadata))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AdditionalMetadata").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(RECOMMENDATION_ID_FIELD,
GENERATION_TIMESTAMP_FIELD, ADDITIONAL_METADATA_FIELD));
private static final long serialVersionUID = 1L;
private final String recommendationId;
private final String generationTimestamp;
private final String additionalMetadata;
private SavingsPlansPurchaseRecommendationMetadata(BuilderImpl builder) {
this.recommendationId = builder.recommendationId;
this.generationTimestamp = builder.generationTimestamp;
this.additionalMetadata = builder.additionalMetadata;
}
/**
*
* The unique identifier for the recommendation set.
*
*
* @return The unique identifier for the recommendation set.
*/
public final String recommendationId() {
return recommendationId;
}
/**
*
* The timestamp that shows when the recommendations were generated.
*
*
* @return The timestamp that shows when the recommendations were generated.
*/
public final String generationTimestamp() {
return generationTimestamp;
}
/**
*
* Additional metadata that might be applicable to the recommendation.
*
*
* @return Additional metadata that might be applicable to the recommendation.
*/
public final String additionalMetadata() {
return additionalMetadata;
}
@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 final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(recommendationId());
hashCode = 31 * hashCode + Objects.hashCode(generationTimestamp());
hashCode = 31 * hashCode + Objects.hashCode(additionalMetadata());
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 SavingsPlansPurchaseRecommendationMetadata)) {
return false;
}
SavingsPlansPurchaseRecommendationMetadata other = (SavingsPlansPurchaseRecommendationMetadata) obj;
return Objects.equals(recommendationId(), other.recommendationId())
&& Objects.equals(generationTimestamp(), other.generationTimestamp())
&& Objects.equals(additionalMetadata(), other.additionalMetadata());
}
/**
* 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("SavingsPlansPurchaseRecommendationMetadata").add("RecommendationId", recommendationId())
.add("GenerationTimestamp", generationTimestamp()).add("AdditionalMetadata", additionalMetadata()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "RecommendationId":
return Optional.ofNullable(clazz.cast(recommendationId()));
case "GenerationTimestamp":
return Optional.ofNullable(clazz.cast(generationTimestamp()));
case "AdditionalMetadata":
return Optional.ofNullable(clazz.cast(additionalMetadata()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy