1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
impl super::Client {
    /// Constructs a fluent builder for the [`CreatePersistentContactAssociation`](crate::operation::create_persistent_contact_association::builders::CreatePersistentContactAssociationFluentBuilder) operation.
    ///
    /// - The fluent builder is configurable:
    ///   - [`instance_id(impl Into<String>)`](crate::operation::create_persistent_contact_association::builders::CreatePersistentContactAssociationFluentBuilder::instance_id) / [`set_instance_id(Option<String>)`](crate::operation::create_persistent_contact_association::builders::CreatePersistentContactAssociationFluentBuilder::set_instance_id):<br>required: **true**<br><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><br>
    ///   - [`initial_contact_id(impl Into<String>)`](crate::operation::create_persistent_contact_association::builders::CreatePersistentContactAssociationFluentBuilder::initial_contact_id) / [`set_initial_contact_id(Option<String>)`](crate::operation::create_persistent_contact_association::builders::CreatePersistentContactAssociationFluentBuilder::set_initial_contact_id):<br>required: **true**<br><p>This is the contactId of the current contact that the <code>CreatePersistentContactAssociation</code> API is being called from.</p><br>
    ///   - [`rehydration_type(RehydrationType)`](crate::operation::create_persistent_contact_association::builders::CreatePersistentContactAssociationFluentBuilder::rehydration_type) / [`set_rehydration_type(Option<RehydrationType>)`](crate::operation::create_persistent_contact_association::builders::CreatePersistentContactAssociationFluentBuilder::set_rehydration_type):<br>required: **true**<br><p>The contactId chosen for rehydration depends on the type chosen.</p>  <ul>   <li> <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>   <li> <p> <code>FROM_SEGMENT</code>: Rehydrates a chat from the specified past chat contact provided in the <code>sourceContactId</code> field. </p> </li>  </ul>  <p>The actual contactId used for rehydration is provided in the response of this API.</p>  <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>  <ul>   <li> <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>    <ul>     <li> <p> <b>Configuration</b> </p>      <ul>       <li> <p>SourceContactId = "C2"</p> </li>       <li> <p>RehydrationType = "FROM_SEGMENT"</p> </li>      </ul> </li>     <li> <p> <b>Expected behavior</b> </p>      <ul>       <li> <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>      </ul> </li>    </ul> </li>   <li> <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>    <ul>     <li> <p> <b>Configuration</b> </p>      <ul>       <li> <p>SourceContactId = "C1"</p> </li>       <li> <p>RehydrationType = "ENTIRE_PAST_SESSION"</p> </li>      </ul> </li>     <li> <p> <b>Expected behavior</b> </p>      <ul>       <li> <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>      </ul> </li>    </ul> </li>  </ul><br>
    ///   - [`source_contact_id(impl Into<String>)`](crate::operation::create_persistent_contact_association::builders::CreatePersistentContactAssociationFluentBuilder::source_contact_id) / [`set_source_contact_id(Option<String>)`](crate::operation::create_persistent_contact_association::builders::CreatePersistentContactAssociationFluentBuilder::set_source_contact_id):<br>required: **true**<br><p>The contactId from which a persistent chat session must be started.</p><br>
    ///   - [`client_token(impl Into<String>)`](crate::operation::create_persistent_contact_association::builders::CreatePersistentContactAssociationFluentBuilder::client_token) / [`set_client_token(Option<String>)`](crate::operation::create_persistent_contact_association::builders::CreatePersistentContactAssociationFluentBuilder::set_client_token):<br>required: **false**<br><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><br>
    /// - On success, responds with [`CreatePersistentContactAssociationOutput`](crate::operation::create_persistent_contact_association::CreatePersistentContactAssociationOutput) with field(s):
    ///   - [`continued_from_contact_id(Option<String>)`](crate::operation::create_persistent_contact_association::CreatePersistentContactAssociationOutput::continued_from_contact_id): <p>The contactId from which a persistent chat session is started. This field is populated only for persistent chat.</p>
    /// - On failure, responds with [`SdkError<CreatePersistentContactAssociationError>`](crate::operation::create_persistent_contact_association::CreatePersistentContactAssociationError)
    pub fn create_persistent_contact_association(
        &self,
    ) -> crate::operation::create_persistent_contact_association::builders::CreatePersistentContactAssociationFluentBuilder {
        crate::operation::create_persistent_contact_association::builders::CreatePersistentContactAssociationFluentBuilder::new(self.handle.clone())
    }
}