/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include #include #include #include namespace Aws { namespace CostExplorer { namespace Model { /** */ class GetCostAndUsageRequest : public CostExplorerRequest { public: AWS_COSTEXPLORER_API GetCostAndUsageRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "GetCostAndUsage"; } AWS_COSTEXPLORER_API Aws::String SerializePayload() const override; AWS_COSTEXPLORER_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; /** *

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.

*/ inline const DateInterval& GetTimePeriod() const{ return m_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.

*/ inline bool TimePeriodHasBeenSet() const { return m_timePeriodHasBeenSet; } /** *

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.

*/ inline void SetTimePeriod(const DateInterval& value) { m_timePeriodHasBeenSet = true; m_timePeriod = value; } /** *

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.

*/ inline void SetTimePeriod(DateInterval&& value) { m_timePeriodHasBeenSet = true; m_timePeriod = std::move(value); } /** *

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.

*/ inline GetCostAndUsageRequest& WithTimePeriod(const DateInterval& value) { SetTimePeriod(value); return *this;} /** *

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.

*/ inline GetCostAndUsageRequest& WithTimePeriod(DateInterval&& value) { SetTimePeriod(std::move(value)); 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.

*/ inline const Granularity& GetGranularity() const{ return m_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.

*/ inline bool GranularityHasBeenSet() const { return m_granularityHasBeenSet; } /** *

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.

*/ inline void SetGranularity(const Granularity& value) { m_granularityHasBeenSet = true; m_granularity = value; } /** *

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.

*/ inline void SetGranularity(Granularity&& value) { m_granularityHasBeenSet = true; m_granularity = std::move(value); } /** *

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.

*/ inline GetCostAndUsageRequest& WithGranularity(const Granularity& value) { SetGranularity(value); 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.

*/ inline GetCostAndUsageRequest& WithGranularity(Granularity&& value) { SetGranularity(std::move(value)); 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.

*/ inline const Expression& GetFilter() const{ return m_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.

*/ inline bool FilterHasBeenSet() const { return m_filterHasBeenSet; } /** *

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.

*/ inline void SetFilter(const Expression& value) { m_filterHasBeenSet = true; m_filter = value; } /** *

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.

*/ inline void SetFilter(Expression&& value) { m_filterHasBeenSet = true; m_filter = std::move(value); } /** *

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.

*/ inline GetCostAndUsageRequest& WithFilter(const Expression& value) { SetFilter(value); 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.

*/ inline GetCostAndUsageRequest& WithFilter(Expression&& value) { SetFilter(std::move(value)); 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.

*/ inline const Aws::Vector& GetMetrics() const{ return m_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.

*/ inline bool MetricsHasBeenSet() const { return m_metricsHasBeenSet; } /** *

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.

*/ inline void SetMetrics(const Aws::Vector& value) { m_metricsHasBeenSet = true; m_metrics = value; } /** *

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.

*/ inline void SetMetrics(Aws::Vector&& value) { m_metricsHasBeenSet = true; m_metrics = std::move(value); } /** *

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.

*/ inline GetCostAndUsageRequest& WithMetrics(const Aws::Vector& value) { SetMetrics(value); 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.

*/ inline GetCostAndUsageRequest& WithMetrics(Aws::Vector&& value) { SetMetrics(std::move(value)); 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.

*/ inline GetCostAndUsageRequest& AddMetrics(const Aws::String& value) { m_metricsHasBeenSet = true; m_metrics.push_back(value); 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.

*/ inline GetCostAndUsageRequest& AddMetrics(Aws::String&& value) { m_metricsHasBeenSet = true; m_metrics.push_back(std::move(value)); 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.

*/ inline GetCostAndUsageRequest& AddMetrics(const char* value) { m_metricsHasBeenSet = true; m_metrics.push_back(value); 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.

*/ inline const Aws::Vector& GetGroupBy() const{ return m_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.

*/ inline bool GroupByHasBeenSet() const { return m_groupByHasBeenSet; } /** *

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.

*/ inline void SetGroupBy(const Aws::Vector& value) { m_groupByHasBeenSet = true; m_groupBy = value; } /** *

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.

*/ inline void SetGroupBy(Aws::Vector&& value) { m_groupByHasBeenSet = true; m_groupBy = std::move(value); } /** *

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.

*/ inline GetCostAndUsageRequest& WithGroupBy(const Aws::Vector& value) { SetGroupBy(value); 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.

*/ inline GetCostAndUsageRequest& WithGroupBy(Aws::Vector&& value) { SetGroupBy(std::move(value)); 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.

*/ inline GetCostAndUsageRequest& AddGroupBy(const GroupDefinition& value) { m_groupByHasBeenSet = true; m_groupBy.push_back(value); 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.

*/ inline GetCostAndUsageRequest& AddGroupBy(GroupDefinition&& value) { m_groupByHasBeenSet = true; m_groupBy.push_back(std::move(value)); 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.

*/ inline const Aws::String& GetNextPageToken() const{ return m_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.

*/ inline bool NextPageTokenHasBeenSet() const { return m_nextPageTokenHasBeenSet; } /** *

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.

*/ inline void SetNextPageToken(const Aws::String& value) { m_nextPageTokenHasBeenSet = true; m_nextPageToken = value; } /** *

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.

*/ inline void SetNextPageToken(Aws::String&& value) { m_nextPageTokenHasBeenSet = true; m_nextPageToken = std::move(value); } /** *

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.

*/ inline void SetNextPageToken(const char* value) { m_nextPageTokenHasBeenSet = true; m_nextPageToken.assign(value); } /** *

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.

*/ inline GetCostAndUsageRequest& WithNextPageToken(const Aws::String& value) { SetNextPageToken(value); 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.

*/ inline GetCostAndUsageRequest& WithNextPageToken(Aws::String&& value) { SetNextPageToken(std::move(value)); 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.

*/ inline GetCostAndUsageRequest& WithNextPageToken(const char* value) { SetNextPageToken(value); return *this;} private: DateInterval m_timePeriod; bool m_timePeriodHasBeenSet = false; Granularity m_granularity; bool m_granularityHasBeenSet = false; Expression m_filter; bool m_filterHasBeenSet = false; Aws::Vector m_metrics; bool m_metricsHasBeenSet = false; Aws::Vector m_groupBy; bool m_groupByHasBeenSet = false; Aws::String m_nextPageToken; bool m_nextPageTokenHasBeenSet = false; }; } // namespace Model } // namespace CostExplorer } // namespace Aws