software.amazon.awssdk.services.costexplorer.model.GetReservationPurchaseRecommendationRequest 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.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class GetReservationPurchaseRecommendationRequest extends CostExplorerRequest implements
ToCopyableBuilder {
private static final SdkField ACCOUNT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AccountId").getter(getter(GetReservationPurchaseRecommendationRequest::accountId))
.setter(setter(Builder::accountId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AccountId").build()).build();
private static final SdkField SERVICE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Service")
.getter(getter(GetReservationPurchaseRecommendationRequest::service)).setter(setter(Builder::service))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Service").build()).build();
private static final SdkField FILTER_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("Filter").getter(getter(GetReservationPurchaseRecommendationRequest::filter))
.setter(setter(Builder::filter)).constructor(Expression::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Filter").build()).build();
private static final SdkField ACCOUNT_SCOPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AccountScope").getter(getter(GetReservationPurchaseRecommendationRequest::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(GetReservationPurchaseRecommendationRequest::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(GetReservationPurchaseRecommendationRequest::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(GetReservationPurchaseRecommendationRequest::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(GetReservationPurchaseRecommendationRequest::serviceSpecification))
.setter(setter(Builder::serviceSpecification)).constructor(ServiceSpecification::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ServiceSpecification").build())
.build();
private static final SdkField PAGE_SIZE_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("PageSize").getter(getter(GetReservationPurchaseRecommendationRequest::pageSize))
.setter(setter(Builder::pageSize))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PageSize").build()).build();
private static final SdkField NEXT_PAGE_TOKEN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("NextPageToken").getter(getter(GetReservationPurchaseRecommendationRequest::nextPageToken))
.setter(setter(Builder::nextPageToken))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NextPageToken").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ACCOUNT_ID_FIELD,
SERVICE_FIELD, FILTER_FIELD, ACCOUNT_SCOPE_FIELD, LOOKBACK_PERIOD_IN_DAYS_FIELD, TERM_IN_YEARS_FIELD,
PAYMENT_OPTION_FIELD, SERVICE_SPECIFICATION_FIELD, PAGE_SIZE_FIELD, NEXT_PAGE_TOKEN_FIELD));
private final String accountId;
private final String service;
private final Expression filter;
private final String accountScope;
private final String lookbackPeriodInDays;
private final String termInYears;
private final String paymentOption;
private final ServiceSpecification serviceSpecification;
private final Integer pageSize;
private final String nextPageToken;
private GetReservationPurchaseRecommendationRequest(BuilderImpl builder) {
super(builder);
this.accountId = builder.accountId;
this.service = builder.service;
this.filter = builder.filter;
this.accountScope = builder.accountScope;
this.lookbackPeriodInDays = builder.lookbackPeriodInDays;
this.termInYears = builder.termInYears;
this.paymentOption = builder.paymentOption;
this.serviceSpecification = builder.serviceSpecification;
this.pageSize = builder.pageSize;
this.nextPageToken = builder.nextPageToken;
}
/**
*
* The account ID that's associated with the recommendation.
*
*
* @return The account ID that's associated with the recommendation.
*/
public final String accountId() {
return accountId;
}
/**
*
* The specific service that you want recommendations for.
*
*
* @return The specific service that you want recommendations for.
*/
public final String service() {
return service;
}
/**
* Returns the value of the Filter property for this object.
*
* @return The value of the Filter property for this object.
*/
public final Expression filter() {
return filter;
}
/**
*
* 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;
}
/**
*
* The number of previous days that you want Amazon Web Services to consider when it calculates your
* recommendations.
*
*
* 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 number of previous days that you want Amazon Web Services to consider when it calculates your
* recommendations.
* @see LookbackPeriodInDays
*/
public final LookbackPeriodInDays lookbackPeriodInDays() {
return LookbackPeriodInDays.fromValue(lookbackPeriodInDays);
}
/**
*
* The number of previous days that you want Amazon Web Services to consider when it calculates your
* recommendations.
*
*
* 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 number of previous days that you want Amazon Web Services to consider when it calculates your
* recommendations.
* @see LookbackPeriodInDays
*/
public final String lookbackPeriodInDaysAsString() {
return lookbackPeriodInDays;
}
/**
*
* The reservation term that you want recommendations for.
*
*
* 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 reservation term that you want recommendations for.
* @see TermInYears
*/
public final TermInYears termInYears() {
return TermInYears.fromValue(termInYears);
}
/**
*
* The reservation term that you want recommendations for.
*
*
* 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 reservation term that you want recommendations for.
* @see TermInYears
*/
public final String termInYearsAsString() {
return termInYears;
}
/**
*
* The reservation purchase option that you want recommendations for.
*
*
* 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 reservation purchase option that you want recommendations for.
* @see PaymentOption
*/
public final PaymentOption paymentOption() {
return PaymentOption.fromValue(paymentOption);
}
/**
*
* The reservation purchase option that you want recommendations for.
*
*
* 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 reservation purchase option that you want recommendations for.
* @see PaymentOption
*/
public final String paymentOptionAsString() {
return paymentOption;
}
/**
*
* The hardware specifications for the service instances that you want recommendations for, such as standard or
* convertible Amazon EC2 instances.
*
*
* @return The hardware specifications for the service instances that you want recommendations for, such as standard
* or convertible Amazon EC2 instances.
*/
public final ServiceSpecification serviceSpecification() {
return serviceSpecification;
}
/**
*
* The number of recommendations that you want returned in a single response object.
*
*
* @return The number of recommendations that you want returned in a single response object.
*/
public final Integer pageSize() {
return pageSize;
}
/**
*
* The pagination token that indicates the next set of results that you want to retrieve.
*
*
* @return The pagination token that indicates the next set of results that you want to retrieve.
*/
public final String nextPageToken() {
return nextPageToken;
}
@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 + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(accountId());
hashCode = 31 * hashCode + Objects.hashCode(service());
hashCode = 31 * hashCode + Objects.hashCode(filter());
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(pageSize());
hashCode = 31 * hashCode + Objects.hashCode(nextPageToken());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof GetReservationPurchaseRecommendationRequest)) {
return false;
}
GetReservationPurchaseRecommendationRequest other = (GetReservationPurchaseRecommendationRequest) obj;
return Objects.equals(accountId(), other.accountId()) && Objects.equals(service(), other.service())
&& Objects.equals(filter(), other.filter())
&& 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())
&& Objects.equals(pageSize(), other.pageSize()) && Objects.equals(nextPageToken(), other.nextPageToken());
}
/**
* 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("GetReservationPurchaseRecommendationRequest").add("AccountId", accountId())
.add("Service", service()).add("Filter", filter()).add("AccountScope", accountScopeAsString())
.add("LookbackPeriodInDays", lookbackPeriodInDaysAsString()).add("TermInYears", termInYearsAsString())
.add("PaymentOption", paymentOptionAsString()).add("ServiceSpecification", serviceSpecification())
.add("PageSize", pageSize()).add("NextPageToken", nextPageToken()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "AccountId":
return Optional.ofNullable(clazz.cast(accountId()));
case "Service":
return Optional.ofNullable(clazz.cast(service()));
case "Filter":
return Optional.ofNullable(clazz.cast(filter()));
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 "PageSize":
return Optional.ofNullable(clazz.cast(pageSize()));
case "NextPageToken":
return Optional.ofNullable(clazz.cast(nextPageToken()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function