ChatThreadAsyncClient Class
- java.
lang. Object - com.
azure. communication. chat. ChatThreadAsyncClient
- com.
public final class ChatThreadAsyncClient
Async Client that supports chat thread operations.
Instantiating an asynchronous Chat Thread Client
// Initialize the chat client builder
final ChatClientBuilder builder = new ChatClientBuilder()
.endpoint(endpoint)
.credential(credential);
// Build the chat client
ChatAsyncClient chatClient = builder.buildAsyncClient();
// Get the chat thread client for your thread's id
ChatThreadAsyncClient chatThreadClient = chatClient.getChatThreadClient(threadId);
View ChatClientBuilder for additional ways to construct the client.
Methods inherited from java.lang.Object
addParticipant
public Mono
Adds a participant to a thread. If the participant already exists, no change occurs.
Parameters:
Returns:
addParticipants
public Mono
Adds participants to a thread. If participants already exist, no change occurs.
Parameters:
Returns:
addParticipantsWithResponse
public Mono
Adds participants to a thread. If participants already exist, no change occurs.
Parameters:
Returns:
addParticipantWithResponse
public Mono
Adds a participant to a thread. If the participant already exists, no change occurs.
Parameters:
Returns:
deleteMessage
public Mono
Deletes a message.
Parameters:
Returns:
deleteMessageWithResponse
public Mono
Deletes a message.
Parameters:
Returns:
getChatThreadId
public String getChatThreadId()
Get the thread id property.
Returns:
getMessage
public Mono
Gets a message by id.
Parameters:
Returns:
getMessageWithResponse
public Mono
Gets a message by id.
Parameters:
Returns:
getProperties
public Mono
Gets chat thread properties.
Returns:
getPropertiesWithResponse
public Mono
Gets chat thread properties.
Returns:
listMessages
public PagedFlux
Gets a list of messages from a thread.
Returns:
listMessages
public PagedFlux
Gets a list of messages from a thread.
Parameters:
Returns:
listParticipants
public PagedFlux
Gets the participants of a thread.
Returns:
listParticipants
public PagedFlux
Gets the participants of a thread.
Parameters:
Returns:
listReadReceipts
public PagedFlux
Gets read receipts for a thread.
Returns:
listReadReceipts
public PagedFlux
Gets read receipts for a thread.
Parameters:
Returns:
removeParticipant
public Mono
Remove a participant from a thread.
Parameters:
Returns:
removeParticipantWithResponse
public Mono
Remove a participant from a thread.
Parameters:
Returns:
sendMessage
public Mono
Sends a message to a thread.
Code Samples
Send a chat message based on "options".
// Set the chat message options
SendChatMessageOptions sendChatMessageOptions = new SendChatMessageOptions()
.setContent("Message content")
.setSenderDisplayName("Sender Display Name");
// Get the request result and the chat message id
SendChatMessageResult sendResult = chatThreadClient.sendMessage(sendChatMessageOptions).block();
String messageId = sendResult.getId();
Parameters:
Returns:
sendMessageWithResponse
public Mono
Sends a message to a thread.
Parameters:
Returns:
sendReadReceipt
public Mono
Posts a read receipt event to a thread, on behalf of a user.
Parameters:
Returns:
sendReadReceiptWithResponse
public Mono
Posts a read receipt event to a thread, on behalf of a user.
Parameters:
Returns:
sendTypingNotification
public Mono
Posts a typing event to a thread, on behalf of a user.
Returns:
sendTypingNotificationWithResponse
public Mono
Posts a typing event to a thread, on behalf of a user.
Returns:
sendTypingNotificationWithResponse
public Mono
Posts a typing event to a thread, on behalf of a user.
Parameters:
Returns:
updateMessage
public Mono
Updates a message.
Parameters:
Returns:
updateMessageWithResponse
public Mono
Updates a message.
Parameters:
Returns:
updateTopic
public Mono
Updates a thread's topic.
Parameters:
Returns:
updateTopicWithResponse
public Mono
Updates a thread's properties.
Parameters:
Returns: