-
public interface ChatService
-
-
Method Summary
Modifier and Type Method Description abstract Unitconfigure(GlobalConfig config)abstract ConnectionDetailsProvidergetConnectionDetailsProvider()abstract Result<Boolean>createChatSession(ChatDetails chatDetails)Creates a chat session with the specified chat details. abstract Result<Boolean>disconnectChatSession()Disconnects the current chat session. abstract Result<Boolean>suspendWebSocketConnection()Disconnects the websocket and suspends reconnection attempts. abstract Result<Boolean>resumeWebSocketConnection()Resumes a suspended websocket and attempts to reconnect. abstract Result<Boolean>reset()Resets the current state which will disconnect the webSocket and remove all session related data without disconnecting the participant from the chat contact. abstract Result<Boolean>sendMessage(ContentType contentType, String message)Sends a message. abstract Result<Boolean>resendFailedMessage(String messageId)Retry a text message or attachment that failed to be sent. abstract Result<Boolean>sendEvent(ContentType contentType, String event)Sends an event. abstract Result<Boolean>sendAttachment(Uri fileUri)Sends an attachment. abstract Result<URL>downloadAttachment(String attachmentId, String fileName)Downloads an attachment. abstract Result<URL>getAttachmentDownloadUrl(String attachmentId)Returns the S3 download URL for an attachment. abstract Result<TranscriptResponse>getTranscript(ScanDirection scanDirection, SortKey sortKey, Integer maxResults, String nextToken, StartPosition startPosition)Gets the transcript. abstract Result<Unit>sendMessageReceipt(MessageReceiptType messageReceiptType, String messageId)Sends a message receipt. abstract Result<View>describeView(String viewToken)Retrieves the view for the specified view token. abstract SharedFlow<ChatEventPayload>getEventPublisher()abstract SharedFlow<TranscriptItem>getTranscriptPublisher()abstract SharedFlow<TranscriptData>getTranscriptListPublisher()abstract SharedFlow<Boolean>getChatSessionStatePublisher()-
-
Method Detail
-
configure
abstract Unit configure(GlobalConfig config)
-
getConnectionDetailsProvider
abstract ConnectionDetailsProvider getConnectionDetailsProvider()
-
createChatSession
abstract Result<Boolean> createChatSession(ChatDetails chatDetails)
Creates a chat session with the specified chat details.
- Parameters:
chatDetails- The details of the chat.
-
disconnectChatSession
abstract Result<Boolean> disconnectChatSession()
Disconnects the current chat session.
-
suspendWebSocketConnection
abstract Result<Boolean> suspendWebSocketConnection()
Disconnects the websocket and suspends reconnection attempts.
-
resumeWebSocketConnection
abstract Result<Boolean> resumeWebSocketConnection()
Resumes a suspended websocket and attempts to reconnect.
-
reset
abstract Result<Boolean> reset()
Resets the current state which will disconnect the webSocket and remove all session related data without disconnecting the participant from the chat contact.
-
sendMessage
abstract Result<Boolean> sendMessage(ContentType contentType, String message)
Sends a message.
- Parameters:
contentType- The content type of the message.message- The message content.
-
resendFailedMessage
abstract Result<Boolean> resendFailedMessage(String messageId)
Retry a text message or attachment that failed to be sent.
- Parameters:
messageId- The Id of the message that failed to be sent.
-
sendEvent
abstract Result<Boolean> sendEvent(ContentType contentType, String event)
Sends an event.
- Parameters:
contentType- The content type of the message.event- The event content.
-
sendAttachment
abstract Result<Boolean> sendAttachment(Uri fileUri)
Sends an attachment.
-
downloadAttachment
abstract Result<URL> downloadAttachment(String attachmentId, String fileName)
Downloads an attachment.
- Parameters:
attachmentId- The ID of the attachment.fileName- The name of the file.
-
getAttachmentDownloadUrl
abstract Result<URL> getAttachmentDownloadUrl(String attachmentId)
Returns the S3 download URL for an attachment.
- Parameters:
attachmentId- The ID of the attachment.
-
getTranscript
abstract Result<TranscriptResponse> getTranscript(ScanDirection scanDirection, SortKey sortKey, Integer maxResults, String nextToken, StartPosition startPosition)
Gets the transcript.
- Parameters:
scanDirection- The direction of the scan.sortKey- The sort key.maxResults- The maximum number of results.nextToken- The next token.startPosition- The start position.
-
sendMessageReceipt
abstract Result<Unit> sendMessageReceipt(MessageReceiptType messageReceiptType, String messageId)
Sends a message receipt.
- Parameters:
messageReceiptType- The type of the message receipt.messageId- The ID of the message.
-
describeView
abstract Result<View> describeView(String viewToken)
Retrieves the view for the specified view token.
- Parameters:
viewToken- The view token from an interactive message.
-
getEventPublisher
abstract SharedFlow<ChatEventPayload> getEventPublisher()
-
getTranscriptPublisher
abstract SharedFlow<TranscriptItem> getTranscriptPublisher()
-
getTranscriptListPublisher
abstract SharedFlow<TranscriptData> getTranscriptListPublisher()
-
getChatSessionStatePublisher
abstract SharedFlow<Boolean> getChatSessionStatePublisher()
-
-
-
-