aws_sdk_connect/operation/get_contact_metrics/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_contact_metrics::_get_contact_metrics_output::GetContactMetricsOutputBuilder;
3
4pub use crate::operation::get_contact_metrics::_get_contact_metrics_input::GetContactMetricsInputBuilder;
5
6impl crate::operation::get_contact_metrics::builders::GetContactMetricsInputBuilder {
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_contact_metrics::GetContactMetricsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_contact_metrics::GetContactMetricsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_contact_metrics();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetContactMetrics`.
24///
25/// <p>Retrieves the position of the contact in the queue.</p>
26/// <p><b>Use cases</b></p>
27/// <p>Following are common uses cases for position in queue:</p>
28/// <ul>
29/// <li>
30/// <p>Understand the expected wait experience of a contact.</p></li>
31/// <li>
32/// <p>Inform customers of their position in queue and potentially offer a callback.</p></li>
33/// <li>
34/// <p>Make data-driven routing decisions between primary and alternative queues.</p></li>
35/// <li>
36/// <p>Enhance queue visibility and leverage agent proficiencies to streamline contact routing.</p></li>
37/// </ul>
38/// <p><b>Important things to know</b></p>
39/// <ul>
40/// <li>
41/// <p>The only way to retrieve the position of the contact in queue is by using this API. You can't retrieve the position by using flows and attributes.</p></li>
42/// <li>
43/// <p>For more information, see the <a href="https://docs.aws.amazon.com/connect/latest/adminguide/metrics-definitions.html">Position in queue</a> metric in the <i>Amazon Connect Administrator Guide</i>.</p></li>
44/// </ul>
45/// <p><b>Endpoints</b>: See <a href="https://docs.aws.amazon.com/general/latest/gr/connect_region.html">Amazon Connect endpoints and quotas</a>.</p>
46#[derive(::std::clone::Clone, ::std::fmt::Debug)]
47pub struct GetContactMetricsFluentBuilder {
48    handle: ::std::sync::Arc<crate::client::Handle>,
49    inner: crate::operation::get_contact_metrics::builders::GetContactMetricsInputBuilder,
50    config_override: ::std::option::Option<crate::config::Builder>,
51}
52impl
53    crate::client::customize::internal::CustomizableSend<
54        crate::operation::get_contact_metrics::GetContactMetricsOutput,
55        crate::operation::get_contact_metrics::GetContactMetricsError,
56    > for GetContactMetricsFluentBuilder
57{
58    fn send(
59        self,
60        config_override: crate::config::Builder,
61    ) -> crate::client::customize::internal::BoxFuture<
62        crate::client::customize::internal::SendResult<
63            crate::operation::get_contact_metrics::GetContactMetricsOutput,
64            crate::operation::get_contact_metrics::GetContactMetricsError,
65        >,
66    > {
67        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
68    }
69}
70impl GetContactMetricsFluentBuilder {
71    /// Creates a new `GetContactMetricsFluentBuilder`.
72    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
73        Self {
74            handle,
75            inner: ::std::default::Default::default(),
76            config_override: ::std::option::Option::None,
77        }
78    }
79    /// Access the GetContactMetrics as a reference.
80    pub fn as_input(&self) -> &crate::operation::get_contact_metrics::builders::GetContactMetricsInputBuilder {
81        &self.inner
82    }
83    /// Sends the request and returns the response.
84    ///
85    /// If an error occurs, an `SdkError` will be returned with additional details that
86    /// can be matched against.
87    ///
88    /// By default, any retryable failures will be retried twice. Retry behavior
89    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
90    /// set when configuring the client.
91    pub async fn send(
92        self,
93    ) -> ::std::result::Result<
94        crate::operation::get_contact_metrics::GetContactMetricsOutput,
95        ::aws_smithy_runtime_api::client::result::SdkError<
96            crate::operation::get_contact_metrics::GetContactMetricsError,
97            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
98        >,
99    > {
100        let input = self
101            .inner
102            .build()
103            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
104        let runtime_plugins = crate::operation::get_contact_metrics::GetContactMetrics::operation_runtime_plugins(
105            self.handle.runtime_plugins.clone(),
106            &self.handle.conf,
107            self.config_override,
108        );
109        crate::operation::get_contact_metrics::GetContactMetrics::orchestrate(&runtime_plugins, input).await
110    }
111
112    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
113    pub fn customize(
114        self,
115    ) -> crate::client::customize::CustomizableOperation<
116        crate::operation::get_contact_metrics::GetContactMetricsOutput,
117        crate::operation::get_contact_metrics::GetContactMetricsError,
118        Self,
119    > {
120        crate::client::customize::CustomizableOperation::new(self)
121    }
122    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
123        self.set_config_override(::std::option::Option::Some(config_override.into()));
124        self
125    }
126
127    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
128        self.config_override = config_override;
129        self
130    }
131    /// <p>The 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>
132    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        self.inner = self.inner.instance_id(input.into());
134        self
135    }
136    /// <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>
137    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.inner = self.inner.set_instance_id(input);
139        self
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 get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
143        self.inner.get_instance_id()
144    }
145    /// <p>The identifier of the contact in this instance of Amazon Connect.</p>
146    pub fn contact_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147        self.inner = self.inner.contact_id(input.into());
148        self
149    }
150    /// <p>The identifier of the contact in this instance of Amazon Connect.</p>
151    pub fn set_contact_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152        self.inner = self.inner.set_contact_id(input);
153        self
154    }
155    /// <p>The identifier of the contact in this instance of Amazon Connect.</p>
156    pub fn get_contact_id(&self) -> &::std::option::Option<::std::string::String> {
157        self.inner.get_contact_id()
158    }
159    ///
160    /// Appends an item to `Metrics`.
161    ///
162    /// To override the contents of this collection use [`set_metrics`](Self::set_metrics).
163    ///
164    /// <p>A list of contact-level metrics to retrieve.</p>
165    pub fn metrics(mut self, input: crate::types::ContactMetricInfo) -> Self {
166        self.inner = self.inner.metrics(input);
167        self
168    }
169    /// <p>A list of contact-level metrics to retrieve.</p>
170    pub fn set_metrics(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ContactMetricInfo>>) -> Self {
171        self.inner = self.inner.set_metrics(input);
172        self
173    }
174    /// <p>A list of contact-level metrics to retrieve.</p>
175    pub fn get_metrics(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ContactMetricInfo>> {
176        self.inner.get_metrics()
177    }
178}