### YamlMime:JavaType uid: "com.azure.communication.chat.ChatClient" fullName: "com.azure.communication.chat.ChatClient" name: "ChatClient" nameWithType: "ChatClient" summary: "Sync Client that supports chat operations." inheritances: - "" inheritedClassMethods: - classRef: "java.lang.Object" methodsRef: - "clone" - "equals" - "finalize" - "getClass" - "hashCode" - "notify" - "notifyAll" - "toString" - "wait" - "wait" - "wait" syntax: "public final class **ChatClient**" methods: - uid: "com.azure.communication.chat.ChatClient.createChatThread(com.azure.communication.chat.models.CreateChatThreadOptions)" fullName: "com.azure.communication.chat.ChatClient.createChatThread(CreateChatThreadOptions options)" name: "createChatThread(CreateChatThreadOptions options)" nameWithType: "ChatClient.createChatThread(CreateChatThreadOptions options)" summary: "Creates a chat thread." parameters: - description: "Options for creating a chat thread." name: "options" type: "" syntax: "public CreateChatThreadResult createChatThread(CreateChatThreadOptions options)" desc: "Creates a chat thread.\n\n**Code Samples**\n\nCreate a chat thread based on \"options\".\n\n```java\n// Initialize the list of chat thread participants\n List participants = new ArrayList();\n\n ChatParticipant firstParticipant = new ChatParticipant()\n .setCommunicationIdentifier(user1)\n .setDisplayName(\"Participant Display Name 1\");\n\n ChatParticipant secondParticipant = new ChatParticipant()\n .setCommunicationIdentifier(user2)\n .setDisplayName(\"Participant Display Name 2\");\n\n participants.add(firstParticipant);\n participants.add(secondParticipant);\n\n // Create the chat thread\n CreateChatThreadOptions createChatThreadOptions = new CreateChatThreadOptions(\"Topic\")\n .setParticipants(participants);\n CreateChatThreadResult result = chatClient.createChatThread(createChatThreadOptions);\n\n // Retrieve the chat thread and the id\n ChatThreadProperties chatThread = result.getChatThread();\n String chatThreadId = chatThread.getId();\n```" returns: description: "the response." type: "" - uid: "com.azure.communication.chat.ChatClient.createChatThreadWithResponse(com.azure.communication.chat.models.CreateChatThreadOptions,com.azure.core.util.Context)" fullName: "com.azure.communication.chat.ChatClient.createChatThreadWithResponse(CreateChatThreadOptions options, Context context)" name: "createChatThreadWithResponse(CreateChatThreadOptions options, Context context)" nameWithType: "ChatClient.createChatThreadWithResponse(CreateChatThreadOptions options, Context context)" summary: "Creates a chat thread." parameters: - description: "Options for creating a chat thread." name: "options" type: "" - description: "The context to associate with this operation." name: "context" type: "" syntax: "public Response createChatThreadWithResponse(CreateChatThreadOptions options, Context context)" desc: "Creates a chat thread." returns: description: "the response." type: "<>" - uid: "com.azure.communication.chat.ChatClient.deleteChatThread(java.lang.String)" fullName: "com.azure.communication.chat.ChatClient.deleteChatThread(String chatThreadId)" name: "deleteChatThread(String chatThreadId)" nameWithType: "ChatClient.deleteChatThread(String chatThreadId)" summary: "Deletes a chat thread." parameters: - description: "Chat thread id to delete." name: "chatThreadId" type: "String" syntax: "public void deleteChatThread(String chatThreadId)" desc: "Deletes a chat thread." - uid: "com.azure.communication.chat.ChatClient.deleteChatThreadWithResponse(java.lang.String,com.azure.core.util.Context)" fullName: "com.azure.communication.chat.ChatClient.deleteChatThreadWithResponse(String chatThreadId, Context context)" name: "deleteChatThreadWithResponse(String chatThreadId, Context context)" nameWithType: "ChatClient.deleteChatThreadWithResponse(String chatThreadId, Context context)" summary: "Deletes a chat thread." parameters: - description: "Chat thread id to delete." name: "chatThreadId" type: "String" - description: "The context to associate with this operation." name: "context" type: "" syntax: "public Response deleteChatThreadWithResponse(String chatThreadId, Context context)" desc: "Deletes a chat thread." returns: description: "the completion." type: "<Void>" - uid: "com.azure.communication.chat.ChatClient.getChatThreadClient(java.lang.String)" fullName: "com.azure.communication.chat.ChatClient.getChatThreadClient(String chatThreadId)" name: "getChatThreadClient(String chatThreadId)" nameWithType: "ChatClient.getChatThreadClient(String chatThreadId)" summary: "Creates a chat thread client." parameters: - description: "The id of the chat thread." name: "chatThreadId" type: "String" syntax: "public ChatThreadClient getChatThreadClient(String chatThreadId)" desc: "Creates a chat thread client." returns: description: "the client." type: "" - uid: "com.azure.communication.chat.ChatClient.listChatThreads()" fullName: "com.azure.communication.chat.ChatClient.listChatThreads()" name: "listChatThreads()" nameWithType: "ChatClient.listChatThreads()" summary: "Gets the list of chat threads of a user." syntax: "public PagedIterable listChatThreads()" desc: "Gets the list of chat threads of a user." returns: description: "the paged list of chat threads of a user." type: "<>" - uid: "com.azure.communication.chat.ChatClient.listChatThreads(com.azure.communication.chat.models.ListChatThreadsOptions,com.azure.core.util.Context)" fullName: "com.azure.communication.chat.ChatClient.listChatThreads(ListChatThreadsOptions listThreadsOptions, Context context)" name: "listChatThreads(ListChatThreadsOptions listThreadsOptions, Context context)" nameWithType: "ChatClient.listChatThreads(ListChatThreadsOptions listThreadsOptions, Context context)" summary: "Gets the list of chat threads of a user." parameters: - description: "The request options." name: "listThreadsOptions" type: "" - description: "The context to associate with this operation." name: "context" type: "" syntax: "public PagedIterable listChatThreads(ListChatThreadsOptions listThreadsOptions, Context context)" desc: "Gets the list of chat threads of a user." returns: description: "the paged list of chat threads of a user." type: "<>" type: "class" desc: "Sync Client that supports chat operations.\n\n**Instantiating a synchronous Chat Client**\n\n```java\n// Initialize the chat client builder\n final ChatClientBuilder builder = new ChatClientBuilder()\n .endpoint(endpoint)\n .credential(credential);\n\n // Build the chat client\n ChatClient chatClient = builder.buildClient();\n```\n\nView for additional ways to construct the client." metadata: {} package: "com.azure.communication.chat" artifact: com.azure:azure-communication-chat:1.5.6