ChatThreadClient
public class ChatThreadClient
Undocumented
-
Undocumented
Declaration
Swift
public let threadId: String
-
Create a ChatThreadClient.
Declaration
Swift
public init( endpoint: String, credential: CommunicationTokenCredential, threadId: String, withOptions options: AzureCommunicationChatClientOptions ) throwsParameters
endpointThe Communication Services endpoint.
credentialThe user credential.
threadIdThe chat thread id.
optionsOptions used to configure the client.
-
Get the ChatThreadProperties for the chat thread.
Declaration
Swift
public func getProperties( withOptions options: GetChatThreadPropertiesOptions? = nil, completionHandler: @escaping HTTPResultHandler<ChatThreadProperties> )Parameters
optionsGet chat thread options.
completionHandlerA completion handler that receives the chat thread properties on success.
-
Updates the ChatThread’s topic.
Declaration
Swift
public func update( topic: String, withOptions options: UpdateChatThreadPropertiesOptions? = nil, completionHandler: @escaping HTTPResultHandler<Void> )Parameters
topicThe topic.
optionsUpdate chat thread options.
completionHandlerA completion handler that receives a status code on success.
-
Sends a read receipt.
Declaration
Swift
public func sendReadReceipt( forMessage messageId: String, withOptions options: SendChatReadReceiptOptions? = nil, completionHandler: @escaping HTTPResultHandler<Void> )Parameters
messageIdThe id of the message to send a read receipt for.
optionsSend read receipt options.
completionHandlerA completion handler that receives a status code on success.
-
Lists read receipts for the ChatThread.
Declaration
Swift
public func listReadReceipts( withOptions options: ListChatReadReceiptsOptions? = nil, completionHandler: @escaping HTTPResultHandler<PagedCollection<ChatMessageReadReceipt>> )Parameters
optionsList chat read receipts options.
completionHandlerA completion handler that receives the list of read receipts on success.
-
Sends a typing notification.
Declaration
Swift
public func sendTypingNotification( from senderDisplayName: String? = nil, withOptions options: SendTypingNotificationOptions? = nil, completionHandler: @escaping HTTPResultHandler<Void> )Parameters
senderDisplayNameDisplay name for the typing notification.
optionsSend typing notification options
completionHandlerA completion handler that receives a status code on success.
-
Sends a message to a ChatThread.
Declaration
Swift
public func send( message: SendChatMessageRequest, withOptions options: SendChatMessageOptions? = nil, completionHandler: @escaping HTTPResultHandler<SendChatMessageResult> )Parameters
messageRequest that contains the message properties.
optionsA list of options for the operation.
completionHandlerA completion handler that receives a status code on success.
-
Gets a message by id.
Declaration
Swift
public func get( message messageId: String, withOptions options: GetChatMessageOptions? = nil, completionHandler: @escaping HTTPResultHandler<ChatMessage> )Parameters
messageIdThe id of the message to get.
optionsGet chat message options
completionHandlerA completion handler that receives the chat message on success.
-
Updates a message.
Declaration
Swift
public func update( message messageId: String, parameters: UpdateChatMessageRequest, withOptions options: UpdateChatMessageOptions? = nil, completionHandler: @escaping HTTPResultHandler<Void> )Parameters
messageThe message id.
parametersThe UpdateChatMessageRequest.
optionsUpdate chat message options
completionHandlerA completion handler that receives a status code on success.
-
Deletes a message.
Declaration
Swift
public func delete( message messageId: String, options: DeleteChatMessageOptions? = nil, completionHandler: @escaping HTTPResultHandler<Void> )Parameters
messageIdThe message id.
optionsDelete chat message options
completionHandlerA completion handler that receives a status code on success.
-
Gets a list of messages from a ChatThread.
Declaration
Swift
public func listMessages( withOptions options: ListChatMessagesOptions? = nil, completionHandler: @escaping HTTPResultHandler<PagedCollection<ChatMessage>> )Parameters
optionsList messages options.
completionHandlerA completion handler that receives the list of messages on success.
-
Adds participants to a ChatThread. If the participants already exist, no change occurs.
Declaration
Swift
public func add( participants: [ChatParticipant], withOptions options: AddChatParticipantsOptions? = nil, completionHandler: @escaping HTTPResultHandler<AddChatParticipantsResult> )Parameters
participantsAn array of chat participants to add.
optionsAdd chat participants options.
completionHandlerA completion handler that receives a status code on success.
-
Removes a participant from the thread.
Declaration
Swift
public func remove( participant participantIdentifier: CommunicationIdentifier, withOptions options: RemoveChatParticipantOptions? = nil, completionHandler: @escaping HTTPResultHandler<Void> )Parameters
participantIdentifierIdentifier of the participant to remove.
optionsRemove participant options
completionHandlerA completion handler that receives a status code on success.
-
Gets the participants of the thread.
Declaration
Swift
public func listParticipants( withOptions options: ListChatParticipantsOptions? = nil, completionHandler: @escaping HTTPResultHandler<PagedCollection<ChatParticipant>> )Parameters
optionsList chat participants options.
completionHandlerA completion handler that receives the list of members on success.
View on GitHub
ChatThreadClient Class Reference