Skip to main content

aws_sdk_connect/operation/associate_queue_email_addresses/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::associate_queue_email_addresses::_associate_queue_email_addresses_input::AssociateQueueEmailAddressesInputBuilder;
3
4pub use crate::operation::associate_queue_email_addresses::_associate_queue_email_addresses_output::AssociateQueueEmailAddressesOutputBuilder;
5
6impl crate::operation::associate_queue_email_addresses::builders::AssociateQueueEmailAddressesInputBuilder {
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_queue_email_addresses::AssociateQueueEmailAddressesOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::associate_queue_email_addresses::AssociateQueueEmailAddressesError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.associate_queue_email_addresses();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `AssociateQueueEmailAddresses`.
24///
25/// <p>Associates a set of email addresses with a queue to enable agents to select different "From" (system) email addresses when replying to inbound email contacts or initiating outbound email contacts. This allows agents to handle email contacts across different brands and business units within the same queue.</p>
26/// <p><b>Important things to know</b></p>
27/// <ul>
28/// <li>
29/// <p>You can associate up to 49 additional email addresses with a single queue, plus 1 default outbound email address, for a total of 50.</p></li>
30/// <li>
31/// <p>The email addresses must already exist in the Amazon Connect instance before they can be associated with a queue.</p></li>
32/// <li>
33/// <p>Agents will be able to select from these associated email addresses when handling email contacts in the queue.</p></li>
34/// <li>
35/// <p>For inbound email contacts, agents can select from email addresses associated with the queue where the contact was accepted.</p></li>
36/// <li>
37/// <p>For outbound email contacts, agents can select from email addresses associated with their default outbound queue configured in their routing profile.</p></li>
38/// </ul>
39#[derive(::std::clone::Clone, ::std::fmt::Debug)]
40pub struct AssociateQueueEmailAddressesFluentBuilder {
41    handle: ::std::sync::Arc<crate::client::Handle>,
42    inner: crate::operation::associate_queue_email_addresses::builders::AssociateQueueEmailAddressesInputBuilder,
43    config_override: ::std::option::Option<crate::config::Builder>,
44}
45impl
46    crate::client::customize::internal::CustomizableSend<
47        crate::operation::associate_queue_email_addresses::AssociateQueueEmailAddressesOutput,
48        crate::operation::associate_queue_email_addresses::AssociateQueueEmailAddressesError,
49    > for AssociateQueueEmailAddressesFluentBuilder
50{
51    fn send(
52        self,
53        config_override: crate::config::Builder,
54    ) -> crate::client::customize::internal::BoxFuture<
55        crate::client::customize::internal::SendResult<
56            crate::operation::associate_queue_email_addresses::AssociateQueueEmailAddressesOutput,
57            crate::operation::associate_queue_email_addresses::AssociateQueueEmailAddressesError,
58        >,
59    > {
60        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
61    }
62}
63impl AssociateQueueEmailAddressesFluentBuilder {
64    /// Creates a new `AssociateQueueEmailAddressesFluentBuilder`.
65    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
66        Self {
67            handle,
68            inner: ::std::default::Default::default(),
69            config_override: ::std::option::Option::None,
70        }
71    }
72    /// Access the AssociateQueueEmailAddresses as a reference.
73    pub fn as_input(&self) -> &crate::operation::associate_queue_email_addresses::builders::AssociateQueueEmailAddressesInputBuilder {
74        &self.inner
75    }
76    /// Sends the request and returns the response.
77    ///
78    /// If an error occurs, an `SdkError` will be returned with additional details that
79    /// can be matched against.
80    ///
81    /// By default, any retryable failures will be retried twice. Retry behavior
82    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
83    /// set when configuring the client.
84    pub async fn send(
85        self,
86    ) -> ::std::result::Result<
87        crate::operation::associate_queue_email_addresses::AssociateQueueEmailAddressesOutput,
88        ::aws_smithy_runtime_api::client::result::SdkError<
89            crate::operation::associate_queue_email_addresses::AssociateQueueEmailAddressesError,
90            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
91        >,
92    > {
93        let input = self
94            .inner
95            .build()
96            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
97        let runtime_plugins = crate::operation::associate_queue_email_addresses::AssociateQueueEmailAddresses::operation_runtime_plugins(
98            self.handle.runtime_plugins.clone(),
99            &self.handle.conf,
100            self.config_override,
101        );
102        crate::operation::associate_queue_email_addresses::AssociateQueueEmailAddresses::orchestrate(&runtime_plugins, input).await
103    }
104
105    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
106    pub fn customize(
107        self,
108    ) -> crate::client::customize::CustomizableOperation<
109        crate::operation::associate_queue_email_addresses::AssociateQueueEmailAddressesOutput,
110        crate::operation::associate_queue_email_addresses::AssociateQueueEmailAddressesError,
111        Self,
112    > {
113        crate::client::customize::CustomizableOperation::new(self)
114    }
115    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
116        self.set_config_override(::std::option::Option::Some(config_override.into()));
117        self
118    }
119
120    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
121        self.config_override = config_override;
122        self
123    }
124    /// <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>
125    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126        self.inner = self.inner.instance_id(input.into());
127        self
128    }
129    /// <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>
130    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131        self.inner = self.inner.set_instance_id(input);
132        self
133    }
134    /// <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>
135    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
136        self.inner.get_instance_id()
137    }
138    /// <p>The identifier for the queue.</p>
139    pub fn queue_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
140        self.inner = self.inner.queue_id(input.into());
141        self
142    }
143    /// <p>The identifier for the queue.</p>
144    pub fn set_queue_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
145        self.inner = self.inner.set_queue_id(input);
146        self
147    }
148    /// <p>The identifier for the queue.</p>
149    pub fn get_queue_id(&self) -> &::std::option::Option<::std::string::String> {
150        self.inner.get_queue_id()
151    }
152    ///
153    /// Appends an item to `EmailAddressesConfig`.
154    ///
155    /// To override the contents of this collection use [`set_email_addresses_config`](Self::set_email_addresses_config).
156    ///
157    /// <p>Configuration list containing the email addresses to associate with the queue. Each configuration specifies an email address ID that should be linked to this queue for routing purposes.</p>
158    pub fn email_addresses_config(mut self, input: crate::types::EmailAddressConfig) -> Self {
159        self.inner = self.inner.email_addresses_config(input);
160        self
161    }
162    /// <p>Configuration list containing the email addresses to associate with the queue. Each configuration specifies an email address ID that should be linked to this queue for routing purposes.</p>
163    pub fn set_email_addresses_config(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EmailAddressConfig>>) -> Self {
164        self.inner = self.inner.set_email_addresses_config(input);
165        self
166    }
167    /// <p>Configuration list containing the email addresses to associate with the queue. Each configuration specifies an email address ID that should be linked to this queue for routing purposes.</p>
168    pub fn get_email_addresses_config(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EmailAddressConfig>> {
169        self.inner.get_email_addresses_config()
170    }
171    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
172    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173        self.inner = self.inner.client_token(input.into());
174        self
175    }
176    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
177    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
178        self.inner = self.inner.set_client_token(input);
179        self
180    }
181    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
182    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
183        self.inner.get_client_token()
184    }
185}