aws_sdk_costexplorer/client/get_rightsizing_recommendation.rs
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
impl super::Client {
/// Constructs a fluent builder for the [`GetRightsizingRecommendation`](crate::operation::get_rightsizing_recommendation::builders::GetRightsizingRecommendationFluentBuilder) operation.
///
/// - The fluent builder is configurable:
/// - [`filter(Expression)`](crate::operation::get_rightsizing_recommendation::builders::GetRightsizingRecommendationFluentBuilder::filter) / [`set_filter(Option<Expression>)`](crate::operation::get_rightsizing_recommendation::builders::GetRightsizingRecommendationFluentBuilder::set_filter):<br>required: **false**<br><p>Use <code>Expression</code> to filter in various Cost Explorer APIs.</p> <p>Not all <code>Expression</code> types are supported in each API. Refer to the documentation for each specific API to see what is supported.</p> <p>There are two patterns:</p> <ul> <li> <p>Simple dimension values.</p> <ul> <li> <p>There are three types of simple dimension values: <code>CostCategories</code>, <code>Tags</code>, and <code>Dimensions</code>.</p> <ul> <li> <p>Specify the <code>CostCategories</code> field to define a filter that acts on Cost Categories.</p></li> <li> <p>Specify the <code>Tags</code> field to define a filter that acts on Cost Allocation Tags.</p></li> <li> <p>Specify the <code>Dimensions</code> field to define a filter that acts on the <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_DimensionValues.html"> <code>DimensionValues</code> </a>.</p></li> </ul></li> <li> <p>For each filter type, you can set the dimension name and values for the filters that you plan to use.</p> <ul> <li> <p>For example, you can filter for <code>REGION==us-east-1 OR REGION==us-west-1</code>. For <code>GetRightsizingRecommendation</code>, the Region is a full name (for example, <code>REGION==US East (N. Virginia)</code>.</p></li> <li> <p>The corresponding <code>Expression</code> for this example is as follows: <code>{ "Dimensions": { "Key": "REGION", "Values": \[ "us-east-1", "us-west-1" \] } }</code></p></li> <li> <p>As shown in the previous example, lists of dimension values are combined with <code>OR</code> when applying the filter.</p></li> </ul></li> <li> <p>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.</p> <ul> <li> <p>For example, you can filter for linked account names that start with "a".</p></li> <li> <p>The corresponding <code>Expression</code> for this example is as follows: <code>{ "Dimensions": { "Key": "LINKED_ACCOUNT_NAME", "MatchOptions": \[ "STARTS_WITH" \], "Values": \[ "a" \] } }</code></p></li> </ul></li> </ul></li> <li> <p>Compound <code>Expression</code> types with logical operations.</p> <ul> <li> <p>You can use multiple <code>Expression</code> types and the logical operators <code>AND/OR/NOT</code> to create a list of one or more <code>Expression</code> objects. By doing this, you can filter by more advanced options.</p></li> <li> <p>For example, you can filter by <code>((REGION == us-east-1 OR REGION == us-west-1) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer)</code>.</p></li> <li> <p>The corresponding <code>Expression</code> for this example is as follows: <code>{ "And": \[ {"Or": \[ {"Dimensions": { "Key": "REGION", "Values": \[ "us-east-1", "us-west-1" \] }}, {"Tags": { "Key": "TagName", "Values": \["Value1"\] } } \]}, {"Not": {"Dimensions": { "Key": "USAGE_TYPE", "Values": \["DataTransfer"\] }}} \] }</code></p></li> </ul><note> <p>Because each <code>Expression</code> can have only one operator, the service returns an error if more than one is specified. The following example shows an <code>Expression</code> object that creates an error: <code>{ "And": \[ ... \], "Dimensions": { "Key": "USAGE_TYPE", "Values": \[ "DataTransfer" \] } }</code></p> <p>The following is an example of the corresponding error message: <code>"Expression has more than one roots. Only one root operator is allowed for each expression: And, Or, Not, Dimensions, Tags, CostCategories"</code></p> </note></li> </ul><note> <p>For the <code>GetRightsizingRecommendation</code> 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 <code>LINKED_ACCOUNT</code>, <code>REGION</code>, or <code>RIGHTSIZING_TYPE</code>.</p> <p>For the <code>GetReservationPurchaseRecommendation</code> action, only NOT is supported. AND and OR aren't supported. Dimensions are limited to <code>LINKED_ACCOUNT</code>.</p> </note><br>
/// - [`configuration(RightsizingRecommendationConfiguration)`](crate::operation::get_rightsizing_recommendation::builders::GetRightsizingRecommendationFluentBuilder::configuration) / [`set_configuration(Option<RightsizingRecommendationConfiguration>)`](crate::operation::get_rightsizing_recommendation::builders::GetRightsizingRecommendationFluentBuilder::set_configuration):<br>required: **false**<br><p>You can use Configuration to customize recommendations across two attributes. You can choose to view recommendations for instances within the same instance families or across different instance families. You can also choose to view your estimated savings that are associated with recommendations with consideration of existing Savings Plans or RI benefits, or neither.</p><br>
/// - [`service(impl Into<String>)`](crate::operation::get_rightsizing_recommendation::builders::GetRightsizingRecommendationFluentBuilder::service) / [`set_service(Option<String>)`](crate::operation::get_rightsizing_recommendation::builders::GetRightsizingRecommendationFluentBuilder::set_service):<br>required: **true**<br><p>The specific service that you want recommendations for. The only valid value for <code>GetRightsizingRecommendation</code> is "<code>AmazonEC2</code>".</p><br>
/// - [`page_size(i32)`](crate::operation::get_rightsizing_recommendation::builders::GetRightsizingRecommendationFluentBuilder::page_size) / [`set_page_size(Option<i32>)`](crate::operation::get_rightsizing_recommendation::builders::GetRightsizingRecommendationFluentBuilder::set_page_size):<br>required: **false**<br><p>The number of recommendations that you want returned in a single response object.</p><br>
/// - [`next_page_token(impl Into<String>)`](crate::operation::get_rightsizing_recommendation::builders::GetRightsizingRecommendationFluentBuilder::next_page_token) / [`set_next_page_token(Option<String>)`](crate::operation::get_rightsizing_recommendation::builders::GetRightsizingRecommendationFluentBuilder::set_next_page_token):<br>required: **false**<br><p>The pagination token that indicates the next set of results that you want to retrieve.</p><br>
/// - On success, responds with [`GetRightsizingRecommendationOutput`](crate::operation::get_rightsizing_recommendation::GetRightsizingRecommendationOutput) with field(s):
/// - [`metadata(Option<RightsizingRecommendationMetadata>)`](crate::operation::get_rightsizing_recommendation::GetRightsizingRecommendationOutput::metadata): <p>Information regarding this specific recommendation set.</p>
/// - [`summary(Option<RightsizingRecommendationSummary>)`](crate::operation::get_rightsizing_recommendation::GetRightsizingRecommendationOutput::summary): <p>Summary of this recommendation set.</p>
/// - [`rightsizing_recommendations(Option<Vec::<RightsizingRecommendation>>)`](crate::operation::get_rightsizing_recommendation::GetRightsizingRecommendationOutput::rightsizing_recommendations): <p>Recommendations to rightsize resources.</p>
/// - [`next_page_token(Option<String>)`](crate::operation::get_rightsizing_recommendation::GetRightsizingRecommendationOutput::next_page_token): <p>The token to retrieve the next set of results.</p>
/// - [`configuration(Option<RightsizingRecommendationConfiguration>)`](crate::operation::get_rightsizing_recommendation::GetRightsizingRecommendationOutput::configuration): <p>You can use Configuration to customize recommendations across two attributes. You can choose to view recommendations for instances within the same instance families or across different instance families. You can also choose to view your estimated savings that are associated with recommendations with consideration of existing Savings Plans or RI benefits, or neither.</p>
/// - On failure, responds with [`SdkError<GetRightsizingRecommendationError>`](crate::operation::get_rightsizing_recommendation::GetRightsizingRecommendationError)
pub fn get_rightsizing_recommendation(
&self,
) -> crate::operation::get_rightsizing_recommendation::builders::GetRightsizingRecommendationFluentBuilder {
crate::operation::get_rightsizing_recommendation::builders::GetRightsizingRecommendationFluentBuilder::new(self.handle.clone())
}
}