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 ) throws
Parameters
endpoint
The Communication Services endpoint.
credential
The user credential.
threadId
The chat thread id.
options
Options 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
options
Get chat thread options.
completionHandler
A 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
topic
The topic.
options
Update chat thread options.
completionHandler
A 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
messageId
The id of the message to send a read receipt for.
options
Send read receipt options.
completionHandler
A 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
options
List chat read receipts options.
completionHandler
A 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
senderDisplayName
Display name for the typing notification.
options
Send typing notification options
completionHandler
A 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
message
Request that contains the message properties.
options
A list of options for the operation.
completionHandler
A 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
messageId
The id of the message to get.
options
Get chat message options
completionHandler
A 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
message
The message id.
parameters
The UpdateChatMessageRequest.
options
Update chat message options
completionHandler
A 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
messageId
The message id.
options
Delete chat message options
completionHandler
A 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
options
List messages options.
completionHandler
A 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
participants
An array of chat participants to add.
options
Add chat participants options.
completionHandler
A 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
participantIdentifier
Identifier of the participant to remove.
options
Remove participant options
completionHandler
A 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
options
List chat participants options.
completionHandler
A completion handler that receives the list of members on success.