aws_sdk_codeguruprofiler/operation/batch_get_frame_metric_data/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::batch_get_frame_metric_data::_batch_get_frame_metric_data_output::BatchGetFrameMetricDataOutputBuilder;
3
4pub use crate::operation::batch_get_frame_metric_data::_batch_get_frame_metric_data_input::BatchGetFrameMetricDataInputBuilder;
5
6impl crate::operation::batch_get_frame_metric_data::builders::BatchGetFrameMetricDataInputBuilder {
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::batch_get_frame_metric_data::BatchGetFrameMetricDataOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::batch_get_frame_metric_data::BatchGetFrameMetricDataError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.batch_get_frame_metric_data();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `BatchGetFrameMetricData`.
24///
25/// <p>Returns the time series of values for a requested list of frame metrics from a time period.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct BatchGetFrameMetricDataFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::batch_get_frame_metric_data::builders::BatchGetFrameMetricDataInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::batch_get_frame_metric_data::BatchGetFrameMetricDataOutput,
35        crate::operation::batch_get_frame_metric_data::BatchGetFrameMetricDataError,
36    > for BatchGetFrameMetricDataFluentBuilder
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::batch_get_frame_metric_data::BatchGetFrameMetricDataOutput,
44            crate::operation::batch_get_frame_metric_data::BatchGetFrameMetricDataError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl BatchGetFrameMetricDataFluentBuilder {
51    /// Creates a new `BatchGetFrameMetricDataFluentBuilder`.
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 BatchGetFrameMetricData as a reference.
60    pub fn as_input(&self) -> &crate::operation::batch_get_frame_metric_data::builders::BatchGetFrameMetricDataInputBuilder {
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::batch_get_frame_metric_data::BatchGetFrameMetricDataOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::batch_get_frame_metric_data::BatchGetFrameMetricDataError,
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::batch_get_frame_metric_data::BatchGetFrameMetricData::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::batch_get_frame_metric_data::BatchGetFrameMetricData::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::batch_get_frame_metric_data::BatchGetFrameMetricDataOutput,
97        crate::operation::batch_get_frame_metric_data::BatchGetFrameMetricDataError,
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 associated with the the frame metrics used to return the time series values.</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 associated with the the frame metrics used to return the time series values.</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 associated with the the frame metrics used to return the time series values.</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 start time of the time period for the frame metrics used to return the time series values. 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 start time of the time period for the frame metrics used to return the time series values. 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 start time of the time period for the frame metrics used to return the time series values. 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 end time of the time period for the returned time series values. 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 end time of the time period for the returned time series values. 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 end time of the time period for the returned time series values. 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 duration of the frame metrics used to return the time series values. Specify using the ISO 8601 format. The maximum period duration is one day (<code>PT24H</code> or <code>P1D</code>).</p>
154    pub fn period(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.period(input.into());
156        self
157    }
158    /// <p>The duration of the frame metrics used to return the time series values. Specify using the ISO 8601 format. The maximum period duration is one day (<code>PT24H</code> or <code>P1D</code>).</p>
159    pub fn set_period(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_period(input);
161        self
162    }
163    /// <p>The duration of the frame metrics used to return the time series values. Specify using the ISO 8601 format. The maximum period duration is one day (<code>PT24H</code> or <code>P1D</code>).</p>
164    pub fn get_period(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_period()
166    }
167    /// <p>The requested resolution of time steps for the returned time series of values. If the requested target resolution is not available due to data not being retained we provide a best effort result by falling back to the most granular available resolution after the target resolution. There are 3 valid values.</p>
168    /// <ul>
169    /// <li>
170    /// <p><code>P1D</code> — 1 day</p></li>
171    /// <li>
172    /// <p><code>PT1H</code> — 1 hour</p></li>
173    /// <li>
174    /// <p><code>PT5M</code> — 5 minutes</p></li>
175    /// </ul>
176    pub fn target_resolution(mut self, input: crate::types::AggregationPeriod) -> Self {
177        self.inner = self.inner.target_resolution(input);
178        self
179    }
180    /// <p>The requested resolution of time steps for the returned time series of values. If the requested target resolution is not available due to data not being retained we provide a best effort result by falling back to the most granular available resolution after the target resolution. There are 3 valid values.</p>
181    /// <ul>
182    /// <li>
183    /// <p><code>P1D</code> — 1 day</p></li>
184    /// <li>
185    /// <p><code>PT1H</code> — 1 hour</p></li>
186    /// <li>
187    /// <p><code>PT5M</code> — 5 minutes</p></li>
188    /// </ul>
189    pub fn set_target_resolution(mut self, input: ::std::option::Option<crate::types::AggregationPeriod>) -> Self {
190        self.inner = self.inner.set_target_resolution(input);
191        self
192    }
193    /// <p>The requested resolution of time steps for the returned time series of values. If the requested target resolution is not available due to data not being retained we provide a best effort result by falling back to the most granular available resolution after the target resolution. There are 3 valid values.</p>
194    /// <ul>
195    /// <li>
196    /// <p><code>P1D</code> — 1 day</p></li>
197    /// <li>
198    /// <p><code>PT1H</code> — 1 hour</p></li>
199    /// <li>
200    /// <p><code>PT5M</code> — 5 minutes</p></li>
201    /// </ul>
202    pub fn get_target_resolution(&self) -> &::std::option::Option<crate::types::AggregationPeriod> {
203        self.inner.get_target_resolution()
204    }
205    ///
206    /// Appends an item to `frameMetrics`.
207    ///
208    /// To override the contents of this collection use [`set_frame_metrics`](Self::set_frame_metrics).
209    ///
210    /// <p>The details of the metrics that are used to request a time series of values. The metric includes the name of the frame, the aggregation type to calculate the metric value for the frame, and the thread states to use to get the count for the metric value of the frame.</p>
211    pub fn frame_metrics(mut self, input: crate::types::FrameMetric) -> Self {
212        self.inner = self.inner.frame_metrics(input);
213        self
214    }
215    /// <p>The details of the metrics that are used to request a time series of values. The metric includes the name of the frame, the aggregation type to calculate the metric value for the frame, and the thread states to use to get the count for the metric value of the frame.</p>
216    pub fn set_frame_metrics(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FrameMetric>>) -> Self {
217        self.inner = self.inner.set_frame_metrics(input);
218        self
219    }
220    /// <p>The details of the metrics that are used to request a time series of values. The metric includes the name of the frame, the aggregation type to calculate the metric value for the frame, and the thread states to use to get the count for the metric value of the frame.</p>
221    pub fn get_frame_metrics(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FrameMetric>> {
222        self.inner.get_frame_metrics()
223    }
224}