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 /// <li>
168 /// <p>Subtypes: 10</p></li>
169 /// <li>
170 /// <p>ValidationTestTypes: 10</p></li>
171 /// </ul>
172 /// <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>
173 /// <p>When using <code>AgentStatuses</code> as filter make sure Queues is added as primary filter.</p>
174 /// <p>When using <code>Subtypes</code> as filter make sure Queues is added as primary filter.</p>
175 /// <p>When using <code>ValidationTestTypes</code> as filter make sure Queues is added as primary filter.</p>
176 /// <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>
177 /// <p>Currently tagging is only supported on the resources that are passed in the filter.</p>
178 pub fn filters(mut self, input: crate::types::Filters) -> Self {
179 self.inner = self.inner.filters(input);
180 self
181 }
182 /// <p>The filters to apply to returned metrics. You can filter up to the following limits:</p>
183 /// <ul>
184 /// <li>
185 /// <p>Queues: 100</p></li>
186 /// <li>
187 /// <p>Routing profiles: 100</p></li>
188 /// <li>
189 /// <p>Channels: 3 (VOICE, CHAT, and TASK channels are supported.)</p></li>
190 /// <li>
191 /// <p>RoutingStepExpressions: 50</p></li>
192 /// <li>
193 /// <p>AgentStatuses: 50</p></li>
194 /// <li>
195 /// <p>Subtypes: 10</p></li>
196 /// <li>
197 /// <p>ValidationTestTypes: 10</p></li>
198 /// </ul>
199 /// <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>
200 /// <p>When using <code>AgentStatuses</code> as filter make sure Queues is added as primary filter.</p>
201 /// <p>When using <code>Subtypes</code> as filter make sure Queues is added as primary filter.</p>
202 /// <p>When using <code>ValidationTestTypes</code> as filter make sure Queues is added as primary filter.</p>
203 /// <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>
204 /// <p>Currently tagging is only supported on the resources that are passed in the filter.</p>
205 pub fn set_filters(mut self, input: ::std::option::Option<crate::types::Filters>) -> Self {
206 self.inner = self.inner.set_filters(input);
207 self
208 }
209 /// <p>The filters to apply to returned metrics. You can filter up to the following limits:</p>
210 /// <ul>
211 /// <li>
212 /// <p>Queues: 100</p></li>
213 /// <li>
214 /// <p>Routing profiles: 100</p></li>
215 /// <li>
216 /// <p>Channels: 3 (VOICE, CHAT, and TASK channels are supported.)</p></li>
217 /// <li>
218 /// <p>RoutingStepExpressions: 50</p></li>
219 /// <li>
220 /// <p>AgentStatuses: 50</p></li>
221 /// <li>
222 /// <p>Subtypes: 10</p></li>
223 /// <li>
224 /// <p>ValidationTestTypes: 10</p></li>
225 /// </ul>
226 /// <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>
227 /// <p>When using <code>AgentStatuses</code> as filter make sure Queues is added as primary filter.</p>
228 /// <p>When using <code>Subtypes</code> as filter make sure Queues is added as primary filter.</p>
229 /// <p>When using <code>ValidationTestTypes</code> as filter make sure Queues is added as primary filter.</p>
230 /// <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>
231 /// <p>Currently tagging is only supported on the resources that are passed in the filter.</p>
232 pub fn get_filters(&self) -> &::std::option::Option<crate::types::Filters> {
233 self.inner.get_filters()
234 }
235 ///
236 /// Appends an item to `Groupings`.
237 ///
238 /// To override the contents of this collection use [`set_groupings`](Self::set_groupings).
239 ///
240 /// <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>
241 /// <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>
242 /// <ul>
243 /// <li>
244 /// <p>If you group by <code>CHANNEL</code>, you should include a Channels filter. VOICE, CHAT, and TASK channels are supported.</p></li>
245 /// <li>
246 /// <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>
247 /// <li>
248 /// <p>If you group by <code>SUBTYPE</code> or <code>VALIDATION_TEST_TYPE</code> as secondary grouping then you must include <code>QUEUE</code> as primary grouping and use Queue as filter</p></li>
249 /// <li>
250 /// <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>
251 /// <li>
252 /// <p>When using the <code>RoutingStepExpression</code> filter, group by <code>ROUTING_STEP_EXPRESSION</code> is required.</p></li>
253 /// </ul>
254 pub fn groupings(mut self, input: crate::types::Grouping) -> Self {
255 self.inner = self.inner.groupings(input);
256 self
257 }
258 /// <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>
259 /// <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>
260 /// <ul>
261 /// <li>
262 /// <p>If you group by <code>CHANNEL</code>, you should include a Channels filter. VOICE, CHAT, and TASK channels are supported.</p></li>
263 /// <li>
264 /// <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>
265 /// <li>
266 /// <p>If you group by <code>SUBTYPE</code> or <code>VALIDATION_TEST_TYPE</code> as secondary grouping then you must include <code>QUEUE</code> as primary grouping and use Queue as filter</p></li>
267 /// <li>
268 /// <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>
269 /// <li>
270 /// <p>When using the <code>RoutingStepExpression</code> filter, group by <code>ROUTING_STEP_EXPRESSION</code> is required.</p></li>
271 /// </ul>
272 pub fn set_groupings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Grouping>>) -> Self {
273 self.inner = self.inner.set_groupings(input);
274 self
275 }
276 /// <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>
277 /// <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>
278 /// <ul>
279 /// <li>
280 /// <p>If you group by <code>CHANNEL</code>, you should include a Channels filter. VOICE, CHAT, and TASK channels are supported.</p></li>
281 /// <li>
282 /// <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>
283 /// <li>
284 /// <p>If you group by <code>SUBTYPE</code> or <code>VALIDATION_TEST_TYPE</code> as secondary grouping then you must include <code>QUEUE</code> as primary grouping and use Queue as filter</p></li>
285 /// <li>
286 /// <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>
287 /// <li>
288 /// <p>When using the <code>RoutingStepExpression</code> filter, group by <code>ROUTING_STEP_EXPRESSION</code> is required.</p></li>
289 /// </ul>
290 pub fn get_groupings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Grouping>> {
291 self.inner.get_groupings()
292 }
293 ///
294 /// Appends an item to `CurrentMetrics`.
295 ///
296 /// To override the contents of this collection use [`set_current_metrics`](Self::set_current_metrics).
297 ///
298 /// <p>The metrics to retrieve. Specify the name or metricId, 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><note>
299 /// <p>MetricId should be used to reference custom metrics or out of the box metrics as Arn. If using MetricId, the limit is 10 MetricId per request.</p>
300 /// </note>
301 /// <dl>
302 /// <dt>
303 /// AGENTS_AFTER_CONTACT_WORK
304 /// </dt>
305 /// <dd>
306 /// <p>Unit: COUNT</p>
307 /// <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>
308 /// </dd>
309 /// <dt>
310 /// AGENTS_AVAILABLE
311 /// </dt>
312 /// <dd>
313 /// <p>Unit: COUNT</p>
314 /// <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>
315 /// </dd>
316 /// <dt>
317 /// AGENTS_ERROR
318 /// </dt>
319 /// <dd>
320 /// <p>Unit: COUNT</p>
321 /// <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>
322 /// </dd>
323 /// <dt>
324 /// AGENTS_NON_PRODUCTIVE
325 /// </dt>
326 /// <dd>
327 /// <p>Unit: COUNT</p>
328 /// <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>
329 /// </dd>
330 /// <dt>
331 /// AGENTS_ON_CALL
332 /// </dt>
333 /// <dd>
334 /// <p>Unit: COUNT</p>
335 /// <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>
336 /// </dd>
337 /// <dt>
338 /// AGENTS_ON_CONTACT
339 /// </dt>
340 /// <dd>
341 /// <p>Unit: COUNT</p>
342 /// <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>
343 /// </dd>
344 /// <dt>
345 /// AGENTS_ONLINE
346 /// </dt>
347 /// <dd>
348 /// <p>Unit: COUNT</p>
349 /// <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>
350 /// </dd>
351 /// <dt>
352 /// AGENTS_STAFFED
353 /// </dt>
354 /// <dd>
355 /// <p>Unit: COUNT</p>
356 /// <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>
357 /// </dd>
358 /// <dt>
359 /// CONTACTS_IN_QUEUE
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#in-queue-real-time">In queue</a></p>
364 /// </dd>
365 /// <dt>
366 /// CONTACTS_SCHEDULED
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#scheduled-real-time">Scheduled</a></p>
371 /// </dd>
372 /// <dt>
373 /// OLDEST_CONTACT_AGE
374 /// </dt>
375 /// <dd>
376 /// <p>Unit: SECONDS</p>
377 /// <p>When you use groupings, Unit says SECONDS and the Value is returned in SECONDS.</p>
378 /// <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>
379 /// <p><code>{ "Metric": { "Name": "OLDEST_CONTACT_AGE", "Unit": "SECONDS" }, "Value": 24113.0 </code>}</p>
380 /// <p>The actual OLDEST_CONTACT_AGE is 24 seconds.</p>
381 /// <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>
382 /// <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>
383 /// </dd>
384 /// <dt>
385 /// SLOTS_ACTIVE
386 /// </dt>
387 /// <dd>
388 /// <p>Unit: COUNT</p>
389 /// <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>
390 /// </dd>
391 /// <dt>
392 /// SLOTS_AVAILABLE
393 /// </dt>
394 /// <dd>
395 /// <p>Unit: COUNT</p>
396 /// <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>
397 /// </dd>
398 /// </dl>
399 pub fn current_metrics(mut self, input: crate::types::CurrentMetric) -> Self {
400 self.inner = self.inner.current_metrics(input);
401 self
402 }
403 /// <p>The metrics to retrieve. Specify the name or metricId, 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><note>
404 /// <p>MetricId should be used to reference custom metrics or out of the box metrics as Arn. If using MetricId, the limit is 10 MetricId per request.</p>
405 /// </note>
406 /// <dl>
407 /// <dt>
408 /// AGENTS_AFTER_CONTACT_WORK
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#aftercallwork-real-time">ACW</a></p>
413 /// </dd>
414 /// <dt>
415 /// AGENTS_AVAILABLE
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#available-real-time">Available</a></p>
420 /// </dd>
421 /// <dt>
422 /// AGENTS_ERROR
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#error-real-time">Error</a></p>
427 /// </dd>
428 /// <dt>
429 /// AGENTS_NON_PRODUCTIVE
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#non-productive-time-real-time">NPT (Non-Productive Time)</a></p>
434 /// </dd>
435 /// <dt>
436 /// AGENTS_ON_CALL
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#on-call-real-time">On contact</a></p>
441 /// </dd>
442 /// <dt>
443 /// AGENTS_ON_CONTACT
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#on-call-real-time">On contact</a></p>
448 /// </dd>
449 /// <dt>
450 /// AGENTS_ONLINE
451 /// </dt>
452 /// <dd>
453 /// <p>Unit: COUNT</p>
454 /// <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>
455 /// </dd>
456 /// <dt>
457 /// AGENTS_STAFFED
458 /// </dt>
459 /// <dd>
460 /// <p>Unit: COUNT</p>
461 /// <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>
462 /// </dd>
463 /// <dt>
464 /// CONTACTS_IN_QUEUE
465 /// </dt>
466 /// <dd>
467 /// <p>Unit: COUNT</p>
468 /// <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>
469 /// </dd>
470 /// <dt>
471 /// CONTACTS_SCHEDULED
472 /// </dt>
473 /// <dd>
474 /// <p>Unit: COUNT</p>
475 /// <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>
476 /// </dd>
477 /// <dt>
478 /// OLDEST_CONTACT_AGE
479 /// </dt>
480 /// <dd>
481 /// <p>Unit: SECONDS</p>
482 /// <p>When you use groupings, Unit says SECONDS and the Value is returned in SECONDS.</p>
483 /// <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>
484 /// <p><code>{ "Metric": { "Name": "OLDEST_CONTACT_AGE", "Unit": "SECONDS" }, "Value": 24113.0 </code>}</p>
485 /// <p>The actual OLDEST_CONTACT_AGE is 24 seconds.</p>
486 /// <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>
487 /// <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>
488 /// </dd>
489 /// <dt>
490 /// SLOTS_ACTIVE
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#active-real-time">Active</a></p>
495 /// </dd>
496 /// <dt>
497 /// SLOTS_AVAILABLE
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#availability-real-time">Availability</a></p>
502 /// </dd>
503 /// </dl>
504 pub fn set_current_metrics(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CurrentMetric>>) -> Self {
505 self.inner = self.inner.set_current_metrics(input);
506 self
507 }
508 /// <p>The metrics to retrieve. Specify the name or metricId, 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><note>
509 /// <p>MetricId should be used to reference custom metrics or out of the box metrics as Arn. If using MetricId, the limit is 10 MetricId per request.</p>
510 /// </note>
511 /// <dl>
512 /// <dt>
513 /// AGENTS_AFTER_CONTACT_WORK
514 /// </dt>
515 /// <dd>
516 /// <p>Unit: COUNT</p>
517 /// <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>
518 /// </dd>
519 /// <dt>
520 /// AGENTS_AVAILABLE
521 /// </dt>
522 /// <dd>
523 /// <p>Unit: COUNT</p>
524 /// <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>
525 /// </dd>
526 /// <dt>
527 /// AGENTS_ERROR
528 /// </dt>
529 /// <dd>
530 /// <p>Unit: COUNT</p>
531 /// <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>
532 /// </dd>
533 /// <dt>
534 /// AGENTS_NON_PRODUCTIVE
535 /// </dt>
536 /// <dd>
537 /// <p>Unit: COUNT</p>
538 /// <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>
539 /// </dd>
540 /// <dt>
541 /// AGENTS_ON_CALL
542 /// </dt>
543 /// <dd>
544 /// <p>Unit: COUNT</p>
545 /// <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>
546 /// </dd>
547 /// <dt>
548 /// AGENTS_ON_CONTACT
549 /// </dt>
550 /// <dd>
551 /// <p>Unit: COUNT</p>
552 /// <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>
553 /// </dd>
554 /// <dt>
555 /// AGENTS_ONLINE
556 /// </dt>
557 /// <dd>
558 /// <p>Unit: COUNT</p>
559 /// <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>
560 /// </dd>
561 /// <dt>
562 /// AGENTS_STAFFED
563 /// </dt>
564 /// <dd>
565 /// <p>Unit: COUNT</p>
566 /// <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>
567 /// </dd>
568 /// <dt>
569 /// CONTACTS_IN_QUEUE
570 /// </dt>
571 /// <dd>
572 /// <p>Unit: COUNT</p>
573 /// <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>
574 /// </dd>
575 /// <dt>
576 /// CONTACTS_SCHEDULED
577 /// </dt>
578 /// <dd>
579 /// <p>Unit: COUNT</p>
580 /// <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>
581 /// </dd>
582 /// <dt>
583 /// OLDEST_CONTACT_AGE
584 /// </dt>
585 /// <dd>
586 /// <p>Unit: SECONDS</p>
587 /// <p>When you use groupings, Unit says SECONDS and the Value is returned in SECONDS.</p>
588 /// <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>
589 /// <p><code>{ "Metric": { "Name": "OLDEST_CONTACT_AGE", "Unit": "SECONDS" }, "Value": 24113.0 </code>}</p>
590 /// <p>The actual OLDEST_CONTACT_AGE is 24 seconds.</p>
591 /// <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>
592 /// <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>
593 /// </dd>
594 /// <dt>
595 /// SLOTS_ACTIVE
596 /// </dt>
597 /// <dd>
598 /// <p>Unit: COUNT</p>
599 /// <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>
600 /// </dd>
601 /// <dt>
602 /// SLOTS_AVAILABLE
603 /// </dt>
604 /// <dd>
605 /// <p>Unit: COUNT</p>
606 /// <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>
607 /// </dd>
608 /// </dl>
609 pub fn get_current_metrics(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CurrentMetric>> {
610 self.inner.get_current_metrics()
611 }
612 /// <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>
613 /// <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>
614 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
615 self.inner = self.inner.next_token(input.into());
616 self
617 }
618 /// <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>
619 /// <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>
620 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
621 self.inner = self.inner.set_next_token(input);
622 self
623 }
624 /// <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>
625 /// <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>
626 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
627 self.inner.get_next_token()
628 }
629 /// <p>The maximum number of results to return per page.</p>
630 pub fn max_results(mut self, input: i32) -> Self {
631 self.inner = self.inner.max_results(input);
632 self
633 }
634 /// <p>The maximum number of results to return per page.</p>
635 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
636 self.inner = self.inner.set_max_results(input);
637 self
638 }
639 /// <p>The maximum number of results to return per page.</p>
640 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
641 self.inner.get_max_results()
642 }
643 ///
644 /// Appends an item to `SortCriteria`.
645 ///
646 /// To override the contents of this collection use [`set_sort_criteria`](Self::set_sort_criteria).
647 ///
648 /// <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>
649 /// <p>Note the following:</p>
650 /// <ul>
651 /// <li>
652 /// <p>Sorting on <code>SLOTS_ACTIVE</code> and <code>SLOTS_AVAILABLE</code> is not supported.</p></li>
653 /// </ul>
654 pub fn sort_criteria(mut self, input: crate::types::CurrentMetricSortCriteria) -> Self {
655 self.inner = self.inner.sort_criteria(input);
656 self
657 }
658 /// <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>
659 /// <p>Note the following:</p>
660 /// <ul>
661 /// <li>
662 /// <p>Sorting on <code>SLOTS_ACTIVE</code> and <code>SLOTS_AVAILABLE</code> is not supported.</p></li>
663 /// </ul>
664 pub fn set_sort_criteria(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CurrentMetricSortCriteria>>) -> Self {
665 self.inner = self.inner.set_sort_criteria(input);
666 self
667 }
668 /// <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>
669 /// <p>Note the following:</p>
670 /// <ul>
671 /// <li>
672 /// <p>Sorting on <code>SLOTS_ACTIVE</code> and <code>SLOTS_AVAILABLE</code> is not supported.</p></li>
673 /// </ul>
674 pub fn get_sort_criteria(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CurrentMetricSortCriteria>> {
675 self.inner.get_sort_criteria()
676 }
677}