aws_sdk_connectparticipant/operation/create_participant_connection/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_participant_connection::_create_participant_connection_output::CreateParticipantConnectionOutputBuilder;
3
4pub use crate::operation::create_participant_connection::_create_participant_connection_input::CreateParticipantConnectionInputBuilder;
5
6impl crate::operation::create_participant_connection::builders::CreateParticipantConnectionInputBuilder {
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_participant_connection::CreateParticipantConnectionOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_participant_connection::CreateParticipantConnectionError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_participant_connection();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateParticipantConnection`.
24///
25/// <p>Creates the participant's connection.</p>
26/// <p>For security recommendations, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/security-best-practices.html#bp-security-chat">Amazon Connect Chat security best practices</a>.</p>
27/// <p>For WebRTC security recommendations, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/security-best-practices.html#bp-webrtc-security">Amazon Connect WebRTC security best practices</a>.</p><note>
28/// <p><code>ParticipantToken</code> is used for invoking this API instead of <code>ConnectionToken</code>.</p>
29/// </note>
30/// <p>The participant token is valid for the lifetime of the participant – until they are part of a contact. For WebRTC participants, if they leave or are disconnected for 60 seconds, a new participant needs to be created using the <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_CreateParticipant.html">CreateParticipant</a> API.</p>
31/// <p><b>For <code>WEBSOCKET</code> Type</b>:</p>
32/// <p>The response URL for has a connect expiry timeout of 100s. Clients must manually connect to the returned websocket URL and subscribe to the desired topic.</p>
33/// <p>For chat, you need to publish the following on the established websocket connection:</p>
34/// <p><code>{"topic":"aws/subscribe","content":{"topics":\["aws/chat"\]}}</code></p>
35/// <p>Upon websocket URL expiry, as specified in the response ConnectionExpiry parameter, clients need to call this API again to obtain a new websocket URL and perform the same steps as before.</p>
36/// <p>The expiry time for the connection token is different than the <code>ChatDurationInMinutes</code>. Expiry time for the connection token is 1 day.</p>
37/// <p><b>For <code>WEBRTC_CONNECTION</code> Type</b>:</p>
38/// <p>The response includes connection data required for the client application to join the call using the Amazon Chime SDK client libraries. The WebRTCConnection response contains Meeting and Attendee information needed to establish the media connection.</p>
39/// <p>The attendee join token in WebRTCConnection response is valid for the lifetime of the participant in the call. If a participant leaves or is disconnected for 60 seconds, their participant credentials will no longer be valid, and a new participant will need to be created to rejoin the call.</p>
40/// <p><b>Message streaming support</b>: This API can also be used together with the <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_StartContactStreaming.html">StartContactStreaming</a> API to create a participant connection for chat contacts that are not using a websocket. For more information about message streaming, <a href="https://docs.aws.amazon.com/connect/latest/adminguide/chat-message-streaming.html">Enable real-time chat message streaming</a> in the <i>Amazon Connect Administrator Guide</i>.</p>
41/// <p><b>Multi-user web, in-app, video calling support</b>:</p>
42/// <p>For WebRTC calls, this API is used in conjunction with the CreateParticipant API to enable multi-party calling. The StartWebRTCContact API creates the initial contact and routes it to an agent, while CreateParticipant adds additional participants to the ongoing call. For more information about multi-party WebRTC calls, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/enable-multiuser-inapp.html">Enable multi-user web, in-app, and video calling</a> in the <i>Amazon Connect Administrator Guide</i>.</p>
43/// <p><b>Feature specifications</b>: For information about feature specifications, such as the allowed number of open websocket connections per participant or maximum number of WebRTC participants, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html#feature-limits">Feature specifications</a> in the <i>Amazon Connect Administrator Guide</i>.</p><note>
44/// <p>The Amazon Connect Participant Service APIs do not use <a href="https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html">Signature Version 4 authentication</a>.</p>
45/// </note>
46#[derive(::std::clone::Clone, ::std::fmt::Debug)]
47pub struct CreateParticipantConnectionFluentBuilder {
48    handle: ::std::sync::Arc<crate::client::Handle>,
49    inner: crate::operation::create_participant_connection::builders::CreateParticipantConnectionInputBuilder,
50    config_override: ::std::option::Option<crate::config::Builder>,
51}
52impl
53    crate::client::customize::internal::CustomizableSend<
54        crate::operation::create_participant_connection::CreateParticipantConnectionOutput,
55        crate::operation::create_participant_connection::CreateParticipantConnectionError,
56    > for CreateParticipantConnectionFluentBuilder
57{
58    fn send(
59        self,
60        config_override: crate::config::Builder,
61    ) -> crate::client::customize::internal::BoxFuture<
62        crate::client::customize::internal::SendResult<
63            crate::operation::create_participant_connection::CreateParticipantConnectionOutput,
64            crate::operation::create_participant_connection::CreateParticipantConnectionError,
65        >,
66    > {
67        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
68    }
69}
70impl CreateParticipantConnectionFluentBuilder {
71    /// Creates a new `CreateParticipantConnectionFluentBuilder`.
72    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
73        Self {
74            handle,
75            inner: ::std::default::Default::default(),
76            config_override: ::std::option::Option::None,
77        }
78    }
79    /// Access the CreateParticipantConnection as a reference.
80    pub fn as_input(&self) -> &crate::operation::create_participant_connection::builders::CreateParticipantConnectionInputBuilder {
81        &self.inner
82    }
83    /// Sends the request and returns the response.
84    ///
85    /// If an error occurs, an `SdkError` will be returned with additional details that
86    /// can be matched against.
87    ///
88    /// By default, any retryable failures will be retried twice. Retry behavior
89    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
90    /// set when configuring the client.
91    pub async fn send(
92        self,
93    ) -> ::std::result::Result<
94        crate::operation::create_participant_connection::CreateParticipantConnectionOutput,
95        ::aws_smithy_runtime_api::client::result::SdkError<
96            crate::operation::create_participant_connection::CreateParticipantConnectionError,
97            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
98        >,
99    > {
100        let input = self
101            .inner
102            .build()
103            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
104        let runtime_plugins = crate::operation::create_participant_connection::CreateParticipantConnection::operation_runtime_plugins(
105            self.handle.runtime_plugins.clone(),
106            &self.handle.conf,
107            self.config_override,
108        );
109        crate::operation::create_participant_connection::CreateParticipantConnection::orchestrate(&runtime_plugins, input).await
110    }
111
112    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
113    pub fn customize(
114        self,
115    ) -> crate::client::customize::CustomizableOperation<
116        crate::operation::create_participant_connection::CreateParticipantConnectionOutput,
117        crate::operation::create_participant_connection::CreateParticipantConnectionError,
118        Self,
119    > {
120        crate::client::customize::CustomizableOperation::new(self)
121    }
122    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
123        self.set_config_override(::std::option::Option::Some(config_override.into()));
124        self
125    }
126
127    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
128        self.config_override = config_override;
129        self
130    }
131    ///
132    /// Appends an item to `Type`.
133    ///
134    /// To override the contents of this collection use [`set_type`](Self::set_type).
135    ///
136    /// <p>Type of connection information required. If you need <code>CONNECTION_CREDENTIALS</code> along with marking participant as connected, pass <code>CONNECTION_CREDENTIALS</code> in <code>Type</code>.</p>
137    pub fn r#type(mut self, input: crate::types::ConnectionType) -> Self {
138        self.inner = self.inner.r#type(input);
139        self
140    }
141    /// <p>Type of connection information required. If you need <code>CONNECTION_CREDENTIALS</code> along with marking participant as connected, pass <code>CONNECTION_CREDENTIALS</code> in <code>Type</code>.</p>
142    pub fn set_type(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ConnectionType>>) -> Self {
143        self.inner = self.inner.set_type(input);
144        self
145    }
146    /// <p>Type of connection information required. If you need <code>CONNECTION_CREDENTIALS</code> along with marking participant as connected, pass <code>CONNECTION_CREDENTIALS</code> in <code>Type</code>.</p>
147    pub fn get_type(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ConnectionType>> {
148        self.inner.get_type()
149    }
150    /// <p>This is a header parameter.</p>
151    /// <p>The ParticipantToken as obtained from <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_StartChatContact.html">StartChatContact</a> API response.</p>
152    pub fn participant_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153        self.inner = self.inner.participant_token(input.into());
154        self
155    }
156    /// <p>This is a header parameter.</p>
157    /// <p>The ParticipantToken as obtained from <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_StartChatContact.html">StartChatContact</a> API response.</p>
158    pub fn set_participant_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159        self.inner = self.inner.set_participant_token(input);
160        self
161    }
162    /// <p>This is a header parameter.</p>
163    /// <p>The ParticipantToken as obtained from <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_StartChatContact.html">StartChatContact</a> API response.</p>
164    pub fn get_participant_token(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_participant_token()
166    }
167    /// <p>Amazon Connect Participant is used to mark the participant as connected for customer participant in message streaming, as well as for agent or manager participant in non-streaming chats.</p>
168    pub fn connect_participant(mut self, input: bool) -> Self {
169        self.inner = self.inner.connect_participant(input);
170        self
171    }
172    /// <p>Amazon Connect Participant is used to mark the participant as connected for customer participant in message streaming, as well as for agent or manager participant in non-streaming chats.</p>
173    pub fn set_connect_participant(mut self, input: ::std::option::Option<bool>) -> Self {
174        self.inner = self.inner.set_connect_participant(input);
175        self
176    }
177    /// <p>Amazon Connect Participant is used to mark the participant as connected for customer participant in message streaming, as well as for agent or manager participant in non-streaming chats.</p>
178    pub fn get_connect_participant(&self) -> &::std::option::Option<bool> {
179        self.inner.get_connect_participant()
180    }
181}