
com.amazonaws.services.costexplorer.model.GetSavingsPlansCoverageRequest 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 GetSavingsPlansCoverageRequest 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;
/**
*
* You can group the data using the attributes INSTANCE_FAMILY
, REGION
, or
* SERVICE
.
*
*/
private java.util.List groupBy;
/**
*
* The granularity of the Amazon Web Services cost data for your Savings Plans. Granularity
can't be
* set if GroupBy
is set.
*
*
* The GetSavingsPlansCoverage
operation supports only DAILY
and MONTHLY
* granularities.
*
*/
private String granularity;
/**
*
* Filters Savings Plans coverage data by dimensions. You can filter data for Savings Plans usage with the following
* dimensions:
*
*
* -
*
* LINKED_ACCOUNT
*
*
* -
*
* REGION
*
*
* -
*
* SERVICE
*
*
* -
*
* INSTANCE_FAMILY
*
*
*
*
* GetSavingsPlansCoverage
uses the same Expression
* object as the other operations, but only AND
is supported among each dimension. If there are
* multiple values for a dimension, they are OR'd together.
*
*
* Cost category is also supported.
*
*/
private Expression filter;
/**
*
* The measurement that you want your Savings Plans coverage reported in. The only valid value is
* SpendCoveredBySavingsPlans
.
*
*/
private java.util.List metrics;
/**
*
* 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
:
*
*
* -
*
* SpendCoveredBySavingsPlan
*
*
* -
*
* OnDemandCost
*
*
* -
*
* CoveragePercentage
*
*
* -
*
* TotalCost
*
*
* -
*
* InstanceFamily
*
*
* -
*
* Region
*
*
* -
*
* Service
*
*
*
*
* 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 GetSavingsPlansCoverageRequest withTimePeriod(DateInterval timePeriod) {
setTimePeriod(timePeriod);
return this;
}
/**
*
* You can group the data using the attributes INSTANCE_FAMILY
, REGION
, or
* SERVICE
.
*
*
* @return You can group the data using the attributes INSTANCE_FAMILY
, REGION
, or
* SERVICE
.
*/
public java.util.List getGroupBy() {
return groupBy;
}
/**
*
* You can group the data using the attributes INSTANCE_FAMILY
, REGION
, or
* SERVICE
.
*
*
* @param groupBy
* You can group the data using the attributes INSTANCE_FAMILY
, REGION
, or
* SERVICE
.
*/
public void setGroupBy(java.util.Collection groupBy) {
if (groupBy == null) {
this.groupBy = null;
return;
}
this.groupBy = new java.util.ArrayList(groupBy);
}
/**
*
* You can group the data using the attributes INSTANCE_FAMILY
, REGION
, or
* SERVICE
.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setGroupBy(java.util.Collection)} or {@link #withGroupBy(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param groupBy
* You can group the data using the attributes INSTANCE_FAMILY
, REGION
, or
* SERVICE
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetSavingsPlansCoverageRequest withGroupBy(GroupDefinition... groupBy) {
if (this.groupBy == null) {
setGroupBy(new java.util.ArrayList(groupBy.length));
}
for (GroupDefinition ele : groupBy) {
this.groupBy.add(ele);
}
return this;
}
/**
*
* You can group the data using the attributes INSTANCE_FAMILY
, REGION
, or
* SERVICE
.
*
*
* @param groupBy
* You can group the data using the attributes INSTANCE_FAMILY
, REGION
, or
* SERVICE
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetSavingsPlansCoverageRequest withGroupBy(java.util.Collection groupBy) {
setGroupBy(groupBy);
return this;
}
/**
*
* The granularity of the Amazon Web Services cost data for your Savings Plans. Granularity
can't be
* set if GroupBy
is set.
*
*
* The GetSavingsPlansCoverage
operation supports only DAILY
and MONTHLY
* granularities.
*
*
* @param granularity
* The granularity of the Amazon Web Services cost data for your Savings Plans. Granularity
* can't be set if GroupBy
is set.
*
* The GetSavingsPlansCoverage
operation supports only DAILY
and
* MONTHLY
granularities.
* @see Granularity
*/
public void setGranularity(String granularity) {
this.granularity = granularity;
}
/**
*
* The granularity of the Amazon Web Services cost data for your Savings Plans. Granularity
can't be
* set if GroupBy
is set.
*
*
* The GetSavingsPlansCoverage
operation supports only DAILY
and MONTHLY
* granularities.
*
*
* @return The granularity of the Amazon Web Services cost data for your Savings Plans. Granularity
* can't be set if GroupBy
is set.
*
* The GetSavingsPlansCoverage
operation supports only DAILY
and
* MONTHLY
granularities.
* @see Granularity
*/
public String getGranularity() {
return this.granularity;
}
/**
*
* The granularity of the Amazon Web Services cost data for your Savings Plans. Granularity
can't be
* set if GroupBy
is set.
*
*
* The GetSavingsPlansCoverage
operation supports only DAILY
and MONTHLY
* granularities.
*
*
* @param granularity
* The granularity of the Amazon Web Services cost data for your Savings Plans. Granularity
* can't be set if GroupBy
is set.
*
* The GetSavingsPlansCoverage
operation supports only DAILY
and
* MONTHLY
granularities.
* @return Returns a reference to this object so that method calls can be chained together.
* @see Granularity
*/
public GetSavingsPlansCoverageRequest withGranularity(String granularity) {
setGranularity(granularity);
return this;
}
/**
*
* The granularity of the Amazon Web Services cost data for your Savings Plans. Granularity
can't be
* set if GroupBy
is set.
*
*
* The GetSavingsPlansCoverage
operation supports only DAILY
and MONTHLY
* granularities.
*
*
* @param granularity
* The granularity of the Amazon Web Services cost data for your Savings Plans. Granularity
* can't be set if GroupBy
is set.
*
* The GetSavingsPlansCoverage
operation supports only DAILY
and
* MONTHLY
granularities.
* @return Returns a reference to this object so that method calls can be chained together.
* @see Granularity
*/
public GetSavingsPlansCoverageRequest withGranularity(Granularity granularity) {
this.granularity = granularity.toString();
return this;
}
/**
*
* Filters Savings Plans coverage data by dimensions. You can filter data for Savings Plans usage with the following
* dimensions:
*
*
* -
*
* LINKED_ACCOUNT
*
*
* -
*
* REGION
*
*
* -
*
* SERVICE
*
*
* -
*
* INSTANCE_FAMILY
*
*
*
*
* GetSavingsPlansCoverage
uses the same Expression
* object as the other operations, but only AND
is supported among each dimension. If there are
* multiple values for a dimension, they are OR'd together.
*
*
* Cost category is also supported.
*
*
* @param filter
* Filters Savings Plans coverage data by dimensions. You can filter data for Savings Plans usage with the
* following dimensions:
*
* -
*
* LINKED_ACCOUNT
*
*
* -
*
* REGION
*
*
* -
*
* SERVICE
*
*
* -
*
* INSTANCE_FAMILY
*
*
*
*
* GetSavingsPlansCoverage
uses the same Expression object as the other operations, but only AND
is supported among each
* dimension. If there are multiple values for a dimension, they are OR'd together.
*
*
* Cost category is also supported.
*/
public void setFilter(Expression filter) {
this.filter = filter;
}
/**
*
* Filters Savings Plans coverage data by dimensions. You can filter data for Savings Plans usage with the following
* dimensions:
*
*
* -
*
* LINKED_ACCOUNT
*
*
* -
*
* REGION
*
*
* -
*
* SERVICE
*
*
* -
*
* INSTANCE_FAMILY
*
*
*
*
* GetSavingsPlansCoverage
uses the same Expression
* object as the other operations, but only AND
is supported among each dimension. If there are
* multiple values for a dimension, they are OR'd together.
*
*
* Cost category is also supported.
*
*
* @return Filters Savings Plans coverage data by dimensions. You can filter data for Savings Plans usage with the
* following dimensions:
*
* -
*
* LINKED_ACCOUNT
*
*
* -
*
* REGION
*
*
* -
*
* SERVICE
*
*
* -
*
* INSTANCE_FAMILY
*
*
*
*
* GetSavingsPlansCoverage
uses the same Expression object as the other operations, but only AND
is supported among each
* dimension. If there are multiple values for a dimension, they are OR'd together.
*
*
* Cost category is also supported.
*/
public Expression getFilter() {
return this.filter;
}
/**
*
* Filters Savings Plans coverage data by dimensions. You can filter data for Savings Plans usage with the following
* dimensions:
*
*
* -
*
* LINKED_ACCOUNT
*
*
* -
*
* REGION
*
*
* -
*
* SERVICE
*
*
* -
*
* INSTANCE_FAMILY
*
*
*
*
* GetSavingsPlansCoverage
uses the same Expression
* object as the other operations, but only AND
is supported among each dimension. If there are
* multiple values for a dimension, they are OR'd together.
*
*
* Cost category is also supported.
*
*
* @param filter
* Filters Savings Plans coverage data by dimensions. You can filter data for Savings Plans usage with the
* following dimensions:
*
* -
*
* LINKED_ACCOUNT
*
*
* -
*
* REGION
*
*
* -
*
* SERVICE
*
*
* -
*
* INSTANCE_FAMILY
*
*
*
*
* GetSavingsPlansCoverage
uses the same Expression object as the other operations, but only AND
is supported among each
* dimension. If there are multiple values for a dimension, they are OR'd together.
*
*
* Cost category is also supported.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetSavingsPlansCoverageRequest withFilter(Expression filter) {
setFilter(filter);
return this;
}
/**
*
* The measurement that you want your Savings Plans coverage reported in. The only valid value is
* SpendCoveredBySavingsPlans
.
*
*
* @return The measurement that you want your Savings Plans coverage reported in. The only valid value is
* SpendCoveredBySavingsPlans
.
*/
public java.util.List getMetrics() {
return metrics;
}
/**
*
* The measurement that you want your Savings Plans coverage reported in. The only valid value is
* SpendCoveredBySavingsPlans
.
*
*
* @param metrics
* The measurement that you want your Savings Plans coverage reported in. The only valid value is
* SpendCoveredBySavingsPlans
.
*/
public void setMetrics(java.util.Collection metrics) {
if (metrics == null) {
this.metrics = null;
return;
}
this.metrics = new java.util.ArrayList(metrics);
}
/**
*
* The measurement that you want your Savings Plans coverage reported in. The only valid value is
* SpendCoveredBySavingsPlans
.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setMetrics(java.util.Collection)} or {@link #withMetrics(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param metrics
* The measurement that you want your Savings Plans coverage reported in. The only valid value is
* SpendCoveredBySavingsPlans
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetSavingsPlansCoverageRequest withMetrics(String... metrics) {
if (this.metrics == null) {
setMetrics(new java.util.ArrayList(metrics.length));
}
for (String ele : metrics) {
this.metrics.add(ele);
}
return this;
}
/**
*
* The measurement that you want your Savings Plans coverage reported in. The only valid value is
* SpendCoveredBySavingsPlans
.
*
*
* @param metrics
* The measurement that you want your Savings Plans coverage reported in. The only valid value is
* SpendCoveredBySavingsPlans
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetSavingsPlansCoverageRequest withMetrics(java.util.Collection metrics) {
setMetrics(metrics);
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 GetSavingsPlansCoverageRequest 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 GetSavingsPlansCoverageRequest withMaxResults(Integer maxResults) {
setMaxResults(maxResults);
return this;
}
/**
*
* The value that you want to sort the data by.
*
*
* The following values are supported for Key
:
*
*
* -
*
* SpendCoveredBySavingsPlan
*
*
* -
*
* OnDemandCost
*
*
* -
*
* CoveragePercentage
*
*
* -
*
* TotalCost
*
*
* -
*
* InstanceFamily
*
*
* -
*
* Region
*
*
* -
*
* Service
*
*
*
*
* 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
:
*
*
* -
*
* SpendCoveredBySavingsPlan
*
*
* -
*
* OnDemandCost
*
*
* -
*
* CoveragePercentage
*
*
* -
*
* TotalCost
*
*
* -
*
* InstanceFamily
*
*
* -
*
* Region
*
*
* -
*
* Service
*
*
*
*
* 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
:
*
*
* -
*
* SpendCoveredBySavingsPlan
*
*
* -
*
* OnDemandCost
*
*
* -
*
* CoveragePercentage
*
*
* -
*
* TotalCost
*
*
* -
*
* InstanceFamily
*
*
* -
*
* Region
*
*
* -
*
* Service
*
*
*
*
* 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
:
*
*
* -
*
* SpendCoveredBySavingsPlan
*
*
* -
*
* OnDemandCost
*
*
* -
*
* CoveragePercentage
*
*
* -
*
* TotalCost
*
*
* -
*
* InstanceFamily
*
*
* -
*
* Region
*
*
* -
*
* Service
*
*
*
*
* 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
:
*
*
* -
*
* SpendCoveredBySavingsPlan
*
*
* -
*
* OnDemandCost
*
*
* -
*
* CoveragePercentage
*
*
* -
*
* TotalCost
*
*
* -
*
* InstanceFamily
*
*
* -
*
* Region
*
*
* -
*
* Service
*
*
*
*
* 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
:
*
*
* -
*
* SpendCoveredBySavingsPlan
*
*
* -
*
* OnDemandCost
*
*
* -
*
* CoveragePercentage
*
*
* -
*
* TotalCost
*
*
* -
*
* InstanceFamily
*
*
* -
*
* Region
*
*
* -
*
* Service
*
*
*
*
* 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 GetSavingsPlansCoverageRequest 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 (getGroupBy() != null)
sb.append("GroupBy: ").append(getGroupBy()).append(",");
if (getGranularity() != null)
sb.append("Granularity: ").append(getGranularity()).append(",");
if (getFilter() != null)
sb.append("Filter: ").append(getFilter()).append(",");
if (getMetrics() != null)
sb.append("Metrics: ").append(getMetrics()).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 GetSavingsPlansCoverageRequest == false)
return false;
GetSavingsPlansCoverageRequest other = (GetSavingsPlansCoverageRequest) obj;
if (other.getTimePeriod() == null ^ this.getTimePeriod() == null)
return false;
if (other.getTimePeriod() != null && other.getTimePeriod().equals(this.getTimePeriod()) == false)
return false;
if (other.getGroupBy() == null ^ this.getGroupBy() == null)
return false;
if (other.getGroupBy() != null && other.getGroupBy().equals(this.getGroupBy()) == false)
return false;
if (other.getGranularity() == null ^ this.getGranularity() == null)
return false;
if (other.getGranularity() != null && other.getGranularity().equals(this.getGranularity()) == 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.getMetrics() == null ^ this.getMetrics() == null)
return false;
if (other.getMetrics() != null && other.getMetrics().equals(this.getMetrics()) == 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 + ((getGroupBy() == null) ? 0 : getGroupBy().hashCode());
hashCode = prime * hashCode + ((getGranularity() == null) ? 0 : getGranularity().hashCode());
hashCode = prime * hashCode + ((getFilter() == null) ? 0 : getFilter().hashCode());
hashCode = prime * hashCode + ((getMetrics() == null) ? 0 : getMetrics().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 GetSavingsPlansCoverageRequest clone() {
return (GetSavingsPlansCoverageRequest) super.clone();
}
}