
com.amazonaws.services.costexplorer.model.GetSavingsPlansUtilizationDetailsRequest 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 GetSavingsPlansUtilizationDetailsRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The time period that you want the usage and costs for. The Start
date must be within 13 months. The
* End
date must be after the Start
date, and before the current date. Future dates can't
* be used as an End
date.
*
*/
private DateInterval timePeriod;
/**
*
* Filters Savings Plans utilization coverage data for active Savings Plans dimensions. You can filter data with the
* following dimensions:
*
*
* -
*
* LINKED_ACCOUNT
*
*
* -
*
* SAVINGS_PLAN_ARN
*
*
* -
*
* REGION
*
*
* -
*
* PAYMENT_OPTION
*
*
* -
*
* INSTANCE_TYPE_FAMILY
*
*
*
*
* GetSavingsPlansUtilizationDetails
uses the same Expression
* object as the other operations, but only AND
is supported among each dimension.
*
*/
private Expression filter;
/**
*
* The data type.
*
*/
private java.util.List dataType;
/**
*
* 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 nextToken;
/**
*
* The number of items to be returned in a response. The default is 20
, with a minimum value of
* 1
.
*
*/
private Integer maxResults;
/**
*
* The value that you want to sort the data by.
*
*
* The following values are supported for Key
:
*
*
* -
*
* UtilizationPercentage
*
*
* -
*
* TotalCommitment
*
*
* -
*
* UsedCommitment
*
*
* -
*
* UnusedCommitment
*
*
* -
*
* NetSavings
*
*
* -
*
* AmortizedRecurringCommitment
*
*
* -
*
* AmortizedUpfrontCommitment
*
*
*
*
* The supported values for SortOrder
are ASCENDING
and DESCENDING
.
*
*/
private SortDefinition sortBy;
/**
*
* The time period that you want the usage and costs for. The Start
date must be within 13 months. The
* End
date must be after the Start
date, and before the current date. Future dates can't
* be used as an End
date.
*
*
* @param timePeriod
* The time period that you want the usage and costs for. The Start
date must be within 13
* months. The End
date must be after the Start
date, and before the current date.
* Future dates can't be used as an End
date.
*/
public void setTimePeriod(DateInterval timePeriod) {
this.timePeriod = timePeriod;
}
/**
*
* The time period that you want the usage and costs for. The Start
date must be within 13 months. The
* End
date must be after the Start
date, and before the current date. Future dates can't
* be used as an End
date.
*
*
* @return The time period that you want the usage and costs for. The Start
date must be within 13
* months. The End
date must be after the Start
date, and before the current date.
* Future dates can't be used as an End
date.
*/
public DateInterval getTimePeriod() {
return this.timePeriod;
}
/**
*
* The time period that you want the usage and costs for. The Start
date must be within 13 months. The
* End
date must be after the Start
date, and before the current date. Future dates can't
* be used as an End
date.
*
*
* @param timePeriod
* The time period that you want the usage and costs for. The Start
date must be within 13
* months. The End
date must be after the Start
date, and before the current date.
* Future dates can't be used as an End
date.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetSavingsPlansUtilizationDetailsRequest withTimePeriod(DateInterval timePeriod) {
setTimePeriod(timePeriod);
return this;
}
/**
*
* Filters Savings Plans utilization coverage data for active Savings Plans dimensions. You can filter data with the
* following dimensions:
*
*
* -
*
* LINKED_ACCOUNT
*
*
* -
*
* SAVINGS_PLAN_ARN
*
*
* -
*
* REGION
*
*
* -
*
* PAYMENT_OPTION
*
*
* -
*
* INSTANCE_TYPE_FAMILY
*
*
*
*
* GetSavingsPlansUtilizationDetails
uses the same Expression
* object as the other operations, but only AND
is supported among each dimension.
*
*
* @param filter
* Filters Savings Plans utilization coverage data for active Savings Plans dimensions. You can filter data
* with the following dimensions:
*
* -
*
* LINKED_ACCOUNT
*
*
* -
*
* SAVINGS_PLAN_ARN
*
*
* -
*
* REGION
*
*
* -
*
* PAYMENT_OPTION
*
*
* -
*
* INSTANCE_TYPE_FAMILY
*
*
*
*
* GetSavingsPlansUtilizationDetails
uses the same Expression object as the other operations, but only AND
is supported among each
* dimension.
*/
public void setFilter(Expression filter) {
this.filter = filter;
}
/**
*
* Filters Savings Plans utilization coverage data for active Savings Plans dimensions. You can filter data with the
* following dimensions:
*
*
* -
*
* LINKED_ACCOUNT
*
*
* -
*
* SAVINGS_PLAN_ARN
*
*
* -
*
* REGION
*
*
* -
*
* PAYMENT_OPTION
*
*
* -
*
* INSTANCE_TYPE_FAMILY
*
*
*
*
* GetSavingsPlansUtilizationDetails
uses the same Expression
* object as the other operations, but only AND
is supported among each dimension.
*
*
* @return Filters Savings Plans utilization coverage data for active Savings Plans dimensions. You can filter data
* with the following dimensions:
*
* -
*
* LINKED_ACCOUNT
*
*
* -
*
* SAVINGS_PLAN_ARN
*
*
* -
*
* REGION
*
*
* -
*
* PAYMENT_OPTION
*
*
* -
*
* INSTANCE_TYPE_FAMILY
*
*
*
*
* GetSavingsPlansUtilizationDetails
uses the same Expression object as the other operations, but only AND
is supported among each
* dimension.
*/
public Expression getFilter() {
return this.filter;
}
/**
*
* Filters Savings Plans utilization coverage data for active Savings Plans dimensions. You can filter data with the
* following dimensions:
*
*
* -
*
* LINKED_ACCOUNT
*
*
* -
*
* SAVINGS_PLAN_ARN
*
*
* -
*
* REGION
*
*
* -
*
* PAYMENT_OPTION
*
*
* -
*
* INSTANCE_TYPE_FAMILY
*
*
*
*
* GetSavingsPlansUtilizationDetails
uses the same Expression
* object as the other operations, but only AND
is supported among each dimension.
*
*
* @param filter
* Filters Savings Plans utilization coverage data for active Savings Plans dimensions. You can filter data
* with the following dimensions:
*
* -
*
* LINKED_ACCOUNT
*
*
* -
*
* SAVINGS_PLAN_ARN
*
*
* -
*
* REGION
*
*
* -
*
* PAYMENT_OPTION
*
*
* -
*
* INSTANCE_TYPE_FAMILY
*
*
*
*
* GetSavingsPlansUtilizationDetails
uses the same Expression object as the other operations, but only AND
is supported among each
* dimension.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetSavingsPlansUtilizationDetailsRequest withFilter(Expression filter) {
setFilter(filter);
return this;
}
/**
*
* The data type.
*
*
* @return The data type.
* @see SavingsPlansDataType
*/
public java.util.List getDataType() {
return dataType;
}
/**
*
* The data type.
*
*
* @param dataType
* The data type.
* @see SavingsPlansDataType
*/
public void setDataType(java.util.Collection dataType) {
if (dataType == null) {
this.dataType = null;
return;
}
this.dataType = new java.util.ArrayList(dataType);
}
/**
*
* The data type.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setDataType(java.util.Collection)} or {@link #withDataType(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param dataType
* The data type.
* @return Returns a reference to this object so that method calls can be chained together.
* @see SavingsPlansDataType
*/
public GetSavingsPlansUtilizationDetailsRequest withDataType(String... dataType) {
if (this.dataType == null) {
setDataType(new java.util.ArrayList(dataType.length));
}
for (String ele : dataType) {
this.dataType.add(ele);
}
return this;
}
/**
*
* The data type.
*
*
* @param dataType
* The data type.
* @return Returns a reference to this object so that method calls can be chained together.
* @see SavingsPlansDataType
*/
public GetSavingsPlansUtilizationDetailsRequest withDataType(java.util.Collection dataType) {
setDataType(dataType);
return this;
}
/**
*
* The data type.
*
*
* @param dataType
* The data type.
* @return Returns a reference to this object so that method calls can be chained together.
* @see SavingsPlansDataType
*/
public GetSavingsPlansUtilizationDetailsRequest withDataType(SavingsPlansDataType... dataType) {
java.util.ArrayList dataTypeCopy = new java.util.ArrayList(dataType.length);
for (SavingsPlansDataType value : dataType) {
dataTypeCopy.add(value.toString());
}
if (getDataType() == null) {
setDataType(dataTypeCopy);
} else {
getDataType().addAll(dataTypeCopy);
}
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 nextToken
* 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 setNextToken(String nextToken) {
this.nextToken = nextToken;
}
/**
*
* 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 getNextToken() {
return this.nextToken;
}
/**
*
* 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 nextToken
* 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 GetSavingsPlansUtilizationDetailsRequest withNextToken(String nextToken) {
setNextToken(nextToken);
return this;
}
/**
*
* The number of items to be returned in a response. The default is 20
, with a minimum value of
* 1
.
*
*
* @param maxResults
* The number of items to be returned in a response. The default is 20
, with a minimum value of
* 1
.
*/
public void setMaxResults(Integer maxResults) {
this.maxResults = maxResults;
}
/**
*
* The number of items to be returned in a response. The default is 20
, with a minimum value of
* 1
.
*
*
* @return The number of items to be returned in a response. The default is 20
, with a minimum value of
* 1
.
*/
public Integer getMaxResults() {
return this.maxResults;
}
/**
*
* The number of items to be returned in a response. The default is 20
, with a minimum value of
* 1
.
*
*
* @param maxResults
* The number of items to be returned in a response. The default is 20
, with a minimum value of
* 1
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetSavingsPlansUtilizationDetailsRequest withMaxResults(Integer maxResults) {
setMaxResults(maxResults);
return this;
}
/**
*
* The value that you want to sort the data by.
*
*
* The following values are supported for Key
:
*
*
* -
*
* UtilizationPercentage
*
*
* -
*
* TotalCommitment
*
*
* -
*
* UsedCommitment
*
*
* -
*
* UnusedCommitment
*
*
* -
*
* NetSavings
*
*
* -
*
* AmortizedRecurringCommitment
*
*
* -
*
* AmortizedUpfrontCommitment
*
*
*
*
* The supported values for SortOrder
are ASCENDING
and DESCENDING
.
*
*
* @param sortBy
* The value that you want to sort the data by.
*
* The following values are supported for Key
:
*
*
* -
*
* UtilizationPercentage
*
*
* -
*
* TotalCommitment
*
*
* -
*
* UsedCommitment
*
*
* -
*
* UnusedCommitment
*
*
* -
*
* NetSavings
*
*
* -
*
* AmortizedRecurringCommitment
*
*
* -
*
* AmortizedUpfrontCommitment
*
*
*
*
* The supported values for SortOrder
are ASCENDING
and DESCENDING
.
*/
public void setSortBy(SortDefinition sortBy) {
this.sortBy = sortBy;
}
/**
*
* The value that you want to sort the data by.
*
*
* The following values are supported for Key
:
*
*
* -
*
* UtilizationPercentage
*
*
* -
*
* TotalCommitment
*
*
* -
*
* UsedCommitment
*
*
* -
*
* UnusedCommitment
*
*
* -
*
* NetSavings
*
*
* -
*
* AmortizedRecurringCommitment
*
*
* -
*
* AmortizedUpfrontCommitment
*
*
*
*
* The supported values for SortOrder
are ASCENDING
and DESCENDING
.
*
*
* @return The value that you want to sort the data by.
*
* The following values are supported for Key
:
*
*
* -
*
* UtilizationPercentage
*
*
* -
*
* TotalCommitment
*
*
* -
*
* UsedCommitment
*
*
* -
*
* UnusedCommitment
*
*
* -
*
* NetSavings
*
*
* -
*
* AmortizedRecurringCommitment
*
*
* -
*
* AmortizedUpfrontCommitment
*
*
*
*
* The supported values for SortOrder
are ASCENDING
and DESCENDING
.
*/
public SortDefinition getSortBy() {
return this.sortBy;
}
/**
*
* The value that you want to sort the data by.
*
*
* The following values are supported for Key
:
*
*
* -
*
* UtilizationPercentage
*
*
* -
*
* TotalCommitment
*
*
* -
*
* UsedCommitment
*
*
* -
*
* UnusedCommitment
*
*
* -
*
* NetSavings
*
*
* -
*
* AmortizedRecurringCommitment
*
*
* -
*
* AmortizedUpfrontCommitment
*
*
*
*
* The supported values for SortOrder
are ASCENDING
and DESCENDING
.
*
*
* @param sortBy
* The value that you want to sort the data by.
*
* The following values are supported for Key
:
*
*
* -
*
* UtilizationPercentage
*
*
* -
*
* TotalCommitment
*
*
* -
*
* UsedCommitment
*
*
* -
*
* UnusedCommitment
*
*
* -
*
* NetSavings
*
*
* -
*
* AmortizedRecurringCommitment
*
*
* -
*
* AmortizedUpfrontCommitment
*
*
*
*
* The supported values for SortOrder
are ASCENDING
and DESCENDING
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetSavingsPlansUtilizationDetailsRequest withSortBy(SortDefinition sortBy) {
setSortBy(sortBy);
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 (getTimePeriod() != null)
sb.append("TimePeriod: ").append(getTimePeriod()).append(",");
if (getFilter() != null)
sb.append("Filter: ").append(getFilter()).append(",");
if (getDataType() != null)
sb.append("DataType: ").append(getDataType()).append(",");
if (getNextToken() != null)
sb.append("NextToken: ").append(getNextToken()).append(",");
if (getMaxResults() != null)
sb.append("MaxResults: ").append(getMaxResults()).append(",");
if (getSortBy() != null)
sb.append("SortBy: ").append(getSortBy());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof GetSavingsPlansUtilizationDetailsRequest == false)
return false;
GetSavingsPlansUtilizationDetailsRequest other = (GetSavingsPlansUtilizationDetailsRequest) obj;
if (other.getTimePeriod() == null ^ this.getTimePeriod() == null)
return false;
if (other.getTimePeriod() != null && other.getTimePeriod().equals(this.getTimePeriod()) == false)
return false;
if (other.getFilter() == null ^ this.getFilter() == null)
return false;
if (other.getFilter() != null && other.getFilter().equals(this.getFilter()) == false)
return false;
if (other.getDataType() == null ^ this.getDataType() == null)
return false;
if (other.getDataType() != null && other.getDataType().equals(this.getDataType()) == false)
return false;
if (other.getNextToken() == null ^ this.getNextToken() == null)
return false;
if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false)
return false;
if (other.getMaxResults() == null ^ this.getMaxResults() == null)
return false;
if (other.getMaxResults() != null && other.getMaxResults().equals(this.getMaxResults()) == false)
return false;
if (other.getSortBy() == null ^ this.getSortBy() == null)
return false;
if (other.getSortBy() != null && other.getSortBy().equals(this.getSortBy()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getTimePeriod() == null) ? 0 : getTimePeriod().hashCode());
hashCode = prime * hashCode + ((getFilter() == null) ? 0 : getFilter().hashCode());
hashCode = prime * hashCode + ((getDataType() == null) ? 0 : getDataType().hashCode());
hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode());
hashCode = prime * hashCode + ((getMaxResults() == null) ? 0 : getMaxResults().hashCode());
hashCode = prime * hashCode + ((getSortBy() == null) ? 0 : getSortBy().hashCode());
return hashCode;
}
@Override
public GetSavingsPlansUtilizationDetailsRequest clone() {
return (GetSavingsPlansUtilizationDetailsRequest) super.clone();
}
}