aws_sdk_connectparticipant/operation/send_event/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::send_event::_send_event_output::SendEventOutputBuilder;
3
4pub use crate::operation::send_event::_send_event_input::SendEventInputBuilder;
5
6impl crate::operation::send_event::builders::SendEventInputBuilder {
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_event::SendEventOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::send_event::SendEventError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.send_event();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `SendEvent`.
24///
25/// <note>
26/// <p>The <code>application/vnd.amazonaws.connect.event.connection.acknowledged</code> ContentType is no longer maintained since December 31, 2024. This event has been migrated to the <a href="https://docs.aws.amazon.com/connect-participant/latest/APIReference/API_CreateParticipantConnection.html">CreateParticipantConnection</a> API using the <code>ConnectParticipant</code> field.</p>
27/// </note>
28/// <p>Sends an event. Message receipts are not supported when there are more than two active participants in the chat. Using the SendEvent API for message receipts when a supervisor is barged-in will result in a conflict exception.</p>
29/// <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><note>
30/// <p><code>ConnectionToken</code> is used for invoking this API instead of <code>ParticipantToken</code>.</p>
31/// </note>
32/// <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>
33#[derive(::std::clone::Clone, ::std::fmt::Debug)]
34pub struct SendEventFluentBuilder {
35 handle: ::std::sync::Arc<crate::client::Handle>,
36 inner: crate::operation::send_event::builders::SendEventInputBuilder,
37 config_override: ::std::option::Option<crate::config::Builder>,
38}
39impl crate::client::customize::internal::CustomizableSend<crate::operation::send_event::SendEventOutput, crate::operation::send_event::SendEventError>
40 for SendEventFluentBuilder
41{
42 fn send(
43 self,
44 config_override: crate::config::Builder,
45 ) -> crate::client::customize::internal::BoxFuture<
46 crate::client::customize::internal::SendResult<crate::operation::send_event::SendEventOutput, crate::operation::send_event::SendEventError>,
47 > {
48 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49 }
50}
51impl SendEventFluentBuilder {
52 /// Creates a new `SendEventFluentBuilder`.
53 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54 Self {
55 handle,
56 inner: ::std::default::Default::default(),
57 config_override: ::std::option::Option::None,
58 }
59 }
60 /// Access the SendEvent as a reference.
61 pub fn as_input(&self) -> &crate::operation::send_event::builders::SendEventInputBuilder {
62 &self.inner
63 }
64 /// Sends the request and returns the response.
65 ///
66 /// If an error occurs, an `SdkError` will be returned with additional details that
67 /// can be matched against.
68 ///
69 /// By default, any retryable failures will be retried twice. Retry behavior
70 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71 /// set when configuring the client.
72 pub async fn send(
73 self,
74 ) -> ::std::result::Result<
75 crate::operation::send_event::SendEventOutput,
76 ::aws_smithy_runtime_api::client::result::SdkError<
77 crate::operation::send_event::SendEventError,
78 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79 >,
80 > {
81 let input = self
82 .inner
83 .build()
84 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85 let runtime_plugins = crate::operation::send_event::SendEvent::operation_runtime_plugins(
86 self.handle.runtime_plugins.clone(),
87 &self.handle.conf,
88 self.config_override,
89 );
90 crate::operation::send_event::SendEvent::orchestrate(&runtime_plugins, input).await
91 }
92
93 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94 pub fn customize(
95 self,
96 ) -> crate::client::customize::CustomizableOperation<
97 crate::operation::send_event::SendEventOutput,
98 crate::operation::send_event::SendEventError,
99 Self,
100 > {
101 crate::client::customize::CustomizableOperation::new(self)
102 }
103 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104 self.set_config_override(::std::option::Option::Some(config_override.into()));
105 self
106 }
107
108 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109 self.config_override = config_override;
110 self
111 }
112 /// <p>The content type of the request. Supported types are:</p>
113 /// <ul>
114 /// <li>
115 /// <p>application/vnd.amazonaws.connect.event.typing</p></li>
116 /// <li>
117 /// <p>application/vnd.amazonaws.connect.event.connection.acknowledged (is no longer maintained since December 31, 2024)</p></li>
118 /// <li>
119 /// <p>application/vnd.amazonaws.connect.event.message.delivered</p></li>
120 /// <li>
121 /// <p>application/vnd.amazonaws.connect.event.message.read</p></li>
122 /// </ul>
123 pub fn content_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124 self.inner = self.inner.content_type(input.into());
125 self
126 }
127 /// <p>The content type of the request. Supported types are:</p>
128 /// <ul>
129 /// <li>
130 /// <p>application/vnd.amazonaws.connect.event.typing</p></li>
131 /// <li>
132 /// <p>application/vnd.amazonaws.connect.event.connection.acknowledged (is no longer maintained since December 31, 2024)</p></li>
133 /// <li>
134 /// <p>application/vnd.amazonaws.connect.event.message.delivered</p></li>
135 /// <li>
136 /// <p>application/vnd.amazonaws.connect.event.message.read</p></li>
137 /// </ul>
138 pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139 self.inner = self.inner.set_content_type(input);
140 self
141 }
142 /// <p>The content type of the request. Supported types are:</p>
143 /// <ul>
144 /// <li>
145 /// <p>application/vnd.amazonaws.connect.event.typing</p></li>
146 /// <li>
147 /// <p>application/vnd.amazonaws.connect.event.connection.acknowledged (is no longer maintained since December 31, 2024)</p></li>
148 /// <li>
149 /// <p>application/vnd.amazonaws.connect.event.message.delivered</p></li>
150 /// <li>
151 /// <p>application/vnd.amazonaws.connect.event.message.read</p></li>
152 /// </ul>
153 pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
154 self.inner.get_content_type()
155 }
156 /// <p>The content of the event to be sent (for example, message text). For content related to message receipts, this is supported in the form of a JSON string.</p>
157 /// <p>Sample Content: "{\"messageId\":\"11111111-aaaa-bbbb-cccc-EXAMPLE01234\"}"</p>
158 pub fn content(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159 self.inner = self.inner.content(input.into());
160 self
161 }
162 /// <p>The content of the event to be sent (for example, message text). For content related to message receipts, this is supported in the form of a JSON string.</p>
163 /// <p>Sample Content: "{\"messageId\":\"11111111-aaaa-bbbb-cccc-EXAMPLE01234\"}"</p>
164 pub fn set_content(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165 self.inner = self.inner.set_content(input);
166 self
167 }
168 /// <p>The content of the event to be sent (for example, message text). For content related to message receipts, this is supported in the form of a JSON string.</p>
169 /// <p>Sample Content: "{\"messageId\":\"11111111-aaaa-bbbb-cccc-EXAMPLE01234\"}"</p>
170 pub fn get_content(&self) -> &::std::option::Option<::std::string::String> {
171 self.inner.get_content()
172 }
173 /// <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>
174 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
175 self.inner = self.inner.client_token(input.into());
176 self
177 }
178 /// <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>
179 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
180 self.inner = self.inner.set_client_token(input);
181 self
182 }
183 /// <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>
184 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
185 self.inner.get_client_token()
186 }
187 /// <p>The authentication token associated with the participant's connection.</p>
188 pub fn connection_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
189 self.inner = self.inner.connection_token(input.into());
190 self
191 }
192 /// <p>The authentication token associated with the participant's connection.</p>
193 pub fn set_connection_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
194 self.inner = self.inner.set_connection_token(input);
195 self
196 }
197 /// <p>The authentication token associated with the participant's connection.</p>
198 pub fn get_connection_token(&self) -> &::std::option::Option<::std::string::String> {
199 self.inner.get_connection_token()
200 }
201}