aws_sdk_connect/operation/create_contact/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_contact::_create_contact_output::CreateContactOutputBuilder;
3
4pub use crate::operation::create_contact::_create_contact_input::CreateContactInputBuilder;
5
6impl crate::operation::create_contact::builders::CreateContactInputBuilder {
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::create_contact::CreateContactOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_contact::CreateContactError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_contact();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateContact`.
24///
25/// <important>
26/// <p>Only the VOICE, EMAIL, and TASK channels are supported.</p>
27/// <ul>
28/// <li>
29/// <p>For VOICE: The supported initiation method is <code>TRANSFER</code>. The contacts created with this initiation method have a subtype <code>connect:ExternalAudio</code>.</p></li>
30/// <li>
31/// <p>For EMAIL: The supported initiation methods are <code>OUTBOUND</code>, <code>AGENT_REPLY</code>, and <code>FLOW</code>.</p></li>
32/// <li>
33/// <p>For TASK: The supported initiation method is <code>API</code>. Contacts created with this API have a sub-type of <code>connect:ExternalTask</code>.</p></li>
34/// </ul>
35/// </important>
36/// <p>Creates a new VOICE, EMAIL, or TASK contact.</p>
37/// <p>After a contact is created, you can move it to the desired state by using the <code>InitiateAs</code> parameter. While you can use API to create task contacts that are in the <code>COMPLETED</code> state, you must contact Amazon Web Services Support before using it for bulk import use cases. Bulk import causes your requests to be throttled or fail if your CreateContact limits aren't high enough.</p>
38#[derive(::std::clone::Clone, ::std::fmt::Debug)]
39pub struct CreateContactFluentBuilder {
40    handle: ::std::sync::Arc<crate::client::Handle>,
41    inner: crate::operation::create_contact::builders::CreateContactInputBuilder,
42    config_override: ::std::option::Option<crate::config::Builder>,
43}
44impl
45    crate::client::customize::internal::CustomizableSend<
46        crate::operation::create_contact::CreateContactOutput,
47        crate::operation::create_contact::CreateContactError,
48    > for CreateContactFluentBuilder
49{
50    fn send(
51        self,
52        config_override: crate::config::Builder,
53    ) -> crate::client::customize::internal::BoxFuture<
54        crate::client::customize::internal::SendResult<
55            crate::operation::create_contact::CreateContactOutput,
56            crate::operation::create_contact::CreateContactError,
57        >,
58    > {
59        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
60    }
61}
62impl CreateContactFluentBuilder {
63    /// Creates a new `CreateContactFluentBuilder`.
64    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
65        Self {
66            handle,
67            inner: ::std::default::Default::default(),
68            config_override: ::std::option::Option::None,
69        }
70    }
71    /// Access the CreateContact as a reference.
72    pub fn as_input(&self) -> &crate::operation::create_contact::builders::CreateContactInputBuilder {
73        &self.inner
74    }
75    /// Sends the request and returns the response.
76    ///
77    /// If an error occurs, an `SdkError` will be returned with additional details that
78    /// can be matched against.
79    ///
80    /// By default, any retryable failures will be retried twice. Retry behavior
81    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
82    /// set when configuring the client.
83    pub async fn send(
84        self,
85    ) -> ::std::result::Result<
86        crate::operation::create_contact::CreateContactOutput,
87        ::aws_smithy_runtime_api::client::result::SdkError<
88            crate::operation::create_contact::CreateContactError,
89            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
90        >,
91    > {
92        let input = self
93            .inner
94            .build()
95            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
96        let runtime_plugins = crate::operation::create_contact::CreateContact::operation_runtime_plugins(
97            self.handle.runtime_plugins.clone(),
98            &self.handle.conf,
99            self.config_override,
100        );
101        crate::operation::create_contact::CreateContact::orchestrate(&runtime_plugins, input).await
102    }
103
104    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
105    pub fn customize(
106        self,
107    ) -> crate::client::customize::CustomizableOperation<
108        crate::operation::create_contact::CreateContactOutput,
109        crate::operation::create_contact::CreateContactError,
110        Self,
111    > {
112        crate::client::customize::CustomizableOperation::new(self)
113    }
114    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
115        self.set_config_override(::std::option::Option::Some(config_override.into()));
116        self
117    }
118
119    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
120        self.config_override = config_override;
121        self
122    }
123    /// <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>
124    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125        self.inner = self.inner.instance_id(input.into());
126        self
127    }
128    /// <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>
129    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130        self.inner = self.inner.set_instance_id(input);
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 get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
135        self.inner.get_instance_id()
136    }
137    /// <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>
138    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139        self.inner = self.inner.client_token(input.into());
140        self
141    }
142    /// <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>
143    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
144        self.inner = self.inner.set_client_token(input);
145        self
146    }
147    /// <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>
148    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
149        self.inner.get_client_token()
150    }
151    /// <p>The identifier of the contact in this instance of Amazon Connect.</p>
152    pub fn related_contact_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153        self.inner = self.inner.related_contact_id(input.into());
154        self
155    }
156    /// <p>The identifier of the contact in this instance of Amazon Connect.</p>
157    pub fn set_related_contact_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158        self.inner = self.inner.set_related_contact_id(input);
159        self
160    }
161    /// <p>The identifier of the contact in this instance of Amazon Connect.</p>
162    pub fn get_related_contact_id(&self) -> &::std::option::Option<::std::string::String> {
163        self.inner.get_related_contact_id()
164    }
165    ///
166    /// Adds a key-value pair to `Attributes`.
167    ///
168    /// To override the contents of this collection use [`set_attributes`](Self::set_attributes).
169    ///
170    /// <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>
171    /// <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>
172    pub fn attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
173        self.inner = self.inner.attributes(k.into(), v.into());
174        self
175    }
176    /// <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>
177    /// <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>
178    pub fn set_attributes(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
179        self.inner = self.inner.set_attributes(input);
180        self
181    }
182    /// <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>
183    /// <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>
184    pub fn get_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
185        self.inner.get_attributes()
186    }
187    ///
188    /// Adds a key-value pair to `References`.
189    ///
190    /// To override the contents of this collection use [`set_references`](Self::set_references).
191    ///
192    /// <p>A formatted URL that is shown to an agent in the Contact Control Panel (CCP). Tasks 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>ATTACHMENT</code>.</p>
193    pub fn references(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::Reference) -> Self {
194        self.inner = self.inner.references(k.into(), v);
195        self
196    }
197    /// <p>A formatted URL that is shown to an agent in the Contact Control Panel (CCP). Tasks 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>ATTACHMENT</code>.</p>
198    pub fn set_references(
199        mut self,
200        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Reference>>,
201    ) -> Self {
202        self.inner = self.inner.set_references(input);
203        self
204    }
205    /// <p>A formatted URL that is shown to an agent in the Contact Control Panel (CCP). Tasks 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>ATTACHMENT</code>.</p>
206    pub fn get_references(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Reference>> {
207        self.inner.get_references()
208    }
209    /// <p>The channel for the contact.</p><important>
210    /// <p>The CHAT channel is not supported. The following information is incorrect. We're working to correct it.</p>
211    /// </important>
212    pub fn channel(mut self, input: crate::types::Channel) -> Self {
213        self.inner = self.inner.channel(input);
214        self
215    }
216    /// <p>The channel for the contact.</p><important>
217    /// <p>The CHAT channel is not supported. The following information is incorrect. We're working to correct it.</p>
218    /// </important>
219    pub fn set_channel(mut self, input: ::std::option::Option<crate::types::Channel>) -> Self {
220        self.inner = self.inner.set_channel(input);
221        self
222    }
223    /// <p>The channel for the contact.</p><important>
224    /// <p>The CHAT channel is not supported. The following information is incorrect. We're working to correct it.</p>
225    /// </important>
226    pub fn get_channel(&self) -> &::std::option::Option<crate::types::Channel> {
227        self.inner.get_channel()
228    }
229    /// <p>Indicates how the contact was initiated.</p><important>
230    /// <p>CreateContact only supports the following initiation methods. Valid values by channel are:</p>
231    /// <ul>
232    /// <li>
233    /// <p>For VOICE: <code>TRANSFER</code> and the subtype <code>connect:ExternalAudio</code></p></li>
234    /// <li>
235    /// <p>For EMAIL: <code>OUTBOUND</code> | <code>AGENT_REPLY</code> | <code>FLOW</code></p></li>
236    /// <li>
237    /// <p>For TASK: <code>API</code></p></li>
238    /// </ul>
239    /// <p>The other channels listed below are incorrect. We're working to correct this information.</p>
240    /// </important>
241    pub fn initiation_method(mut self, input: crate::types::ContactInitiationMethod) -> Self {
242        self.inner = self.inner.initiation_method(input);
243        self
244    }
245    /// <p>Indicates how the contact was initiated.</p><important>
246    /// <p>CreateContact only supports the following initiation methods. Valid values by channel are:</p>
247    /// <ul>
248    /// <li>
249    /// <p>For VOICE: <code>TRANSFER</code> and the subtype <code>connect:ExternalAudio</code></p></li>
250    /// <li>
251    /// <p>For EMAIL: <code>OUTBOUND</code> | <code>AGENT_REPLY</code> | <code>FLOW</code></p></li>
252    /// <li>
253    /// <p>For TASK: <code>API</code></p></li>
254    /// </ul>
255    /// <p>The other channels listed below are incorrect. We're working to correct this information.</p>
256    /// </important>
257    pub fn set_initiation_method(mut self, input: ::std::option::Option<crate::types::ContactInitiationMethod>) -> Self {
258        self.inner = self.inner.set_initiation_method(input);
259        self
260    }
261    /// <p>Indicates how the contact was initiated.</p><important>
262    /// <p>CreateContact only supports the following initiation methods. Valid values by channel are:</p>
263    /// <ul>
264    /// <li>
265    /// <p>For VOICE: <code>TRANSFER</code> and the subtype <code>connect:ExternalAudio</code></p></li>
266    /// <li>
267    /// <p>For EMAIL: <code>OUTBOUND</code> | <code>AGENT_REPLY</code> | <code>FLOW</code></p></li>
268    /// <li>
269    /// <p>For TASK: <code>API</code></p></li>
270    /// </ul>
271    /// <p>The other channels listed below are incorrect. We're working to correct this information.</p>
272    /// </important>
273    pub fn get_initiation_method(&self) -> &::std::option::Option<crate::types::ContactInitiationMethod> {
274        self.inner.get_initiation_method()
275    }
276    /// <p>Number of minutes the contact will be active for before expiring</p>
277    pub fn expiry_duration_in_minutes(mut self, input: i32) -> Self {
278        self.inner = self.inner.expiry_duration_in_minutes(input);
279        self
280    }
281    /// <p>Number of minutes the contact will be active for before expiring</p>
282    pub fn set_expiry_duration_in_minutes(mut self, input: ::std::option::Option<i32>) -> Self {
283        self.inner = self.inner.set_expiry_duration_in_minutes(input);
284        self
285    }
286    /// <p>Number of minutes the contact will be active for before expiring</p>
287    pub fn get_expiry_duration_in_minutes(&self) -> &::std::option::Option<i32> {
288        self.inner.get_expiry_duration_in_minutes()
289    }
290    /// <p>User details for the contact</p><important>
291    /// <p>UserInfo is required when creating an EMAIL contact with <code>OUTBOUND</code> and <code>AGENT_REPLY</code> contact initiation methods.</p>
292    /// </important>
293    pub fn user_info(mut self, input: crate::types::UserInfo) -> Self {
294        self.inner = self.inner.user_info(input);
295        self
296    }
297    /// <p>User details for the contact</p><important>
298    /// <p>UserInfo is required when creating an EMAIL contact with <code>OUTBOUND</code> and <code>AGENT_REPLY</code> contact initiation methods.</p>
299    /// </important>
300    pub fn set_user_info(mut self, input: ::std::option::Option<crate::types::UserInfo>) -> Self {
301        self.inner = self.inner.set_user_info(input);
302        self
303    }
304    /// <p>User details for the contact</p><important>
305    /// <p>UserInfo is required when creating an EMAIL contact with <code>OUTBOUND</code> and <code>AGENT_REPLY</code> contact initiation methods.</p>
306    /// </important>
307    pub fn get_user_info(&self) -> &::std::option::Option<crate::types::UserInfo> {
308        self.inner.get_user_info()
309    }
310    /// <p>Initial state of the contact when it's created. Only TASK channel contacts can be initiated with <code>COMPLETED</code> state.</p>
311    pub fn initiate_as(mut self, input: crate::types::InitiateAs) -> Self {
312        self.inner = self.inner.initiate_as(input);
313        self
314    }
315    /// <p>Initial state of the contact when it's created. Only TASK channel contacts can be initiated with <code>COMPLETED</code> state.</p>
316    pub fn set_initiate_as(mut self, input: ::std::option::Option<crate::types::InitiateAs>) -> Self {
317        self.inner = self.inner.set_initiate_as(input);
318        self
319    }
320    /// <p>Initial state of the contact when it's created. Only TASK channel contacts can be initiated with <code>COMPLETED</code> state.</p>
321    pub fn get_initiate_as(&self) -> &::std::option::Option<crate::types::InitiateAs> {
322        self.inner.get_initiate_as()
323    }
324    /// <p>The name of a the contact.</p>
325    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
326        self.inner = self.inner.name(input.into());
327        self
328    }
329    /// <p>The name of a the contact.</p>
330    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
331        self.inner = self.inner.set_name(input);
332        self
333    }
334    /// <p>The name of a the contact.</p>
335    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
336        self.inner.get_name()
337    }
338    /// <p>A description of the contact.</p>
339    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
340        self.inner = self.inner.description(input.into());
341        self
342    }
343    /// <p>A description of the contact.</p>
344    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
345        self.inner = self.inner.set_description(input);
346        self
347    }
348    /// <p>A description of the contact.</p>
349    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
350        self.inner.get_description()
351    }
352    ///
353    /// Adds a key-value pair to `SegmentAttributes`.
354    ///
355    /// To override the contents of this collection use [`set_segment_attributes`](Self::set_segment_attributes).
356    ///
357    /// <p>A set of system defined key-value pairs stored on individual contact segments (unique contact ID) using an attribute map. The attributes are standard Amazon Connect attributes. They can be accessed in flows.</p>
358    /// <p>Attribute keys can include only alphanumeric, -, and _.</p>
359    /// <p>This field can be used to set Segment Contact Expiry as a duration in minutes.</p><note>
360    /// <p>To set contact expiry, a ValueMap 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>
361    /// </note>
362    pub fn segment_attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::SegmentAttributeValue) -> Self {
363        self.inner = self.inner.segment_attributes(k.into(), v);
364        self
365    }
366    /// <p>A set of system defined key-value pairs stored on individual contact segments (unique contact ID) using an attribute map. The attributes are standard Amazon Connect attributes. They can be accessed in flows.</p>
367    /// <p>Attribute keys can include only alphanumeric, -, and _.</p>
368    /// <p>This field can be used to set Segment Contact Expiry as a duration in minutes.</p><note>
369    /// <p>To set contact expiry, a ValueMap 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>
370    /// </note>
371    pub fn set_segment_attributes(
372        mut self,
373        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::SegmentAttributeValue>>,
374    ) -> Self {
375        self.inner = self.inner.set_segment_attributes(input);
376        self
377    }
378    /// <p>A set of system defined key-value pairs stored on individual contact segments (unique contact ID) using an attribute map. The attributes are standard Amazon Connect attributes. They can be accessed in flows.</p>
379    /// <p>Attribute keys can include only alphanumeric, -, and _.</p>
380    /// <p>This field can be used to set Segment Contact Expiry as a duration in minutes.</p><note>
381    /// <p>To set contact expiry, a ValueMap 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>
382    /// </note>
383    pub fn get_segment_attributes(
384        &self,
385    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::SegmentAttributeValue>> {
386        self.inner.get_segment_attributes()
387    }
388    /// <p>The ID of the previous contact when creating a transfer contact. This value can be provided only for external audio contacts. For more information, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/contact-lens-integration.html">Integrate Amazon Connect Contact Lens with external voice systems</a> in the <i>Amazon Connect Administrator Guide</i>.</p>
389    pub fn previous_contact_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
390        self.inner = self.inner.previous_contact_id(input.into());
391        self
392    }
393    /// <p>The ID of the previous contact when creating a transfer contact. This value can be provided only for external audio contacts. For more information, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/contact-lens-integration.html">Integrate Amazon Connect Contact Lens with external voice systems</a> in the <i>Amazon Connect Administrator Guide</i>.</p>
394    pub fn set_previous_contact_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
395        self.inner = self.inner.set_previous_contact_id(input);
396        self
397    }
398    /// <p>The ID of the previous contact when creating a transfer contact. This value can be provided only for external audio contacts. For more information, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/contact-lens-integration.html">Integrate Amazon Connect Contact Lens with external voice systems</a> in the <i>Amazon Connect Administrator Guide</i>.</p>
399    pub fn get_previous_contact_id(&self) -> &::std::option::Option<::std::string::String> {
400        self.inner.get_previous_contact_id()
401    }
402}