#[non_exhaustive]pub struct GetDimensionValuesInputBuilder { /* private fields */ }
Expand description
A builder for GetDimensionValuesInput
.
Implementations§
Source§impl GetDimensionValuesInputBuilder
impl GetDimensionValuesInputBuilder
Sourcepub fn search_string(self, input: impl Into<String>) -> Self
pub fn search_string(self, input: impl Into<String>) -> Self
The value that you want to search the filter values for.
Sourcepub fn set_search_string(self, input: Option<String>) -> Self
pub fn set_search_string(self, input: Option<String>) -> Self
The value that you want to search the filter values for.
Sourcepub fn get_search_string(&self) -> &Option<String>
pub fn get_search_string(&self) -> &Option<String>
The value that you want to search the filter values for.
Sourcepub fn time_period(self, input: DateInterval) -> Self
pub fn time_period(self, input: DateInterval) -> Self
The start date and end date for retrieving the dimension values. 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
.
Sourcepub fn set_time_period(self, input: Option<DateInterval>) -> Self
pub fn set_time_period(self, input: Option<DateInterval>) -> Self
The start date and end date for retrieving the dimension values. 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
.
Sourcepub fn get_time_period(&self) -> &Option<DateInterval>
pub fn get_time_period(&self) -> &Option<DateInterval>
The start date and end date for retrieving the dimension values. 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
.
Sourcepub fn dimension(self, input: Dimension) -> Self
pub fn dimension(self, input: Dimension) -> Self
The name of the dimension. Each Dimension
is available for a different Context
. For more information, see Context
. LINK_ACCOUNT_NAME
and SERVICE_CODE
can only be used in CostCategoryRule.
Sourcepub fn set_dimension(self, input: Option<Dimension>) -> Self
pub fn set_dimension(self, input: Option<Dimension>) -> Self
The name of the dimension. Each Dimension
is available for a different Context
. For more information, see Context
. LINK_ACCOUNT_NAME
and SERVICE_CODE
can only be used in CostCategoryRule.
Sourcepub fn get_dimension(&self) -> &Option<Dimension>
pub fn get_dimension(&self) -> &Option<Dimension>
The name of the dimension. Each Dimension
is available for a different Context
. For more information, see Context
. LINK_ACCOUNT_NAME
and SERVICE_CODE
can only be used in CostCategoryRule.
Sourcepub fn context(self, input: Context) -> Self
pub fn context(self, input: Context) -> Self
The context for the call to GetDimensionValues
. This can be RESERVATIONS
or COST_AND_USAGE
. The default value is COST_AND_USAGE
. If the context is set to RESERVATIONS
, the resulting dimension values can be used in the GetReservationUtilization
operation. If the context is set to COST_AND_USAGE
, the resulting dimension values can be used in the GetCostAndUsage
operation.
If you set the context to COST_AND_USAGE
, you can use the following dimensions for searching:
-
AZ - The Availability Zone. An example is
us-east-1a
. -
BILLING_ENTITY - The Amazon Web Services seller that your account is with. Possible values are the following:
- Amazon Web Services(Amazon Web Services): The entity that sells Amazon Web Services services.
- AISPL (Amazon Internet Services Pvt. Ltd.): The local Indian entity that's an acting reseller for Amazon Web Services services in India.
- Amazon Web Services Marketplace: The entity that supports the sale of solutions that are built on Amazon Web Services by third-party software providers.
-
CACHE_ENGINE - The Amazon ElastiCache operating system. Examples are Windows or Linux.
-
DEPLOYMENT_OPTION - The scope of Amazon Relational Database Service deployments. Valid values are
SingleAZ
andMultiAZ
. -
DATABASE_ENGINE - The Amazon Relational Database Service database. Examples are Aurora or MySQL.
-
INSTANCE_TYPE - The type of Amazon EC2 instance. An example is
m4.xlarge
. -
INSTANCE_TYPE_FAMILY - A family of instance types optimized to fit different use cases. Examples are
Compute Optimized
(for example,C4
,C5
,C6g
, andC7g
),Memory Optimization
(for example,R4
,R5n
,R5b
, andR6g
). -
INVOICING_ENTITY - The name of the entity that issues the Amazon Web Services invoice.
-
LEGAL_ENTITY_NAME - The name of the organization that sells you Amazon Web Services services, such as Amazon Web Services.
-
LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the Amazon Web Services ID of the member account.
-
OPERATING_SYSTEM - The operating system. Examples are Windows or Linux.
-
OPERATION - The action performed. Examples include
RunInstance
andCreateBucket
. -
PLATFORM - The Amazon EC2 operating system. Examples are Windows or Linux.
-
PURCHASE_TYPE - The reservation type of the purchase that this usage is related to. Examples include On-Demand Instances and Standard Reserved Instances.
-
RESERVATION_ID - The unique identifier for an Amazon Web Services Reservation Instance.
-
SAVINGS_PLAN_ARN - The unique identifier for your Savings Plans.
-
SAVINGS_PLANS_TYPE - Type of Savings Plans (EC2 Instance or Compute).
-
SERVICE - The Amazon Web Services service such as Amazon DynamoDB.
-
TENANCY - The tenancy of a resource. Examples are shared or dedicated.
-
USAGE_TYPE - The type of usage. An example is DataTransfer-In-Bytes. The response for the
GetDimensionValues
operation includes a unit attribute. Examples include GB and Hrs. -
USAGE_TYPE_GROUP - The grouping of common usage types. An example is Amazon EC2: CloudWatch – Alarms. The response for this operation includes a unit attribute.
-
REGION - The Amazon Web Services Region.
-
RECORD_TYPE - The different types of charges such as Reserved Instance (RI) fees, usage costs, tax refunds, and credits.
-
RESOURCE_ID - The unique identifier of the resource. ResourceId is an opt-in feature only available for last 14 days for EC2-Compute Service.
If you set the context to RESERVATIONS
, you can use the following dimensions for searching:
-
AZ - The Availability Zone. An example is
us-east-1a
. -
CACHE_ENGINE - The Amazon ElastiCache operating system. Examples are Windows or Linux.
-
DEPLOYMENT_OPTION - The scope of Amazon Relational Database Service deployments. Valid values are
SingleAZ
andMultiAZ
. -
INSTANCE_TYPE - The type of Amazon EC2 instance. An example is
m4.xlarge
. -
LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the Amazon Web Services ID of the member account.
-
PLATFORM - The Amazon EC2 operating system. Examples are Windows or Linux.
-
REGION - The Amazon Web Services Region.
-
SCOPE (Utilization only) - The scope of a Reserved Instance (RI). Values are regional or a single Availability Zone.
-
TAG (Coverage only) - The tags that are associated with a Reserved Instance (RI).
-
TENANCY - The tenancy of a resource. Examples are shared or dedicated.
If you set the context to SAVINGS_PLANS
, you can use the following dimensions for searching:
-
SAVINGS_PLANS_TYPE - Type of Savings Plans (EC2 Instance or Compute)
-
PAYMENT_OPTION - The payment option for the given Savings Plans (for example, All Upfront)
-
REGION - The Amazon Web Services Region.
-
INSTANCE_TYPE_FAMILY - The family of instances (For example,
m5
) -
LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the Amazon Web Services ID of the member account.
-
SAVINGS_PLAN_ARN - The unique identifier for your Savings Plans.
Sourcepub fn set_context(self, input: Option<Context>) -> Self
pub fn set_context(self, input: Option<Context>) -> Self
The context for the call to GetDimensionValues
. This can be RESERVATIONS
or COST_AND_USAGE
. The default value is COST_AND_USAGE
. If the context is set to RESERVATIONS
, the resulting dimension values can be used in the GetReservationUtilization
operation. If the context is set to COST_AND_USAGE
, the resulting dimension values can be used in the GetCostAndUsage
operation.
If you set the context to COST_AND_USAGE
, you can use the following dimensions for searching:
-
AZ - The Availability Zone. An example is
us-east-1a
. -
BILLING_ENTITY - The Amazon Web Services seller that your account is with. Possible values are the following:
- Amazon Web Services(Amazon Web Services): The entity that sells Amazon Web Services services.
- AISPL (Amazon Internet Services Pvt. Ltd.): The local Indian entity that's an acting reseller for Amazon Web Services services in India.
- Amazon Web Services Marketplace: The entity that supports the sale of solutions that are built on Amazon Web Services by third-party software providers.
-
CACHE_ENGINE - The Amazon ElastiCache operating system. Examples are Windows or Linux.
-
DEPLOYMENT_OPTION - The scope of Amazon Relational Database Service deployments. Valid values are
SingleAZ
andMultiAZ
. -
DATABASE_ENGINE - The Amazon Relational Database Service database. Examples are Aurora or MySQL.
-
INSTANCE_TYPE - The type of Amazon EC2 instance. An example is
m4.xlarge
. -
INSTANCE_TYPE_FAMILY - A family of instance types optimized to fit different use cases. Examples are
Compute Optimized
(for example,C4
,C5
,C6g
, andC7g
),Memory Optimization
(for example,R4
,R5n
,R5b
, andR6g
). -
INVOICING_ENTITY - The name of the entity that issues the Amazon Web Services invoice.
-
LEGAL_ENTITY_NAME - The name of the organization that sells you Amazon Web Services services, such as Amazon Web Services.
-
LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the Amazon Web Services ID of the member account.
-
OPERATING_SYSTEM - The operating system. Examples are Windows or Linux.
-
OPERATION - The action performed. Examples include
RunInstance
andCreateBucket
. -
PLATFORM - The Amazon EC2 operating system. Examples are Windows or Linux.
-
PURCHASE_TYPE - The reservation type of the purchase that this usage is related to. Examples include On-Demand Instances and Standard Reserved Instances.
-
RESERVATION_ID - The unique identifier for an Amazon Web Services Reservation Instance.
-
SAVINGS_PLAN_ARN - The unique identifier for your Savings Plans.
-
SAVINGS_PLANS_TYPE - Type of Savings Plans (EC2 Instance or Compute).
-
SERVICE - The Amazon Web Services service such as Amazon DynamoDB.
-
TENANCY - The tenancy of a resource. Examples are shared or dedicated.
-
USAGE_TYPE - The type of usage. An example is DataTransfer-In-Bytes. The response for the
GetDimensionValues
operation includes a unit attribute. Examples include GB and Hrs. -
USAGE_TYPE_GROUP - The grouping of common usage types. An example is Amazon EC2: CloudWatch – Alarms. The response for this operation includes a unit attribute.
-
REGION - The Amazon Web Services Region.
-
RECORD_TYPE - The different types of charges such as Reserved Instance (RI) fees, usage costs, tax refunds, and credits.
-
RESOURCE_ID - The unique identifier of the resource. ResourceId is an opt-in feature only available for last 14 days for EC2-Compute Service.
If you set the context to RESERVATIONS
, you can use the following dimensions for searching:
-
AZ - The Availability Zone. An example is
us-east-1a
. -
CACHE_ENGINE - The Amazon ElastiCache operating system. Examples are Windows or Linux.
-
DEPLOYMENT_OPTION - The scope of Amazon Relational Database Service deployments. Valid values are
SingleAZ
andMultiAZ
. -
INSTANCE_TYPE - The type of Amazon EC2 instance. An example is
m4.xlarge
. -
LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the Amazon Web Services ID of the member account.
-
PLATFORM - The Amazon EC2 operating system. Examples are Windows or Linux.
-
REGION - The Amazon Web Services Region.
-
SCOPE (Utilization only) - The scope of a Reserved Instance (RI). Values are regional or a single Availability Zone.
-
TAG (Coverage only) - The tags that are associated with a Reserved Instance (RI).
-
TENANCY - The tenancy of a resource. Examples are shared or dedicated.
If you set the context to SAVINGS_PLANS
, you can use the following dimensions for searching:
-
SAVINGS_PLANS_TYPE - Type of Savings Plans (EC2 Instance or Compute)
-
PAYMENT_OPTION - The payment option for the given Savings Plans (for example, All Upfront)
-
REGION - The Amazon Web Services Region.
-
INSTANCE_TYPE_FAMILY - The family of instances (For example,
m5
) -
LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the Amazon Web Services ID of the member account.
-
SAVINGS_PLAN_ARN - The unique identifier for your Savings Plans.
Sourcepub fn get_context(&self) -> &Option<Context>
pub fn get_context(&self) -> &Option<Context>
The context for the call to GetDimensionValues
. This can be RESERVATIONS
or COST_AND_USAGE
. The default value is COST_AND_USAGE
. If the context is set to RESERVATIONS
, the resulting dimension values can be used in the GetReservationUtilization
operation. If the context is set to COST_AND_USAGE
, the resulting dimension values can be used in the GetCostAndUsage
operation.
If you set the context to COST_AND_USAGE
, you can use the following dimensions for searching:
-
AZ - The Availability Zone. An example is
us-east-1a
. -
BILLING_ENTITY - The Amazon Web Services seller that your account is with. Possible values are the following:
- Amazon Web Services(Amazon Web Services): The entity that sells Amazon Web Services services.
- AISPL (Amazon Internet Services Pvt. Ltd.): The local Indian entity that's an acting reseller for Amazon Web Services services in India.
- Amazon Web Services Marketplace: The entity that supports the sale of solutions that are built on Amazon Web Services by third-party software providers.
-
CACHE_ENGINE - The Amazon ElastiCache operating system. Examples are Windows or Linux.
-
DEPLOYMENT_OPTION - The scope of Amazon Relational Database Service deployments. Valid values are
SingleAZ
andMultiAZ
. -
DATABASE_ENGINE - The Amazon Relational Database Service database. Examples are Aurora or MySQL.
-
INSTANCE_TYPE - The type of Amazon EC2 instance. An example is
m4.xlarge
. -
INSTANCE_TYPE_FAMILY - A family of instance types optimized to fit different use cases. Examples are
Compute Optimized
(for example,C4
,C5
,C6g
, andC7g
),Memory Optimization
(for example,R4
,R5n
,R5b
, andR6g
). -
INVOICING_ENTITY - The name of the entity that issues the Amazon Web Services invoice.
-
LEGAL_ENTITY_NAME - The name of the organization that sells you Amazon Web Services services, such as Amazon Web Services.
-
LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the Amazon Web Services ID of the member account.
-
OPERATING_SYSTEM - The operating system. Examples are Windows or Linux.
-
OPERATION - The action performed. Examples include
RunInstance
andCreateBucket
. -
PLATFORM - The Amazon EC2 operating system. Examples are Windows or Linux.
-
PURCHASE_TYPE - The reservation type of the purchase that this usage is related to. Examples include On-Demand Instances and Standard Reserved Instances.
-
RESERVATION_ID - The unique identifier for an Amazon Web Services Reservation Instance.
-
SAVINGS_PLAN_ARN - The unique identifier for your Savings Plans.
-
SAVINGS_PLANS_TYPE - Type of Savings Plans (EC2 Instance or Compute).
-
SERVICE - The Amazon Web Services service such as Amazon DynamoDB.
-
TENANCY - The tenancy of a resource. Examples are shared or dedicated.
-
USAGE_TYPE - The type of usage. An example is DataTransfer-In-Bytes. The response for the
GetDimensionValues
operation includes a unit attribute. Examples include GB and Hrs. -
USAGE_TYPE_GROUP - The grouping of common usage types. An example is Amazon EC2: CloudWatch – Alarms. The response for this operation includes a unit attribute.
-
REGION - The Amazon Web Services Region.
-
RECORD_TYPE - The different types of charges such as Reserved Instance (RI) fees, usage costs, tax refunds, and credits.
-
RESOURCE_ID - The unique identifier of the resource. ResourceId is an opt-in feature only available for last 14 days for EC2-Compute Service.
If you set the context to RESERVATIONS
, you can use the following dimensions for searching:
-
AZ - The Availability Zone. An example is
us-east-1a
. -
CACHE_ENGINE - The Amazon ElastiCache operating system. Examples are Windows or Linux.
-
DEPLOYMENT_OPTION - The scope of Amazon Relational Database Service deployments. Valid values are
SingleAZ
andMultiAZ
. -
INSTANCE_TYPE - The type of Amazon EC2 instance. An example is
m4.xlarge
. -
LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the Amazon Web Services ID of the member account.
-
PLATFORM - The Amazon EC2 operating system. Examples are Windows or Linux.
-
REGION - The Amazon Web Services Region.
-
SCOPE (Utilization only) - The scope of a Reserved Instance (RI). Values are regional or a single Availability Zone.
-
TAG (Coverage only) - The tags that are associated with a Reserved Instance (RI).
-
TENANCY - The tenancy of a resource. Examples are shared or dedicated.
If you set the context to SAVINGS_PLANS
, you can use the following dimensions for searching:
-
SAVINGS_PLANS_TYPE - Type of Savings Plans (EC2 Instance or Compute)
-
PAYMENT_OPTION - The payment option for the given Savings Plans (for example, All Upfront)
-
REGION - The Amazon Web Services Region.
-
INSTANCE_TYPE_FAMILY - The family of instances (For example,
m5
) -
LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the Amazon Web Services ID of the member account.
-
SAVINGS_PLAN_ARN - The unique identifier for your Savings Plans.
Sourcepub fn filter(self, input: Expression) -> Self
pub fn filter(self, input: Expression) -> Self
Use Expression
to filter in various Cost Explorer APIs.
Not all Expression
types are supported in each API. Refer to the documentation for each specific API to see what is supported.
There are two patterns:
-
Simple dimension values.
-
There are three types of simple dimension values:
CostCategories
,Tags
, andDimensions
.-
Specify the
CostCategories
field to define a filter that acts on Cost Categories. -
Specify the
Tags
field to define a filter that acts on Cost Allocation Tags. -
Specify the
Dimensions
field to define a filter that acts on theDimensionValues
.
-
-
For each filter type, you can set the dimension name and values for the filters that you plan to use.
-
For example, you can filter for
REGION==us-east-1 OR REGION==us-west-1
. ForGetRightsizingRecommendation
, the Region is a full name (for example,REGION==US East (N. Virginia)
. -
The corresponding
Expression
for this example is as follows:{ "Dimensions": { "Key": "REGION", "Values": \[ "us-east-1", "us-west-1" \] } }
-
As shown in the previous example, lists of dimension values are combined with
OR
when applying the filter.
-
-
You can also set different match options to further control how the filter behaves. Not all APIs support match options. Refer to the documentation for each specific API to see what is supported.
-
For example, you can filter for linked account names that start with "a".
-
The corresponding
Expression
for this example is as follows:{ "Dimensions": { "Key": "LINKED_ACCOUNT_NAME", "MatchOptions": \[ "STARTS_WITH" \], "Values": \[ "a" \] } }
-
-
-
Compound
Expression
types with logical operations.-
You can use multiple
Expression
types and the logical operatorsAND/OR/NOT
to create a list of one or moreExpression
objects. By doing this, you can filter by more advanced options. -
For example, you can filter by
((REGION == us-east-1 OR REGION == us-west-1) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer)
. -
The corresponding
Expression
for this example is as follows:{ "And": \[ {"Or": \[ {"Dimensions": { "Key": "REGION", "Values": \[ "us-east-1", "us-west-1" \] }}, {"Tags": { "Key": "TagName", "Values": \["Value1"\] } } \]}, {"Not": {"Dimensions": { "Key": "USAGE_TYPE", "Values": \["DataTransfer"\] }}} \] }
Because each
Expression
can have only one operator, the service returns an error if more than one is specified. The following example shows anExpression
object that creates an error:{ "And": \[ ... \], "Dimensions": { "Key": "USAGE_TYPE", "Values": \[ "DataTransfer" \] } }
The following is an example of the corresponding error message:
"Expression has more than one roots. Only one root operator is allowed for each expression: And, Or, Not, Dimensions, Tags, CostCategories"
-
For the GetRightsizingRecommendation
action, a combination of OR and NOT isn't supported. OR isn't supported between different dimensions, or dimensions and tags. NOT operators aren't supported. Dimensions are also limited to LINKED_ACCOUNT
, REGION
, or RIGHTSIZING_TYPE
.
For the GetReservationPurchaseRecommendation
action, only NOT is supported. AND and OR aren't supported. Dimensions are limited to LINKED_ACCOUNT
.
Sourcepub fn set_filter(self, input: Option<Expression>) -> Self
pub fn set_filter(self, input: Option<Expression>) -> Self
Use Expression
to filter in various Cost Explorer APIs.
Not all Expression
types are supported in each API. Refer to the documentation for each specific API to see what is supported.
There are two patterns:
-
Simple dimension values.
-
There are three types of simple dimension values:
CostCategories
,Tags
, andDimensions
.-
Specify the
CostCategories
field to define a filter that acts on Cost Categories. -
Specify the
Tags
field to define a filter that acts on Cost Allocation Tags. -
Specify the
Dimensions
field to define a filter that acts on theDimensionValues
.
-
-
For each filter type, you can set the dimension name and values for the filters that you plan to use.
-
For example, you can filter for
REGION==us-east-1 OR REGION==us-west-1
. ForGetRightsizingRecommendation
, the Region is a full name (for example,REGION==US East (N. Virginia)
. -
The corresponding
Expression
for this example is as follows:{ "Dimensions": { "Key": "REGION", "Values": \[ "us-east-1", "us-west-1" \] } }
-
As shown in the previous example, lists of dimension values are combined with
OR
when applying the filter.
-
-
You can also set different match options to further control how the filter behaves. Not all APIs support match options. Refer to the documentation for each specific API to see what is supported.
-
For example, you can filter for linked account names that start with "a".
-
The corresponding
Expression
for this example is as follows:{ "Dimensions": { "Key": "LINKED_ACCOUNT_NAME", "MatchOptions": \[ "STARTS_WITH" \], "Values": \[ "a" \] } }
-
-
-
Compound
Expression
types with logical operations.-
You can use multiple
Expression
types and the logical operatorsAND/OR/NOT
to create a list of one or moreExpression
objects. By doing this, you can filter by more advanced options. -
For example, you can filter by
((REGION == us-east-1 OR REGION == us-west-1) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer)
. -
The corresponding
Expression
for this example is as follows:{ "And": \[ {"Or": \[ {"Dimensions": { "Key": "REGION", "Values": \[ "us-east-1", "us-west-1" \] }}, {"Tags": { "Key": "TagName", "Values": \["Value1"\] } } \]}, {"Not": {"Dimensions": { "Key": "USAGE_TYPE", "Values": \["DataTransfer"\] }}} \] }
Because each
Expression
can have only one operator, the service returns an error if more than one is specified. The following example shows anExpression
object that creates an error:{ "And": \[ ... \], "Dimensions": { "Key": "USAGE_TYPE", "Values": \[ "DataTransfer" \] } }
The following is an example of the corresponding error message:
"Expression has more than one roots. Only one root operator is allowed for each expression: And, Or, Not, Dimensions, Tags, CostCategories"
-
For the GetRightsizingRecommendation
action, a combination of OR and NOT isn't supported. OR isn't supported between different dimensions, or dimensions and tags. NOT operators aren't supported. Dimensions are also limited to LINKED_ACCOUNT
, REGION
, or RIGHTSIZING_TYPE
.
For the GetReservationPurchaseRecommendation
action, only NOT is supported. AND and OR aren't supported. Dimensions are limited to LINKED_ACCOUNT
.
Sourcepub fn get_filter(&self) -> &Option<Expression>
pub fn get_filter(&self) -> &Option<Expression>
Use Expression
to filter in various Cost Explorer APIs.
Not all Expression
types are supported in each API. Refer to the documentation for each specific API to see what is supported.
There are two patterns:
-
Simple dimension values.
-
There are three types of simple dimension values:
CostCategories
,Tags
, andDimensions
.-
Specify the
CostCategories
field to define a filter that acts on Cost Categories. -
Specify the
Tags
field to define a filter that acts on Cost Allocation Tags. -
Specify the
Dimensions
field to define a filter that acts on theDimensionValues
.
-
-
For each filter type, you can set the dimension name and values for the filters that you plan to use.
-
For example, you can filter for
REGION==us-east-1 OR REGION==us-west-1
. ForGetRightsizingRecommendation
, the Region is a full name (for example,REGION==US East (N. Virginia)
. -
The corresponding
Expression
for this example is as follows:{ "Dimensions": { "Key": "REGION", "Values": \[ "us-east-1", "us-west-1" \] } }
-
As shown in the previous example, lists of dimension values are combined with
OR
when applying the filter.
-
-
You can also set different match options to further control how the filter behaves. Not all APIs support match options. Refer to the documentation for each specific API to see what is supported.
-
For example, you can filter for linked account names that start with "a".
-
The corresponding
Expression
for this example is as follows:{ "Dimensions": { "Key": "LINKED_ACCOUNT_NAME", "MatchOptions": \[ "STARTS_WITH" \], "Values": \[ "a" \] } }
-
-
-
Compound
Expression
types with logical operations.-
You can use multiple
Expression
types and the logical operatorsAND/OR/NOT
to create a list of one or moreExpression
objects. By doing this, you can filter by more advanced options. -
For example, you can filter by
((REGION == us-east-1 OR REGION == us-west-1) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer)
. -
The corresponding
Expression
for this example is as follows:{ "And": \[ {"Or": \[ {"Dimensions": { "Key": "REGION", "Values": \[ "us-east-1", "us-west-1" \] }}, {"Tags": { "Key": "TagName", "Values": \["Value1"\] } } \]}, {"Not": {"Dimensions": { "Key": "USAGE_TYPE", "Values": \["DataTransfer"\] }}} \] }
Because each
Expression
can have only one operator, the service returns an error if more than one is specified. The following example shows anExpression
object that creates an error:{ "And": \[ ... \], "Dimensions": { "Key": "USAGE_TYPE", "Values": \[ "DataTransfer" \] } }
The following is an example of the corresponding error message:
"Expression has more than one roots. Only one root operator is allowed for each expression: And, Or, Not, Dimensions, Tags, CostCategories"
-
For the GetRightsizingRecommendation
action, a combination of OR and NOT isn't supported. OR isn't supported between different dimensions, or dimensions and tags. NOT operators aren't supported. Dimensions are also limited to LINKED_ACCOUNT
, REGION
, or RIGHTSIZING_TYPE
.
For the GetReservationPurchaseRecommendation
action, only NOT is supported. AND and OR aren't supported. Dimensions are limited to LINKED_ACCOUNT
.
Sourcepub fn sort_by(self, input: SortDefinition) -> Self
pub fn sort_by(self, input: SortDefinition) -> Self
Appends an item to sort_by
.
To override the contents of this collection use set_sort_by
.
The value that you want to sort the data by.
The key represents cost and usage metrics. The following values are supported:
-
BlendedCost
-
UnblendedCost
-
AmortizedCost
-
NetAmortizedCost
-
NetUnblendedCost
-
UsageQuantity
-
NormalizedUsageAmount
The supported values for the SortOrder
key are ASCENDING
or DESCENDING
.
When you specify a SortBy
paramater, the context must be COST_AND_USAGE
. Further, when using SortBy
, NextPageToken
and SearchString
aren't supported.
Sourcepub fn set_sort_by(self, input: Option<Vec<SortDefinition>>) -> Self
pub fn set_sort_by(self, input: Option<Vec<SortDefinition>>) -> Self
The value that you want to sort the data by.
The key represents cost and usage metrics. The following values are supported:
-
BlendedCost
-
UnblendedCost
-
AmortizedCost
-
NetAmortizedCost
-
NetUnblendedCost
-
UsageQuantity
-
NormalizedUsageAmount
The supported values for the SortOrder
key are ASCENDING
or DESCENDING
.
When you specify a SortBy
paramater, the context must be COST_AND_USAGE
. Further, when using SortBy
, NextPageToken
and SearchString
aren't supported.
Sourcepub fn get_sort_by(&self) -> &Option<Vec<SortDefinition>>
pub fn get_sort_by(&self) -> &Option<Vec<SortDefinition>>
The value that you want to sort the data by.
The key represents cost and usage metrics. The following values are supported:
-
BlendedCost
-
UnblendedCost
-
AmortizedCost
-
NetAmortizedCost
-
NetUnblendedCost
-
UsageQuantity
-
NormalizedUsageAmount
The supported values for the SortOrder
key are ASCENDING
or DESCENDING
.
When you specify a SortBy
paramater, the context must be COST_AND_USAGE
. Further, when using SortBy
, NextPageToken
and SearchString
aren't supported.
Sourcepub fn billing_view_arn(self, input: impl Into<String>) -> Self
pub fn billing_view_arn(self, input: impl Into<String>) -> Self
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.
Sourcepub fn set_billing_view_arn(self, input: Option<String>) -> Self
pub fn set_billing_view_arn(self, input: Option<String>) -> Self
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.
Sourcepub fn get_billing_view_arn(&self) -> &Option<String>
pub fn get_billing_view_arn(&self) -> &Option<String>
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.
Sourcepub fn max_results(self, input: i32) -> Self
pub fn max_results(self, input: i32) -> Self
This field is only used when SortBy is provided in the request. The maximum number of objects that are returned for this request. If MaxResults isn't specified with SortBy, the request returns 1000 results as the default value for this parameter.
For GetDimensionValues
, MaxResults has an upper limit of 1000.
Sourcepub fn set_max_results(self, input: Option<i32>) -> Self
pub fn set_max_results(self, input: Option<i32>) -> Self
This field is only used when SortBy is provided in the request. The maximum number of objects that are returned for this request. If MaxResults isn't specified with SortBy, the request returns 1000 results as the default value for this parameter.
For GetDimensionValues
, MaxResults has an upper limit of 1000.
Sourcepub fn get_max_results(&self) -> &Option<i32>
pub fn get_max_results(&self) -> &Option<i32>
This field is only used when SortBy is provided in the request. The maximum number of objects that are returned for this request. If MaxResults isn't specified with SortBy, the request returns 1000 results as the default value for this parameter.
For GetDimensionValues
, MaxResults has an upper limit of 1000.
Sourcepub fn next_page_token(self, input: impl Into<String>) -> Self
pub fn next_page_token(self, input: impl Into<String>) -> Self
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.
Sourcepub fn set_next_page_token(self, input: Option<String>) -> Self
pub fn set_next_page_token(self, input: Option<String>) -> Self
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.
Sourcepub fn get_next_page_token(&self) -> &Option<String>
pub fn get_next_page_token(&self) -> &Option<String>
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.
Sourcepub fn build(self) -> Result<GetDimensionValuesInput, BuildError>
pub fn build(self) -> Result<GetDimensionValuesInput, BuildError>
Consumes the builder and constructs a GetDimensionValuesInput
.
Source§impl GetDimensionValuesInputBuilder
impl GetDimensionValuesInputBuilder
Sourcepub async fn send_with(
self,
client: &Client,
) -> Result<GetDimensionValuesOutput, SdkError<GetDimensionValuesError, HttpResponse>>
pub async fn send_with( self, client: &Client, ) -> Result<GetDimensionValuesOutput, SdkError<GetDimensionValuesError, HttpResponse>>
Sends a request with this input using the given client.
Trait Implementations§
Source§impl Clone for GetDimensionValuesInputBuilder
impl Clone for GetDimensionValuesInputBuilder
Source§fn clone(&self) -> GetDimensionValuesInputBuilder
fn clone(&self) -> GetDimensionValuesInputBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Default for GetDimensionValuesInputBuilder
impl Default for GetDimensionValuesInputBuilder
Source§fn default() -> GetDimensionValuesInputBuilder
fn default() -> GetDimensionValuesInputBuilder
Source§impl PartialEq for GetDimensionValuesInputBuilder
impl PartialEq for GetDimensionValuesInputBuilder
Source§fn eq(&self, other: &GetDimensionValuesInputBuilder) -> bool
fn eq(&self, other: &GetDimensionValuesInputBuilder) -> bool
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for GetDimensionValuesInputBuilder
Auto Trait Implementations§
impl Freeze for GetDimensionValuesInputBuilder
impl RefUnwindSafe for GetDimensionValuesInputBuilder
impl Send for GetDimensionValuesInputBuilder
impl Sync for GetDimensionValuesInputBuilder
impl Unpin for GetDimensionValuesInputBuilder
impl UnwindSafe for GetDimensionValuesInputBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightBlack
.
§Example
println!("{}", value.bright_black());
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightGreen
.
§Example
println!("{}", value.bright_green());
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightYellow
.
§Example
println!("{}", value.bright_yellow());
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightMagenta
.
§Example
println!("{}", value.bright_magenta());
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightWhite
.
§Example
println!("{}", value.bright_white());
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightBlack
.
§Example
println!("{}", value.on_bright_black());
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightGreen
.
§Example
println!("{}", value.on_bright_green());
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightYellow
.
§Example
println!("{}", value.on_bright_yellow());
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightBlue
.
§Example
println!("{}", value.on_bright_blue());
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightMagenta
.
§Example
println!("{}", value.on_bright_magenta());
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightCyan
.
§Example
println!("{}", value.on_bright_cyan());
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightWhite
.
§Example
println!("{}", value.on_bright_white());
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn underline(&self) -> Painted<&T>
fn underline(&self) -> Painted<&T>
Returns self
with the
attr()
set to
Attribute::Underline
.
§Example
println!("{}", value.underline());
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Returns self
with the
attr()
set to
Attribute::RapidBlink
.
§Example
println!("{}", value.rapid_blink());
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);