aws_sdk_connect/operation/get_current_metric_data/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_current_metric_data::_get_current_metric_data_output::GetCurrentMetricDataOutputBuilder;
3
4pub use crate::operation::get_current_metric_data::_get_current_metric_data_input::GetCurrentMetricDataInputBuilder;
5
6impl crate::operation::get_current_metric_data::builders::GetCurrentMetricDataInputBuilder {
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_current_metric_data::GetCurrentMetricDataOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_current_metric_data::GetCurrentMetricDataError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_current_metric_data();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetCurrentMetricData`.
24///
25/// <p>Gets the real-time metric data from the specified Amazon Connect instance.</p>
26/// <p>For a description of each metric, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html">Metrics definitions</a> in the <i>Amazon Connect Administrator Guide</i>.</p><note>
27/// <p>When you make a successful API request, you can expect the following metric values in the response:</p>
28/// <ol>
29/// <li>
30/// <p><b>Metric value is null</b>: The calculation cannot be performed due to divide by zero or insufficient data</p></li>
31/// <li>
32/// <p><b>Metric value is a number (including 0) of defined type</b>: The number provided is the calculation result</p></li>
33/// <li>
34/// <p><b>MetricResult list is empty</b>: The request cannot find any data in the system</p></li>
35/// </ol>
36/// <p>The following guidelines can help you work with the API:</p>
37/// <ul>
38/// <li>
39/// <p>Each dimension in the metric response must contain a value</p></li>
40/// <li>
41/// <p>Each item in MetricResult must include all requested metrics</p></li>
42/// <li>
43/// <p>If the response is slow due to large result sets, try these approaches:</p>
44/// <ul>
45/// <li>
46/// <p>Add filters to reduce the amount of data returned</p></li>
47/// </ul></li>
48/// </ul>
49/// </note>
50#[derive(::std::clone::Clone, ::std::fmt::Debug)]
51pub struct GetCurrentMetricDataFluentBuilder {
52    handle: ::std::sync::Arc<crate::client::Handle>,
53    inner: crate::operation::get_current_metric_data::builders::GetCurrentMetricDataInputBuilder,
54    config_override: ::std::option::Option<crate::config::Builder>,
55}
56impl
57    crate::client::customize::internal::CustomizableSend<
58        crate::operation::get_current_metric_data::GetCurrentMetricDataOutput,
59        crate::operation::get_current_metric_data::GetCurrentMetricDataError,
60    > for GetCurrentMetricDataFluentBuilder
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_current_metric_data::GetCurrentMetricDataOutput,
68            crate::operation::get_current_metric_data::GetCurrentMetricDataError,
69        >,
70    > {
71        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
72    }
73}
74impl GetCurrentMetricDataFluentBuilder {
75    /// Creates a new `GetCurrentMetricDataFluentBuilder`.
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 GetCurrentMetricData as a reference.
84    pub fn as_input(&self) -> &crate::operation::get_current_metric_data::builders::GetCurrentMetricDataInputBuilder {
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_current_metric_data::GetCurrentMetricDataOutput,
99        ::aws_smithy_runtime_api::client::result::SdkError<
100            crate::operation::get_current_metric_data::GetCurrentMetricDataError,
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_current_metric_data::GetCurrentMetricData::operation_runtime_plugins(
109            self.handle.runtime_plugins.clone(),
110            &self.handle.conf,
111            self.config_override,
112        );
113        crate::operation::get_current_metric_data::GetCurrentMetricData::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_current_metric_data::GetCurrentMetricDataOutput,
121        crate::operation::get_current_metric_data::GetCurrentMetricDataError,
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    /// Create a paginator for this request
136    ///
137    /// Paginators are used by calling [`send().await`](crate::operation::get_current_metric_data::paginator::GetCurrentMetricDataPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
138    pub fn into_paginator(self) -> crate::operation::get_current_metric_data::paginator::GetCurrentMetricDataPaginator {
139        crate::operation::get_current_metric_data::paginator::GetCurrentMetricDataPaginator::new(self.handle, self.inner)
140    }
141    /// <p>The identifier of the Amazon Connect instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
142    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143        self.inner = self.inner.instance_id(input.into());
144        self
145    }
146    /// <p>The identifier of the Amazon Connect instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
147    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148        self.inner = self.inner.set_instance_id(input);
149        self
150    }
151    /// <p>The identifier of the Amazon Connect instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
152    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
153        self.inner.get_instance_id()
154    }
155    /// <p>The filters to apply to returned metrics. You can filter up to the following limits:</p>
156    /// <ul>
157    /// <li>
158    /// <p>Queues: 100</p></li>
159    /// <li>
160    /// <p>Routing profiles: 100</p></li>
161    /// <li>
162    /// <p>Channels: 3 (VOICE, CHAT, and TASK channels are supported.)</p></li>
163    /// <li>
164    /// <p>RoutingStepExpressions: 50</p></li>
165    /// <li>
166    /// <p>AgentStatuses: 50</p></li>
167    /// </ul>
168    /// <p>Metric data is retrieved only for the resources associated with the queues or routing profiles, and by any channels included in the filter. (You cannot filter by both queue AND routing profile.) You can include both resource IDs and resource ARNs in the same request.</p>
169    /// <p>When using <code>AgentStatuses</code> as filter make sure Queues is added as primary filter.</p>
170    /// <p>When using the <code>RoutingStepExpression</code> filter, you need to pass exactly one <code>QueueId</code>. The filter is also case sensitive so when using the <code>RoutingStepExpression</code> filter, grouping by <code>ROUTING_STEP_EXPRESSION</code> is required.</p>
171    /// <p>Currently tagging is only supported on the resources that are passed in the filter.</p>
172    pub fn filters(mut self, input: crate::types::Filters) -> Self {
173        self.inner = self.inner.filters(input);
174        self
175    }
176    /// <p>The filters to apply to returned metrics. You can filter up to the following limits:</p>
177    /// <ul>
178    /// <li>
179    /// <p>Queues: 100</p></li>
180    /// <li>
181    /// <p>Routing profiles: 100</p></li>
182    /// <li>
183    /// <p>Channels: 3 (VOICE, CHAT, and TASK channels are supported.)</p></li>
184    /// <li>
185    /// <p>RoutingStepExpressions: 50</p></li>
186    /// <li>
187    /// <p>AgentStatuses: 50</p></li>
188    /// </ul>
189    /// <p>Metric data is retrieved only for the resources associated with the queues or routing profiles, and by any channels included in the filter. (You cannot filter by both queue AND routing profile.) You can include both resource IDs and resource ARNs in the same request.</p>
190    /// <p>When using <code>AgentStatuses</code> as filter make sure Queues is added as primary filter.</p>
191    /// <p>When using the <code>RoutingStepExpression</code> filter, you need to pass exactly one <code>QueueId</code>. The filter is also case sensitive so when using the <code>RoutingStepExpression</code> filter, grouping by <code>ROUTING_STEP_EXPRESSION</code> is required.</p>
192    /// <p>Currently tagging is only supported on the resources that are passed in the filter.</p>
193    pub fn set_filters(mut self, input: ::std::option::Option<crate::types::Filters>) -> Self {
194        self.inner = self.inner.set_filters(input);
195        self
196    }
197    /// <p>The filters to apply to returned metrics. You can filter up to the following limits:</p>
198    /// <ul>
199    /// <li>
200    /// <p>Queues: 100</p></li>
201    /// <li>
202    /// <p>Routing profiles: 100</p></li>
203    /// <li>
204    /// <p>Channels: 3 (VOICE, CHAT, and TASK channels are supported.)</p></li>
205    /// <li>
206    /// <p>RoutingStepExpressions: 50</p></li>
207    /// <li>
208    /// <p>AgentStatuses: 50</p></li>
209    /// </ul>
210    /// <p>Metric data is retrieved only for the resources associated with the queues or routing profiles, and by any channels included in the filter. (You cannot filter by both queue AND routing profile.) You can include both resource IDs and resource ARNs in the same request.</p>
211    /// <p>When using <code>AgentStatuses</code> as filter make sure Queues is added as primary filter.</p>
212    /// <p>When using the <code>RoutingStepExpression</code> filter, you need to pass exactly one <code>QueueId</code>. The filter is also case sensitive so when using the <code>RoutingStepExpression</code> filter, grouping by <code>ROUTING_STEP_EXPRESSION</code> is required.</p>
213    /// <p>Currently tagging is only supported on the resources that are passed in the filter.</p>
214    pub fn get_filters(&self) -> &::std::option::Option<crate::types::Filters> {
215        self.inner.get_filters()
216    }
217    ///
218    /// Appends an item to `Groupings`.
219    ///
220    /// To override the contents of this collection use [`set_groupings`](Self::set_groupings).
221    ///
222    /// <p>Defines the level of aggregation for metrics data by a dimension(s). Its similar to sorting items into buckets based on a common characteristic, then counting or calculating something for each bucket. For example, when grouped by <code>QUEUE</code>, the metrics returned apply to each queue rather than aggregated for all queues.</p>
223    /// <p>The grouping list is an ordered list, with the first item in the list defined as the primary grouping. If no grouping is included in the request, the aggregation happens at the instance-level.</p>
224    /// <ul>
225    /// <li>
226    /// <p>If you group by <code>CHANNEL</code>, you should include a Channels filter. VOICE, CHAT, and TASK channels are supported.</p></li>
227    /// <li>
228    /// <p>If you group by <code>AGENT_STATUS</code>, you must include the <code>QUEUE</code> as the primary grouping and use queue filter. When you group by <code>AGENT_STATUS</code>, the only metric available is the <code>AGENTS_ONLINE</code> metric.</p></li>
229    /// <li>
230    /// <p>If you group by <code>ROUTING_PROFILE</code>, you must include either a queue or routing profile filter. In addition, a routing profile filter is required for metrics <code>CONTACTS_SCHEDULED</code>, <code>CONTACTS_IN_QUEUE</code>, and <code> OLDEST_CONTACT_AGE</code>.</p></li>
231    /// <li>
232    /// <p>When using the <code>RoutingStepExpression</code> filter, group by <code>ROUTING_STEP_EXPRESSION</code> is required.</p></li>
233    /// </ul>
234    pub fn groupings(mut self, input: crate::types::Grouping) -> Self {
235        self.inner = self.inner.groupings(input);
236        self
237    }
238    /// <p>Defines the level of aggregation for metrics data by a dimension(s). Its similar to sorting items into buckets based on a common characteristic, then counting or calculating something for each bucket. For example, when grouped by <code>QUEUE</code>, the metrics returned apply to each queue rather than aggregated for all queues.</p>
239    /// <p>The grouping list is an ordered list, with the first item in the list defined as the primary grouping. If no grouping is included in the request, the aggregation happens at the instance-level.</p>
240    /// <ul>
241    /// <li>
242    /// <p>If you group by <code>CHANNEL</code>, you should include a Channels filter. VOICE, CHAT, and TASK channels are supported.</p></li>
243    /// <li>
244    /// <p>If you group by <code>AGENT_STATUS</code>, you must include the <code>QUEUE</code> as the primary grouping and use queue filter. When you group by <code>AGENT_STATUS</code>, the only metric available is the <code>AGENTS_ONLINE</code> metric.</p></li>
245    /// <li>
246    /// <p>If you group by <code>ROUTING_PROFILE</code>, you must include either a queue or routing profile filter. In addition, a routing profile filter is required for metrics <code>CONTACTS_SCHEDULED</code>, <code>CONTACTS_IN_QUEUE</code>, and <code> OLDEST_CONTACT_AGE</code>.</p></li>
247    /// <li>
248    /// <p>When using the <code>RoutingStepExpression</code> filter, group by <code>ROUTING_STEP_EXPRESSION</code> is required.</p></li>
249    /// </ul>
250    pub fn set_groupings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Grouping>>) -> Self {
251        self.inner = self.inner.set_groupings(input);
252        self
253    }
254    /// <p>Defines the level of aggregation for metrics data by a dimension(s). Its similar to sorting items into buckets based on a common characteristic, then counting or calculating something for each bucket. For example, when grouped by <code>QUEUE</code>, the metrics returned apply to each queue rather than aggregated for all queues.</p>
255    /// <p>The grouping list is an ordered list, with the first item in the list defined as the primary grouping. If no grouping is included in the request, the aggregation happens at the instance-level.</p>
256    /// <ul>
257    /// <li>
258    /// <p>If you group by <code>CHANNEL</code>, you should include a Channels filter. VOICE, CHAT, and TASK channels are supported.</p></li>
259    /// <li>
260    /// <p>If you group by <code>AGENT_STATUS</code>, you must include the <code>QUEUE</code> as the primary grouping and use queue filter. When you group by <code>AGENT_STATUS</code>, the only metric available is the <code>AGENTS_ONLINE</code> metric.</p></li>
261    /// <li>
262    /// <p>If you group by <code>ROUTING_PROFILE</code>, you must include either a queue or routing profile filter. In addition, a routing profile filter is required for metrics <code>CONTACTS_SCHEDULED</code>, <code>CONTACTS_IN_QUEUE</code>, and <code> OLDEST_CONTACT_AGE</code>.</p></li>
263    /// <li>
264    /// <p>When using the <code>RoutingStepExpression</code> filter, group by <code>ROUTING_STEP_EXPRESSION</code> is required.</p></li>
265    /// </ul>
266    pub fn get_groupings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Grouping>> {
267        self.inner.get_groupings()
268    }
269    ///
270    /// Appends an item to `CurrentMetrics`.
271    ///
272    /// To override the contents of this collection use [`set_current_metrics`](Self::set_current_metrics).
273    ///
274    /// <p>The metrics to retrieve. Specify the name and unit for each metric. The following metrics are available. For a description of all the metrics, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html">Metrics definitions</a> in the <i>Amazon Connect Administrator Guide</i>.</p>
275    /// <dl>
276    /// <dt>
277    /// AGENTS_AFTER_CONTACT_WORK
278    /// </dt>
279    /// <dd>
280    /// <p>Unit: COUNT</p>
281    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#aftercallwork-real-time">ACW</a></p>
282    /// </dd>
283    /// <dt>
284    /// AGENTS_AVAILABLE
285    /// </dt>
286    /// <dd>
287    /// <p>Unit: COUNT</p>
288    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#available-real-time">Available</a></p>
289    /// </dd>
290    /// <dt>
291    /// AGENTS_ERROR
292    /// </dt>
293    /// <dd>
294    /// <p>Unit: COUNT</p>
295    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#error-real-time">Error</a></p>
296    /// </dd>
297    /// <dt>
298    /// AGENTS_NON_PRODUCTIVE
299    /// </dt>
300    /// <dd>
301    /// <p>Unit: COUNT</p>
302    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#non-productive-time-real-time">NPT (Non-Productive Time)</a></p>
303    /// </dd>
304    /// <dt>
305    /// AGENTS_ON_CALL
306    /// </dt>
307    /// <dd>
308    /// <p>Unit: COUNT</p>
309    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#on-call-real-time">On contact</a></p>
310    /// </dd>
311    /// <dt>
312    /// AGENTS_ON_CONTACT
313    /// </dt>
314    /// <dd>
315    /// <p>Unit: COUNT</p>
316    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#on-call-real-time">On contact</a></p>
317    /// </dd>
318    /// <dt>
319    /// AGENTS_ONLINE
320    /// </dt>
321    /// <dd>
322    /// <p>Unit: COUNT</p>
323    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#online-real-time">Online</a></p>
324    /// </dd>
325    /// <dt>
326    /// AGENTS_STAFFED
327    /// </dt>
328    /// <dd>
329    /// <p>Unit: COUNT</p>
330    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#staffed-real-time">Staffed</a></p>
331    /// </dd>
332    /// <dt>
333    /// CONTACTS_IN_QUEUE
334    /// </dt>
335    /// <dd>
336    /// <p>Unit: COUNT</p>
337    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#in-queue-real-time">In queue</a></p>
338    /// </dd>
339    /// <dt>
340    /// CONTACTS_SCHEDULED
341    /// </dt>
342    /// <dd>
343    /// <p>Unit: COUNT</p>
344    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#scheduled-real-time">Scheduled</a></p>
345    /// </dd>
346    /// <dt>
347    /// OLDEST_CONTACT_AGE
348    /// </dt>
349    /// <dd>
350    /// <p>Unit: SECONDS</p>
351    /// <p>When you use groupings, Unit says SECONDS and the Value is returned in SECONDS.</p>
352    /// <p>When you do not use groupings, Unit says SECONDS but the Value is returned in MILLISECONDS. For example, if you get a response like this:</p>
353    /// <p><code>{ "Metric": { "Name": "OLDEST_CONTACT_AGE", "Unit": "SECONDS" }, "Value": 24113.0 </code>}</p>
354    /// <p>The actual OLDEST_CONTACT_AGE is 24 seconds.</p>
355    /// <p>When the filter <code>RoutingStepExpression</code> is used, this metric is still calculated from enqueue time. For example, if a contact that has been queued under <code><expression 1></expression></code> for 10 seconds has expired and <code><expression 2></expression></code> becomes active, then <code>OLDEST_CONTACT_AGE</code> for this queue will be counted starting from 10, not 0.</p>
356    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#oldest-real-time">Oldest</a></p>
357    /// </dd>
358    /// <dt>
359    /// SLOTS_ACTIVE
360    /// </dt>
361    /// <dd>
362    /// <p>Unit: COUNT</p>
363    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#active-real-time">Active</a></p>
364    /// </dd>
365    /// <dt>
366    /// SLOTS_AVAILABLE
367    /// </dt>
368    /// <dd>
369    /// <p>Unit: COUNT</p>
370    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#availability-real-time">Availability</a></p>
371    /// </dd>
372    /// </dl>
373    pub fn current_metrics(mut self, input: crate::types::CurrentMetric) -> Self {
374        self.inner = self.inner.current_metrics(input);
375        self
376    }
377    /// <p>The metrics to retrieve. Specify the name and unit for each metric. The following metrics are available. For a description of all the metrics, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html">Metrics definitions</a> in the <i>Amazon Connect Administrator Guide</i>.</p>
378    /// <dl>
379    /// <dt>
380    /// AGENTS_AFTER_CONTACT_WORK
381    /// </dt>
382    /// <dd>
383    /// <p>Unit: COUNT</p>
384    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#aftercallwork-real-time">ACW</a></p>
385    /// </dd>
386    /// <dt>
387    /// AGENTS_AVAILABLE
388    /// </dt>
389    /// <dd>
390    /// <p>Unit: COUNT</p>
391    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#available-real-time">Available</a></p>
392    /// </dd>
393    /// <dt>
394    /// AGENTS_ERROR
395    /// </dt>
396    /// <dd>
397    /// <p>Unit: COUNT</p>
398    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#error-real-time">Error</a></p>
399    /// </dd>
400    /// <dt>
401    /// AGENTS_NON_PRODUCTIVE
402    /// </dt>
403    /// <dd>
404    /// <p>Unit: COUNT</p>
405    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#non-productive-time-real-time">NPT (Non-Productive Time)</a></p>
406    /// </dd>
407    /// <dt>
408    /// AGENTS_ON_CALL
409    /// </dt>
410    /// <dd>
411    /// <p>Unit: COUNT</p>
412    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#on-call-real-time">On contact</a></p>
413    /// </dd>
414    /// <dt>
415    /// AGENTS_ON_CONTACT
416    /// </dt>
417    /// <dd>
418    /// <p>Unit: COUNT</p>
419    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#on-call-real-time">On contact</a></p>
420    /// </dd>
421    /// <dt>
422    /// AGENTS_ONLINE
423    /// </dt>
424    /// <dd>
425    /// <p>Unit: COUNT</p>
426    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#online-real-time">Online</a></p>
427    /// </dd>
428    /// <dt>
429    /// AGENTS_STAFFED
430    /// </dt>
431    /// <dd>
432    /// <p>Unit: COUNT</p>
433    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#staffed-real-time">Staffed</a></p>
434    /// </dd>
435    /// <dt>
436    /// CONTACTS_IN_QUEUE
437    /// </dt>
438    /// <dd>
439    /// <p>Unit: COUNT</p>
440    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#in-queue-real-time">In queue</a></p>
441    /// </dd>
442    /// <dt>
443    /// CONTACTS_SCHEDULED
444    /// </dt>
445    /// <dd>
446    /// <p>Unit: COUNT</p>
447    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#scheduled-real-time">Scheduled</a></p>
448    /// </dd>
449    /// <dt>
450    /// OLDEST_CONTACT_AGE
451    /// </dt>
452    /// <dd>
453    /// <p>Unit: SECONDS</p>
454    /// <p>When you use groupings, Unit says SECONDS and the Value is returned in SECONDS.</p>
455    /// <p>When you do not use groupings, Unit says SECONDS but the Value is returned in MILLISECONDS. For example, if you get a response like this:</p>
456    /// <p><code>{ "Metric": { "Name": "OLDEST_CONTACT_AGE", "Unit": "SECONDS" }, "Value": 24113.0 </code>}</p>
457    /// <p>The actual OLDEST_CONTACT_AGE is 24 seconds.</p>
458    /// <p>When the filter <code>RoutingStepExpression</code> is used, this metric is still calculated from enqueue time. For example, if a contact that has been queued under <code><expression 1></expression></code> for 10 seconds has expired and <code><expression 2></expression></code> becomes active, then <code>OLDEST_CONTACT_AGE</code> for this queue will be counted starting from 10, not 0.</p>
459    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#oldest-real-time">Oldest</a></p>
460    /// </dd>
461    /// <dt>
462    /// SLOTS_ACTIVE
463    /// </dt>
464    /// <dd>
465    /// <p>Unit: COUNT</p>
466    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#active-real-time">Active</a></p>
467    /// </dd>
468    /// <dt>
469    /// SLOTS_AVAILABLE
470    /// </dt>
471    /// <dd>
472    /// <p>Unit: COUNT</p>
473    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#availability-real-time">Availability</a></p>
474    /// </dd>
475    /// </dl>
476    pub fn set_current_metrics(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CurrentMetric>>) -> Self {
477        self.inner = self.inner.set_current_metrics(input);
478        self
479    }
480    /// <p>The metrics to retrieve. Specify the name and unit for each metric. The following metrics are available. For a description of all the metrics, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html">Metrics definitions</a> in the <i>Amazon Connect Administrator Guide</i>.</p>
481    /// <dl>
482    /// <dt>
483    /// AGENTS_AFTER_CONTACT_WORK
484    /// </dt>
485    /// <dd>
486    /// <p>Unit: COUNT</p>
487    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#aftercallwork-real-time">ACW</a></p>
488    /// </dd>
489    /// <dt>
490    /// AGENTS_AVAILABLE
491    /// </dt>
492    /// <dd>
493    /// <p>Unit: COUNT</p>
494    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#available-real-time">Available</a></p>
495    /// </dd>
496    /// <dt>
497    /// AGENTS_ERROR
498    /// </dt>
499    /// <dd>
500    /// <p>Unit: COUNT</p>
501    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#error-real-time">Error</a></p>
502    /// </dd>
503    /// <dt>
504    /// AGENTS_NON_PRODUCTIVE
505    /// </dt>
506    /// <dd>
507    /// <p>Unit: COUNT</p>
508    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#non-productive-time-real-time">NPT (Non-Productive Time)</a></p>
509    /// </dd>
510    /// <dt>
511    /// AGENTS_ON_CALL
512    /// </dt>
513    /// <dd>
514    /// <p>Unit: COUNT</p>
515    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#on-call-real-time">On contact</a></p>
516    /// </dd>
517    /// <dt>
518    /// AGENTS_ON_CONTACT
519    /// </dt>
520    /// <dd>
521    /// <p>Unit: COUNT</p>
522    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#on-call-real-time">On contact</a></p>
523    /// </dd>
524    /// <dt>
525    /// AGENTS_ONLINE
526    /// </dt>
527    /// <dd>
528    /// <p>Unit: COUNT</p>
529    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#online-real-time">Online</a></p>
530    /// </dd>
531    /// <dt>
532    /// AGENTS_STAFFED
533    /// </dt>
534    /// <dd>
535    /// <p>Unit: COUNT</p>
536    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#staffed-real-time">Staffed</a></p>
537    /// </dd>
538    /// <dt>
539    /// CONTACTS_IN_QUEUE
540    /// </dt>
541    /// <dd>
542    /// <p>Unit: COUNT</p>
543    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#in-queue-real-time">In queue</a></p>
544    /// </dd>
545    /// <dt>
546    /// CONTACTS_SCHEDULED
547    /// </dt>
548    /// <dd>
549    /// <p>Unit: COUNT</p>
550    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#scheduled-real-time">Scheduled</a></p>
551    /// </dd>
552    /// <dt>
553    /// OLDEST_CONTACT_AGE
554    /// </dt>
555    /// <dd>
556    /// <p>Unit: SECONDS</p>
557    /// <p>When you use groupings, Unit says SECONDS and the Value is returned in SECONDS.</p>
558    /// <p>When you do not use groupings, Unit says SECONDS but the Value is returned in MILLISECONDS. For example, if you get a response like this:</p>
559    /// <p><code>{ "Metric": { "Name": "OLDEST_CONTACT_AGE", "Unit": "SECONDS" }, "Value": 24113.0 </code>}</p>
560    /// <p>The actual OLDEST_CONTACT_AGE is 24 seconds.</p>
561    /// <p>When the filter <code>RoutingStepExpression</code> is used, this metric is still calculated from enqueue time. For example, if a contact that has been queued under <code><expression 1></expression></code> for 10 seconds has expired and <code><expression 2></expression></code> becomes active, then <code>OLDEST_CONTACT_AGE</code> for this queue will be counted starting from 10, not 0.</p>
562    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#oldest-real-time">Oldest</a></p>
563    /// </dd>
564    /// <dt>
565    /// SLOTS_ACTIVE
566    /// </dt>
567    /// <dd>
568    /// <p>Unit: COUNT</p>
569    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#active-real-time">Active</a></p>
570    /// </dd>
571    /// <dt>
572    /// SLOTS_AVAILABLE
573    /// </dt>
574    /// <dd>
575    /// <p>Unit: COUNT</p>
576    /// <p>Name in real-time metrics report: <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html#availability-real-time">Availability</a></p>
577    /// </dd>
578    /// </dl>
579    pub fn get_current_metrics(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CurrentMetric>> {
580        self.inner.get_current_metrics()
581    }
582    /// <p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>
583    /// <p>The token expires after 5 minutes from the time it is created. Subsequent requests that use the token must use the same request parameters as the request that generated the token.</p>
584    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
585        self.inner = self.inner.next_token(input.into());
586        self
587    }
588    /// <p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>
589    /// <p>The token expires after 5 minutes from the time it is created. Subsequent requests that use the token must use the same request parameters as the request that generated the token.</p>
590    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
591        self.inner = self.inner.set_next_token(input);
592        self
593    }
594    /// <p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>
595    /// <p>The token expires after 5 minutes from the time it is created. Subsequent requests that use the token must use the same request parameters as the request that generated the token.</p>
596    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
597        self.inner.get_next_token()
598    }
599    /// <p>The maximum number of results to return per page.</p>
600    pub fn max_results(mut self, input: i32) -> Self {
601        self.inner = self.inner.max_results(input);
602        self
603    }
604    /// <p>The maximum number of results to return per page.</p>
605    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
606        self.inner = self.inner.set_max_results(input);
607        self
608    }
609    /// <p>The maximum number of results to return per page.</p>
610    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
611        self.inner.get_max_results()
612    }
613    ///
614    /// Appends an item to `SortCriteria`.
615    ///
616    /// To override the contents of this collection use [`set_sort_criteria`](Self::set_sort_criteria).
617    ///
618    /// <p>The way to sort the resulting response based on metrics. You can enter one sort criteria. By default resources are sorted based on <code>AGENTS_ONLINE</code>, <code>DESCENDING</code>. The metric collection is sorted based on the input metrics.</p>
619    /// <p>Note the following:</p>
620    /// <ul>
621    /// <li>
622    /// <p>Sorting on <code>SLOTS_ACTIVE</code> and <code>SLOTS_AVAILABLE</code> is not supported.</p></li>
623    /// </ul>
624    pub fn sort_criteria(mut self, input: crate::types::CurrentMetricSortCriteria) -> Self {
625        self.inner = self.inner.sort_criteria(input);
626        self
627    }
628    /// <p>The way to sort the resulting response based on metrics. You can enter one sort criteria. By default resources are sorted based on <code>AGENTS_ONLINE</code>, <code>DESCENDING</code>. The metric collection is sorted based on the input metrics.</p>
629    /// <p>Note the following:</p>
630    /// <ul>
631    /// <li>
632    /// <p>Sorting on <code>SLOTS_ACTIVE</code> and <code>SLOTS_AVAILABLE</code> is not supported.</p></li>
633    /// </ul>
634    pub fn set_sort_criteria(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CurrentMetricSortCriteria>>) -> Self {
635        self.inner = self.inner.set_sort_criteria(input);
636        self
637    }
638    /// <p>The way to sort the resulting response based on metrics. You can enter one sort criteria. By default resources are sorted based on <code>AGENTS_ONLINE</code>, <code>DESCENDING</code>. The metric collection is sorted based on the input metrics.</p>
639    /// <p>Note the following:</p>
640    /// <ul>
641    /// <li>
642    /// <p>Sorting on <code>SLOTS_ACTIVE</code> and <code>SLOTS_AVAILABLE</code> is not supported.</p></li>
643    /// </ul>
644    pub fn get_sort_criteria(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CurrentMetricSortCriteria>> {
645        self.inner.get_sort_criteria()
646    }
647}