aws_sdk_codeguruprofiler/operation/get_recommendations/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_recommendations::_get_recommendations_output::GetRecommendationsOutputBuilder;
3
4pub use crate::operation::get_recommendations::_get_recommendations_input::GetRecommendationsInputBuilder;
5
6impl crate::operation::get_recommendations::builders::GetRecommendationsInputBuilder {
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_recommendations::GetRecommendationsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_recommendations::GetRecommendationsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_recommendations();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetRecommendations`.
24///
25/// <p>Returns a list of <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_Recommendation.html"> <code>Recommendation</code> </a> objects that contain recommendations for a profiling group for a given time period. A list of <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_Anomaly.html"> <code>Anomaly</code> </a> objects that contains details about anomalies detected in the profiling group for the same time period is also returned.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct GetRecommendationsFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::get_recommendations::builders::GetRecommendationsInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::get_recommendations::GetRecommendationsOutput,
35        crate::operation::get_recommendations::GetRecommendationsError,
36    > for GetRecommendationsFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::get_recommendations::GetRecommendationsOutput,
44            crate::operation::get_recommendations::GetRecommendationsError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl GetRecommendationsFluentBuilder {
51    /// Creates a new `GetRecommendationsFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the GetRecommendations as a reference.
60    pub fn as_input(&self) -> &crate::operation::get_recommendations::builders::GetRecommendationsInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::get_recommendations::GetRecommendationsOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::get_recommendations::GetRecommendationsError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::get_recommendations::GetRecommendations::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::get_recommendations::GetRecommendations::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::get_recommendations::GetRecommendationsOutput,
97        crate::operation::get_recommendations::GetRecommendationsError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The name of the profiling group to get analysis data about.</p>
112    pub fn profiling_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.profiling_group_name(input.into());
114        self
115    }
116    /// <p>The name of the profiling group to get analysis data about.</p>
117    pub fn set_profiling_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_profiling_group_name(input);
119        self
120    }
121    /// <p>The name of the profiling group to get analysis data about.</p>
122    pub fn get_profiling_group_name(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_profiling_group_name()
124    }
125    /// <p>The end time of the profile to get analysis data about. You must specify <code>startTime</code> and <code>endTime</code>. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
126    pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
127        self.inner = self.inner.start_time(input);
128        self
129    }
130    /// <p>The end time of the profile to get analysis data about. You must specify <code>startTime</code> and <code>endTime</code>. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
131    pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
132        self.inner = self.inner.set_start_time(input);
133        self
134    }
135    /// <p>The end time of the profile to get analysis data about. You must specify <code>startTime</code> and <code>endTime</code>. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
136    pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
137        self.inner.get_start_time()
138    }
139    /// <p>The start time of the profile to get analysis data about. You must specify <code>startTime</code> and <code>endTime</code>. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
140    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
141        self.inner = self.inner.end_time(input);
142        self
143    }
144    /// <p>The start time of the profile to get analysis data about. You must specify <code>startTime</code> and <code>endTime</code>. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
145    pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
146        self.inner = self.inner.set_end_time(input);
147        self
148    }
149    /// <p>The start time of the profile to get analysis data about. You must specify <code>startTime</code> and <code>endTime</code>. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
150    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
151        self.inner.get_end_time()
152    }
153    /// <p>The language used to provide analysis. Specify using a string that is one of the following <code>BCP 47</code> language codes.</p>
154    /// <ul>
155    /// <li>
156    /// <p><code>de-DE</code> - German, Germany</p></li>
157    /// <li>
158    /// <p><code>en-GB</code> - English, United Kingdom</p></li>
159    /// <li>
160    /// <p><code>en-US</code> - English, United States</p></li>
161    /// <li>
162    /// <p><code>es-ES</code> - Spanish, Spain</p></li>
163    /// <li>
164    /// <p><code>fr-FR</code> - French, France</p></li>
165    /// <li>
166    /// <p><code>it-IT</code> - Italian, Italy</p></li>
167    /// <li>
168    /// <p><code>ja-JP</code> - Japanese, Japan</p></li>
169    /// <li>
170    /// <p><code>ko-KR</code> - Korean, Republic of Korea</p></li>
171    /// <li>
172    /// <p><code>pt-BR</code> - Portugese, Brazil</p></li>
173    /// <li>
174    /// <p><code>zh-CN</code> - Chinese, China</p></li>
175    /// <li>
176    /// <p><code>zh-TW</code> - Chinese, Taiwan</p></li>
177    /// </ul>
178    pub fn locale(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
179        self.inner = self.inner.locale(input.into());
180        self
181    }
182    /// <p>The language used to provide analysis. Specify using a string that is one of the following <code>BCP 47</code> language codes.</p>
183    /// <ul>
184    /// <li>
185    /// <p><code>de-DE</code> - German, Germany</p></li>
186    /// <li>
187    /// <p><code>en-GB</code> - English, United Kingdom</p></li>
188    /// <li>
189    /// <p><code>en-US</code> - English, United States</p></li>
190    /// <li>
191    /// <p><code>es-ES</code> - Spanish, Spain</p></li>
192    /// <li>
193    /// <p><code>fr-FR</code> - French, France</p></li>
194    /// <li>
195    /// <p><code>it-IT</code> - Italian, Italy</p></li>
196    /// <li>
197    /// <p><code>ja-JP</code> - Japanese, Japan</p></li>
198    /// <li>
199    /// <p><code>ko-KR</code> - Korean, Republic of Korea</p></li>
200    /// <li>
201    /// <p><code>pt-BR</code> - Portugese, Brazil</p></li>
202    /// <li>
203    /// <p><code>zh-CN</code> - Chinese, China</p></li>
204    /// <li>
205    /// <p><code>zh-TW</code> - Chinese, Taiwan</p></li>
206    /// </ul>
207    pub fn set_locale(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
208        self.inner = self.inner.set_locale(input);
209        self
210    }
211    /// <p>The language used to provide analysis. Specify using a string that is one of the following <code>BCP 47</code> language codes.</p>
212    /// <ul>
213    /// <li>
214    /// <p><code>de-DE</code> - German, Germany</p></li>
215    /// <li>
216    /// <p><code>en-GB</code> - English, United Kingdom</p></li>
217    /// <li>
218    /// <p><code>en-US</code> - English, United States</p></li>
219    /// <li>
220    /// <p><code>es-ES</code> - Spanish, Spain</p></li>
221    /// <li>
222    /// <p><code>fr-FR</code> - French, France</p></li>
223    /// <li>
224    /// <p><code>it-IT</code> - Italian, Italy</p></li>
225    /// <li>
226    /// <p><code>ja-JP</code> - Japanese, Japan</p></li>
227    /// <li>
228    /// <p><code>ko-KR</code> - Korean, Republic of Korea</p></li>
229    /// <li>
230    /// <p><code>pt-BR</code> - Portugese, Brazil</p></li>
231    /// <li>
232    /// <p><code>zh-CN</code> - Chinese, China</p></li>
233    /// <li>
234    /// <p><code>zh-TW</code> - Chinese, Taiwan</p></li>
235    /// </ul>
236    pub fn get_locale(&self) -> &::std::option::Option<::std::string::String> {
237        self.inner.get_locale()
238    }
239}