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

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

/**
 * 

* A specific reservation that Amazon Web Services recommends for purchase. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ReservationPurchaseRecommendation implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ACCOUNT_SCOPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("AccountScope").getter(getter(ReservationPurchaseRecommendation::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(ReservationPurchaseRecommendation::lookbackPeriodInDaysAsString)) .setter(setter(Builder::lookbackPeriodInDays)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LookbackPeriodInDays").build()) .build(); private static final SdkField TERM_IN_YEARS_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("TermInYears").getter(getter(ReservationPurchaseRecommendation::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(ReservationPurchaseRecommendation::paymentOptionAsString)) .setter(setter(Builder::paymentOption)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PaymentOption").build()).build(); private static final SdkField SERVICE_SPECIFICATION_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("ServiceSpecification") .getter(getter(ReservationPurchaseRecommendation::serviceSpecification)) .setter(setter(Builder::serviceSpecification)).constructor(ServiceSpecification::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ServiceSpecification").build()) .build(); private static final SdkField> RECOMMENDATION_DETAILS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("RecommendationDetails") .getter(getter(ReservationPurchaseRecommendation::recommendationDetails)) .setter(setter(Builder::recommendationDetails)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RecommendationDetails").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(ReservationPurchaseRecommendationDetail::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField RECOMMENDATION_SUMMARY_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("RecommendationSummary") .getter(getter(ReservationPurchaseRecommendation::recommendationSummary)) .setter(setter(Builder::recommendationSummary)).constructor(ReservationPurchaseRecommendationSummary::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RecommendationSummary").build()) .build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ACCOUNT_SCOPE_FIELD, LOOKBACK_PERIOD_IN_DAYS_FIELD, TERM_IN_YEARS_FIELD, PAYMENT_OPTION_FIELD, SERVICE_SPECIFICATION_FIELD, RECOMMENDATION_DETAILS_FIELD, RECOMMENDATION_SUMMARY_FIELD)); private static final long serialVersionUID = 1L; private final String accountScope; private final String lookbackPeriodInDays; private final String termInYears; private final String paymentOption; private final ServiceSpecification serviceSpecification; private final List recommendationDetails; private final ReservationPurchaseRecommendationSummary recommendationSummary; private ReservationPurchaseRecommendation(BuilderImpl builder) { this.accountScope = builder.accountScope; this.lookbackPeriodInDays = builder.lookbackPeriodInDays; this.termInYears = builder.termInYears; this.paymentOption = builder.paymentOption; this.serviceSpecification = builder.serviceSpecification; this.recommendationDetails = builder.recommendationDetails; this.recommendationSummary = builder.recommendationSummary; } /** *

* The account scope that Amazon Web Services recommends that you purchase this instance for. For example, you can * purchase this reservation for an entire organization in Amazon Web Services Organizations. *

*

* 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 Amazon Web Services recommends that you purchase this instance for. For example, * you can purchase this reservation for an entire organization in Amazon Web Services Organizations. * @see AccountScope */ public final AccountScope accountScope() { return AccountScope.fromValue(accountScope); } /** *

* The account scope that Amazon Web Services recommends that you purchase this instance for. For example, you can * purchase this reservation for an entire organization in Amazon Web Services Organizations. *

*

* 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 Amazon Web Services recommends that you purchase this instance for. For example, * you can purchase this reservation for an entire organization in Amazon Web Services Organizations. * @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 term of the reservation that you want recommendations for, 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 reservation that you want recommendations for, in years. * @see TermInYears */ public final TermInYears termInYears() { return TermInYears.fromValue(termInYears); } /** *

* The term of the reservation that you want recommendations for, 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 reservation that you want recommendations for, in years. * @see TermInYears */ public final String termInYearsAsString() { return termInYears; } /** *

* The payment option for the reservation (for example, AllUpfront or NoUpfront). *

*

* 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 reservation (for example, AllUpfront or NoUpfront). * @see PaymentOption */ public final PaymentOption paymentOption() { return PaymentOption.fromValue(paymentOption); } /** *

* The payment option for the reservation (for example, AllUpfront or NoUpfront). *

*

* 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 reservation (for example, AllUpfront or NoUpfront). * @see PaymentOption */ public final String paymentOptionAsString() { return paymentOption; } /** *

* Hardware specifications for the service that you want recommendations for. *

* * @return Hardware specifications for the service that you want recommendations for. */ public final ServiceSpecification serviceSpecification() { return serviceSpecification; } /** * For responses, this returns true if the service returned a value for the RecommendationDetails 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 hasRecommendationDetails() { return recommendationDetails != null && !(recommendationDetails instanceof SdkAutoConstructList); } /** *

* Details about the recommended purchases. *

*

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

* * @return Details about the recommended purchases. */ public final List recommendationDetails() { return recommendationDetails; } /** *

* A summary about the recommended purchase. *

* * @return A summary about the recommended purchase. */ public final ReservationPurchaseRecommendationSummary recommendationSummary() { return recommendationSummary; } @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(lookbackPeriodInDaysAsString()); hashCode = 31 * hashCode + Objects.hashCode(termInYearsAsString()); hashCode = 31 * hashCode + Objects.hashCode(paymentOptionAsString()); hashCode = 31 * hashCode + Objects.hashCode(serviceSpecification()); hashCode = 31 * hashCode + Objects.hashCode(hasRecommendationDetails() ? recommendationDetails() : null); hashCode = 31 * hashCode + Objects.hashCode(recommendationSummary()); 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 ReservationPurchaseRecommendation)) { return false; } ReservationPurchaseRecommendation other = (ReservationPurchaseRecommendation) obj; return Objects.equals(accountScopeAsString(), other.accountScopeAsString()) && Objects.equals(lookbackPeriodInDaysAsString(), other.lookbackPeriodInDaysAsString()) && Objects.equals(termInYearsAsString(), other.termInYearsAsString()) && Objects.equals(paymentOptionAsString(), other.paymentOptionAsString()) && Objects.equals(serviceSpecification(), other.serviceSpecification()) && hasRecommendationDetails() == other.hasRecommendationDetails() && Objects.equals(recommendationDetails(), other.recommendationDetails()) && Objects.equals(recommendationSummary(), other.recommendationSummary()); } /** * 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("ReservationPurchaseRecommendation").add("AccountScope", accountScopeAsString()) .add("LookbackPeriodInDays", lookbackPeriodInDaysAsString()).add("TermInYears", termInYearsAsString()) .add("PaymentOption", paymentOptionAsString()).add("ServiceSpecification", serviceSpecification()) .add("RecommendationDetails", hasRecommendationDetails() ? recommendationDetails() : null) .add("RecommendationSummary", recommendationSummary()).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 "TermInYears": return Optional.ofNullable(clazz.cast(termInYearsAsString())); case "PaymentOption": return Optional.ofNullable(clazz.cast(paymentOptionAsString())); case "ServiceSpecification": return Optional.ofNullable(clazz.cast(serviceSpecification())); case "RecommendationDetails": return Optional.ofNullable(clazz.cast(recommendationDetails())); case "RecommendationSummary": return Optional.ofNullable(clazz.cast(recommendationSummary())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ReservationPurchaseRecommendation) 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 Amazon Web Services recommends that you purchase this instance for. For example, you * can purchase this reservation for an entire organization in Amazon Web Services Organizations. *

* * @param accountScope * The account scope that Amazon Web Services recommends that you purchase this instance for. For * example, you can purchase this reservation for an entire organization in Amazon Web Services * Organizations. * @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 Amazon Web Services recommends that you purchase this instance for. For example, you * can purchase this reservation for an entire organization in Amazon Web Services Organizations. *

* * @param accountScope * The account scope that Amazon Web Services recommends that you purchase this instance for. For * example, you can purchase this reservation for an entire organization in Amazon Web Services * Organizations. * @see AccountScope * @return Returns a reference to this object so that method calls can be chained together. * @see AccountScope */ Builder accountScope(AccountScope accountScope); /** *

* How many days of previous usage that Amazon Web Services considers when making this recommendation. *

* * @param lookbackPeriodInDays * How many days of previous usage that Amazon Web Services considers when making this recommendation. * @see LookbackPeriodInDays * @return Returns a reference to this object so that method calls can be chained together. * @see LookbackPeriodInDays */ Builder lookbackPeriodInDays(String lookbackPeriodInDays); /** *

* How many days of previous usage that Amazon Web Services considers when making this recommendation. *

* * @param lookbackPeriodInDays * How many days of previous usage that Amazon Web Services considers when making this recommendation. * @see LookbackPeriodInDays * @return Returns a reference to this object so that method calls can be chained together. * @see LookbackPeriodInDays */ Builder lookbackPeriodInDays(LookbackPeriodInDays lookbackPeriodInDays); /** *

* The term of the reservation that you want recommendations for, in years. *

* * @param termInYears * The term of the reservation that you want recommendations for, in years. * @see TermInYears * @return Returns a reference to this object so that method calls can be chained together. * @see TermInYears */ Builder termInYears(String termInYears); /** *

* The term of the reservation that you want recommendations for, in years. *

* * @param termInYears * The term of the reservation that you want recommendations for, in years. * @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 for the reservation (for example, AllUpfront or NoUpfront). *

* * @param paymentOption * The payment option for the reservation (for example, AllUpfront or NoUpfront * ). * @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 for the reservation (for example, AllUpfront or NoUpfront). *

* * @param paymentOption * The payment option for the reservation (for example, AllUpfront or NoUpfront * ). * @see PaymentOption * @return Returns a reference to this object so that method calls can be chained together. * @see PaymentOption */ Builder paymentOption(PaymentOption paymentOption); /** *

* Hardware specifications for the service that you want recommendations for. *

* * @param serviceSpecification * Hardware specifications for the service that you want recommendations for. * @return Returns a reference to this object so that method calls can be chained together. */ Builder serviceSpecification(ServiceSpecification serviceSpecification); /** *

* Hardware specifications for the service that you want recommendations for. *

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

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

* Details about the recommended purchases. *

* * @param recommendationDetails * Details about the recommended purchases. * @return Returns a reference to this object so that method calls can be chained together. */ Builder recommendationDetails(Collection recommendationDetails); /** *

* Details about the recommended purchases. *

* * @param recommendationDetails * Details about the recommended purchases. * @return Returns a reference to this object so that method calls can be chained together. */ Builder recommendationDetails(ReservationPurchaseRecommendationDetail... recommendationDetails); /** *

* Details about the recommended purchases. *

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

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

* A summary about the recommended purchase. *

* * @param recommendationSummary * A summary about the recommended purchase. * @return Returns a reference to this object so that method calls can be chained together. */ Builder recommendationSummary(ReservationPurchaseRecommendationSummary recommendationSummary); /** *

* A summary about the recommended purchase. *

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

* When the {@link Consumer} completes, {@link ReservationPurchaseRecommendationSummary.Builder#build()} is * called immediately and its result is passed to * {@link #recommendationSummary(ReservationPurchaseRecommendationSummary)}. * * @param recommendationSummary * a consumer that will call methods on {@link ReservationPurchaseRecommendationSummary.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #recommendationSummary(ReservationPurchaseRecommendationSummary) */ default Builder recommendationSummary(Consumer recommendationSummary) { return recommendationSummary(ReservationPurchaseRecommendationSummary.builder().applyMutation(recommendationSummary) .build()); } } static final class BuilderImpl implements Builder { private String accountScope; private String lookbackPeriodInDays; private String termInYears; private String paymentOption; private ServiceSpecification serviceSpecification; private List recommendationDetails = DefaultSdkAutoConstructList.getInstance(); private ReservationPurchaseRecommendationSummary recommendationSummary; private BuilderImpl() { } private BuilderImpl(ReservationPurchaseRecommendation model) { accountScope(model.accountScope); lookbackPeriodInDays(model.lookbackPeriodInDays); termInYears(model.termInYears); paymentOption(model.paymentOption); serviceSpecification(model.serviceSpecification); recommendationDetails(model.recommendationDetails); recommendationSummary(model.recommendationSummary); } 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 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 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 ServiceSpecification.Builder getServiceSpecification() { return serviceSpecification != null ? serviceSpecification.toBuilder() : null; } public final void setServiceSpecification(ServiceSpecification.BuilderImpl serviceSpecification) { this.serviceSpecification = serviceSpecification != null ? serviceSpecification.build() : null; } @Override public final Builder serviceSpecification(ServiceSpecification serviceSpecification) { this.serviceSpecification = serviceSpecification; return this; } public final List getRecommendationDetails() { List result = ReservationPurchaseRecommendationDetailsCopier .copyToBuilder(this.recommendationDetails); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setRecommendationDetails( Collection recommendationDetails) { this.recommendationDetails = ReservationPurchaseRecommendationDetailsCopier.copyFromBuilder(recommendationDetails); } @Override public final Builder recommendationDetails(Collection recommendationDetails) { this.recommendationDetails = ReservationPurchaseRecommendationDetailsCopier.copy(recommendationDetails); return this; } @Override @SafeVarargs public final Builder recommendationDetails(ReservationPurchaseRecommendationDetail... recommendationDetails) { recommendationDetails(Arrays.asList(recommendationDetails)); return this; } @Override @SafeVarargs public final Builder recommendationDetails( Consumer... recommendationDetails) { recommendationDetails(Stream.of(recommendationDetails) .map(c -> ReservationPurchaseRecommendationDetail.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final ReservationPurchaseRecommendationSummary.Builder getRecommendationSummary() { return recommendationSummary != null ? recommendationSummary.toBuilder() : null; } public final void setRecommendationSummary(ReservationPurchaseRecommendationSummary.BuilderImpl recommendationSummary) { this.recommendationSummary = recommendationSummary != null ? recommendationSummary.build() : null; } @Override public final Builder recommendationSummary(ReservationPurchaseRecommendationSummary recommendationSummary) { this.recommendationSummary = recommendationSummary; return this; } @Override public ReservationPurchaseRecommendation build() { return new ReservationPurchaseRecommendation(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy