
com.amazonaws.services.costexplorer.model.GetCostAndUsageRequest 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 GetCostAndUsageRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* Sets the start date and end date for retrieving Amazon Web Services costs. The start date is inclusive, but the
* end date is exclusive. For example, if start
is 2017-01-01
and end
is
* 2017-05-01
, then the cost and usage data is retrieved from 2017-01-01
up to and
* including 2017-04-30
but not including 2017-05-01
.
*
*/
private DateInterval timePeriod;
/**
*
* Sets the Amazon Web Services cost granularity to MONTHLY
or DAILY
, or
* HOURLY
. If Granularity
isn't set, the response object doesn't include the
* Granularity
, either MONTHLY
or DAILY
, or HOURLY
.
*
*/
private String granularity;
/**
*
* Filters Amazon Web Services costs by different dimensions. For example, you can specify SERVICE
and
* LINKED_ACCOUNT
and get the costs that are associated with that account's usage of that service. You
* can nest Expression
objects to define any combination of dimension filters. For more information,
* see Expression.
*
*
* Valid values for MatchOptions
for Dimensions
are EQUALS
and
* CASE_SENSITIVE
.
*
*
* Valid values for MatchOptions
for CostCategories
and Tags
are
* EQUALS
, ABSENT
, and CASE_SENSITIVE
. Default values are EQUALS
* and CASE_SENSITIVE
.
*
*/
private Expression filter;
/**
*
* Which metrics are returned in the query. For more information about blended and unblended rates, see Why does the "blended"
* annotation appear on some line items in my bill?.
*
*
* Valid values are AmortizedCost
, BlendedCost
, NetAmortizedCost
,
* NetUnblendedCost
, NormalizedUsageAmount
, UnblendedCost
, and
* UsageQuantity
.
*
*
*
* If you return the UsageQuantity
metric, the service aggregates all usage numbers without taking into
* account the units. For example, if you aggregate usageQuantity
across all of Amazon EC2, the results
* aren't meaningful because Amazon EC2 compute hours and data transfer are measured in different units (for
* example, hours and GB). To get more meaningful UsageQuantity
metrics, filter by
* UsageType
or UsageTypeGroups
.
*
*
*
* Metrics
is required for GetCostAndUsage
requests.
*
*/
private java.util.List metrics;
/**
*
* You can group Amazon Web Services costs using up to two different groups, either dimensions, tag keys, cost
* categories, or any two group by types.
*
*
* Valid values for the DIMENSION
type are AZ
, INSTANCE_TYPE
,
* LEGAL_ENTITY_NAME
, INVOICING_ENTITY
, LINKED_ACCOUNT
,
* OPERATION
, PLATFORM
, PURCHASE_TYPE
, SERVICE
,
* TENANCY
, RECORD_TYPE
, and USAGE_TYPE
.
*
*
* When you group by the TAG
type and include a valid tag key, you get all tag values, including empty
* strings.
*
*/
private java.util.List groupBy;
/**
*
* 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;
/**
*
* Sets the start date and end date for retrieving Amazon Web Services costs. The start date is inclusive, but the
* end date is exclusive. For example, if start
is 2017-01-01
and end
is
* 2017-05-01
, then the cost and usage data is retrieved from 2017-01-01
up to and
* including 2017-04-30
but not including 2017-05-01
.
*
*
* @param timePeriod
* Sets the start date and end date for retrieving Amazon Web Services costs. The start date is inclusive,
* but the end date is exclusive. For example, if start
is 2017-01-01
and
* end
is 2017-05-01
, then the cost and usage data is retrieved from
* 2017-01-01
up to and including 2017-04-30
but not including
* 2017-05-01
.
*/
public void setTimePeriod(DateInterval timePeriod) {
this.timePeriod = timePeriod;
}
/**
*
* Sets the start date and end date for retrieving Amazon Web Services costs. The start date is inclusive, but the
* end date is exclusive. For example, if start
is 2017-01-01
and end
is
* 2017-05-01
, then the cost and usage data is retrieved from 2017-01-01
up to and
* including 2017-04-30
but not including 2017-05-01
.
*
*
* @return Sets the start date and end date for retrieving Amazon Web Services costs. The start date is inclusive,
* but the end date is exclusive. For example, if start
is 2017-01-01
and
* end
is 2017-05-01
, then the cost and usage data is retrieved from
* 2017-01-01
up to and including 2017-04-30
but not including
* 2017-05-01
.
*/
public DateInterval getTimePeriod() {
return this.timePeriod;
}
/**
*
* Sets the start date and end date for retrieving Amazon Web Services costs. The start date is inclusive, but the
* end date is exclusive. For example, if start
is 2017-01-01
and end
is
* 2017-05-01
, then the cost and usage data is retrieved from 2017-01-01
up to and
* including 2017-04-30
but not including 2017-05-01
.
*
*
* @param timePeriod
* Sets the start date and end date for retrieving Amazon Web Services costs. The start date is inclusive,
* but the end date is exclusive. For example, if start
is 2017-01-01
and
* end
is 2017-05-01
, then the cost and usage data is retrieved from
* 2017-01-01
up to and including 2017-04-30
but not including
* 2017-05-01
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetCostAndUsageRequest withTimePeriod(DateInterval timePeriod) {
setTimePeriod(timePeriod);
return this;
}
/**
*
* Sets the Amazon Web Services cost granularity to MONTHLY
or DAILY
, or
* HOURLY
. If Granularity
isn't set, the response object doesn't include the
* Granularity
, either MONTHLY
or DAILY
, or HOURLY
.
*
*
* @param granularity
* Sets the Amazon Web Services cost granularity to MONTHLY
or DAILY
, or
* HOURLY
. If Granularity
isn't set, the response object doesn't include the
* Granularity
, either MONTHLY
or DAILY
, or HOURLY
.
* @see Granularity
*/
public void setGranularity(String granularity) {
this.granularity = granularity;
}
/**
*
* Sets the Amazon Web Services cost granularity to MONTHLY
or DAILY
, or
* HOURLY
. If Granularity
isn't set, the response object doesn't include the
* Granularity
, either MONTHLY
or DAILY
, or HOURLY
.
*
*
* @return Sets the Amazon Web Services cost granularity to MONTHLY
or DAILY
, or
* HOURLY
. If Granularity
isn't set, the response object doesn't include the
* Granularity
, either MONTHLY
or DAILY
, or HOURLY
.
* @see Granularity
*/
public String getGranularity() {
return this.granularity;
}
/**
*
* Sets the Amazon Web Services cost granularity to MONTHLY
or DAILY
, or
* HOURLY
. If Granularity
isn't set, the response object doesn't include the
* Granularity
, either MONTHLY
or DAILY
, or HOURLY
.
*
*
* @param granularity
* Sets the Amazon Web Services cost granularity to MONTHLY
or DAILY
, or
* HOURLY
. If Granularity
isn't set, the response object doesn't include the
* Granularity
, either MONTHLY
or DAILY
, or HOURLY
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see Granularity
*/
public GetCostAndUsageRequest withGranularity(String granularity) {
setGranularity(granularity);
return this;
}
/**
*
* Sets the Amazon Web Services cost granularity to MONTHLY
or DAILY
, or
* HOURLY
. If Granularity
isn't set, the response object doesn't include the
* Granularity
, either MONTHLY
or DAILY
, or HOURLY
.
*
*
* @param granularity
* Sets the Amazon Web Services cost granularity to MONTHLY
or DAILY
, or
* HOURLY
. If Granularity
isn't set, the response object doesn't include the
* Granularity
, either MONTHLY
or DAILY
, or HOURLY
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see Granularity
*/
public GetCostAndUsageRequest withGranularity(Granularity granularity) {
this.granularity = granularity.toString();
return this;
}
/**
*
* Filters Amazon Web Services costs by different dimensions. For example, you can specify SERVICE
and
* LINKED_ACCOUNT
and get the costs that are associated with that account's usage of that service. You
* can nest Expression
objects to define any combination of dimension filters. For more information,
* see Expression.
*
*
* Valid values for MatchOptions
for Dimensions
are EQUALS
and
* CASE_SENSITIVE
.
*
*
* Valid values for MatchOptions
for CostCategories
and Tags
are
* EQUALS
, ABSENT
, and CASE_SENSITIVE
. Default values are EQUALS
* and CASE_SENSITIVE
.
*
*
* @param filter
* Filters Amazon Web Services costs by different dimensions. For example, you can specify
* SERVICE
and LINKED_ACCOUNT
and get the costs that are associated with that
* account's usage of that service. You can nest Expression
objects to define any combination of
* dimension filters. For more information, see Expression.
*
* Valid values for MatchOptions
for Dimensions
are EQUALS
and
* CASE_SENSITIVE
.
*
*
* Valid values for MatchOptions
for CostCategories
and Tags
are
* EQUALS
, ABSENT
, and CASE_SENSITIVE
. Default values are
* EQUALS
and CASE_SENSITIVE
.
*/
public void setFilter(Expression filter) {
this.filter = filter;
}
/**
*
* Filters Amazon Web Services costs by different dimensions. For example, you can specify SERVICE
and
* LINKED_ACCOUNT
and get the costs that are associated with that account's usage of that service. You
* can nest Expression
objects to define any combination of dimension filters. For more information,
* see Expression.
*
*
* Valid values for MatchOptions
for Dimensions
are EQUALS
and
* CASE_SENSITIVE
.
*
*
* Valid values for MatchOptions
for CostCategories
and Tags
are
* EQUALS
, ABSENT
, and CASE_SENSITIVE
. Default values are EQUALS
* and CASE_SENSITIVE
.
*
*
* @return Filters Amazon Web Services costs by different dimensions. For example, you can specify
* SERVICE
and LINKED_ACCOUNT
and get the costs that are associated with that
* account's usage of that service. You can nest Expression
objects to define any combination
* of dimension filters. For more information, see Expression.
*
* Valid values for MatchOptions
for Dimensions
are EQUALS
and
* CASE_SENSITIVE
.
*
*
* Valid values for MatchOptions
for CostCategories
and Tags
are
* EQUALS
, ABSENT
, and CASE_SENSITIVE
. Default values are
* EQUALS
and CASE_SENSITIVE
.
*/
public Expression getFilter() {
return this.filter;
}
/**
*
* Filters Amazon Web Services costs by different dimensions. For example, you can specify SERVICE
and
* LINKED_ACCOUNT
and get the costs that are associated with that account's usage of that service. You
* can nest Expression
objects to define any combination of dimension filters. For more information,
* see Expression.
*
*
* Valid values for MatchOptions
for Dimensions
are EQUALS
and
* CASE_SENSITIVE
.
*
*
* Valid values for MatchOptions
for CostCategories
and Tags
are
* EQUALS
, ABSENT
, and CASE_SENSITIVE
. Default values are EQUALS
* and CASE_SENSITIVE
.
*
*
* @param filter
* Filters Amazon Web Services costs by different dimensions. For example, you can specify
* SERVICE
and LINKED_ACCOUNT
and get the costs that are associated with that
* account's usage of that service. You can nest Expression
objects to define any combination of
* dimension filters. For more information, see Expression.
*
* Valid values for MatchOptions
for Dimensions
are EQUALS
and
* CASE_SENSITIVE
.
*
*
* Valid values for MatchOptions
for CostCategories
and Tags
are
* EQUALS
, ABSENT
, and CASE_SENSITIVE
. Default values are
* EQUALS
and CASE_SENSITIVE
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetCostAndUsageRequest withFilter(Expression filter) {
setFilter(filter);
return this;
}
/**
*
* Which metrics are returned in the query. For more information about blended and unblended rates, see Why does the "blended"
* annotation appear on some line items in my bill?.
*
*
* Valid values are AmortizedCost
, BlendedCost
, NetAmortizedCost
,
* NetUnblendedCost
, NormalizedUsageAmount
, UnblendedCost
, and
* UsageQuantity
.
*
*
*
* If you return the UsageQuantity
metric, the service aggregates all usage numbers without taking into
* account the units. For example, if you aggregate usageQuantity
across all of Amazon EC2, the results
* aren't meaningful because Amazon EC2 compute hours and data transfer are measured in different units (for
* example, hours and GB). To get more meaningful UsageQuantity
metrics, filter by
* UsageType
or UsageTypeGroups
.
*
*
*
* Metrics
is required for GetCostAndUsage
requests.
*
*
* @return Which metrics are returned in the query. For more information about blended and unblended rates, see Why does the "blended"
* annotation appear on some line items in my bill?.
*
* Valid values are AmortizedCost
, BlendedCost
, NetAmortizedCost
,
* NetUnblendedCost
, NormalizedUsageAmount
, UnblendedCost
, and
* UsageQuantity
.
*
*
*
* If you return the UsageQuantity
metric, the service aggregates all usage numbers without
* taking into account the units. For example, if you aggregate usageQuantity
across all of
* Amazon EC2, the results aren't meaningful because Amazon EC2 compute hours and data transfer are measured
* in different units (for example, hours and GB). To get more meaningful UsageQuantity
* metrics, filter by UsageType
or UsageTypeGroups
.
*
*
*
* Metrics
is required for GetCostAndUsage
requests.
*/
public java.util.List getMetrics() {
return metrics;
}
/**
*
* Which metrics are returned in the query. For more information about blended and unblended rates, see Why does the "blended"
* annotation appear on some line items in my bill?.
*
*
* Valid values are AmortizedCost
, BlendedCost
, NetAmortizedCost
,
* NetUnblendedCost
, NormalizedUsageAmount
, UnblendedCost
, and
* UsageQuantity
.
*
*
*
* If you return the UsageQuantity
metric, the service aggregates all usage numbers without taking into
* account the units. For example, if you aggregate usageQuantity
across all of Amazon EC2, the results
* aren't meaningful because Amazon EC2 compute hours and data transfer are measured in different units (for
* example, hours and GB). To get more meaningful UsageQuantity
metrics, filter by
* UsageType
or UsageTypeGroups
.
*
*
*
* Metrics
is required for GetCostAndUsage
requests.
*
*
* @param metrics
* Which metrics are returned in the query. For more information about blended and unblended rates, see Why does the "blended"
* annotation appear on some line items in my bill?.
*
* Valid values are AmortizedCost
, BlendedCost
, NetAmortizedCost
,
* NetUnblendedCost
, NormalizedUsageAmount
, UnblendedCost
, and
* UsageQuantity
.
*
*
*
* If you return the UsageQuantity
metric, the service aggregates all usage numbers without
* taking into account the units. For example, if you aggregate usageQuantity
across all of
* Amazon EC2, the results aren't meaningful because Amazon EC2 compute hours and data transfer are measured
* in different units (for example, hours and GB). To get more meaningful UsageQuantity
metrics,
* filter by UsageType
or UsageTypeGroups
.
*
*
*
* Metrics
is required for GetCostAndUsage
requests.
*/
public void setMetrics(java.util.Collection metrics) {
if (metrics == null) {
this.metrics = null;
return;
}
this.metrics = new java.util.ArrayList(metrics);
}
/**
*
* Which metrics are returned in the query. For more information about blended and unblended rates, see Why does the "blended"
* annotation appear on some line items in my bill?.
*
*
* Valid values are AmortizedCost
, BlendedCost
, NetAmortizedCost
,
* NetUnblendedCost
, NormalizedUsageAmount
, UnblendedCost
, and
* UsageQuantity
.
*
*
*
* If you return the UsageQuantity
metric, the service aggregates all usage numbers without taking into
* account the units. For example, if you aggregate usageQuantity
across all of Amazon EC2, the results
* aren't meaningful because Amazon EC2 compute hours and data transfer are measured in different units (for
* example, hours and GB). To get more meaningful UsageQuantity
metrics, filter by
* UsageType
or UsageTypeGroups
.
*
*
*
* Metrics
is required for GetCostAndUsage
requests.
*
*
* 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
* Which metrics are returned in the query. For more information about blended and unblended rates, see Why does the "blended"
* annotation appear on some line items in my bill?.
*
* Valid values are AmortizedCost
, BlendedCost
, NetAmortizedCost
,
* NetUnblendedCost
, NormalizedUsageAmount
, UnblendedCost
, and
* UsageQuantity
.
*
*
*
* If you return the UsageQuantity
metric, the service aggregates all usage numbers without
* taking into account the units. For example, if you aggregate usageQuantity
across all of
* Amazon EC2, the results aren't meaningful because Amazon EC2 compute hours and data transfer are measured
* in different units (for example, hours and GB). To get more meaningful UsageQuantity
metrics,
* filter by UsageType
or UsageTypeGroups
.
*
*
*
* Metrics
is required for GetCostAndUsage
requests.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetCostAndUsageRequest withMetrics(String... metrics) {
if (this.metrics == null) {
setMetrics(new java.util.ArrayList(metrics.length));
}
for (String ele : metrics) {
this.metrics.add(ele);
}
return this;
}
/**
*
* Which metrics are returned in the query. For more information about blended and unblended rates, see Why does the "blended"
* annotation appear on some line items in my bill?.
*
*
* Valid values are AmortizedCost
, BlendedCost
, NetAmortizedCost
,
* NetUnblendedCost
, NormalizedUsageAmount
, UnblendedCost
, and
* UsageQuantity
.
*
*
*
* If you return the UsageQuantity
metric, the service aggregates all usage numbers without taking into
* account the units. For example, if you aggregate usageQuantity
across all of Amazon EC2, the results
* aren't meaningful because Amazon EC2 compute hours and data transfer are measured in different units (for
* example, hours and GB). To get more meaningful UsageQuantity
metrics, filter by
* UsageType
or UsageTypeGroups
.
*
*
*
* Metrics
is required for GetCostAndUsage
requests.
*
*
* @param metrics
* Which metrics are returned in the query. For more information about blended and unblended rates, see Why does the "blended"
* annotation appear on some line items in my bill?.
*
* Valid values are AmortizedCost
, BlendedCost
, NetAmortizedCost
,
* NetUnblendedCost
, NormalizedUsageAmount
, UnblendedCost
, and
* UsageQuantity
.
*
*
*
* If you return the UsageQuantity
metric, the service aggregates all usage numbers without
* taking into account the units. For example, if you aggregate usageQuantity
across all of
* Amazon EC2, the results aren't meaningful because Amazon EC2 compute hours and data transfer are measured
* in different units (for example, hours and GB). To get more meaningful UsageQuantity
metrics,
* filter by UsageType
or UsageTypeGroups
.
*
*
*
* Metrics
is required for GetCostAndUsage
requests.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetCostAndUsageRequest withMetrics(java.util.Collection metrics) {
setMetrics(metrics);
return this;
}
/**
*
* You can group Amazon Web Services costs using up to two different groups, either dimensions, tag keys, cost
* categories, or any two group by types.
*
*
* Valid values for the DIMENSION
type are AZ
, INSTANCE_TYPE
,
* LEGAL_ENTITY_NAME
, INVOICING_ENTITY
, LINKED_ACCOUNT
,
* OPERATION
, PLATFORM
, PURCHASE_TYPE
, SERVICE
,
* TENANCY
, RECORD_TYPE
, and USAGE_TYPE
.
*
*
* When you group by the TAG
type and include a valid tag key, you get all tag values, including empty
* strings.
*
*
* @return You can group Amazon Web Services costs using up to two different groups, either dimensions, tag keys,
* cost categories, or any two group by types.
*
* Valid values for the DIMENSION
type are AZ
, INSTANCE_TYPE
,
* LEGAL_ENTITY_NAME
, INVOICING_ENTITY
, LINKED_ACCOUNT
,
* OPERATION
, PLATFORM
, PURCHASE_TYPE
, SERVICE
,
* TENANCY
, RECORD_TYPE
, and USAGE_TYPE
.
*
*
* When you group by the TAG
type and include a valid tag key, you get all tag values,
* including empty strings.
*/
public java.util.List getGroupBy() {
return groupBy;
}
/**
*
* You can group Amazon Web Services costs using up to two different groups, either dimensions, tag keys, cost
* categories, or any two group by types.
*
*
* Valid values for the DIMENSION
type are AZ
, INSTANCE_TYPE
,
* LEGAL_ENTITY_NAME
, INVOICING_ENTITY
, LINKED_ACCOUNT
,
* OPERATION
, PLATFORM
, PURCHASE_TYPE
, SERVICE
,
* TENANCY
, RECORD_TYPE
, and USAGE_TYPE
.
*
*
* When you group by the TAG
type and include a valid tag key, you get all tag values, including empty
* strings.
*
*
* @param groupBy
* You can group Amazon Web Services costs using up to two different groups, either dimensions, tag keys,
* cost categories, or any two group by types.
*
* Valid values for the DIMENSION
type are AZ
, INSTANCE_TYPE
,
* LEGAL_ENTITY_NAME
, INVOICING_ENTITY
, LINKED_ACCOUNT
,
* OPERATION
, PLATFORM
, PURCHASE_TYPE
, SERVICE
,
* TENANCY
, RECORD_TYPE
, and USAGE_TYPE
.
*
*
* When you group by the TAG
type and include a valid tag key, you get all tag values, including
* empty strings.
*/
public void setGroupBy(java.util.Collection groupBy) {
if (groupBy == null) {
this.groupBy = null;
return;
}
this.groupBy = new java.util.ArrayList(groupBy);
}
/**
*
* You can group Amazon Web Services costs using up to two different groups, either dimensions, tag keys, cost
* categories, or any two group by types.
*
*
* Valid values for the DIMENSION
type are AZ
, INSTANCE_TYPE
,
* LEGAL_ENTITY_NAME
, INVOICING_ENTITY
, LINKED_ACCOUNT
,
* OPERATION
, PLATFORM
, PURCHASE_TYPE
, SERVICE
,
* TENANCY
, RECORD_TYPE
, and USAGE_TYPE
.
*
*
* When you group by the TAG
type and include a valid tag key, you get all tag values, including empty
* strings.
*
*
* 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 Amazon Web Services costs using up to two different groups, either dimensions, tag keys,
* cost categories, or any two group by types.
*
* Valid values for the DIMENSION
type are AZ
, INSTANCE_TYPE
,
* LEGAL_ENTITY_NAME
, INVOICING_ENTITY
, LINKED_ACCOUNT
,
* OPERATION
, PLATFORM
, PURCHASE_TYPE
, SERVICE
,
* TENANCY
, RECORD_TYPE
, and USAGE_TYPE
.
*
*
* When you group by the TAG
type and include a valid tag key, you get all tag values, including
* empty strings.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetCostAndUsageRequest 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 Amazon Web Services costs using up to two different groups, either dimensions, tag keys, cost
* categories, or any two group by types.
*
*
* Valid values for the DIMENSION
type are AZ
, INSTANCE_TYPE
,
* LEGAL_ENTITY_NAME
, INVOICING_ENTITY
, LINKED_ACCOUNT
,
* OPERATION
, PLATFORM
, PURCHASE_TYPE
, SERVICE
,
* TENANCY
, RECORD_TYPE
, and USAGE_TYPE
.
*
*
* When you group by the TAG
type and include a valid tag key, you get all tag values, including empty
* strings.
*
*
* @param groupBy
* You can group Amazon Web Services costs using up to two different groups, either dimensions, tag keys,
* cost categories, or any two group by types.
*
* Valid values for the DIMENSION
type are AZ
, INSTANCE_TYPE
,
* LEGAL_ENTITY_NAME
, INVOICING_ENTITY
, LINKED_ACCOUNT
,
* OPERATION
, PLATFORM
, PURCHASE_TYPE
, SERVICE
,
* TENANCY
, RECORD_TYPE
, and USAGE_TYPE
.
*
*
* When you group by the TAG
type and include a valid tag key, you get all tag values, including
* empty strings.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetCostAndUsageRequest withGroupBy(java.util.Collection groupBy) {
setGroupBy(groupBy);
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 GetCostAndUsageRequest withNextPageToken(String nextPageToken) {
setNextPageToken(nextPageToken);
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 (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 (getGroupBy() != null)
sb.append("GroupBy: ").append(getGroupBy()).append(",");
if (getNextPageToken() != null)
sb.append("NextPageToken: ").append(getNextPageToken());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof GetCostAndUsageRequest == false)
return false;
GetCostAndUsageRequest other = (GetCostAndUsageRequest) obj;
if (other.getTimePeriod() == null ^ this.getTimePeriod() == null)
return false;
if (other.getTimePeriod() != null && other.getTimePeriod().equals(this.getTimePeriod()) == 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.getGroupBy() == null ^ this.getGroupBy() == null)
return false;
if (other.getGroupBy() != null && other.getGroupBy().equals(this.getGroupBy()) == false)
return false;
if (other.getNextPageToken() == null ^ this.getNextPageToken() == null)
return false;
if (other.getNextPageToken() != null && other.getNextPageToken().equals(this.getNextPageToken()) == 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 + ((getGranularity() == null) ? 0 : getGranularity().hashCode());
hashCode = prime * hashCode + ((getFilter() == null) ? 0 : getFilter().hashCode());
hashCode = prime * hashCode + ((getMetrics() == null) ? 0 : getMetrics().hashCode());
hashCode = prime * hashCode + ((getGroupBy() == null) ? 0 : getGroupBy().hashCode());
hashCode = prime * hashCode + ((getNextPageToken() == null) ? 0 : getNextPageToken().hashCode());
return hashCode;
}
@Override
public GetCostAndUsageRequest clone() {
return (GetCostAndUsageRequest) super.clone();
}
}