
com.amazonaws.services.costexplorer.model.GetSavingsPlansPurchaseRecommendationRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-costexplorer Show documentation
/*
* Copyright 2020-2025 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 com.amazonaws.services.costexplorer.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class GetSavingsPlansPurchaseRecommendationRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The Savings Plans recommendation type that's requested.
*
*/
private String savingsPlansType;
/**
*
* The savings plan recommendation term that's used to generate these recommendations.
*
*/
private String termInYears;
/**
*
* The payment option that's used to generate these recommendations.
*
*/
private String paymentOption;
/**
*
* 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.
*
*/
private String accountScope;
/**
*
* The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a
* previous call has more results than the maximum page size.
*
*/
private String nextPageToken;
/**
*
* The number of recommendations that you want returned in a single response object.
*
*/
private Integer pageSize;
/**
*
* The lookback period that's used to generate the recommendation.
*
*/
private String lookbackPeriodInDays;
/**
*
* You can filter your recommendations by Account ID with the LINKED_ACCOUNT
dimension. To filter your
* recommendations by Account ID, specify Key
as LINKED_ACCOUNT
and Value
as
* the comma-separated Acount ID(s) that you want to see Savings Plans purchase recommendations for.
*
*
* For GetSavingsPlansPurchaseRecommendation, the Filter
doesn't include CostCategories
or
* Tags
. It only includes Dimensions
. With Dimensions
, Key
must
* be LINKED_ACCOUNT
and Value
can be a single Account ID or multiple comma-separated
* Account IDs that you want to see Savings Plans Purchase Recommendations for. AND
and OR
* operators are not supported.
*
*/
private Expression filter;
/**
*
* The Savings Plans recommendation type that's requested.
*
*
* @param savingsPlansType
* The Savings Plans recommendation type that's requested.
* @see SupportedSavingsPlansType
*/
public void setSavingsPlansType(String savingsPlansType) {
this.savingsPlansType = savingsPlansType;
}
/**
*
* The Savings Plans recommendation type that's requested.
*
*
* @return The Savings Plans recommendation type that's requested.
* @see SupportedSavingsPlansType
*/
public String getSavingsPlansType() {
return this.savingsPlansType;
}
/**
*
* The Savings Plans recommendation type that's requested.
*
*
* @param savingsPlansType
* The Savings Plans recommendation type that's requested.
* @return Returns a reference to this object so that method calls can be chained together.
* @see SupportedSavingsPlansType
*/
public GetSavingsPlansPurchaseRecommendationRequest withSavingsPlansType(String savingsPlansType) {
setSavingsPlansType(savingsPlansType);
return this;
}
/**
*
* The Savings Plans recommendation type that's requested.
*
*
* @param savingsPlansType
* The Savings Plans recommendation type that's requested.
* @return Returns a reference to this object so that method calls can be chained together.
* @see SupportedSavingsPlansType
*/
public GetSavingsPlansPurchaseRecommendationRequest withSavingsPlansType(SupportedSavingsPlansType savingsPlansType) {
this.savingsPlansType = savingsPlansType.toString();
return this;
}
/**
*
* The savings plan recommendation term that's used to generate these recommendations.
*
*
* @param termInYears
* The savings plan recommendation term that's used to generate these recommendations.
* @see TermInYears
*/
public void setTermInYears(String termInYears) {
this.termInYears = termInYears;
}
/**
*
* The savings plan recommendation term that's used to generate these recommendations.
*
*
* @return The savings plan recommendation term that's used to generate these recommendations.
* @see TermInYears
*/
public String getTermInYears() {
return this.termInYears;
}
/**
*
* The savings plan recommendation term that's used to generate these recommendations.
*
*
* @param termInYears
* The savings plan recommendation term that's used to generate these recommendations.
* @return Returns a reference to this object so that method calls can be chained together.
* @see TermInYears
*/
public GetSavingsPlansPurchaseRecommendationRequest withTermInYears(String termInYears) {
setTermInYears(termInYears);
return this;
}
/**
*
* The savings plan recommendation term that's used to generate these recommendations.
*
*
* @param termInYears
* The savings plan recommendation term that's used to generate these recommendations.
* @return Returns a reference to this object so that method calls can be chained together.
* @see TermInYears
*/
public GetSavingsPlansPurchaseRecommendationRequest withTermInYears(TermInYears termInYears) {
this.termInYears = termInYears.toString();
return this;
}
/**
*
* The payment option that's used to generate these recommendations.
*
*
* @param paymentOption
* The payment option that's used to generate these recommendations.
* @see PaymentOption
*/
public void setPaymentOption(String paymentOption) {
this.paymentOption = paymentOption;
}
/**
*
* The payment option that's used to generate these recommendations.
*
*
* @return The payment option that's used to generate these recommendations.
* @see PaymentOption
*/
public String getPaymentOption() {
return this.paymentOption;
}
/**
*
* The payment option that's used to generate these recommendations.
*
*
* @param paymentOption
* The payment option that's used to generate these recommendations.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PaymentOption
*/
public GetSavingsPlansPurchaseRecommendationRequest withPaymentOption(String paymentOption) {
setPaymentOption(paymentOption);
return this;
}
/**
*
* The payment option that's used to generate these recommendations.
*
*
* @param paymentOption
* The payment option that's used to generate these recommendations.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PaymentOption
*/
public GetSavingsPlansPurchaseRecommendationRequest withPaymentOption(PaymentOption paymentOption) {
this.paymentOption = paymentOption.toString();
return this;
}
/**
*
* 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.
*
*
* @param 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.
* @see AccountScope
*/
public void setAccountScope(String accountScope) {
this.accountScope = 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.
*
*
* @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 String getAccountScope() {
return this.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.
*
*
* @param 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.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AccountScope
*/
public GetSavingsPlansPurchaseRecommendationRequest withAccountScope(String accountScope) {
setAccountScope(accountScope);
return this;
}
/**
*
* 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.
*
*
* @param 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.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AccountScope
*/
public GetSavingsPlansPurchaseRecommendationRequest withAccountScope(AccountScope accountScope) {
this.accountScope = accountScope.toString();
return this;
}
/**
*
* The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a
* previous call has more results than the maximum page size.
*
*
* @param nextPageToken
* The token to retrieve the next set of results. Amazon Web Services provides the token when the response
* from a previous call has more results than the maximum page size.
*/
public void setNextPageToken(String nextPageToken) {
this.nextPageToken = nextPageToken;
}
/**
*
* The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a
* previous call has more results than the maximum page size.
*
*
* @return The token to retrieve the next set of results. Amazon Web Services provides the token when the response
* from a previous call has more results than the maximum page size.
*/
public String getNextPageToken() {
return this.nextPageToken;
}
/**
*
* The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a
* previous call has more results than the maximum page size.
*
*
* @param nextPageToken
* The token to retrieve the next set of results. Amazon Web Services provides the token when the response
* from a previous call has more results than the maximum page size.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetSavingsPlansPurchaseRecommendationRequest withNextPageToken(String nextPageToken) {
setNextPageToken(nextPageToken);
return this;
}
/**
*
* The number of recommendations that you want returned in a single response object.
*
*
* @param pageSize
* The number of recommendations that you want returned in a single response object.
*/
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
/**
*
* 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 Integer getPageSize() {
return this.pageSize;
}
/**
*
* The number of recommendations that you want returned in a single response object.
*
*
* @param pageSize
* The number of recommendations that you want returned in a single response object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetSavingsPlansPurchaseRecommendationRequest withPageSize(Integer pageSize) {
setPageSize(pageSize);
return this;
}
/**
*
* The lookback period that's used to generate the recommendation.
*
*
* @param lookbackPeriodInDays
* The lookback period that's used to generate the recommendation.
* @see LookbackPeriodInDays
*/
public void setLookbackPeriodInDays(String lookbackPeriodInDays) {
this.lookbackPeriodInDays = lookbackPeriodInDays;
}
/**
*
* The lookback period that's used to generate the recommendation.
*
*
* @return The lookback period that's used to generate the recommendation.
* @see LookbackPeriodInDays
*/
public String getLookbackPeriodInDays() {
return this.lookbackPeriodInDays;
}
/**
*
* The lookback period that's used to generate the recommendation.
*
*
* @param lookbackPeriodInDays
* The lookback period that's used to generate the recommendation.
* @return Returns a reference to this object so that method calls can be chained together.
* @see LookbackPeriodInDays
*/
public GetSavingsPlansPurchaseRecommendationRequest withLookbackPeriodInDays(String lookbackPeriodInDays) {
setLookbackPeriodInDays(lookbackPeriodInDays);
return this;
}
/**
*
* The lookback period that's used to generate the recommendation.
*
*
* @param lookbackPeriodInDays
* The lookback period that's used to generate the recommendation.
* @return Returns a reference to this object so that method calls can be chained together.
* @see LookbackPeriodInDays
*/
public GetSavingsPlansPurchaseRecommendationRequest withLookbackPeriodInDays(LookbackPeriodInDays lookbackPeriodInDays) {
this.lookbackPeriodInDays = lookbackPeriodInDays.toString();
return this;
}
/**
*
* You can filter your recommendations by Account ID with the LINKED_ACCOUNT
dimension. To filter your
* recommendations by Account ID, specify Key
as LINKED_ACCOUNT
and Value
as
* the comma-separated Acount ID(s) that you want to see Savings Plans purchase recommendations for.
*
*
* For GetSavingsPlansPurchaseRecommendation, the Filter
doesn't include CostCategories
or
* Tags
. It only includes Dimensions
. With Dimensions
, Key
must
* be LINKED_ACCOUNT
and Value
can be a single Account ID or multiple comma-separated
* Account IDs that you want to see Savings Plans Purchase Recommendations for. AND
and OR
* operators are not supported.
*
*
* @param filter
* You can filter your recommendations by Account ID with the LINKED_ACCOUNT
dimension. To
* filter your recommendations by Account ID, specify Key
as LINKED_ACCOUNT
and
* Value
as the comma-separated Acount ID(s) that you want to see Savings Plans purchase
* recommendations for.
*
* For GetSavingsPlansPurchaseRecommendation, the Filter
doesn't include
* CostCategories
or Tags
. It only includes Dimensions
. With
* Dimensions
, Key
must be LINKED_ACCOUNT
and Value
can
* be a single Account ID or multiple comma-separated Account IDs that you want to see Savings Plans Purchase
* Recommendations for. AND
and OR
operators are not supported.
*/
public void setFilter(Expression filter) {
this.filter = filter;
}
/**
*
* You can filter your recommendations by Account ID with the LINKED_ACCOUNT
dimension. To filter your
* recommendations by Account ID, specify Key
as LINKED_ACCOUNT
and Value
as
* the comma-separated Acount ID(s) that you want to see Savings Plans purchase recommendations for.
*
*
* For GetSavingsPlansPurchaseRecommendation, the Filter
doesn't include CostCategories
or
* Tags
. It only includes Dimensions
. With Dimensions
, Key
must
* be LINKED_ACCOUNT
and Value
can be a single Account ID or multiple comma-separated
* Account IDs that you want to see Savings Plans Purchase Recommendations for. AND
and OR
* operators are not supported.
*
*
* @return You can filter your recommendations by Account ID with the LINKED_ACCOUNT
dimension. To
* filter your recommendations by Account ID, specify Key
as LINKED_ACCOUNT
and
* Value
as the comma-separated Acount ID(s) that you want to see Savings Plans purchase
* recommendations for.
*
* For GetSavingsPlansPurchaseRecommendation, the Filter
doesn't include
* CostCategories
or Tags
. It only includes Dimensions
. With
* Dimensions
, Key
must be LINKED_ACCOUNT
and Value
can
* be a single Account ID or multiple comma-separated Account IDs that you want to see Savings Plans
* Purchase Recommendations for. AND
and OR
operators are not supported.
*/
public Expression getFilter() {
return this.filter;
}
/**
*
* You can filter your recommendations by Account ID with the LINKED_ACCOUNT
dimension. To filter your
* recommendations by Account ID, specify Key
as LINKED_ACCOUNT
and Value
as
* the comma-separated Acount ID(s) that you want to see Savings Plans purchase recommendations for.
*
*
* For GetSavingsPlansPurchaseRecommendation, the Filter
doesn't include CostCategories
or
* Tags
. It only includes Dimensions
. With Dimensions
, Key
must
* be LINKED_ACCOUNT
and Value
can be a single Account ID or multiple comma-separated
* Account IDs that you want to see Savings Plans Purchase Recommendations for. AND
and OR
* operators are not supported.
*
*
* @param filter
* You can filter your recommendations by Account ID with the LINKED_ACCOUNT
dimension. To
* filter your recommendations by Account ID, specify Key
as LINKED_ACCOUNT
and
* Value
as the comma-separated Acount ID(s) that you want to see Savings Plans purchase
* recommendations for.
*
* For GetSavingsPlansPurchaseRecommendation, the Filter
doesn't include
* CostCategories
or Tags
. It only includes Dimensions
. With
* Dimensions
, Key
must be LINKED_ACCOUNT
and Value
can
* be a single Account ID or multiple comma-separated Account IDs that you want to see Savings Plans Purchase
* Recommendations for. AND
and OR
operators are not supported.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetSavingsPlansPurchaseRecommendationRequest withFilter(Expression filter) {
setFilter(filter);
return this;
}
/**
* 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.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getSavingsPlansType() != null)
sb.append("SavingsPlansType: ").append(getSavingsPlansType()).append(",");
if (getTermInYears() != null)
sb.append("TermInYears: ").append(getTermInYears()).append(",");
if (getPaymentOption() != null)
sb.append("PaymentOption: ").append(getPaymentOption()).append(",");
if (getAccountScope() != null)
sb.append("AccountScope: ").append(getAccountScope()).append(",");
if (getNextPageToken() != null)
sb.append("NextPageToken: ").append(getNextPageToken()).append(",");
if (getPageSize() != null)
sb.append("PageSize: ").append(getPageSize()).append(",");
if (getLookbackPeriodInDays() != null)
sb.append("LookbackPeriodInDays: ").append(getLookbackPeriodInDays()).append(",");
if (getFilter() != null)
sb.append("Filter: ").append(getFilter());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof GetSavingsPlansPurchaseRecommendationRequest == false)
return false;
GetSavingsPlansPurchaseRecommendationRequest other = (GetSavingsPlansPurchaseRecommendationRequest) obj;
if (other.getSavingsPlansType() == null ^ this.getSavingsPlansType() == null)
return false;
if (other.getSavingsPlansType() != null && other.getSavingsPlansType().equals(this.getSavingsPlansType()) == false)
return false;
if (other.getTermInYears() == null ^ this.getTermInYears() == null)
return false;
if (other.getTermInYears() != null && other.getTermInYears().equals(this.getTermInYears()) == false)
return false;
if (other.getPaymentOption() == null ^ this.getPaymentOption() == null)
return false;
if (other.getPaymentOption() != null && other.getPaymentOption().equals(this.getPaymentOption()) == false)
return false;
if (other.getAccountScope() == null ^ this.getAccountScope() == null)
return false;
if (other.getAccountScope() != null && other.getAccountScope().equals(this.getAccountScope()) == false)
return false;
if (other.getNextPageToken() == null ^ this.getNextPageToken() == null)
return false;
if (other.getNextPageToken() != null && other.getNextPageToken().equals(this.getNextPageToken()) == false)
return false;
if (other.getPageSize() == null ^ this.getPageSize() == null)
return false;
if (other.getPageSize() != null && other.getPageSize().equals(this.getPageSize()) == false)
return false;
if (other.getLookbackPeriodInDays() == null ^ this.getLookbackPeriodInDays() == null)
return false;
if (other.getLookbackPeriodInDays() != null && other.getLookbackPeriodInDays().equals(this.getLookbackPeriodInDays()) == false)
return false;
if (other.getFilter() == null ^ this.getFilter() == null)
return false;
if (other.getFilter() != null && other.getFilter().equals(this.getFilter()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getSavingsPlansType() == null) ? 0 : getSavingsPlansType().hashCode());
hashCode = prime * hashCode + ((getTermInYears() == null) ? 0 : getTermInYears().hashCode());
hashCode = prime * hashCode + ((getPaymentOption() == null) ? 0 : getPaymentOption().hashCode());
hashCode = prime * hashCode + ((getAccountScope() == null) ? 0 : getAccountScope().hashCode());
hashCode = prime * hashCode + ((getNextPageToken() == null) ? 0 : getNextPageToken().hashCode());
hashCode = prime * hashCode + ((getPageSize() == null) ? 0 : getPageSize().hashCode());
hashCode = prime * hashCode + ((getLookbackPeriodInDays() == null) ? 0 : getLookbackPeriodInDays().hashCode());
hashCode = prime * hashCode + ((getFilter() == null) ? 0 : getFilter().hashCode());
return hashCode;
}
@Override
public GetSavingsPlansPurchaseRecommendationRequest clone() {
return (GetSavingsPlansPurchaseRecommendationRequest) super.clone();
}
}