/** * 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 AWS_COSTEXPLORER_API GetCostAndUsageRequest : public CostExplorerRequest { public: 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::String SerializePayload() const override; Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; /** *

Sets the start and end dates for retrieving AWS 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 and end dates for retrieving AWS 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 and end dates for retrieving AWS 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 and end dates for retrieving AWS 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 and end dates for retrieving AWS 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 and end dates for retrieving AWS 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 AWS 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 AWS 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 AWS 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 AWS 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 AWS 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 AWS 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 AWS 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. *

*/ inline const Expression& GetFilter() const{ return m_filter; } /** *

Filters AWS 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. *

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

Filters AWS 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. *

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

Filters AWS 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. *

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

Filters AWS 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. *

*/ inline GetCostAndUsageRequest& WithFilter(const Expression& value) { SetFilter(value); return *this;} /** *

Filters AWS 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. *

*/ 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 vs. 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 vs. 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 vs. 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 vs. 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 vs. 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 vs. 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 vs. 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 vs. 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 vs. 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 AWS costs using up to two different groups, either dimensions, * tag keys, or both.

When you group by tag key, you get all tag values, * including empty strings.

Valid values are AZ, * INSTANCE_TYPE, LEGAL_ENTITY_NAME, * LINKED_ACCOUNT, OPERATION, PLATFORM, * PURCHASE_TYPE, SERVICE, TAGS, * TENANCY, RECORD_TYPE, and USAGE_TYPE.

*/ inline const Aws::Vector& GetGroupBy() const{ return m_groupBy; } /** *

You can group AWS costs using up to two different groups, either dimensions, * tag keys, or both.

When you group by tag key, you get all tag values, * including empty strings.

Valid values are AZ, * INSTANCE_TYPE, LEGAL_ENTITY_NAME, * LINKED_ACCOUNT, OPERATION, PLATFORM, * PURCHASE_TYPE, SERVICE, TAGS, * TENANCY, RECORD_TYPE, and USAGE_TYPE.

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

You can group AWS costs using up to two different groups, either dimensions, * tag keys, or both.

When you group by tag key, you get all tag values, * including empty strings.

Valid values are AZ, * INSTANCE_TYPE, LEGAL_ENTITY_NAME, * LINKED_ACCOUNT, OPERATION, PLATFORM, * PURCHASE_TYPE, SERVICE, TAGS, * TENANCY, RECORD_TYPE, and USAGE_TYPE.

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

You can group AWS costs using up to two different groups, either dimensions, * tag keys, or both.

When you group by tag key, you get all tag values, * including empty strings.

Valid values are AZ, * INSTANCE_TYPE, LEGAL_ENTITY_NAME, * LINKED_ACCOUNT, OPERATION, PLATFORM, * PURCHASE_TYPE, SERVICE, TAGS, * TENANCY, RECORD_TYPE, and USAGE_TYPE.

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

You can group AWS costs using up to two different groups, either dimensions, * tag keys, or both.

When you group by tag key, you get all tag values, * including empty strings.

Valid values are AZ, * INSTANCE_TYPE, LEGAL_ENTITY_NAME, * LINKED_ACCOUNT, OPERATION, PLATFORM, * PURCHASE_TYPE, SERVICE, TAGS, * TENANCY, RECORD_TYPE, and USAGE_TYPE.

*/ inline GetCostAndUsageRequest& WithGroupBy(const Aws::Vector& value) { SetGroupBy(value); return *this;} /** *

You can group AWS costs using up to two different groups, either dimensions, * tag keys, or both.

When you group by tag key, you get all tag values, * including empty strings.

Valid values are AZ, * INSTANCE_TYPE, LEGAL_ENTITY_NAME, * LINKED_ACCOUNT, OPERATION, PLATFORM, * PURCHASE_TYPE, SERVICE, TAGS, * TENANCY, RECORD_TYPE, and USAGE_TYPE.

*/ inline GetCostAndUsageRequest& WithGroupBy(Aws::Vector&& value) { SetGroupBy(std::move(value)); return *this;} /** *

You can group AWS costs using up to two different groups, either dimensions, * tag keys, or both.

When you group by tag key, you get all tag values, * including empty strings.

Valid values are AZ, * INSTANCE_TYPE, LEGAL_ENTITY_NAME, * LINKED_ACCOUNT, OPERATION, PLATFORM, * PURCHASE_TYPE, SERVICE, TAGS, * TENANCY, RECORD_TYPE, and USAGE_TYPE.

*/ inline GetCostAndUsageRequest& AddGroupBy(const GroupDefinition& value) { m_groupByHasBeenSet = true; m_groupBy.push_back(value); return *this; } /** *

You can group AWS costs using up to two different groups, either dimensions, * tag keys, or both.

When you group by tag key, you get all tag values, * including empty strings.

Valid values are AZ, * INSTANCE_TYPE, LEGAL_ENTITY_NAME, * LINKED_ACCOUNT, OPERATION, PLATFORM, * PURCHASE_TYPE, SERVICE, TAGS, * TENANCY, RECORD_TYPE, and USAGE_TYPE.

*/ 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. AWS 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. AWS 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. AWS 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. AWS 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. AWS 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. AWS 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. AWS 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. AWS 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; Granularity m_granularity; bool m_granularityHasBeenSet; Expression m_filter; bool m_filterHasBeenSet; Aws::Vector m_metrics; bool m_metricsHasBeenSet; Aws::Vector m_groupBy; bool m_groupByHasBeenSet; Aws::String m_nextPageToken; bool m_nextPageTokenHasBeenSet; }; } // namespace Model } // namespace CostExplorer } // namespace Aws