Class GetCostAndUsageRequest
- All Implemented Interfaces:
SdkPojo,ToCopyableBuilder<GetCostAndUsageRequest.Builder,GetCostAndUsageRequest>
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder()final booleanfinal booleanequalsBySdkFields(Object obj) Indicates whether some other object is "equal to" this one by SDK fields.final Expressionfilter()Filters Amazon Web Services costs by different dimensions.final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) Used to retrieve the value of a field from any class that extendsSdkRequest.final GranularitySets the Amazon Web Services cost granularity toMONTHLYorDAILY, orHOURLY.final StringSets the Amazon Web Services cost granularity toMONTHLYorDAILY, orHOURLY.final List<GroupDefinition> 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.final booleanFor responses, this returns true if the service returned a value for the GroupBy property.final inthashCode()final booleanFor responses, this returns true if the service returned a value for the Metrics property.metrics()Which metrics are returned in the query.final StringThe token to retrieve the next set of results.static Class<? extends GetCostAndUsageRequest.Builder> final DateIntervalSets the start date and end date for retrieving Amazon Web Services costs.Take this object and create a builder that contains all of the current property values of this object.final StringtoString()Returns a string representation of this object.Methods inherited from class software.amazon.awssdk.awscore.AwsRequest
overrideConfigurationMethods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
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
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 date and end date for retrieving Amazon Web Services costs. 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
Sets the Amazon Web Services cost granularity to
MONTHLYorDAILY, orHOURLY. IfGranularityisn't set, the response object doesn't include theGranularity, eitherMONTHLYorDAILY, 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
MONTHLYorDAILY, orHOURLY. IfGranularityisn't set, the response object doesn't include theGranularity, eitherMONTHLYorDAILY, orHOURLY. - See Also:
-
granularityAsString
Sets the Amazon Web Services cost granularity to
MONTHLYorDAILY, orHOURLY. IfGranularityisn't set, the response object doesn't include theGranularity, eitherMONTHLYorDAILY, 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
MONTHLYorDAILY, orHOURLY. IfGranularityisn't set, the response object doesn't include theGranularity, eitherMONTHLYorDAILY, orHOURLY. - See Also:
-
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.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.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
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 into account the units. 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, hours and GB). To get more meaningfulUsageQuantitymetrics, filter byUsageTypeorUsageTypeGroups.Metricsis required forGetCostAndUsagerequests.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 into account the units. 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, hours and GB). To get more meaningfulUsageQuantitymetrics, filter byUsageTypeorUsageTypeGroups.Metricsis required forGetCostAndUsagerequests.
-
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
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
DIMENSIONtype areAZ,INSTANCE_TYPE,LEGAL_ENTITY_NAME,INVOICING_ENTITY,LINKED_ACCOUNT,OPERATION,PLATFORM,PURCHASE_TYPE,SERVICE,TENANCY,RECORD_TYPE, andUSAGE_TYPE.When you group by the
TAGtype and include a valid tag key, you get all tag values, including empty strings.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, either dimensions, tag keys,
cost categories, or any two group by types.
Valid values for the
DIMENSIONtype areAZ,INSTANCE_TYPE,LEGAL_ENTITY_NAME,INVOICING_ENTITY,LINKED_ACCOUNT,OPERATION,PLATFORM,PURCHASE_TYPE,SERVICE,TENANCY,RECORD_TYPE, andUSAGE_TYPE.When you group by the
TAGtype and include a valid tag key, you get all tag values, including empty strings.
-
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
Description copied from interface:ToCopyableBuilderTake this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilderin interfaceToCopyableBuilder<GetCostAndUsageRequest.Builder,GetCostAndUsageRequest> - Specified by:
toBuilderin classCostExplorerRequest- Returns:
- a builder for type T
-
builder
-
serializableBuilderClass
-
hashCode
public final int hashCode()- Overrides:
hashCodein classAwsRequest
-
equals
- Overrides:
equalsin classAwsRequest
-
equalsBySdkFields
Description copied from interface:SdkPojoIndicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in anSdkPojoclass, and is generated based on a service model.If an
SdkPojoclass does not have any inherited fields,equalsBySdkFieldsandequalsare essentially the same.- Specified by:
equalsBySdkFieldsin interfaceSdkPojo- Parameters:
obj- the object to be compared with- Returns:
- true if the other object equals to this object by sdk fields, false otherwise.
-
toString
-
getValueForField
Description copied from class:SdkRequestUsed to retrieve the value of a field from any class that extendsSdkRequest. The field name specified should match the member name from the corresponding service-2.json model specified in the codegen-resources folder for a given service. The class specifies what class to cast the returned value to. If the returned value is also a modeled class, theSdkRequest.getValueForField(String, Class)method will again be available.- Overrides:
getValueForFieldin classSdkRequest- Parameters:
fieldName- The name of the member to be retrieved.clazz- The class to cast the returned object to.- Returns:
- Optional containing the casted return value
-
sdkFields
-