aws_sdk_connect/operation/create_persistent_contact_association/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_persistent_contact_association::_create_persistent_contact_association_output::CreatePersistentContactAssociationOutputBuilder;
3
4pub use crate::operation::create_persistent_contact_association::_create_persistent_contact_association_input::CreatePersistentContactAssociationInputBuilder;
5
6impl crate::operation::create_persistent_contact_association::builders::CreatePersistentContactAssociationInputBuilder {
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_persistent_contact_association::CreatePersistentContactAssociationOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_persistent_contact_association::CreatePersistentContactAssociationError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_persistent_contact_association();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreatePersistentContactAssociation`.
24///
25/// <p>Enables rehydration of chats for the lifespan of a contact. For more information about chat rehydration, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/chat-persistence.html">Enable persistent chat</a> in the <i>Amazon Connect Administrator Guide</i>.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreatePersistentContactAssociationFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::create_persistent_contact_association::builders::CreatePersistentContactAssociationInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::create_persistent_contact_association::CreatePersistentContactAssociationOutput,
35 crate::operation::create_persistent_contact_association::CreatePersistentContactAssociationError,
36 > for CreatePersistentContactAssociationFluentBuilder
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::create_persistent_contact_association::CreatePersistentContactAssociationOutput,
44 crate::operation::create_persistent_contact_association::CreatePersistentContactAssociationError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl CreatePersistentContactAssociationFluentBuilder {
51 /// Creates a new `CreatePersistentContactAssociationFluentBuilder`.
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 CreatePersistentContactAssociation as a reference.
60 pub fn as_input(&self) -> &crate::operation::create_persistent_contact_association::builders::CreatePersistentContactAssociationInputBuilder {
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::create_persistent_contact_association::CreatePersistentContactAssociationOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::create_persistent_contact_association::CreatePersistentContactAssociationError,
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::create_persistent_contact_association::CreatePersistentContactAssociation::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::create_persistent_contact_association::CreatePersistentContactAssociation::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::create_persistent_contact_association::CreatePersistentContactAssociationOutput,
97 crate::operation::create_persistent_contact_association::CreatePersistentContactAssociationError,
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 /// <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>
112 pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113 self.inner = self.inner.instance_id(input.into());
114 self
115 }
116 /// <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>
117 pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118 self.inner = self.inner.set_instance_id(input);
119 self
120 }
121 /// <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>
122 pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
123 self.inner.get_instance_id()
124 }
125 /// <p>This is the contactId of the current contact that the <code>CreatePersistentContactAssociation</code> API is being called from.</p>
126 pub fn initial_contact_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127 self.inner = self.inner.initial_contact_id(input.into());
128 self
129 }
130 /// <p>This is the contactId of the current contact that the <code>CreatePersistentContactAssociation</code> API is being called from.</p>
131 pub fn set_initial_contact_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132 self.inner = self.inner.set_initial_contact_id(input);
133 self
134 }
135 /// <p>This is the contactId of the current contact that the <code>CreatePersistentContactAssociation</code> API is being called from.</p>
136 pub fn get_initial_contact_id(&self) -> &::std::option::Option<::std::string::String> {
137 self.inner.get_initial_contact_id()
138 }
139 /// <p>The contactId chosen for rehydration depends on the type chosen.</p>
140 /// <ul>
141 /// <li>
142 /// <p><code>ENTIRE_PAST_SESSION</code>: Rehydrates a chat from the most recently terminated past chat contact of the specified past ended chat session. To use this type, provide the <code>initialContactId</code> of the past ended chat session in the <code>sourceContactId</code> field. In this type, Amazon Connect determines what the most recent chat contact on the past ended chat session and uses it to start a persistent chat.</p></li>
143 /// <li>
144 /// <p><code>FROM_SEGMENT</code>: Rehydrates a chat from the specified past chat contact provided in the <code>sourceContactId</code> field.</p></li>
145 /// </ul>
146 /// <p>The actual contactId used for rehydration is provided in the response of this API.</p>
147 /// <p>To illustrate how to use rehydration type, consider the following example: A customer starts a chat session. Agent a1 accepts the chat and a conversation starts between the customer and Agent a1. This first contact creates a contact ID <b>C1</b>. Agent a1 then transfers the chat to Agent a2. This creates another contact ID <b>C2</b>. At this point Agent a2 ends the chat. The customer is forwarded to the disconnect flow for a post chat survey that creates another contact ID <b>C3</b>. After the chat survey, the chat session ends. Later, the customer returns and wants to resume their past chat session. At this point, the customer can have following use cases:</p>
148 /// <ul>
149 /// <li>
150 /// <p><b>Use Case 1</b>: The customer wants to continue the past chat session but they want to hide the post chat survey. For this they will use the following configuration:</p>
151 /// <ul>
152 /// <li>
153 /// <p><b>Configuration</b></p>
154 /// <ul>
155 /// <li>
156 /// <p>SourceContactId = "C2"</p></li>
157 /// <li>
158 /// <p>RehydrationType = "FROM_SEGMENT"</p></li>
159 /// </ul></li>
160 /// <li>
161 /// <p><b>Expected behavior</b></p>
162 /// <ul>
163 /// <li>
164 /// <p>This starts a persistent chat session from the specified past ended contact (C2). Transcripts of past chat sessions C2 and C1 are accessible in the current persistent chat session. Note that chat segment C3 is dropped from the persistent chat session.</p></li>
165 /// </ul></li>
166 /// </ul></li>
167 /// <li>
168 /// <p><b>Use Case 2</b>: The customer wants to continue the past chat session and see the transcript of the entire past engagement, including the post chat survey. For this they will use the following configuration:</p>
169 /// <ul>
170 /// <li>
171 /// <p><b>Configuration</b></p>
172 /// <ul>
173 /// <li>
174 /// <p>SourceContactId = "C1"</p></li>
175 /// <li>
176 /// <p>RehydrationType = "ENTIRE_PAST_SESSION"</p></li>
177 /// </ul></li>
178 /// <li>
179 /// <p><b>Expected behavior</b></p>
180 /// <ul>
181 /// <li>
182 /// <p>This starts a persistent chat session from the most recently ended chat contact (C3). Transcripts of past chat sessions C3, C2 and C1 are accessible in the current persistent chat session.</p></li>
183 /// </ul></li>
184 /// </ul></li>
185 /// </ul>
186 pub fn rehydration_type(mut self, input: crate::types::RehydrationType) -> Self {
187 self.inner = self.inner.rehydration_type(input);
188 self
189 }
190 /// <p>The contactId chosen for rehydration depends on the type chosen.</p>
191 /// <ul>
192 /// <li>
193 /// <p><code>ENTIRE_PAST_SESSION</code>: Rehydrates a chat from the most recently terminated past chat contact of the specified past ended chat session. To use this type, provide the <code>initialContactId</code> of the past ended chat session in the <code>sourceContactId</code> field. In this type, Amazon Connect determines what the most recent chat contact on the past ended chat session and uses it to start a persistent chat.</p></li>
194 /// <li>
195 /// <p><code>FROM_SEGMENT</code>: Rehydrates a chat from the specified past chat contact provided in the <code>sourceContactId</code> field.</p></li>
196 /// </ul>
197 /// <p>The actual contactId used for rehydration is provided in the response of this API.</p>
198 /// <p>To illustrate how to use rehydration type, consider the following example: A customer starts a chat session. Agent a1 accepts the chat and a conversation starts between the customer and Agent a1. This first contact creates a contact ID <b>C1</b>. Agent a1 then transfers the chat to Agent a2. This creates another contact ID <b>C2</b>. At this point Agent a2 ends the chat. The customer is forwarded to the disconnect flow for a post chat survey that creates another contact ID <b>C3</b>. After the chat survey, the chat session ends. Later, the customer returns and wants to resume their past chat session. At this point, the customer can have following use cases:</p>
199 /// <ul>
200 /// <li>
201 /// <p><b>Use Case 1</b>: The customer wants to continue the past chat session but they want to hide the post chat survey. For this they will use the following configuration:</p>
202 /// <ul>
203 /// <li>
204 /// <p><b>Configuration</b></p>
205 /// <ul>
206 /// <li>
207 /// <p>SourceContactId = "C2"</p></li>
208 /// <li>
209 /// <p>RehydrationType = "FROM_SEGMENT"</p></li>
210 /// </ul></li>
211 /// <li>
212 /// <p><b>Expected behavior</b></p>
213 /// <ul>
214 /// <li>
215 /// <p>This starts a persistent chat session from the specified past ended contact (C2). Transcripts of past chat sessions C2 and C1 are accessible in the current persistent chat session. Note that chat segment C3 is dropped from the persistent chat session.</p></li>
216 /// </ul></li>
217 /// </ul></li>
218 /// <li>
219 /// <p><b>Use Case 2</b>: The customer wants to continue the past chat session and see the transcript of the entire past engagement, including the post chat survey. For this they will use the following configuration:</p>
220 /// <ul>
221 /// <li>
222 /// <p><b>Configuration</b></p>
223 /// <ul>
224 /// <li>
225 /// <p>SourceContactId = "C1"</p></li>
226 /// <li>
227 /// <p>RehydrationType = "ENTIRE_PAST_SESSION"</p></li>
228 /// </ul></li>
229 /// <li>
230 /// <p><b>Expected behavior</b></p>
231 /// <ul>
232 /// <li>
233 /// <p>This starts a persistent chat session from the most recently ended chat contact (C3). Transcripts of past chat sessions C3, C2 and C1 are accessible in the current persistent chat session.</p></li>
234 /// </ul></li>
235 /// </ul></li>
236 /// </ul>
237 pub fn set_rehydration_type(mut self, input: ::std::option::Option<crate::types::RehydrationType>) -> Self {
238 self.inner = self.inner.set_rehydration_type(input);
239 self
240 }
241 /// <p>The contactId chosen for rehydration depends on the type chosen.</p>
242 /// <ul>
243 /// <li>
244 /// <p><code>ENTIRE_PAST_SESSION</code>: Rehydrates a chat from the most recently terminated past chat contact of the specified past ended chat session. To use this type, provide the <code>initialContactId</code> of the past ended chat session in the <code>sourceContactId</code> field. In this type, Amazon Connect determines what the most recent chat contact on the past ended chat session and uses it to start a persistent chat.</p></li>
245 /// <li>
246 /// <p><code>FROM_SEGMENT</code>: Rehydrates a chat from the specified past chat contact provided in the <code>sourceContactId</code> field.</p></li>
247 /// </ul>
248 /// <p>The actual contactId used for rehydration is provided in the response of this API.</p>
249 /// <p>To illustrate how to use rehydration type, consider the following example: A customer starts a chat session. Agent a1 accepts the chat and a conversation starts between the customer and Agent a1. This first contact creates a contact ID <b>C1</b>. Agent a1 then transfers the chat to Agent a2. This creates another contact ID <b>C2</b>. At this point Agent a2 ends the chat. The customer is forwarded to the disconnect flow for a post chat survey that creates another contact ID <b>C3</b>. After the chat survey, the chat session ends. Later, the customer returns and wants to resume their past chat session. At this point, the customer can have following use cases:</p>
250 /// <ul>
251 /// <li>
252 /// <p><b>Use Case 1</b>: The customer wants to continue the past chat session but they want to hide the post chat survey. For this they will use the following configuration:</p>
253 /// <ul>
254 /// <li>
255 /// <p><b>Configuration</b></p>
256 /// <ul>
257 /// <li>
258 /// <p>SourceContactId = "C2"</p></li>
259 /// <li>
260 /// <p>RehydrationType = "FROM_SEGMENT"</p></li>
261 /// </ul></li>
262 /// <li>
263 /// <p><b>Expected behavior</b></p>
264 /// <ul>
265 /// <li>
266 /// <p>This starts a persistent chat session from the specified past ended contact (C2). Transcripts of past chat sessions C2 and C1 are accessible in the current persistent chat session. Note that chat segment C3 is dropped from the persistent chat session.</p></li>
267 /// </ul></li>
268 /// </ul></li>
269 /// <li>
270 /// <p><b>Use Case 2</b>: The customer wants to continue the past chat session and see the transcript of the entire past engagement, including the post chat survey. For this they will use the following configuration:</p>
271 /// <ul>
272 /// <li>
273 /// <p><b>Configuration</b></p>
274 /// <ul>
275 /// <li>
276 /// <p>SourceContactId = "C1"</p></li>
277 /// <li>
278 /// <p>RehydrationType = "ENTIRE_PAST_SESSION"</p></li>
279 /// </ul></li>
280 /// <li>
281 /// <p><b>Expected behavior</b></p>
282 /// <ul>
283 /// <li>
284 /// <p>This starts a persistent chat session from the most recently ended chat contact (C3). Transcripts of past chat sessions C3, C2 and C1 are accessible in the current persistent chat session.</p></li>
285 /// </ul></li>
286 /// </ul></li>
287 /// </ul>
288 pub fn get_rehydration_type(&self) -> &::std::option::Option<crate::types::RehydrationType> {
289 self.inner.get_rehydration_type()
290 }
291 /// <p>The contactId from which a persistent chat session must be started.</p>
292 pub fn source_contact_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
293 self.inner = self.inner.source_contact_id(input.into());
294 self
295 }
296 /// <p>The contactId from which a persistent chat session must be started.</p>
297 pub fn set_source_contact_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
298 self.inner = self.inner.set_source_contact_id(input);
299 self
300 }
301 /// <p>The contactId from which a persistent chat session must be started.</p>
302 pub fn get_source_contact_id(&self) -> &::std::option::Option<::std::string::String> {
303 self.inner.get_source_contact_id()
304 }
305 /// <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>
306 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
307 self.inner = self.inner.client_token(input.into());
308 self
309 }
310 /// <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>
311 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
312 self.inner = self.inner.set_client_token(input);
313 self
314 }
315 /// <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>
316 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
317 self.inner.get_client_token()
318 }
319}