Skip to main content

aws_sdk_cloudwatch/operation/get_metric_statistics/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_metric_statistics::_get_metric_statistics_output::GetMetricStatisticsOutputBuilder;
3
4pub use crate::operation::get_metric_statistics::_get_metric_statistics_input::GetMetricStatisticsInputBuilder;
5
6impl crate::operation::get_metric_statistics::builders::GetMetricStatisticsInputBuilder {
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_metric_statistics::GetMetricStatisticsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_metric_statistics::GetMetricStatisticsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_metric_statistics();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetMetricStatistics`.
24///
25/// <p>Gets statistics for the specified metric.</p>
26/// <p>The maximum number of data points returned from a single call is 1,440. If you request more than 1,440 data points, CloudWatch returns an error. To reduce the number of data points, you can narrow the specified time range and make multiple requests across adjacent time ranges, or you can increase the specified period. Data points are not returned in chronological order.</p>
27/// <p>CloudWatch aggregates data points based on the length of the period that you specify. For example, if you request statistics with a one-hour period, CloudWatch aggregates all data points with time stamps that fall within each one-hour period. Therefore, the number of values aggregated by CloudWatch is larger than the number of data points returned.</p>
28/// <p>CloudWatch needs raw data points to calculate percentile statistics. If you publish data using a statistic set instead, you can only retrieve percentile statistics for this data if one of the following conditions is true:</p>
29/// <ul>
30/// <li>
31/// <p>The SampleCount value of the statistic set is 1.</p></li>
32/// <li>
33/// <p>The Min and the Max values of the statistic set are equal.</p></li>
34/// </ul>
35/// <p>Percentile statistics are not available for metrics when any of the metric values are negative numbers.</p>
36/// <p>Amazon CloudWatch retains metric data as follows:</p>
37/// <ul>
38/// <li>
39/// <p>Data points with a period of less than 60 seconds are available for 3 hours. These data points are high-resolution metrics and are available only for custom metrics that have been defined with a <code>StorageResolution</code> of 1.</p></li>
40/// <li>
41/// <p>Data points with a period of 60 seconds (1-minute) are available for 15 days.</p></li>
42/// <li>
43/// <p>Data points with a period of 300 seconds (5-minute) are available for 63 days.</p></li>
44/// <li>
45/// <p>Data points with a period of 3600 seconds (1 hour) are available for 455 days (15 months).</p></li>
46/// </ul>
47/// <p>Data points that are initially published with a shorter period are aggregated together for long-term storage. For example, if you collect data using a period of 1 minute, the data remains available for 15 days with 1-minute resolution. After 15 days, this data is still available, but is aggregated and retrievable only with a resolution of 5 minutes. After 63 days, the data is further aggregated and is available with a resolution of 1 hour.</p>
48/// <p>CloudWatch started retaining 5-minute and 1-hour metric data as of July 9, 2016.</p>
49/// <p>For information about metrics and dimensions supported by Amazon Web Services services, see the <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CW_Support_For_AWS.html">Amazon CloudWatch Metrics and Dimensions Reference</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
50#[derive(::std::clone::Clone, ::std::fmt::Debug)]
51pub struct GetMetricStatisticsFluentBuilder {
52    handle: ::std::sync::Arc<crate::client::Handle>,
53    inner: crate::operation::get_metric_statistics::builders::GetMetricStatisticsInputBuilder,
54    config_override: ::std::option::Option<crate::config::Builder>,
55}
56impl
57    crate::client::customize::internal::CustomizableSend<
58        crate::operation::get_metric_statistics::GetMetricStatisticsOutput,
59        crate::operation::get_metric_statistics::GetMetricStatisticsError,
60    > for GetMetricStatisticsFluentBuilder
61{
62    fn send(
63        self,
64        config_override: crate::config::Builder,
65    ) -> crate::client::customize::internal::BoxFuture<
66        crate::client::customize::internal::SendResult<
67            crate::operation::get_metric_statistics::GetMetricStatisticsOutput,
68            crate::operation::get_metric_statistics::GetMetricStatisticsError,
69        >,
70    > {
71        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
72    }
73}
74impl GetMetricStatisticsFluentBuilder {
75    /// Creates a new `GetMetricStatisticsFluentBuilder`.
76    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
77        Self {
78            handle,
79            inner: ::std::default::Default::default(),
80            config_override: ::std::option::Option::None,
81        }
82    }
83    /// Access the GetMetricStatistics as a reference.
84    pub fn as_input(&self) -> &crate::operation::get_metric_statistics::builders::GetMetricStatisticsInputBuilder {
85        &self.inner
86    }
87    /// Sends the request and returns the response.
88    ///
89    /// If an error occurs, an `SdkError` will be returned with additional details that
90    /// can be matched against.
91    ///
92    /// By default, any retryable failures will be retried twice. Retry behavior
93    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
94    /// set when configuring the client.
95    pub async fn send(
96        self,
97    ) -> ::std::result::Result<
98        crate::operation::get_metric_statistics::GetMetricStatisticsOutput,
99        ::aws_smithy_runtime_api::client::result::SdkError<
100            crate::operation::get_metric_statistics::GetMetricStatisticsError,
101            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
102        >,
103    > {
104        let input = self
105            .inner
106            .build()
107            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
108        let runtime_plugins = crate::operation::get_metric_statistics::GetMetricStatistics::operation_runtime_plugins(
109            self.handle.runtime_plugins.clone(),
110            &self.handle.conf,
111            self.config_override,
112        );
113        crate::operation::get_metric_statistics::GetMetricStatistics::orchestrate(&runtime_plugins, input).await
114    }
115
116    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
117    pub fn customize(
118        self,
119    ) -> crate::client::customize::CustomizableOperation<
120        crate::operation::get_metric_statistics::GetMetricStatisticsOutput,
121        crate::operation::get_metric_statistics::GetMetricStatisticsError,
122        Self,
123    > {
124        crate::client::customize::CustomizableOperation::new(self)
125    }
126    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
127        self.set_config_override(::std::option::Option::Some(config_override.into()));
128        self
129    }
130
131    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
132        self.config_override = config_override;
133        self
134    }
135    /// <p>The namespace of the metric, with or without spaces.</p>
136    pub fn namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137        self.inner = self.inner.namespace(input.into());
138        self
139    }
140    /// <p>The namespace of the metric, with or without spaces.</p>
141    pub fn set_namespace(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142        self.inner = self.inner.set_namespace(input);
143        self
144    }
145    /// <p>The namespace of the metric, with or without spaces.</p>
146    pub fn get_namespace(&self) -> &::std::option::Option<::std::string::String> {
147        self.inner.get_namespace()
148    }
149    /// <p>The name of the metric, with or without spaces.</p>
150    pub fn metric_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151        self.inner = self.inner.metric_name(input.into());
152        self
153    }
154    /// <p>The name of the metric, with or without spaces.</p>
155    pub fn set_metric_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156        self.inner = self.inner.set_metric_name(input);
157        self
158    }
159    /// <p>The name of the metric, with or without spaces.</p>
160    pub fn get_metric_name(&self) -> &::std::option::Option<::std::string::String> {
161        self.inner.get_metric_name()
162    }
163    ///
164    /// Appends an item to `Dimensions`.
165    ///
166    /// To override the contents of this collection use [`set_dimensions`](Self::set_dimensions).
167    ///
168    /// <p>The dimensions. If the metric contains multiple dimensions, you must include a value for each dimension. CloudWatch treats each unique combination of dimensions as a separate metric. If a specific combination of dimensions was not published, you can't retrieve statistics for it. You must specify the same dimensions that were used when the metrics were created. For an example, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#dimension-combinations">Dimension Combinations</a> in the <i>Amazon CloudWatch User Guide</i>. For more information about specifying dimensions, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html">Publishing Metrics</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
169    pub fn dimensions(mut self, input: crate::types::Dimension) -> Self {
170        self.inner = self.inner.dimensions(input);
171        self
172    }
173    /// <p>The dimensions. If the metric contains multiple dimensions, you must include a value for each dimension. CloudWatch treats each unique combination of dimensions as a separate metric. If a specific combination of dimensions was not published, you can't retrieve statistics for it. You must specify the same dimensions that were used when the metrics were created. For an example, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#dimension-combinations">Dimension Combinations</a> in the <i>Amazon CloudWatch User Guide</i>. For more information about specifying dimensions, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html">Publishing Metrics</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
174    pub fn set_dimensions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Dimension>>) -> Self {
175        self.inner = self.inner.set_dimensions(input);
176        self
177    }
178    /// <p>The dimensions. If the metric contains multiple dimensions, you must include a value for each dimension. CloudWatch treats each unique combination of dimensions as a separate metric. If a specific combination of dimensions was not published, you can't retrieve statistics for it. You must specify the same dimensions that were used when the metrics were created. For an example, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#dimension-combinations">Dimension Combinations</a> in the <i>Amazon CloudWatch User Guide</i>. For more information about specifying dimensions, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html">Publishing Metrics</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
179    pub fn get_dimensions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Dimension>> {
180        self.inner.get_dimensions()
181    }
182    /// <p>The time stamp that determines the first data point to return. Start times are evaluated relative to the time that CloudWatch receives the request.</p>
183    /// <p>The value specified is inclusive; results include data points with the specified time stamp. In a raw HTTP query, the time stamp must be in ISO 8601 UTC format (for example, 2016-10-03T23:00:00Z).</p>
184    /// <p>CloudWatch rounds the specified time stamp as follows:</p>
185    /// <ul>
186    /// <li>
187    /// <p>Start time less than 15 days ago - Round down to the nearest whole minute. For example, 12:32:34 is rounded down to 12:32:00.</p></li>
188    /// <li>
189    /// <p>Start time between 15 and 63 days ago - Round down to the nearest 5-minute clock interval. For example, 12:32:34 is rounded down to 12:30:00.</p></li>
190    /// <li>
191    /// <p>Start time greater than 63 days ago - Round down to the nearest 1-hour clock interval. For example, 12:32:34 is rounded down to 12:00:00.</p></li>
192    /// </ul>
193    /// <p>If you set <code>Period</code> to 5, 10, 20, or 30, the start time of your request is rounded down to the nearest time that corresponds to even 5-, 10-, 20-, or 30-second divisions of a minute. For example, if you make a query at (HH:mm:ss) 01:05:23 for the previous 10-second period, the start time of your request is rounded down and you receive data from 01:05:10 to 01:05:20. If you make a query at 15:07:17 for the previous 5 minutes of data, using a period of 5 seconds, you receive data timestamped between 15:02:15 and 15:07:15.</p>
194    pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
195        self.inner = self.inner.start_time(input);
196        self
197    }
198    /// <p>The time stamp that determines the first data point to return. Start times are evaluated relative to the time that CloudWatch receives the request.</p>
199    /// <p>The value specified is inclusive; results include data points with the specified time stamp. In a raw HTTP query, the time stamp must be in ISO 8601 UTC format (for example, 2016-10-03T23:00:00Z).</p>
200    /// <p>CloudWatch rounds the specified time stamp as follows:</p>
201    /// <ul>
202    /// <li>
203    /// <p>Start time less than 15 days ago - Round down to the nearest whole minute. For example, 12:32:34 is rounded down to 12:32:00.</p></li>
204    /// <li>
205    /// <p>Start time between 15 and 63 days ago - Round down to the nearest 5-minute clock interval. For example, 12:32:34 is rounded down to 12:30:00.</p></li>
206    /// <li>
207    /// <p>Start time greater than 63 days ago - Round down to the nearest 1-hour clock interval. For example, 12:32:34 is rounded down to 12:00:00.</p></li>
208    /// </ul>
209    /// <p>If you set <code>Period</code> to 5, 10, 20, or 30, the start time of your request is rounded down to the nearest time that corresponds to even 5-, 10-, 20-, or 30-second divisions of a minute. For example, if you make a query at (HH:mm:ss) 01:05:23 for the previous 10-second period, the start time of your request is rounded down and you receive data from 01:05:10 to 01:05:20. If you make a query at 15:07:17 for the previous 5 minutes of data, using a period of 5 seconds, you receive data timestamped between 15:02:15 and 15:07:15.</p>
210    pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
211        self.inner = self.inner.set_start_time(input);
212        self
213    }
214    /// <p>The time stamp that determines the first data point to return. Start times are evaluated relative to the time that CloudWatch receives the request.</p>
215    /// <p>The value specified is inclusive; results include data points with the specified time stamp. In a raw HTTP query, the time stamp must be in ISO 8601 UTC format (for example, 2016-10-03T23:00:00Z).</p>
216    /// <p>CloudWatch rounds the specified time stamp as follows:</p>
217    /// <ul>
218    /// <li>
219    /// <p>Start time less than 15 days ago - Round down to the nearest whole minute. For example, 12:32:34 is rounded down to 12:32:00.</p></li>
220    /// <li>
221    /// <p>Start time between 15 and 63 days ago - Round down to the nearest 5-minute clock interval. For example, 12:32:34 is rounded down to 12:30:00.</p></li>
222    /// <li>
223    /// <p>Start time greater than 63 days ago - Round down to the nearest 1-hour clock interval. For example, 12:32:34 is rounded down to 12:00:00.</p></li>
224    /// </ul>
225    /// <p>If you set <code>Period</code> to 5, 10, 20, or 30, the start time of your request is rounded down to the nearest time that corresponds to even 5-, 10-, 20-, or 30-second divisions of a minute. For example, if you make a query at (HH:mm:ss) 01:05:23 for the previous 10-second period, the start time of your request is rounded down and you receive data from 01:05:10 to 01:05:20. If you make a query at 15:07:17 for the previous 5 minutes of data, using a period of 5 seconds, you receive data timestamped between 15:02:15 and 15:07:15.</p>
226    pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
227        self.inner.get_start_time()
228    }
229    /// <p>The time stamp that determines the last data point to return.</p>
230    /// <p>The value specified is exclusive; results include data points up to the specified time stamp. In a raw HTTP query, the time stamp must be in ISO 8601 UTC format (for example, 2016-10-10T23:00:00Z).</p>
231    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
232        self.inner = self.inner.end_time(input);
233        self
234    }
235    /// <p>The time stamp that determines the last data point to return.</p>
236    /// <p>The value specified is exclusive; results include data points up to the specified time stamp. In a raw HTTP query, the time stamp must be in ISO 8601 UTC format (for example, 2016-10-10T23:00:00Z).</p>
237    pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
238        self.inner = self.inner.set_end_time(input);
239        self
240    }
241    /// <p>The time stamp that determines the last data point to return.</p>
242    /// <p>The value specified is exclusive; results include data points up to the specified time stamp. In a raw HTTP query, the time stamp must be in ISO 8601 UTC format (for example, 2016-10-10T23:00:00Z).</p>
243    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
244        self.inner.get_end_time()
245    }
246    /// <p>The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 20, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a <code>PutMetricData</code> call that includes a <code>StorageResolution</code> of 1 second.</p>
247    /// <p>If the <code>StartTime</code> parameter specifies a time stamp that is greater than 3 hours ago, you must specify the period as follows or no data points in that time range is returned:</p>
248    /// <ul>
249    /// <li>
250    /// <p>Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute).</p></li>
251    /// <li>
252    /// <p>Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes).</p></li>
253    /// <li>
254    /// <p>Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).</p></li>
255    /// </ul>
256    pub fn period(mut self, input: i32) -> Self {
257        self.inner = self.inner.period(input);
258        self
259    }
260    /// <p>The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 20, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a <code>PutMetricData</code> call that includes a <code>StorageResolution</code> of 1 second.</p>
261    /// <p>If the <code>StartTime</code> parameter specifies a time stamp that is greater than 3 hours ago, you must specify the period as follows or no data points in that time range is returned:</p>
262    /// <ul>
263    /// <li>
264    /// <p>Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute).</p></li>
265    /// <li>
266    /// <p>Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes).</p></li>
267    /// <li>
268    /// <p>Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).</p></li>
269    /// </ul>
270    pub fn set_period(mut self, input: ::std::option::Option<i32>) -> Self {
271        self.inner = self.inner.set_period(input);
272        self
273    }
274    /// <p>The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 20, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a <code>PutMetricData</code> call that includes a <code>StorageResolution</code> of 1 second.</p>
275    /// <p>If the <code>StartTime</code> parameter specifies a time stamp that is greater than 3 hours ago, you must specify the period as follows or no data points in that time range is returned:</p>
276    /// <ul>
277    /// <li>
278    /// <p>Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute).</p></li>
279    /// <li>
280    /// <p>Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes).</p></li>
281    /// <li>
282    /// <p>Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).</p></li>
283    /// </ul>
284    pub fn get_period(&self) -> &::std::option::Option<i32> {
285        self.inner.get_period()
286    }
287    ///
288    /// Appends an item to `Statistics`.
289    ///
290    /// To override the contents of this collection use [`set_statistics`](Self::set_statistics).
291    ///
292    /// <p>The metric statistics, other than percentile. For percentile statistics, use <code>ExtendedStatistics</code>. When calling <code>GetMetricStatistics</code>, you must specify either <code>Statistics</code> or <code>ExtendedStatistics</code>, but not both.</p>
293    pub fn statistics(mut self, input: crate::types::Statistic) -> Self {
294        self.inner = self.inner.statistics(input);
295        self
296    }
297    /// <p>The metric statistics, other than percentile. For percentile statistics, use <code>ExtendedStatistics</code>. When calling <code>GetMetricStatistics</code>, you must specify either <code>Statistics</code> or <code>ExtendedStatistics</code>, but not both.</p>
298    pub fn set_statistics(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Statistic>>) -> Self {
299        self.inner = self.inner.set_statistics(input);
300        self
301    }
302    /// <p>The metric statistics, other than percentile. For percentile statistics, use <code>ExtendedStatistics</code>. When calling <code>GetMetricStatistics</code>, you must specify either <code>Statistics</code> or <code>ExtendedStatistics</code>, but not both.</p>
303    pub fn get_statistics(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Statistic>> {
304        self.inner.get_statistics()
305    }
306    ///
307    /// Appends an item to `ExtendedStatistics`.
308    ///
309    /// To override the contents of this collection use [`set_extended_statistics`](Self::set_extended_statistics).
310    ///
311    /// <p>The percentile statistics. Specify values between p0.0 and p100. When calling <code>GetMetricStatistics</code>, you must specify either <code>Statistics</code> or <code>ExtendedStatistics</code>, but not both. Percentile statistics are not available for metrics when any of the metric values are negative numbers.</p>
312    pub fn extended_statistics(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
313        self.inner = self.inner.extended_statistics(input.into());
314        self
315    }
316    /// <p>The percentile statistics. Specify values between p0.0 and p100. When calling <code>GetMetricStatistics</code>, you must specify either <code>Statistics</code> or <code>ExtendedStatistics</code>, but not both. Percentile statistics are not available for metrics when any of the metric values are negative numbers.</p>
317    pub fn set_extended_statistics(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
318        self.inner = self.inner.set_extended_statistics(input);
319        self
320    }
321    /// <p>The percentile statistics. Specify values between p0.0 and p100. When calling <code>GetMetricStatistics</code>, you must specify either <code>Statistics</code> or <code>ExtendedStatistics</code>, but not both. Percentile statistics are not available for metrics when any of the metric values are negative numbers.</p>
322    pub fn get_extended_statistics(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
323        self.inner.get_extended_statistics()
324    }
325    /// <p>The unit for a given metric. If you omit <code>Unit</code>, all data that was collected with any unit is returned, along with the corresponding units that were specified when the data was reported to CloudWatch. If you specify a unit, the operation returns only data that was collected with that unit specified. If you specify a unit that does not match the data collected, the results of the operation are null. CloudWatch does not perform unit conversions.</p>
326    pub fn unit(mut self, input: crate::types::StandardUnit) -> Self {
327        self.inner = self.inner.unit(input);
328        self
329    }
330    /// <p>The unit for a given metric. If you omit <code>Unit</code>, all data that was collected with any unit is returned, along with the corresponding units that were specified when the data was reported to CloudWatch. If you specify a unit, the operation returns only data that was collected with that unit specified. If you specify a unit that does not match the data collected, the results of the operation are null. CloudWatch does not perform unit conversions.</p>
331    pub fn set_unit(mut self, input: ::std::option::Option<crate::types::StandardUnit>) -> Self {
332        self.inner = self.inner.set_unit(input);
333        self
334    }
335    /// <p>The unit for a given metric. If you omit <code>Unit</code>, all data that was collected with any unit is returned, along with the corresponding units that were specified when the data was reported to CloudWatch. If you specify a unit, the operation returns only data that was collected with that unit specified. If you specify a unit that does not match the data collected, the results of the operation are null. CloudWatch does not perform unit conversions.</p>
336    pub fn get_unit(&self) -> &::std::option::Option<crate::types::StandardUnit> {
337        self.inner.get_unit()
338    }
339}