aws_sdk_costexplorer/client/get_cost_and_usage.rs
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
impl super::Client {
/// Constructs a fluent builder for the [`GetCostAndUsage`](crate::operation::get_cost_and_usage::builders::GetCostAndUsageFluentBuilder) operation.
///
/// - The fluent builder is configurable:
/// - [`time_period(DateInterval)`](crate::operation::get_cost_and_usage::builders::GetCostAndUsageFluentBuilder::time_period) / [`set_time_period(Option<DateInterval>)`](crate::operation::get_cost_and_usage::builders::GetCostAndUsageFluentBuilder::set_time_period):<br>required: **true**<br><p>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 <code>start</code> is <code>2017-01-01</code> and <code>end</code> is <code>2017-05-01</code>, then the cost and usage data is retrieved from <code>2017-01-01</code> up to and including <code>2017-04-30</code> but not including <code>2017-05-01</code>.</p><br>
/// - [`granularity(Granularity)`](crate::operation::get_cost_and_usage::builders::GetCostAndUsageFluentBuilder::granularity) / [`set_granularity(Option<Granularity>)`](crate::operation::get_cost_and_usage::builders::GetCostAndUsageFluentBuilder::set_granularity):<br>required: **true**<br><p>Sets the Amazon Web Services cost granularity to <code>MONTHLY</code> or <code>DAILY</code>, or <code>HOURLY</code>. If <code>Granularity</code> isn't set, the response object doesn't include the <code>Granularity</code>, either <code>MONTHLY</code> or <code>DAILY</code>, or <code>HOURLY</code>.</p><br>
/// - [`filter(Expression)`](crate::operation::get_cost_and_usage::builders::GetCostAndUsageFluentBuilder::filter) / [`set_filter(Option<Expression>)`](crate::operation::get_cost_and_usage::builders::GetCostAndUsageFluentBuilder::set_filter):<br>required: **false**<br><p>Filters Amazon Web Services costs by different dimensions. For example, you can specify <code>SERVICE</code> and <code>LINKED_ACCOUNT</code> and get the costs that are associated with that account's usage of that service. You can nest <code>Expression</code> objects to define any combination of dimension filters. For more information, see <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html">Expression</a>.</p> <p>Valid values for <code>MatchOptions</code> for <code>Dimensions</code> are <code>EQUALS</code> and <code>CASE_SENSITIVE</code>.</p> <p>Valid values for <code>MatchOptions</code> for <code>CostCategories</code> and <code>Tags</code> are <code>EQUALS</code>, <code>ABSENT</code>, and <code>CASE_SENSITIVE</code>. Default values are <code>EQUALS</code> and <code>CASE_SENSITIVE</code>.</p><br>
/// - [`metrics(impl Into<String>)`](crate::operation::get_cost_and_usage::builders::GetCostAndUsageFluentBuilder::metrics) / [`set_metrics(Option<Vec::<String>>)`](crate::operation::get_cost_and_usage::builders::GetCostAndUsageFluentBuilder::set_metrics):<br>required: **true**<br><p>Which metrics are returned in the query. For more information about blended and unblended rates, see <a href="http://aws.amazon.com/premiumsupport/knowledge-center/blended-rates-intro/">Why does the "blended" annotation appear on some line items in my bill?</a>.</p> <p>Valid values are <code>AmortizedCost</code>, <code>BlendedCost</code>, <code>NetAmortizedCost</code>, <code>NetUnblendedCost</code>, <code>NormalizedUsageAmount</code>, <code>UnblendedCost</code>, and <code>UsageQuantity</code>.</p><note> <p>If you return the <code>UsageQuantity</code> metric, the service aggregates all usage numbers without taking into account the units. For example, if you aggregate <code>usageQuantity</code> 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 <code>UsageQuantity</code> metrics, filter by <code>UsageType</code> or <code>UsageTypeGroups</code>.</p> </note> <p><code>Metrics</code> is required for <code>GetCostAndUsage</code> requests.</p><br>
/// - [`group_by(GroupDefinition)`](crate::operation::get_cost_and_usage::builders::GetCostAndUsageFluentBuilder::group_by) / [`set_group_by(Option<Vec::<GroupDefinition>>)`](crate::operation::get_cost_and_usage::builders::GetCostAndUsageFluentBuilder::set_group_by):<br>required: **false**<br><p>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.</p> <p>Valid values for the <code>DIMENSION</code> type are <code>AZ</code>, <code>INSTANCE_TYPE</code>, <code>LEGAL_ENTITY_NAME</code>, <code>INVOICING_ENTITY</code>, <code>LINKED_ACCOUNT</code>, <code>OPERATION</code>, <code>PLATFORM</code>, <code>PURCHASE_TYPE</code>, <code>SERVICE</code>, <code>TENANCY</code>, <code>RECORD_TYPE</code>, and <code>USAGE_TYPE</code>.</p> <p>When you group by the <code>TAG</code> type and include a valid tag key, you get all tag values, including empty strings.</p><br>
/// - [`billing_view_arn(impl Into<String>)`](crate::operation::get_cost_and_usage::builders::GetCostAndUsageFluentBuilder::billing_view_arn) / [`set_billing_view_arn(Option<String>)`](crate::operation::get_cost_and_usage::builders::GetCostAndUsageFluentBuilder::set_billing_view_arn):<br>required: **false**<br><p>The Amazon Resource Name (ARN) that uniquely identifies a specific billing view. The ARN is used to specify which particular billing view you want to interact with or retrieve information from when making API calls related to Amazon Web Services Billing and Cost Management features. The BillingViewArn can be retrieved by calling the ListBillingViews API.</p><br>
/// - [`next_page_token(impl Into<String>)`](crate::operation::get_cost_and_usage::builders::GetCostAndUsageFluentBuilder::next_page_token) / [`set_next_page_token(Option<String>)`](crate::operation::get_cost_and_usage::builders::GetCostAndUsageFluentBuilder::set_next_page_token):<br>required: **false**<br><p>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.</p><br>
/// - On success, responds with [`GetCostAndUsageOutput`](crate::operation::get_cost_and_usage::GetCostAndUsageOutput) with field(s):
/// - [`next_page_token(Option<String>)`](crate::operation::get_cost_and_usage::GetCostAndUsageOutput::next_page_token): <p>The token for the next set of retrievable results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.</p>
/// - [`group_definitions(Option<Vec::<GroupDefinition>>)`](crate::operation::get_cost_and_usage::GetCostAndUsageOutput::group_definitions): <p>The groups that are specified by the <code>Filter</code> or <code>GroupBy</code> parameters in the request.</p>
/// - [`results_by_time(Option<Vec::<ResultByTime>>)`](crate::operation::get_cost_and_usage::GetCostAndUsageOutput::results_by_time): <p>The time period that's covered by the results in the response.</p>
/// - [`dimension_value_attributes(Option<Vec::<DimensionValuesWithAttributes>>)`](crate::operation::get_cost_and_usage::GetCostAndUsageOutput::dimension_value_attributes): <p>The attributes that apply to a specific dimension value. For example, if the value is a linked account, the attribute is that account name.</p>
/// - On failure, responds with [`SdkError<GetCostAndUsageError>`](crate::operation::get_cost_and_usage::GetCostAndUsageError)
pub fn get_cost_and_usage(&self) -> crate::operation::get_cost_and_usage::builders::GetCostAndUsageFluentBuilder {
crate::operation::get_cost_and_usage::builders::GetCostAndUsageFluentBuilder::new(self.handle.clone())
}
}