aws_sdk_connect/operation/send_chat_integration_event/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::send_chat_integration_event::_send_chat_integration_event_output::SendChatIntegrationEventOutputBuilder;
3
4pub use crate::operation::send_chat_integration_event::_send_chat_integration_event_input::SendChatIntegrationEventInputBuilder;
5
6impl crate::operation::send_chat_integration_event::builders::SendChatIntegrationEventInputBuilder {
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::send_chat_integration_event::SendChatIntegrationEventOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::send_chat_integration_event::SendChatIntegrationEventError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.send_chat_integration_event();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `SendChatIntegrationEvent`.
24///
25/// <p>Processes chat integration events from Amazon Web Services or external integrations to Amazon Connect. A chat integration event includes:</p>
26/// <ul>
27/// <li>
28/// <p>SourceId, DestinationId, and Subtype: a set of identifiers, uniquely representing a chat</p></li>
29/// <li>
30/// <p>ChatEvent: details of the chat action to perform such as sending a message, event, or disconnecting from a chat</p></li>
31/// </ul>
32/// <p>When a chat integration event is sent with chat identifiers that do not map to an active chat contact, a new chat contact is also created before handling chat action.</p>
33/// <p>Access to this API is currently restricted to Amazon Web Services End User Messaging for supporting SMS integration.</p>
34#[derive(::std::clone::Clone, ::std::fmt::Debug)]
35pub struct SendChatIntegrationEventFluentBuilder {
36    handle: ::std::sync::Arc<crate::client::Handle>,
37    inner: crate::operation::send_chat_integration_event::builders::SendChatIntegrationEventInputBuilder,
38    config_override: ::std::option::Option<crate::config::Builder>,
39}
40impl
41    crate::client::customize::internal::CustomizableSend<
42        crate::operation::send_chat_integration_event::SendChatIntegrationEventOutput,
43        crate::operation::send_chat_integration_event::SendChatIntegrationEventError,
44    > for SendChatIntegrationEventFluentBuilder
45{
46    fn send(
47        self,
48        config_override: crate::config::Builder,
49    ) -> crate::client::customize::internal::BoxFuture<
50        crate::client::customize::internal::SendResult<
51            crate::operation::send_chat_integration_event::SendChatIntegrationEventOutput,
52            crate::operation::send_chat_integration_event::SendChatIntegrationEventError,
53        >,
54    > {
55        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
56    }
57}
58impl SendChatIntegrationEventFluentBuilder {
59    /// Creates a new `SendChatIntegrationEventFluentBuilder`.
60    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
61        Self {
62            handle,
63            inner: ::std::default::Default::default(),
64            config_override: ::std::option::Option::None,
65        }
66    }
67    /// Access the SendChatIntegrationEvent as a reference.
68    pub fn as_input(&self) -> &crate::operation::send_chat_integration_event::builders::SendChatIntegrationEventInputBuilder {
69        &self.inner
70    }
71    /// Sends the request and returns the response.
72    ///
73    /// If an error occurs, an `SdkError` will be returned with additional details that
74    /// can be matched against.
75    ///
76    /// By default, any retryable failures will be retried twice. Retry behavior
77    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
78    /// set when configuring the client.
79    pub async fn send(
80        self,
81    ) -> ::std::result::Result<
82        crate::operation::send_chat_integration_event::SendChatIntegrationEventOutput,
83        ::aws_smithy_runtime_api::client::result::SdkError<
84            crate::operation::send_chat_integration_event::SendChatIntegrationEventError,
85            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
86        >,
87    > {
88        let input = self
89            .inner
90            .build()
91            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
92        let runtime_plugins = crate::operation::send_chat_integration_event::SendChatIntegrationEvent::operation_runtime_plugins(
93            self.handle.runtime_plugins.clone(),
94            &self.handle.conf,
95            self.config_override,
96        );
97        crate::operation::send_chat_integration_event::SendChatIntegrationEvent::orchestrate(&runtime_plugins, input).await
98    }
99
100    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
101    pub fn customize(
102        self,
103    ) -> crate::client::customize::CustomizableOperation<
104        crate::operation::send_chat_integration_event::SendChatIntegrationEventOutput,
105        crate::operation::send_chat_integration_event::SendChatIntegrationEventError,
106        Self,
107    > {
108        crate::client::customize::CustomizableOperation::new(self)
109    }
110    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
111        self.set_config_override(::std::option::Option::Some(config_override.into()));
112        self
113    }
114
115    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
116        self.config_override = config_override;
117        self
118    }
119    /// <p>External identifier of chat customer participant, used in part to uniquely identify a chat. For SMS, this is the E164 phone number of the chat customer participant.</p>
120    pub fn source_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.inner = self.inner.source_id(input.into());
122        self
123    }
124    /// <p>External identifier of chat customer participant, used in part to uniquely identify a chat. For SMS, this is the E164 phone number of the chat customer participant.</p>
125    pub fn set_source_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126        self.inner = self.inner.set_source_id(input);
127        self
128    }
129    /// <p>External identifier of chat customer participant, used in part to uniquely identify a chat. For SMS, this is the E164 phone number of the chat customer participant.</p>
130    pub fn get_source_id(&self) -> &::std::option::Option<::std::string::String> {
131        self.inner.get_source_id()
132    }
133    /// <p>Chat system identifier, used in part to uniquely identify chat. This is associated with the Amazon Connect instance and flow to be used to start chats. For Server Migration Service, this is the phone number destination of inbound Server Migration Service messages represented by an Amazon Web Services End User Messaging phone number ARN.</p>
134    pub fn destination_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.inner = self.inner.destination_id(input.into());
136        self
137    }
138    /// <p>Chat system identifier, used in part to uniquely identify chat. This is associated with the Amazon Connect instance and flow to be used to start chats. For Server Migration Service, this is the phone number destination of inbound Server Migration Service messages represented by an Amazon Web Services End User Messaging phone number ARN.</p>
139    pub fn set_destination_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.inner = self.inner.set_destination_id(input);
141        self
142    }
143    /// <p>Chat system identifier, used in part to uniquely identify chat. This is associated with the Amazon Connect instance and flow to be used to start chats. For Server Migration Service, this is the phone number destination of inbound Server Migration Service messages represented by an Amazon Web Services End User Messaging phone number ARN.</p>
144    pub fn get_destination_id(&self) -> &::std::option::Option<::std::string::String> {
145        self.inner.get_destination_id()
146    }
147    /// <p>Classification of a channel. This is used in part to uniquely identify chat.</p>
148    /// <p>Valid value: <code>\["connect:sms", connect:"WhatsApp"\]</code></p>
149    pub fn subtype(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
150        self.inner = self.inner.subtype(input.into());
151        self
152    }
153    /// <p>Classification of a channel. This is used in part to uniquely identify chat.</p>
154    /// <p>Valid value: <code>\["connect:sms", connect:"WhatsApp"\]</code></p>
155    pub fn set_subtype(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156        self.inner = self.inner.set_subtype(input);
157        self
158    }
159    /// <p>Classification of a channel. This is used in part to uniquely identify chat.</p>
160    /// <p>Valid value: <code>\["connect:sms", connect:"WhatsApp"\]</code></p>
161    pub fn get_subtype(&self) -> &::std::option::Option<::std::string::String> {
162        self.inner.get_subtype()
163    }
164    /// <p>Chat integration event payload</p>
165    pub fn event(mut self, input: crate::types::ChatEvent) -> Self {
166        self.inner = self.inner.event(input);
167        self
168    }
169    /// <p>Chat integration event payload</p>
170    pub fn set_event(mut self, input: ::std::option::Option<crate::types::ChatEvent>) -> Self {
171        self.inner = self.inner.set_event(input);
172        self
173    }
174    /// <p>Chat integration event payload</p>
175    pub fn get_event(&self) -> &::std::option::Option<crate::types::ChatEvent> {
176        self.inner.get_event()
177    }
178    /// <p>Contact properties to apply when starting a new chat. If the integration event is handled with an existing chat, this is ignored.</p>
179    pub fn new_session_details(mut self, input: crate::types::NewSessionDetails) -> Self {
180        self.inner = self.inner.new_session_details(input);
181        self
182    }
183    /// <p>Contact properties to apply when starting a new chat. If the integration event is handled with an existing chat, this is ignored.</p>
184    pub fn set_new_session_details(mut self, input: ::std::option::Option<crate::types::NewSessionDetails>) -> Self {
185        self.inner = self.inner.set_new_session_details(input);
186        self
187    }
188    /// <p>Contact properties to apply when starting a new chat. If the integration event is handled with an existing chat, this is ignored.</p>
189    pub fn get_new_session_details(&self) -> &::std::option::Option<crate::types::NewSessionDetails> {
190        self.inner.get_new_session_details()
191    }
192}