Class GetCostAndUsageWithResourcesRequest
- java.lang.Object
-
- software.amazon.awssdk.core.SdkRequest
-
- software.amazon.awssdk.awscore.AwsRequest
-
- software.amazon.awssdk.services.costexplorer.model.CostExplorerRequest
-
- software.amazon.awssdk.services.costexplorer.model.GetCostAndUsageWithResourcesRequest
-
- All Implemented Interfaces:
SdkPojo,ToCopyableBuilder<GetCostAndUsageWithResourcesRequest.Builder,GetCostAndUsageWithResourcesRequest>
@Generated("software.amazon.awssdk:codegen") public final class GetCostAndUsageWithResourcesRequest extends CostExplorerRequest implements ToCopyableBuilder<GetCostAndUsageWithResourcesRequest.Builder,GetCostAndUsageWithResourcesRequest>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceGetCostAndUsageWithResourcesRequest.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GetCostAndUsageWithResourcesRequest.Builderbuilder()booleanequals(Object obj)booleanequalsBySdkFields(Object obj)Expressionfilter()Filters Amazon Web Services costs by different dimensions.<T> Optional<T>getValueForField(String fieldName, Class<T> clazz)Granularitygranularity()Sets the Amazon Web Services cost granularity toMONTHLY,DAILY, orHOURLY.StringgranularityAsString()Sets the Amazon Web Services cost granularity toMONTHLY,DAILY, orHOURLY.List<GroupDefinition>groupBy()You can group Amazon Web Services costs using up to two different groups:DIMENSION,TAG,COST_CATEGORY.booleanhasGroupBy()For responses, this returns true if the service returned a value for the GroupBy property.inthashCode()booleanhasMetrics()For responses, this returns true if the service returned a value for the Metrics property.List<String>metrics()Which metrics are returned in the query.StringnextPageToken()The token to retrieve the next set of results.List<SdkField<?>>sdkFields()static Class<? extends GetCostAndUsageWithResourcesRequest.Builder>serializableBuilderClass()DateIntervaltimePeriod()Sets the start and end dates for retrieving Amazon Web Services costs.GetCostAndUsageWithResourcesRequest.BuildertoBuilder()StringtoString()Returns a string representation of this object.-
Methods inherited from class software.amazon.awssdk.awscore.AwsRequest
overrideConfiguration
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
-
-
-
Method Detail
-
timePeriod
public final DateInterval timePeriod()
Sets the start and end dates for retrieving Amazon Web Services costs. The range must be within the last 14 days (the start date cannot be earlier than 14 days ago). The start date is inclusive, but the end date is exclusive. For example, if
startis2017-01-01andendis2017-05-01, then the cost and usage data is retrieved from2017-01-01up to and including2017-04-30but not including2017-05-01.- Returns:
- Sets the start and end dates for retrieving Amazon Web Services costs. The range must be within the last
14 days (the start date cannot be earlier than 14 days ago). The start date is inclusive, but the end
date is exclusive. For example, if
startis2017-01-01andendis2017-05-01, then the cost and usage data is retrieved from2017-01-01up to and including2017-04-30but not including2017-05-01.
-
granularity
public final Granularity granularity()
Sets the Amazon Web Services cost granularity to
MONTHLY,DAILY, orHOURLY. IfGranularityisn't set, the response object doesn't include theGranularity,MONTHLY,DAILY, orHOURLY.If the service returns an enum value that is not available in the current SDK version,
granularitywill returnGranularity.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromgranularityAsString().- Returns:
- Sets the Amazon Web Services cost granularity to
MONTHLY,DAILY, orHOURLY. IfGranularityisn't set, the response object doesn't include theGranularity,MONTHLY,DAILY, orHOURLY. - See Also:
Granularity
-
granularityAsString
public final String granularityAsString()
Sets the Amazon Web Services cost granularity to
MONTHLY,DAILY, orHOURLY. IfGranularityisn't set, the response object doesn't include theGranularity,MONTHLY,DAILY, orHOURLY.If the service returns an enum value that is not available in the current SDK version,
granularitywill returnGranularity.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromgranularityAsString().- Returns:
- Sets the Amazon Web Services cost granularity to
MONTHLY,DAILY, orHOURLY. IfGranularityisn't set, the response object doesn't include theGranularity,MONTHLY,DAILY, orHOURLY. - See Also:
Granularity
-
filter
public final Expression filter()
Filters Amazon Web Services costs by different dimensions. For example, you can specify
SERVICEandLINKED_ACCOUNTand get the costs that are associated with that account's usage of that service. You can nestExpressionobjects to define any combination of dimension filters. For more information, see Expression.The
GetCostAndUsageWithResourcesoperation requires that you either group by or filter by aResourceId. It requires the Expression"SERVICE = Amazon Elastic Compute Cloud - Compute"in the filter.Valid values for
MatchOptionsforDimensionsareEQUALSandCASE_SENSITIVE.Valid values for
MatchOptionsforCostCategoriesandTagsareEQUALS,ABSENT, andCASE_SENSITIVE. Default values areEQUALSandCASE_SENSITIVE.- Returns:
- Filters Amazon Web Services costs by different dimensions. For example, you can specify
SERVICEandLINKED_ACCOUNTand get the costs that are associated with that account's usage of that service. You can nestExpressionobjects to define any combination of dimension filters. For more information, see Expression.The
GetCostAndUsageWithResourcesoperation requires that you either group by or filter by aResourceId. It requires the Expression"SERVICE = Amazon Elastic Compute Cloud - Compute"in the filter.Valid values for
MatchOptionsforDimensionsareEQUALSandCASE_SENSITIVE.Valid values for
MatchOptionsforCostCategoriesandTagsareEQUALS,ABSENT, andCASE_SENSITIVE. Default values areEQUALSandCASE_SENSITIVE.
-
hasMetrics
public final boolean hasMetrics()
For responses, this returns true if the service returned a value for the Metrics property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
metrics
public final List<String> 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, andUsageQuantity.If you return the
UsageQuantitymetric, the service aggregates all usage numbers without taking the units into account. For example, if you aggregateusageQuantityacross all of Amazon EC2, the results aren't meaningful because Amazon EC2 compute hours and data transfer are measured in different units (for example, hour or GB). To get more meaningfulUsageQuantitymetrics, filter byUsageTypeorUsageTypeGroups.Metricsis required forGetCostAndUsageWithResourcesrequests.Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasMetrics()method.- Returns:
- 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, andUsageQuantity.If you return the
UsageQuantitymetric, the service aggregates all usage numbers without taking the units into account. For example, if you aggregateusageQuantityacross all of Amazon EC2, the results aren't meaningful because Amazon EC2 compute hours and data transfer are measured in different units (for example, hour or GB). To get more meaningfulUsageQuantitymetrics, filter byUsageTypeorUsageTypeGroups.Metricsis required forGetCostAndUsageWithResourcesrequests.
-
hasGroupBy
public final boolean hasGroupBy()
For responses, this returns true if the service returned a value for the GroupBy property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
groupBy
public final List<GroupDefinition> groupBy()
You can group Amazon Web Services costs using up to two different groups:
DIMENSION,TAG,COST_CATEGORY.Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasGroupBy()method.- Returns:
- You can group Amazon Web Services costs using up to two different groups:
DIMENSION,TAG,COST_CATEGORY.
-
nextPageToken
public final String 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.
- Returns:
- 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.
-
toBuilder
public GetCostAndUsageWithResourcesRequest.Builder toBuilder()
- Specified by:
toBuilderin interfaceToCopyableBuilder<GetCostAndUsageWithResourcesRequest.Builder,GetCostAndUsageWithResourcesRequest>- Specified by:
toBuilderin classCostExplorerRequest
-
builder
public static GetCostAndUsageWithResourcesRequest.Builder builder()
-
serializableBuilderClass
public static Class<? extends GetCostAndUsageWithResourcesRequest.Builder> serializableBuilderClass()
-
hashCode
public final int hashCode()
- Overrides:
hashCodein classAwsRequest
-
equals
public final boolean equals(Object obj)
- Overrides:
equalsin classAwsRequest
-
equalsBySdkFields
public final boolean equalsBySdkFields(Object obj)
- Specified by:
equalsBySdkFieldsin interfaceSdkPojo
-
toString
public final String toString()
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.
-
getValueForField
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
- Overrides:
getValueForFieldin classSdkRequest
-
-