aws_sdk_connect/operation/start_email_contact/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::start_email_contact::_start_email_contact_output::StartEmailContactOutputBuilder;
3
4pub use crate::operation::start_email_contact::_start_email_contact_input::StartEmailContactInputBuilder;
5
6impl crate::operation::start_email_contact::builders::StartEmailContactInputBuilder {
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::start_email_contact::StartEmailContactOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::start_email_contact::StartEmailContactError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.start_email_contact();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `StartEmailContact`.
24///
25/// <p>Creates an inbound email contact and initiates a flow to start the email contact for the customer. Response of this API provides the ContactId of the email contact created.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct StartEmailContactFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::start_email_contact::builders::StartEmailContactInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::start_email_contact::StartEmailContactOutput,
35        crate::operation::start_email_contact::StartEmailContactError,
36    > for StartEmailContactFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::start_email_contact::StartEmailContactOutput,
44            crate::operation::start_email_contact::StartEmailContactError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl StartEmailContactFluentBuilder {
51    /// Creates a new `StartEmailContactFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the StartEmailContact as a reference.
60    pub fn as_input(&self) -> &crate::operation::start_email_contact::builders::StartEmailContactInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::start_email_contact::StartEmailContactOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::start_email_contact::StartEmailContactError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::start_email_contact::StartEmailContact::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::start_email_contact::StartEmailContact::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::start_email_contact::StartEmailContactOutput,
97        crate::operation::start_email_contact::StartEmailContactError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <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>
112    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.instance_id(input.into());
114        self
115    }
116    /// <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>
117    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_instance_id(input);
119        self
120    }
121    /// <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>
122    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_instance_id()
124    }
125    /// <p>The email address of the customer.</p>
126    pub fn from_email_address(mut self, input: crate::types::EmailAddressInfo) -> Self {
127        self.inner = self.inner.from_email_address(input);
128        self
129    }
130    /// <p>The email address of the customer.</p>
131    pub fn set_from_email_address(mut self, input: ::std::option::Option<crate::types::EmailAddressInfo>) -> Self {
132        self.inner = self.inner.set_from_email_address(input);
133        self
134    }
135    /// <p>The email address of the customer.</p>
136    pub fn get_from_email_address(&self) -> &::std::option::Option<crate::types::EmailAddressInfo> {
137        self.inner.get_from_email_address()
138    }
139    /// <p>The email address associated with the Amazon Connect instance.</p>
140    pub fn destination_email_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.destination_email_address(input.into());
142        self
143    }
144    /// <p>The email address associated with the Amazon Connect instance.</p>
145    pub fn set_destination_email_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_destination_email_address(input);
147        self
148    }
149    /// <p>The email address associated with the Amazon Connect instance.</p>
150    pub fn get_destination_email_address(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_destination_email_address()
152    }
153    /// <p>A description of the email contact.</p>
154    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.description(input.into());
156        self
157    }
158    /// <p>A description of the email contact.</p>
159    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_description(input);
161        self
162    }
163    /// <p>A description of the email contact.</p>
164    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_description()
166    }
167    ///
168    /// Adds a key-value pair to `References`.
169    ///
170    /// To override the contents of this collection use [`set_references`](Self::set_references).
171    ///
172    /// <p>A formatted URL that is shown to an agent in the Contact Control Panel (CCP). Emails can have the following reference types at the time of creation: <code>URL</code> | <code>NUMBER</code> | <code>STRING</code> | <code>DATE</code>. <code>EMAIL</code> | <code>EMAIL_MESSAGE</code> |<code>ATTACHMENT</code> are not a supported reference type during email creation.</p>
173    pub fn references(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::Reference) -> Self {
174        self.inner = self.inner.references(k.into(), v);
175        self
176    }
177    /// <p>A formatted URL that is shown to an agent in the Contact Control Panel (CCP). Emails can have the following reference types at the time of creation: <code>URL</code> | <code>NUMBER</code> | <code>STRING</code> | <code>DATE</code>. <code>EMAIL</code> | <code>EMAIL_MESSAGE</code> |<code>ATTACHMENT</code> are not a supported reference type during email creation.</p>
178    pub fn set_references(
179        mut self,
180        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Reference>>,
181    ) -> Self {
182        self.inner = self.inner.set_references(input);
183        self
184    }
185    /// <p>A formatted URL that is shown to an agent in the Contact Control Panel (CCP). Emails can have the following reference types at the time of creation: <code>URL</code> | <code>NUMBER</code> | <code>STRING</code> | <code>DATE</code>. <code>EMAIL</code> | <code>EMAIL_MESSAGE</code> |<code>ATTACHMENT</code> are not a supported reference type during email creation.</p>
186    pub fn get_references(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Reference>> {
187        self.inner.get_references()
188    }
189    /// <p>The name of a email that is shown to an agent in the Contact Control Panel (CCP).</p>
190    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191        self.inner = self.inner.name(input.into());
192        self
193    }
194    /// <p>The name of a email that is shown to an agent in the Contact Control Panel (CCP).</p>
195    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
196        self.inner = self.inner.set_name(input);
197        self
198    }
199    /// <p>The name of a email that is shown to an agent in the Contact Control Panel (CCP).</p>
200    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
201        self.inner.get_name()
202    }
203    /// <p>The email message body to be sent to the newly created email.</p>
204    pub fn email_message(mut self, input: crate::types::InboundEmailContent) -> Self {
205        self.inner = self.inner.email_message(input);
206        self
207    }
208    /// <p>The email message body to be sent to the newly created email.</p>
209    pub fn set_email_message(mut self, input: ::std::option::Option<crate::types::InboundEmailContent>) -> Self {
210        self.inner = self.inner.set_email_message(input);
211        self
212    }
213    /// <p>The email message body to be sent to the newly created email.</p>
214    pub fn get_email_message(&self) -> &::std::option::Option<crate::types::InboundEmailContent> {
215        self.inner.get_email_message()
216    }
217    /// <p>The additional recipients address of the email.</p>
218    pub fn additional_recipients(mut self, input: crate::types::InboundAdditionalRecipients) -> Self {
219        self.inner = self.inner.additional_recipients(input);
220        self
221    }
222    /// <p>The additional recipients address of the email.</p>
223    pub fn set_additional_recipients(mut self, input: ::std::option::Option<crate::types::InboundAdditionalRecipients>) -> Self {
224        self.inner = self.inner.set_additional_recipients(input);
225        self
226    }
227    /// <p>The additional recipients address of the email.</p>
228    pub fn get_additional_recipients(&self) -> &::std::option::Option<crate::types::InboundAdditionalRecipients> {
229        self.inner.get_additional_recipients()
230    }
231    ///
232    /// Appends an item to `Attachments`.
233    ///
234    /// To override the contents of this collection use [`set_attachments`](Self::set_attachments).
235    ///
236    /// <p>List of S3 presigned URLs of email attachments and their file name.</p>
237    pub fn attachments(mut self, input: crate::types::EmailAttachment) -> Self {
238        self.inner = self.inner.attachments(input);
239        self
240    }
241    /// <p>List of S3 presigned URLs of email attachments and their file name.</p>
242    pub fn set_attachments(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EmailAttachment>>) -> Self {
243        self.inner = self.inner.set_attachments(input);
244        self
245    }
246    /// <p>List of S3 presigned URLs of email attachments and their file name.</p>
247    pub fn get_attachments(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EmailAttachment>> {
248        self.inner.get_attachments()
249    }
250    /// <p>The identifier of the flow for initiating the emails. To see the ContactFlowId in the Amazon Connect admin website, on the navigation menu go to <b>Routing</b>, <b>Flows</b>. Choose the flow. On the flow page, under the name of the flow, choose <b>Show additional flow information</b>. The ContactFlowId is the last part of the ARN, shown here in bold:</p>
251    /// <p>arn:aws:connect:us-west-2:xxxxxxxxxxxx:instance/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/contact-flow/<b>846ec553-a005-41c0-8341-xxxxxxxxxxxx</b></p>
252    pub fn contact_flow_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
253        self.inner = self.inner.contact_flow_id(input.into());
254        self
255    }
256    /// <p>The identifier of the flow for initiating the emails. To see the ContactFlowId in the Amazon Connect admin website, on the navigation menu go to <b>Routing</b>, <b>Flows</b>. Choose the flow. On the flow page, under the name of the flow, choose <b>Show additional flow information</b>. The ContactFlowId is the last part of the ARN, shown here in bold:</p>
257    /// <p>arn:aws:connect:us-west-2:xxxxxxxxxxxx:instance/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/contact-flow/<b>846ec553-a005-41c0-8341-xxxxxxxxxxxx</b></p>
258    pub fn set_contact_flow_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
259        self.inner = self.inner.set_contact_flow_id(input);
260        self
261    }
262    /// <p>The identifier of the flow for initiating the emails. To see the ContactFlowId in the Amazon Connect admin website, on the navigation menu go to <b>Routing</b>, <b>Flows</b>. Choose the flow. On the flow page, under the name of the flow, choose <b>Show additional flow information</b>. The ContactFlowId is the last part of the ARN, shown here in bold:</p>
263    /// <p>arn:aws:connect:us-west-2:xxxxxxxxxxxx:instance/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/contact-flow/<b>846ec553-a005-41c0-8341-xxxxxxxxxxxx</b></p>
264    pub fn get_contact_flow_id(&self) -> &::std::option::Option<::std::string::String> {
265        self.inner.get_contact_flow_id()
266    }
267    /// <p>The contactId that is related to this contact. Linking emails together by using <code>RelatedContactID</code> copies over contact attributes from the related email contact to the new email contact. All updates to user-defined attributes in the new email contact are limited to the individual contact ID. There are no limits to the number of contacts that can be linked by using <code>RelatedContactId</code>.</p>
268    pub fn related_contact_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
269        self.inner = self.inner.related_contact_id(input.into());
270        self
271    }
272    /// <p>The contactId that is related to this contact. Linking emails together by using <code>RelatedContactID</code> copies over contact attributes from the related email contact to the new email contact. All updates to user-defined attributes in the new email contact are limited to the individual contact ID. There are no limits to the number of contacts that can be linked by using <code>RelatedContactId</code>.</p>
273    pub fn set_related_contact_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
274        self.inner = self.inner.set_related_contact_id(input);
275        self
276    }
277    /// <p>The contactId that is related to this contact. Linking emails together by using <code>RelatedContactID</code> copies over contact attributes from the related email contact to the new email contact. All updates to user-defined attributes in the new email contact are limited to the individual contact ID. There are no limits to the number of contacts that can be linked by using <code>RelatedContactId</code>.</p>
278    pub fn get_related_contact_id(&self) -> &::std::option::Option<::std::string::String> {
279        self.inner.get_related_contact_id()
280    }
281    ///
282    /// Adds a key-value pair to `Attributes`.
283    ///
284    /// To override the contents of this collection use [`set_attributes`](Self::set_attributes).
285    ///
286    /// <p>A custom key-value pair using an attribute map. The attributes are standard Amazon Connect attributes, and can be accessed in flows just like any other contact attributes.</p>
287    /// <p>There can be up to 32,768 UTF-8 bytes across all key-value pairs per contact. Attribute keys can include only alphanumeric, dash, and underscore characters.</p>
288    pub fn attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
289        self.inner = self.inner.attributes(k.into(), v.into());
290        self
291    }
292    /// <p>A custom key-value pair using an attribute map. The attributes are standard Amazon Connect attributes, and can be accessed in flows just like any other contact attributes.</p>
293    /// <p>There can be up to 32,768 UTF-8 bytes across all key-value pairs per contact. Attribute keys can include only alphanumeric, dash, and underscore characters.</p>
294    pub fn set_attributes(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
295        self.inner = self.inner.set_attributes(input);
296        self
297    }
298    /// <p>A custom key-value pair using an attribute map. The attributes are standard Amazon Connect attributes, and can be accessed in flows just like any other contact attributes.</p>
299    /// <p>There can be up to 32,768 UTF-8 bytes across all key-value pairs per contact. Attribute keys can include only alphanumeric, dash, and underscore characters.</p>
300    pub fn get_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
301        self.inner.get_attributes()
302    }
303    ///
304    /// Adds a key-value pair to `SegmentAttributes`.
305    ///
306    /// To override the contents of this collection use [`set_segment_attributes`](Self::set_segment_attributes).
307    ///
308    /// <p>A set of system defined key-value pairs stored on individual contact segments using an attribute map. The attributes are standard Amazon Connect attributes. They can be accessed in flows.</p>
309    /// <p>Attribute keys can include only alphanumeric, -, and _.</p>
310    /// <p>This field can be used to show channel subtype, such as <code>connect:Guide</code>.</p><note>
311    /// <p>To set contact expiry, a <code>ValueMap</code> must be specified containing the integer number of minutes the contact will be active for before expiring, with <code>SegmentAttributes</code> like { <code> "connect:ContactExpiry": {"ValueMap" : { "ExpiryDuration": { "ValueInteger":135}}}}</code>.</p>
312    /// </note>
313    pub fn segment_attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::SegmentAttributeValue) -> Self {
314        self.inner = self.inner.segment_attributes(k.into(), v);
315        self
316    }
317    /// <p>A set of system defined key-value pairs stored on individual contact segments using an attribute map. The attributes are standard Amazon Connect attributes. They can be accessed in flows.</p>
318    /// <p>Attribute keys can include only alphanumeric, -, and _.</p>
319    /// <p>This field can be used to show channel subtype, such as <code>connect:Guide</code>.</p><note>
320    /// <p>To set contact expiry, a <code>ValueMap</code> must be specified containing the integer number of minutes the contact will be active for before expiring, with <code>SegmentAttributes</code> like { <code> "connect:ContactExpiry": {"ValueMap" : { "ExpiryDuration": { "ValueInteger":135}}}}</code>.</p>
321    /// </note>
322    pub fn set_segment_attributes(
323        mut self,
324        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::SegmentAttributeValue>>,
325    ) -> Self {
326        self.inner = self.inner.set_segment_attributes(input);
327        self
328    }
329    /// <p>A set of system defined key-value pairs stored on individual contact segments using an attribute map. The attributes are standard Amazon Connect attributes. They can be accessed in flows.</p>
330    /// <p>Attribute keys can include only alphanumeric, -, and _.</p>
331    /// <p>This field can be used to show channel subtype, such as <code>connect:Guide</code>.</p><note>
332    /// <p>To set contact expiry, a <code>ValueMap</code> must be specified containing the integer number of minutes the contact will be active for before expiring, with <code>SegmentAttributes</code> like { <code> "connect:ContactExpiry": {"ValueMap" : { "ExpiryDuration": { "ValueInteger":135}}}}</code>.</p>
333    /// </note>
334    pub fn get_segment_attributes(
335        &self,
336    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::SegmentAttributeValue>> {
337        self.inner.get_segment_attributes()
338    }
339    /// <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>
340    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
341        self.inner = self.inner.client_token(input.into());
342        self
343    }
344    /// <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>
345    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
346        self.inner = self.inner.set_client_token(input);
347        self
348    }
349    /// <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>
350    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
351        self.inner.get_client_token()
352    }
353}