aws_sdk_computeoptimizer/operation/get_recommendation_summaries/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_recommendation_summaries::_get_recommendation_summaries_output::GetRecommendationSummariesOutputBuilder;
3
4pub use crate::operation::get_recommendation_summaries::_get_recommendation_summaries_input::GetRecommendationSummariesInputBuilder;
5
6impl crate::operation::get_recommendation_summaries::builders::GetRecommendationSummariesInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::get_recommendation_summaries::GetRecommendationSummariesOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_recommendation_summaries::GetRecommendationSummariesError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_recommendation_summaries();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetRecommendationSummaries`.
24///
25/// <p>Returns the optimization findings for an account.</p>
26/// <p>It returns the number of:</p>
27/// <ul>
28/// <li>
29/// <p>Amazon EC2 instances in an account that are <code>Underprovisioned</code>, <code>Overprovisioned</code>, or <code>Optimized</code>.</p></li>
30/// <li>
31/// <p>EC2Auto Scaling groups in an account that are <code>NotOptimized</code>, or <code>Optimized</code>.</p></li>
32/// <li>
33/// <p>Amazon EBS volumes in an account that are <code>NotOptimized</code>, or <code>Optimized</code>.</p></li>
34/// <li>
35/// <p>Lambda functions in an account that are <code>NotOptimized</code>, or <code>Optimized</code>.</p></li>
36/// <li>
37/// <p>Amazon ECS services in an account that are <code>Underprovisioned</code>, <code>Overprovisioned</code>, or <code>Optimized</code>.</p></li>
38/// <li>
39/// <p>Commercial software licenses in an account that are <code>InsufficientMetrics</code>, <code>NotOptimized</code> or <code>Optimized</code>.</p></li>
40/// <li>
41/// <p>Amazon Aurora and Amazon RDS databases in an account that are <code>Underprovisioned</code>, <code>Overprovisioned</code>, <code>Optimized</code>, or <code>NotOptimized</code>.</p></li>
42/// </ul>
43#[derive(::std::clone::Clone, ::std::fmt::Debug)]
44pub struct GetRecommendationSummariesFluentBuilder {
45    handle: ::std::sync::Arc<crate::client::Handle>,
46    inner: crate::operation::get_recommendation_summaries::builders::GetRecommendationSummariesInputBuilder,
47    config_override: ::std::option::Option<crate::config::Builder>,
48}
49impl
50    crate::client::customize::internal::CustomizableSend<
51        crate::operation::get_recommendation_summaries::GetRecommendationSummariesOutput,
52        crate::operation::get_recommendation_summaries::GetRecommendationSummariesError,
53    > for GetRecommendationSummariesFluentBuilder
54{
55    fn send(
56        self,
57        config_override: crate::config::Builder,
58    ) -> crate::client::customize::internal::BoxFuture<
59        crate::client::customize::internal::SendResult<
60            crate::operation::get_recommendation_summaries::GetRecommendationSummariesOutput,
61            crate::operation::get_recommendation_summaries::GetRecommendationSummariesError,
62        >,
63    > {
64        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
65    }
66}
67impl GetRecommendationSummariesFluentBuilder {
68    /// Creates a new `GetRecommendationSummariesFluentBuilder`.
69    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
70        Self {
71            handle,
72            inner: ::std::default::Default::default(),
73            config_override: ::std::option::Option::None,
74        }
75    }
76    /// Access the GetRecommendationSummaries as a reference.
77    pub fn as_input(&self) -> &crate::operation::get_recommendation_summaries::builders::GetRecommendationSummariesInputBuilder {
78        &self.inner
79    }
80    /// Sends the request and returns the response.
81    ///
82    /// If an error occurs, an `SdkError` will be returned with additional details that
83    /// can be matched against.
84    ///
85    /// By default, any retryable failures will be retried twice. Retry behavior
86    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
87    /// set when configuring the client.
88    pub async fn send(
89        self,
90    ) -> ::std::result::Result<
91        crate::operation::get_recommendation_summaries::GetRecommendationSummariesOutput,
92        ::aws_smithy_runtime_api::client::result::SdkError<
93            crate::operation::get_recommendation_summaries::GetRecommendationSummariesError,
94            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
95        >,
96    > {
97        let input = self
98            .inner
99            .build()
100            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
101        let runtime_plugins = crate::operation::get_recommendation_summaries::GetRecommendationSummaries::operation_runtime_plugins(
102            self.handle.runtime_plugins.clone(),
103            &self.handle.conf,
104            self.config_override,
105        );
106        crate::operation::get_recommendation_summaries::GetRecommendationSummaries::orchestrate(&runtime_plugins, input).await
107    }
108
109    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
110    pub fn customize(
111        self,
112    ) -> crate::client::customize::CustomizableOperation<
113        crate::operation::get_recommendation_summaries::GetRecommendationSummariesOutput,
114        crate::operation::get_recommendation_summaries::GetRecommendationSummariesError,
115        Self,
116    > {
117        crate::client::customize::CustomizableOperation::new(self)
118    }
119    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
120        self.set_config_override(::std::option::Option::Some(config_override.into()));
121        self
122    }
123
124    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
125        self.config_override = config_override;
126        self
127    }
128    /// Create a paginator for this request
129    ///
130    /// Paginators are used by calling [`send().await`](crate::operation::get_recommendation_summaries::paginator::GetRecommendationSummariesPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
131    pub fn into_paginator(self) -> crate::operation::get_recommendation_summaries::paginator::GetRecommendationSummariesPaginator {
132        crate::operation::get_recommendation_summaries::paginator::GetRecommendationSummariesPaginator::new(self.handle, self.inner)
133    }
134    ///
135    /// Appends an item to `accountIds`.
136    ///
137    /// To override the contents of this collection use [`set_account_ids`](Self::set_account_ids).
138    ///
139    /// <p>The ID of the Amazon Web Services account for which to return recommendation summaries.</p>
140    /// <p>If your account is the management account of an organization, use this parameter to specify the member account for which you want to return recommendation summaries.</p>
141    /// <p>Only one account ID can be specified per request.</p>
142    pub fn account_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143        self.inner = self.inner.account_ids(input.into());
144        self
145    }
146    /// <p>The ID of the Amazon Web Services account for which to return recommendation summaries.</p>
147    /// <p>If your account is the management account of an organization, use this parameter to specify the member account for which you want to return recommendation summaries.</p>
148    /// <p>Only one account ID can be specified per request.</p>
149    pub fn set_account_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
150        self.inner = self.inner.set_account_ids(input);
151        self
152    }
153    /// <p>The ID of the Amazon Web Services account for which to return recommendation summaries.</p>
154    /// <p>If your account is the management account of an organization, use this parameter to specify the member account for which you want to return recommendation summaries.</p>
155    /// <p>Only one account ID can be specified per request.</p>
156    pub fn get_account_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
157        self.inner.get_account_ids()
158    }
159    /// <p>The token to advance to the next page of recommendation summaries.</p>
160    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
161        self.inner = self.inner.next_token(input.into());
162        self
163    }
164    /// <p>The token to advance to the next page of recommendation summaries.</p>
165    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
166        self.inner = self.inner.set_next_token(input);
167        self
168    }
169    /// <p>The token to advance to the next page of recommendation summaries.</p>
170    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
171        self.inner.get_next_token()
172    }
173    /// <p>The maximum number of recommendation summaries to return with a single request.</p>
174    /// <p>To retrieve the remaining results, make another request with the returned <code>nextToken</code> value.</p>
175    pub fn max_results(mut self, input: i32) -> Self {
176        self.inner = self.inner.max_results(input);
177        self
178    }
179    /// <p>The maximum number of recommendation summaries to return with a single request.</p>
180    /// <p>To retrieve the remaining results, make another request with the returned <code>nextToken</code> value.</p>
181    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
182        self.inner = self.inner.set_max_results(input);
183        self
184    }
185    /// <p>The maximum number of recommendation summaries to return with a single request.</p>
186    /// <p>To retrieve the remaining results, make another request with the returned <code>nextToken</code> value.</p>
187    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
188        self.inner.get_max_results()
189    }
190}