aws_sdk_connect/operation/start_web_rtc_contact/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::start_web_rtc_contact::_start_web_rtc_contact_output::StartWebRtcContactOutputBuilder;
3
4pub use crate::operation::start_web_rtc_contact::_start_web_rtc_contact_input::StartWebRtcContactInputBuilder;
5
6impl crate::operation::start_web_rtc_contact::builders::StartWebRtcContactInputBuilder {
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_web_rtc_contact::StartWebRtcContactOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::start_web_rtc_contact::StartWebRTCContactError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.start_web_rtc_contact();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `StartWebRTCContact`.
24///
25/// <p>Places an inbound in-app, web, or video call to a contact, and then initiates the flow. It performs the actions in the flow that are specified (in ContactFlowId) and present in the Amazon Connect instance (specified as InstanceId).</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct StartWebRTCContactFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::start_web_rtc_contact::builders::StartWebRtcContactInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::start_web_rtc_contact::StartWebRtcContactOutput,
35        crate::operation::start_web_rtc_contact::StartWebRTCContactError,
36    > for StartWebRTCContactFluentBuilder
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_web_rtc_contact::StartWebRtcContactOutput,
44            crate::operation::start_web_rtc_contact::StartWebRTCContactError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl StartWebRTCContactFluentBuilder {
51    /// Creates a new `StartWebRTCContactFluentBuilder`.
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 StartWebRTCContact as a reference.
60    pub fn as_input(&self) -> &crate::operation::start_web_rtc_contact::builders::StartWebRtcContactInputBuilder {
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_web_rtc_contact::StartWebRtcContactOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::start_web_rtc_contact::StartWebRTCContactError,
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_web_rtc_contact::StartWebRTCContact::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::start_web_rtc_contact::StartWebRTCContact::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_web_rtc_contact::StartWebRtcContactOutput,
97        crate::operation::start_web_rtc_contact::StartWebRTCContactError,
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    ///
112    /// Adds a key-value pair to `Attributes`.
113    ///
114    /// To override the contents of this collection use [`set_attributes`](Self::set_attributes).
115    ///
116    /// <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>
117    /// <p>There can be up to 32,768 UTF-8 bytes across all key-value pairs per contact. Attribute keys can include only alphanumeric, -, and _ characters.</p>
118    pub fn attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.inner = self.inner.attributes(k.into(), v.into());
120        self
121    }
122    /// <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>
123    /// <p>There can be up to 32,768 UTF-8 bytes across all key-value pairs per contact. Attribute keys can include only alphanumeric, -, and _ characters.</p>
124    pub fn set_attributes(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
125        self.inner = self.inner.set_attributes(input);
126        self
127    }
128    /// <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>
129    /// <p>There can be up to 32,768 UTF-8 bytes across all key-value pairs per contact. Attribute keys can include only alphanumeric, -, and _ characters.</p>
130    pub fn get_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
131        self.inner.get_attributes()
132    }
133    /// <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>
134    /// <p>The token is valid for 7 days after creation. If a contact is already started, the contact ID is returned.</p>
135    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136        self.inner = self.inner.client_token(input.into());
137        self
138    }
139    /// <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>
140    /// <p>The token is valid for 7 days after creation. If a contact is already started, the contact ID is returned.</p>
141    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142        self.inner = self.inner.set_client_token(input);
143        self
144    }
145    /// <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>
146    /// <p>The token is valid for 7 days after creation. If a contact is already started, the contact ID is returned.</p>
147    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
148        self.inner.get_client_token()
149    }
150    /// <p>The identifier of the flow for the call. 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>
151    /// <p>arn:aws:connect:us-west-2:xxxxxxxxxxxx:instance/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/contact-flow/<b>846ec553-a005-41c0-8341-xxxxxxxxxxxx</b></p>
152    pub fn contact_flow_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153        self.inner = self.inner.contact_flow_id(input.into());
154        self
155    }
156    /// <p>The identifier of the flow for the call. 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>
157    /// <p>arn:aws:connect:us-west-2:xxxxxxxxxxxx:instance/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/contact-flow/<b>846ec553-a005-41c0-8341-xxxxxxxxxxxx</b></p>
158    pub fn set_contact_flow_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159        self.inner = self.inner.set_contact_flow_id(input);
160        self
161    }
162    /// <p>The identifier of the flow for the call. 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>
163    /// <p>arn:aws:connect:us-west-2:xxxxxxxxxxxx:instance/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/contact-flow/<b>846ec553-a005-41c0-8341-xxxxxxxxxxxx</b></p>
164    pub fn get_contact_flow_id(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_contact_flow_id()
166    }
167    /// <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>
168    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
169        self.inner = self.inner.instance_id(input.into());
170        self
171    }
172    /// <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>
173    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
174        self.inner = self.inner.set_instance_id(input);
175        self
176    }
177    /// <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>
178    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
179        self.inner.get_instance_id()
180    }
181    /// <p>Information about the video sharing capabilities of the participants (customer, agent).</p>
182    pub fn allowed_capabilities(mut self, input: crate::types::AllowedCapabilities) -> Self {
183        self.inner = self.inner.allowed_capabilities(input);
184        self
185    }
186    /// <p>Information about the video sharing capabilities of the participants (customer, agent).</p>
187    pub fn set_allowed_capabilities(mut self, input: ::std::option::Option<crate::types::AllowedCapabilities>) -> Self {
188        self.inner = self.inner.set_allowed_capabilities(input);
189        self
190    }
191    /// <p>Information about the video sharing capabilities of the participants (customer, agent).</p>
192    pub fn get_allowed_capabilities(&self) -> &::std::option::Option<crate::types::AllowedCapabilities> {
193        self.inner.get_allowed_capabilities()
194    }
195    /// <p>The customer's details.</p>
196    pub fn participant_details(mut self, input: crate::types::ParticipantDetails) -> Self {
197        self.inner = self.inner.participant_details(input);
198        self
199    }
200    /// <p>The customer's details.</p>
201    pub fn set_participant_details(mut self, input: ::std::option::Option<crate::types::ParticipantDetails>) -> Self {
202        self.inner = self.inner.set_participant_details(input);
203        self
204    }
205    /// <p>The customer's details.</p>
206    pub fn get_participant_details(&self) -> &::std::option::Option<crate::types::ParticipantDetails> {
207        self.inner.get_participant_details()
208    }
209    /// <p>The unique identifier for an Amazon Connect contact. This identifier is related to the contact starting.</p>
210    pub fn related_contact_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
211        self.inner = self.inner.related_contact_id(input.into());
212        self
213    }
214    /// <p>The unique identifier for an Amazon Connect contact. This identifier is related to the contact starting.</p>
215    pub fn set_related_contact_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
216        self.inner = self.inner.set_related_contact_id(input);
217        self
218    }
219    /// <p>The unique identifier for an Amazon Connect contact. This identifier is related to the contact starting.</p>
220    pub fn get_related_contact_id(&self) -> &::std::option::Option<::std::string::String> {
221        self.inner.get_related_contact_id()
222    }
223    ///
224    /// Adds a key-value pair to `References`.
225    ///
226    /// To override the contents of this collection use [`set_references`](Self::set_references).
227    ///
228    /// <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> is not a supported reference type during task creation.</p>
229    pub fn references(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::Reference) -> Self {
230        self.inner = self.inner.references(k.into(), v);
231        self
232    }
233    /// <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> is not a supported reference type during task creation.</p>
234    pub fn set_references(
235        mut self,
236        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Reference>>,
237    ) -> Self {
238        self.inner = self.inner.set_references(input);
239        self
240    }
241    /// <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> is not a supported reference type during task creation.</p>
242    pub fn get_references(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Reference>> {
243        self.inner.get_references()
244    }
245    /// <p>A description of the task that is shown to an agent in the Contact Control Panel (CCP).</p>
246    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
247        self.inner = self.inner.description(input.into());
248        self
249    }
250    /// <p>A description of the task that is shown to an agent in the Contact Control Panel (CCP).</p>
251    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
252        self.inner = self.inner.set_description(input);
253        self
254    }
255    /// <p>A description of the task that is shown to an agent in the Contact Control Panel (CCP).</p>
256    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
257        self.inner.get_description()
258    }
259}