aws_sdk_codeguruprofiler/operation/get_profile/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_profile::_get_profile_output::GetProfileOutputBuilder;
3
4pub use crate::operation::get_profile::_get_profile_input::GetProfileInputBuilder;
5
6impl crate::operation::get_profile::builders::GetProfileInputBuilder {
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_profile::GetProfileOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_profile::GetProfileError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_profile();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetProfile`.
24///
25/// <p>Gets the aggregated profile of a profiling group for a specified time range. Amazon CodeGuru Profiler collects posted agent profiles for a profiling group into aggregated profiles.</p><note>
26/// <p>Because aggregated profiles expire over time <code>GetProfile</code> is not idempotent.</p>
27/// </note>
28/// <p>Specify the time range for the requested aggregated profile using 1 or 2 of the following parameters: <code>startTime</code>, <code>endTime</code>, <code>period</code>. The maximum time range allowed is 7 days. If you specify all 3 parameters, an exception is thrown. If you specify only <code>period</code>, the latest aggregated profile is returned.</p>
29/// <p>Aggregated profiles are available with aggregation periods of 5 minutes, 1 hour, and 1 day, aligned to UTC. The aggregation period of an aggregated profile determines how long it is retained. For more information, see <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_AggregatedProfileTime.html"> <code>AggregatedProfileTime</code> </a>. The aggregated profile's aggregation period determines how long it is retained by CodeGuru Profiler.</p>
30/// <ul>
31/// <li>
32/// <p>If the aggregation period is 5 minutes, the aggregated profile is retained for 15 days.</p></li>
33/// <li>
34/// <p>If the aggregation period is 1 hour, the aggregated profile is retained for 60 days.</p></li>
35/// <li>
36/// <p>If the aggregation period is 1 day, the aggregated profile is retained for 3 years.</p></li>
37/// </ul>
38/// <p>There are two use cases for calling <code>GetProfile</code>.</p>
39/// <ol>
40/// <li>
41/// <p>If you want to return an aggregated profile that already exists, use <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ListProfileTimes.html"> <code>ListProfileTimes</code> </a> to view the time ranges of existing aggregated profiles. Use them in a <code>GetProfile</code> request to return a specific, existing aggregated profile.</p></li>
42/// <li>
43/// <p>If you want to return an aggregated profile for a time range that doesn't align with an existing aggregated profile, then CodeGuru Profiler makes a best effort to combine existing aggregated profiles from the requested time range and return them as one aggregated profile.</p>
44/// <p>If aggregated profiles do not exist for the full time range requested, then aggregated profiles for a smaller time range are returned. For example, if the requested time range is from 00:00 to 00:20, and the existing aggregated profiles are from 00:15 and 00:25, then the aggregated profiles from 00:15 to 00:20 are returned.</p></li>
45/// </ol>
46#[derive(::std::clone::Clone, ::std::fmt::Debug)]
47pub struct GetProfileFluentBuilder {
48    handle: ::std::sync::Arc<crate::client::Handle>,
49    inner: crate::operation::get_profile::builders::GetProfileInputBuilder,
50    config_override: ::std::option::Option<crate::config::Builder>,
51}
52impl
53    crate::client::customize::internal::CustomizableSend<
54        crate::operation::get_profile::GetProfileOutput,
55        crate::operation::get_profile::GetProfileError,
56    > for GetProfileFluentBuilder
57{
58    fn send(
59        self,
60        config_override: crate::config::Builder,
61    ) -> crate::client::customize::internal::BoxFuture<
62        crate::client::customize::internal::SendResult<
63            crate::operation::get_profile::GetProfileOutput,
64            crate::operation::get_profile::GetProfileError,
65        >,
66    > {
67        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
68    }
69}
70impl GetProfileFluentBuilder {
71    /// Creates a new `GetProfileFluentBuilder`.
72    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
73        Self {
74            handle,
75            inner: ::std::default::Default::default(),
76            config_override: ::std::option::Option::None,
77        }
78    }
79    /// Access the GetProfile as a reference.
80    pub fn as_input(&self) -> &crate::operation::get_profile::builders::GetProfileInputBuilder {
81        &self.inner
82    }
83    /// Sends the request and returns the response.
84    ///
85    /// If an error occurs, an `SdkError` will be returned with additional details that
86    /// can be matched against.
87    ///
88    /// By default, any retryable failures will be retried twice. Retry behavior
89    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
90    /// set when configuring the client.
91    pub async fn send(
92        self,
93    ) -> ::std::result::Result<
94        crate::operation::get_profile::GetProfileOutput,
95        ::aws_smithy_runtime_api::client::result::SdkError<
96            crate::operation::get_profile::GetProfileError,
97            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
98        >,
99    > {
100        let input = self
101            .inner
102            .build()
103            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
104        let runtime_plugins = crate::operation::get_profile::GetProfile::operation_runtime_plugins(
105            self.handle.runtime_plugins.clone(),
106            &self.handle.conf,
107            self.config_override,
108        );
109        crate::operation::get_profile::GetProfile::orchestrate(&runtime_plugins, input).await
110    }
111
112    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
113    pub fn customize(
114        self,
115    ) -> crate::client::customize::CustomizableOperation<
116        crate::operation::get_profile::GetProfileOutput,
117        crate::operation::get_profile::GetProfileError,
118        Self,
119    > {
120        crate::client::customize::CustomizableOperation::new(self)
121    }
122    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
123        self.set_config_override(::std::option::Option::Some(config_override.into()));
124        self
125    }
126
127    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
128        self.config_override = config_override;
129        self
130    }
131    /// <p>The name of the profiling group to get.</p>
132    pub fn profiling_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        self.inner = self.inner.profiling_group_name(input.into());
134        self
135    }
136    /// <p>The name of the profiling group to get.</p>
137    pub fn set_profiling_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.inner = self.inner.set_profiling_group_name(input);
139        self
140    }
141    /// <p>The name of the profiling group to get.</p>
142    pub fn get_profiling_group_name(&self) -> &::std::option::Option<::std::string::String> {
143        self.inner.get_profiling_group_name()
144    }
145    /// <p>The start time of the profile to get. Specify 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>
146    /// <p>If you specify <code>startTime</code>, then you must also specify <code>period</code> or <code>endTime</code>, but not both.</p>
147    pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
148        self.inner = self.inner.start_time(input);
149        self
150    }
151    /// <p>The start time of the profile to get. Specify 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>
152    /// <p>If you specify <code>startTime</code>, then you must also specify <code>period</code> or <code>endTime</code>, but not both.</p>
153    pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
154        self.inner = self.inner.set_start_time(input);
155        self
156    }
157    /// <p>The start time of the profile to get. Specify 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>
158    /// <p>If you specify <code>startTime</code>, then you must also specify <code>period</code> or <code>endTime</code>, but not both.</p>
159    pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
160        self.inner.get_start_time()
161    }
162    /// <p>Used with <code>startTime</code> or <code>endTime</code> to specify the time range for the returned aggregated profile. Specify using the ISO 8601 format. For example, <code>P1DT1H1M1S</code>.</p>
163    /// <p>To get the latest aggregated profile, specify only <code>period</code>.</p>
164    pub fn period(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
165        self.inner = self.inner.period(input.into());
166        self
167    }
168    /// <p>Used with <code>startTime</code> or <code>endTime</code> to specify the time range for the returned aggregated profile. Specify using the ISO 8601 format. For example, <code>P1DT1H1M1S</code>.</p>
169    /// <p>To get the latest aggregated profile, specify only <code>period</code>.</p>
170    pub fn set_period(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
171        self.inner = self.inner.set_period(input);
172        self
173    }
174    /// <p>Used with <code>startTime</code> or <code>endTime</code> to specify the time range for the returned aggregated profile. Specify using the ISO 8601 format. For example, <code>P1DT1H1M1S</code>.</p>
175    /// <p>To get the latest aggregated profile, specify only <code>period</code>.</p>
176    pub fn get_period(&self) -> &::std::option::Option<::std::string::String> {
177        self.inner.get_period()
178    }
179    /// <p>The end time of the requested profile. Specify 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>
180    /// <p>If you specify <code>endTime</code>, then you must also specify <code>period</code> or <code>startTime</code>, but not both.</p>
181    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
182        self.inner = self.inner.end_time(input);
183        self
184    }
185    /// <p>The end time of the requested profile. Specify 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>
186    /// <p>If you specify <code>endTime</code>, then you must also specify <code>period</code> or <code>startTime</code>, but not both.</p>
187    pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
188        self.inner = self.inner.set_end_time(input);
189        self
190    }
191    /// <p>The end time of the requested profile. Specify 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>
192    /// <p>If you specify <code>endTime</code>, then you must also specify <code>period</code> or <code>startTime</code>, but not both.</p>
193    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
194        self.inner.get_end_time()
195    }
196    /// <p>The maximum depth of the stacks in the code that is represented in the aggregated profile. For example, if CodeGuru Profiler finds a method <code>A</code>, which calls method <code>B</code>, which calls method <code>C</code>, which calls method <code>D</code>, then the depth is 4. If the <code>maxDepth</code> is set to 2, then the aggregated profile contains representations of methods <code>A</code> and <code>B</code>.</p>
197    pub fn max_depth(mut self, input: i32) -> Self {
198        self.inner = self.inner.max_depth(input);
199        self
200    }
201    /// <p>The maximum depth of the stacks in the code that is represented in the aggregated profile. For example, if CodeGuru Profiler finds a method <code>A</code>, which calls method <code>B</code>, which calls method <code>C</code>, which calls method <code>D</code>, then the depth is 4. If the <code>maxDepth</code> is set to 2, then the aggregated profile contains representations of methods <code>A</code> and <code>B</code>.</p>
202    pub fn set_max_depth(mut self, input: ::std::option::Option<i32>) -> Self {
203        self.inner = self.inner.set_max_depth(input);
204        self
205    }
206    /// <p>The maximum depth of the stacks in the code that is represented in the aggregated profile. For example, if CodeGuru Profiler finds a method <code>A</code>, which calls method <code>B</code>, which calls method <code>C</code>, which calls method <code>D</code>, then the depth is 4. If the <code>maxDepth</code> is set to 2, then the aggregated profile contains representations of methods <code>A</code> and <code>B</code>.</p>
207    pub fn get_max_depth(&self) -> &::std::option::Option<i32> {
208        self.inner.get_max_depth()
209    }
210    /// <p>The format of the returned profiling data. The format maps to the <code>Accept</code> and <code>Content-Type</code> headers of the HTTP request. You can specify one of the following: or the default .</p>
211    /// <ul>
212    /// <li>
213    /// <p><code>application/json</code> — standard JSON format</p></li>
214    /// <li>
215    /// <p><code>application/x-amzn-ion</code> — the Amazon Ion data format. For more information, see <a href="http://amzn.github.io/ion-docs/">Amazon Ion</a>.</p></li>
216    /// </ul>
217    pub fn accept(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
218        self.inner = self.inner.accept(input.into());
219        self
220    }
221    /// <p>The format of the returned profiling data. The format maps to the <code>Accept</code> and <code>Content-Type</code> headers of the HTTP request. You can specify one of the following: or the default .</p>
222    /// <ul>
223    /// <li>
224    /// <p><code>application/json</code> — standard JSON format</p></li>
225    /// <li>
226    /// <p><code>application/x-amzn-ion</code> — the Amazon Ion data format. For more information, see <a href="http://amzn.github.io/ion-docs/">Amazon Ion</a>.</p></li>
227    /// </ul>
228    pub fn set_accept(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
229        self.inner = self.inner.set_accept(input);
230        self
231    }
232    /// <p>The format of the returned profiling data. The format maps to the <code>Accept</code> and <code>Content-Type</code> headers of the HTTP request. You can specify one of the following: or the default .</p>
233    /// <ul>
234    /// <li>
235    /// <p><code>application/json</code> — standard JSON format</p></li>
236    /// <li>
237    /// <p><code>application/x-amzn-ion</code> — the Amazon Ion data format. For more information, see <a href="http://amzn.github.io/ion-docs/">Amazon Ion</a>.</p></li>
238    /// </ul>
239    pub fn get_accept(&self) -> &::std::option::Option<::std::string::String> {
240        self.inner.get_accept()
241    }
242}