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

software.amazon.awssdk.services.costexplorer.model.SavingsPlansPurchaseRecommendation 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.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;

/**
 * 

* Contains your request parameters, Savings Plan Recommendations Summary, and Details. *

*/ @Generated("software.amazon.awssdk:codegen") public final class SavingsPlansPurchaseRecommendation implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ACCOUNT_SCOPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("AccountScope").getter(getter(SavingsPlansPurchaseRecommendation::accountScopeAsString)) .setter(setter(Builder::accountScope)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AccountScope").build()).build(); private static final SdkField SAVINGS_PLANS_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("SavingsPlansType").getter(getter(SavingsPlansPurchaseRecommendation::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(SavingsPlansPurchaseRecommendation::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(SavingsPlansPurchaseRecommendation::paymentOptionAsString)) .setter(setter(Builder::paymentOption)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PaymentOption").build()).build(); private static final SdkField LOOKBACK_PERIOD_IN_DAYS_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("LookbackPeriodInDays").getter(getter(SavingsPlansPurchaseRecommendation::lookbackPeriodInDaysAsString)) .setter(setter(Builder::lookbackPeriodInDays)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LookbackPeriodInDays").build()) .build(); private static final SdkField> SAVINGS_PLANS_PURCHASE_RECOMMENDATION_DETAILS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("SavingsPlansPurchaseRecommendationDetails") .getter(getter(SavingsPlansPurchaseRecommendation::savingsPlansPurchaseRecommendationDetails)) .setter(setter(Builder::savingsPlansPurchaseRecommendationDetails)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("SavingsPlansPurchaseRecommendationDetails").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(SavingsPlansPurchaseRecommendationDetail::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField SAVINGS_PLANS_PURCHASE_RECOMMENDATION_SUMMARY_FIELD = SdkField . builder(MarshallingType.SDK_POJO) .memberName("SavingsPlansPurchaseRecommendationSummary") .getter(getter(SavingsPlansPurchaseRecommendation::savingsPlansPurchaseRecommendationSummary)) .setter(setter(Builder::savingsPlansPurchaseRecommendationSummary)) .constructor(SavingsPlansPurchaseRecommendationSummary::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("SavingsPlansPurchaseRecommendationSummary").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ACCOUNT_SCOPE_FIELD, SAVINGS_PLANS_TYPE_FIELD, TERM_IN_YEARS_FIELD, PAYMENT_OPTION_FIELD, LOOKBACK_PERIOD_IN_DAYS_FIELD, SAVINGS_PLANS_PURCHASE_RECOMMENDATION_DETAILS_FIELD, SAVINGS_PLANS_PURCHASE_RECOMMENDATION_SUMMARY_FIELD)); private static final long serialVersionUID = 1L; private final String accountScope; private final String savingsPlansType; private final String termInYears; private final String paymentOption; private final String lookbackPeriodInDays; private final List savingsPlansPurchaseRecommendationDetails; private final SavingsPlansPurchaseRecommendationSummary savingsPlansPurchaseRecommendationSummary; private SavingsPlansPurchaseRecommendation(BuilderImpl builder) { this.accountScope = builder.accountScope; this.savingsPlansType = builder.savingsPlansType; this.termInYears = builder.termInYears; this.paymentOption = builder.paymentOption; this.lookbackPeriodInDays = builder.lookbackPeriodInDays; this.savingsPlansPurchaseRecommendationDetails = builder.savingsPlansPurchaseRecommendationDetails; this.savingsPlansPurchaseRecommendationSummary = builder.savingsPlansPurchaseRecommendationSummary; } /** *

* The account scope that you want your recommendations for. Amazon Web Services calculates recommendations that * include 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 * that include 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 that * include 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 * that include 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; } /** *

* The requested Savings Plans 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 Plans recommendation type. * @see SupportedSavingsPlansType */ public final SupportedSavingsPlansType savingsPlansType() { return SupportedSavingsPlansType.fromValue(savingsPlansType); } /** *

* The requested Savings Plans 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 Plans recommendation type. * @see SupportedSavingsPlansType */ public final String savingsPlansTypeAsString() { return savingsPlansType; } /** *

* The Savings Plans recommendation term in years. It's used to generate the recommendation. *

*

* 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 Savings Plans recommendation term in years. It's used to generate the recommendation. * @see TermInYears */ public final TermInYears termInYears() { return TermInYears.fromValue(termInYears); } /** *

* The Savings Plans recommendation term in years. It's used to generate the recommendation. *

*

* 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 Savings Plans recommendation term in years. It's used to generate the recommendation. * @see TermInYears */ public final String termInYearsAsString() { return termInYears; } /** *

* The payment option that's used to generate the recommendation. *

*

* 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 that's used to generate the recommendation. * @see PaymentOption */ public final PaymentOption paymentOption() { return PaymentOption.fromValue(paymentOption); } /** *

* The payment option that's used to generate the recommendation. *

*

* 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 that's used to generate the recommendation. * @see PaymentOption */ public final String paymentOptionAsString() { return paymentOption; } /** *

* The lookback period in days that's used to generate the 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 The lookback period in days that's used to generate the recommendation. * @see LookbackPeriodInDays */ public final LookbackPeriodInDays lookbackPeriodInDays() { return LookbackPeriodInDays.fromValue(lookbackPeriodInDays); } /** *

* The lookback period in days that's used to generate the 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 The lookback period in days that's used to generate the recommendation. * @see LookbackPeriodInDays */ public final String lookbackPeriodInDaysAsString() { return lookbackPeriodInDays; } /** * For responses, this returns true if the service returned a value for the * SavingsPlansPurchaseRecommendationDetails 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 hasSavingsPlansPurchaseRecommendationDetails() { return savingsPlansPurchaseRecommendationDetails != null && !(savingsPlansPurchaseRecommendationDetails instanceof SdkAutoConstructList); } /** *

* Details for the Savings Plans that we recommend that you purchase to cover existing Savings Plans eligible * workloads. *

*

* 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 #hasSavingsPlansPurchaseRecommendationDetails} method. *

* * @return Details for the Savings Plans that we recommend that you purchase to cover existing Savings Plans * eligible workloads. */ public final List savingsPlansPurchaseRecommendationDetails() { return savingsPlansPurchaseRecommendationDetails; } /** *

* Summary metrics for your Savings Plans Recommendations. *

* * @return Summary metrics for your Savings Plans Recommendations. */ public final SavingsPlansPurchaseRecommendationSummary savingsPlansPurchaseRecommendationSummary() { return savingsPlansPurchaseRecommendationSummary; } @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(accountScopeAsString()); hashCode = 31 * hashCode + Objects.hashCode(savingsPlansTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(termInYearsAsString()); hashCode = 31 * hashCode + Objects.hashCode(paymentOptionAsString()); hashCode = 31 * hashCode + Objects.hashCode(lookbackPeriodInDaysAsString()); hashCode = 31 * hashCode + Objects.hashCode(hasSavingsPlansPurchaseRecommendationDetails() ? savingsPlansPurchaseRecommendationDetails() : null); hashCode = 31 * hashCode + Objects.hashCode(savingsPlansPurchaseRecommendationSummary()); 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 SavingsPlansPurchaseRecommendation)) { return false; } SavingsPlansPurchaseRecommendation other = (SavingsPlansPurchaseRecommendation) obj; return Objects.equals(accountScopeAsString(), other.accountScopeAsString()) && Objects.equals(savingsPlansTypeAsString(), other.savingsPlansTypeAsString()) && Objects.equals(termInYearsAsString(), other.termInYearsAsString()) && Objects.equals(paymentOptionAsString(), other.paymentOptionAsString()) && Objects.equals(lookbackPeriodInDaysAsString(), other.lookbackPeriodInDaysAsString()) && hasSavingsPlansPurchaseRecommendationDetails() == other.hasSavingsPlansPurchaseRecommendationDetails() && Objects.equals(savingsPlansPurchaseRecommendationDetails(), other.savingsPlansPurchaseRecommendationDetails()) && Objects.equals(savingsPlansPurchaseRecommendationSummary(), other.savingsPlansPurchaseRecommendationSummary()); } /** * 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("SavingsPlansPurchaseRecommendation") .add("AccountScope", accountScopeAsString()) .add("SavingsPlansType", savingsPlansTypeAsString()) .add("TermInYears", termInYearsAsString()) .add("PaymentOption", paymentOptionAsString()) .add("LookbackPeriodInDays", lookbackPeriodInDaysAsString()) .add("SavingsPlansPurchaseRecommendationDetails", hasSavingsPlansPurchaseRecommendationDetails() ? savingsPlansPurchaseRecommendationDetails() : null) .add("SavingsPlansPurchaseRecommendationSummary", savingsPlansPurchaseRecommendationSummary()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "AccountScope": return Optional.ofNullable(clazz.cast(accountScopeAsString())); 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 "LookbackPeriodInDays": return Optional.ofNullable(clazz.cast(lookbackPeriodInDaysAsString())); case "SavingsPlansPurchaseRecommendationDetails": return Optional.ofNullable(clazz.cast(savingsPlansPurchaseRecommendationDetails())); case "SavingsPlansPurchaseRecommendationSummary": return Optional.ofNullable(clazz.cast(savingsPlansPurchaseRecommendationSummary())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((SavingsPlansPurchaseRecommendation) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The account scope that you want your recommendations for. Amazon Web Services calculates recommendations that * include 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. *

* * @param accountScope * The account scope that you want your recommendations for. Amazon Web Services calculates * recommendations that include 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 * @return Returns a reference to this object so that method calls can be chained together. * @see AccountScope */ Builder accountScope(String accountScope); /** *

* The account scope that you want your recommendations for. Amazon Web Services calculates recommendations that * include 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. *

* * @param accountScope * The account scope that you want your recommendations for. Amazon Web Services calculates * recommendations that include 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 * @return Returns a reference to this object so that method calls can be chained together. * @see AccountScope */ Builder accountScope(AccountScope accountScope); /** *

* The requested Savings Plans recommendation type. *

* * @param savingsPlansType * The requested Savings Plans recommendation type. * @see SupportedSavingsPlansType * @return Returns a reference to this object so that method calls can be chained together. * @see SupportedSavingsPlansType */ Builder savingsPlansType(String savingsPlansType); /** *

* The requested Savings Plans recommendation type. *

* * @param savingsPlansType * The requested Savings Plans recommendation type. * @see SupportedSavingsPlansType * @return Returns a reference to this object so that method calls can be chained together. * @see SupportedSavingsPlansType */ Builder savingsPlansType(SupportedSavingsPlansType savingsPlansType); /** *

* The Savings Plans recommendation term in years. It's used to generate the recommendation. *

* * @param termInYears * The Savings Plans recommendation term in years. It's used to generate the recommendation. * @see TermInYears * @return Returns a reference to this object so that method calls can be chained together. * @see TermInYears */ Builder termInYears(String termInYears); /** *

* The Savings Plans recommendation term in years. It's used to generate the recommendation. *

* * @param termInYears * The Savings Plans recommendation term in years. It's used to generate the recommendation. * @see TermInYears * @return Returns a reference to this object so that method calls can be chained together. * @see TermInYears */ Builder termInYears(TermInYears termInYears); /** *

* The payment option that's used to generate the recommendation. *

* * @param paymentOption * The payment option that's used to generate the recommendation. * @see PaymentOption * @return Returns a reference to this object so that method calls can be chained together. * @see PaymentOption */ Builder paymentOption(String paymentOption); /** *

* The payment option that's used to generate the recommendation. *

* * @param paymentOption * The payment option that's used to generate the recommendation. * @see PaymentOption * @return Returns a reference to this object so that method calls can be chained together. * @see PaymentOption */ Builder paymentOption(PaymentOption paymentOption); /** *

* The lookback period in days that's used to generate the recommendation. *

* * @param lookbackPeriodInDays * The lookback period in days that's used to generate the recommendation. * @see LookbackPeriodInDays * @return Returns a reference to this object so that method calls can be chained together. * @see LookbackPeriodInDays */ Builder lookbackPeriodInDays(String lookbackPeriodInDays); /** *

* The lookback period in days that's used to generate the recommendation. *

* * @param lookbackPeriodInDays * The lookback period in days that's used to generate the recommendation. * @see LookbackPeriodInDays * @return Returns a reference to this object so that method calls can be chained together. * @see LookbackPeriodInDays */ Builder lookbackPeriodInDays(LookbackPeriodInDays lookbackPeriodInDays); /** *

* Details for the Savings Plans that we recommend that you purchase to cover existing Savings Plans eligible * workloads. *

* * @param savingsPlansPurchaseRecommendationDetails * Details for the Savings Plans that we recommend that you purchase to cover existing Savings Plans * eligible workloads. * @return Returns a reference to this object so that method calls can be chained together. */ Builder savingsPlansPurchaseRecommendationDetails( Collection savingsPlansPurchaseRecommendationDetails); /** *

* Details for the Savings Plans that we recommend that you purchase to cover existing Savings Plans eligible * workloads. *

* * @param savingsPlansPurchaseRecommendationDetails * Details for the Savings Plans that we recommend that you purchase to cover existing Savings Plans * eligible workloads. * @return Returns a reference to this object so that method calls can be chained together. */ Builder savingsPlansPurchaseRecommendationDetails( SavingsPlansPurchaseRecommendationDetail... savingsPlansPurchaseRecommendationDetails); /** *

* Details for the Savings Plans that we recommend that you purchase to cover existing Savings Plans eligible * workloads. *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.costexplorer.model.SavingsPlansPurchaseRecommendationDetail.Builder} * avoiding the need to create one manually via * {@link software.amazon.awssdk.services.costexplorer.model.SavingsPlansPurchaseRecommendationDetail#builder()} * . * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.costexplorer.model.SavingsPlansPurchaseRecommendationDetail.Builder#build()} * is called immediately and its result is passed to {@link * #savingsPlansPurchaseRecommendationDetails(List)}. * * @param savingsPlansPurchaseRecommendationDetails * a consumer that will call methods on * {@link software.amazon.awssdk.services.costexplorer.model.SavingsPlansPurchaseRecommendationDetail.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see * #savingsPlansPurchaseRecommendationDetails(java.util.Collection * ) */ Builder savingsPlansPurchaseRecommendationDetails( Consumer... savingsPlansPurchaseRecommendationDetails); /** *

* Summary metrics for your Savings Plans Recommendations. *

* * @param savingsPlansPurchaseRecommendationSummary * Summary metrics for your Savings Plans Recommendations. * @return Returns a reference to this object so that method calls can be chained together. */ Builder savingsPlansPurchaseRecommendationSummary( SavingsPlansPurchaseRecommendationSummary savingsPlansPurchaseRecommendationSummary); /** *

* Summary metrics for your Savings Plans Recommendations. *

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

* When the {@link Consumer} completes, {@link SavingsPlansPurchaseRecommendationSummary.Builder#build()} is * called immediately and its result is passed to * {@link #savingsPlansPurchaseRecommendationSummary(SavingsPlansPurchaseRecommendationSummary)}. * * @param savingsPlansPurchaseRecommendationSummary * a consumer that will call methods on {@link SavingsPlansPurchaseRecommendationSummary.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #savingsPlansPurchaseRecommendationSummary(SavingsPlansPurchaseRecommendationSummary) */ default Builder savingsPlansPurchaseRecommendationSummary( Consumer savingsPlansPurchaseRecommendationSummary) { return savingsPlansPurchaseRecommendationSummary(SavingsPlansPurchaseRecommendationSummary.builder() .applyMutation(savingsPlansPurchaseRecommendationSummary).build()); } } static final class BuilderImpl implements Builder { private String accountScope; private String savingsPlansType; private String termInYears; private String paymentOption; private String lookbackPeriodInDays; private List savingsPlansPurchaseRecommendationDetails = DefaultSdkAutoConstructList .getInstance(); private SavingsPlansPurchaseRecommendationSummary savingsPlansPurchaseRecommendationSummary; private BuilderImpl() { } private BuilderImpl(SavingsPlansPurchaseRecommendation model) { accountScope(model.accountScope); savingsPlansType(model.savingsPlansType); termInYears(model.termInYears); paymentOption(model.paymentOption); lookbackPeriodInDays(model.lookbackPeriodInDays); savingsPlansPurchaseRecommendationDetails(model.savingsPlansPurchaseRecommendationDetails); savingsPlansPurchaseRecommendationSummary(model.savingsPlansPurchaseRecommendationSummary); } public final String getAccountScope() { return accountScope; } public final void setAccountScope(String accountScope) { this.accountScope = accountScope; } @Override public final Builder accountScope(String accountScope) { this.accountScope = accountScope; return this; } @Override public final Builder accountScope(AccountScope accountScope) { this.accountScope(accountScope == null ? null : accountScope.toString()); return this; } public final String getSavingsPlansType() { return savingsPlansType; } public final void setSavingsPlansType(String savingsPlansType) { this.savingsPlansType = savingsPlansType; } @Override public final Builder savingsPlansType(String savingsPlansType) { this.savingsPlansType = savingsPlansType; return this; } @Override public final Builder savingsPlansType(SupportedSavingsPlansType savingsPlansType) { this.savingsPlansType(savingsPlansType == null ? null : savingsPlansType.toString()); return this; } public final String getTermInYears() { return termInYears; } public final void setTermInYears(String termInYears) { this.termInYears = termInYears; } @Override public final Builder termInYears(String termInYears) { this.termInYears = termInYears; return this; } @Override public final Builder termInYears(TermInYears termInYears) { this.termInYears(termInYears == null ? null : termInYears.toString()); return this; } public final String getPaymentOption() { return paymentOption; } public final void setPaymentOption(String paymentOption) { this.paymentOption = paymentOption; } @Override public final Builder paymentOption(String paymentOption) { this.paymentOption = paymentOption; return this; } @Override public final Builder paymentOption(PaymentOption paymentOption) { this.paymentOption(paymentOption == null ? null : paymentOption.toString()); return this; } public final String getLookbackPeriodInDays() { return lookbackPeriodInDays; } public final void setLookbackPeriodInDays(String lookbackPeriodInDays) { this.lookbackPeriodInDays = lookbackPeriodInDays; } @Override public final Builder lookbackPeriodInDays(String lookbackPeriodInDays) { this.lookbackPeriodInDays = lookbackPeriodInDays; return this; } @Override public final Builder lookbackPeriodInDays(LookbackPeriodInDays lookbackPeriodInDays) { this.lookbackPeriodInDays(lookbackPeriodInDays == null ? null : lookbackPeriodInDays.toString()); return this; } public final List getSavingsPlansPurchaseRecommendationDetails() { List result = SavingsPlansPurchaseRecommendationDetailListCopier .copyToBuilder(this.savingsPlansPurchaseRecommendationDetails); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setSavingsPlansPurchaseRecommendationDetails( Collection savingsPlansPurchaseRecommendationDetails) { this.savingsPlansPurchaseRecommendationDetails = SavingsPlansPurchaseRecommendationDetailListCopier .copyFromBuilder(savingsPlansPurchaseRecommendationDetails); } @Override public final Builder savingsPlansPurchaseRecommendationDetails( Collection savingsPlansPurchaseRecommendationDetails) { this.savingsPlansPurchaseRecommendationDetails = SavingsPlansPurchaseRecommendationDetailListCopier .copy(savingsPlansPurchaseRecommendationDetails); return this; } @Override @SafeVarargs public final Builder savingsPlansPurchaseRecommendationDetails( SavingsPlansPurchaseRecommendationDetail... savingsPlansPurchaseRecommendationDetails) { savingsPlansPurchaseRecommendationDetails(Arrays.asList(savingsPlansPurchaseRecommendationDetails)); return this; } @Override @SafeVarargs public final Builder savingsPlansPurchaseRecommendationDetails( Consumer... savingsPlansPurchaseRecommendationDetails) { savingsPlansPurchaseRecommendationDetails(Stream.of(savingsPlansPurchaseRecommendationDetails) .map(c -> SavingsPlansPurchaseRecommendationDetail.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final SavingsPlansPurchaseRecommendationSummary.Builder getSavingsPlansPurchaseRecommendationSummary() { return savingsPlansPurchaseRecommendationSummary != null ? savingsPlansPurchaseRecommendationSummary.toBuilder() : null; } public final void setSavingsPlansPurchaseRecommendationSummary( SavingsPlansPurchaseRecommendationSummary.BuilderImpl savingsPlansPurchaseRecommendationSummary) { this.savingsPlansPurchaseRecommendationSummary = savingsPlansPurchaseRecommendationSummary != null ? savingsPlansPurchaseRecommendationSummary .build() : null; } @Override public final Builder savingsPlansPurchaseRecommendationSummary( SavingsPlansPurchaseRecommendationSummary savingsPlansPurchaseRecommendationSummary) { this.savingsPlansPurchaseRecommendationSummary = savingsPlansPurchaseRecommendationSummary; return this; } @Override public SavingsPlansPurchaseRecommendation build() { return new SavingsPlansPurchaseRecommendation(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy