aws_sdk_connect/operation/start_outbound_chat_contact/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::start_outbound_chat_contact::_start_outbound_chat_contact_output::StartOutboundChatContactOutputBuilder;
3
4pub use crate::operation::start_outbound_chat_contact::_start_outbound_chat_contact_input::StartOutboundChatContactInputBuilder;
5
6impl crate::operation::start_outbound_chat_contact::builders::StartOutboundChatContactInputBuilder {
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_outbound_chat_contact::StartOutboundChatContactOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::start_outbound_chat_contact::StartOutboundChatContactError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.start_outbound_chat_contact();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `StartOutboundChatContact`.
24///
25/// <p>Initiates a new outbound SMS contact to a customer. Response of this API provides the <code>ContactId</code> of the outbound SMS contact created.</p>
26/// <p><b>SourceEndpoint</b> only supports Endpoints with <code>CONNECT_PHONENUMBER_ARN</code> as Type and <b>DestinationEndpoint</b> only supports Endpoints with <code>TELEPHONE_NUMBER</code> as Type. <b>ContactFlowId</b> initiates the flow to manage the new SMS contact created.</p>
27/// <p>This API can be used to initiate outbound SMS contacts for an agent, or it can also deflect an ongoing contact to an outbound SMS contact by using the <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_StartOutboundChatContact.html">StartOutboundChatContact</a> Flow Action.</p>
28/// <p>For more information about using SMS in Amazon Connect, see the following topics in the <i>Amazon Connect Administrator Guide</i>:</p>
29/// <ul>
30/// <li>
31/// <p><a href="https://docs.aws.amazon.com/connect/latest/adminguide/setup-sms-messaging.html">Set up SMS messaging</a></p></li>
32/// <li>
33/// <p><a href="https://docs.aws.amazon.com/connect/latest/adminguide/sms-number.html">Request an SMS-enabled phone number through AWS End User Messaging SMS</a></p></li>
34/// </ul>
35#[derive(::std::clone::Clone, ::std::fmt::Debug)]
36pub struct StartOutboundChatContactFluentBuilder {
37    handle: ::std::sync::Arc<crate::client::Handle>,
38    inner: crate::operation::start_outbound_chat_contact::builders::StartOutboundChatContactInputBuilder,
39    config_override: ::std::option::Option<crate::config::Builder>,
40}
41impl
42    crate::client::customize::internal::CustomizableSend<
43        crate::operation::start_outbound_chat_contact::StartOutboundChatContactOutput,
44        crate::operation::start_outbound_chat_contact::StartOutboundChatContactError,
45    > for StartOutboundChatContactFluentBuilder
46{
47    fn send(
48        self,
49        config_override: crate::config::Builder,
50    ) -> crate::client::customize::internal::BoxFuture<
51        crate::client::customize::internal::SendResult<
52            crate::operation::start_outbound_chat_contact::StartOutboundChatContactOutput,
53            crate::operation::start_outbound_chat_contact::StartOutboundChatContactError,
54        >,
55    > {
56        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
57    }
58}
59impl StartOutboundChatContactFluentBuilder {
60    /// Creates a new `StartOutboundChatContactFluentBuilder`.
61    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
62        Self {
63            handle,
64            inner: ::std::default::Default::default(),
65            config_override: ::std::option::Option::None,
66        }
67    }
68    /// Access the StartOutboundChatContact as a reference.
69    pub fn as_input(&self) -> &crate::operation::start_outbound_chat_contact::builders::StartOutboundChatContactInputBuilder {
70        &self.inner
71    }
72    /// Sends the request and returns the response.
73    ///
74    /// If an error occurs, an `SdkError` will be returned with additional details that
75    /// can be matched against.
76    ///
77    /// By default, any retryable failures will be retried twice. Retry behavior
78    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
79    /// set when configuring the client.
80    pub async fn send(
81        self,
82    ) -> ::std::result::Result<
83        crate::operation::start_outbound_chat_contact::StartOutboundChatContactOutput,
84        ::aws_smithy_runtime_api::client::result::SdkError<
85            crate::operation::start_outbound_chat_contact::StartOutboundChatContactError,
86            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
87        >,
88    > {
89        let input = self
90            .inner
91            .build()
92            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
93        let runtime_plugins = crate::operation::start_outbound_chat_contact::StartOutboundChatContact::operation_runtime_plugins(
94            self.handle.runtime_plugins.clone(),
95            &self.handle.conf,
96            self.config_override,
97        );
98        crate::operation::start_outbound_chat_contact::StartOutboundChatContact::orchestrate(&runtime_plugins, input).await
99    }
100
101    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
102    pub fn customize(
103        self,
104    ) -> crate::client::customize::CustomizableOperation<
105        crate::operation::start_outbound_chat_contact::StartOutboundChatContactOutput,
106        crate::operation::start_outbound_chat_contact::StartOutboundChatContactError,
107        Self,
108    > {
109        crate::client::customize::CustomizableOperation::new(self)
110    }
111    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
112        self.set_config_override(::std::option::Option::Some(config_override.into()));
113        self
114    }
115
116    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
117        self.config_override = config_override;
118        self
119    }
120    /// <p>Information about the endpoint.</p>
121    pub fn source_endpoint(mut self, input: crate::types::Endpoint) -> Self {
122        self.inner = self.inner.source_endpoint(input);
123        self
124    }
125    /// <p>Information about the endpoint.</p>
126    pub fn set_source_endpoint(mut self, input: ::std::option::Option<crate::types::Endpoint>) -> Self {
127        self.inner = self.inner.set_source_endpoint(input);
128        self
129    }
130    /// <p>Information about the endpoint.</p>
131    pub fn get_source_endpoint(&self) -> &::std::option::Option<crate::types::Endpoint> {
132        self.inner.get_source_endpoint()
133    }
134    /// <p>Information about the endpoint.</p>
135    pub fn destination_endpoint(mut self, input: crate::types::Endpoint) -> Self {
136        self.inner = self.inner.destination_endpoint(input);
137        self
138    }
139    /// <p>Information about the endpoint.</p>
140    pub fn set_destination_endpoint(mut self, input: ::std::option::Option<crate::types::Endpoint>) -> Self {
141        self.inner = self.inner.set_destination_endpoint(input);
142        self
143    }
144    /// <p>Information about the endpoint.</p>
145    pub fn get_destination_endpoint(&self) -> &::std::option::Option<crate::types::Endpoint> {
146        self.inner.get_destination_endpoint()
147    }
148    /// <p>The identifier of the Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.</p>
149    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
150        self.inner = self.inner.instance_id(input.into());
151        self
152    }
153    /// <p>The identifier of the Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.</p>
154    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
155        self.inner = self.inner.set_instance_id(input);
156        self
157    }
158    /// <p>The identifier of the Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.</p>
159    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
160        self.inner.get_instance_id()
161    }
162    ///
163    /// Adds a key-value pair to `SegmentAttributes`.
164    ///
165    /// To override the contents of this collection use [`set_segment_attributes`](Self::set_segment_attributes).
166    ///
167    /// <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>
168    /// <ul>
169    /// <li>
170    /// <p>Attribute keys can include only alphanumeric, <code>-</code>, and <code>_</code>.</p></li>
171    /// <li>
172    /// <p>This field can be used to show channel subtype, such as <code>connect:Guide</code> and <code>connect:SMS</code>.</p></li>
173    /// </ul>
174    pub fn segment_attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::SegmentAttributeValue) -> Self {
175        self.inner = self.inner.segment_attributes(k.into(), v);
176        self
177    }
178    /// <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>
179    /// <ul>
180    /// <li>
181    /// <p>Attribute keys can include only alphanumeric, <code>-</code>, and <code>_</code>.</p></li>
182    /// <li>
183    /// <p>This field can be used to show channel subtype, such as <code>connect:Guide</code> and <code>connect:SMS</code>.</p></li>
184    /// </ul>
185    pub fn set_segment_attributes(
186        mut self,
187        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::SegmentAttributeValue>>,
188    ) -> Self {
189        self.inner = self.inner.set_segment_attributes(input);
190        self
191    }
192    /// <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>
193    /// <ul>
194    /// <li>
195    /// <p>Attribute keys can include only alphanumeric, <code>-</code>, and <code>_</code>.</p></li>
196    /// <li>
197    /// <p>This field can be used to show channel subtype, such as <code>connect:Guide</code> and <code>connect:SMS</code>.</p></li>
198    /// </ul>
199    pub fn get_segment_attributes(
200        &self,
201    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::SegmentAttributeValue>> {
202        self.inner.get_segment_attributes()
203    }
204    ///
205    /// Adds a key-value pair to `Attributes`.
206    ///
207    /// To override the contents of this collection use [`set_attributes`](Self::set_attributes).
208    ///
209    /// <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>
210    pub fn attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
211        self.inner = self.inner.attributes(k.into(), v.into());
212        self
213    }
214    /// <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>
215    pub fn set_attributes(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
216        self.inner = self.inner.set_attributes(input);
217        self
218    }
219    /// <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>
220    pub fn get_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
221        self.inner.get_attributes()
222    }
223    /// <p>The identifier of the flow for the call. To see the ContactFlowId in the Amazon Connect console user interface, on the navigation menu go to <b>Routing, Contact 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>
224    /// <ul>
225    /// <li>
226    /// <p>arn:aws:connect:us-west-2:xxxxxxxxxxxx:instance/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/contact-flow/<b>123ec456-a007-89c0-1234-xxxxxxxxxxxx</b></p></li>
227    /// </ul>
228    pub fn contact_flow_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
229        self.inner = self.inner.contact_flow_id(input.into());
230        self
231    }
232    /// <p>The identifier of the flow for the call. To see the ContactFlowId in the Amazon Connect console user interface, on the navigation menu go to <b>Routing, Contact 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>
233    /// <ul>
234    /// <li>
235    /// <p>arn:aws:connect:us-west-2:xxxxxxxxxxxx:instance/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/contact-flow/<b>123ec456-a007-89c0-1234-xxxxxxxxxxxx</b></p></li>
236    /// </ul>
237    pub fn set_contact_flow_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
238        self.inner = self.inner.set_contact_flow_id(input);
239        self
240    }
241    /// <p>The identifier of the flow for the call. To see the ContactFlowId in the Amazon Connect console user interface, on the navigation menu go to <b>Routing, Contact 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>
242    /// <ul>
243    /// <li>
244    /// <p>arn:aws:connect:us-west-2:xxxxxxxxxxxx:instance/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/contact-flow/<b>123ec456-a007-89c0-1234-xxxxxxxxxxxx</b></p></li>
245    /// </ul>
246    pub fn get_contact_flow_id(&self) -> &::std::option::Option<::std::string::String> {
247        self.inner.get_contact_flow_id()
248    }
249    /// <p>The total duration of the newly started chat session. If not specified, the chat session duration defaults to 25 hour. The minimum configurable time is 60 minutes. The maximum configurable time is 10,080 minutes (7 days).</p>
250    pub fn chat_duration_in_minutes(mut self, input: i32) -> Self {
251        self.inner = self.inner.chat_duration_in_minutes(input);
252        self
253    }
254    /// <p>The total duration of the newly started chat session. If not specified, the chat session duration defaults to 25 hour. The minimum configurable time is 60 minutes. The maximum configurable time is 10,080 minutes (7 days).</p>
255    pub fn set_chat_duration_in_minutes(mut self, input: ::std::option::Option<i32>) -> Self {
256        self.inner = self.inner.set_chat_duration_in_minutes(input);
257        self
258    }
259    /// <p>The total duration of the newly started chat session. If not specified, the chat session duration defaults to 25 hour. The minimum configurable time is 60 minutes. The maximum configurable time is 10,080 minutes (7 days).</p>
260    pub fn get_chat_duration_in_minutes(&self) -> &::std::option::Option<i32> {
261        self.inner.get_chat_duration_in_minutes()
262    }
263    /// <p>The customer's details.</p>
264    pub fn participant_details(mut self, input: crate::types::ParticipantDetails) -> Self {
265        self.inner = self.inner.participant_details(input);
266        self
267    }
268    /// <p>The customer's details.</p>
269    pub fn set_participant_details(mut self, input: ::std::option::Option<crate::types::ParticipantDetails>) -> Self {
270        self.inner = self.inner.set_participant_details(input);
271        self
272    }
273    /// <p>The customer's details.</p>
274    pub fn get_participant_details(&self) -> &::std::option::Option<crate::types::ParticipantDetails> {
275        self.inner.get_participant_details()
276    }
277    /// <p>A chat message.</p>
278    pub fn initial_system_message(mut self, input: crate::types::ChatMessage) -> Self {
279        self.inner = self.inner.initial_system_message(input);
280        self
281    }
282    /// <p>A chat message.</p>
283    pub fn set_initial_system_message(mut self, input: ::std::option::Option<crate::types::ChatMessage>) -> Self {
284        self.inner = self.inner.set_initial_system_message(input);
285        self
286    }
287    /// <p>A chat message.</p>
288    pub fn get_initial_system_message(&self) -> &::std::option::Option<crate::types::ChatMessage> {
289        self.inner.get_initial_system_message()
290    }
291    /// <p>The unique identifier for an Amazon Connect contact. This identifier is related to the contact starting.</p>
292    pub fn related_contact_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
293        self.inner = self.inner.related_contact_id(input.into());
294        self
295    }
296    /// <p>The unique identifier for an Amazon Connect contact. This identifier is related to the contact starting.</p>
297    pub fn set_related_contact_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
298        self.inner = self.inner.set_related_contact_id(input);
299        self
300    }
301    /// <p>The unique identifier for an Amazon Connect contact. This identifier is related to the contact starting.</p>
302    pub fn get_related_contact_id(&self) -> &::std::option::Option<::std::string::String> {
303        self.inner.get_related_contact_id()
304    }
305    ///
306    /// Appends an item to `SupportedMessagingContentTypes`.
307    ///
308    /// To override the contents of this collection use [`set_supported_messaging_content_types`](Self::set_supported_messaging_content_types).
309    ///
310    /// <p>The supported chat message content types. Supported types are:</p>
311    /// <ul>
312    /// <li>
313    /// <p><code>text/plain</code></p></li>
314    /// <li>
315    /// <p><code>text/markdown</code></p></li>
316    /// <li>
317    /// <p><code>application/json, application/vnd.amazonaws.connect.message.interactive</code></p></li>
318    /// <li>
319    /// <p><code>application/vnd.amazonaws.connect.message.interactive.response</code></p></li>
320    /// </ul>
321    /// <p>Content types must always contain <code>text/plain</code>. You can then put any other supported type in the list. For example, all the following lists are valid because they contain <code>text/plain</code>:</p>
322    /// <ul>
323    /// <li>
324    /// <p><code>\[text/plain, text/markdown, application/json\]</code></p></li>
325    /// <li>
326    /// <p><code>\[text/markdown, text/plain\]</code></p></li>
327    /// <li>
328    /// <p><code>\[text/plain, application/json, application/vnd.amazonaws.connect.message.interactive.response\]</code></p></li>
329    /// </ul>
330    pub fn supported_messaging_content_types(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
331        self.inner = self.inner.supported_messaging_content_types(input.into());
332        self
333    }
334    /// <p>The supported chat message content types. Supported types are:</p>
335    /// <ul>
336    /// <li>
337    /// <p><code>text/plain</code></p></li>
338    /// <li>
339    /// <p><code>text/markdown</code></p></li>
340    /// <li>
341    /// <p><code>application/json, application/vnd.amazonaws.connect.message.interactive</code></p></li>
342    /// <li>
343    /// <p><code>application/vnd.amazonaws.connect.message.interactive.response</code></p></li>
344    /// </ul>
345    /// <p>Content types must always contain <code>text/plain</code>. You can then put any other supported type in the list. For example, all the following lists are valid because they contain <code>text/plain</code>:</p>
346    /// <ul>
347    /// <li>
348    /// <p><code>\[text/plain, text/markdown, application/json\]</code></p></li>
349    /// <li>
350    /// <p><code>\[text/markdown, text/plain\]</code></p></li>
351    /// <li>
352    /// <p><code>\[text/plain, application/json, application/vnd.amazonaws.connect.message.interactive.response\]</code></p></li>
353    /// </ul>
354    pub fn set_supported_messaging_content_types(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
355        self.inner = self.inner.set_supported_messaging_content_types(input);
356        self
357    }
358    /// <p>The supported chat message content types. Supported types are:</p>
359    /// <ul>
360    /// <li>
361    /// <p><code>text/plain</code></p></li>
362    /// <li>
363    /// <p><code>text/markdown</code></p></li>
364    /// <li>
365    /// <p><code>application/json, application/vnd.amazonaws.connect.message.interactive</code></p></li>
366    /// <li>
367    /// <p><code>application/vnd.amazonaws.connect.message.interactive.response</code></p></li>
368    /// </ul>
369    /// <p>Content types must always contain <code>text/plain</code>. You can then put any other supported type in the list. For example, all the following lists are valid because they contain <code>text/plain</code>:</p>
370    /// <ul>
371    /// <li>
372    /// <p><code>\[text/plain, text/markdown, application/json\]</code></p></li>
373    /// <li>
374    /// <p><code>\[text/markdown, text/plain\]</code></p></li>
375    /// <li>
376    /// <p><code>\[text/plain, application/json, application/vnd.amazonaws.connect.message.interactive.response\]</code></p></li>
377    /// </ul>
378    pub fn get_supported_messaging_content_types(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
379        self.inner.get_supported_messaging_content_types()
380    }
381    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the AWS 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>. The token is valid for 7 days after creation. If a contact is already started, the contact ID is returned.</p>
382    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
383        self.inner = self.inner.client_token(input.into());
384        self
385    }
386    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the AWS 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>. The token is valid for 7 days after creation. If a contact is already started, the contact ID is returned.</p>
387    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
388        self.inner = self.inner.set_client_token(input);
389        self
390    }
391    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the AWS 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>. The token is valid for 7 days after creation. If a contact is already started, the contact ID is returned.</p>
392    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
393        self.inner.get_client_token()
394    }
395}