aws_sdk_connect/operation/associate_contact_with_user/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::associate_contact_with_user::_associate_contact_with_user_output::AssociateContactWithUserOutputBuilder;
3
4pub use crate::operation::associate_contact_with_user::_associate_contact_with_user_input::AssociateContactWithUserInputBuilder;
5
6impl crate::operation::associate_contact_with_user::builders::AssociateContactWithUserInputBuilder {
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::associate_contact_with_user::AssociateContactWithUserOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::associate_contact_with_user::AssociateContactWithUserError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.associate_contact_with_user();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `AssociateContactWithUser`.
24///
25/// <p>Associates a queued contact with an agent.</p>
26/// <p><b>Use cases</b></p>
27/// <p>Following are common uses cases for this API:</p>
28/// <ul>
29/// <li>
30/// <p>Programmatically assign queued contacts to available users.</p></li>
31/// <li>
32/// <p>Leverage the IAM context key <code>connect:PreferredUserArn</code> to restrict contact association to specific preferred user.</p></li>
33/// </ul>
34/// <p><b>Important things to know</b></p>
35/// <ul>
36/// <li>
37/// <p>Use this API with chat, email, and task contacts. It does not support voice contacts.</p></li>
38/// <li>
39/// <p>Use it to associate contacts with users regardless of their current state, including custom states. Ensure your application logic accounts for user availability before making associations.</p></li>
40/// <li>
41/// <p>It honors the IAM context key <code>connect:PreferredUserArn</code> to prevent unauthorized contact associations.</p></li>
42/// <li>
43/// <p>It respects the IAM context key <code>connect:PreferredUserArn</code> to enforce authorization controls and prevent unauthorized contact associations. Verify that your IAM policies are properly configured to support your intended use cases.</p></li>
44/// <li>
45/// <p>The service quota <i>Queues per routing profile per instance</i> applies to manually assigned queues, too. For more information about this quota, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html#connect-quotas">Amazon Connect quotas</a> in the <i>Amazon Connect Administrator Guide</i>.</p></li>
46/// </ul>
47/// <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>
48#[derive(::std::clone::Clone, ::std::fmt::Debug)]
49pub struct AssociateContactWithUserFluentBuilder {
50    handle: ::std::sync::Arc<crate::client::Handle>,
51    inner: crate::operation::associate_contact_with_user::builders::AssociateContactWithUserInputBuilder,
52    config_override: ::std::option::Option<crate::config::Builder>,
53}
54impl
55    crate::client::customize::internal::CustomizableSend<
56        crate::operation::associate_contact_with_user::AssociateContactWithUserOutput,
57        crate::operation::associate_contact_with_user::AssociateContactWithUserError,
58    > for AssociateContactWithUserFluentBuilder
59{
60    fn send(
61        self,
62        config_override: crate::config::Builder,
63    ) -> crate::client::customize::internal::BoxFuture<
64        crate::client::customize::internal::SendResult<
65            crate::operation::associate_contact_with_user::AssociateContactWithUserOutput,
66            crate::operation::associate_contact_with_user::AssociateContactWithUserError,
67        >,
68    > {
69        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
70    }
71}
72impl AssociateContactWithUserFluentBuilder {
73    /// Creates a new `AssociateContactWithUserFluentBuilder`.
74    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
75        Self {
76            handle,
77            inner: ::std::default::Default::default(),
78            config_override: ::std::option::Option::None,
79        }
80    }
81    /// Access the AssociateContactWithUser as a reference.
82    pub fn as_input(&self) -> &crate::operation::associate_contact_with_user::builders::AssociateContactWithUserInputBuilder {
83        &self.inner
84    }
85    /// Sends the request and returns the response.
86    ///
87    /// If an error occurs, an `SdkError` will be returned with additional details that
88    /// can be matched against.
89    ///
90    /// By default, any retryable failures will be retried twice. Retry behavior
91    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
92    /// set when configuring the client.
93    pub async fn send(
94        self,
95    ) -> ::std::result::Result<
96        crate::operation::associate_contact_with_user::AssociateContactWithUserOutput,
97        ::aws_smithy_runtime_api::client::result::SdkError<
98            crate::operation::associate_contact_with_user::AssociateContactWithUserError,
99            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
100        >,
101    > {
102        let input = self
103            .inner
104            .build()
105            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
106        let runtime_plugins = crate::operation::associate_contact_with_user::AssociateContactWithUser::operation_runtime_plugins(
107            self.handle.runtime_plugins.clone(),
108            &self.handle.conf,
109            self.config_override,
110        );
111        crate::operation::associate_contact_with_user::AssociateContactWithUser::orchestrate(&runtime_plugins, input).await
112    }
113
114    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
115    pub fn customize(
116        self,
117    ) -> crate::client::customize::CustomizableOperation<
118        crate::operation::associate_contact_with_user::AssociateContactWithUserOutput,
119        crate::operation::associate_contact_with_user::AssociateContactWithUserError,
120        Self,
121    > {
122        crate::client::customize::CustomizableOperation::new(self)
123    }
124    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
125        self.set_config_override(::std::option::Option::Some(config_override.into()));
126        self
127    }
128
129    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
130        self.config_override = config_override;
131        self
132    }
133    /// <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>
134    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.inner = self.inner.instance_id(input.into());
136        self
137    }
138    /// <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>
139    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.inner = self.inner.set_instance_id(input);
141        self
142    }
143    /// <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>
144    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
145        self.inner.get_instance_id()
146    }
147    /// <p>The identifier of the contact in this instance of Amazon Connect.</p>
148    pub fn contact_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149        self.inner = self.inner.contact_id(input.into());
150        self
151    }
152    /// <p>The identifier of the contact in this instance of Amazon Connect.</p>
153    pub fn set_contact_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.inner = self.inner.set_contact_id(input);
155        self
156    }
157    /// <p>The identifier of the contact in this instance of Amazon Connect.</p>
158    pub fn get_contact_id(&self) -> &::std::option::Option<::std::string::String> {
159        self.inner.get_contact_id()
160    }
161    /// <p>The identifier for the user. This can be the ID or the ARN of the user.</p>
162    pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
163        self.inner = self.inner.user_id(input.into());
164        self
165    }
166    /// <p>The identifier for the user. This can be the ID or the ARN of the user.</p>
167    pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168        self.inner = self.inner.set_user_id(input);
169        self
170    }
171    /// <p>The identifier for the user. This can be the ID or the ARN of the user.</p>
172    pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
173        self.inner.get_user_id()
174    }
175}