software.amazon.awssdk.services.costexplorer.model.RecommendationDetailData Maven / Gradle / Ivy
Show all versions of costexplorer Show documentation
/*
* 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.Collection;
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 java.util.stream.Collectors;
import java.util.stream.Stream;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* The details and metrics for the given recommendation.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class RecommendationDetailData implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField ACCOUNT_SCOPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AccountScope").getter(getter(RecommendationDetailData::accountScopeAsString))
.setter(setter(Builder::accountScope))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AccountScope").build()).build();
private static final SdkField LOOKBACK_PERIOD_IN_DAYS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("LookbackPeriodInDays").getter(getter(RecommendationDetailData::lookbackPeriodInDaysAsString))
.setter(setter(Builder::lookbackPeriodInDays))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LookbackPeriodInDays").build())
.build();
private static final SdkField SAVINGS_PLANS_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SavingsPlansType").getter(getter(RecommendationDetailData::savingsPlansTypeAsString))
.setter(setter(Builder::savingsPlansType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SavingsPlansType").build()).build();
private static final SdkField TERM_IN_YEARS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TermInYears").getter(getter(RecommendationDetailData::termInYearsAsString))
.setter(setter(Builder::termInYears))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TermInYears").build()).build();
private static final SdkField PAYMENT_OPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("PaymentOption").getter(getter(RecommendationDetailData::paymentOptionAsString))
.setter(setter(Builder::paymentOption))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PaymentOption").build()).build();
private static final SdkField ACCOUNT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AccountId").getter(getter(RecommendationDetailData::accountId)).setter(setter(Builder::accountId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AccountId").build()).build();
private static final SdkField CURRENCY_CODE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CurrencyCode").getter(getter(RecommendationDetailData::currencyCode))
.setter(setter(Builder::currencyCode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CurrencyCode").build()).build();
private static final SdkField INSTANCE_FAMILY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("InstanceFamily").getter(getter(RecommendationDetailData::instanceFamily))
.setter(setter(Builder::instanceFamily))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InstanceFamily").build()).build();
private static final SdkField REGION_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Region")
.getter(getter(RecommendationDetailData::region)).setter(setter(Builder::region))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Region").build()).build();
private static final SdkField OFFERING_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("OfferingId").getter(getter(RecommendationDetailData::offeringId)).setter(setter(Builder::offeringId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OfferingId").build()).build();
private static final SdkField GENERATION_TIMESTAMP_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("GenerationTimestamp").getter(getter(RecommendationDetailData::generationTimestamp))
.setter(setter(Builder::generationTimestamp))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GenerationTimestamp").build())
.build();
private static final SdkField LATEST_USAGE_TIMESTAMP_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("LatestUsageTimestamp").getter(getter(RecommendationDetailData::latestUsageTimestamp))
.setter(setter(Builder::latestUsageTimestamp))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LatestUsageTimestamp").build())
.build();
private static final SdkField CURRENT_AVERAGE_HOURLY_ON_DEMAND_SPEND_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("CurrentAverageHourlyOnDemandSpend")
.getter(getter(RecommendationDetailData::currentAverageHourlyOnDemandSpend))
.setter(setter(Builder::currentAverageHourlyOnDemandSpend))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CurrentAverageHourlyOnDemandSpend")
.build()).build();
private static final SdkField CURRENT_MAXIMUM_HOURLY_ON_DEMAND_SPEND_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("CurrentMaximumHourlyOnDemandSpend")
.getter(getter(RecommendationDetailData::currentMaximumHourlyOnDemandSpend))
.setter(setter(Builder::currentMaximumHourlyOnDemandSpend))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CurrentMaximumHourlyOnDemandSpend")
.build()).build();
private static final SdkField CURRENT_MINIMUM_HOURLY_ON_DEMAND_SPEND_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("CurrentMinimumHourlyOnDemandSpend")
.getter(getter(RecommendationDetailData::currentMinimumHourlyOnDemandSpend))
.setter(setter(Builder::currentMinimumHourlyOnDemandSpend))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CurrentMinimumHourlyOnDemandSpend")
.build()).build();
private static final SdkField ESTIMATED_AVERAGE_UTILIZATION_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("EstimatedAverageUtilization")
.getter(getter(RecommendationDetailData::estimatedAverageUtilization))
.setter(setter(Builder::estimatedAverageUtilization))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EstimatedAverageUtilization")
.build()).build();
private static final SdkField ESTIMATED_MONTHLY_SAVINGS_AMOUNT_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("EstimatedMonthlySavingsAmount")
.getter(getter(RecommendationDetailData::estimatedMonthlySavingsAmount))
.setter(setter(Builder::estimatedMonthlySavingsAmount))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EstimatedMonthlySavingsAmount")
.build()).build();
private static final SdkField ESTIMATED_ON_DEMAND_COST_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EstimatedOnDemandCost").getter(getter(RecommendationDetailData::estimatedOnDemandCost))
.setter(setter(Builder::estimatedOnDemandCost))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EstimatedOnDemandCost").build())
.build();
private static final SdkField ESTIMATED_ON_DEMAND_COST_WITH_CURRENT_COMMITMENT_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("EstimatedOnDemandCostWithCurrentCommitment")
.getter(getter(RecommendationDetailData::estimatedOnDemandCostWithCurrentCommitment))
.setter(setter(Builder::estimatedOnDemandCostWithCurrentCommitment))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("EstimatedOnDemandCostWithCurrentCommitment").build()).build();
private static final SdkField ESTIMATED_ROI_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EstimatedROI").getter(getter(RecommendationDetailData::estimatedROI))
.setter(setter(Builder::estimatedROI))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EstimatedROI").build()).build();
private static final SdkField ESTIMATED_SP_COST_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EstimatedSPCost").getter(getter(RecommendationDetailData::estimatedSPCost))
.setter(setter(Builder::estimatedSPCost))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EstimatedSPCost").build()).build();
private static final SdkField ESTIMATED_SAVINGS_AMOUNT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EstimatedSavingsAmount").getter(getter(RecommendationDetailData::estimatedSavingsAmount))
.setter(setter(Builder::estimatedSavingsAmount))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EstimatedSavingsAmount").build())
.build();
private static final SdkField ESTIMATED_SAVINGS_PERCENTAGE_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("EstimatedSavingsPercentage")
.getter(getter(RecommendationDetailData::estimatedSavingsPercentage))
.setter(setter(Builder::estimatedSavingsPercentage))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EstimatedSavingsPercentage").build())
.build();
private static final SdkField EXISTING_HOURLY_COMMITMENT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ExistingHourlyCommitment").getter(getter(RecommendationDetailData::existingHourlyCommitment))
.setter(setter(Builder::existingHourlyCommitment))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ExistingHourlyCommitment").build())
.build();
private static final SdkField HOURLY_COMMITMENT_TO_PURCHASE_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("HourlyCommitmentToPurchase")
.getter(getter(RecommendationDetailData::hourlyCommitmentToPurchase))
.setter(setter(Builder::hourlyCommitmentToPurchase))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HourlyCommitmentToPurchase").build())
.build();
private static final SdkField UPFRONT_COST_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("UpfrontCost").getter(getter(RecommendationDetailData::upfrontCost)).setter(setter(Builder::upfrontCost))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UpfrontCost").build()).build();
private static final SdkField CURRENT_AVERAGE_COVERAGE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CurrentAverageCoverage").getter(getter(RecommendationDetailData::currentAverageCoverage))
.setter(setter(Builder::currentAverageCoverage))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CurrentAverageCoverage").build())
.build();
private static final SdkField ESTIMATED_AVERAGE_COVERAGE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EstimatedAverageCoverage").getter(getter(RecommendationDetailData::estimatedAverageCoverage))
.setter(setter(Builder::estimatedAverageCoverage))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EstimatedAverageCoverage").build())
.build();
private static final SdkField> METRICS_OVER_LOOKBACK_PERIOD_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("MetricsOverLookbackPeriod")
.getter(getter(RecommendationDetailData::metricsOverLookbackPeriod))
.setter(setter(Builder::metricsOverLookbackPeriod))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MetricsOverLookbackPeriod").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(RecommendationDetailHourlyMetrics::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ACCOUNT_SCOPE_FIELD,
LOOKBACK_PERIOD_IN_DAYS_FIELD, SAVINGS_PLANS_TYPE_FIELD, TERM_IN_YEARS_FIELD, PAYMENT_OPTION_FIELD, ACCOUNT_ID_FIELD,
CURRENCY_CODE_FIELD, INSTANCE_FAMILY_FIELD, REGION_FIELD, OFFERING_ID_FIELD, GENERATION_TIMESTAMP_FIELD,
LATEST_USAGE_TIMESTAMP_FIELD, CURRENT_AVERAGE_HOURLY_ON_DEMAND_SPEND_FIELD,
CURRENT_MAXIMUM_HOURLY_ON_DEMAND_SPEND_FIELD, CURRENT_MINIMUM_HOURLY_ON_DEMAND_SPEND_FIELD,
ESTIMATED_AVERAGE_UTILIZATION_FIELD, ESTIMATED_MONTHLY_SAVINGS_AMOUNT_FIELD, ESTIMATED_ON_DEMAND_COST_FIELD,
ESTIMATED_ON_DEMAND_COST_WITH_CURRENT_COMMITMENT_FIELD, ESTIMATED_ROI_FIELD, ESTIMATED_SP_COST_FIELD,
ESTIMATED_SAVINGS_AMOUNT_FIELD, ESTIMATED_SAVINGS_PERCENTAGE_FIELD, EXISTING_HOURLY_COMMITMENT_FIELD,
HOURLY_COMMITMENT_TO_PURCHASE_FIELD, UPFRONT_COST_FIELD, CURRENT_AVERAGE_COVERAGE_FIELD,
ESTIMATED_AVERAGE_COVERAGE_FIELD, METRICS_OVER_LOOKBACK_PERIOD_FIELD));
private static final long serialVersionUID = 1L;
private final String accountScope;
private final String lookbackPeriodInDays;
private final String savingsPlansType;
private final String termInYears;
private final String paymentOption;
private final String accountId;
private final String currencyCode;
private final String instanceFamily;
private final String region;
private final String offeringId;
private final String generationTimestamp;
private final String latestUsageTimestamp;
private final String currentAverageHourlyOnDemandSpend;
private final String currentMaximumHourlyOnDemandSpend;
private final String currentMinimumHourlyOnDemandSpend;
private final String estimatedAverageUtilization;
private final String estimatedMonthlySavingsAmount;
private final String estimatedOnDemandCost;
private final String estimatedOnDemandCostWithCurrentCommitment;
private final String estimatedROI;
private final String estimatedSPCost;
private final String estimatedSavingsAmount;
private final String estimatedSavingsPercentage;
private final String existingHourlyCommitment;
private final String hourlyCommitmentToPurchase;
private final String upfrontCost;
private final String currentAverageCoverage;
private final String estimatedAverageCoverage;
private final List metricsOverLookbackPeriod;
private RecommendationDetailData(BuilderImpl builder) {
this.accountScope = builder.accountScope;
this.lookbackPeriodInDays = builder.lookbackPeriodInDays;
this.savingsPlansType = builder.savingsPlansType;
this.termInYears = builder.termInYears;
this.paymentOption = builder.paymentOption;
this.accountId = builder.accountId;
this.currencyCode = builder.currencyCode;
this.instanceFamily = builder.instanceFamily;
this.region = builder.region;
this.offeringId = builder.offeringId;
this.generationTimestamp = builder.generationTimestamp;
this.latestUsageTimestamp = builder.latestUsageTimestamp;
this.currentAverageHourlyOnDemandSpend = builder.currentAverageHourlyOnDemandSpend;
this.currentMaximumHourlyOnDemandSpend = builder.currentMaximumHourlyOnDemandSpend;
this.currentMinimumHourlyOnDemandSpend = builder.currentMinimumHourlyOnDemandSpend;
this.estimatedAverageUtilization = builder.estimatedAverageUtilization;
this.estimatedMonthlySavingsAmount = builder.estimatedMonthlySavingsAmount;
this.estimatedOnDemandCost = builder.estimatedOnDemandCost;
this.estimatedOnDemandCostWithCurrentCommitment = builder.estimatedOnDemandCostWithCurrentCommitment;
this.estimatedROI = builder.estimatedROI;
this.estimatedSPCost = builder.estimatedSPCost;
this.estimatedSavingsAmount = builder.estimatedSavingsAmount;
this.estimatedSavingsPercentage = builder.estimatedSavingsPercentage;
this.existingHourlyCommitment = builder.existingHourlyCommitment;
this.hourlyCommitmentToPurchase = builder.hourlyCommitmentToPurchase;
this.upfrontCost = builder.upfrontCost;
this.currentAverageCoverage = builder.currentAverageCoverage;
this.estimatedAverageCoverage = builder.estimatedAverageCoverage;
this.metricsOverLookbackPeriod = builder.metricsOverLookbackPeriod;
}
/**
*
* The account scope that you want your recommendations for. Amazon Web Services calculates recommendations
* including the management account and member accounts if the value is set to PAYER. If the value is LINKED,
* recommendations are calculated for individual member accounts only.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #accountScope} will
* return {@link AccountScope#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #accountScopeAsString}.
*
*
* @return The account scope that you want your recommendations for. Amazon Web Services calculates recommendations
* including the management account and member accounts if the value is set to PAYER. If the value is
* LINKED, recommendations are calculated for individual member accounts only.
* @see AccountScope
*/
public final AccountScope accountScope() {
return AccountScope.fromValue(accountScope);
}
/**
*
* The account scope that you want your recommendations for. Amazon Web Services calculates recommendations
* including the management account and member accounts if the value is set to PAYER. If the value is LINKED,
* recommendations are calculated for individual member accounts only.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #accountScope} will
* return {@link AccountScope#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #accountScopeAsString}.
*
*
* @return The account scope that you want your recommendations for. Amazon Web Services calculates recommendations
* including the management account and member accounts if the value is set to PAYER. If the value is
* LINKED, recommendations are calculated for individual member accounts only.
* @see AccountScope
*/
public final String accountScopeAsString() {
return accountScope;
}
/**
*
* How many days of previous usage that Amazon Web Services considers when making this recommendation.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #lookbackPeriodInDays} will return {@link LookbackPeriodInDays#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #lookbackPeriodInDaysAsString}.
*
*
* @return How many days of previous usage that Amazon Web Services considers when making this recommendation.
* @see LookbackPeriodInDays
*/
public final LookbackPeriodInDays lookbackPeriodInDays() {
return LookbackPeriodInDays.fromValue(lookbackPeriodInDays);
}
/**
*
* How many days of previous usage that Amazon Web Services considers when making this recommendation.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #lookbackPeriodInDays} will return {@link LookbackPeriodInDays#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #lookbackPeriodInDaysAsString}.
*
*
* @return How many days of previous usage that Amazon Web Services considers when making this recommendation.
* @see LookbackPeriodInDays
*/
public final String lookbackPeriodInDaysAsString() {
return lookbackPeriodInDays;
}
/**
*
* The requested Savings Plan recommendation type.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #savingsPlansType}
* will return {@link SupportedSavingsPlansType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #savingsPlansTypeAsString}.
*
*
* @return The requested Savings Plan recommendation type.
* @see SupportedSavingsPlansType
*/
public final SupportedSavingsPlansType savingsPlansType() {
return SupportedSavingsPlansType.fromValue(savingsPlansType);
}
/**
*
* The requested Savings Plan recommendation type.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #savingsPlansType}
* will return {@link SupportedSavingsPlansType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #savingsPlansTypeAsString}.
*
*
* @return The requested Savings Plan recommendation type.
* @see SupportedSavingsPlansType
*/
public final String savingsPlansTypeAsString() {
return savingsPlansType;
}
/**
*
* The term of the commitment in years.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #termInYears} will
* return {@link TermInYears#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #termInYearsAsString}.
*
*
* @return The term of the commitment in years.
* @see TermInYears
*/
public final TermInYears termInYears() {
return TermInYears.fromValue(termInYears);
}
/**
*
* The term of the commitment in years.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #termInYears} will
* return {@link TermInYears#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #termInYearsAsString}.
*
*
* @return The term of the commitment in years.
* @see TermInYears
*/
public final String termInYearsAsString() {
return termInYears;
}
/**
*
* The payment option for the commitment (for example, All Upfront or No Upfront).
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #paymentOption}
* will return {@link PaymentOption#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #paymentOptionAsString}.
*
*
* @return The payment option for the commitment (for example, All Upfront or No Upfront).
* @see PaymentOption
*/
public final PaymentOption paymentOption() {
return PaymentOption.fromValue(paymentOption);
}
/**
*
* The payment option for the commitment (for example, All Upfront or No Upfront).
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #paymentOption}
* will return {@link PaymentOption#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #paymentOptionAsString}.
*
*
* @return The payment option for the commitment (for example, All Upfront or No Upfront).
* @see PaymentOption
*/
public final String paymentOptionAsString() {
return paymentOption;
}
/**
*
* The AccountID that the recommendation is generated for.
*
*
* @return The AccountID that the recommendation is generated for.
*/
public final String accountId() {
return accountId;
}
/**
*
* The currency code that Amazon Web Services used to generate the recommendation and present potential savings.
*
*
* @return The currency code that Amazon Web Services used to generate the recommendation and present potential
* savings.
*/
public final String currencyCode() {
return currencyCode;
}
/**
*
* The instance family of the recommended Savings Plan.
*
*
* @return The instance family of the recommended Savings Plan.
*/
public final String instanceFamily() {
return instanceFamily;
}
/**
*
* The region the recommendation is generated for.
*
*
* @return The region the recommendation is generated for.
*/
public final String region() {
return region;
}
/**
*
* The unique ID that's used to distinguish Savings Plans from one another.
*
*
* @return The unique ID that's used to distinguish Savings Plans from one another.
*/
public final String offeringId() {
return offeringId;
}
/**
* Returns the value of the GenerationTimestamp property for this object.
*
* @return The value of the GenerationTimestamp property for this object.
*/
public final String generationTimestamp() {
return generationTimestamp;
}
/**
* Returns the value of the LatestUsageTimestamp property for this object.
*
* @return The value of the LatestUsageTimestamp property for this object.
*/
public final String latestUsageTimestamp() {
return latestUsageTimestamp;
}
/**
*
* The average value of hourly On-Demand spend over the lookback period of the applicable usage type.
*
*
* @return The average value of hourly On-Demand spend over the lookback period of the applicable usage type.
*/
public final String currentAverageHourlyOnDemandSpend() {
return currentAverageHourlyOnDemandSpend;
}
/**
*
* The highest value of hourly On-Demand spend over the lookback period of the applicable usage type.
*
*
* @return The highest value of hourly On-Demand spend over the lookback period of the applicable usage type.
*/
public final String currentMaximumHourlyOnDemandSpend() {
return currentMaximumHourlyOnDemandSpend;
}
/**
*
* The lowest value of hourly On-Demand spend over the lookback period of the applicable usage type.
*
*
* @return The lowest value of hourly On-Demand spend over the lookback period of the applicable usage type.
*/
public final String currentMinimumHourlyOnDemandSpend() {
return currentMinimumHourlyOnDemandSpend;
}
/**
*
* The estimated utilization of the recommended Savings Plan.
*
*
* @return The estimated utilization of the recommended Savings Plan.
*/
public final String estimatedAverageUtilization() {
return estimatedAverageUtilization;
}
/**
*
* The estimated monthly savings amount based on the recommended Savings Plan.
*
*
* @return The estimated monthly savings amount based on the recommended Savings Plan.
*/
public final String estimatedMonthlySavingsAmount() {
return estimatedMonthlySavingsAmount;
}
/**
*
* The remaining On-Demand cost estimated to not be covered by the recommended Savings Plan, over the length of the
* lookback period.
*
*
* @return The remaining On-Demand cost estimated to not be covered by the recommended Savings Plan, over the length
* of the lookback period.
*/
public final String estimatedOnDemandCost() {
return estimatedOnDemandCost;
}
/**
*
* The estimated On-Demand costs you expect with no additional commitment, based on your usage of the selected time
* period and the Savings Plan you own.
*
*
* @return The estimated On-Demand costs you expect with no additional commitment, based on your usage of the
* selected time period and the Savings Plan you own.
*/
public final String estimatedOnDemandCostWithCurrentCommitment() {
return estimatedOnDemandCostWithCurrentCommitment;
}
/**
*
* The estimated return on investment that's based on the recommended Savings Plan that you purchased. This is
* calculated as estimatedSavingsAmount/estimatedSPCost*100.
*
*
* @return The estimated return on investment that's based on the recommended Savings Plan that you purchased. This
* is calculated as estimatedSavingsAmount/estimatedSPCost*100.
*/
public final String estimatedROI() {
return estimatedROI;
}
/**
*
* The cost of the recommended Savings Plan over the length of the lookback period.
*
*
* @return The cost of the recommended Savings Plan over the length of the lookback period.
*/
public final String estimatedSPCost() {
return estimatedSPCost;
}
/**
*
* The estimated savings amount that's based on the recommended Savings Plan over the length of the lookback period.
*
*
* @return The estimated savings amount that's based on the recommended Savings Plan over the length of the lookback
* period.
*/
public final String estimatedSavingsAmount() {
return estimatedSavingsAmount;
}
/**
*
* The estimated savings percentage relative to the total cost of applicable On-Demand usage over the lookback
* period.
*
*
* @return The estimated savings percentage relative to the total cost of applicable On-Demand usage over the
* lookback period.
*/
public final String estimatedSavingsPercentage() {
return estimatedSavingsPercentage;
}
/**
*
* The existing hourly commitment for the Savings Plan type.
*
*
* @return The existing hourly commitment for the Savings Plan type.
*/
public final String existingHourlyCommitment() {
return existingHourlyCommitment;
}
/**
*
* The recommended hourly commitment level for the Savings Plan type and the configuration that's based on the usage
* during the lookback period.
*
*
* @return The recommended hourly commitment level for the Savings Plan type and the configuration that's based on
* the usage during the lookback period.
*/
public final String hourlyCommitmentToPurchase() {
return hourlyCommitmentToPurchase;
}
/**
*
* The upfront cost of the recommended Savings Plan, based on the selected payment option.
*
*
* @return The upfront cost of the recommended Savings Plan, based on the selected payment option.
*/
public final String upfrontCost() {
return upfrontCost;
}
/**
*
* The average value of hourly coverage over the lookback period.
*
*
* @return The average value of hourly coverage over the lookback period.
*/
public final String currentAverageCoverage() {
return currentAverageCoverage;
}
/**
*
* The estimated coverage of the recommended Savings Plan.
*
*
* @return The estimated coverage of the recommended Savings Plan.
*/
public final String estimatedAverageCoverage() {
return estimatedAverageCoverage;
}
/**
* For responses, this returns true if the service returned a value for the MetricsOverLookbackPeriod property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasMetricsOverLookbackPeriod() {
return metricsOverLookbackPeriod != null && !(metricsOverLookbackPeriod instanceof SdkAutoConstructList);
}
/**
*
* The related hourly cost, coverage, and utilization metrics over the lookback period.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMetricsOverLookbackPeriod} method.
*
*
* @return The related hourly cost, coverage, and utilization metrics over the lookback period.
*/
public final List metricsOverLookbackPeriod() {
return metricsOverLookbackPeriod;
}
@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(accountScopeAsString());
hashCode = 31 * hashCode + Objects.hashCode(lookbackPeriodInDaysAsString());
hashCode = 31 * hashCode + Objects.hashCode(savingsPlansTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(termInYearsAsString());
hashCode = 31 * hashCode + Objects.hashCode(paymentOptionAsString());
hashCode = 31 * hashCode + Objects.hashCode(accountId());
hashCode = 31 * hashCode + Objects.hashCode(currencyCode());
hashCode = 31 * hashCode + Objects.hashCode(instanceFamily());
hashCode = 31 * hashCode + Objects.hashCode(region());
hashCode = 31 * hashCode + Objects.hashCode(offeringId());
hashCode = 31 * hashCode + Objects.hashCode(generationTimestamp());
hashCode = 31 * hashCode + Objects.hashCode(latestUsageTimestamp());
hashCode = 31 * hashCode + Objects.hashCode(currentAverageHourlyOnDemandSpend());
hashCode = 31 * hashCode + Objects.hashCode(currentMaximumHourlyOnDemandSpend());
hashCode = 31 * hashCode + Objects.hashCode(currentMinimumHourlyOnDemandSpend());
hashCode = 31 * hashCode + Objects.hashCode(estimatedAverageUtilization());
hashCode = 31 * hashCode + Objects.hashCode(estimatedMonthlySavingsAmount());
hashCode = 31 * hashCode + Objects.hashCode(estimatedOnDemandCost());
hashCode = 31 * hashCode + Objects.hashCode(estimatedOnDemandCostWithCurrentCommitment());
hashCode = 31 * hashCode + Objects.hashCode(estimatedROI());
hashCode = 31 * hashCode + Objects.hashCode(estimatedSPCost());
hashCode = 31 * hashCode + Objects.hashCode(estimatedSavingsAmount());
hashCode = 31 * hashCode + Objects.hashCode(estimatedSavingsPercentage());
hashCode = 31 * hashCode + Objects.hashCode(existingHourlyCommitment());
hashCode = 31 * hashCode + Objects.hashCode(hourlyCommitmentToPurchase());
hashCode = 31 * hashCode + Objects.hashCode(upfrontCost());
hashCode = 31 * hashCode + Objects.hashCode(currentAverageCoverage());
hashCode = 31 * hashCode + Objects.hashCode(estimatedAverageCoverage());
hashCode = 31 * hashCode + Objects.hashCode(hasMetricsOverLookbackPeriod() ? metricsOverLookbackPeriod() : null);
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 RecommendationDetailData)) {
return false;
}
RecommendationDetailData other = (RecommendationDetailData) obj;
return Objects.equals(accountScopeAsString(), other.accountScopeAsString())
&& Objects.equals(lookbackPeriodInDaysAsString(), other.lookbackPeriodInDaysAsString())
&& Objects.equals(savingsPlansTypeAsString(), other.savingsPlansTypeAsString())
&& Objects.equals(termInYearsAsString(), other.termInYearsAsString())
&& Objects.equals(paymentOptionAsString(), other.paymentOptionAsString())
&& Objects.equals(accountId(), other.accountId())
&& Objects.equals(currencyCode(), other.currencyCode())
&& Objects.equals(instanceFamily(), other.instanceFamily())
&& Objects.equals(region(), other.region())
&& Objects.equals(offeringId(), other.offeringId())
&& Objects.equals(generationTimestamp(), other.generationTimestamp())
&& Objects.equals(latestUsageTimestamp(), other.latestUsageTimestamp())
&& Objects.equals(currentAverageHourlyOnDemandSpend(), other.currentAverageHourlyOnDemandSpend())
&& Objects.equals(currentMaximumHourlyOnDemandSpend(), other.currentMaximumHourlyOnDemandSpend())
&& Objects.equals(currentMinimumHourlyOnDemandSpend(), other.currentMinimumHourlyOnDemandSpend())
&& Objects.equals(estimatedAverageUtilization(), other.estimatedAverageUtilization())
&& Objects.equals(estimatedMonthlySavingsAmount(), other.estimatedMonthlySavingsAmount())
&& Objects.equals(estimatedOnDemandCost(), other.estimatedOnDemandCost())
&& Objects.equals(estimatedOnDemandCostWithCurrentCommitment(),
other.estimatedOnDemandCostWithCurrentCommitment())
&& Objects.equals(estimatedROI(), other.estimatedROI())
&& Objects.equals(estimatedSPCost(), other.estimatedSPCost())
&& Objects.equals(estimatedSavingsAmount(), other.estimatedSavingsAmount())
&& Objects.equals(estimatedSavingsPercentage(), other.estimatedSavingsPercentage())
&& Objects.equals(existingHourlyCommitment(), other.existingHourlyCommitment())
&& Objects.equals(hourlyCommitmentToPurchase(), other.hourlyCommitmentToPurchase())
&& Objects.equals(upfrontCost(), other.upfrontCost())
&& Objects.equals(currentAverageCoverage(), other.currentAverageCoverage())
&& Objects.equals(estimatedAverageCoverage(), other.estimatedAverageCoverage())
&& hasMetricsOverLookbackPeriod() == other.hasMetricsOverLookbackPeriod()
&& Objects.equals(metricsOverLookbackPeriod(), other.metricsOverLookbackPeriod());
}
/**
* 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("RecommendationDetailData").add("AccountScope", accountScopeAsString())
.add("LookbackPeriodInDays", lookbackPeriodInDaysAsString()).add("SavingsPlansType", savingsPlansTypeAsString())
.add("TermInYears", termInYearsAsString()).add("PaymentOption", paymentOptionAsString())
.add("AccountId", accountId()).add("CurrencyCode", currencyCode()).add("InstanceFamily", instanceFamily())
.add("Region", region()).add("OfferingId", offeringId()).add("GenerationTimestamp", generationTimestamp())
.add("LatestUsageTimestamp", latestUsageTimestamp())
.add("CurrentAverageHourlyOnDemandSpend", currentAverageHourlyOnDemandSpend())
.add("CurrentMaximumHourlyOnDemandSpend", currentMaximumHourlyOnDemandSpend())
.add("CurrentMinimumHourlyOnDemandSpend", currentMinimumHourlyOnDemandSpend())
.add("EstimatedAverageUtilization", estimatedAverageUtilization())
.add("EstimatedMonthlySavingsAmount", estimatedMonthlySavingsAmount())
.add("EstimatedOnDemandCost", estimatedOnDemandCost())
.add("EstimatedOnDemandCostWithCurrentCommitment", estimatedOnDemandCostWithCurrentCommitment())
.add("EstimatedROI", estimatedROI()).add("EstimatedSPCost", estimatedSPCost())
.add("EstimatedSavingsAmount", estimatedSavingsAmount())
.add("EstimatedSavingsPercentage", estimatedSavingsPercentage())
.add("ExistingHourlyCommitment", existingHourlyCommitment())
.add("HourlyCommitmentToPurchase", hourlyCommitmentToPurchase()).add("UpfrontCost", upfrontCost())
.add("CurrentAverageCoverage", currentAverageCoverage())
.add("EstimatedAverageCoverage", estimatedAverageCoverage())
.add("MetricsOverLookbackPeriod", hasMetricsOverLookbackPeriod() ? metricsOverLookbackPeriod() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "AccountScope":
return Optional.ofNullable(clazz.cast(accountScopeAsString()));
case "LookbackPeriodInDays":
return Optional.ofNullable(clazz.cast(lookbackPeriodInDaysAsString()));
case "SavingsPlansType":
return Optional.ofNullable(clazz.cast(savingsPlansTypeAsString()));
case "TermInYears":
return Optional.ofNullable(clazz.cast(termInYearsAsString()));
case "PaymentOption":
return Optional.ofNullable(clazz.cast(paymentOptionAsString()));
case "AccountId":
return Optional.ofNullable(clazz.cast(accountId()));
case "CurrencyCode":
return Optional.ofNullable(clazz.cast(currencyCode()));
case "InstanceFamily":
return Optional.ofNullable(clazz.cast(instanceFamily()));
case "Region":
return Optional.ofNullable(clazz.cast(region()));
case "OfferingId":
return Optional.ofNullable(clazz.cast(offeringId()));
case "GenerationTimestamp":
return Optional.ofNullable(clazz.cast(generationTimestamp()));
case "LatestUsageTimestamp":
return Optional.ofNullable(clazz.cast(latestUsageTimestamp()));
case "CurrentAverageHourlyOnDemandSpend":
return Optional.ofNullable(clazz.cast(currentAverageHourlyOnDemandSpend()));
case "CurrentMaximumHourlyOnDemandSpend":
return Optional.ofNullable(clazz.cast(currentMaximumHourlyOnDemandSpend()));
case "CurrentMinimumHourlyOnDemandSpend":
return Optional.ofNullable(clazz.cast(currentMinimumHourlyOnDemandSpend()));
case "EstimatedAverageUtilization":
return Optional.ofNullable(clazz.cast(estimatedAverageUtilization()));
case "EstimatedMonthlySavingsAmount":
return Optional.ofNullable(clazz.cast(estimatedMonthlySavingsAmount()));
case "EstimatedOnDemandCost":
return Optional.ofNullable(clazz.cast(estimatedOnDemandCost()));
case "EstimatedOnDemandCostWithCurrentCommitment":
return Optional.ofNullable(clazz.cast(estimatedOnDemandCostWithCurrentCommitment()));
case "EstimatedROI":
return Optional.ofNullable(clazz.cast(estimatedROI()));
case "EstimatedSPCost":
return Optional.ofNullable(clazz.cast(estimatedSPCost()));
case "EstimatedSavingsAmount":
return Optional.ofNullable(clazz.cast(estimatedSavingsAmount()));
case "EstimatedSavingsPercentage":
return Optional.ofNullable(clazz.cast(estimatedSavingsPercentage()));
case "ExistingHourlyCommitment":
return Optional.ofNullable(clazz.cast(existingHourlyCommitment()));
case "HourlyCommitmentToPurchase":
return Optional.ofNullable(clazz.cast(hourlyCommitmentToPurchase()));
case "UpfrontCost":
return Optional.ofNullable(clazz.cast(upfrontCost()));
case "CurrentAverageCoverage":
return Optional.ofNullable(clazz.cast(currentAverageCoverage()));
case "EstimatedAverageCoverage":
return Optional.ofNullable(clazz.cast(estimatedAverageCoverage()));
case "MetricsOverLookbackPeriod":
return Optional.ofNullable(clazz.cast(metricsOverLookbackPeriod()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function