diff --git a/sdk/communication/azure-communication-chat/README.md b/sdk/communication/azure-communication-chat/README.md index b178c8bd0e48..c5468fc8d877 100644 --- a/sdk/communication/azure-communication-chat/README.md +++ b/sdk/communication/azure-communication-chat/README.md @@ -36,8 +36,8 @@ tokenresponse = identity_client.issue_token(user, scopes=["chat"]) token = tokenresponse.token ``` -The `user` created above will be used later, because that user should be added as a member of new chat thread when you creating -it with this token. It is because the initiator of the create request must be in the list of the members of the chat thread. +The `user` created above will be used later, because that user should be added as a participant of new chat thread when you creating +it with this token. It is because the initiator of the create request must be in the list of the participants of the chat thread. ## Create the Chat Client @@ -55,12 +55,21 @@ chat_client = ChatClient(endpoint, CommunicationTokenCredential(refresh_options) ## Create Chat Thread Client The ChatThreadClient will allow you to perform operations specific to a chat thread, like send message, get message, update -the chat thread topic, add members to chat thread, etc. +the chat thread topic, add participants to chat thread, etc. You can get it by creating a new chat thread using ChatClient: ```python -chat_thread_client = chat_client.create_chat_thread(topic, thread_members) +chat_thread_client = chat_client.create_chat_thread(topic, thread_participants) +``` + +Additionally, the client can also direct so that the request is repeatable; that is, if the client makes the +request multiple times with the same Repeatability-Request-ID and it will get back an appropriate response without +the server executing the request multiple times. The value of the Repeatability-Request-ID is an opaque string +representing a client-generated, globally unique for all time, identifier for the request. + +```python +chat_thread_client = chat_client.create_chat_thread(topic, thread_participants, repeatability_request_id) ``` Alternatively, if you have created a chat thread before and you have its thread_id, you can create it by: @@ -71,14 +80,14 @@ chat_thread_client = chat_client.get_chat_thread_client(thread_id) # Key concepts -A chat conversation is represented by a chat thread. Each user in the thread is called a thread member. Thread members can chat with one another privately in a 1:1 chat or huddle up in a 1:N group chat. Users also get near real-time updates for when others are typing and when they have read the messages. +A chat conversation is represented by a chat thread. Each user in the thread is called a thread participant. Thread participants can chat with one another privately in a 1:1 chat or huddle up in a 1:N group chat. Users also get near real-time updates for when others are typing and when they have read the messages. Once you initialized a `ChatClient` class, you can do the following chat operations: ## Create, get, update, and delete threads ```Python -create_chat_thread(topic, thread_members, **kwargs) +create_chat_thread(topic, thread_participants, **kwargs) get_chat_thread(thread_id, **kwargs) list_chat_threads(**kwargs) delete_chat_thread(thread_id, **kwargs) @@ -89,7 +98,7 @@ Once you initialized a `ChatThreadClient` class, you can do the following chat o ## Update thread ```python -update_thread(topic, **kwargs) +update_topic(topic, **kwargs) ``` ## Send, get, update, and delete messages @@ -102,12 +111,12 @@ update_message(message_id, content, **kwargs) delete_message(message_id, **kwargs) ``` -## Get, add, and remove members +## Get, add, and remove participants ```Python -list_members(**kwargs) -add_members(thread_members, **kwargs) -remove_member(member_id, **kwargs) +list_participants(**kwargs) +add_participants(thread_participants, **kwargs) +remove_participant(participant_id, **kwargs) ``` ## Send typing notification @@ -131,7 +140,7 @@ The following sections provide several code snippets covering some of the most c ## Thread Operations @@ -141,27 +150,55 @@ The following sections provide several code snippets covering some of the most c Use the `create_chat_thread` method to create a chat thread client object. - Use `topic` to give a thread topic; -- Use `thread_members` to list the `ChatThreadMember` to be added to the thread; +- Use `thread_participants` to list the `ChatThreadParticipant` to be added to the thread; +- Use `repeatability_request_id` to specify the unique identifier for the request. - `user`, required, it is the `CommunicationUserIdentifier` you created by CommunicationIdentityClient.create_user() from User Access Tokens -- `display_name`, optional, is the display name for the thread member. -- `share_history_time`, optional, time from which the chat history is shared with the member. +- `display_name`, optional, is the display name for the thread participant. +- `share_history_time`, optional, time from which the chat history is shared with the participant. `ChatThreadClient` is the result returned from creating a thread, you can use it to perform other chat operations to this chat thread ```Python -from azure.communication.chat import ChatThreadMember +# Without repeatability_request_id + +from azure.communication.chat import ChatThreadParticipant topic = "test topic" -thread_members = [ChatThreadMember( +thread_participants = [ChatThreadParticipant( user='', display_name='name', share_history_time=datetime.utcnow() )] -chat_thread_client = chat_client.create_chat_thread(topic, thread_members) +chat_thread_client = chat_client.create_chat_thread(topic, thread_participants) thread_id = chat_thread_client.thread_id ``` +```Python +# With repeatability_request_id + +from azure.communication.chat import ChatThreadParticipant +import uuid + +# modify function to implement customer logic +def get_unique_identifier_for_request(**kwargs): + res = None + # implement custom logic here + res = uuid.uuid4() + return res + +topic = "test topic" +thread_participants = [ChatThreadParticipant( + user='', + display_name='name', + share_history_time=datetime.utcnow() +)] + +chat_thread_client = chat_client.create_chat_thread(topic, thread_participants, repeatability_request_id) +thread_id = chat_thread_client.thread_id +``` + + ### Get a thread The `get_chat_thread` method retrieves a thread from the service. @@ -216,7 +253,7 @@ chat_client.delete_chat_thread(thread_id) Use `send_message` method to sends a message to a thread identified by threadId. - Use `content` to provide the chat message content, it is required -- Use `priority` to specify the message priority level, such as 'Normal' or 'High', if not speficied, 'Normal' will be set +- Use `chat_message_type` to provide the chat message type. Possible values include: `ChatMessageType.TEXT`, `ChatMessageType.HTML`, `ChatMessageType.TOPIC_UPDATED`, `ChatMessageType.PARTICIPANT_ADDED`, `ChatMessageType.PARTICIPANT_REMOVED` - Use `sender_display_name` to specify the display name of the sender, if not specified, empty name will be set `SendChatMessageResult` is the response returned from sending a message, it contains an id, which is the unique ID of the message. @@ -225,10 +262,9 @@ Use `send_message` method to sends a message to a thread identified by threadId. from azure.communication.chat import ChatMessagePriority content='hello world' -priority=ChatMessagePriority.NORMAL sender_display_name='sender name' -send_message_result = chat_thread_client.send_message(content, priority=priority, sender_display_name=sender_display_name) +send_message_result = chat_thread_client.send_message(content, sender_display_name=sender_display_name) ``` ### Get a message @@ -282,50 +318,50 @@ Use `delete_message` to delete a message. chat_thread_client.delete_message(message_id) ``` -## Thread Member Operations +## Thread Participant Operations -### Get thread members +### Get thread participants -Use `list_members` to retrieve the members of the thread. +Use `list_participants` to retrieve the participants of the thread. -An iterator of `[ChatThreadMember]` is the response returned from listing members +An iterator of `[ChatThreadParticipant]` is the response returned from listing participants ```python -chat_thread_members = chat_thread_client.list_members() -for chat_thread_member in chat_thread_members: - print(chat_thread_member) +chat_thread_participants = chat_thread_client.list_participants(results_per_page=5, skip=5) +for chat_thread_participant in chat_thread_participants: + print(chat_thread_participant) ``` -### Add thread members +### Add thread participants -Use `add_members` method to add thread members to the thread. +Use `add_participants` method to add thread participants to the thread. -- Use `thread_members` to list the `ChatThreadMember` to be added to the thread; +- Use `thread_participants` to list the `ChatThreadParticipant` to be added to the thread; - `user`, required, it is the `CommunicationUserIdentifier` you created by CommunicationIdentityClient.create_user() from User Access Tokens -- `display_name`, optional, is the display name for the thread member. -- `share_history_time`, optional, time from which the chat history is shared with the member. +- `display_name`, optional, is the display name for the thread participant. +- `share_history_time`, optional, time from which the chat history is shared with the participant. ```Python -from azure.communication.chat import ChatThreadMember +from azure.communication.chat import ChatThreadParticipant from datetime import datetime -member = ChatThreadMember( +participant = ChatThreadParticipant( user='', display_name='name', share_history_time=datetime.utcnow()) -thread_members = [member] -chat_thread_client.add_members(thread_members) +thread_participants = [participant] +chat_thread_client.add_participants(thread_participants) ``` -### Remove thread member +### Remove thread participant -Use `remove_member` method to remove thread member from the thread identified by threadId. +Use `remove_participant` method to remove thread participant from the thread identified by threadId. `user` is the `CommunicationUserIdentifier` you created by CommunicationIdentityClient.create_user() from User Access Tokens and was added into this chat thread. ```python -chat_thread_client.remove_member(user) +chat_thread_client.remove_participant(user) ``` ## Events Operations @@ -350,10 +386,10 @@ chat_thread_client.send_read_receipt(message_id) `list_read_receipts` method retrieves read receipts for a thread. -An iterator of `[ReadReceipt]` is the response returned from listing read receipts +An iterator of `[ChatMessageReadReceipt]` is the response returned from listing read receipts ```python -read_receipts = chat_thread_client.list_read_receipts() +read_receipts = chat_thread_client.list_read_receipts(results_per_page=5, skip=5) for read_receipt in read_receipts: print(read_receipt) print(read_receipt.sender) diff --git a/sdk/communication/azure-communication-chat/azure/communication/chat/__init__.py b/sdk/communication/azure-communication-chat/azure/communication/chat/__init__.py index 0e33c4caa201..b96a16e4aff7 100644 --- a/sdk/communication/azure-communication-chat/azure/communication/chat/__init__.py +++ b/sdk/communication/azure-communication-chat/azure/communication/chat/__init__.py @@ -2,17 +2,18 @@ from ._chat_client import ChatClient from ._chat_thread_client import ChatThreadClient from ._generated.models import ( - ChatMessagePriority, SendChatMessageResult, ChatThreadInfo, + ChatMessageType ) from ._shared.user_credential import CommunicationTokenCredential from ._shared.user_token_refresh_options import CommunicationTokenRefreshOptions from ._models import ( - ChatThreadMember, + ChatThreadParticipant, ChatMessage, ChatThread, - ReadReceipt, + ChatMessageReadReceipt, + ChatMessageContent ) from ._shared.models import CommunicationUserIdentifier @@ -20,14 +21,15 @@ 'ChatClient', 'ChatThreadClient', 'ChatMessage', - 'ChatMessagePriority', - 'ReadReceipt', + 'ChatMessageContent', + 'ChatMessageReadReceipt', 'SendChatMessageResult', 'ChatThread', 'ChatThreadInfo', 'CommunicationTokenCredential', 'CommunicationTokenRefreshOptions', - 'ChatThreadMember', 'CommunicationUserIdentifier', + 'ChatThreadParticipant', + 'ChatMessageType' ] __version__ = VERSION diff --git a/sdk/communication/azure-communication-chat/azure/communication/chat/_chat_client.py b/sdk/communication/azure-communication-chat/azure/communication/chat/_chat_client.py index 096e31311fd0..af1ad4f897a2 100644 --- a/sdk/communication/azure-communication-chat/azure/communication/chat/_chat_client.py +++ b/sdk/communication/azure-communication-chat/azure/communication/chat/_chat_client.py @@ -4,22 +4,24 @@ # license information. # -------------------------------------------------------------------------- from typing import TYPE_CHECKING - +from uuid import uuid4 try: from urllib.parse import urlparse except ImportError: from urlparse import urlparse # type: ignore from azure.core.tracing.decorator import distributed_trace -from azure.core.exceptions import HttpResponseError from azure.core.pipeline.policies import BearerTokenCredentialPolicy from ._chat_thread_client import ChatThreadClient from ._shared.user_credential import CommunicationTokenCredential from ._generated import AzureCommunicationChatService from ._generated.models import CreateChatThreadRequest -from ._models import ChatThread -from ._utils import _to_utc_datetime # pylint: disable=unused-import +from ._models import ( + ChatThread, + ChatThreadParticipant +) +from ._utils import _to_utc_datetime, return_response # pylint: disable=unused-import from ._version import SDK_MONIKER if TYPE_CHECKING: @@ -117,7 +119,8 @@ def get_chat_thread_client( @distributed_trace def create_chat_thread( self, topic, # type: str - thread_members, # type: list[ChatThreadMember] + thread_participants, # type: list[ChatThreadParticipant] + repeatability_request_id=None, # type: Optional[str] **kwargs # type: Any ): # type: (...) -> ChatThreadClient @@ -125,8 +128,15 @@ def create_chat_thread( :param topic: Required. The thread topic. :type topic: str - :param thread_members: Required. Members to be added to the thread. - :type thread_members: list[~azure.communication.chat.ChatThreadMember] + :param thread_participants: Required. Participants to be added to the thread. + :type thread_participants: list[~azure.communication.chat.ChatThreadParticipant] + :param repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-ID and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-ID is an opaque string + representing a client-generated, globally unique for all time, identifier for the request. If not + specified, a new unique id would be generated. + :type repeatability_request_id: str :return: ChatThreadClient :rtype: ~azure.communication.chat.ChatThreadClient :raises: ~azure.core.exceptions.HttpResponseError, ValueError @@ -142,24 +152,29 @@ def create_chat_thread( """ if not topic: raise ValueError("topic cannot be None.") - if not thread_members: - raise ValueError("List of ThreadMember cannot be None.") - - members = [m._to_generated() for m in thread_members] # pylint:disable=protected-access - create_thread_request = CreateChatThreadRequest(topic=topic, members=members) - - create_chat_thread_result = self._client.create_chat_thread(create_thread_request, **kwargs) - - multiple_status = create_chat_thread_result.multiple_status - thread_status = [status for status in multiple_status if status.type == "Thread"] - if not thread_status: - raise HttpResponseError(message="Can not find chat thread status result from: {}".format(thread_status)) - if thread_status[0].status_code != 201: - raise HttpResponseError(message="Chat thread creation failed with status code {}, message: {}.".format( - thread_status[0].status_code, thread_status[0].message)) - - thread_id = thread_status[0].id - + if not thread_participants: + raise ValueError("List of ChatThreadParticipant cannot be None.") + if repeatability_request_id is None: + repeatability_request_id = str(uuid4()) + + participants = [m._to_generated() for m in thread_participants] # pylint:disable=protected-access + create_thread_request = \ + CreateChatThreadRequest(topic=topic, participants=participants) + + create_chat_thread_result = self._client.chat.create_chat_thread( + create_chat_thread_request=create_thread_request, + repeatability_request_id=repeatability_request_id, + **kwargs) + if hasattr(create_chat_thread_result, 'errors') and \ + create_chat_thread_result.errors is not None: + participants = \ + create_chat_thread_result.errors.invalid_participants + errors = [] + for participant in participants: + errors.append('participant ' + participant.target + + ' failed to join thread due to: ' + participant.message) + raise RuntimeError(errors) + thread_id = create_chat_thread_result.chat_thread.id return ChatThreadClient( endpoint=self._endpoint, credential=self._credential, @@ -194,7 +209,7 @@ def get_chat_thread( if not thread_id: raise ValueError("thread_id cannot be None.") - chat_thread = self._client.get_chat_thread(thread_id, **kwargs) + chat_thread = self._client.chat.get_chat_thread(thread_id, **kwargs) return ChatThread._from_generated(chat_thread) # pylint:disable=protected-access @distributed_trace @@ -207,9 +222,8 @@ def list_chat_threads( :keyword int results_per_page: The maximum number of chat threads returned per page. :keyword ~datetime.datetime start_time: The earliest point in time to get chat threads up to. - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ItemPaged[:class:`~azure.communication.chat.ChatThreadInfo`] - :rtype: ~azure.core.paging.ItemPaged + :return: An iterator like instance of ChatThreadInfo + :rtype: ~azure.core.paging.ItemPaged[~azure.communication.chat.ChatThreadInfo] :raises: ~azure.core.exceptions.HttpResponseError, ValueError .. admonition:: Example: @@ -224,7 +238,7 @@ def list_chat_threads( results_per_page = kwargs.pop("results_per_page", None) start_time = kwargs.pop("start_time", None) - return self._client.list_chat_threads( + return self._client.chat.list_chat_threads( max_page_size=results_per_page, start_time=start_time, **kwargs) @@ -257,7 +271,7 @@ def delete_chat_thread( if not thread_id: raise ValueError("thread_id cannot be None.") - return self._client.delete_chat_thread(thread_id, **kwargs) + return self._client.chat.delete_chat_thread(thread_id, **kwargs) def close(self): # type: () -> None diff --git a/sdk/communication/azure-communication-chat/azure/communication/chat/_chat_thread_client.py b/sdk/communication/azure-communication-chat/azure/communication/chat/_chat_thread_client.py index 8da49613ae01..1e3095997cf6 100644 --- a/sdk/communication/azure-communication-chat/azure/communication/chat/_chat_thread_client.py +++ b/sdk/communication/azure-communication-chat/azure/communication/chat/_chat_thread_client.py @@ -16,16 +16,17 @@ from ._shared.user_credential import CommunicationTokenCredential from ._generated import AzureCommunicationChatService from ._generated.models import ( - AddChatThreadMembersRequest, + AddChatParticipantsRequest, SendReadReceiptRequest, SendChatMessageRequest, UpdateChatMessageRequest, - UpdateChatThreadRequest + UpdateChatThreadRequest, + ChatMessageType ) from ._models import ( - ChatThreadMember, + ChatThreadParticipant, ChatMessage, - ReadReceipt + ChatMessageReadReceipt ) from ._utils import _to_utc_datetime # pylint: disable=unused-import @@ -42,7 +43,7 @@ class ChatThreadClient(object): """A client to interact with the AzureCommunicationService Chat gateway. Instances of this class is normally created by ChatClient.create_chat_thread() - This client provides operations to add member to chat thread, remove member from + This client provides operations to add participant to chat thread, remove participant from chat thread, send message, delete message, update message, send typing notifications, send and list read receipt @@ -113,7 +114,7 @@ def thread_id(self): return self._thread_id @distributed_trace - def update_thread( + def update_topic( self, topic=None, # type: Optional[str] **kwargs # type: Any @@ -132,17 +133,17 @@ def update_thread( .. admonition:: Example: .. literalinclude:: ../samples/chat_thread_client_sample.py - :start-after: [START update_thread] - :end-before: [END update_thread] + :start-after: [START update_topic] + :end-before: [END update_topic] :language: python :dedent: 8 :caption: Updating chat thread. """ - update_thread_request = UpdateChatThreadRequest(topic=topic) - return self._client.update_chat_thread( + update_topic_request = UpdateChatThreadRequest(topic=topic) + return self._client.chat_thread.update_chat_thread( chat_thread_id=self._thread_id, - body=update_thread_request, + update_chat_thread_request=update_topic_request, **kwargs) @distributed_trace @@ -174,9 +175,9 @@ def send_read_receipt( raise ValueError("message_id cannot be None.") post_read_receipt_request = SendReadReceiptRequest(chat_message_id=message_id) - return self._client.send_chat_read_receipt( + return self._client.chat_thread.send_chat_read_receipt( self._thread_id, - body=post_read_receipt_request, + send_read_receipt_request=post_read_receipt_request, **kwargs) @distributed_trace @@ -184,12 +185,14 @@ def list_read_receipts( self, **kwargs # type: Any ): - # type: (...) -> ItemPaged[ReadReceipt] + # type: (...) -> ItemPaged[ChatMessageReadReceipt] """Gets read receipts for a thread. + :keyword int results_per_page: The maximum number of chat message read receipts to be returned per page. + :keyword int skip: Skips chat message read receipts up to a specified position in response. :keyword callable cls: A custom type or function that will be passed the direct response - :return: ItemPaged[:class:`~azure.communication.chat.ReadReceipt`] - :rtype: ~azure.core.paging.ItemPaged + :return: An iterator like instance of ChatMessageReadReceipt + :rtype: ~azure.core.paging.ItemPaged[~azure.communication.chat.ChatMessageReadReceipt] :raises: ~azure.core.exceptions.HttpResponseError, ValueError .. admonition:: Example: @@ -201,9 +204,14 @@ def list_read_receipts( :dedent: 8 :caption: Listing read receipts. """ - return self._client.list_chat_read_receipts( + results_per_page = kwargs.pop("results_per_page", None) + skip = kwargs.pop("skip", None) + + return self._client.chat_thread.list_chat_read_receipts( self._thread_id, - cls=lambda objs: [ReadReceipt._from_generated(x) for x in objs], # pylint:disable=protected-access + max_page_size=results_per_page, + skip=skip, + cls=lambda objs: [ChatMessageReadReceipt._from_generated(x) for x in objs], # pylint:disable=protected-access **kwargs) @distributed_trace @@ -228,7 +236,7 @@ def send_typing_notification( :dedent: 8 :caption: Sending typing notification. """ - return self._client.send_typing_notification(self._thread_id, **kwargs) + return self._client.chat_thread.send_typing_notification(self._thread_id, **kwargs) @distributed_trace def send_message( @@ -236,18 +244,19 @@ def send_message( content, # type: str **kwargs # type: Any ): - # type: (...) -> SendChatMessageResult + # type: (...) -> str """Sends a message to a thread. :param content: Required. Chat message content. :type content: str - :keyword priority: Message priority. - :paramtype priority: str or ChatMessagePriority + :param chat_message_type: The chat message type. Possible values include: "text", "html". + Default: ChatMessageType.TEXT + :type chat_message_type: str or ~azure.communication.chat.models.ChatMessageType :keyword str sender_display_name: The display name of the message sender. This property is used to populate sender name for push notifications. :keyword callable cls: A custom type or function that will be passed the direct response - :return: SendChatMessageResult, or the result of cls(response) - :rtype: ~azure.communication.chat.SendChatMessageResult + :return: str, or the result of cls(response) + :rtype: str :raises: ~azure.core.exceptions.HttpResponseError, ValueError .. admonition:: Example: @@ -262,18 +271,33 @@ def send_message( if not content: raise ValueError("content cannot be None.") - priority = kwargs.pop("priority", None) + chat_message_type = kwargs.pop("chat_message_type", None) + if chat_message_type is None: + chat_message_type = ChatMessageType.TEXT + elif not isinstance(chat_message_type, ChatMessageType): + try: + chat_message_type = ChatMessageType.__getattr__(chat_message_type) # pylint:disable=protected-access + except Exception: + raise ValueError( + "chat_message_type: {message_type} is not acceptable".format(message_type=chat_message_type)) + + if chat_message_type not in [ChatMessageType.TEXT, ChatMessageType.HTML]: + raise ValueError( + "chat_message_type: {message_type} can be only 'text' or 'html'".format(message_type=chat_message_type)) + sender_display_name = kwargs.pop("sender_display_name", None) create_message_request = SendChatMessageRequest( content=content, - priority=priority, + type=chat_message_type, sender_display_name=sender_display_name ) - return self._client.send_chat_message( + + send_chat_message_result = self._client.chat_thread.send_chat_message( chat_thread_id=self._thread_id, - body=create_message_request, + send_chat_message_request=create_message_request, **kwargs) + return send_chat_message_result.id @distributed_trace def get_message( @@ -303,7 +327,7 @@ def get_message( if not message_id: raise ValueError("message_id cannot be None.") - chat_message = self._client.get_chat_message(self._thread_id, message_id, **kwargs) + chat_message = self._client.chat_thread.get_chat_message(self._thread_id, message_id, **kwargs) return ChatMessage._from_generated(chat_message) # pylint:disable=protected-access @distributed_trace @@ -317,8 +341,8 @@ def list_messages( :keyword int results_per_page: The maximum number of messages to be returned per page. :keyword ~datetime.datetime start_time: The start time where the range query. :keyword callable cls: A custom type or function that will be passed the direct response - :return: ItemPaged[:class:`~azure.communication.chat.ChatMessage`] - :rtype: ~azure.core.paging.ItemPaged + :return: An iterator like instance of ChatMessage + :rtype: ~azure.core.paging.ItemPaged[~azure.communication.chat.ChatMessage] :raises: ~azure.core.exceptions.HttpResponseError, ValueError .. admonition:: Example: @@ -333,12 +357,13 @@ def list_messages( results_per_page = kwargs.pop("results_per_page", None) start_time = kwargs.pop("start_time", None) - return self._client.list_chat_messages( + a = self._client.chat_thread.list_chat_messages( self._thread_id, max_page_size=results_per_page, start_time=start_time, cls=lambda objs: [ChatMessage._from_generated(x) for x in objs], # pylint:disable=protected-access **kwargs) + return a @distributed_trace def update_message( @@ -373,10 +398,10 @@ def update_message( update_message_request = UpdateChatMessageRequest(content=content, priority=None) - return self._client.update_chat_message( + return self._client.chat_thread.update_chat_message( chat_thread_id=self._thread_id, chat_message_id=message_id, - body=update_message_request, + update_chat_message_request=update_message_request, **kwargs) @distributed_trace @@ -407,50 +432,93 @@ def delete_message( if not message_id: raise ValueError("message_id cannot be None.") - return self._client.delete_chat_message( + return self._client.chat_thread.delete_chat_message( chat_thread_id=self._thread_id, chat_message_id=message_id, **kwargs) @distributed_trace - def list_members( + def list_participants( self, **kwargs # type: Any ): - # type: (...) -> ItemPaged[ChatThreadMember] - """Gets the members of a thread. + # type: (...) -> ItemPaged[ChatThreadParticipant] + """Gets the participants of a thread. + :keyword int results_per_page: The maximum number of participants to be returned per page. + :keyword int skip: Skips participants up to a specified position in response. :keyword callable cls: A custom type or function that will be passed the direct response - :return: ItemPaged[:class:`~azure.communication.chat.ChatThreadMember`] - :rtype: ~azure.core.paging.ItemPaged + :return: An iterator like instance of ChatThreadParticipant + :rtype: ~azure.core.paging.ItemPaged[~azure.communication.chat.ChatThreadParticipant] :raises: ~azure.core.exceptions.HttpResponseError, ValueError .. admonition:: Example: .. literalinclude:: ../samples/chat_thread_client_sample.py - :start-after: [START list_members] - :end-before: [END list_members] + :start-after: [START list_participants] + :end-before: [END list_participants] :language: python :dedent: 8 - :caption: Listing members of chat thread. + :caption: Listing participants of chat thread. """ - return self._client.list_chat_thread_members( + results_per_page = kwargs.pop("results_per_page", None) + skip = kwargs.pop("skip", None) + + return self._client.chat_thread.list_chat_participants( self._thread_id, - cls=lambda objs: [ChatThreadMember._from_generated(x) for x in objs], # pylint:disable=protected-access + max_page_size=results_per_page, + skip=skip, + cls=lambda objs: [ChatThreadParticipant._from_generated(x) for x in objs], # pylint:disable=protected-access + **kwargs) + + @distributed_trace + def add_participant( + self, + thread_participant, # type: ChatThreadParticipant + **kwargs # type: Any + ): + # type: (...) -> None + """Adds single thread participant to a thread. If participant already exist, no change occurs. + + :param thread_participant: Required. Single thread participant to be added to the thread. + :type thread_participant: ~azure.communication.chat.ChatThreadParticipant + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError, ValueError + + .. admonition:: Example: + + .. literalinclude:: ../samples/chat_thread_client_sample.py + :start-after: [START add_participant] + :end-before: [END add_participant] + :language: python + :dedent: 8 + :caption: Adding single participant to chat thread. + """ + if not thread_participant: + raise ValueError("thread_participant cannot be None.") + + participants = [thread_participant._to_generated()] # pylint:disable=protected-access + add_thread_participants_request = AddChatParticipantsRequest(participants=participants) + + return self._client.chat_thread.add_chat_participants( + chat_thread_id=self._thread_id, + add_chat_participants_request=add_thread_participants_request, **kwargs) @distributed_trace - def add_members( + def add_participants( self, - thread_members, # type: list[ChatThreadMember] + thread_participants, # type: list[ChatThreadParticipant] **kwargs # type: Any ): # type: (...) -> None - """Adds thread members to a thread. If members already exist, no change occurs. + """Adds thread participants to a thread. If participants already exist, no change occurs. - :param thread_members: Required. Thread members to be added to the thread. - :type thread_members: list[~azure.communication.chat.ChatThreadMember] + :param thread_participants: Required. Thread participants to be added to the thread. + :type thread_participants: list[~azure.communication.chat.ChatThreadParticipant] :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -459,33 +527,33 @@ def add_members( .. admonition:: Example: .. literalinclude:: ../samples/chat_thread_client_sample.py - :start-after: [START add_members] - :end-before: [END add_members] + :start-after: [START add_participants] + :end-before: [END add_participants] :language: python :dedent: 8 - :caption: Adding members to chat thread. + :caption: Adding participants to chat thread. """ - if not thread_members: - raise ValueError("thread_members cannot be None.") + if not thread_participants: + raise ValueError("thread_participants cannot be None.") - members = [m._to_generated() for m in thread_members] # pylint:disable=protected-access - add_thread_members_request = AddChatThreadMembersRequest(members=members) + participants = [m._to_generated() for m in thread_participants] # pylint:disable=protected-access + add_thread_participants_request = AddChatParticipantsRequest(participants=participants) - return self._client.add_chat_thread_members( + return self._client.chat_thread.add_chat_participants( chat_thread_id=self._thread_id, - body=add_thread_members_request, + add_chat_participants_request=add_thread_participants_request, **kwargs) @distributed_trace - def remove_member( + def remove_participant( self, - user, # type: CommunicationUser + user, # type: CommunicationUserIdentifier **kwargs # type: Any ): # type: (...) -> None - """Remove a member from a thread. + """Remove a participant from a thread. - :param user: Required. User identity of the thread member to remove from the thread. + :param user: Required. User identity of the thread participant to remove from the thread. :type user: ~azure.communication.chat.CommunicationUserIdentifier :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) @@ -495,18 +563,18 @@ def remove_member( .. admonition:: Example: .. literalinclude:: ../samples/chat_thread_client_sample.py - :start-after: [START remove_member] - :end-before: [END remove_member] + :start-after: [START remove_participant] + :end-before: [END remove_participant] :language: python :dedent: 8 - :caption: Removing member from chat thread. + :caption: Removing participant from chat thread. """ if not user: raise ValueError("user cannot be None.") - return self._client.remove_chat_thread_member( + return self._client.chat_thread.remove_chat_participant( chat_thread_id=self._thread_id, - chat_member_id=user.identifier, + chat_participant_id=user.identifier, **kwargs) def close(self): diff --git a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/_azure_communication_chat_service.py b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/_azure_communication_chat_service.py index 996122990a6b..e49f027055f2 100644 --- a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/_azure_communication_chat_service.py +++ b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/_azure_communication_chat_service.py @@ -16,13 +16,18 @@ from typing import Any from ._configuration import AzureCommunicationChatServiceConfiguration -from .operations import AzureCommunicationChatServiceOperationsMixin +from .operations import ChatThreadOperations +from .operations import ChatOperations from . import models -class AzureCommunicationChatService(AzureCommunicationChatServiceOperationsMixin): +class AzureCommunicationChatService(object): """Azure Communication Chat Service. + :ivar chat_thread: ChatThreadOperations operations + :vartype chat_thread: azure.communication.chat.operations.ChatThreadOperations + :ivar chat: ChatOperations operations + :vartype chat: azure.communication.chat.operations.ChatOperations :param endpoint: The endpoint of the Azure Communication resource. :type endpoint: str """ @@ -39,8 +44,13 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) + self.chat_thread = ChatThreadOperations( + self._client, self._config, self._serialize, self._deserialize) + self.chat = ChatOperations( + self._client, self._config, self._serialize, self._deserialize) def close(self): # type: () -> None diff --git a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/_configuration.py b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/_configuration.py index 65b08c58e662..ffeba8865187 100644 --- a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/_configuration.py +++ b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/_configuration.py @@ -38,7 +38,7 @@ def __init__( super(AzureCommunicationChatServiceConfiguration, self).__init__(**kwargs) self.endpoint = endpoint - self.api_version = "2020-09-21-preview2" + self.api_version = "2020-11-01-preview3" kwargs.setdefault('sdk_moniker', 'azurecommunicationchatservice/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/_azure_communication_chat_service.py b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/_azure_communication_chat_service.py index eb5faba2dd2b..0abf7bcfd572 100644 --- a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/_azure_communication_chat_service.py +++ b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/_azure_communication_chat_service.py @@ -12,13 +12,18 @@ from msrest import Deserializer, Serializer from ._configuration import AzureCommunicationChatServiceConfiguration -from .operations import AzureCommunicationChatServiceOperationsMixin +from .operations import ChatThreadOperations +from .operations import ChatOperations from .. import models -class AzureCommunicationChatService(AzureCommunicationChatServiceOperationsMixin): +class AzureCommunicationChatService(object): """Azure Communication Chat Service. + :ivar chat_thread: ChatThreadOperations operations + :vartype chat_thread: azure.communication.chat.aio.operations.ChatThreadOperations + :ivar chat: ChatOperations operations + :vartype chat: azure.communication.chat.aio.operations.ChatOperations :param endpoint: The endpoint of the Azure Communication resource. :type endpoint: str """ @@ -34,8 +39,13 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) + self.chat_thread = ChatThreadOperations( + self._client, self._config, self._serialize, self._deserialize) + self.chat = ChatOperations( + self._client, self._config, self._serialize, self._deserialize) async def close(self) -> None: await self._client.close() diff --git a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/_configuration.py b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/_configuration.py index 60e56e152f13..ccd461ebf21b 100644 --- a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/_configuration.py +++ b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/_configuration.py @@ -33,7 +33,7 @@ def __init__( super(AzureCommunicationChatServiceConfiguration, self).__init__(**kwargs) self.endpoint = endpoint - self.api_version = "2020-09-21-preview2" + self.api_version = "2020-11-01-preview3" kwargs.setdefault('sdk_moniker', 'azurecommunicationchatservice/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/operations/__init__.py b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/operations/__init__.py index fbcbeea166ae..ca0d822356d7 100644 --- a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/operations/__init__.py +++ b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/operations/__init__.py @@ -6,8 +6,10 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._azure_communication_chat_service_operations import AzureCommunicationChatServiceOperationsMixin +from ._chat_thread_operations import ChatThreadOperations +from ._chat_operations import ChatOperations __all__ = [ - 'AzureCommunicationChatServiceOperationsMixin', + 'ChatThreadOperations', + 'ChatOperations', ] diff --git a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/operations/_chat_operations.py b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/operations/_chat_operations.py new file mode 100644 index 000000000000..f4c03ab7678e --- /dev/null +++ b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/operations/_chat_operations.py @@ -0,0 +1,324 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ChatOperations: + """ChatOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.communication.chat.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def create_chat_thread( + self, + create_chat_thread_request: "_models.CreateChatThreadRequest", + repeatability_request_id: Optional[str] = None, + **kwargs + ) -> "_models.CreateChatThreadResult": + """Creates a chat thread. + + Creates a chat thread. + + :param create_chat_thread_request: Request payload for creating a chat thread. + :type create_chat_thread_request: ~azure.communication.chat.models.CreateChatThreadRequest + :param repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-ID and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-ID is an opaque string + representing a client-generated, globally unique for all time, identifier for the request. It + is recommended to use version 4 (random) UUIDs. + :type repeatability_request_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CreateChatThreadResult, or the result of cls(response) + :rtype: ~azure.communication.chat.models.CreateChatThreadResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CreateChatThreadResult"] + error_map = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview3" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_chat_thread.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if repeatability_request_id is not None: + header_parameters['repeatability-Request-ID'] = self._serialize.header("repeatability_request_id", repeatability_request_id, 'str') + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(create_chat_thread_request, 'CreateChatThreadRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + deserialized = self._deserialize('CreateChatThreadResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_chat_thread.metadata = {'url': '/chat/threads'} # type: ignore + + def list_chat_threads( + self, + max_page_size: Optional[int] = None, + start_time: Optional[datetime.datetime] = None, + **kwargs + ) -> AsyncIterable["_models.ChatThreadsInfoCollection"]: + """Gets the list of chat threads of a user. + + Gets the list of chat threads of a user. + + :param max_page_size: The maximum number of chat threads returned per page. + :type max_page_size: int + :param start_time: The earliest point in time to get chat threads up to. The timestamp should + be in RFC3339 format: ``yyyy-MM-ddTHH:mm:ssZ``. + :type start_time: ~datetime.datetime + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ChatThreadsInfoCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.communication.chat.models.ChatThreadsInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ChatThreadsInfoCollection"] + error_map = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview3" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_chat_threads.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if max_page_size is not None: + query_parameters['maxPageSize'] = self._serialize.query("max_page_size", max_page_size, 'int') + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ChatThreadsInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_chat_threads.metadata = {'url': '/chat/threads'} # type: ignore + + async def get_chat_thread( + self, + chat_thread_id: str, + **kwargs + ) -> "_models.ChatThread": + """Gets a chat thread. + + Gets a chat thread. + + :param chat_thread_id: Id of the thread. + :type chat_thread_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ChatThread, or the result of cls(response) + :rtype: ~azure.communication.chat.models.ChatThread + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ChatThread"] + error_map = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview3" + accept = "application/json" + + # Construct URL + url = self.get_chat_thread.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'chatThreadId': self._serialize.url("chat_thread_id", chat_thread_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + deserialized = self._deserialize('ChatThread', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_chat_thread.metadata = {'url': '/chat/threads/{chatThreadId}'} # type: ignore + + async def delete_chat_thread( + self, + chat_thread_id: str, + **kwargs + ) -> None: + """Deletes a thread. + + Deletes a thread. + + :param chat_thread_id: Id of the thread to be deleted. + :type chat_thread_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview3" + accept = "application/json" + + # Construct URL + url = self.delete_chat_thread.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'chatThreadId': self._serialize.url("chat_thread_id", chat_thread_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) + + delete_chat_thread.metadata = {'url': '/chat/threads/{chatThreadId}'} # type: ignore diff --git a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/operations/_azure_communication_chat_service_operations.py b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/operations/_chat_thread_operations.py similarity index 62% rename from sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/operations/_azure_communication_chat_service_operations.py rename to sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/operations/_chat_thread_operations.py index b1ab6ae6f996..c0310c0e14a0 100644 --- a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/operations/_azure_communication_chat_service_operations.py +++ b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/aio/operations/_chat_thread_operations.py @@ -14,40 +14,66 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class AzureCommunicationChatServiceOperationsMixin: +class ChatThreadOperations: + """ChatThreadOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.communication.chat.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config def list_chat_read_receipts( self, chat_thread_id: str, + max_page_size: Optional[int] = None, + skip: Optional[int] = None, **kwargs - ) -> AsyncIterable["models.ReadReceiptsCollection"]: - """Gets read receipts for a thread. + ) -> AsyncIterable["_models.ChatMessageReadReceiptsCollection"]: + """Gets chat message read receipts for a thread. - Gets read receipts for a thread. + Gets chat message read receipts for a thread. - :param chat_thread_id: Thread id to get the read receipts for. + :param chat_thread_id: Thread id to get the chat message read receipts for. :type chat_thread_id: str + :param max_page_size: The maximum number of chat message read receipts to be returned per page. + :type max_page_size: int + :param skip: Skips chat message read receipts up to a specified position in response. + :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ReadReceiptsCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.communication.chat.models.ReadReceiptsCollection] + :return: An iterator like instance of either ChatMessageReadReceiptsCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.communication.chat.models.ChatMessageReadReceiptsCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ReadReceiptsCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ChatMessageReadReceiptsCollection"] error_map = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" + api_version = "2020-11-01-preview3" accept = "application/json" def prepare_request(next_link=None): @@ -65,6 +91,10 @@ def prepare_request(next_link=None): url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] + if max_page_size is not None: + query_parameters['maxPageSize'] = self._serialize.query("max_page_size", max_page_size, 'int') + if skip is not None: + query_parameters['skip'] = self._serialize.query("skip", skip, 'int') query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') request = self._client.get(url, query_parameters, header_parameters) @@ -80,7 +110,7 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ReadReceiptsCollection', pipeline_response) + deserialized = self._deserialize('ChatMessageReadReceiptsCollection', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -101,12 +131,12 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_chat_read_receipts.metadata = {'url': '/chat/threads/{chatThreadId}/readreceipts'} # type: ignore + list_chat_read_receipts.metadata = {'url': '/chat/threads/{chatThreadId}/readReceipts'} # type: ignore async def send_chat_read_receipt( self, chat_thread_id: str, - body: "models.SendReadReceiptRequest", + send_read_receipt_request: "_models.SendReadReceiptRequest", **kwargs ) -> None: """Sends a read receipt event to a thread, on behalf of a user. @@ -115,8 +145,8 @@ async def send_chat_read_receipt( :param chat_thread_id: Thread id to send the read receipt event to. :type chat_thread_id: str - :param body: Read receipt details. - :type body: ~azure.communication.chat.models.SendReadReceiptRequest + :param send_read_receipt_request: Read receipt details. + :type send_read_receipt_request: ~azure.communication.chat.models.SendReadReceiptRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -126,13 +156,13 @@ async def send_chat_read_receipt( error_map = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" + api_version = "2020-11-01-preview3" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -154,51 +184,51 @@ async def send_chat_read_receipt( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(body, 'SendReadReceiptRequest') + body_content = self._serialize.body(send_read_receipt_request, 'SendReadReceiptRequest') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [201]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) if cls: return cls(pipeline_response, None, {}) - send_chat_read_receipt.metadata = {'url': '/chat/threads/{chatThreadId}/readreceipts'} # type: ignore + send_chat_read_receipt.metadata = {'url': '/chat/threads/{chatThreadId}/readReceipts'} # type: ignore async def send_chat_message( self, chat_thread_id: str, - body: "models.SendChatMessageRequest", + send_chat_message_request: "_models.SendChatMessageRequest", **kwargs - ) -> "models.SendChatMessageResult": + ) -> "_models.SendChatMessageResult": """Sends a message to a thread. Sends a message to a thread. :param chat_thread_id: The thread id to send the message to. :type chat_thread_id: str - :param body: Details of the message to send. - :type body: ~azure.communication.chat.models.SendChatMessageRequest + :param send_chat_message_request: Details of the message to send. + :type send_chat_message_request: ~azure.communication.chat.models.SendChatMessageRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: SendChatMessageResult, or the result of cls(response) :rtype: ~azure.communication.chat.models.SendChatMessageResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SendChatMessageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SendChatMessageResult"] error_map = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" + api_version = "2020-11-01-preview3" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -220,7 +250,7 @@ async def send_chat_message( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(body, 'SendChatMessageRequest') + body_content = self._serialize.body(send_chat_message_request, 'SendChatMessageRequest') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) @@ -244,7 +274,7 @@ def list_chat_messages( max_page_size: Optional[int] = None, start_time: Optional[datetime.datetime] = None, **kwargs - ) -> AsyncIterable["models.ChatMessagesCollection"]: + ) -> AsyncIterable["_models.ChatMessagesCollection"]: """Gets a list of messages from a thread. Gets a list of messages from a thread. @@ -254,24 +284,24 @@ def list_chat_messages( :param max_page_size: The maximum number of messages to be returned per page. :type max_page_size: int :param start_time: The earliest point in time to get messages up to. The timestamp should be in - ISO8601 format: ``yyyy-MM-ddTHH:mm:ssZ``. + RFC3339 format: ``yyyy-MM-ddTHH:mm:ssZ``. :type start_time: ~datetime.datetime :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ChatMessagesCollection or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.communication.chat.models.ChatMessagesCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ChatMessagesCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ChatMessagesCollection"] error_map = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" + api_version = "2020-11-01-preview3" accept = "application/json" def prepare_request(next_link=None): @@ -336,7 +366,7 @@ async def get_chat_message( chat_thread_id: str, chat_message_id: str, **kwargs - ) -> "models.ChatMessage": + ) -> "_models.ChatMessage": """Gets a message by id. Gets a message by id. @@ -350,17 +380,17 @@ async def get_chat_message( :rtype: ~azure.communication.chat.models.ChatMessage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ChatMessage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ChatMessage"] error_map = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" + api_version = "2020-11-01-preview3" accept = "application/json" # Construct URL @@ -400,7 +430,7 @@ async def update_chat_message( self, chat_thread_id: str, chat_message_id: str, - body: "models.UpdateChatMessageRequest", + update_chat_message_request: "_models.UpdateChatMessageRequest", **kwargs ) -> None: """Updates a message. @@ -411,8 +441,8 @@ async def update_chat_message( :type chat_thread_id: str :param chat_message_id: The message id. :type chat_message_id: str - :param body: Details of the request to update the message. - :type body: ~azure.communication.chat.models.UpdateChatMessageRequest + :param update_chat_message_request: Details of the request to update the message. + :type update_chat_message_request: ~azure.communication.chat.models.UpdateChatMessageRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -422,14 +452,14 @@ async def update_chat_message( error_map = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" - content_type = kwargs.pop("content_type", "application/json") + api_version = "2020-11-01-preview3" + content_type = kwargs.pop("content_type", "application/merge-patch+json") accept = "application/json" # Construct URL @@ -451,13 +481,13 @@ async def update_chat_message( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(body, 'UpdateChatMessageRequest') + body_content = self._serialize.body(update_chat_message_request, 'UpdateChatMessageRequest') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) @@ -489,13 +519,13 @@ async def delete_chat_message( error_map = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" + api_version = "2020-11-01-preview3" accept = "application/json" # Construct URL @@ -548,13 +578,13 @@ async def send_typing_notification( error_map = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" + api_version = "2020-11-01-preview3" accept = "application/json" # Construct URL @@ -586,33 +616,39 @@ async def send_typing_notification( send_typing_notification.metadata = {'url': '/chat/threads/{chatThreadId}/typing'} # type: ignore - def list_chat_thread_members( + def list_chat_participants( self, chat_thread_id: str, + max_page_size: Optional[int] = None, + skip: Optional[int] = None, **kwargs - ) -> AsyncIterable["models.ChatThreadMembersCollection"]: - """Gets the members of a thread. + ) -> AsyncIterable["_models.ChatParticipantsCollection"]: + """Gets the participants of a thread. - Gets the members of a thread. + Gets the participants of a thread. - :param chat_thread_id: Thread id to get members for. + :param chat_thread_id: Thread id to get participants for. :type chat_thread_id: str + :param max_page_size: The maximum number of participants to be returned per page. + :type max_page_size: int + :param skip: Skips participants up to a specified position in response. + :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ChatThreadMembersCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.communication.chat.models.ChatThreadMembersCollection] + :return: An iterator like instance of either ChatParticipantsCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.communication.chat.models.ChatParticipantsCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ChatThreadMembersCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ChatParticipantsCollection"] error_map = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" + api_version = "2020-11-01-preview3" accept = "application/json" def prepare_request(next_link=None): @@ -622,7 +658,7 @@ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_chat_thread_members.metadata['url'] # type: ignore + url = self.list_chat_participants.metadata['url'] # type: ignore path_format_arguments = { 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), 'chatThreadId': self._serialize.url("chat_thread_id", chat_thread_id, 'str'), @@ -630,6 +666,10 @@ def prepare_request(next_link=None): url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] + if max_page_size is not None: + query_parameters['maxPageSize'] = self._serialize.query("max_page_size", max_page_size, 'int') + if skip is not None: + query_parameters['skip'] = self._serialize.query("skip", skip, 'int') query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') request = self._client.get(url, query_parameters, header_parameters) @@ -645,7 +685,7 @@ def prepare_request(next_link=None): return request async def extract_data(pipeline_response): - deserialized = self._deserialize('ChatThreadMembersCollection', pipeline_response) + deserialized = self._deserialize('ChatParticipantsCollection', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -666,88 +706,22 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_chat_thread_members.metadata = {'url': '/chat/threads/{chatThreadId}/members'} # type: ignore - - async def add_chat_thread_members( - self, - chat_thread_id: str, - body: "models.AddChatThreadMembersRequest", - **kwargs - ) -> None: - """Adds thread members to a thread. If members already exist, no change occurs. - - Adds thread members to a thread. If members already exist, no change occurs. - - :param chat_thread_id: Id of the thread to add members to. - :type chat_thread_id: str - :param body: Thread members to be added to the thread. - :type body: ~azure.communication.chat.models.AddChatThreadMembersRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.add_chat_thread_members.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'chatThreadId': self._serialize.url("chat_thread_id", chat_thread_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(body, 'AddChatThreadMembersRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [207]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) - - add_chat_thread_members.metadata = {'url': '/chat/threads/{chatThreadId}/members'} # type: ignore + list_chat_participants.metadata = {'url': '/chat/threads/{chatThreadId}/participants'} # type: ignore - async def remove_chat_thread_member( + async def remove_chat_participant( self, chat_thread_id: str, - chat_member_id: str, + chat_participant_id: str, **kwargs ) -> None: - """Remove a member from a thread. + """Remove a participant from a thread. - Remove a member from a thread. + Remove a participant from a thread. - :param chat_thread_id: Thread id to remove the member from. + :param chat_thread_id: Thread id to remove the participant from. :type chat_thread_id: str - :param chat_member_id: Id of the thread member to remove from the thread. - :type chat_member_id: str + :param chat_participant_id: Id of the thread participant to remove from the thread. + :type chat_participant_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -757,21 +731,21 @@ async def remove_chat_thread_member( error_map = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" + api_version = "2020-11-01-preview3" accept = "application/json" # Construct URL - url = self.remove_chat_thread_member.metadata['url'] # type: ignore + url = self.remove_chat_participant.metadata['url'] # type: ignore path_format_arguments = { 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), 'chatThreadId': self._serialize.url("chat_thread_id", chat_thread_id, 'str'), - 'chatMemberId': self._serialize.url("chat_member_id", chat_member_id, 'str'), + 'chatParticipantId': self._serialize.url("chat_participant_id", chat_participant_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -794,42 +768,46 @@ async def remove_chat_thread_member( if cls: return cls(pipeline_response, None, {}) - remove_chat_thread_member.metadata = {'url': '/chat/threads/{chatThreadId}/members/{chatMemberId}'} # type: ignore + remove_chat_participant.metadata = {'url': '/chat/threads/{chatThreadId}/participants/{chatParticipantId}'} # type: ignore - async def create_chat_thread( + async def add_chat_participants( self, - body: "models.CreateChatThreadRequest", + chat_thread_id: str, + add_chat_participants_request: "_models.AddChatParticipantsRequest", **kwargs - ) -> "models.MultiStatusResponse": - """Creates a chat thread. + ) -> "_models.AddChatParticipantsResult": + """Adds thread participants to a thread. If participants already exist, no change occurs. - Creates a chat thread. + Adds thread participants to a thread. If participants already exist, no change occurs. - :param body: Request payload for creating a chat thread. - :type body: ~azure.communication.chat.models.CreateChatThreadRequest + :param chat_thread_id: Id of the thread to add participants to. + :type chat_thread_id: str + :param add_chat_participants_request: Thread participants to be added to the thread. + :type add_chat_participants_request: ~azure.communication.chat.models.AddChatParticipantsRequest :keyword callable cls: A custom type or function that will be passed the direct response - :return: MultiStatusResponse, or the result of cls(response) - :rtype: ~azure.communication.chat.models.MultiStatusResponse + :return: AddChatParticipantsResult, or the result of cls(response) + :rtype: ~azure.communication.chat.models.AddChatParticipantsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MultiStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AddChatParticipantsResult"] error_map = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" + api_version = "2020-11-01-preview3" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL - url = self.create_chat_thread.metadata['url'] # type: ignore + url = self.add_chat_participants.metadata['url'] # type: ignore path_format_arguments = { 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'chatThreadId': self._serialize.url("chat_thread_id", chat_thread_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -843,116 +821,28 @@ async def create_chat_thread( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(body, 'CreateChatThreadRequest') + body_content = self._serialize.body(add_chat_participants_request, 'AddChatParticipantsRequest') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [207]: + if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - deserialized = self._deserialize('MultiStatusResponse', pipeline_response) + deserialized = self._deserialize('AddChatParticipantsResult', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_chat_thread.metadata = {'url': '/chat/threads'} # type: ignore - - def list_chat_threads( - self, - max_page_size: Optional[int] = None, - start_time: Optional[datetime.datetime] = None, - **kwargs - ) -> AsyncIterable["models.ChatThreadsInfoCollection"]: - """Gets the list of chat threads of a user. - - Gets the list of chat threads of a user. - - :param max_page_size: The maximum number of chat threads returned per page. - :type max_page_size: int - :param start_time: The earliest point in time to get chat threads up to. The timestamp should - be in ISO8601 format: ``yyyy-MM-ddTHH:mm:ssZ``. - :type start_time: ~datetime.datetime - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ChatThreadsInfoCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.communication.chat.models.ChatThreadsInfoCollection] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ChatThreadsInfoCollection"] - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_chat_threads.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if max_page_size is not None: - query_parameters['maxPageSize'] = self._serialize.query("max_page_size", max_page_size, 'int') - if start_time is not None: - query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ChatThreadsInfoCollection', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_chat_threads.metadata = {'url': '/chat/threads'} # type: ignore + add_chat_participants.metadata = {'url': '/chat/threads/{chatThreadId}/participants/:add'} # type: ignore async def update_chat_thread( self, chat_thread_id: str, - body: "models.UpdateChatThreadRequest", + update_chat_thread_request: "_models.UpdateChatThreadRequest", **kwargs ) -> None: """Updates a thread's properties. @@ -961,8 +851,8 @@ async def update_chat_thread( :param chat_thread_id: The id of the thread to update. :type chat_thread_id: str - :param body: Request payload for updating a chat thread. - :type body: ~azure.communication.chat.models.UpdateChatThreadRequest + :param update_chat_thread_request: Request payload for updating a chat thread. + :type update_chat_thread_request: ~azure.communication.chat.models.UpdateChatThreadRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -972,14 +862,14 @@ async def update_chat_thread( error_map = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" - content_type = kwargs.pop("content_type", "application/json") + api_version = "2020-11-01-preview3" + content_type = kwargs.pop("content_type", "application/merge-patch+json") accept = "application/json" # Construct URL @@ -1000,131 +890,12 @@ async def update_chat_thread( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(body, 'UpdateChatThreadRequest') + body_content = self._serialize.body(update_chat_thread_request, 'UpdateChatThreadRequest') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) - - update_chat_thread.metadata = {'url': '/chat/threads/{chatThreadId}'} # type: ignore - - async def get_chat_thread( - self, - chat_thread_id: str, - **kwargs - ) -> "models.ChatThread": - """Gets a chat thread. - - Gets a chat thread. - - :param chat_thread_id: Thread id to get. - :type chat_thread_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ChatThread, or the result of cls(response) - :rtype: ~azure.communication.chat.models.ChatThread - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ChatThread"] - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" - accept = "application/json" - - # Construct URL - url = self.get_chat_thread.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'chatThreadId': self._serialize.url("chat_thread_id", chat_thread_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - deserialized = self._deserialize('ChatThread', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_chat_thread.metadata = {'url': '/chat/threads/{chatThreadId}'} # type: ignore - - async def delete_chat_thread( - self, - chat_thread_id: str, - **kwargs - ) -> None: - """Deletes a thread. - - Deletes a thread. - - :param chat_thread_id: Thread id to delete. - :type chat_thread_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" - accept = "application/json" - - # Construct URL - url = self.delete_chat_thread.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'chatThreadId': self._serialize.url("chat_thread_id", chat_thread_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) @@ -1132,4 +903,4 @@ async def delete_chat_thread( if cls: return cls(pipeline_response, None, {}) - delete_chat_thread.metadata = {'url': '/chat/threads/{chatThreadId}'} # type: ignore + update_chat_thread.metadata = {'url': '/chat/threads/{chatThreadId}'} # type: ignore diff --git a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/models/__init__.py b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/models/__init__.py index 7ab0f15afde3..5a3c0ca85620 100644 --- a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/models/__init__.py +++ b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/models/__init__.py @@ -7,40 +7,48 @@ # -------------------------------------------------------------------------- try: - from ._models_py3 import AddChatThreadMembersRequest + from ._models_py3 import AddChatParticipantsErrors + from ._models_py3 import AddChatParticipantsRequest + from ._models_py3 import AddChatParticipantsResult from ._models_py3 import ChatMessage + from ._models_py3 import ChatMessageContent + from ._models_py3 import ChatMessageReadReceipt + from ._models_py3 import ChatMessageReadReceiptsCollection from ._models_py3 import ChatMessagesCollection + from ._models_py3 import ChatParticipant + from ._models_py3 import ChatParticipantsCollection from ._models_py3 import ChatThread from ._models_py3 import ChatThreadInfo - from ._models_py3 import ChatThreadMember - from ._models_py3 import ChatThreadMembersCollection from ._models_py3 import ChatThreadsInfoCollection + from ._models_py3 import CommunicationError + from ._models_py3 import CommunicationErrorResponse + from ._models_py3 import CreateChatThreadErrors from ._models_py3 import CreateChatThreadRequest - from ._models_py3 import Error - from ._models_py3 import IndividualStatusResponse - from ._models_py3 import MultiStatusResponse - from ._models_py3 import ReadReceipt - from ._models_py3 import ReadReceiptsCollection + from ._models_py3 import CreateChatThreadResult from ._models_py3 import SendChatMessageRequest from ._models_py3 import SendChatMessageResult from ._models_py3 import SendReadReceiptRequest from ._models_py3 import UpdateChatMessageRequest from ._models_py3 import UpdateChatThreadRequest except (SyntaxError, ImportError): - from ._models import AddChatThreadMembersRequest # type: ignore + from ._models import AddChatParticipantsErrors # type: ignore + from ._models import AddChatParticipantsRequest # type: ignore + from ._models import AddChatParticipantsResult # type: ignore from ._models import ChatMessage # type: ignore + from ._models import ChatMessageContent # type: ignore + from ._models import ChatMessageReadReceipt # type: ignore + from ._models import ChatMessageReadReceiptsCollection # type: ignore from ._models import ChatMessagesCollection # type: ignore + from ._models import ChatParticipant # type: ignore + from ._models import ChatParticipantsCollection # type: ignore from ._models import ChatThread # type: ignore from ._models import ChatThreadInfo # type: ignore - from ._models import ChatThreadMember # type: ignore - from ._models import ChatThreadMembersCollection # type: ignore from ._models import ChatThreadsInfoCollection # type: ignore + from ._models import CommunicationError # type: ignore + from ._models import CommunicationErrorResponse # type: ignore + from ._models import CreateChatThreadErrors # type: ignore from ._models import CreateChatThreadRequest # type: ignore - from ._models import Error # type: ignore - from ._models import IndividualStatusResponse # type: ignore - from ._models import MultiStatusResponse # type: ignore - from ._models import ReadReceipt # type: ignore - from ._models import ReadReceiptsCollection # type: ignore + from ._models import CreateChatThreadResult # type: ignore from ._models import SendChatMessageRequest # type: ignore from ._models import SendChatMessageResult # type: ignore from ._models import SendReadReceiptRequest # type: ignore @@ -48,28 +56,32 @@ from ._models import UpdateChatThreadRequest # type: ignore from ._azure_communication_chat_service_enums import ( - ChatMessagePriority, + ChatMessageType, ) __all__ = [ - 'AddChatThreadMembersRequest', + 'AddChatParticipantsErrors', + 'AddChatParticipantsRequest', + 'AddChatParticipantsResult', 'ChatMessage', + 'ChatMessageContent', + 'ChatMessageReadReceipt', + 'ChatMessageReadReceiptsCollection', 'ChatMessagesCollection', + 'ChatParticipant', + 'ChatParticipantsCollection', 'ChatThread', 'ChatThreadInfo', - 'ChatThreadMember', - 'ChatThreadMembersCollection', 'ChatThreadsInfoCollection', + 'CommunicationError', + 'CommunicationErrorResponse', + 'CreateChatThreadErrors', 'CreateChatThreadRequest', - 'Error', - 'IndividualStatusResponse', - 'MultiStatusResponse', - 'ReadReceipt', - 'ReadReceiptsCollection', + 'CreateChatThreadResult', 'SendChatMessageRequest', 'SendChatMessageResult', 'SendReadReceiptRequest', 'UpdateChatMessageRequest', 'UpdateChatThreadRequest', - 'ChatMessagePriority', + 'ChatMessageType', ] diff --git a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/models/_azure_communication_chat_service_enums.py b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/models/_azure_communication_chat_service_enums.py index 1e93e5728b03..9370f9fec0d7 100644 --- a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/models/_azure_communication_chat_service_enums.py +++ b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/models/_azure_communication_chat_service_enums.py @@ -26,9 +26,12 @@ def __getattr__(cls, name): raise AttributeError(name) -class ChatMessagePriority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The chat message priority. +class ChatMessageType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The chat message type. """ - NORMAL = "Normal" - HIGH = "High" + TEXT = "text" + HTML = "html" + TOPIC_UPDATED = "topicUpdated" + PARTICIPANT_ADDED = "participantAdded" + PARTICIPANT_REMOVED = "participantRemoved" diff --git a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/models/_models.py b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/models/_models.py index 4bc3f247591d..999437af07cb 100644 --- a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/models/_models.py +++ b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/models/_models.py @@ -10,84 +10,123 @@ import msrest.serialization -class AddChatThreadMembersRequest(msrest.serialization.Model): - """Thread members to be added to the thread. +class AddChatParticipantsErrors(msrest.serialization.Model): + """Errors encountered during the addition of the chat participant to the chat thread. All required parameters must be populated in order to send to Azure. - :param members: Required. Members to add to a chat thread. - :type members: list[~azure.communication.chat.models.ChatThreadMember] + :param invalid_participants: Required. The participants that failed to be added to the chat + thread. + :type invalid_participants: list[~azure.communication.chat.models.CommunicationError] """ _validation = { - 'members': {'required': True}, + 'invalid_participants': {'required': True}, } _attribute_map = { - 'members': {'key': 'members', 'type': '[ChatThreadMember]'}, + 'invalid_participants': {'key': 'invalidParticipants', 'type': '[CommunicationError]'}, } def __init__( self, **kwargs ): - super(AddChatThreadMembersRequest, self).__init__(**kwargs) - self.members = kwargs['members'] + super(AddChatParticipantsErrors, self).__init__(**kwargs) + self.invalid_participants = kwargs['invalid_participants'] + + +class AddChatParticipantsRequest(msrest.serialization.Model): + """Participants to be added to the thread. + + All required parameters must be populated in order to send to Azure. + + :param participants: Required. Participants to add to a chat thread. + :type participants: list[~azure.communication.chat.models.ChatParticipant] + """ + + _validation = { + 'participants': {'required': True}, + } + + _attribute_map = { + 'participants': {'key': 'participants', 'type': '[ChatParticipant]'}, + } + + def __init__( + self, + **kwargs + ): + super(AddChatParticipantsRequest, self).__init__(**kwargs) + self.participants = kwargs['participants'] + + +class AddChatParticipantsResult(msrest.serialization.Model): + """Result of the add chat participants operation. + + :param errors: Errors encountered during the addition of the chat participant to the chat + thread. + :type errors: ~azure.communication.chat.models.AddChatParticipantsErrors + """ + + _attribute_map = { + 'errors': {'key': 'errors', 'type': 'AddChatParticipantsErrors'}, + } + + def __init__( + self, + **kwargs + ): + super(AddChatParticipantsResult, self).__init__(**kwargs) + self.errors = kwargs.get('errors', None) class ChatMessage(msrest.serialization.Model): - """ChatMessage. + """Chat message. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar id: The id of the chat message. This id is server generated. - :vartype id: str - :param type: Type of the chat message. - - Possible values: - - .. code-block:: - - - Text - - ThreadActivity/TopicUpdate - - ThreadActivity/AddMember - - ThreadActivity/DeleteMember. - :type type: str - :param priority: The chat message priority. Possible values include: "Normal", "High". - :type priority: str or ~azure.communication.chat.models.ChatMessagePriority - :ivar version: Version of the chat message. - :vartype version: str - :param content: Content of the chat message. - :type content: str + :param id: Required. The id of the chat message. This id is server generated. + :type id: str + :param type: Required. The chat message type. Possible values include: "text", "html", + "topicUpdated", "participantAdded", "participantRemoved". + :type type: str or ~azure.communication.chat.models.ChatMessageType + :param sequence_id: Required. Sequence of the chat message in the conversation. + :type sequence_id: str + :param version: Required. Version of the chat message. + :type version: str + :param content: Content of a chat message. + :type content: ~azure.communication.chat.models.ChatMessageContent :param sender_display_name: The display name of the chat message sender. This property is used to populate sender name for push notifications. :type sender_display_name: str - :ivar created_on: The timestamp when the chat message arrived at the server. The timestamp is - in ISO8601 format: ``yyyy-MM-ddTHH:mm:ssZ``. - :vartype created_on: ~datetime.datetime - :ivar sender_id: The id of the chat message sender. - :vartype sender_id: str - :param deleted_on: The timestamp when the chat message was deleted. The timestamp is in ISO8601 - format: ``yyyy-MM-ddTHH:mm:ssZ``. + :param created_on: Required. The timestamp when the chat message arrived at the server. The + timestamp is in RFC3339 format: ``yyyy-MM-ddTHH:mm:ssZ``. + :type created_on: ~datetime.datetime + :param sender_id: The id of the chat message sender. + :type sender_id: str + :param deleted_on: The timestamp (if applicable) when the message was deleted. The timestamp is + in RFC3339 format: ``yyyy-MM-ddTHH:mm:ssZ``. :type deleted_on: ~datetime.datetime - :param edited_on: The timestamp when the chat message was edited. The timestamp is in ISO8601 - format: ``yyyy-MM-ddTHH:mm:ssZ``. + :param edited_on: The last timestamp (if applicable) when the message was edited. The timestamp + is in RFC3339 format: ``yyyy-MM-ddTHH:mm:ssZ``. :type edited_on: ~datetime.datetime """ _validation = { - 'id': {'readonly': True}, - 'version': {'readonly': True}, - 'created_on': {'readonly': True}, - 'sender_id': {'readonly': True}, + 'id': {'required': True}, + 'type': {'required': True}, + 'sequence_id': {'required': True}, + 'version': {'required': True}, + 'created_on': {'required': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'str'}, + 'sequence_id': {'key': 'sequenceId', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'}, - 'content': {'key': 'content', 'type': 'str'}, + 'content': {'key': 'content', 'type': 'ChatMessageContent'}, 'sender_display_name': {'key': 'senderDisplayName', 'type': 'str'}, 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, 'sender_id': {'key': 'senderId', 'type': 'str'}, @@ -100,144 +139,165 @@ def __init__( **kwargs ): super(ChatMessage, self).__init__(**kwargs) - self.id = None - self.type = kwargs.get('type', None) - self.priority = kwargs.get('priority', None) - self.version = None + self.id = kwargs['id'] + self.type = kwargs['type'] + self.sequence_id = kwargs['sequence_id'] + self.version = kwargs['version'] self.content = kwargs.get('content', None) self.sender_display_name = kwargs.get('sender_display_name', None) - self.created_on = None - self.sender_id = None + self.created_on = kwargs['created_on'] + self.sender_id = kwargs.get('sender_id', None) self.deleted_on = kwargs.get('deleted_on', None) self.edited_on = kwargs.get('edited_on', None) -class ChatMessagesCollection(msrest.serialization.Model): - """Collection of chat messages for a particular chat thread. +class ChatMessageContent(msrest.serialization.Model): + """Content of a chat message. - Variables are only populated by the server, and will be ignored when sending a request. + :param message: Chat message content for messages of types text or html. + :type message: str + :param topic: Chat message content for messages of type topicUpdated. + :type topic: str + :param participants: Chat message content for messages of types participantAdded or + participantRemoved. + :type participants: list[~azure.communication.chat.models.ChatParticipant] + :param initiator: Chat message content for messages of types participantAdded or + participantRemoved. + :type initiator: str + """ - :ivar value: Collection of chat messages. - :vartype value: list[~azure.communication.chat.models.ChatMessage] - :ivar next_link: If there are more chat messages that can be retrieved, the next link will be - populated. - :vartype next_link: str + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'topic': {'key': 'topic', 'type': 'str'}, + 'participants': {'key': 'participants', 'type': '[ChatParticipant]'}, + 'initiator': {'key': 'initiator', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ChatMessageContent, self).__init__(**kwargs) + self.message = kwargs.get('message', None) + self.topic = kwargs.get('topic', None) + self.participants = kwargs.get('participants', None) + self.initiator = kwargs.get('initiator', None) + + +class ChatMessageReadReceipt(msrest.serialization.Model): + """A chat message read receipt indicates the time a chat message was read by a recipient. + + All required parameters must be populated in order to send to Azure. + + :param sender_id: Required. Id of the participant who read the message. + :type sender_id: str + :param chat_message_id: Required. Id of the chat message that has been read. This id is + generated by the server. + :type chat_message_id: str + :param read_on: Required. The time at which the message was read. The timestamp is in RFC3339 + format: ``yyyy-MM-ddTHH:mm:ssZ``. + :type read_on: ~datetime.datetime """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + 'sender_id': {'required': True}, + 'chat_message_id': {'required': True}, + 'read_on': {'required': True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ChatMessage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'sender_id': {'key': 'senderId', 'type': 'str'}, + 'chat_message_id': {'key': 'chatMessageId', 'type': 'str'}, + 'read_on': {'key': 'readOn', 'type': 'iso-8601'}, } def __init__( self, **kwargs ): - super(ChatMessagesCollection, self).__init__(**kwargs) - self.value = None - self.next_link = None + super(ChatMessageReadReceipt, self).__init__(**kwargs) + self.sender_id = kwargs['sender_id'] + self.chat_message_id = kwargs['chat_message_id'] + self.read_on = kwargs['read_on'] -class ChatThread(msrest.serialization.Model): - """ChatThread. +class ChatMessageReadReceiptsCollection(msrest.serialization.Model): + """A paged collection of chat message read receipts. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Chat thread id. - :vartype id: str - :param topic: Chat thread topic. - :type topic: str - :ivar created_on: The timestamp when the chat thread was created. The timestamp is in ISO8601 - format: ``yyyy-MM-ddTHH:mm:ssZ``. - :vartype created_on: ~datetime.datetime - :ivar created_by: Id of the chat thread owner. - :vartype created_by: str - :param members: Chat thread members. - :type members: list[~azure.communication.chat.models.ChatThreadMember] + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of chat message read receipts. + :type value: list[~azure.communication.chat.models.ChatMessageReadReceipt] + :ivar next_link: If there are more chat message read receipts that can be retrieved, the next + link will be populated. + :vartype next_link: str """ _validation = { - 'id': {'readonly': True}, - 'created_on': {'readonly': True}, - 'created_by': {'readonly': True}, + 'value': {'required': True}, + 'next_link': {'readonly': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'topic': {'key': 'topic', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'members': {'key': 'members', 'type': '[ChatThreadMember]'}, + 'value': {'key': 'value', 'type': '[ChatMessageReadReceipt]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, **kwargs ): - super(ChatThread, self).__init__(**kwargs) - self.id = None - self.topic = kwargs.get('topic', None) - self.created_on = None - self.created_by = None - self.members = kwargs.get('members', None) + super(ChatMessageReadReceiptsCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None -class ChatThreadInfo(msrest.serialization.Model): - """ChatThreadInfo. +class ChatMessagesCollection(msrest.serialization.Model): + """Collection of chat messages for a particular chat thread. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Chat thread id. - :vartype id: str - :param topic: Chat thread topic. - :type topic: str - :param is_deleted: Flag if a chat thread is soft deleted. - :type is_deleted: bool - :ivar last_message_received_on: The timestamp when the last message arrived at the server. The - timestamp is in ISO8601 format: ``yyyy-MM-ddTHH:mm:ssZ``. - :vartype last_message_received_on: ~datetime.datetime + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of chat messages. + :type value: list[~azure.communication.chat.models.ChatMessage] + :ivar next_link: If there are more chat messages that can be retrieved, the next link will be + populated. + :vartype next_link: str """ _validation = { - 'id': {'readonly': True}, - 'last_message_received_on': {'readonly': True}, + 'value': {'required': True}, + 'next_link': {'readonly': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'topic': {'key': 'topic', 'type': 'str'}, - 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, - 'last_message_received_on': {'key': 'lastMessageReceivedOn', 'type': 'iso-8601'}, + 'value': {'key': 'value', 'type': '[ChatMessage]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, **kwargs ): - super(ChatThreadInfo, self).__init__(**kwargs) - self.id = None - self.topic = kwargs.get('topic', None) - self.is_deleted = kwargs.get('is_deleted', None) - self.last_message_received_on = None + super(ChatMessagesCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None -class ChatThreadMember(msrest.serialization.Model): - """A member of the chat thread. +class ChatParticipant(msrest.serialization.Model): + """A participant of the chat thread. All required parameters must be populated in order to send to Azure. - :param id: Required. The id of the chat thread member in the format - ``8:acs:ResourceId_AcsUserId``. + :param id: Required. The id of the chat participant. :type id: str - :param display_name: Display name for the chat thread member. + :param display_name: Display name for the chat participant. :type display_name: str - :param share_history_time: Time from which the chat history is shared with the member. The - timestamp is in ISO8601 format: ``yyyy-MM-ddTHH:mm:ssZ``. + :param share_history_time: Time from which the chat history is shared with the participant. The + timestamp is in RFC3339 format: ``yyyy-MM-ddTHH:mm:ssZ``. :type share_history_time: ~datetime.datetime """ @@ -255,30 +315,33 @@ def __init__( self, **kwargs ): - super(ChatThreadMember, self).__init__(**kwargs) + super(ChatParticipant, self).__init__(**kwargs) self.id = kwargs['id'] self.display_name = kwargs.get('display_name', None) self.share_history_time = kwargs.get('share_history_time', None) -class ChatThreadMembersCollection(msrest.serialization.Model): - """Collection of thread members belong to a particular thread. +class ChatParticipantsCollection(msrest.serialization.Model): + """Collection of participants belong to a particular thread. Variables are only populated by the server, and will be ignored when sending a request. - :param value: Chat thread members. - :type value: list[~azure.communication.chat.models.ChatThreadMember] - :ivar next_link: If there are more chat threads that can be retrieved, the next link will be - populated. + All required parameters must be populated in order to send to Azure. + + :param value: Required. Chat participants. + :type value: list[~azure.communication.chat.models.ChatParticipant] + :ivar next_link: If there are more chat participants that can be retrieved, the next link will + be populated. :vartype next_link: str """ _validation = { + 'value': {'required': True}, 'next_link': {'readonly': True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ChatThreadMember]'}, + 'value': {'key': 'value', 'type': '[ChatParticipant]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -286,251 +349,281 @@ def __init__( self, **kwargs ): - super(ChatThreadMembersCollection, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + super(ChatParticipantsCollection, self).__init__(**kwargs) + self.value = kwargs['value'] self.next_link = None -class ChatThreadsInfoCollection(msrest.serialization.Model): - """Collection of chat threads. +class ChatThread(msrest.serialization.Model): + """Chat thread. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar value: Collection of chat threads. - :vartype value: list[~azure.communication.chat.models.ChatThreadInfo] - :ivar next_link: If there are more chat threads that can be retrieved, the next link will be - populated. - :vartype next_link: str + :param id: Required. Chat thread id. + :type id: str + :param topic: Required. Chat thread topic. + :type topic: str + :param created_on: Required. The timestamp when the chat thread was created. The timestamp is + in RFC3339 format: ``yyyy-MM-ddTHH:mm:ssZ``. + :type created_on: ~datetime.datetime + :param created_by: Required. Id of the chat thread owner. + :type created_by: str + :param deleted_on: The timestamp when the chat thread was deleted. The timestamp is in RFC3339 + format: ``yyyy-MM-ddTHH:mm:ssZ``. + :type deleted_on: ~datetime.datetime """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + 'id': {'required': True}, + 'topic': {'required': True}, + 'created_on': {'required': True}, + 'created_by': {'required': True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ChatThreadInfo]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'topic': {'key': 'topic', 'type': 'str'}, + 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'deleted_on': {'key': 'deletedOn', 'type': 'iso-8601'}, } def __init__( self, **kwargs ): - super(ChatThreadsInfoCollection, self).__init__(**kwargs) - self.value = None - self.next_link = None + super(ChatThread, self).__init__(**kwargs) + self.id = kwargs['id'] + self.topic = kwargs['topic'] + self.created_on = kwargs['created_on'] + self.created_by = kwargs['created_by'] + self.deleted_on = kwargs.get('deleted_on', None) -class CreateChatThreadRequest(msrest.serialization.Model): - """Request payload for creating a chat thread. +class ChatThreadInfo(msrest.serialization.Model): + """Summary information of a chat thread. + + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param topic: Required. The chat thread topic. + :param id: Required. Chat thread id. + :type id: str + :param topic: Required. Chat thread topic. :type topic: str - :param members: Required. Members to be added to the chat thread. - :type members: list[~azure.communication.chat.models.ChatThreadMember] + :param deleted_on: The timestamp when the chat thread was deleted. The timestamp is in RFC3339 + format: ``yyyy-MM-ddTHH:mm:ssZ``. + :type deleted_on: ~datetime.datetime + :ivar last_message_received_on: The timestamp when the last message arrived at the server. The + timestamp is in RFC3339 format: ``yyyy-MM-ddTHH:mm:ssZ``. + :vartype last_message_received_on: ~datetime.datetime """ _validation = { + 'id': {'required': True}, 'topic': {'required': True}, - 'members': {'required': True}, + 'last_message_received_on': {'readonly': True}, } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, 'topic': {'key': 'topic', 'type': 'str'}, - 'members': {'key': 'members', 'type': '[ChatThreadMember]'}, + 'deleted_on': {'key': 'deletedOn', 'type': 'iso-8601'}, + 'last_message_received_on': {'key': 'lastMessageReceivedOn', 'type': 'iso-8601'}, } def __init__( self, **kwargs ): - super(CreateChatThreadRequest, self).__init__(**kwargs) + super(ChatThreadInfo, self).__init__(**kwargs) + self.id = kwargs['id'] self.topic = kwargs['topic'] - self.members = kwargs['members'] + self.deleted_on = kwargs.get('deleted_on', None) + self.last_message_received_on = None -class Error(msrest.serialization.Model): - """Error. +class ChatThreadsInfoCollection(msrest.serialization.Model): + """Collection of chat threads. Variables are only populated by the server, and will be ignored when sending a request. - :ivar code: - :vartype code: str - :ivar message: - :vartype message: str - :ivar target: - :vartype target: str - :ivar inner_errors: - :vartype inner_errors: list[~azure.communication.chat.models.Error] + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of chat threads. + :type value: list[~azure.communication.chat.models.ChatThreadInfo] + :ivar next_link: If there are more chat threads that can be retrieved, the next link will be + populated. + :vartype next_link: str """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'inner_errors': {'readonly': True}, + 'value': {'required': True}, + 'next_link': {'readonly': True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'inner_errors': {'key': 'innerErrors', 'type': '[Error]'}, + 'value': {'key': 'value', 'type': '[ChatThreadInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, **kwargs ): - super(Error, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.inner_errors = None + super(ChatThreadsInfoCollection, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None -class IndividualStatusResponse(msrest.serialization.Model): - """IndividualStatusResponse. +class CommunicationError(msrest.serialization.Model): + """The Communication Services error. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Identifies the resource to which the individual status corresponds. - :vartype id: str - :ivar status_code: The status code of the resource operation. - - Possible values include: - 200 for a successful update or delete, - 201 for successful creation, - 400 for a malformed input, - 403 for lacking permission to execute the operation, - 404 for resource not found. - :vartype status_code: int - :ivar message: The message explaining why the operation failed for the resource identified by - the key; null if the operation succeeded. - :vartype message: str - :ivar type: Identifies the type of the resource to which the individual status corresponds. - :vartype type: str + All required parameters must be populated in order to send to Azure. + + :param code: Required. The error code. + :type code: str + :param message: Required. The error message. + :type message: str + :ivar target: The error target. + :vartype target: str + :ivar details: Further details about specific errors that led to this error. + :vartype details: list[~azure.communication.chat.models.CommunicationError] + :ivar inner_error: The inner error if any. + :vartype inner_error: ~azure.communication.chat.models.CommunicationError """ _validation = { - 'id': {'readonly': True}, - 'status_code': {'readonly': True}, - 'message': {'readonly': True}, - 'type': {'readonly': True}, + 'code': {'required': True}, + 'message': {'required': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'inner_error': {'readonly': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, + 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CommunicationError]'}, + 'inner_error': {'key': 'innererror', 'type': 'CommunicationError'}, } def __init__( self, **kwargs ): - super(IndividualStatusResponse, self).__init__(**kwargs) - self.id = None - self.status_code = None - self.message = None - self.type = None + super(CommunicationError, self).__init__(**kwargs) + self.code = kwargs['code'] + self.message = kwargs['message'] + self.target = None + self.details = None + self.inner_error = None -class MultiStatusResponse(msrest.serialization.Model): - """MultiStatusResponse. +class CommunicationErrorResponse(msrest.serialization.Model): + """The Communication Services error. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar multiple_status: The list of status information for each resource in the request. - :vartype multiple_status: list[~azure.communication.chat.models.IndividualStatusResponse] + :param error: Required. The Communication Services error. + :type error: ~azure.communication.chat.models.CommunicationError """ _validation = { - 'multiple_status': {'readonly': True}, + 'error': {'required': True}, } _attribute_map = { - 'multiple_status': {'key': 'multipleStatus', 'type': '[IndividualStatusResponse]'}, + 'error': {'key': 'error', 'type': 'CommunicationError'}, } def __init__( self, **kwargs ): - super(MultiStatusResponse, self).__init__(**kwargs) - self.multiple_status = None + super(CommunicationErrorResponse, self).__init__(**kwargs) + self.error = kwargs['error'] -class ReadReceipt(msrest.serialization.Model): - """A read receipt indicates the time a chat message was read by a recipient. +class CreateChatThreadErrors(msrest.serialization.Model): + """Errors encountered during the creation of the chat thread. Variables are only populated by the server, and will be ignored when sending a request. - :ivar sender_id: Read receipt sender id. - :vartype sender_id: str - :ivar chat_message_id: Id for the chat message that has been read. This id is generated by the - server. - :vartype chat_message_id: str - :ivar read_on: Read receipt timestamp. The timestamp is in ISO8601 format: ``yyyy-MM- - ddTHH:mm:ssZ``. - :vartype read_on: ~datetime.datetime + :ivar invalid_participants: The participants that failed to be added to the chat thread. + :vartype invalid_participants: list[~azure.communication.chat.models.CommunicationError] """ _validation = { - 'sender_id': {'readonly': True}, - 'chat_message_id': {'readonly': True}, - 'read_on': {'readonly': True}, + 'invalid_participants': {'readonly': True}, } _attribute_map = { - 'sender_id': {'key': 'senderId', 'type': 'str'}, - 'chat_message_id': {'key': 'chatMessageId', 'type': 'str'}, - 'read_on': {'key': 'readOn', 'type': 'iso-8601'}, + 'invalid_participants': {'key': 'invalidParticipants', 'type': '[CommunicationError]'}, } def __init__( self, **kwargs ): - super(ReadReceipt, self).__init__(**kwargs) - self.sender_id = None - self.chat_message_id = None - self.read_on = None + super(CreateChatThreadErrors, self).__init__(**kwargs) + self.invalid_participants = None -class ReadReceiptsCollection(msrest.serialization.Model): - """ReadReceiptsCollection. +class CreateChatThreadRequest(msrest.serialization.Model): + """Request payload for creating a chat thread. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar value: Collection of read receipts. - :vartype value: list[~azure.communication.chat.models.ReadReceipt] - :ivar next_link: If there are more read receipts that can be retrieved, the next link will be - populated. - :vartype next_link: str + :param topic: Required. The chat thread topic. + :type topic: str + :param participants: Required. Participants to be added to the chat thread. + :type participants: list[~azure.communication.chat.models.ChatParticipant] """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + 'topic': {'required': True}, + 'participants': {'required': True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ReadReceipt]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'topic': {'key': 'topic', 'type': 'str'}, + 'participants': {'key': 'participants', 'type': '[ChatParticipant]'}, } def __init__( self, **kwargs ): - super(ReadReceiptsCollection, self).__init__(**kwargs) - self.value = None - self.next_link = None + super(CreateChatThreadRequest, self).__init__(**kwargs) + self.topic = kwargs['topic'] + self.participants = kwargs['participants'] + + +class CreateChatThreadResult(msrest.serialization.Model): + """Result of the create chat thread operation. + + :param chat_thread: Chat thread. + :type chat_thread: ~azure.communication.chat.models.ChatThread + :param errors: Errors encountered during the creation of the chat thread. + :type errors: ~azure.communication.chat.models.CreateChatThreadErrors + """ + + _attribute_map = { + 'chat_thread': {'key': 'chatThread', 'type': 'ChatThread'}, + 'errors': {'key': 'errors', 'type': 'CreateChatThreadErrors'}, + } + + def __init__( + self, + **kwargs + ): + super(CreateChatThreadResult, self).__init__(**kwargs) + self.chat_thread = kwargs.get('chat_thread', None) + self.errors = kwargs.get('errors', None) class SendChatMessageRequest(msrest.serialization.Model): @@ -538,13 +631,14 @@ class SendChatMessageRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param priority: The chat message priority. Possible values include: "Normal", "High". - :type priority: str or ~azure.communication.chat.models.ChatMessagePriority :param content: Required. Chat message content. :type content: str :param sender_display_name: The display name of the chat message sender. This property is used to populate sender name for push notifications. :type sender_display_name: str + :param type: The chat message type. Possible values include: "text", "html", "topicUpdated", + "participantAdded", "participantRemoved". + :type type: str or ~azure.communication.chat.models.ChatMessageType """ _validation = { @@ -552,9 +646,9 @@ class SendChatMessageRequest(msrest.serialization.Model): } _attribute_map = { - 'priority': {'key': 'priority', 'type': 'str'}, 'content': {'key': 'content', 'type': 'str'}, 'sender_display_name': {'key': 'senderDisplayName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, } def __init__( @@ -562,22 +656,22 @@ def __init__( **kwargs ): super(SendChatMessageRequest, self).__init__(**kwargs) - self.priority = kwargs.get('priority', None) self.content = kwargs['content'] self.sender_display_name = kwargs.get('sender_display_name', None) + self.type = kwargs.get('type', None) class SendChatMessageResult(msrest.serialization.Model): """Result of the send message operation. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar id: A server-generated message id. - :vartype id: str + :param id: Required. A server-generated message id. + :type id: str """ _validation = { - 'id': {'readonly': True}, + 'id': {'required': True}, } _attribute_map = { @@ -589,7 +683,7 @@ def __init__( **kwargs ): super(SendChatMessageResult, self).__init__(**kwargs) - self.id = None + self.id = kwargs['id'] class SendReadReceiptRequest(msrest.serialization.Model): @@ -618,17 +712,14 @@ def __init__( class UpdateChatMessageRequest(msrest.serialization.Model): - """UpdateChatMessageRequest. + """Request payload for updating a chat message. :param content: Chat message content. :type content: str - :param priority: The chat message priority. Possible values include: "Normal", "High". - :type priority: str or ~azure.communication.chat.models.ChatMessagePriority """ _attribute_map = { 'content': {'key': 'content', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'str'}, } def __init__( @@ -637,11 +728,10 @@ def __init__( ): super(UpdateChatMessageRequest, self).__init__(**kwargs) self.content = kwargs.get('content', None) - self.priority = kwargs.get('priority', None) class UpdateChatThreadRequest(msrest.serialization.Model): - """UpdateChatThreadRequest. + """Request payload for updating a chat thread. :param topic: Chat thread topic. :type topic: str diff --git a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/models/_models_py3.py b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/models/_models_py3.py index 85157315f42c..8da8a31bc35c 100644 --- a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/models/_models_py3.py +++ b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/models/_models_py3.py @@ -15,86 +15,129 @@ from ._azure_communication_chat_service_enums import * -class AddChatThreadMembersRequest(msrest.serialization.Model): - """Thread members to be added to the thread. +class AddChatParticipantsErrors(msrest.serialization.Model): + """Errors encountered during the addition of the chat participant to the chat thread. All required parameters must be populated in order to send to Azure. - :param members: Required. Members to add to a chat thread. - :type members: list[~azure.communication.chat.models.ChatThreadMember] + :param invalid_participants: Required. The participants that failed to be added to the chat + thread. + :type invalid_participants: list[~azure.communication.chat.models.CommunicationError] """ _validation = { - 'members': {'required': True}, + 'invalid_participants': {'required': True}, } _attribute_map = { - 'members': {'key': 'members', 'type': '[ChatThreadMember]'}, + 'invalid_participants': {'key': 'invalidParticipants', 'type': '[CommunicationError]'}, } def __init__( self, *, - members: List["ChatThreadMember"], + invalid_participants: List["CommunicationError"], **kwargs ): - super(AddChatThreadMembersRequest, self).__init__(**kwargs) - self.members = members + super(AddChatParticipantsErrors, self).__init__(**kwargs) + self.invalid_participants = invalid_participants + + +class AddChatParticipantsRequest(msrest.serialization.Model): + """Participants to be added to the thread. + + All required parameters must be populated in order to send to Azure. + + :param participants: Required. Participants to add to a chat thread. + :type participants: list[~azure.communication.chat.models.ChatParticipant] + """ + + _validation = { + 'participants': {'required': True}, + } + + _attribute_map = { + 'participants': {'key': 'participants', 'type': '[ChatParticipant]'}, + } + + def __init__( + self, + *, + participants: List["ChatParticipant"], + **kwargs + ): + super(AddChatParticipantsRequest, self).__init__(**kwargs) + self.participants = participants + + +class AddChatParticipantsResult(msrest.serialization.Model): + """Result of the add chat participants operation. + + :param errors: Errors encountered during the addition of the chat participant to the chat + thread. + :type errors: ~azure.communication.chat.models.AddChatParticipantsErrors + """ + + _attribute_map = { + 'errors': {'key': 'errors', 'type': 'AddChatParticipantsErrors'}, + } + + def __init__( + self, + *, + errors: Optional["AddChatParticipantsErrors"] = None, + **kwargs + ): + super(AddChatParticipantsResult, self).__init__(**kwargs) + self.errors = errors class ChatMessage(msrest.serialization.Model): - """ChatMessage. + """Chat message. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar id: The id of the chat message. This id is server generated. - :vartype id: str - :param type: Type of the chat message. - - Possible values: - - .. code-block:: - - - Text - - ThreadActivity/TopicUpdate - - ThreadActivity/AddMember - - ThreadActivity/DeleteMember. - :type type: str - :param priority: The chat message priority. Possible values include: "Normal", "High". - :type priority: str or ~azure.communication.chat.models.ChatMessagePriority - :ivar version: Version of the chat message. - :vartype version: str - :param content: Content of the chat message. - :type content: str + :param id: Required. The id of the chat message. This id is server generated. + :type id: str + :param type: Required. The chat message type. Possible values include: "text", "html", + "topicUpdated", "participantAdded", "participantRemoved". + :type type: str or ~azure.communication.chat.models.ChatMessageType + :param sequence_id: Required. Sequence of the chat message in the conversation. + :type sequence_id: str + :param version: Required. Version of the chat message. + :type version: str + :param content: Content of a chat message. + :type content: ~azure.communication.chat.models.ChatMessageContent :param sender_display_name: The display name of the chat message sender. This property is used to populate sender name for push notifications. :type sender_display_name: str - :ivar created_on: The timestamp when the chat message arrived at the server. The timestamp is - in ISO8601 format: ``yyyy-MM-ddTHH:mm:ssZ``. - :vartype created_on: ~datetime.datetime - :ivar sender_id: The id of the chat message sender. - :vartype sender_id: str - :param deleted_on: The timestamp when the chat message was deleted. The timestamp is in ISO8601 - format: ``yyyy-MM-ddTHH:mm:ssZ``. + :param created_on: Required. The timestamp when the chat message arrived at the server. The + timestamp is in RFC3339 format: ``yyyy-MM-ddTHH:mm:ssZ``. + :type created_on: ~datetime.datetime + :param sender_id: The id of the chat message sender. + :type sender_id: str + :param deleted_on: The timestamp (if applicable) when the message was deleted. The timestamp is + in RFC3339 format: ``yyyy-MM-ddTHH:mm:ssZ``. :type deleted_on: ~datetime.datetime - :param edited_on: The timestamp when the chat message was edited. The timestamp is in ISO8601 - format: ``yyyy-MM-ddTHH:mm:ssZ``. + :param edited_on: The last timestamp (if applicable) when the message was edited. The timestamp + is in RFC3339 format: ``yyyy-MM-ddTHH:mm:ssZ``. :type edited_on: ~datetime.datetime """ _validation = { - 'id': {'readonly': True}, - 'version': {'readonly': True}, - 'created_on': {'readonly': True}, - 'sender_id': {'readonly': True}, + 'id': {'required': True}, + 'type': {'required': True}, + 'sequence_id': {'required': True}, + 'version': {'required': True}, + 'created_on': {'required': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'str'}, + 'sequence_id': {'key': 'sequenceId', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'}, - 'content': {'key': 'content', 'type': 'str'}, + 'content': {'key': 'content', 'type': 'ChatMessageContent'}, 'sender_display_name': {'key': 'senderDisplayName', 'type': 'str'}, 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, 'sender_id': {'key': 'senderId', 'type': 'str'}, @@ -105,159 +148,191 @@ class ChatMessage(msrest.serialization.Model): def __init__( self, *, - type: Optional[str] = None, - priority: Optional[Union[str, "ChatMessagePriority"]] = None, - content: Optional[str] = None, + id: str, + type: Union[str, "ChatMessageType"], + sequence_id: str, + version: str, + created_on: datetime.datetime, + content: Optional["ChatMessageContent"] = None, sender_display_name: Optional[str] = None, + sender_id: Optional[str] = None, deleted_on: Optional[datetime.datetime] = None, edited_on: Optional[datetime.datetime] = None, **kwargs ): super(ChatMessage, self).__init__(**kwargs) - self.id = None + self.id = id self.type = type - self.priority = priority - self.version = None + self.sequence_id = sequence_id + self.version = version self.content = content self.sender_display_name = sender_display_name - self.created_on = None - self.sender_id = None + self.created_on = created_on + self.sender_id = sender_id self.deleted_on = deleted_on self.edited_on = edited_on -class ChatMessagesCollection(msrest.serialization.Model): - """Collection of chat messages for a particular chat thread. +class ChatMessageContent(msrest.serialization.Model): + """Content of a chat message. - Variables are only populated by the server, and will be ignored when sending a request. + :param message: Chat message content for messages of types text or html. + :type message: str + :param topic: Chat message content for messages of type topicUpdated. + :type topic: str + :param participants: Chat message content for messages of types participantAdded or + participantRemoved. + :type participants: list[~azure.communication.chat.models.ChatParticipant] + :param initiator: Chat message content for messages of types participantAdded or + participantRemoved. + :type initiator: str + """ - :ivar value: Collection of chat messages. - :vartype value: list[~azure.communication.chat.models.ChatMessage] - :ivar next_link: If there are more chat messages that can be retrieved, the next link will be - populated. - :vartype next_link: str + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'topic': {'key': 'topic', 'type': 'str'}, + 'participants': {'key': 'participants', 'type': '[ChatParticipant]'}, + 'initiator': {'key': 'initiator', 'type': 'str'}, + } + + def __init__( + self, + *, + message: Optional[str] = None, + topic: Optional[str] = None, + participants: Optional[List["ChatParticipant"]] = None, + initiator: Optional[str] = None, + **kwargs + ): + super(ChatMessageContent, self).__init__(**kwargs) + self.message = message + self.topic = topic + self.participants = participants + self.initiator = initiator + + +class ChatMessageReadReceipt(msrest.serialization.Model): + """A chat message read receipt indicates the time a chat message was read by a recipient. + + All required parameters must be populated in order to send to Azure. + + :param sender_id: Required. Id of the participant who read the message. + :type sender_id: str + :param chat_message_id: Required. Id of the chat message that has been read. This id is + generated by the server. + :type chat_message_id: str + :param read_on: Required. The time at which the message was read. The timestamp is in RFC3339 + format: ``yyyy-MM-ddTHH:mm:ssZ``. + :type read_on: ~datetime.datetime """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + 'sender_id': {'required': True}, + 'chat_message_id': {'required': True}, + 'read_on': {'required': True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ChatMessage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'sender_id': {'key': 'senderId', 'type': 'str'}, + 'chat_message_id': {'key': 'chatMessageId', 'type': 'str'}, + 'read_on': {'key': 'readOn', 'type': 'iso-8601'}, } def __init__( self, + *, + sender_id: str, + chat_message_id: str, + read_on: datetime.datetime, **kwargs ): - super(ChatMessagesCollection, self).__init__(**kwargs) - self.value = None - self.next_link = None + super(ChatMessageReadReceipt, self).__init__(**kwargs) + self.sender_id = sender_id + self.chat_message_id = chat_message_id + self.read_on = read_on -class ChatThread(msrest.serialization.Model): - """ChatThread. +class ChatMessageReadReceiptsCollection(msrest.serialization.Model): + """A paged collection of chat message read receipts. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Chat thread id. - :vartype id: str - :param topic: Chat thread topic. - :type topic: str - :ivar created_on: The timestamp when the chat thread was created. The timestamp is in ISO8601 - format: ``yyyy-MM-ddTHH:mm:ssZ``. - :vartype created_on: ~datetime.datetime - :ivar created_by: Id of the chat thread owner. - :vartype created_by: str - :param members: Chat thread members. - :type members: list[~azure.communication.chat.models.ChatThreadMember] + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of chat message read receipts. + :type value: list[~azure.communication.chat.models.ChatMessageReadReceipt] + :ivar next_link: If there are more chat message read receipts that can be retrieved, the next + link will be populated. + :vartype next_link: str """ _validation = { - 'id': {'readonly': True}, - 'created_on': {'readonly': True}, - 'created_by': {'readonly': True}, + 'value': {'required': True}, + 'next_link': {'readonly': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'topic': {'key': 'topic', 'type': 'str'}, - 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'members': {'key': 'members', 'type': '[ChatThreadMember]'}, + 'value': {'key': 'value', 'type': '[ChatMessageReadReceipt]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, *, - topic: Optional[str] = None, - members: Optional[List["ChatThreadMember"]] = None, + value: List["ChatMessageReadReceipt"], **kwargs ): - super(ChatThread, self).__init__(**kwargs) - self.id = None - self.topic = topic - self.created_on = None - self.created_by = None - self.members = members + super(ChatMessageReadReceiptsCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None -class ChatThreadInfo(msrest.serialization.Model): - """ChatThreadInfo. +class ChatMessagesCollection(msrest.serialization.Model): + """Collection of chat messages for a particular chat thread. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Chat thread id. - :vartype id: str - :param topic: Chat thread topic. - :type topic: str - :param is_deleted: Flag if a chat thread is soft deleted. - :type is_deleted: bool - :ivar last_message_received_on: The timestamp when the last message arrived at the server. The - timestamp is in ISO8601 format: ``yyyy-MM-ddTHH:mm:ssZ``. - :vartype last_message_received_on: ~datetime.datetime + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of chat messages. + :type value: list[~azure.communication.chat.models.ChatMessage] + :ivar next_link: If there are more chat messages that can be retrieved, the next link will be + populated. + :vartype next_link: str """ _validation = { - 'id': {'readonly': True}, - 'last_message_received_on': {'readonly': True}, + 'value': {'required': True}, + 'next_link': {'readonly': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'topic': {'key': 'topic', 'type': 'str'}, - 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, - 'last_message_received_on': {'key': 'lastMessageReceivedOn', 'type': 'iso-8601'}, + 'value': {'key': 'value', 'type': '[ChatMessage]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, *, - topic: Optional[str] = None, - is_deleted: Optional[bool] = None, + value: List["ChatMessage"], **kwargs ): - super(ChatThreadInfo, self).__init__(**kwargs) - self.id = None - self.topic = topic - self.is_deleted = is_deleted - self.last_message_received_on = None + super(ChatMessagesCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None -class ChatThreadMember(msrest.serialization.Model): - """A member of the chat thread. +class ChatParticipant(msrest.serialization.Model): + """A participant of the chat thread. All required parameters must be populated in order to send to Azure. - :param id: Required. The id of the chat thread member in the format - ``8:acs:ResourceId_AcsUserId``. + :param id: Required. The id of the chat participant. :type id: str - :param display_name: Display name for the chat thread member. + :param display_name: Display name for the chat participant. :type display_name: str - :param share_history_time: Time from which the chat history is shared with the member. The - timestamp is in ISO8601 format: ``yyyy-MM-ddTHH:mm:ssZ``. + :param share_history_time: Time from which the chat history is shared with the participant. The + timestamp is in RFC3339 format: ``yyyy-MM-ddTHH:mm:ssZ``. :type share_history_time: ~datetime.datetime """ @@ -279,287 +354,340 @@ def __init__( share_history_time: Optional[datetime.datetime] = None, **kwargs ): - super(ChatThreadMember, self).__init__(**kwargs) + super(ChatParticipant, self).__init__(**kwargs) self.id = id self.display_name = display_name self.share_history_time = share_history_time -class ChatThreadMembersCollection(msrest.serialization.Model): - """Collection of thread members belong to a particular thread. +class ChatParticipantsCollection(msrest.serialization.Model): + """Collection of participants belong to a particular thread. Variables are only populated by the server, and will be ignored when sending a request. - :param value: Chat thread members. - :type value: list[~azure.communication.chat.models.ChatThreadMember] - :ivar next_link: If there are more chat threads that can be retrieved, the next link will be - populated. + All required parameters must be populated in order to send to Azure. + + :param value: Required. Chat participants. + :type value: list[~azure.communication.chat.models.ChatParticipant] + :ivar next_link: If there are more chat participants that can be retrieved, the next link will + be populated. :vartype next_link: str """ _validation = { + 'value': {'required': True}, 'next_link': {'readonly': True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ChatThreadMember]'}, + 'value': {'key': 'value', 'type': '[ChatParticipant]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, *, - value: Optional[List["ChatThreadMember"]] = None, + value: List["ChatParticipant"], **kwargs ): - super(ChatThreadMembersCollection, self).__init__(**kwargs) + super(ChatParticipantsCollection, self).__init__(**kwargs) self.value = value self.next_link = None -class ChatThreadsInfoCollection(msrest.serialization.Model): - """Collection of chat threads. +class ChatThread(msrest.serialization.Model): + """Chat thread. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar value: Collection of chat threads. - :vartype value: list[~azure.communication.chat.models.ChatThreadInfo] - :ivar next_link: If there are more chat threads that can be retrieved, the next link will be - populated. - :vartype next_link: str + :param id: Required. Chat thread id. + :type id: str + :param topic: Required. Chat thread topic. + :type topic: str + :param created_on: Required. The timestamp when the chat thread was created. The timestamp is + in RFC3339 format: ``yyyy-MM-ddTHH:mm:ssZ``. + :type created_on: ~datetime.datetime + :param created_by: Required. Id of the chat thread owner. + :type created_by: str + :param deleted_on: The timestamp when the chat thread was deleted. The timestamp is in RFC3339 + format: ``yyyy-MM-ddTHH:mm:ssZ``. + :type deleted_on: ~datetime.datetime """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + 'id': {'required': True}, + 'topic': {'required': True}, + 'created_on': {'required': True}, + 'created_by': {'required': True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ChatThreadInfo]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'topic': {'key': 'topic', 'type': 'str'}, + 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'deleted_on': {'key': 'deletedOn', 'type': 'iso-8601'}, } def __init__( self, + *, + id: str, + topic: str, + created_on: datetime.datetime, + created_by: str, + deleted_on: Optional[datetime.datetime] = None, **kwargs ): - super(ChatThreadsInfoCollection, self).__init__(**kwargs) - self.value = None - self.next_link = None + super(ChatThread, self).__init__(**kwargs) + self.id = id + self.topic = topic + self.created_on = created_on + self.created_by = created_by + self.deleted_on = deleted_on -class CreateChatThreadRequest(msrest.serialization.Model): - """Request payload for creating a chat thread. +class ChatThreadInfo(msrest.serialization.Model): + """Summary information of a chat thread. + + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param topic: Required. The chat thread topic. + :param id: Required. Chat thread id. + :type id: str + :param topic: Required. Chat thread topic. :type topic: str - :param members: Required. Members to be added to the chat thread. - :type members: list[~azure.communication.chat.models.ChatThreadMember] + :param deleted_on: The timestamp when the chat thread was deleted. The timestamp is in RFC3339 + format: ``yyyy-MM-ddTHH:mm:ssZ``. + :type deleted_on: ~datetime.datetime + :ivar last_message_received_on: The timestamp when the last message arrived at the server. The + timestamp is in RFC3339 format: ``yyyy-MM-ddTHH:mm:ssZ``. + :vartype last_message_received_on: ~datetime.datetime """ _validation = { + 'id': {'required': True}, 'topic': {'required': True}, - 'members': {'required': True}, + 'last_message_received_on': {'readonly': True}, } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, 'topic': {'key': 'topic', 'type': 'str'}, - 'members': {'key': 'members', 'type': '[ChatThreadMember]'}, + 'deleted_on': {'key': 'deletedOn', 'type': 'iso-8601'}, + 'last_message_received_on': {'key': 'lastMessageReceivedOn', 'type': 'iso-8601'}, } def __init__( self, *, + id: str, topic: str, - members: List["ChatThreadMember"], + deleted_on: Optional[datetime.datetime] = None, **kwargs ): - super(CreateChatThreadRequest, self).__init__(**kwargs) + super(ChatThreadInfo, self).__init__(**kwargs) + self.id = id self.topic = topic - self.members = members + self.deleted_on = deleted_on + self.last_message_received_on = None -class Error(msrest.serialization.Model): - """Error. +class ChatThreadsInfoCollection(msrest.serialization.Model): + """Collection of chat threads. Variables are only populated by the server, and will be ignored when sending a request. - :ivar code: - :vartype code: str - :ivar message: - :vartype message: str - :ivar target: - :vartype target: str - :ivar inner_errors: - :vartype inner_errors: list[~azure.communication.chat.models.Error] + All required parameters must be populated in order to send to Azure. + + :param value: Required. Collection of chat threads. + :type value: list[~azure.communication.chat.models.ChatThreadInfo] + :ivar next_link: If there are more chat threads that can be retrieved, the next link will be + populated. + :vartype next_link: str """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'inner_errors': {'readonly': True}, + 'value': {'required': True}, + 'next_link': {'readonly': True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'inner_errors': {'key': 'innerErrors', 'type': '[Error]'}, + 'value': {'key': 'value', 'type': '[ChatThreadInfo]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, + *, + value: List["ChatThreadInfo"], **kwargs ): - super(Error, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.inner_errors = None + super(ChatThreadsInfoCollection, self).__init__(**kwargs) + self.value = value + self.next_link = None -class IndividualStatusResponse(msrest.serialization.Model): - """IndividualStatusResponse. +class CommunicationError(msrest.serialization.Model): + """The Communication Services error. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Identifies the resource to which the individual status corresponds. - :vartype id: str - :ivar status_code: The status code of the resource operation. - - Possible values include: - 200 for a successful update or delete, - 201 for successful creation, - 400 for a malformed input, - 403 for lacking permission to execute the operation, - 404 for resource not found. - :vartype status_code: int - :ivar message: The message explaining why the operation failed for the resource identified by - the key; null if the operation succeeded. - :vartype message: str - :ivar type: Identifies the type of the resource to which the individual status corresponds. - :vartype type: str + All required parameters must be populated in order to send to Azure. + + :param code: Required. The error code. + :type code: str + :param message: Required. The error message. + :type message: str + :ivar target: The error target. + :vartype target: str + :ivar details: Further details about specific errors that led to this error. + :vartype details: list[~azure.communication.chat.models.CommunicationError] + :ivar inner_error: The inner error if any. + :vartype inner_error: ~azure.communication.chat.models.CommunicationError """ _validation = { - 'id': {'readonly': True}, - 'status_code': {'readonly': True}, - 'message': {'readonly': True}, - 'type': {'readonly': True}, + 'code': {'required': True}, + 'message': {'required': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'inner_error': {'readonly': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, + 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CommunicationError]'}, + 'inner_error': {'key': 'innererror', 'type': 'CommunicationError'}, } def __init__( self, + *, + code: str, + message: str, **kwargs ): - super(IndividualStatusResponse, self).__init__(**kwargs) - self.id = None - self.status_code = None - self.message = None - self.type = None + super(CommunicationError, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = None + self.details = None + self.inner_error = None -class MultiStatusResponse(msrest.serialization.Model): - """MultiStatusResponse. +class CommunicationErrorResponse(msrest.serialization.Model): + """The Communication Services error. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar multiple_status: The list of status information for each resource in the request. - :vartype multiple_status: list[~azure.communication.chat.models.IndividualStatusResponse] + :param error: Required. The Communication Services error. + :type error: ~azure.communication.chat.models.CommunicationError """ _validation = { - 'multiple_status': {'readonly': True}, + 'error': {'required': True}, } _attribute_map = { - 'multiple_status': {'key': 'multipleStatus', 'type': '[IndividualStatusResponse]'}, + 'error': {'key': 'error', 'type': 'CommunicationError'}, } def __init__( self, + *, + error: "CommunicationError", **kwargs ): - super(MultiStatusResponse, self).__init__(**kwargs) - self.multiple_status = None + super(CommunicationErrorResponse, self).__init__(**kwargs) + self.error = error -class ReadReceipt(msrest.serialization.Model): - """A read receipt indicates the time a chat message was read by a recipient. +class CreateChatThreadErrors(msrest.serialization.Model): + """Errors encountered during the creation of the chat thread. Variables are only populated by the server, and will be ignored when sending a request. - :ivar sender_id: Read receipt sender id. - :vartype sender_id: str - :ivar chat_message_id: Id for the chat message that has been read. This id is generated by the - server. - :vartype chat_message_id: str - :ivar read_on: Read receipt timestamp. The timestamp is in ISO8601 format: ``yyyy-MM- - ddTHH:mm:ssZ``. - :vartype read_on: ~datetime.datetime + :ivar invalid_participants: The participants that failed to be added to the chat thread. + :vartype invalid_participants: list[~azure.communication.chat.models.CommunicationError] """ _validation = { - 'sender_id': {'readonly': True}, - 'chat_message_id': {'readonly': True}, - 'read_on': {'readonly': True}, + 'invalid_participants': {'readonly': True}, } _attribute_map = { - 'sender_id': {'key': 'senderId', 'type': 'str'}, - 'chat_message_id': {'key': 'chatMessageId', 'type': 'str'}, - 'read_on': {'key': 'readOn', 'type': 'iso-8601'}, + 'invalid_participants': {'key': 'invalidParticipants', 'type': '[CommunicationError]'}, } def __init__( self, **kwargs ): - super(ReadReceipt, self).__init__(**kwargs) - self.sender_id = None - self.chat_message_id = None - self.read_on = None + super(CreateChatThreadErrors, self).__init__(**kwargs) + self.invalid_participants = None -class ReadReceiptsCollection(msrest.serialization.Model): - """ReadReceiptsCollection. +class CreateChatThreadRequest(msrest.serialization.Model): + """Request payload for creating a chat thread. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar value: Collection of read receipts. - :vartype value: list[~azure.communication.chat.models.ReadReceipt] - :ivar next_link: If there are more read receipts that can be retrieved, the next link will be - populated. - :vartype next_link: str + :param topic: Required. The chat thread topic. + :type topic: str + :param participants: Required. Participants to be added to the chat thread. + :type participants: list[~azure.communication.chat.models.ChatParticipant] """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + 'topic': {'required': True}, + 'participants': {'required': True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ReadReceipt]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'topic': {'key': 'topic', 'type': 'str'}, + 'participants': {'key': 'participants', 'type': '[ChatParticipant]'}, } def __init__( self, + *, + topic: str, + participants: List["ChatParticipant"], **kwargs ): - super(ReadReceiptsCollection, self).__init__(**kwargs) - self.value = None - self.next_link = None + super(CreateChatThreadRequest, self).__init__(**kwargs) + self.topic = topic + self.participants = participants + + +class CreateChatThreadResult(msrest.serialization.Model): + """Result of the create chat thread operation. + + :param chat_thread: Chat thread. + :type chat_thread: ~azure.communication.chat.models.ChatThread + :param errors: Errors encountered during the creation of the chat thread. + :type errors: ~azure.communication.chat.models.CreateChatThreadErrors + """ + + _attribute_map = { + 'chat_thread': {'key': 'chatThread', 'type': 'ChatThread'}, + 'errors': {'key': 'errors', 'type': 'CreateChatThreadErrors'}, + } + + def __init__( + self, + *, + chat_thread: Optional["ChatThread"] = None, + errors: Optional["CreateChatThreadErrors"] = None, + **kwargs + ): + super(CreateChatThreadResult, self).__init__(**kwargs) + self.chat_thread = chat_thread + self.errors = errors class SendChatMessageRequest(msrest.serialization.Model): @@ -567,13 +695,14 @@ class SendChatMessageRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param priority: The chat message priority. Possible values include: "Normal", "High". - :type priority: str or ~azure.communication.chat.models.ChatMessagePriority :param content: Required. Chat message content. :type content: str :param sender_display_name: The display name of the chat message sender. This property is used to populate sender name for push notifications. :type sender_display_name: str + :param type: The chat message type. Possible values include: "text", "html", "topicUpdated", + "participantAdded", "participantRemoved". + :type type: str or ~azure.communication.chat.models.ChatMessageType """ _validation = { @@ -581,36 +710,36 @@ class SendChatMessageRequest(msrest.serialization.Model): } _attribute_map = { - 'priority': {'key': 'priority', 'type': 'str'}, 'content': {'key': 'content', 'type': 'str'}, 'sender_display_name': {'key': 'senderDisplayName', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, } def __init__( self, *, content: str, - priority: Optional[Union[str, "ChatMessagePriority"]] = None, sender_display_name: Optional[str] = None, + type: Optional[Union[str, "ChatMessageType"]] = None, **kwargs ): super(SendChatMessageRequest, self).__init__(**kwargs) - self.priority = priority self.content = content self.sender_display_name = sender_display_name + self.type = type class SendChatMessageResult(msrest.serialization.Model): """Result of the send message operation. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar id: A server-generated message id. - :vartype id: str + :param id: Required. A server-generated message id. + :type id: str """ _validation = { - 'id': {'readonly': True}, + 'id': {'required': True}, } _attribute_map = { @@ -619,10 +748,12 @@ class SendChatMessageResult(msrest.serialization.Model): def __init__( self, + *, + id: str, **kwargs ): super(SendChatMessageResult, self).__init__(**kwargs) - self.id = None + self.id = id class SendReadReceiptRequest(msrest.serialization.Model): @@ -653,33 +784,28 @@ def __init__( class UpdateChatMessageRequest(msrest.serialization.Model): - """UpdateChatMessageRequest. + """Request payload for updating a chat message. :param content: Chat message content. :type content: str - :param priority: The chat message priority. Possible values include: "Normal", "High". - :type priority: str or ~azure.communication.chat.models.ChatMessagePriority """ _attribute_map = { 'content': {'key': 'content', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'str'}, } def __init__( self, *, content: Optional[str] = None, - priority: Optional[Union[str, "ChatMessagePriority"]] = None, **kwargs ): super(UpdateChatMessageRequest, self).__init__(**kwargs) self.content = content - self.priority = priority class UpdateChatThreadRequest(msrest.serialization.Model): - """UpdateChatThreadRequest. + """Request payload for updating a chat thread. :param topic: Chat thread topic. :type topic: str diff --git a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/operations/__init__.py b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/operations/__init__.py index fbcbeea166ae..ca0d822356d7 100644 --- a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/operations/__init__.py +++ b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/operations/__init__.py @@ -6,8 +6,10 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._azure_communication_chat_service_operations import AzureCommunicationChatServiceOperationsMixin +from ._chat_thread_operations import ChatThreadOperations +from ._chat_operations import ChatOperations __all__ = [ - 'AzureCommunicationChatServiceOperationsMixin', + 'ChatThreadOperations', + 'ChatOperations', ] diff --git a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/operations/_chat_operations.py b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/operations/_chat_operations.py new file mode 100644 index 000000000000..c6c3e06c9d72 --- /dev/null +++ b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/operations/_chat_operations.py @@ -0,0 +1,332 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ChatOperations(object): + """ChatOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.communication.chat.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def create_chat_thread( + self, + create_chat_thread_request, # type: "_models.CreateChatThreadRequest" + repeatability_request_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.CreateChatThreadResult" + """Creates a chat thread. + + Creates a chat thread. + + :param create_chat_thread_request: Request payload for creating a chat thread. + :type create_chat_thread_request: ~azure.communication.chat.models.CreateChatThreadRequest + :param repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-ID and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-ID is an opaque string + representing a client-generated, globally unique for all time, identifier for the request. It + is recommended to use version 4 (random) UUIDs. + :type repeatability_request_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CreateChatThreadResult, or the result of cls(response) + :rtype: ~azure.communication.chat.models.CreateChatThreadResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CreateChatThreadResult"] + error_map = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview3" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_chat_thread.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + if repeatability_request_id is not None: + header_parameters['repeatability-Request-ID'] = self._serialize.header("repeatability_request_id", repeatability_request_id, 'str') + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(create_chat_thread_request, 'CreateChatThreadRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + deserialized = self._deserialize('CreateChatThreadResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_chat_thread.metadata = {'url': '/chat/threads'} # type: ignore + + def list_chat_threads( + self, + max_page_size=None, # type: Optional[int] + start_time=None, # type: Optional[datetime.datetime] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ChatThreadsInfoCollection"] + """Gets the list of chat threads of a user. + + Gets the list of chat threads of a user. + + :param max_page_size: The maximum number of chat threads returned per page. + :type max_page_size: int + :param start_time: The earliest point in time to get chat threads up to. The timestamp should + be in RFC3339 format: ``yyyy-MM-ddTHH:mm:ssZ``. + :type start_time: ~datetime.datetime + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ChatThreadsInfoCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.communication.chat.models.ChatThreadsInfoCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ChatThreadsInfoCollection"] + error_map = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview3" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_chat_threads.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if max_page_size is not None: + query_parameters['maxPageSize'] = self._serialize.query("max_page_size", max_page_size, 'int') + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ChatThreadsInfoCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_chat_threads.metadata = {'url': '/chat/threads'} # type: ignore + + def get_chat_thread( + self, + chat_thread_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ChatThread" + """Gets a chat thread. + + Gets a chat thread. + + :param chat_thread_id: Id of the thread. + :type chat_thread_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ChatThread, or the result of cls(response) + :rtype: ~azure.communication.chat.models.ChatThread + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ChatThread"] + error_map = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview3" + accept = "application/json" + + # Construct URL + url = self.get_chat_thread.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'chatThreadId': self._serialize.url("chat_thread_id", chat_thread_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + deserialized = self._deserialize('ChatThread', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_chat_thread.metadata = {'url': '/chat/threads/{chatThreadId}'} # type: ignore + + def delete_chat_thread( + self, + chat_thread_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a thread. + + Deletes a thread. + + :param chat_thread_id: Id of the thread to be deleted. + :type chat_thread_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-01-preview3" + accept = "application/json" + + # Construct URL + url = self.delete_chat_thread.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'chatThreadId': self._serialize.url("chat_thread_id", chat_thread_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) + + delete_chat_thread.metadata = {'url': '/chat/threads/{chatThreadId}'} # type: ignore diff --git a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/operations/_azure_communication_chat_service_operations.py b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/operations/_chat_thread_operations.py similarity index 62% rename from sdk/communication/azure-communication-chat/azure/communication/chat/_generated/operations/_azure_communication_chat_service_operations.py rename to sdk/communication/azure-communication-chat/azure/communication/chat/_generated/operations/_chat_thread_operations.py index a2fdb439c5df..46c22d82b4b5 100644 --- a/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/operations/_azure_communication_chat_service_operations.py +++ b/sdk/communication/azure-communication-chat/azure/communication/chat/_generated/operations/_chat_thread_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -23,36 +23,62 @@ T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] -class AzureCommunicationChatServiceOperationsMixin(object): +class ChatThreadOperations(object): + """ChatThreadOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.communication.chat.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config def list_chat_read_receipts( self, chat_thread_id, # type: str + max_page_size=None, # type: Optional[int] + skip=None, # type: Optional[int] **kwargs # type: Any ): - # type: (...) -> Iterable["models.ReadReceiptsCollection"] - """Gets read receipts for a thread. + # type: (...) -> Iterable["_models.ChatMessageReadReceiptsCollection"] + """Gets chat message read receipts for a thread. - Gets read receipts for a thread. + Gets chat message read receipts for a thread. - :param chat_thread_id: Thread id to get the read receipts for. + :param chat_thread_id: Thread id to get the chat message read receipts for. :type chat_thread_id: str + :param max_page_size: The maximum number of chat message read receipts to be returned per page. + :type max_page_size: int + :param skip: Skips chat message read receipts up to a specified position in response. + :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ReadReceiptsCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.communication.chat.models.ReadReceiptsCollection] + :return: An iterator like instance of either ChatMessageReadReceiptsCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.communication.chat.models.ChatMessageReadReceiptsCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ReadReceiptsCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ChatMessageReadReceiptsCollection"] error_map = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" + api_version = "2020-11-01-preview3" accept = "application/json" def prepare_request(next_link=None): @@ -70,6 +96,10 @@ def prepare_request(next_link=None): url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] + if max_page_size is not None: + query_parameters['maxPageSize'] = self._serialize.query("max_page_size", max_page_size, 'int') + if skip is not None: + query_parameters['skip'] = self._serialize.query("skip", skip, 'int') query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') request = self._client.get(url, query_parameters, header_parameters) @@ -85,7 +115,7 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize('ReadReceiptsCollection', pipeline_response) + deserialized = self._deserialize('ChatMessageReadReceiptsCollection', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -106,12 +136,12 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_chat_read_receipts.metadata = {'url': '/chat/threads/{chatThreadId}/readreceipts'} # type: ignore + list_chat_read_receipts.metadata = {'url': '/chat/threads/{chatThreadId}/readReceipts'} # type: ignore def send_chat_read_receipt( self, chat_thread_id, # type: str - body, # type: "models.SendReadReceiptRequest" + send_read_receipt_request, # type: "_models.SendReadReceiptRequest" **kwargs # type: Any ): # type: (...) -> None @@ -121,8 +151,8 @@ def send_chat_read_receipt( :param chat_thread_id: Thread id to send the read receipt event to. :type chat_thread_id: str - :param body: Read receipt details. - :type body: ~azure.communication.chat.models.SendReadReceiptRequest + :param send_read_receipt_request: Read receipt details. + :type send_read_receipt_request: ~azure.communication.chat.models.SendReadReceiptRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -132,13 +162,13 @@ def send_chat_read_receipt( error_map = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" + api_version = "2020-11-01-preview3" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -160,52 +190,52 @@ def send_chat_read_receipt( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(body, 'SendReadReceiptRequest') + body_content = self._serialize.body(send_read_receipt_request, 'SendReadReceiptRequest') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [201]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) if cls: return cls(pipeline_response, None, {}) - send_chat_read_receipt.metadata = {'url': '/chat/threads/{chatThreadId}/readreceipts'} # type: ignore + send_chat_read_receipt.metadata = {'url': '/chat/threads/{chatThreadId}/readReceipts'} # type: ignore def send_chat_message( self, chat_thread_id, # type: str - body, # type: "models.SendChatMessageRequest" + send_chat_message_request, # type: "_models.SendChatMessageRequest" **kwargs # type: Any ): - # type: (...) -> "models.SendChatMessageResult" + # type: (...) -> "_models.SendChatMessageResult" """Sends a message to a thread. Sends a message to a thread. :param chat_thread_id: The thread id to send the message to. :type chat_thread_id: str - :param body: Details of the message to send. - :type body: ~azure.communication.chat.models.SendChatMessageRequest + :param send_chat_message_request: Details of the message to send. + :type send_chat_message_request: ~azure.communication.chat.models.SendChatMessageRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: SendChatMessageResult, or the result of cls(response) :rtype: ~azure.communication.chat.models.SendChatMessageResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.SendChatMessageResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SendChatMessageResult"] error_map = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" + api_version = "2020-11-01-preview3" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -227,7 +257,7 @@ def send_chat_message( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(body, 'SendChatMessageRequest') + body_content = self._serialize.body(send_chat_message_request, 'SendChatMessageRequest') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) @@ -252,7 +282,7 @@ def list_chat_messages( start_time=None, # type: Optional[datetime.datetime] **kwargs # type: Any ): - # type: (...) -> Iterable["models.ChatMessagesCollection"] + # type: (...) -> Iterable["_models.ChatMessagesCollection"] """Gets a list of messages from a thread. Gets a list of messages from a thread. @@ -262,24 +292,24 @@ def list_chat_messages( :param max_page_size: The maximum number of messages to be returned per page. :type max_page_size: int :param start_time: The earliest point in time to get messages up to. The timestamp should be in - ISO8601 format: ``yyyy-MM-ddTHH:mm:ssZ``. + RFC3339 format: ``yyyy-MM-ddTHH:mm:ssZ``. :type start_time: ~datetime.datetime :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ChatMessagesCollection or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.communication.chat.models.ChatMessagesCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ChatMessagesCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ChatMessagesCollection"] error_map = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" + api_version = "2020-11-01-preview3" accept = "application/json" def prepare_request(next_link=None): @@ -345,7 +375,7 @@ def get_chat_message( chat_message_id, # type: str **kwargs # type: Any ): - # type: (...) -> "models.ChatMessage" + # type: (...) -> "_models.ChatMessage" """Gets a message by id. Gets a message by id. @@ -359,17 +389,17 @@ def get_chat_message( :rtype: ~azure.communication.chat.models.ChatMessage :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ChatMessage"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ChatMessage"] error_map = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" + api_version = "2020-11-01-preview3" accept = "application/json" # Construct URL @@ -409,7 +439,7 @@ def update_chat_message( self, chat_thread_id, # type: str chat_message_id, # type: str - body, # type: "models.UpdateChatMessageRequest" + update_chat_message_request, # type: "_models.UpdateChatMessageRequest" **kwargs # type: Any ): # type: (...) -> None @@ -421,8 +451,8 @@ def update_chat_message( :type chat_thread_id: str :param chat_message_id: The message id. :type chat_message_id: str - :param body: Details of the request to update the message. - :type body: ~azure.communication.chat.models.UpdateChatMessageRequest + :param update_chat_message_request: Details of the request to update the message. + :type update_chat_message_request: ~azure.communication.chat.models.UpdateChatMessageRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -432,14 +462,14 @@ def update_chat_message( error_map = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" - content_type = kwargs.pop("content_type", "application/json") + api_version = "2020-11-01-preview3" + content_type = kwargs.pop("content_type", "application/merge-patch+json") accept = "application/json" # Construct URL @@ -461,13 +491,13 @@ def update_chat_message( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(body, 'UpdateChatMessageRequest') + body_content = self._serialize.body(update_chat_message_request, 'UpdateChatMessageRequest') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) @@ -500,13 +530,13 @@ def delete_chat_message( error_map = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" + api_version = "2020-11-01-preview3" accept = "application/json" # Construct URL @@ -560,13 +590,13 @@ def send_typing_notification( error_map = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" + api_version = "2020-11-01-preview3" accept = "application/json" # Construct URL @@ -598,34 +628,40 @@ def send_typing_notification( send_typing_notification.metadata = {'url': '/chat/threads/{chatThreadId}/typing'} # type: ignore - def list_chat_thread_members( + def list_chat_participants( self, chat_thread_id, # type: str + max_page_size=None, # type: Optional[int] + skip=None, # type: Optional[int] **kwargs # type: Any ): - # type: (...) -> Iterable["models.ChatThreadMembersCollection"] - """Gets the members of a thread. + # type: (...) -> Iterable["_models.ChatParticipantsCollection"] + """Gets the participants of a thread. - Gets the members of a thread. + Gets the participants of a thread. - :param chat_thread_id: Thread id to get members for. + :param chat_thread_id: Thread id to get participants for. :type chat_thread_id: str + :param max_page_size: The maximum number of participants to be returned per page. + :type max_page_size: int + :param skip: Skips participants up to a specified position in response. + :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ChatThreadMembersCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.communication.chat.models.ChatThreadMembersCollection] + :return: An iterator like instance of either ChatParticipantsCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.communication.chat.models.ChatParticipantsCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ChatThreadMembersCollection"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ChatParticipantsCollection"] error_map = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" + api_version = "2020-11-01-preview3" accept = "application/json" def prepare_request(next_link=None): @@ -635,7 +671,7 @@ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_chat_thread_members.metadata['url'] # type: ignore + url = self.list_chat_participants.metadata['url'] # type: ignore path_format_arguments = { 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), 'chatThreadId': self._serialize.url("chat_thread_id", chat_thread_id, 'str'), @@ -643,6 +679,10 @@ def prepare_request(next_link=None): url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] + if max_page_size is not None: + query_parameters['maxPageSize'] = self._serialize.query("max_page_size", max_page_size, 'int') + if skip is not None: + query_parameters['skip'] = self._serialize.query("skip", skip, 'int') query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') request = self._client.get(url, query_parameters, header_parameters) @@ -658,7 +698,7 @@ def prepare_request(next_link=None): return request def extract_data(pipeline_response): - deserialized = self._deserialize('ChatThreadMembersCollection', pipeline_response) + deserialized = self._deserialize('ChatParticipantsCollection', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) @@ -679,90 +719,23 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_chat_thread_members.metadata = {'url': '/chat/threads/{chatThreadId}/members'} # type: ignore - - def add_chat_thread_members( - self, - chat_thread_id, # type: str - body, # type: "models.AddChatThreadMembersRequest" - **kwargs # type: Any - ): - # type: (...) -> None - """Adds thread members to a thread. If members already exist, no change occurs. - - Adds thread members to a thread. If members already exist, no change occurs. - - :param chat_thread_id: Id of the thread to add members to. - :type chat_thread_id: str - :param body: Thread members to be added to the thread. - :type body: ~azure.communication.chat.models.AddChatThreadMembersRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.add_chat_thread_members.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'chatThreadId': self._serialize.url("chat_thread_id", chat_thread_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(body, 'AddChatThreadMembersRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [207]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) - - add_chat_thread_members.metadata = {'url': '/chat/threads/{chatThreadId}/members'} # type: ignore + list_chat_participants.metadata = {'url': '/chat/threads/{chatThreadId}/participants'} # type: ignore - def remove_chat_thread_member( + def remove_chat_participant( self, chat_thread_id, # type: str - chat_member_id, # type: str + chat_participant_id, # type: str **kwargs # type: Any ): # type: (...) -> None - """Remove a member from a thread. + """Remove a participant from a thread. - Remove a member from a thread. + Remove a participant from a thread. - :param chat_thread_id: Thread id to remove the member from. + :param chat_thread_id: Thread id to remove the participant from. :type chat_thread_id: str - :param chat_member_id: Id of the thread member to remove from the thread. - :type chat_member_id: str + :param chat_participant_id: Id of the thread participant to remove from the thread. + :type chat_participant_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -772,21 +745,21 @@ def remove_chat_thread_member( error_map = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" + api_version = "2020-11-01-preview3" accept = "application/json" # Construct URL - url = self.remove_chat_thread_member.metadata['url'] # type: ignore + url = self.remove_chat_participant.metadata['url'] # type: ignore path_format_arguments = { 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), 'chatThreadId': self._serialize.url("chat_thread_id", chat_thread_id, 'str'), - 'chatMemberId': self._serialize.url("chat_member_id", chat_member_id, 'str'), + 'chatParticipantId': self._serialize.url("chat_participant_id", chat_participant_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -809,43 +782,47 @@ def remove_chat_thread_member( if cls: return cls(pipeline_response, None, {}) - remove_chat_thread_member.metadata = {'url': '/chat/threads/{chatThreadId}/members/{chatMemberId}'} # type: ignore + remove_chat_participant.metadata = {'url': '/chat/threads/{chatThreadId}/participants/{chatParticipantId}'} # type: ignore - def create_chat_thread( + def add_chat_participants( self, - body, # type: "models.CreateChatThreadRequest" + chat_thread_id, # type: str + add_chat_participants_request, # type: "_models.AddChatParticipantsRequest" **kwargs # type: Any ): - # type: (...) -> "models.MultiStatusResponse" - """Creates a chat thread. + # type: (...) -> "_models.AddChatParticipantsResult" + """Adds thread participants to a thread. If participants already exist, no change occurs. - Creates a chat thread. + Adds thread participants to a thread. If participants already exist, no change occurs. - :param body: Request payload for creating a chat thread. - :type body: ~azure.communication.chat.models.CreateChatThreadRequest + :param chat_thread_id: Id of the thread to add participants to. + :type chat_thread_id: str + :param add_chat_participants_request: Thread participants to be added to the thread. + :type add_chat_participants_request: ~azure.communication.chat.models.AddChatParticipantsRequest :keyword callable cls: A custom type or function that will be passed the direct response - :return: MultiStatusResponse, or the result of cls(response) - :rtype: ~azure.communication.chat.models.MultiStatusResponse + :return: AddChatParticipantsResult, or the result of cls(response) + :rtype: ~azure.communication.chat.models.AddChatParticipantsResult :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.MultiStatusResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AddChatParticipantsResult"] error_map = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" + api_version = "2020-11-01-preview3" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL - url = self.create_chat_thread.metadata['url'] # type: ignore + url = self.add_chat_participants.metadata['url'] # type: ignore path_format_arguments = { 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'chatThreadId': self._serialize.url("chat_thread_id", chat_thread_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -859,117 +836,28 @@ def create_chat_thread( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(body, 'CreateChatThreadRequest') + body_content = self._serialize.body(add_chat_participants_request, 'AddChatParticipantsRequest') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [207]: + if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) - deserialized = self._deserialize('MultiStatusResponse', pipeline_response) + deserialized = self._deserialize('AddChatParticipantsResult', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_chat_thread.metadata = {'url': '/chat/threads'} # type: ignore - - def list_chat_threads( - self, - max_page_size=None, # type: Optional[int] - start_time=None, # type: Optional[datetime.datetime] - **kwargs # type: Any - ): - # type: (...) -> Iterable["models.ChatThreadsInfoCollection"] - """Gets the list of chat threads of a user. - - Gets the list of chat threads of a user. - - :param max_page_size: The maximum number of chat threads returned per page. - :type max_page_size: int - :param start_time: The earliest point in time to get chat threads up to. The timestamp should - be in ISO8601 format: ``yyyy-MM-ddTHH:mm:ssZ``. - :type start_time: ~datetime.datetime - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ChatThreadsInfoCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.communication.chat.models.ChatThreadsInfoCollection] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ChatThreadsInfoCollection"] - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_chat_threads.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if max_page_size is not None: - query_parameters['maxPageSize'] = self._serialize.query("max_page_size", max_page_size, 'int') - if start_time is not None: - query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'iso-8601') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('ChatThreadsInfoCollection', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_chat_threads.metadata = {'url': '/chat/threads'} # type: ignore + add_chat_participants.metadata = {'url': '/chat/threads/{chatThreadId}/participants/:add'} # type: ignore def update_chat_thread( self, chat_thread_id, # type: str - body, # type: "models.UpdateChatThreadRequest" + update_chat_thread_request, # type: "_models.UpdateChatThreadRequest" **kwargs # type: Any ): # type: (...) -> None @@ -979,8 +867,8 @@ def update_chat_thread( :param chat_thread_id: The id of the thread to update. :type chat_thread_id: str - :param body: Request payload for updating a chat thread. - :type body: ~azure.communication.chat.models.UpdateChatThreadRequest + :param update_chat_thread_request: Request payload for updating a chat thread. + :type update_chat_thread_request: ~azure.communication.chat.models.UpdateChatThreadRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -990,14 +878,14 @@ def update_chat_thread( error_map = { 404: ResourceNotFoundError, 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), + 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 403: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 429: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), + 503: lambda response: HttpResponseError(response=response, model=self._deserialize(_models.CommunicationErrorResponse, response)), } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" - content_type = kwargs.pop("content_type", "application/json") + api_version = "2020-11-01-preview3" + content_type = kwargs.pop("content_type", "application/merge-patch+json") accept = "application/json" # Construct URL @@ -1018,133 +906,12 @@ def update_chat_thread( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(body, 'UpdateChatThreadRequest') + body_content = self._serialize.body(update_chat_thread_request, 'UpdateChatThreadRequest') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - if cls: - return cls(pipeline_response, None, {}) - - update_chat_thread.metadata = {'url': '/chat/threads/{chatThreadId}'} # type: ignore - - def get_chat_thread( - self, - chat_thread_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "models.ChatThread" - """Gets a chat thread. - - Gets a chat thread. - - :param chat_thread_id: Thread id to get. - :type chat_thread_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ChatThread, or the result of cls(response) - :rtype: ~azure.communication.chat.models.ChatThread - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ChatThread"] - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" - accept = "application/json" - - # Construct URL - url = self.get_chat_thread.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'chatThreadId': self._serialize.url("chat_thread_id", chat_thread_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - - deserialized = self._deserialize('ChatThread', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_chat_thread.metadata = {'url': '/chat/threads/{chatThreadId}'} # type: ignore - - def delete_chat_thread( - self, - chat_thread_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Deletes a thread. - - Deletes a thread. - - :param chat_thread_id: Thread id to delete. - :type chat_thread_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 401: lambda response: ClientAuthenticationError(response=response, model=self._deserialize(models.Error, response)), - 403: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 429: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - 503: lambda response: HttpResponseError(response=response, model=self._deserialize(models.Error, response)), - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-09-21-preview2" - accept = "application/json" - - # Construct URL - url = self.delete_chat_thread.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'chatThreadId': self._serialize.url("chat_thread_id", chat_thread_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response) @@ -1152,4 +919,4 @@ def delete_chat_thread( if cls: return cls(pipeline_response, None, {}) - delete_chat_thread.metadata = {'url': '/chat/threads/{chatThreadId}'} # type: ignore + update_chat_thread.metadata = {'url': '/chat/threads/{chatThreadId}'} # type: ignore diff --git a/sdk/communication/azure-communication-chat/azure/communication/chat/_models.py b/sdk/communication/azure-communication-chat/azure/communication/chat/_models.py index 5998963cc5b2..5055b1c40369 100644 --- a/sdk/communication/azure-communication-chat/azure/communication/chat/_models.py +++ b/sdk/communication/azure-communication-chat/azure/communication/chat/_models.py @@ -4,42 +4,44 @@ # Licensed under the MIT License. # ------------------------------------ +from ._generated.models import ChatParticipant as ChatParticipantAutorest from ._shared.models import CommunicationUserIdentifier -from ._generated.models import ChatThreadMember as ChatThreadMemberAutorest +from ._generated.models import ChatMessageType - -class ChatThreadMember(object): - """A member of the chat thread. +class ChatThreadParticipant(object): + """A participant of the chat thread. All required parameters must be populated in order to send to Azure. :param user: Required. The CommunicationUserIdentifier. :type user: CommunicationUserIdentifier - :param display_name: Display name for the chat thread member. + :param display_name: Display name for the chat thread participant. :type display_name: str - :param share_history_time: Time from which the chat history is shared with the member. The + :param share_history_time: Time from which the chat history is shared with the participant. The timestamp is in ISO8601 format: ``yyyy-MM-ddTHH:mm:ssZ``. :type share_history_time: ~datetime.datetime """ def __init__( self, - **kwargs + **kwargs # type: Any ): + # type: (...) -> None + self.user = kwargs['user'] self.display_name = kwargs.get('display_name', None) self.share_history_time = kwargs.get('share_history_time', None) @classmethod - def _from_generated(cls, chat_thread_member): + def _from_generated(cls, chat_thread_participant): return cls( - user=CommunicationUserIdentifier(chat_thread_member.id), - display_name=chat_thread_member.display_name, - share_history_time=chat_thread_member.share_history_time + user=CommunicationUserIdentifier(chat_thread_participant.id), + display_name=chat_thread_participant.display_name, + share_history_time=chat_thread_participant.share_history_time ) def _to_generated(self): - return ChatThreadMemberAutorest( + return ChatParticipantAutorest( id=self.user.identifier, display_name=self.display_name, share_history_time=self.share_history_time @@ -47,68 +49,119 @@ def _to_generated(self): class ChatMessage(object): - """ChatMessage. + """Chat message. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: The id of the chat message. This id is server generated. :vartype id: str - :param type: Type of the chat message. Possible values include: "Text", - "ThreadActivity/TopicUpdate", "ThreadActivity/AddMember", "ThreadActivity/DeleteMember". - :type type: str - :param priority: The chat message priority. Possible values include: "Normal", "High". - :type priority: str or ~azure.communication.chat.models.ChatMessagePriority + :ivar type: Type of the chat message. Possible values include: "text", "html", + "topicUpdated", "participantAdded", "participantRemoved". + :type type: ~azure.communication.chat.models.ChatMessageType + :ivar sequence_id: Sequence of the chat message in the conversation. + :type sequence_id: str :ivar version: Version of the chat message. :vartype version: str - :param content: Content of the chat message. - :type content: str - :param sender_display_name: The display name of the chat message sender. This property is used + :ivar content: Content of the chat message. + :type content: ~azure.communication.chat.models.ChatMessageContent + :ivar sender_display_name: The display name of the chat message sender. This property is used to populate sender name for push notifications. :type sender_display_name: str :ivar created_on: The timestamp when the chat message arrived at the server. The timestamp is - in ISO8601 format: ``yyyy-MM-ddTHH:mm:ssZ``. - :vartype created_on: ~datetime.datetime - :ivar sender: The chat message sender. - :vartype sender: CommunicationUserIdentifier - :param deleted_on: The timestamp when the chat message was deleted. The timestamp is in ISO8601 + in RFC3339 format: ``yyyy-MM-ddTHH:mm:ssZ``. + :type created_on: ~datetime.datetime + :ivar sender_id: The chat message sender. + :type sender_id: CommunicationUserIdentifier + :ivar deleted_on: The timestamp when the chat message was deleted. The timestamp is in RFC3339 format: ``yyyy-MM-ddTHH:mm:ssZ``. :type deleted_on: ~datetime.datetime - :param edited_on: The timestamp when the chat message was edited. The timestamp is in ISO8601 - format: ``yyyy-MM-ddTHH:mm:ssZ``. + :ivar edited_on: The last timestamp (if applicable) when the message was edited. The timestamp + is in RFC3339 format: ``yyyy-MM-ddTHH:mm:ssZ``. :type edited_on: ~datetime.datetime """ def __init__( - self, - **kwargs + self, + **kwargs # type: Any ): + # type: (...) -> None + self.id = kwargs['id'] - self.type = kwargs.get('type', None) - self.priority = kwargs.get('priority', None) + self.type = kwargs['type'] + self.sequence_id = kwargs['sequence_id'] self.version = kwargs['version'] - self.content = kwargs.get('content', None) - self.sender_display_name = kwargs.get('sender_display_name', None) + self.content = kwargs['content'] + self.sender_display_name = kwargs['sender_display_name'] self.created_on = kwargs['created_on'] - self.sender = kwargs['sender'] - self.deleted_on = kwargs.get('deleted_on', None) - self.edited_on = kwargs.get('edited_on', None) + self.sender_id = kwargs['sender_id'] + self.deleted_on = kwargs['deleted_on'] + self.edited_on = kwargs['edited_on'] + + @classmethod + def _get_message_type(cls, chat_message_type): + for message_type in ChatMessageType: + value = message_type.value + if value == chat_message_type: + return message_type + raise AttributeError(chat_message_type) @classmethod def _from_generated(cls, chat_message): return cls( id=chat_message.id, - type=chat_message.type, - priority=chat_message.priority, + type=cls._get_message_type(chat_message.type), + sequence_id=chat_message.sequence_id, version=chat_message.version, - content=chat_message.content, + content=ChatMessageContent._from_generated(chat_message.content), # pylint:disable=protected-access sender_display_name=chat_message.sender_display_name, created_on=chat_message.created_on, - sender=CommunicationUserIdentifier(chat_message.sender_id), + sender_id=CommunicationUserIdentifier(chat_message.sender_id), deleted_on=chat_message.deleted_on, edited_on=chat_message.edited_on ) +class ChatMessageContent(object): + """Content of a chat message. + + :param message: Chat message content for messages of types text or html. + :type message: str + :param topic: Chat message content for messages of type topicUpdated. + :type topic: str + :param participants: Chat message content for messages of types participantAdded or + participantRemoved. + :type participants: list[~azure.communication.chat.models.ChatParticipant] + :param initiator: Chat message content for messages of types participantAdded or + participantRemoved. + :type initiator: str + """ + + def __init__( + self, + **kwargs # type: Any + ): + # type: (...) -> None + + self.message = kwargs.get('message', None) + self.topic = kwargs.get('topic', None) + self.participants = kwargs.get('participants', None) + self.initiator = kwargs.get('initiator', None) + + @classmethod + def _from_generated(cls, chat_message_content): + participants_list = chat_message_content.participants + if participants_list is not None and len(participants_list) > 0: + participants = [ChatThreadParticipant._from_generated(participant) for participant in participants_list] # pylint:disable=protected-access + else: + participants = [] + return cls( + message=chat_message_content.message, + topic=chat_message_content.topic, + participants=participants, + initiator=chat_message_content.initiator + ) + + class ChatThread(object): """ChatThread. @@ -123,21 +176,22 @@ class ChatThread(object): :vartype created_on: ~datetime.datetime :ivar created_by: the chat thread owner. :vartype created_by: CommunicationUserIdentifier - :param members: Chat thread members. - :type members: list[~azure.communication.chat.ChatThreadMember] + :param participants: Chat thread participants. + :type participants: list[~azure.communication.chat.ChatThreadParticipant] """ # pylint:disable=protected-access def __init__( self, - **kwargs + **kwargs # type: Any ): + # type: (...) -> None self.id = kwargs['id'] self.topic = kwargs.get('topic', None) self.created_on = kwargs['created_on'] self.created_by = kwargs['created_by'] - self.members = kwargs.get('members', None) + self.participants = kwargs.get('participants', None) @classmethod def _from_generated(cls, chat_thread): @@ -145,13 +199,12 @@ def _from_generated(cls, chat_thread): id=chat_thread.id, topic=chat_thread.topic, created_on=chat_thread.created_on, - created_by=CommunicationUserIdentifier(chat_thread.created_by), - members=[ChatThreadMember._from_generated(x) for x in chat_thread.members] + created_by=CommunicationUserIdentifier(chat_thread.created_by) ) -class ReadReceipt(object): - """A read receipt indicates the time a chat message was read by a recipient. +class ChatMessageReadReceipt(object): + """A chat message read receipt indicates the time a chat message was read by a recipient. Variables are only populated by the server, and will be ignored when sending a request. @@ -167,8 +220,9 @@ class ReadReceipt(object): def __init__( self, - **kwargs + **kwargs # type: Any ): + # type: (...) -> None self.sender = kwargs['sender'] self.chat_message_id = kwargs['chat_message_id'] self.read_on = kwargs['read_on'] diff --git a/sdk/communication/azure-communication-chat/azure/communication/chat/_utils.py b/sdk/communication/azure-communication-chat/azure/communication/chat/_utils.py index 886f4b51c413..5311e8979cc3 100644 --- a/sdk/communication/azure-communication-chat/azure/communication/chat/_utils.py +++ b/sdk/communication/azure-communication-chat/azure/communication/chat/_utils.py @@ -6,3 +6,6 @@ def _to_utc_datetime(value): return value.strftime('%Y-%m-%dT%H:%M:%SZ') + +def return_response(response, deserialized, _): # pylint: disable=unused-argument + return response, deserialized diff --git a/sdk/communication/azure-communication-chat/azure/communication/chat/aio/_chat_client_async.py b/sdk/communication/azure-communication-chat/azure/communication/chat/aio/_chat_client_async.py index 62f6969ec87f..afd984be57ff 100644 --- a/sdk/communication/azure-communication-chat/azure/communication/chat/aio/_chat_client_async.py +++ b/sdk/communication/azure-communication-chat/azure/communication/chat/aio/_chat_client_async.py @@ -11,6 +11,7 @@ # pylint: disable=unused-import,ungrouped-imports from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union from datetime import datetime +from uuid import uuid4 import six from azure.core.tracing.decorator import distributed_trace @@ -28,9 +29,9 @@ ) from .._models import ( ChatThread, - ChatThreadMember + ChatThreadParticipant ) -from .._utils import _to_utc_datetime # pylint: disable=unused-import +from .._utils import _to_utc_datetime, return_response # pylint: disable=unused-import from .._version import SDK_MONIKER @@ -58,8 +59,10 @@ class ChatClient(object): def __init__( self, endpoint: str, credential: CommunicationTokenCredential, - **kwargs + **kwargs: Any ) -> None: + # type: (...) -> None + if not credential: raise ValueError("credential can not be None") @@ -84,9 +87,11 @@ def __init__( @distributed_trace def get_chat_thread_client( - self, thread_id: str, - **kwargs + self, thread_id: str, + **kwargs: Any ) -> ChatThreadClient: + + # type: (...) -> ChatThreadClient """ Get ChatThreadClient by providing a thread_id. @@ -118,15 +123,26 @@ def get_chat_thread_client( @distributed_trace_async async def create_chat_thread( self, topic: str, - thread_members: List[ChatThreadMember], + thread_participants: List[ChatThreadParticipant], + repeatability_request_id: Optional[str] = None, **kwargs ) -> ChatThreadClient: + + # type: (...) -> ChatThreadClient + """Creates a chat thread. :param topic: Required. The thread topic. :type topic: str - :param thread_members: Required. Members to be added to the thread. - :type thread_members: list[~azure.communication.chat.ChatThreadMember] + :param thread_participants: Required. Participants to be added to the thread. + :type thread_participants: list[~azure.communication.chat.ChatThreadParticipant] + :param repeatability_request_id: If specified, the client directs that the request is + repeatable; that is, that the client can make the request multiple times with the same + Repeatability-Request-ID and get back an appropriate response without the server executing the + request multiple times. The value of the Repeatability-Request-ID is an opaque string + representing a client-generated, globally unique for all time, identifier for the request. If not + specified, a new unique id would be generated. + :type repeatability_request_id: str :return: ChatThreadClient :rtype: ~azure.communication.chat.aio.ChatThreadClient :raises: ~azure.core.exceptions.HttpResponseError, ValueError @@ -142,24 +158,29 @@ async def create_chat_thread( """ if not topic: raise ValueError("topic cannot be None.") - if not thread_members: - raise ValueError("List of ThreadMember cannot be None.") - - members = [m._to_generated() for m in thread_members] # pylint:disable=protected-access - create_thread_request = CreateChatThreadRequest(topic=topic, members=members) - - create_chat_thread_result = await self._client.create_chat_thread(create_thread_request, **kwargs) - - multiple_status = create_chat_thread_result.multiple_status - thread_status = [status for status in multiple_status if status.type == "Thread"] - if not thread_status: - raise HttpResponseError(message="Can not find chat thread status result from: {}".format(thread_status)) - if thread_status[0].status_code != 201: - raise HttpResponseError(message="Chat thread creation failed with status code {}, message: {}.".format( - thread_status[0].status_code, thread_status[0].message)) - - thread_id = thread_status[0].id - + if not thread_participants: + raise ValueError("List of ThreadParticipant cannot be None.") + if repeatability_request_id is None: + repeatability_request_id = str(uuid4()) + + participants = [m._to_generated() for m in thread_participants] # pylint:disable=protected-access + create_thread_request = \ + CreateChatThreadRequest(topic=topic, participants=participants) + + create_chat_thread_result = await self._client.chat.create_chat_thread( + create_chat_thread_request=create_thread_request, + repeatability_request_id=repeatability_request_id, + **kwargs) + if hasattr(create_chat_thread_result, 'errors') \ + and create_chat_thread_result.errors is not None: + participants = \ + create_chat_thread_result.errors.invalid_participants + errors = [] + for participant in participants: + errors.append('participant ' + participant.target + + ' failed to join thread due to: ' + participant.message) + raise RuntimeError(errors) + thread_id = create_chat_thread_result.chat_thread.id return ChatThreadClient( endpoint=self._endpoint, credential=self._credential, @@ -171,7 +192,8 @@ async def create_chat_thread( async def get_chat_thread( self, thread_id: str, **kwargs - ) -> ChatThread: + ) -> ChatThread: # type: (...) -> ChatThread + """Gets a chat thread. :param thread_id: Required. Thread id to get. @@ -193,21 +215,21 @@ async def get_chat_thread( if not thread_id: raise ValueError("thread_id cannot be None.") - chat_thread = await self._client.get_chat_thread(thread_id, **kwargs) + chat_thread = await self._client.chat.get_chat_thread(thread_id, **kwargs) return ChatThread._from_generated(chat_thread) # pylint:disable=protected-access @distributed_trace def list_chat_threads( self, - **kwargs - ) -> AsyncItemPaged[ChatThreadInfo]: + **kwargs: Any + ): # type: (...) -> AsyncItemPaged[ChatThreadInfo] """Gets the list of chat threads of a user. :keyword int results_per_page: The maximum number of chat threads to be returned per page. :keyword ~datetime.datetime start_time: The earliest point in time to get chat threads up to. :keyword callable cls: A custom type or function that will be passed the direct response - :return: AsyncItemPaged[:class:`~azure.communication.chat.ChatThreadInfo`] - :rtype: ~azure.core.async_paging.AsyncItemPaged + :return: An iterator like instance of ChatThreadInfo + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.communication.chat.ChatThreadInfo] :raises: ~azure.core.exceptions.HttpResponseError, ValueError .. admonition:: Example: @@ -222,7 +244,7 @@ def list_chat_threads( results_per_page = kwargs.pop("results_per_page", None) start_time = kwargs.pop("start_time", None) - return self._client.list_chat_threads( + return self._client.chat.list_chat_threads( max_page_size=results_per_page, start_time=start_time, **kwargs) @@ -254,7 +276,7 @@ async def delete_chat_thread( if not thread_id: raise ValueError("thread_id cannot be None.") - return await self._client.delete_chat_thread(thread_id, **kwargs) + return await self._client.chat.delete_chat_thread(thread_id, **kwargs) async def close(self) -> None: await self._client.close() diff --git a/sdk/communication/azure-communication-chat/azure/communication/chat/aio/_chat_thread_client_async.py b/sdk/communication/azure-communication-chat/azure/communication/chat/aio/_chat_thread_client_async.py index 597c0f7b39d4..aa057f11dd6f 100644 --- a/sdk/communication/azure-communication-chat/azure/communication/chat/aio/_chat_thread_client_async.py +++ b/sdk/communication/azure-communication-chat/azure/communication/chat/aio/_chat_thread_client_async.py @@ -21,17 +21,18 @@ from .._shared.user_credential_async import CommunicationTokenCredential from .._generated.aio import AzureCommunicationChatService from .._generated.models import ( - AddChatThreadMembersRequest, + AddChatParticipantsRequest, SendReadReceiptRequest, SendChatMessageRequest, UpdateChatMessageRequest, UpdateChatThreadRequest, - SendChatMessageResult + SendChatMessageResult, + ChatMessageType ) from .._models import ( - ChatThreadMember, + ChatThreadParticipant, ChatMessage, - ReadReceipt + ChatMessageReadReceipt ) from .._shared.models import CommunicationUserIdentifier from .._utils import _to_utc_datetime # pylint: disable=unused-import @@ -42,7 +43,7 @@ class ChatThreadClient(object): """A client to interact with the AzureCommunicationService Chat gateway. Instances of this class is normally created by ChatClient.create_chat_thread() - This client provides operations to add member to chat thread, remove member from + This client provides operations to add participant to chat thread, remove participant from chat thread, send message, delete message, update message, send typing notifications, send and list read receipt @@ -72,8 +73,8 @@ def __init__( endpoint: str, credential: CommunicationTokenCredential, thread_id: str, - **kwargs - ) -> None: + **kwargs: Any + ): # type: (...) -> None if not thread_id: raise ValueError("thread_id can not be None or empty") @@ -111,7 +112,7 @@ def thread_id(self): return self._thread_id @distributed_trace_async - async def update_thread( + async def update_topic( self, *, topic: str = None, @@ -130,17 +131,17 @@ async def update_thread( .. admonition:: Example: .. literalinclude:: ../samples/chat_thread_client_sample_async.py - :start-after: [START update_thread] - :end-before: [END update_thread] + :start-after: [START update_topic] + :end-before: [END update_topic] :language: python :dedent: 12 :caption: Updating chat thread. """ - update_thread_request = UpdateChatThreadRequest(topic=topic) - return await self._client.update_chat_thread( + update_topic_request = UpdateChatThreadRequest(topic=topic) + return await self._client.chat_thread.update_chat_thread( chat_thread_id=self._thread_id, - body=update_thread_request, + update_chat_thread_request=update_topic_request, **kwargs) @distributed_trace_async @@ -171,21 +172,22 @@ async def send_read_receipt( raise ValueError("message_id cannot be None.") post_read_receipt_request = SendReadReceiptRequest(chat_message_id=message_id) - return await self._client.send_chat_read_receipt( + return await self._client.chat_thread.send_chat_read_receipt( self._thread_id, - body=post_read_receipt_request, + send_read_receipt_request=post_read_receipt_request, **kwargs) @distributed_trace def list_read_receipts( self, - **kwargs - ) -> AsyncItemPaged[ReadReceipt]: + **kwargs: Any + ): # type: (...) -> AsyncItemPaged[ChatMessageReadReceipt] """Gets read receipts for a thread. - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AsyncItemPaged[:class:`~azure.communication.chat.ReadReceipt`] - :rtype: ~azure.core.async_paging.AsyncItemPaged + :keyword int results_per_page: The maximum number of chat message read receipts to be returned per page. + :keyword int skip: Skips chat message read receipts up to a specified position in response. + :return: An iterator like instance of ChatMessageReadReceipt + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.communication.chat.ChatMessageReadReceipt] :raises: ~azure.core.exceptions.HttpResponseError, ValueError .. admonition:: Example: @@ -197,9 +199,14 @@ def list_read_receipts( :dedent: 12 :caption: Listing read receipts. """ - return self._client.list_chat_read_receipts( + results_per_page = kwargs.pop("results_per_page", None) + skip = kwargs.pop("skip", None) + + return self._client.chat_thread.list_chat_read_receipts( self._thread_id, - cls=lambda objs: [ReadReceipt._from_generated(x) for x in objs], # pylint:disable=protected-access + max_page_size=results_per_page, + skip=skip, + cls=lambda objs: [ChatMessageReadReceipt._from_generated(x) for x in objs], # pylint:disable=protected-access **kwargs) @distributed_trace_async @@ -223,25 +230,26 @@ async def send_typing_notification( :dedent: 12 :caption: Sending typing notification. """ - return await self._client.send_typing_notification(self._thread_id, **kwargs) + return await self._client.chat_thread.send_typing_notification(self._thread_id, **kwargs) @distributed_trace_async async def send_message( self, content: str, **kwargs - ) -> SendChatMessageResult: + ) -> str: """Sends a message to a thread. :param content: Required. Chat message content. :type content: str - :keyword priority: Message priority. - :paramtype priority: str or ChatMessagePriority + :param chat_message_type: The chat message type. Possible values include: "text", "html". + Default: ChatMessageType.TEXT + :type chat_message_type: str or ~azure.communication.chat.models.ChatMessageType :keyword str sender_display_name: The display name of the message sender. This property is used to populate sender name for push notifications. :keyword callable cls: A custom type or function that will be passed the direct response - :return: SendChatMessageResult, or the result of cls(response) - :rtype: ~azure.communication.chat.SendChatMessageResult + :return: str, or the result of cls(response) + :rtype: str :raises: ~azure.core.exceptions.HttpResponseError, ValueError .. admonition:: Example: @@ -256,19 +264,34 @@ async def send_message( if not content: raise ValueError("content cannot be None.") - priority = kwargs.pop("priority", None) + chat_message_type = kwargs.pop("chat_message_type", None) + if chat_message_type is None: + chat_message_type = ChatMessageType.TEXT + elif not isinstance(chat_message_type, ChatMessageType): + try: + chat_message_type = ChatMessageType.__getattr__(chat_message_type) # pylint:disable=protected-access + except Exception: + raise ValueError( + "chat_message_type: {message_type} is not acceptable".format(message_type=chat_message_type)) + + if chat_message_type not in [ChatMessageType.TEXT, ChatMessageType.HTML]: + raise ValueError( + "chat_message_type: {message_type} can be only 'text' or 'html'".format(message_type=chat_message_type)) + sender_display_name = kwargs.pop("sender_display_name", None) create_message_request = SendChatMessageRequest( content=content, - priority=priority, + type=chat_message_type, sender_display_name=sender_display_name ) - return await self._client.send_chat_message( + send_chat_message_result = await self._client.chat_thread.send_chat_message( chat_thread_id=self._thread_id, - body=create_message_request, + send_chat_message_request=create_message_request, **kwargs) + return send_chat_message_result.id + @distributed_trace_async async def get_message( self, @@ -296,21 +319,21 @@ async def get_message( if not message_id: raise ValueError("message_id cannot be None.") - chat_message = await self._client.get_chat_message(self._thread_id, message_id, **kwargs) + chat_message = await self._client.chat_thread.get_chat_message(self._thread_id, message_id, **kwargs) return ChatMessage._from_generated(chat_message) # pylint:disable=protected-access @distributed_trace def list_messages( self, - **kwargs - ) -> AsyncItemPaged[ChatMessage]: + **kwargs: Any + ): # type: (...) -> AsyncItemPaged[ChatMessage] """Gets a list of messages from a thread. :keyword int results_per_page: The maximum number of messages to be returned per page. :keyword ~datetime.datetime start_time: The start time where the range query. :keyword callable cls: A custom type or function that will be passed the direct response - :return: AsyncItemPaged[:class:`~azure.communication.chat.ChatMessage`] - :rtype: ~azure.core.async_paging.AsyncItemPaged + :return: An iterator like instance of ChatMessage + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.communication.chat.ChatMessage] :raises: ~azure.core.exceptions.HttpResponseError, ValueError .. admonition:: Example: @@ -325,7 +348,7 @@ def list_messages( results_per_page = kwargs.pop("results_per_page", None) start_time = kwargs.pop("start_time", None) - return self._client.list_chat_messages( + return self._client.chat_thread.list_chat_messages( self._thread_id, max_page_size=results_per_page, start_time=start_time, @@ -365,10 +388,10 @@ async def update_message( update_message_request = UpdateChatMessageRequest(content=content, priority=None) - return await self._client.update_chat_message( + return await self._client.chat_thread.update_chat_message( chat_thread_id=self._thread_id, chat_message_id=message_id, - body=update_message_request, + update_chat_message_request=update_message_request, **kwargs) @distributed_trace_async @@ -398,47 +421,90 @@ async def delete_message( if not message_id: raise ValueError("message_id cannot be None.") - return await self._client.delete_chat_message( + return await self._client.chat_thread.delete_chat_message( chat_thread_id=self._thread_id, chat_message_id=message_id, **kwargs) @distributed_trace - def list_members( + def list_participants( self, - **kwargs - ) -> AsyncItemPaged[ChatThreadMember]: - """Gets the members of a thread. + **kwargs: Any + ): # type: (...) -> AsyncItemPaged[ChatThreadParticipant] + """Gets the participants of a thread. + :keyword int results_per_page: The maximum number of participants to be returned per page. + :keyword int skip: Skips participants up to a specified position in response. :keyword callable cls: A custom type or function that will be passed the direct response - :return: AsyncItemPaged[:class:`~azure.communication.chat.ChatThreadMember`] - :rtype: ~azure.core.async_paging.AsyncItemPaged + :return: An iterator like instance of ChatThreadParticipant + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.communication.chat.ChatThreadParticipant] :raises: ~azure.core.exceptions.HttpResponseError, ValueError .. admonition:: Example: .. literalinclude:: ../samples/chat_thread_client_sample_async.py - :start-after: [START list_members] - :end-before: [END list_members] + :start-after: [START list_participants] + :end-before: [END list_participants] :language: python :dedent: 12 - :caption: Listing members of chat thread. + :caption: Listing participants of chat thread. """ - return self._client.list_chat_thread_members( + + results_per_page = kwargs.pop("results_per_page", None) + skip = kwargs.pop("skip", None) + + return self._client.chat_thread.list_chat_participants( self._thread_id, - cls=lambda objs: [ChatThreadMember._from_generated(x) for x in objs], # pylint:disable=protected-access + max_page_size=results_per_page, + skip=skip, + cls=lambda objs: [ChatThreadParticipant._from_generated(x) for x in objs], # pylint:disable=protected-access + **kwargs) + + @distributed_trace_async + async def add_participant( + self, + thread_participant: ChatThreadParticipant, + **kwargs + ) -> None: + """Adds single thread participant to a thread. If participant already exist, no change occurs. + + :param thread_participant: Required. Single thread participant to be added to the thread. + :type thread_participant: ~azure.communication.chat.ChatThreadParticipant + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError, ValueError + + .. admonition:: Example: + + .. literalinclude:: ../samples/chat_thread_client_sample_async.py + :start-after: [START add_participant] + :end-before: [END add_participant] + :language: python + :dedent: 12 + :caption: Adding single participant to chat thread. + """ + if not thread_participant: + raise ValueError("thread_participant cannot be None.") + + participants = [thread_participant._to_generated()] # pylint:disable=protected-access + add_thread_participants_request = AddChatParticipantsRequest(participants=participants) + + return await self._client.chat_thread.add_chat_participants( + chat_thread_id=self._thread_id, + add_chat_participants_request=add_thread_participants_request, **kwargs) @distributed_trace_async - async def add_members( + async def add_participants( self, - thread_members: List[ChatThreadMember], + thread_participants: List[ChatThreadParticipant], **kwargs ) -> None: - """Adds thread members to a thread. If members already exist, no change occurs. + """Adds thread participants to a thread. If participants already exist, no change occurs. - :param thread_members: Required. Thread members to be added to the thread. - :type thread_members: list[~azure.communication.chat.ChatThreadMember] + :param thread_participants: Required. Thread participants to be added to the thread. + :type thread_participants: list[~azure.communication.chat.ChatThreadParticipant] :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -447,32 +513,32 @@ async def add_members( .. admonition:: Example: .. literalinclude:: ../samples/chat_thread_client_sample_async.py - :start-after: [START add_members] - :end-before: [END add_members] + :start-after: [START add_participants] + :end-before: [END add_participants] :language: python :dedent: 12 - :caption: Adding members to chat thread. + :caption: Adding participants to chat thread. """ - if not thread_members: - raise ValueError("thread_members cannot be None.") + if not thread_participants: + raise ValueError("thread_participants cannot be None.") - members = [m._to_generated() for m in thread_members] # pylint:disable=protected-access - add_thread_members_request = AddChatThreadMembersRequest(members=members) + participants = [m._to_generated() for m in thread_participants] # pylint:disable=protected-access + add_thread_participants_request = AddChatParticipantsRequest(participants=participants) - return await self._client.add_chat_thread_members( + return await self._client.chat_thread.add_chat_participants( chat_thread_id=self._thread_id, - body=add_thread_members_request, + add_chat_participants_request=add_thread_participants_request, **kwargs) @distributed_trace_async - async def remove_member( + async def remove_participant( self, user: CommunicationUserIdentifier, **kwargs ) -> None: - """Remove a member from a thread. + """Remove a participant from a thread. - :param user: Required. User identity of the thread member to remove from the thread. + :param user: Required. User identity of the thread participant to remove from the thread. :type user: ~azure.communication.chat.CommunicationUserIdentifier :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) @@ -482,18 +548,18 @@ async def remove_member( .. admonition:: Example: .. literalinclude:: ../samples/chat_thread_client_sample_async.py - :start-after: [START remove_member] - :end-before: [END remove_member] + :start-after: [START remove_participant] + :end-before: [END remove_participant] :language: python :dedent: 12 - :caption: Removing member from chat thread. + :caption: Removing participant from chat thread. """ if not user: raise ValueError("user cannot be None.") - return await self._client.remove_chat_thread_member( + return await self._client.chat_thread.remove_chat_participant( chat_thread_id=self._thread_id, - chat_member_id=user.identifier, + chat_participant_id=user.identifier, **kwargs) async def close(self) -> None: diff --git a/sdk/communication/azure-communication-chat/samples/chat_client_sample.py b/sdk/communication/azure-communication-chat/samples/chat_client_sample.py index 25963095f8fd..ac7fb0062477 100644 --- a/sdk/communication/azure-communication-chat/samples/chat_client_sample.py +++ b/sdk/communication/azure-communication-chat/samples/chat_client_sample.py @@ -55,22 +55,30 @@ def create_thread(self): from datetime import datetime from azure.communication.chat import( ChatClient, - ChatThreadMember, CommunicationUserIdentifier, CommunicationTokenCredential, CommunicationTokenRefreshOptions + ChatThreadParticipant ) refresh_options = CommunicationTokenRefreshOptions(self.token) chat_client = ChatClient(self.endpoint, CommunicationTokenCredential(refresh_options)) topic = "test topic" - members = [ChatThreadMember( + participants = [ChatThreadParticipant( user=self.user, display_name='name', share_history_time=datetime.utcnow() )] - chat_thread_client = chat_client.create_chat_thread(topic, members) + + # creates a new chat_thread everytime + chat_thread_client = chat_client.create_chat_thread(topic, participants) + + # creates a new chat_thread if not exists + repeatability_request_id = 'b66d6031-fdcc-41df-8306-e524c9f226b8' # unique identifier + chat_thread_client_w_repeatability_id = chat_client.create_chat_thread(topic, + participants, + repeatability_request_id) # [END create_thread] self._thread_id = chat_thread_client.thread_id diff --git a/sdk/communication/azure-communication-chat/samples/chat_client_sample_async.py b/sdk/communication/azure-communication-chat/samples/chat_client_sample_async.py index fc8874226f8b..6a8df4addb8e 100644 --- a/sdk/communication/azure-communication-chat/samples/chat_client_sample_async.py +++ b/sdk/communication/azure-communication-chat/samples/chat_client_sample_async.py @@ -55,19 +55,26 @@ def create_chat_client(self): async def create_thread_async(self): from datetime import datetime from azure.communication.chat.aio import ChatClient, CommunicationTokenCredential, CommunicationTokenRefreshOptions - from azure.communication.chat import ChatThreadMember, CommunicationUser + from azure.communication.chat import ChatThreadParticipant, CommunicationUserIdentifier refresh_options = CommunicationTokenRefreshOptions(self.token) chat_client = ChatClient(self.endpoint, CommunicationTokenCredential(refresh_options)) async with chat_client: # [START create_thread] topic = "test topic" - members = [ChatThreadMember( + participants = [ChatThreadParticipant( user=self.user, display_name='name', share_history_time=datetime.utcnow() )] - chat_thread_client = await chat_client.create_chat_thread(topic, members) + # creates a new chat_thread everytime + chat_thread_client = await chat_client.create_chat_thread(topic, participants) + + # creates a new chat_thread if not exists + repeatability_request_id = 'b66d6031-fdcc-41df-8306-e524c9f226b8' # unique identifier + chat_thread_client_w_repeatability_id = await chat_client.create_chat_thread(topic, + participants, + repeatability_request_id) # [END create_thread] self._thread_id = chat_thread_client.thread_id diff --git a/sdk/communication/azure-communication-chat/samples/chat_thread_client_sample.py b/sdk/communication/azure-communication-chat/samples/chat_thread_client_sample.py index 8ba955777a08..5ee180aea894 100644 --- a/sdk/communication/azure-communication-chat/samples/chat_thread_client_sample.py +++ b/sdk/communication/azure-communication-chat/samples/chat_thread_client_sample.py @@ -9,8 +9,8 @@ DESCRIPTION: These samples demonstrate create a chat thread client, to update chat thread, get chat message, list chat messages, update chat message, send - read receipt, list read receipts, delete chat message, add members, remove - members, list members, send typing notification + read receipt, list read receipts, delete chat message, add participants, remove + participants, list participants, send typing notification You need to use azure.communication.configuration module to get user access token and user identity before run this sample @@ -50,33 +50,33 @@ def create_chat_thread_client(self): from datetime import datetime from azure.communication.chat import ( ChatClient, - ChatThreadMember, CommunicationUserIdentifier, CommunicationTokenCredential, - CommunicationTokenRefreshOptions + CommunicationTokenRefreshOptions, + ChatThreadParticipant ) refresh_options = CommunicationTokenRefreshOptions(self.token) chat_client = ChatClient(self.endpoint, CommunicationTokenCredential(refresh_options)) topic = "test topic" - members = [ChatThreadMember( + participants = [ChatThreadParticipant( user=self.user, display_name='name', share_history_time=datetime.utcnow() )] - chat_thread_client = chat_client.create_chat_thread(topic, members) + chat_thread_client = chat_client.create_chat_thread(topic, participants) # [END create_chat_thread_client] self._thread_id = chat_thread_client.thread_id print("chat_thread_client created") - def update_thread(self): + def update_topic(self): from azure.communication.chat import ChatThreadClient from azure.communication.chat import CommunicationTokenCredential, CommunicationTokenRefreshOptions refresh_options = CommunicationTokenRefreshOptions(self.token) chat_thread_client = ChatThreadClient(self.endpoint, CommunicationTokenCredential(refresh_options), self._thread_id) - # [START update_thread] + # [START update_topic] topic = "updated thread topic" - chat_thread_client.update_thread(topic=topic) - # [END update_thread] + chat_thread_client.update_topic(topic=topic) + # [END update_topic] print("update_chat_thread succeeded") @@ -88,18 +88,21 @@ def send_message(self): # [START send_message] from azure.communication.chat import ChatMessagePriority - priority = ChatMessagePriority.NORMAL content = 'hello world' sender_display_name = 'sender name' - send_message_result = chat_thread_client.send_message( + send_message_result_id = chat_thread_client.send_message( content, - priority=priority, sender_display_name=sender_display_name) + + send_message_result_w_type_id = chat_thread_client.send_message( + content, + sender_display_name=sender_display_name, chat_message_type=ChatMessageType.TEXT) # [END send_message] - self._message_id = send_message_result.id + self._message_id = send_message_result_id print("send_chat_message succeeded, message id:", self._message_id) + print("send_message succeeded with type specified, message id:", send_message_result_w_type_id) def get_message(self): from azure.communication.chat import ChatThreadClient @@ -174,46 +177,64 @@ def delete_message(self): # [END delete_message] print("delete_chat_message succeeded") - def list_members(self): + def list_participants(self): from azure.communication.chat import ChatThreadClient from azure.communication.chat import CommunicationTokenCredential, CommunicationTokenRefreshOptions refresh_options = CommunicationTokenRefreshOptions(self.token) chat_thread_client = ChatThreadClient(self.endpoint, CommunicationTokenCredential(refresh_options), self._thread_id) - # [START list_members] - chat_thread_members = chat_thread_client.list_members() - print("list_chat_members succeeded, members: ") - for chat_thread_member in chat_thread_members: - print(chat_thread_member) - # [END list_members] - - def add_members(self): - from azure.communication.chat import ChatThreadClient, CommunicationTokenCredential, CommunicationTokenRefreshOptions + # [START list_participants] + chat_thread_participants = chat_thread_client.list_participants() + print("list_chat_participants succeeded, participants: ") + for chat_thread_participant in chat_thread_participants: + print(chat_thread_participant) + # [END list_participants] + + def add_participant(self): + from azure.communication.chat import ChatThreadClient, CommunicationTokenCredential, \ + CommunicationTokenRefreshOptions + refresh_options = CommunicationTokenRefreshOptions(self.token) + chat_thread_client = ChatThreadClient(self.endpoint, CommunicationTokenCredential(refresh_options), + self._thread_id) + # [START add_participant] + from azure.communication.chat import ChatThreadParticipant + from datetime import datetime + new_chat_thread_participant = ChatThreadParticipant( + user=self.new_user, + display_name='name', + share_history_time=datetime.utcnow()) + chat_thread_client.add_participant(new_chat_thread_participant) + # [END add_participant] + print("add_chat_participant succeeded") + + def add_participants(self): + from azure.communication.chat import ChatThreadClient, CommunicationTokenCredential, \ + CommunicationTokenRefreshOptions refresh_options = CommunicationTokenRefreshOptions(self.token) chat_thread_client = ChatThreadClient(self.endpoint, CommunicationTokenCredential(refresh_options), self._thread_id) - # [START add_members] - from azure.communication.chat import ChatThreadMember + # [START add_participants] + from azure.communication.chat import ChatThreadParticipant from datetime import datetime - new_member = ChatThreadMember( + new_participant = ChatThreadParticipant( user=self.new_user, display_name='name', share_history_time=datetime.utcnow()) - thread_members = [new_member] - chat_thread_client.add_members(thread_members) - # [END add_members] - print("add_chat_members succeeded") + thread_participants = [new_participant] + chat_thread_client.add_participants(thread_participants) + # [END add_participants] + print("add_chat_participants succeeded") - def remove_member(self): + def remove_participant(self): from azure.communication.chat import ChatThreadClient - from azure.communication.chat import CommunicationTokenCredential, CommunicationUser, CommunicationTokenRefreshOptions + from azure.communication.chat import CommunicationTokenCredential, CommunicationUserIdentifier, CommunicationTokenRefreshOptions refresh_options = CommunicationTokenRefreshOptions(self.token) chat_thread_client = ChatThreadClient(self.endpoint, CommunicationTokenCredential(refresh_options), self._thread_id) - # [START remove_member] - chat_thread_client.remove_member(self.new_user) - # [END remove_member] + # [START remove_participant] + chat_thread_client.remove_participant(self.new_user) + # [END remove_participant] - print("remove_chat_member succeeded") + print("remove_chat_participant succeeded") def send_typing_notification(self): from azure.communication.chat import ChatThreadClient, CommunicationTokenCredential, CommunicationTokenRefreshOptions @@ -233,7 +254,7 @@ def clean_up(self): if __name__ == '__main__': sample = ChatThreadClientSamples() sample.create_chat_thread_client() - sample.update_thread() + sample.update_topic() sample.send_message() sample.get_message() sample.list_messages() @@ -241,8 +262,9 @@ def clean_up(self): sample.send_read_receipt() sample.list_read_receipts() sample.delete_message() - sample.add_members() - sample.list_members() - sample.remove_member() + sample.add_participant() + sample.add_participants() + sample.list_participants() + sample.remove_participant() sample.send_typing_notification() sample.clean_up() diff --git a/sdk/communication/azure-communication-chat/samples/chat_thread_client_sample_async.py b/sdk/communication/azure-communication-chat/samples/chat_thread_client_sample_async.py index 135fd274970c..2d70572bc3cb 100644 --- a/sdk/communication/azure-communication-chat/samples/chat_thread_client_sample_async.py +++ b/sdk/communication/azure-communication-chat/samples/chat_thread_client_sample_async.py @@ -9,8 +9,8 @@ DESCRIPTION: These samples demonstrate create a chat thread client, to update chat thread, get chat message, list chat messages, update chat message, send - read receipt, list read receipts, delete chat message, add members, remove - members, list members, send typing notification + read receipt, list read receipts, delete chat message, add participants, remove + participants, list participants, send typing notification You need to use azure.communication.configuration module to get user access token and user identity before run this sample @@ -50,36 +50,38 @@ async def create_chat_thread_client_async(self): # [START create_chat_thread_client] from datetime import datetime from azure.communication.chat.aio import ChatClient, CommunicationTokenCredential, CommunicationTokenRefreshOptions - from azure.communication.chat import ChatThreadMember, CommunicationUserIdentifier + from azure.communication.chat import ChatThreadParticipant, CommunicationUserIdentifier refresh_options = CommunicationTokenRefreshOptions(self.token) chat_client = ChatClient(self.endpoint, CommunicationTokenCredential(refresh_options)) async with chat_client: topic = "test topic" - members = [ChatThreadMember( + participants = [ChatThreadParticipant( user=self.user, display_name='name', share_history_time=datetime.utcnow() )] - chat_thread_client = await chat_client.create_chat_thread(topic, members) + chat_thread_client = await chat_client.create_chat_thread(topic, participants) # [END create_chat_thread_client] self._thread_id = chat_thread_client.thread_id print("thread created, id: " + self._thread_id) - async def update_thread_async(self): - from azure.communication.chat.aio import ChatThreadClient, CommunicationTokenCredential, CommunicationTokenRefreshOptions + async def update_topic_async(self): + from azure.communication.chat.aio import ChatThreadClient, CommunicationTokenCredential, \ + CommunicationTokenRefreshOptions refresh_options = CommunicationTokenRefreshOptions(self.token) - chat_thread_client = ChatThreadClient(self.endpoint, CommunicationTokenCredential(refresh_options), self._thread_id) + chat_thread_client = ChatThreadClient(self.endpoint, CommunicationTokenCredential(refresh_options), + self._thread_id) async with chat_thread_client: - # [START update_thread] + # [START update_topic] topic = "updated thread topic" - await chat_thread_client.update_thread(topic=topic) - # [END update_thread] + await chat_thread_client.update_topic(topic=topic) + # [END update_topic] - print("update_thread succeeded") + print("update_topic succeeded") async def send_message_async(self): from azure.communication.chat.aio import ChatThreadClient, CommunicationTokenCredential, CommunicationTokenRefreshOptions @@ -94,13 +96,18 @@ async def send_message_async(self): content='hello world' sender_display_name='sender name' - send_message_result = await chat_thread_client.send_message( + send_message_result_id = await chat_thread_client.send_message( content, priority=priority, sender_display_name=sender_display_name) + + send_message_result_w_type_id = await chat_thread_client.send_message( + content, + sender_display_name=sender_display_name, chat_message_type=ChatMessageType.TEXT) # [END send_message] - self._message_id = send_message_result.id + self._message_id = send_message_result_id print("send_message succeeded, message id:", self._message_id) + print("send_message succeeded with type specified, message id:", send_message_result_w_type_id) async def get_message_async(self): from azure.communication.chat.aio import ChatThreadClient, CommunicationTokenCredential, CommunicationTokenRefreshOptions @@ -178,47 +185,66 @@ async def delete_message_async(self): # [END delete_message] print("delete_message succeeded") - async def list_members_async(self): + async def list_participants_async(self): from azure.communication.chat.aio import ChatThreadClient, CommunicationTokenCredential, CommunicationTokenRefreshOptions refresh_options = CommunicationTokenRefreshOptions(self.token) chat_thread_client = ChatThreadClient(self.endpoint, CommunicationTokenCredential(refresh_options), self._thread_id) async with chat_thread_client: - # [START list_members] - chat_thread_members = chat_thread_client.list_members() - print("list_members succeeded, members:") - async for chat_thread_member in chat_thread_members: - print(chat_thread_member) - # [END list_members] - - async def add_members_async(self): + # [START list_participants] + chat_thread_participants = chat_thread_client.list_participants() + print("list_participants succeeded, participants:") + async for chat_thread_participant in chat_thread_participants: + print(chat_thread_participant) + # [END list_participants] + + async def add_participant_async(self): from azure.communication.chat.aio import ChatThreadClient, CommunicationTokenCredential, CommunicationTokenRefreshOptions refresh_options = CommunicationTokenRefreshOptions(self.token) chat_thread_client = ChatThreadClient(self.endpoint, CommunicationTokenCredential(refresh_options), self._thread_id) async with chat_thread_client: - # [START add_members] - from azure.communication.chat import ChatThreadMember, CommunicationUser + # [START add_participant] + from azure.communication.chat import ChatThreadParticipant, CommunicationUserIdentifier from datetime import datetime - new_member = ChatThreadMember( + new_chat_thread_participant = ChatThreadParticipant( user=self.new_user, display_name='name', share_history_time=datetime.utcnow()) - members = [new_member] - await chat_thread_client.add_members(members) - # [END add_members] - print("add_members succeeded") + await chat_thread_client.add_participant(new_chat_thread_participant) + # [END add_participant] + print("add_participant succeeded") - async def remove_member_async(self): + async def add_participants_async(self): from azure.communication.chat.aio import ChatThreadClient, CommunicationTokenCredential, CommunicationTokenRefreshOptions refresh_options = CommunicationTokenRefreshOptions(self.token) chat_thread_client = ChatThreadClient(self.endpoint, CommunicationTokenCredential(refresh_options), self._thread_id) async with chat_thread_client: - # [START remove_member] - await chat_thread_client.remove_member(self.new_user) - # [END remove_member] - print("remove_member_async succeeded") + # [START add_participants] + from azure.communication.chat import ChatThreadParticipant, CommunicationUserIdentifier + from datetime import datetime + new_participant = ChatThreadParticipant( + user=self.new_user, + display_name='name', + share_history_time=datetime.utcnow()) + participants = [new_participant] + await chat_thread_client.add_participants(participants) + # [END add_participants] + print("add_participants succeeded") + + async def remove_participant_async(self): + from azure.communication.chat.aio import ChatThreadClient, CommunicationTokenCredential, \ + CommunicationTokenRefreshOptions + refresh_options = CommunicationTokenRefreshOptions(self.token) + chat_thread_client = ChatThreadClient(self.endpoint, CommunicationTokenCredential(refresh_options), + self._thread_id) + + async with chat_thread_client: + # [START remove_participant] + await chat_thread_client.remove_participant(self.new_user) + # [END remove_participant] + print("remove_participant_async succeeded") async def send_typing_notification_async(self): from azure.communication.chat.aio import ChatThreadClient, CommunicationTokenCredential, CommunicationTokenRefreshOptions @@ -240,7 +266,7 @@ def clean_up(self): async def main(): sample = ChatThreadClientSamplesAsync() await sample.create_chat_thread_client_async() - await sample.update_thread_async() + await sample.update_topic_async() await sample.send_message_async() await sample.get_message_async() await sample.list_messages_async() @@ -248,9 +274,10 @@ async def main(): await sample.send_read_receipt_async() await sample.list_read_receipts_async() await sample.delete_message_async() - await sample.add_members_async() - await sample.list_members_async() - await sample.remove_member_async() + await sample.add_participant_async() + await sample.add_participants_async() + await sample.list_participants_async() + await sample.remove_participant_async() await sample.send_typing_notification_async() sample.clean_up() diff --git a/sdk/communication/azure-communication-chat/swagger/SWAGGER.md b/sdk/communication/azure-communication-chat/swagger/SWAGGER.md index 4d99df5dd8ce..655be82ec88a 100644 --- a/sdk/communication/azure-communication-chat/swagger/SWAGGER.md +++ b/sdk/communication/azure-communication-chat/swagger/SWAGGER.md @@ -15,7 +15,7 @@ autorest SWAGGER.md ### Settings ``` yaml -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/8818a603b78a1355ba1647ab9cd4e3354cdc4b69/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-09-21-preview2/communicationserviceschat.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/communication/data-plane/Microsoft.CommunicationServicesChat/preview/2020-11-01-preview3/communicationserviceschat.json output-folder: ../azure/communication/chat/_generated namespace: azure.communication.chat no-namespace-folders: true diff --git a/sdk/communication/azure-communication-chat/swagger/swagger.json b/sdk/communication/azure-communication-chat/swagger/swagger.json deleted file mode 100644 index 13d43e6e87e7..000000000000 --- a/sdk/communication/azure-communication-chat/swagger/swagger.json +++ /dev/null @@ -1,1646 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Azure Communication Chat Service", - "description": "Azure Communication Chat Service", - "contact": { - "email": "acsdevexdisc@microsoft.com" - }, - "version": "2020-09-21-preview2" - }, - "paths": { - "/chat/threads/{chatThreadId}/readreceipts": { - "get": { - "tags": [ - "Threads" - ], - "summary": "Gets read receipts for a thread.", - "operationId": "ListChatReadReceipts", - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "path", - "name": "chatThreadId", - "description": "Thread id to get the read receipts for.", - "required": true, - "type": "string" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "Request successful. The action returns the requested `ReadReceipt` resources.", - "schema": { - "$ref": "#/definitions/ReadReceiptsCollection" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "403": { - "description": "Forbidden", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "429": { - "description": "Too many requests", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "503": { - "description": "Service unavailable", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - } - }, - "x-ms-examples": { - "Get thread read receipts": { - "$ref": "./examples/Conversations_ListChatReadReceipts.json" - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink", - "itemName": "value" - } - }, - "post": { - "tags": [ - "Threads" - ], - "summary": "Sends a read receipt event to a thread, on behalf of a user.", - "operationId": "SendChatReadReceipt", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "path", - "name": "chatThreadId", - "description": "Thread id to send the read receipt event to.", - "required": true, - "type": "string" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "in": "body", - "name": "body", - "description": "Read receipt details.", - "required": true, - "schema": { - "$ref": "#/definitions/SendReadReceiptRequest" - } - } - ], - "responses": { - "201": { - "description": "Request successful." - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "403": { - "description": "Forbidden", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "429": { - "description": "Too many requests", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "503": { - "description": "Service unavailable", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - } - }, - "x-ms-examples": { - "Send read receipt": { - "$ref": "./examples/Conversations_SendChatReadReceipt.json" - } - } - } - }, - "/chat/threads/{chatThreadId}/messages": { - "post": { - "tags": [ - "Messages" - ], - "summary": "Sends a message to a thread.", - "operationId": "SendChatMessage", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "path", - "name": "chatThreadId", - "description": "The thread id to send the message to.", - "required": true, - "type": "string" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "in": "body", - "name": "body", - "description": "Details of the message to send.", - "required": true, - "schema": { - "$ref": "#/definitions/SendChatMessageRequest" - } - } - ], - "responses": { - "201": { - "description": "Message sent, the `Location` header contains the URL for the newly sent message.", - "schema": { - "$ref": "#/definitions/SendChatMessageResult" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "403": { - "description": "Forbidden", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "429": { - "description": "Too many requests", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "503": { - "description": "Service unavailable", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - } - }, - "x-ms-examples": { - "Send Message": { - "$ref": "./examples/Messages_SendChatMessage.json" - } - } - }, - "get": { - "tags": [ - "Messages" - ], - "summary": "Gets a list of messages from a thread.", - "operationId": "ListChatMessages", - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "path", - "name": "chatThreadId", - "description": "The thread id of the message.", - "required": true, - "type": "string" - }, - { - "in": "query", - "name": "maxPageSize", - "description": "The maximum number of messages to be returned per page.", - "type": "integer", - "format": "int32" - }, - { - "in": "query", - "name": "startTime", - "description": "The earliest point in time to get messages up to. The timestamp should be in ISO8601 format: `yyyy-MM-ddTHH:mm:ssZ`.", - "type": "string", - "format": "date-time" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ChatMessagesCollection" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "403": { - "description": "Forbidden", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "429": { - "description": "Too many requests", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "503": { - "description": "Service unavailable", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - } - }, - "x-ms-examples": { - "Get messages with pagination (max page size)": { - "$ref": "./examples/Messages_ListChatMessagesWithPageSize.json" - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink", - "itemName": "value" - } - } - }, - "/chat/threads/{chatThreadId}/messages/{chatMessageId}": { - "get": { - "tags": [ - "Messages" - ], - "summary": "Gets a message by id.", - "operationId": "GetChatMessage", - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "path", - "name": "chatThreadId", - "description": "The thread id to which the message was sent.", - "required": true, - "type": "string" - }, - { - "in": "path", - "name": "chatMessageId", - "description": "The message id.", - "required": true, - "type": "string" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "Request successful. The action returns a `Message` resource.", - "schema": { - "$ref": "#/definitions/ChatMessage" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "403": { - "description": "Forbidden", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "429": { - "description": "Too many requests", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "503": { - "description": "Service unavailable", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - } - }, - "x-ms-examples": { - "Get Message": { - "$ref": "./examples/Messages_GetChatMessage.json" - } - } - }, - "patch": { - "tags": [ - "Messages" - ], - "summary": "Updates a message.", - "operationId": "UpdateChatMessage", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "path", - "name": "chatThreadId", - "description": "The thread id to which the message was sent.", - "required": true, - "type": "string" - }, - { - "in": "path", - "name": "chatMessageId", - "description": "The message id.", - "required": true, - "type": "string" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "in": "body", - "name": "body", - "description": "Details of the request to update the message.", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateChatMessageRequest" - } - } - ], - "responses": { - "200": { - "description": "Message is successfully updated." - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "403": { - "description": "Forbidden", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "429": { - "description": "Too many requests", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "503": { - "description": "Service unavailable", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - } - }, - "x-ms-examples": { - "Update message content": { - "$ref": "./examples/Messages_UpdateChatMessage.json" - } - } - }, - "delete": { - "tags": [ - "Messages" - ], - "summary": "Deletes a message.", - "operationId": "DeleteChatMessage", - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "path", - "name": "chatThreadId", - "description": "The thread id to which the message was sent.", - "required": true, - "type": "string" - }, - { - "in": "path", - "name": "chatMessageId", - "description": "The message id.", - "required": true, - "type": "string" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "204": { - "description": "Request successful." - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "403": { - "description": "Forbidden", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "429": { - "description": "Too many requests", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "503": { - "description": "Service unavailable", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - } - }, - "x-ms-examples": { - "Delete message": { - "$ref": "./examples/Messages_DeleteChatMessage.json" - } - } - } - }, - "/chat/threads/{chatThreadId}/typing": { - "post": { - "tags": [ - "Messages" - ], - "summary": "Posts a typing event to a thread, on behalf of a user.", - "operationId": "SendTypingNotification", - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "path", - "name": "chatThreadId", - "description": "Id of the thread.", - "required": true, - "type": "string" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "Request successful." - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "403": { - "description": "Forbidden", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "429": { - "description": "Too many requests", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "503": { - "description": "Service unavailable", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - } - }, - "x-ms-examples": { - "Post typing event to a thread": { - "$ref": "./examples/Messages_SendTypingNotification.json" - } - } - } - }, - "/chat/threads/{chatThreadId}/members": { - "get": { - "tags": [ - "ThreadMembers" - ], - "summary": "Gets the members of a thread.", - "operationId": "ListChatThreadMembers", - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "path", - "name": "chatThreadId", - "description": "Thread id to get members for.", - "required": true, - "type": "string" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "Request successful. The action returns the members of a thread.", - "schema": { - "$ref": "#/definitions/ChatThreadMembersCollection" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "403": { - "description": "Forbidden", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "429": { - "description": "Too many requests", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "503": { - "description": "Service unavailable", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - } - }, - "x-ms-examples": { - "Get thread members": { - "$ref": "./examples/ThreadMembers_ListChatThreadMembers.json" - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink", - "itemName": "value" - } - }, - "post": { - "tags": [ - "ThreadMembers" - ], - "summary": "Adds thread members to a thread. If members already exist, no change occurs.", - "operationId": "AddChatThreadMembers", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "path", - "name": "chatThreadId", - "description": "Id of the thread to add members to.", - "required": true, - "type": "string" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "in": "body", - "name": "body", - "description": "Thread members to be added to the thread.", - "required": true, - "schema": { - "$ref": "#/definitions/AddChatThreadMembersRequest" - } - } - ], - "responses": { - "207": { - "description": "Multi status response, containing the status for the thread member addition operations." - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "403": { - "description": "Forbidden", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "429": { - "description": "Too many requests", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "503": { - "description": "Service unavailable", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - } - }, - "x-ms-examples": { - "Add thread members": { - "$ref": "./examples/ThreadMembers_AddChatThreadMembers.json" - } - } - } - }, - "/chat/threads/{chatThreadId}/members/{chatMemberId}": { - "delete": { - "tags": [ - "ThreadMembers" - ], - "summary": "Remove a member from a thread.", - "operationId": "RemoveChatThreadMember", - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "path", - "name": "chatThreadId", - "description": "Thread id to remove the member from.", - "required": true, - "type": "string" - }, - { - "in": "path", - "name": "chatMemberId", - "description": "Id of the thread member to remove from the thread.", - "required": true, - "type": "string" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "204": { - "description": "Request successful." - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "403": { - "description": "Forbidden", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "429": { - "description": "Too many requests", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "503": { - "description": "Service unavailable", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - } - }, - "x-ms-examples": { - "Remove thread member": { - "$ref": "./examples/ThreadMembers_RemoveChatThreadMember.json" - } - } - } - }, - "/chat/threads": { - "post": { - "tags": [ - "Threads" - ], - "summary": "Creates a chat thread.", - "operationId": "CreateChatThread", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "in": "body", - "name": "body", - "description": "Request payload for creating a chat thread.", - "required": true, - "schema": { - "$ref": "#/definitions/CreateChatThreadRequest" - } - } - ], - "responses": { - "207": { - "description": "Multi status response, containing the status for the thread creation and the thread member addition operations.\r\nIf the thread was created successfully, `Location` header would contain the URL for the newly created thread.", - "schema": { - "$ref": "#/definitions/MultiStatusResponse" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "403": { - "description": "Forbidden", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "429": { - "description": "Too many requests", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "503": { - "description": "Service unavailable", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - } - }, - "x-ms-examples": { - "Create chat thread": { - "$ref": "./examples/Threads_CreateChatThread.json" - } - } - }, - "get": { - "tags": [ - "Threads" - ], - "summary": "Gets the list of chat threads of a user.", - "operationId": "ListChatThreads", - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "query", - "name": "maxPageSize", - "description": "The maximum number of chat threads returned per page.", - "type": "integer", - "format": "int32" - }, - { - "in": "query", - "name": "startTime", - "description": "The earliest point in time to get chat threads up to. The timestamp should be in ISO8601 format: `yyyy-MM-ddTHH:mm:ssZ`.", - "type": "string", - "format": "date-time" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "Request successful. The action returns a `GetThreadsResponse` resource.", - "schema": { - "$ref": "#/definitions/ChatThreadsInfoCollection" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "403": { - "description": "Forbidden", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "429": { - "description": "Too many requests", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "503": { - "description": "Service unavailable", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - } - }, - "x-ms-examples": { - "Get threads with pagination (Max Page Size)": { - "$ref": "./examples/Threads_ListChatThreadsWithPageSize.json" - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink", - "itemName": "value" - } - } - }, - "/chat/threads/{chatThreadId}": { - "patch": { - "tags": [ - "Threads" - ], - "summary": "Updates a thread's properties.", - "operationId": "UpdateChatThread", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "path", - "name": "chatThreadId", - "description": "The id of the thread to update.", - "required": true, - "type": "string" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "in": "body", - "name": "body", - "description": "Request payload for updating a chat thread.", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateChatThreadRequest" - } - } - ], - "responses": { - "200": { - "description": "Thread was successfully updated." - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "403": { - "description": "Forbidden", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "429": { - "description": "Too many requests", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "503": { - "description": "Service unavailable", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - } - }, - "x-ms-examples": { - "Update chat thread topic": { - "$ref": "./examples/Threads_UpdateChatThreadTopic.json" - } - } - }, - "get": { - "tags": [ - "Threads" - ], - "summary": "Gets a chat thread.", - "operationId": "GetChatThread", - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "path", - "name": "chatThreadId", - "description": "Thread id to get.", - "required": true, - "type": "string" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "Request successful. The action returns a `Thread` resource.", - "schema": { - "$ref": "#/definitions/ChatThread" - } - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "403": { - "description": "Forbidden", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "429": { - "description": "Too many requests", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "503": { - "description": "Service unavailable", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - } - }, - "x-ms-examples": { - "Get chat thread": { - "$ref": "./examples/Threads_GetChatThread.json" - } - } - }, - "delete": { - "tags": [ - "Threads" - ], - "summary": "Deletes a thread.", - "operationId": "DeleteChatThread", - "produces": [ - "application/json" - ], - "parameters": [ - { - "in": "path", - "name": "chatThreadId", - "description": "Thread id to delete.", - "required": true, - "type": "string" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "204": { - "description": "Request successful." - }, - "401": { - "description": "Unauthorized", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "403": { - "description": "Forbidden", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "429": { - "description": "Too many requests", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - }, - "503": { - "description": "Service unavailable", - "schema": { - "$ref": "#/definitions/Error" - }, - "x-ms-error-response": true - } - }, - "x-ms-examples": { - "Delete chat thread": { - "$ref": "./examples/Threads_DeleteChatThread.json" - } - } - } - } - }, - "definitions": { - "ReadReceipt": { - "description": "A read receipt indicates the time a chat message was read by a recipient.", - "type": "object", - "properties": { - "senderId": { - "description": "Read receipt sender id.", - "type": "string", - "readOnly": true, - "example": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" - }, - "chatMessageId": { - "description": "Id for the chat message that has been read. This id is generated by the server.", - "type": "string", - "readOnly": true, - "example": "1591137790240" - }, - "readOn": { - "format": "date-time", - "description": "Read receipt timestamp. The timestamp is in ISO8601 format: `yyyy-MM-ddTHH:mm:ssZ`.", - "type": "string", - "readOnly": true, - "example": "2020-10-30T10:50:50Z" - } - } - }, - "ReadReceiptsCollection": { - "type": "object", - "properties": { - "value": { - "description": "Collection of read receipts.", - "type": "array", - "items": { - "$ref": "#/definitions/ReadReceipt" - }, - "readOnly": true - }, - "nextLink": { - "description": "If there are more read receipts that can be retrieved, the next link will be populated.", - "type": "string", - "readOnly": true - } - } - }, - "Error": { - "type": "object", - "properties": { - "code": { - "type": "string", - "readOnly": true - }, - "message": { - "type": "string", - "readOnly": true - }, - "target": { - "type": "string", - "readOnly": true - }, - "innerErrors": { - "type": "array", - "items": { - "$ref": "#/definitions/Error" - }, - "readOnly": true - } - } - }, - "SendReadReceiptRequest": { - "description": "Request payload for sending a read receipt.", - "required": [ - "chatMessageId" - ], - "type": "object", - "properties": { - "chatMessageId": { - "description": "Id of the latest chat message read by the user.", - "type": "string", - "example": "1592435762364" - } - } - }, - "ChatMessagePriority": { - "description": "The chat message priority.", - "enum": [ - "Normal", - "High" - ], - "type": "string", - "x-ms-enum": { - "name": "ChatMessagePriority", - "modelAsString": true - } - }, - "SendChatMessageRequest": { - "description": "Details of the message to send.", - "required": [ - "content" - ], - "type": "object", - "properties": { - "priority": { - "$ref": "#/definitions/ChatMessagePriority" - }, - "content": { - "description": "Chat message content.", - "type": "string", - "example": "Come one guys, lets go for lunch together." - }, - "senderDisplayName": { - "description": "The display name of the chat message sender. This property is used to populate sender name for push notifications.", - "type": "string", - "example": "Bob Admin" - } - } - }, - "SendChatMessageResult": { - "description": "Result of the send message operation.", - "type": "object", - "properties": { - "id": { - "description": "A server-generated message id.", - "type": "string", - "readOnly": true, - "example": "123456789" - } - } - }, - "ChatMessage": { - "type": "object", - "properties": { - "id": { - "description": "The id of the chat message. This id is server generated.", - "type": "string", - "readOnly": true, - "example": "123456789" - }, - "type": { - "description": "Type of the chat message.\r\n \r\nPossible values:\r\n - Text\r\n - ThreadActivity/TopicUpdate\r\n - ThreadActivity/AddMember\r\n - ThreadActivity/DeleteMember", - "type": "string", - "example": "Text" - }, - "priority": { - "$ref": "#/definitions/ChatMessagePriority" - }, - "version": { - "description": "Version of the chat message.", - "type": "string", - "readOnly": true - }, - "content": { - "description": "Content of the chat message.", - "type": "string", - "example": "Come one guys, lets go for lunch together." - }, - "senderDisplayName": { - "description": "The display name of the chat message sender. This property is used to populate sender name for push notifications.", - "type": "string", - "example": "Jane" - }, - "createdOn": { - "format": "date-time", - "description": "The timestamp when the chat message arrived at the server. The timestamp is in ISO8601 format: `yyyy-MM-ddTHH:mm:ssZ`.", - "type": "string", - "readOnly": true, - "example": "2020-10-30T10:50:50Z" - }, - "senderId": { - "description": "The id of the chat message sender.", - "type": "string", - "readOnly": true, - "example": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" - }, - "deletedOn": { - "format": "date-time", - "description": "The timestamp when the chat message was deleted. The timestamp is in ISO8601 format: `yyyy-MM-ddTHH:mm:ssZ`.", - "type": "string", - "example": "2020-10-30T10:50:50Z" - }, - "editedOn": { - "format": "date-time", - "description": "The timestamp when the chat message was edited. The timestamp is in ISO8601 format: `yyyy-MM-ddTHH:mm:ssZ`.", - "type": "string", - "example": "2020-10-30T10:50:50Z" - } - } - }, - "ChatMessagesCollection": { - "description": "Collection of chat messages for a particular chat thread.", - "type": "object", - "properties": { - "value": { - "description": "Collection of chat messages.", - "type": "array", - "items": { - "$ref": "#/definitions/ChatMessage" - }, - "readOnly": true - }, - "nextLink": { - "description": "If there are more chat messages that can be retrieved, the next link will be populated.", - "type": "string", - "readOnly": true - } - } - }, - "UpdateChatMessageRequest": { - "type": "object", - "properties": { - "content": { - "description": "Chat message content.", - "type": "string", - "example": "Let's go for lunch together." - }, - "priority": { - "$ref": "#/definitions/ChatMessagePriority" - } - } - }, - "ChatThreadMember": { - "description": "A member of the chat thread.", - "required": [ - "id" - ], - "type": "object", - "properties": { - "id": { - "description": "The id of the chat thread member in the format `8:acs:ResourceId_AcsUserId`.", - "type": "string", - "example": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" - }, - "displayName": { - "description": "Display name for the chat thread member.", - "type": "string", - "example": "Bob" - }, - "shareHistoryTime": { - "format": "date-time", - "description": "Time from which the chat history is shared with the member. The timestamp is in ISO8601 format: `yyyy-MM-ddTHH:mm:ssZ`.", - "type": "string", - "example": "2020-10-30T10:50:50Z" - } - } - }, - "ChatThreadMembersCollection": { - "description": "Collection of thread members belong to a particular thread.", - "type": "object", - "properties": { - "value": { - "description": "Chat thread members.", - "type": "array", - "items": { - "$ref": "#/definitions/ChatThreadMember" - } - }, - "nextLink": { - "description": "If there are more chat threads that can be retrieved, the next link will be populated.", - "type": "string", - "readOnly": true - } - } - }, - "AddChatThreadMembersRequest": { - "description": "Thread members to be added to the thread.", - "required": [ - "members" - ], - "type": "object", - "properties": { - "members": { - "description": "Members to add to a chat thread.", - "type": "array", - "items": { - "$ref": "#/definitions/ChatThreadMember" - } - } - } - }, - "CreateChatThreadRequest": { - "description": "Request payload for creating a chat thread.", - "required": [ - "members", - "topic" - ], - "type": "object", - "properties": { - "topic": { - "description": "The chat thread topic.", - "type": "string", - "example": "Lunch Thread" - }, - "members": { - "description": "Members to be added to the chat thread.", - "type": "array", - "items": { - "$ref": "#/definitions/ChatThreadMember" - } - } - } - }, - "IndividualStatusResponse": { - "type": "object", - "properties": { - "id": { - "description": "Identifies the resource to which the individual status corresponds.", - "type": "string", - "readOnly": true - }, - "statusCode": { - "format": "int32", - "description": "The status code of the resource operation.\r\n \r\nPossible values include:\r\n 200 for a successful update or delete,\r\n 201 for successful creation,\r\n 400 for a malformed input,\r\n 403 for lacking permission to execute the operation,\r\n 404 for resource not found.", - "type": "integer", - "readOnly": true - }, - "message": { - "description": "The message explaining why the operation failed for the resource identified by the key; null if the operation succeeded.", - "type": "string", - "readOnly": true - }, - "type": { - "description": "Identifies the type of the resource to which the individual status corresponds.", - "type": "string", - "readOnly": true - } - } - }, - "MultiStatusResponse": { - "type": "object", - "properties": { - "multipleStatus": { - "description": "The list of status information for each resource in the request.", - "type": "array", - "items": { - "$ref": "#/definitions/IndividualStatusResponse" - }, - "readOnly": true - } - } - }, - "ChatThreadInfo": { - "type": "object", - "properties": { - "id": { - "description": "Chat thread id.", - "type": "string", - "readOnly": true, - "example": "19:uni01_uy5ucb66ugp3lrhe7pxso6xx4hsmm3dl6eyjfefv2n6x3rrurpea@thread.v2" - }, - "topic": { - "description": "Chat thread topic.", - "type": "string", - "example": "Lunch Chat thread" - }, - "isDeleted": { - "description": "Flag if a chat thread is soft deleted.", - "type": "boolean", - "example": false - }, - "lastMessageReceivedOn": { - "format": "date-time", - "description": "The timestamp when the last message arrived at the server. The timestamp is in ISO8601 format: `yyyy-MM-ddTHH:mm:ssZ`.", - "type": "string", - "readOnly": true, - "example": "2020-10-30T10:50:50Z" - } - } - }, - "ChatThreadsInfoCollection": { - "description": "Collection of chat threads.", - "type": "object", - "properties": { - "value": { - "description": "Collection of chat threads.", - "type": "array", - "items": { - "$ref": "#/definitions/ChatThreadInfo" - }, - "readOnly": true - }, - "nextLink": { - "description": "If there are more chat threads that can be retrieved, the next link will be populated.", - "type": "string", - "readOnly": true - } - } - }, - "UpdateChatThreadRequest": { - "type": "object", - "properties": { - "topic": { - "description": "Chat thread topic.", - "type": "string", - "example": "Lunch Thread" - } - } - }, - "ChatThread": { - "type": "object", - "properties": { - "id": { - "description": "Chat thread id.", - "type": "string", - "readOnly": true, - "example": "19:uni01_uy5ucb66ugp3lrhe7pxso6xx4hsmm3dl6eyjfefv2n6x3rrurpea@thread.v2" - }, - "topic": { - "description": "Chat thread topic.", - "type": "string", - "example": "Lunch Chat thread" - }, - "createdOn": { - "format": "date-time", - "description": "The timestamp when the chat thread was created. The timestamp is in ISO8601 format: `yyyy-MM-ddTHH:mm:ssZ`.", - "type": "string", - "readOnly": true, - "example": "2020-10-30T10:50:50Z" - }, - "createdBy": { - "description": "Id of the chat thread owner.", - "type": "string", - "readOnly": true, - "example": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" - }, - "members": { - "description": "Chat thread members.", - "type": "array", - "items": { - "$ref": "#/definitions/ChatThreadMember" - } - } - } - }, - "CommunicationIdentifierModel": { - "description": "Test", - "required": [ - "kind" - ], - "type": "object", - "properties": { - "kind": { - "description": "Test", - "type": "string" - }, - "id": { - "description": "Test", - "type": "string" - }, - "phoneNumber": { - "description": "Test", - "type": "string" - }, - "isAnonymous": { - "description": "Test", - "type": "boolean" - }, - "microsoftTeamsUserId": { - "description": "Test", - "type": "string" - } - } - } - }, - "parameters": { - "ApiVersionParameter": { - "in": "query", - "name": "api-version", - "description": "Version of API to invoke.", - "required": true, - "type": "string", - "x-ms-parameter-location": "method" - }, - "Endpoint": { - "in": "path", - "name": "endpoint", - "description": "The endpoint of the Azure Communication resource.", - "required": true, - "type": "string", - "x-ms-skip-url-encoding": true, - "x-ms-parameter-location": "client" - } - }, - "securityDefinitions": { - "Authorization": { - "type": "apiKey", - "name": "Authorization", - "in": "header", - "description": "An ACS (Azure Communication Services) user access token." - } - }, - "security": [ - { - "Authorization": [] - } - ], - "x-ms-parameterized-host": { - "hostTemplate": "{endpoint}", - "useSchemePrefix": false, - "parameters": [ - { - "$ref": "#/parameters/Endpoint" - } - ] - } -} \ No newline at end of file diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_create_chat_thread.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_create_chat_thread.yaml index 5f8fe3923e2c..53597211f34c 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_create_chat_thread.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_create_chat_thread.yaml @@ -11,30 +11,30 @@ interactions: Content-Length: - '0' Date: - - Thu, 10 Dec 2020 20:18:53 GMT + - Mon, 01 Feb 2021 23:05:51 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Thu, 10 Dec 2020 20:18:53 GMT + - Mon, 01 Feb 2021 23:05:49 GMT ms-cv: - - 26unB3Qk9kGJOTYw60xNKA.0 + - ZnvUuj0XsUmdCSvrKAuq/Q.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 20ms + - 83ms status: code: 200 message: OK @@ -52,35 +52,35 @@ interactions: Content-Type: - application/json Date: - - Thu, 10 Dec 2020 20:18:53 GMT + - Mon, 01 Feb 2021 23:05:51 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities/sanitized/token?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2020-12-11T20:18:53.2210662+00:00"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:05:49.906379+00:00"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Thu, 10 Dec 2020 20:18:53 GMT + - Mon, 01 Feb 2021 23:05:50 GMT ms-cv: - - xJYSvPeXlUaWtjmVOEkxdA.0 + - cCElD8gOXkyn78SC7PR2xA.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 27ms + - 133ms status: code: 200 message: OK - request: - body: '{"topic": "test topic", "members": "sanitized"}' + body: '{"topic": "test topic", "participants": "sanitized"}' headers: Accept: - application/json @@ -89,33 +89,36 @@ interactions: Connection: - keep-alive Content-Length: - - '201' + - '206' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - ee5399fe-a8b4-4f81-b022-eb5271820855 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 response: - body: '{"multipleStatus": "sanitized"}' + body: '{"chatThread": {"id": "19:1DwYpmFor6fm6d9B-KPvnaKt1GDCbGkphgtJGLw6qMY1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:05:51Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffb9-ff5a-1655-373a0d0025bf"}}' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: - application/json; charset=utf-8 date: - - Thu, 10 Dec 2020 20:18:54 GMT + - Mon, 01 Feb 2021 23:05:52 GMT ms-cv: - - ybRSHz3T7UezfcBNs8+Q6Q.0 + - TO71ajX/1EiaJuJJQ5vqJw.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 460ms + - 1318ms status: - code: 207 - message: Multi-Status + code: 201 + message: Created - request: body: null headers: @@ -128,27 +131,27 @@ interactions: Content-Length: - '0' Date: - - Thu, 10 Dec 2020 20:18:54 GMT + - Mon, 01 Feb 2021 23:05:53 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Thu, 10 Dec 2020 20:18:55 GMT + - Mon, 01 Feb 2021 23:06:09 GMT ms-cv: - - ohlmRj1q906w2iJt02dXqQ.0 + - w8dY644PGkyY7+bBkOXYHQ.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 1296ms + - 16808ms status: code: 204 message: No Content @@ -164,23 +167,23 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 date: - - Thu, 10 Dec 2020 20:18:55 GMT + - Mon, 01 Feb 2021 23:06:09 GMT ms-cv: - - bhmNk4jKnE+OV/AY+p9szw.0 + - qsobGe1ye0iPmeq6xTNEXA.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 139ms + - 345ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_create_chat_thread_w_repeatability_request_id.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_create_chat_thread_w_repeatability_request_id.yaml new file mode 100644 index 000000000000..d6ea61b26cd2 --- /dev/null +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_create_chat_thread_w_repeatability_request_id.yaml @@ -0,0 +1,230 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:06:10 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:06:09 GMT + ms-cv: + - 8aH3ZE1jlUSY/zW87XGWVg.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 36ms + status: + code: 200 + message: OK +- request: + body: '{"scopes": ["chat"]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '20' + Content-Type: + - application/json + Date: + - Mon, 01 Feb 2021 23:06:10 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:06:09.4122919+00:00"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:06:09 GMT + ms-cv: + - FlQlge6m9E699iT/tDaOfQ.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 314ms + status: + code: 200 + message: OK +- request: + body: '{"topic": "test topic", "participants": "sanitized"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '206' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - 3226b945-d88e-4c7e-abee-7468608ec067 + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 + response: + body: '{"chatThread": {"id": "19:x5mqfZ2VXhexu1xRl38J_IthJWFc78uWfSJ7_fQ49qs1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:06:10Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffba-4adc-1db7-3a3a0d002ba2"}}' + headers: + api-supported-versions: + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:06:10 GMT + ms-cv: + - BQidqaje0kytcwLvtImyhw.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 913ms + status: + code: 201 + message: Created +- request: + body: '{"topic": "test topic", "participants": "sanitized"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '206' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - 3226b945-d88e-4c7e-abee-7468608ec067 + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 + response: + body: '{"chatThread": {"id": "19:x5mqfZ2VXhexu1xRl38J_IthJWFc78uWfSJ7_fQ49qs1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:06:10Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffba-4adc-1db7-3a3a0d002ba2"}}' + headers: + api-supported-versions: + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:06:11 GMT + ms-cv: + - QzgDF9PqIUOb1VmJ/WDwBQ.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 731ms + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:06:13 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + date: + - Mon, 01 Feb 2021 23:06:28 GMT + ms-cv: + - HRni64wz5EG6rPYVVX/BvA.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 16015ms + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + date: + - Mon, 01 Feb 2021 23:06:27 GMT + ms-cv: + - 9/q+DwwLaky0HTNC9m/YSw.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 313ms + status: + code: 204 + message: No Content +version: 1 diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_delete_chat_thread.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_delete_chat_thread.yaml index 89208acd8754..d41a415a6555 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_delete_chat_thread.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_delete_chat_thread.yaml @@ -11,30 +11,30 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:47:07 GMT + - Mon, 01 Feb 2021 23:06:29 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:06 GMT + - Mon, 01 Feb 2021 23:06:28 GMT ms-cv: - - gWsoTNIIsESeHKQoyza/LA.0 + - +o8WsDMOs0uqL5EJG1EhCA.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 209ms + - 269ms status: code: 200 message: OK @@ -52,35 +52,35 @@ interactions: Content-Type: - application/json Date: - - Wed, 02 Dec 2020 23:47:08 GMT + - Mon, 01 Feb 2021 23:06:30 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities/sanitized/token?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2020-12-03T23:47:06.1263309+00:00"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:06:28.6577603+00:00"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:06 GMT + - Mon, 01 Feb 2021 23:06:29 GMT ms-cv: - - R1/BpTiBsE+I8UbwKUR/0w.0 + - NXs+b7gabkGQbpFj6Ob9jw.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 278ms + - 162ms status: code: 200 message: OK - request: - body: '{"topic": "test topic", "members": "sanitized"}' + body: '{"topic": "test topic", "participants": "sanitized"}' headers: Accept: - application/json @@ -89,33 +89,36 @@ interactions: Connection: - keep-alive Content-Length: - - '201' + - '206' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - e249507a-f040-419b-b197-3e2585182bc0 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 response: - body: '{"multipleStatus": "sanitized"}' + body: '{"chatThread": {"id": "19:j9pZbUVFcG0UIKClamuE8fPBzDr7o2szKbPsuRRuH6M1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:06:30Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffba-95de-1655-373a0d0025c3"}}' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:07 GMT + - Mon, 01 Feb 2021 23:06:30 GMT ms-cv: - - WpuQkQmOmE6DGBY5BWe4IA.0 + - OtyGkQBz0k+TjFJiC9qciw.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 381ms + - 919ms status: - code: 207 - message: Multi-Status + code: 201 + message: Created - request: body: null headers: @@ -128,23 +131,23 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 date: - - Wed, 02 Dec 2020 23:47:07 GMT + - Mon, 01 Feb 2021 23:06:31 GMT ms-cv: - - ZtUAO0OxB0q8ivftF6Yc0A.0 + - mQ+gq8vICEGXJsrvlW4nNw.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 165ms + - 338ms status: code: 204 message: No Content @@ -160,27 +163,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:47:09 GMT + - Mon, 01 Feb 2021 23:06:32 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:47:09 GMT + - Mon, 01 Feb 2021 23:06:47 GMT ms-cv: - - +h+VlWjjeUigsk2oZMhtHw.0 + - jgtU2RpRuECz0gcDM385Lw.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 1071ms + - 16385ms status: code: 204 message: No Content @@ -196,23 +199,23 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 date: - - Wed, 02 Dec 2020 23:47:09 GMT + - Mon, 01 Feb 2021 23:06:47 GMT ms-cv: - - 3glYFarFr0aeJn9IGjsjGA.0 + - vXn1GQn/UkO+84loyHanjQ.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 62ms + - 262ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_get_chat_thread.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_get_chat_thread.yaml index 86098377aaf2..1dcfd729d18e 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_get_chat_thread.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_get_chat_thread.yaml @@ -11,30 +11,30 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:47:11 GMT + - Mon, 01 Feb 2021 23:06:48 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:10 GMT + - Mon, 01 Feb 2021 23:06:47 GMT ms-cv: - - tVlzxts3H0CGdNKx4oL4cg.0 + - UQWpMrfQB0uptNVSVeWXWg.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 211ms + - 76ms status: code: 200 message: OK @@ -52,35 +52,35 @@ interactions: Content-Type: - application/json Date: - - Wed, 02 Dec 2020 23:47:11 GMT + - Mon, 01 Feb 2021 23:06:49 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities/sanitized/token?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2020-12-03T23:47:09.8304716+00:00"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:06:47.4035307+00:00"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:10 GMT + - Mon, 01 Feb 2021 23:06:47 GMT ms-cv: - - vUtd9yMZMUqj+jyslkke8g.0 + - tOyEJ/wQQE6lS3vi6YLgkg.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 286ms + - 96ms status: code: 200 message: OK - request: - body: '{"topic": "test topic", "members": "sanitized"}' + body: '{"topic": "test topic", "participants": "sanitized"}' headers: Accept: - application/json @@ -89,33 +89,36 @@ interactions: Connection: - keep-alive Content-Length: - - '201' + - '206' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - 8967dc15-d604-4257-bb87-44d8058b01a6 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 response: - body: '{"multipleStatus": "sanitized"}' + body: '{"chatThread": {"id": "19:iAnuf61IaCSlEJsC8O3VbYqM-AMHX8L_wUgpMocRTHs1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:06:48Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffba-e02e-9c58-373a0d002dd6"}}' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:11 GMT + - Mon, 01 Feb 2021 23:06:48 GMT ms-cv: - - pcsN13x5eEuWMzOHELEEUg.0 + - /X7nkGa+NUmOrDElQS1Bvw.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 262ms + - 899ms status: - code: 207 - message: Multi-Status + code: 201 + message: Created - request: body: null headers: @@ -126,27 +129,27 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 response: - body: '{"id": "sanitized", "topic": "test topic", "createdOn": "2020-12-02T23:47:11Z", - "createdBy": "sanitized", "members": "sanitized"}' + body: '{"id": "sanitized", "topic": "test topic", "createdOn": "2021-02-01T23:06:48Z", + "createdBy": "sanitized"}' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:11 GMT + - Mon, 01 Feb 2021 23:06:49 GMT ms-cv: - - vWVn824KxkONTMHJgd+cQw.0 + - LLJhSl5tYEaCJ4F/58GCqQ.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 67ms + - 264ms status: code: 200 message: OK @@ -162,27 +165,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:47:13 GMT + - Mon, 01 Feb 2021 23:06:50 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:47:13 GMT + - Mon, 01 Feb 2021 23:07:05 GMT ms-cv: - - jq9t7+ckWUi1Gqf+L8SP8Q.0 + - xsILKS7K+0yTmDu48f13FQ.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 1495ms + - 16893ms status: code: 204 message: No Content @@ -198,23 +201,23 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 date: - - Wed, 02 Dec 2020 23:47:13 GMT + - Mon, 01 Feb 2021 23:07:06 GMT ms-cv: - - HQR5UmiuqUCdHM6nzdSLFA.0 + - RtDlEf0Z3k6b2K0CyU/63Q.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 139ms + - 310ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_get_thread_client.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_get_thread_client.yaml index b9ad691d0b25..3b1b97458bd3 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_get_thread_client.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_get_thread_client.yaml @@ -11,30 +11,30 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:47:14 GMT + - Mon, 01 Feb 2021 23:07:08 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:14 GMT + - Mon, 01 Feb 2021 23:07:06 GMT ms-cv: - - unWGwaW/mkecuJOVqQYQjQ.0 + - ZU5arxpcBkuN+tm5herHCg.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 244ms + - 29ms status: code: 200 message: OK @@ -52,35 +52,35 @@ interactions: Content-Type: - application/json Date: - - Wed, 02 Dec 2020 23:47:15 GMT + - Mon, 01 Feb 2021 23:07:08 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities/sanitized/token?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2020-12-03T23:47:13.8882327+00:00"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:07:06.4449462+00:00"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:14 GMT + - Mon, 01 Feb 2021 23:07:06 GMT ms-cv: - - uMKM1KYK60mrKhR4TYZzyg.0 + - lzLWBxG1nEeff221x5eFDQ.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 284ms + - 100ms status: code: 200 message: OK - request: - body: '{"topic": "test topic", "members": "sanitized"}' + body: '{"topic": "test topic", "participants": "sanitized"}' headers: Accept: - application/json @@ -89,33 +89,36 @@ interactions: Connection: - keep-alive Content-Length: - - '201' + - '206' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - c6bb2f2d-0896-4cb7-86b5-00d9d5761055 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 response: - body: '{"multipleStatus": "sanitized"}' + body: '{"chatThread": {"id": "19:Uiuh6FNzmfVS0c2HNkr_QCX0gEk1FFjcr-zn-VrTnhc1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:07:07Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffbb-2aa0-1db7-3a3a0d002ba6"}}' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:15 GMT + - Mon, 01 Feb 2021 23:07:08 GMT ms-cv: - - sdG/7ul5N06rvyrn+0EsOA.0 + - U0QyAn/ugU6H0ZxvqbdNDg.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 271ms + - 862ms status: - code: 207 - message: Multi-Status + code: 201 + message: Created - request: body: null headers: @@ -128,27 +131,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:47:17 GMT + - Mon, 01 Feb 2021 23:07:09 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:47:16 GMT + - Mon, 01 Feb 2021 23:07:25 GMT ms-cv: - - YrsGqGLkKEKiqYcu6131dA.0 + - XHNTij4AikOzSly2DQRMZg.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 1488ms + - 16828ms status: code: 204 message: No Content @@ -164,23 +167,23 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 date: - - Wed, 02 Dec 2020 23:47:17 GMT + - Mon, 01 Feb 2021 23:07:25 GMT ms-cv: - - xvywnUjse0S6fKP4F1bgQw.0 + - GrF9Je9SjE+2uzKFZKSfRg.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 145ms + - 303ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_list_chat_threads.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_list_chat_threads.yaml index a5676b4b1410..6040674e2923 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_list_chat_threads.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e.test_list_chat_threads.yaml @@ -11,30 +11,30 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:47:19 GMT + - Mon, 01 Feb 2021 23:07:26 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:17 GMT + - Mon, 01 Feb 2021 23:07:25 GMT ms-cv: - - JYdK+w62Mky4+PnOgkIrYQ.0 + - ZBImGh7ZAESko20q+2GvXg.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 207ms + - 23ms status: code: 200 message: OK @@ -52,35 +52,35 @@ interactions: Content-Type: - application/json Date: - - Wed, 02 Dec 2020 23:47:19 GMT + - Mon, 01 Feb 2021 23:07:26 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities/sanitized/token?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2020-12-03T23:47:17.6875722+00:00"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:07:25.0879986+00:00"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:17 GMT + - Mon, 01 Feb 2021 23:07:25 GMT ms-cv: - - PZXxCIENDUCVME1Uz0qfvQ.0 + - 31MYXxPAMEexuRXuhapk4w.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 279ms + - 102ms status: code: 200 message: OK - request: - body: '{"topic": "test topic", "members": "sanitized"}' + body: '{"topic": "test topic", "participants": "sanitized"}' headers: Accept: - application/json @@ -89,33 +89,36 @@ interactions: Connection: - keep-alive Content-Length: - - '201' + - '206' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - ca9c6cf2-f753-45b3-9a76-d7d86a6f318f method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 response: - body: '{"multipleStatus": "sanitized"}' + body: '{"chatThread": {"id": "19:bl8DP2LGHPRhk7ZPZ9GAlUpS4szKweh-3VPudlijLUg1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:07:26Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffbb-7371-1655-373a0d0025c4"}}' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:18 GMT + - Mon, 01 Feb 2021 23:07:27 GMT ms-cv: - - YyA7Qs0k4kC5Il5kP1uGtw.0 + - VqZOxX2c4kqTFVEHLa77Fw.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 421ms + - 1038ms status: - code: 207 - message: Multi-Status + code: 201 + message: Created - request: body: null headers: @@ -126,26 +129,26 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads?maxPageSize=1&api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads?maxPageSize=1&api-version=2020-11-01-preview3 response: body: '{"value": "sanitized"}' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:21 GMT + - Mon, 01 Feb 2021 23:07:29 GMT ms-cv: - - 6gKpeApOKkeKLQ+jeIUeGw.0 + - gFdW35Os30Guz6FRRnR6Qg.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 25ms + - 325ms status: code: 200 message: OK @@ -161,27 +164,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:47:23 GMT + - Mon, 01 Feb 2021 23:07:30 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:47:22 GMT + - Mon, 01 Feb 2021 23:07:45 GMT ms-cv: - - RiySMAdHEUOed6NAhjeWvQ.0 + - tZLG0lJIv0C4eg3da882Bw.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 977ms + - 16461ms status: code: 204 message: No Content @@ -197,23 +200,23 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 date: - - Wed, 02 Dec 2020 23:47:22 GMT + - Mon, 01 Feb 2021 23:07:46 GMT ms-cv: - - KH74ovx+8UOD57kDDLDMkw.0 + - YuU0xKQrIU6+YkzfDMRpgQ.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 125ms + - 303ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_create_chat_thread_async.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_create_chat_thread_async.yaml index 732cbf8ea0b1..d42052238e76 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_create_chat_thread_async.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_create_chat_thread_async.yaml @@ -11,30 +11,30 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:47:24 GMT + - Mon, 01 Feb 2021 23:07:47 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:23 GMT + - Mon, 01 Feb 2021 23:07:46 GMT ms-cv: - - k1uhIxxIHkytdDJYNJB1bQ.0 + - J++BLQqKNkWICPCA+9xZ5A.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 211ms + - 46ms status: code: 200 message: OK @@ -52,82 +52,85 @@ interactions: Content-Type: - application/json Date: - - Wed, 02 Dec 2020 23:47:25 GMT + - Mon, 01 Feb 2021 23:07:47 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities/sanitized/token?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2020-12-03T23:47:23.1482132+00:00"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:07:47.0289732+00:00"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:23 GMT + - Mon, 01 Feb 2021 23:07:47 GMT ms-cv: - - FeXfd+E6kEyk1Xiy6LG7dw.0 + - 5pAZRPWRe0i48Hg8Jb+jrQ.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 290ms + - 926ms status: code: 200 message: OK - request: - body: '{"topic": "test topic", "members": "sanitized"}' + body: '{"topic": "test topic", "participants": "sanitized"}' headers: Accept: - application/json Content-Length: - - '201' + - '206' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - 3d1ef516-d70b-44ca-9923-fbb0a98f85ce method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 response: - body: '{"multipleStatus": "sanitized"}' + body: '{"chatThread": {"id": "19:yt2KMiiytdERIiWZQFH0bAjzO6rOwAPinaLi0mrDGb01@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:07:48Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffbb-c5cc-b0b7-3a3a0d002fc4"}}' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: application/json; charset=utf-8 - date: Wed, 02 Dec 2020 23:47:23 GMT - ms-cv: DAjO6UVirkKR+lanq+6LOA.0 + date: Mon, 01 Feb 2021 23:07:48 GMT + ms-cv: mJTbpNZw80uaQIaKPqktTw.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 278ms + x-processing-time: 851ms status: - code: 207 - message: Multi-Status - url: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + code: 201 + message: Created + url: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 - date: Wed, 02 Dec 2020 23:47:24 GMT - ms-cv: pMwU+IZh+kiRDUMa8dbiyw.0 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + date: Mon, 01 Feb 2021 23:07:48 GMT + ms-cv: gVvHOsLZu0K6aBGua2aZbQ.0 strict-transport-security: max-age=2592000 - x-processing-time: 164ms + x-processing-time: 298ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 - request: body: null headers: @@ -140,27 +143,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:47:26 GMT + - Mon, 01 Feb 2021 23:07:50 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:47:26 GMT + - Mon, 01 Feb 2021 23:08:04 GMT ms-cv: - - MpmHa7pSQ0Km89WjP/kthA.0 + - QCpe+2PiPE2cp9pwMDjx+w.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 1432ms + - 16313ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_create_chat_thread_w_repeatability_request_id_async.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_create_chat_thread_w_repeatability_request_id_async.yaml new file mode 100644 index 000000000000..0c3d8a323d7a --- /dev/null +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_create_chat_thread_w_repeatability_request_id_async.yaml @@ -0,0 +1,200 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:08:06 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:08:05 GMT + ms-cv: + - BmO2rJliKkacnw64wuz7Qg.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 31ms + status: + code: 200 + message: OK +- request: + body: '{"scopes": ["chat"]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '20' + Content-Type: + - application/json + Date: + - Mon, 01 Feb 2021 23:08:06 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:08:05.2241522+00:00"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:08:05 GMT + ms-cv: + - lXr3PgaBu0ukIDdpT998MQ.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 109ms + status: + code: 200 + message: OK +- request: + body: '{"topic": "test topic", "participants": "sanitized"}' + headers: + Accept: + - application/json + Content-Length: + - '206' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - d22a1da5-d171-48c2-b7cb-b4454a7213dd + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 + response: + body: '{"chatThread": {"id": "19:pxayKUZkmv_fcL_6rAq9aBuZpsJDHOxMmT6t0uTv8pU1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:08:06Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffbc-101f-1655-373a0d0025c6"}}' + headers: + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-type: application/json; charset=utf-8 + date: Mon, 01 Feb 2021 23:08:07 GMT + ms-cv: Z6uZ+gz1OkmUVgLK+F5oUw.0 + strict-transport-security: max-age=2592000 + transfer-encoding: chunked + x-processing-time: 845ms + status: + code: 201 + message: Created + url: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 +- request: + body: '{"topic": "test topic", "participants": "sanitized"}' + headers: + Accept: + - application/json + Content-Length: + - '206' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - d22a1da5-d171-48c2-b7cb-b4454a7213dd + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 + response: + body: '{"chatThread": {"id": "19:pxayKUZkmv_fcL_6rAq9aBuZpsJDHOxMmT6t0uTv8pU1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:08:06Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffbc-101f-1655-373a0d0025c6"}}' + headers: + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-type: application/json; charset=utf-8 + date: Mon, 01 Feb 2021 23:08:07 GMT + ms-cv: 2HnWsHW3e0O7piyoPIQ+hw.0 + strict-transport-security: max-age=2592000 + transfer-encoding: chunked + x-processing-time: 668ms + status: + code: 201 + message: Created + url: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 + response: + body: + string: '' + headers: + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + date: Mon, 01 Feb 2021 23:08:08 GMT + ms-cv: sTmUo3kaV0KXVzuFhaOF6g.0 + strict-transport-security: max-age=2592000 + x-processing-time: 295ms + status: + code: 204 + message: No Content + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:08:09 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + date: + - Mon, 01 Feb 2021 23:08:23 GMT + ms-cv: + - 6qXDz5fHa0yRI9HIVUTylQ.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 15711ms + status: + code: 204 + message: No Content +version: 1 diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_delete_chat_thread.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_delete_chat_thread.yaml index 306b2f0c72ea..7aed4a167227 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_delete_chat_thread.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_delete_chat_thread.yaml @@ -11,30 +11,30 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:47:28 GMT + - Mon, 01 Feb 2021 23:08:25 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:26 GMT + - Mon, 01 Feb 2021 23:08:24 GMT ms-cv: - - fhyGerZaykiz43C1wQrfKg.0 + - AmpnCZx48EeezdIwB3zhpg.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 206ms + - 20ms status: code: 200 message: OK @@ -52,104 +52,107 @@ interactions: Content-Type: - application/json Date: - - Wed, 02 Dec 2020 23:47:28 GMT + - Mon, 01 Feb 2021 23:08:25 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities/sanitized/token?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2020-12-03T23:47:26.6202219+00:00"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:08:23.5482813+00:00"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:27 GMT + - Mon, 01 Feb 2021 23:08:24 GMT ms-cv: - - c7+GC/LdXkm5C16fJbebnQ.0 + - T5Q0LnhnQ0mohxkku8vP7A.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 283ms + - 99ms status: code: 200 message: OK - request: - body: '{"topic": "test topic", "members": "sanitized"}' + body: '{"topic": "test topic", "participants": "sanitized"}' headers: Accept: - application/json Content-Length: - - '200' + - '205' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - 16c202bb-5dd3-4daf-b26b-b63f9aa04882 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 response: - body: '{"multipleStatus": "sanitized"}' + body: '{"chatThread": {"id": "19:d7OEHcAwW1jzyloZ0VWwSrhuUVhBbQmt_ywPGPE9RLc1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:08:24Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffbc-57cb-1655-373a0d0025c7"}}' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: application/json; charset=utf-8 - date: Wed, 02 Dec 2020 23:47:27 GMT - ms-cv: o3tiOtodrEOKVKshGpP1QA.0 + date: Mon, 01 Feb 2021 23:08:25 GMT + ms-cv: lgrgiV1N4k6IBhGbDZcUlQ.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 177ms + x-processing-time: 1153ms status: - code: 207 - message: Multi-Status - url: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + code: 201 + message: Created + url: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 - date: Wed, 02 Dec 2020 23:47:27 GMT - ms-cv: NkzF0V5ua0GC8deYEIT8WA.0 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + date: Mon, 01 Feb 2021 23:08:25 GMT + ms-cv: kcGpQt5nZUKT0JqV1KNlog.0 strict-transport-security: max-age=2592000 - x-processing-time: 161ms + x-processing-time: 288ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 - date: Wed, 02 Dec 2020 23:47:28 GMT - ms-cv: V87A8A4W2EmEcsoety6PuA.0 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + date: Mon, 01 Feb 2021 23:08:26 GMT + ms-cv: eJfhBClL/0OOCTRfYO+rPQ.0 strict-transport-security: max-age=2592000 - x-processing-time: 83ms + x-processing-time: 259ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 - request: body: null headers: @@ -162,27 +165,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:47:30 GMT + - Mon, 01 Feb 2021 23:08:27 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:47:29 GMT + - Mon, 01 Feb 2021 23:08:42 GMT ms-cv: - - O3f1a1jO9EipDhJSu8jHAQ.0 + - A5I5fzDO+0uC5mmCzYlPSg.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 1006ms + - 16432ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_get_chat_thread.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_get_chat_thread.yaml index 89581c1582a9..80c0f4e673ab 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_get_chat_thread.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_get_chat_thread.yaml @@ -11,30 +11,30 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:47:31 GMT + - Mon, 01 Feb 2021 23:08:43 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:30 GMT + - Mon, 01 Feb 2021 23:08:43 GMT ms-cv: - - 6R4gU+twbkyBcY7nsqsp8w.0 + - N2xJrSbqm0KEwZJcYEFSKw.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 207ms + - 21ms status: code: 200 message: OK @@ -52,106 +52,109 @@ interactions: Content-Type: - application/json Date: - - Wed, 02 Dec 2020 23:47:31 GMT + - Mon, 01 Feb 2021 23:08:44 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities/sanitized/token?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2020-12-03T23:47:29.9669179+00:00"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:08:42.3776314+00:00"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:30 GMT + - Mon, 01 Feb 2021 23:08:43 GMT ms-cv: - - x27mn1NLyk2+f4Fk2OwOVQ.0 + - SauqYXgsqUGA1REpr0qJ/Q.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 274ms + - 106ms status: code: 200 message: OK - request: - body: '{"topic": "test topic", "members": "sanitized"}' + body: '{"topic": "test topic", "participants": "sanitized"}' headers: Accept: - application/json Content-Length: - - '201' + - '206' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - 51e80716-553e-416f-ab88-ca2ae1385f19 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 response: - body: '{"multipleStatus": "sanitized"}' + body: '{"chatThread": {"id": "19:EQXoydWlPLxGgkYqZp4tqWuhxAwLbEnnf2E_h58XqtQ1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:08:44Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffbc-a155-9c58-373a0d002dd8"}}' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: application/json; charset=utf-8 - date: Wed, 02 Dec 2020 23:47:31 GMT - ms-cv: Ky0SiCHD90ytgwrnq0mBeg.0 + date: Mon, 01 Feb 2021 23:08:45 GMT + ms-cv: OVJtV5UbHE2/2zFrj6wpQA.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 279ms + x-processing-time: 1616ms status: - code: 207 - message: Multi-Status - url: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + code: 201 + message: Created + url: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 response: - body: '{"id": "sanitized", "topic": "test topic", "createdOn": "2020-12-02T23:47:31Z", - "createdBy": "sanitized", "members": "sanitized"}' + body: '{"id": "sanitized", "topic": "test topic", "createdOn": "2021-02-01T23:08:44Z", + "createdBy": "sanitized"}' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: application/json; charset=utf-8 - date: Wed, 02 Dec 2020 23:47:31 GMT - ms-cv: /QksQtqV20ClYpZEdwRc7Q.0 + date: Mon, 01 Feb 2021 23:08:45 GMT + ms-cv: WA+vAGOIwUWpGifBnrlzsA.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 67ms + x-processing-time: 257ms status: code: 200 message: OK - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 - date: Wed, 02 Dec 2020 23:47:31 GMT - ms-cv: gmZJhV+trEC1ejQ25JN4dw.0 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + date: Mon, 01 Feb 2021 23:08:46 GMT + ms-cv: jBgMdj97NUePvbeakFOeJg.0 strict-transport-security: max-age=2592000 - x-processing-time: 140ms + x-processing-time: 298ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 - request: body: null headers: @@ -164,27 +167,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:47:33 GMT + - Mon, 01 Feb 2021 23:08:47 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:47:32 GMT + - Mon, 01 Feb 2021 23:09:01 GMT ms-cv: - - m5aAQ69baEm0y2+QI/DRpw.0 + - T9QT5+k0kka/dj9zVpdDiA.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 1084ms + - 15968ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_get_thread_client.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_get_thread_client.yaml index 6d9a8d2845a6..0d5423613171 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_get_thread_client.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_get_thread_client.yaml @@ -11,30 +11,30 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:47:34 GMT + - Mon, 01 Feb 2021 23:09:03 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:33 GMT + - Mon, 01 Feb 2021 23:09:02 GMT ms-cv: - - ZExDC3TnIEGTf6fVcPScQg.0 + - YM8icpnay0K7KP/XVMKYDA.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 213ms + - 70ms status: code: 200 message: OK @@ -52,82 +52,85 @@ interactions: Content-Type: - application/json Date: - - Wed, 02 Dec 2020 23:47:35 GMT + - Mon, 01 Feb 2021 23:09:03 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities/sanitized/token?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2020-12-03T23:47:33.1685786+00:00"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:09:01.7993412+00:00"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:33 GMT + - Mon, 01 Feb 2021 23:09:02 GMT ms-cv: - - /+UR2bHAJUyDqqri1UcWoQ.0 + - AsBe+PS7pkSntXxIXRC3dw.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 281ms + - 102ms status: code: 200 message: OK - request: - body: '{"topic": "test topic", "members": "sanitized"}' + body: '{"topic": "test topic", "participants": "sanitized"}' headers: Accept: - application/json Content-Length: - - '201' + - '203' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - 94e5888e-3f56-4368-ab96-048141497269 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 response: - body: '{"multipleStatus": "sanitized"}' + body: '{"chatThread": {"id": "19:Sk-2ikAf1aYAs5MIdC2t_ErQdkR5_lMEEca7q57mY4s1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:09:03Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffbc-ed34-1655-373a0d0025c8"}}' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: application/json; charset=utf-8 - date: Wed, 02 Dec 2020 23:47:33 GMT - ms-cv: NIGCXoZoCUu/aozrXfQgaA.0 + date: Mon, 01 Feb 2021 23:09:03 GMT + ms-cv: EdWDWRBkg0mOtjPozclZOA.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 349ms + x-processing-time: 1101ms status: - code: 207 - message: Multi-Status - url: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + code: 201 + message: Created + url: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 - date: Wed, 02 Dec 2020 23:47:34 GMT - ms-cv: cKlqBBe6XkSO60+WvuyrMg.0 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + date: Mon, 01 Feb 2021 23:09:04 GMT + ms-cv: AtFPBYlxXUuxBgHl/KzW0w.0 strict-transport-security: max-age=2592000 - x-processing-time: 167ms + x-processing-time: 298ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 - request: body: null headers: @@ -140,27 +143,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:47:36 GMT + - Mon, 01 Feb 2021 23:09:05 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:47:36 GMT + - Mon, 01 Feb 2021 23:09:20 GMT ms-cv: - - S/5JtwWLa02aUFmSk3Fp4Q.0 + - 4bLlDL2gOEy1RxPNZZQJFA.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 1237ms + - 16561ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_list_chat_threads.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_list_chat_threads.yaml index e8d3ed70cd4c..46a1988cb526 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_list_chat_threads.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_client_e2e_async.test_list_chat_threads.yaml @@ -11,30 +11,30 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:47:37 GMT + - Mon, 01 Feb 2021 23:09:22 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:36 GMT + - Mon, 01 Feb 2021 23:09:20 GMT ms-cv: - - qOanpWQSTUONn9sl7m00cw.0 + - 2ytELSchtUOns4PQf5VYpg.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 221ms + - 24ms status: code: 200 message: OK @@ -52,105 +52,108 @@ interactions: Content-Type: - application/json Date: - - Wed, 02 Dec 2020 23:47:38 GMT + - Mon, 01 Feb 2021 23:09:22 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities/sanitized/token?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2020-12-03T23:47:36.5603341+00:00"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:09:20.4937887+00:00"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:36 GMT + - Mon, 01 Feb 2021 23:09:20 GMT ms-cv: - - 3L7EM7UHeEimdupefnGSnw.0 + - 2+VKkuNu7ECuTx736cL1mg.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 287ms + - 93ms status: code: 200 message: OK - request: - body: '{"topic": "test topic", "members": "sanitized"}' + body: '{"topic": "test topic", "participants": "sanitized"}' headers: Accept: - application/json Content-Length: - - '201' + - '206' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - 6476c094-a85d-48b1-abbf-698215352a79 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 response: - body: '{"multipleStatus": "sanitized"}' + body: '{"chatThread": {"id": "19:BRQy_EyPZ9vT_-b0HaF9oeQBo3yzuo8CzWuAfziqakU1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:09:22Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffbd-3640-1655-373a0d0025cb"}}' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: application/json; charset=utf-8 - date: Wed, 02 Dec 2020 23:47:37 GMT - ms-cv: tQcin5ycYE6yPjW5vdPqXg.0 + date: Mon, 01 Feb 2021 23:09:22 GMT + ms-cv: Ckm0ytRMXEmyDhevDxPr3Q.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 188ms + x-processing-time: 1296ms status: - code: 207 - message: Multi-Status - url: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + code: 201 + message: Created + url: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads?maxPageSize=1&api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads?maxPageSize=1&api-version=2020-11-01-preview3 response: body: '{"value": "sanitized"}' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: application/json; charset=utf-8 - date: Wed, 02 Dec 2020 23:47:39 GMT - ms-cv: XF6pilSaCkWx437Td0gmjQ.0 + date: Mon, 01 Feb 2021 23:09:24 GMT + ms-cv: zE0P4+XPxkCOPdXe7HaI2w.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 120ms + x-processing-time: 327ms status: code: 200 message: OK - url: https://sanitized.communication.azure.com/chat/threads?maxPageSize=1&api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads?maxPageSize=1&api-version=2020-11-01-preview3 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 - date: Wed, 02 Dec 2020 23:47:39 GMT - ms-cv: 3rfDKCV2x0GKUdOYfcSPNw.0 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + date: Mon, 01 Feb 2021 23:09:24 GMT + ms-cv: IEQc0iCyH0O6clHor+VS2A.0 strict-transport-security: max-age=2592000 - x-processing-time: 198ms + x-processing-time: 293ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 - request: body: null headers: @@ -163,27 +166,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:47:41 GMT + - Mon, 01 Feb 2021 23:09:26 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:47:40 GMT + - Mon, 01 Feb 2021 23:09:41 GMT ms-cv: - - vymdAQrEHUuXVyrWXx6l2Q.0 + - 5tsI71dnaUim68qiB9QwjQ.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 1026ms + - 16117ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_add_participant.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_add_participant.yaml new file mode 100644 index 000000000000..11cd2528dab9 --- /dev/null +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_add_participant.yaml @@ -0,0 +1,343 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:09:42 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:09:42 GMT + ms-cv: + - 2c7RaiilYEKo/QBxlOa6/A.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 85ms + status: + code: 200 + message: OK +- request: + body: '{"scopes": ["chat"]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '20' + Content-Type: + - application/json + Date: + - Mon, 01 Feb 2021 23:09:43 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:09:41.4212749+00:00"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:09:42 GMT + ms-cv: + - 1havVHtCV0yHbpuESV588Q.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 99ms + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:09:43 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:09:42 GMT + ms-cv: + - /M2sVMEVAUWnORXdkKQOXw.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 18ms + status: + code: 200 + message: OK +- request: + body: '{"scopes": ["chat"]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '20' + Content-Type: + - application/json + Date: + - Mon, 01 Feb 2021 23:09:43 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:09:41.6322038+00:00"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:09:42 GMT + ms-cv: + - KTOc0xa2fkGcuoYlBMXEvA.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 87ms + status: + code: 200 + message: OK +- request: + body: '{"topic": "test topic", "participants": "sanitized"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '206' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - 7e90ce67-21ed-42cc-bf70-003c2085c634 + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 + response: + body: '{"chatThread": {"id": "19:_WtuTI_rGzHlkgbImP27Kb8Uab-pnuHZgheUB-bv5lc1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:09:43Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffbd-87fb-b0b7-3a3a0d002fc8"}}' + headers: + api-supported-versions: + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:09:42 GMT + ms-cv: + - aW7nLTKynEm/mwhkshfxpA.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 843ms + status: + code: 201 + message: Created +- request: + body: '{"participants": "sanitized"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '183' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/participants/:add?api-version=2020-11-01-preview3 + response: + body: '{}' + headers: + api-supported-versions: + - 2020-11-01-preview3, 2021-01-27-preview4 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:09:44 GMT + ms-cv: + - b/eV8VUWJUWJQ7AbCfiYPQ.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 947ms + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:09:45 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + date: + - Mon, 01 Feb 2021 23:10:01 GMT + ms-cv: + - 9DcGZ6EiiUW1Zpm/1eVRsw.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 17040ms + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:10:02 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + date: + - Mon, 01 Feb 2021 23:10:17 GMT + ms-cv: + - Lz9BP2/4P02Ec0l+GwE0Ow.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 16112ms + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + date: + - Mon, 01 Feb 2021 23:10:18 GMT + ms-cv: + - rgDG1g19qU6WrLCSOHrZ/g.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 340ms + status: + code: 204 + message: No Content +version: 1 diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_add_participants.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_add_participants.yaml new file mode 100644 index 000000000000..2ff85ba3988c --- /dev/null +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_add_participants.yaml @@ -0,0 +1,343 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:10:19 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:10:18 GMT + ms-cv: + - vnzmRKwuUUu1xgU9C2ezJQ.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 132ms + status: + code: 200 + message: OK +- request: + body: '{"scopes": ["chat"]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '20' + Content-Type: + - application/json + Date: + - Mon, 01 Feb 2021 23:10:20 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:10:18.2618513+00:00"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:10:18 GMT + ms-cv: + - Fe4oLYvJCkm5Ee1bjG/Bwg.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 98ms + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:10:20 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:10:18 GMT + ms-cv: + - /FONHcKKiE2oHcBiUWbxsg.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 50ms + status: + code: 200 + message: OK +- request: + body: '{"scopes": ["chat"]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '20' + Content-Type: + - application/json + Date: + - Mon, 01 Feb 2021 23:10:20 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:10:18.5020576+00:00"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:10:18 GMT + ms-cv: + - AcDUKjvclE2JBfuYphiGaQ.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 101ms + status: + code: 200 + message: OK +- request: + body: '{"topic": "test topic", "participants": "sanitized"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '206' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - 14285cb5-b1f8-4bad-ad13-0891f94d4aea + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 + response: + body: '{"chatThread": {"id": "19:n3cu_jYMVs8O4UZUxccMnQLv0W0E7M-JSHy8a4EmPqU1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:10:19Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffbe-17e9-1db7-3a3a0d002bab"}}' + headers: + api-supported-versions: + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:10:20 GMT + ms-cv: + - uZB4rB4UW0GUpZR04jf0dg.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 859ms + status: + code: 201 + message: Created +- request: + body: '{"participants": "sanitized"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '183' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/participants/:add?api-version=2020-11-01-preview3 + response: + body: '{}' + headers: + api-supported-versions: + - 2020-11-01-preview3, 2021-01-27-preview4 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:10:20 GMT + ms-cv: + - gc3qX2jTCk6ZMnH3AbdYHA.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 401ms + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:10:21 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + date: + - Mon, 01 Feb 2021 23:10:38 GMT + ms-cv: + - T3lD6L81kEO42dkUQwlsiQ.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 17069ms + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:10:39 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + date: + - Mon, 01 Feb 2021 23:10:53 GMT + ms-cv: + - cEBOvK1OT0Wm2DQoII6g8g.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 15783ms + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + date: + - Mon, 01 Feb 2021 23:10:53 GMT + ms-cv: + - t2qznUOa5km2Fzbh1vp9EA.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 309ms + status: + code: 204 + message: No Content +version: 1 diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_delete_message.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_delete_message.yaml index 9bac64957ad4..fe14a30d334c 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_delete_message.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_delete_message.yaml @@ -11,30 +11,30 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:47:49 GMT + - Mon, 01 Feb 2021 23:10:55 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:47 GMT + - Mon, 01 Feb 2021 23:10:54 GMT ms-cv: - - 8oKQj4k/jkawyR9Os9ofQQ.0 + - Y5yKxdi/pEWTDIC1tIcd1A.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 205ms + - 20ms status: code: 200 message: OK @@ -52,30 +52,30 @@ interactions: Content-Type: - application/json Date: - - Wed, 02 Dec 2020 23:47:49 GMT + - Mon, 01 Feb 2021 23:10:55 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities/sanitized/token?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2020-12-03T23:47:47.7821291+00:00"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:10:53.6424333+00:00"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:48 GMT + - Mon, 01 Feb 2021 23:10:54 GMT ms-cv: - - afP0kPL660CVSrzdVWsfWg.0 + - N96mc7wlvkOqhmk40buU9g.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 276ms + - 94ms status: code: 200 message: OK @@ -91,35 +91,35 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:47:50 GMT + - Mon, 01 Feb 2021 23:10:55 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:48 GMT + - Mon, 01 Feb 2021 23:10:54 GMT ms-cv: - - LBslmmhJlEagI0SPnWx0Fg.0 + - G0rrJaH1hEaiBCtU03c0cA.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 206ms + - 24ms status: code: 200 message: OK - request: - body: '{"topic": "test topic", "members": "sanitized"}' + body: '{"scopes": ["chat"]}' headers: Accept: - application/json @@ -128,36 +128,80 @@ interactions: Connection: - keep-alive Content-Length: - - '201' + - '20' Content-Type: - application/json + Date: + - Mon, 01 Feb 2021 23:10:55 GMT User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"multipleStatus": "sanitized"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:10:53.869524+00:00"}' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:49 GMT + - Mon, 01 Feb 2021 23:10:54 GMT ms-cv: - - xdLGTdiTGEKeYkNbzsP3Rw.0 + - Ls8LRrez3kOUSj8ID/Bjjg.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 274ms + - 93ms status: - code: 207 - message: Multi-Status + code: 200 + message: OK +- request: + body: '{"topic": "test topic", "participants": "sanitized"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '205' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - c2bdbe6c-1c1f-4643-82d2-9dc9ecdf9e70 + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 + response: + body: '{"chatThread": {"id": "19:CQMbb5qBbsYoqTG4zXgK40nGmD3XxvbtL8kE1IJc0oM1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:10:55Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffbe-a225-1655-373a0d0025d2"}}' + headers: + api-supported-versions: + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:10:55 GMT + ms-cv: + - 1A3OuOir9Uix9v+YFAycdA.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 832ms + status: + code: 201 + message: Created - request: - body: '{"priority": "Normal", "content": "hello world", "senderDisplayName": "sender - name"}' + body: '{"content": "hello world", "senderDisplayName": "sender name", "type": + "text"}' headers: Accept: - application/json @@ -166,30 +210,30 @@ interactions: Connection: - keep-alive Content-Length: - - '84' + - '78' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?api-version=2020-11-01-preview3 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:50 GMT + - Mon, 01 Feb 2021 23:10:56 GMT ms-cv: - - GV5O22CtHkSTYlObkXKwdg.0 + - CDgQSn5I2ECFyxmOTxQs1w.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 257ms + - 370ms status: code: 201 message: Created @@ -205,23 +249,23 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 date: - - Wed, 02 Dec 2020 23:47:50 GMT + - Mon, 01 Feb 2021 23:10:56 GMT ms-cv: - - 5SfIxLjjwECfVLKSS66aLg.0 + - xbXo/aeDukOL02oLhahF0g.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 163ms + - 420ms status: code: 204 message: No Content @@ -237,27 +281,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:47:52 GMT + - Mon, 01 Feb 2021 23:10:57 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:47:51 GMT + - Mon, 01 Feb 2021 23:11:12 GMT ms-cv: - - +BxolgU4sEOsK9DmY6AsWg.0 + - CBsVjaIEnU2H6p8B4eDqWA.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 1243ms + - 16445ms status: code: 204 message: No Content @@ -273,27 +317,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:47:53 GMT + - Mon, 01 Feb 2021 23:11:14 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:47:52 GMT + - Mon, 01 Feb 2021 23:11:28 GMT ms-cv: - - /M2pQM5rK0eCi7+UTwVRRA.0 + - eoZnGb1h0USW14/XPmmdNA.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 901ms + - 15983ms status: code: 204 message: No Content @@ -309,23 +353,23 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 date: - - Wed, 02 Dec 2020 23:47:52 GMT + - Mon, 01 Feb 2021 23:11:29 GMT ms-cv: - - 19EqY/+7E0uxsDCqsU9zmw.0 + - iq/zfgeleUa5YgulN7LQWg.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 142ms + - 331ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_get_message.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_get_message.yaml index a81e92321761..eb451dc038aa 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_get_message.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_get_message.yaml @@ -11,30 +11,30 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:47:55 GMT + - Mon, 01 Feb 2021 23:11:30 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:53 GMT + - Mon, 01 Feb 2021 23:11:29 GMT ms-cv: - - fbjmYcKW60ubTWnJTQr0Nw.0 + - lZuK0EZcm0Wwy5U0VdV7Sw.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 206ms + - 22ms status: code: 200 message: OK @@ -52,30 +52,30 @@ interactions: Content-Type: - application/json Date: - - Wed, 02 Dec 2020 23:47:55 GMT + - Mon, 01 Feb 2021 23:11:31 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities/sanitized/token?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2020-12-03T23:47:53.5773001+00:00"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:11:29.2886281+00:00"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:53 GMT + - Mon, 01 Feb 2021 23:11:29 GMT ms-cv: - - XzuuhI3Hlk+cHol4v8bq+Q.0 + - 6NkyAQX4uUew4rCbVgZFPw.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 282ms + - 91ms status: code: 200 message: OK @@ -91,35 +91,35 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:47:55 GMT + - Mon, 01 Feb 2021 23:11:31 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:54 GMT + - Mon, 01 Feb 2021 23:11:29 GMT ms-cv: - - D7nTc9qn2ESonYAn7j3xZg.0 + - zhnlFrwTK0uTglkFRWdGTQ.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 207ms + - 18ms status: code: 200 message: OK - request: - body: '{"topic": "test topic", "members": "sanitized"}' + body: '{"scopes": ["chat"]}' headers: Accept: - application/json @@ -128,36 +128,80 @@ interactions: Connection: - keep-alive Content-Length: - - '201' + - '20' Content-Type: - application/json + Date: + - Mon, 01 Feb 2021 23:11:31 GMT User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"multipleStatus": "sanitized"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:11:29.4909482+00:00"}' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:55 GMT + - Mon, 01 Feb 2021 23:11:29 GMT ms-cv: - - OW+DOIdcc0eudoz5uQ/EAg.0 + - e+z0oVH/HUORsypwrRor1g.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 288ms + - 94ms status: - code: 207 - message: Multi-Status + code: 200 + message: OK +- request: + body: '{"topic": "test topic", "participants": "sanitized"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '205' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - 830a9723-1096-457b-9f39-d010d9f63ea3 + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 + response: + body: '{"chatThread": {"id": "19:ahNeeGqZrXgnPY919SOdVpRk0s5o8Ry7ko7igr6YGVk1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:11:30Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffbf-2d5f-1655-373a0d0025d6"}}' + headers: + api-supported-versions: + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:11:30 GMT + ms-cv: + - P43c9Lc7tEeOLnAY8G+3mg.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 857ms + status: + code: 201 + message: Created - request: - body: '{"priority": "Normal", "content": "hello world", "senderDisplayName": "sender - name"}' + body: '{"content": "hello world", "senderDisplayName": "sender name", "type": + "text"}' headers: Accept: - application/json @@ -166,30 +210,30 @@ interactions: Connection: - keep-alive Content-Length: - - '84' + - '78' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?api-version=2020-11-01-preview3 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:55 GMT + - Mon, 01 Feb 2021 23:11:31 GMT ms-cv: - - 09MM/wSUmE6L0YD7HVwjfg.0 + - Np4p+Sh6Z0iUMg49MZ5h+w.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 293ms + - 376ms status: code: 201 message: Created @@ -203,28 +247,28 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages/sanitized?api-version=2020-11-01-preview3 response: - body: '{"id": "sanitized", "type": "Text", "priority": "Normal", "version": "1606952876147", - "content": "hello world", "senderDisplayName": "sender name", "createdOn": "2020-12-02T23:47:56Z", - "senderId": "sanitized"}' + body: '{"id": "sanitized", "type": "text", "sequenceId": "3", "version": "1612221091980", + "content": {"message": "hello world"}, "senderDisplayName": "sender name", "createdOn": + "2021-02-01T23:11:31Z", "senderId": "sanitized"}' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:47:55 GMT + - Mon, 01 Feb 2021 23:11:32 GMT ms-cv: - - ul+EwLJcrUKGYDVIkJPN6A.0 + - 7h18nFkBjUGxMSdJls5/yA.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 54ms + - 261ms status: code: 200 message: OK @@ -240,27 +284,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:47:57 GMT + - Mon, 01 Feb 2021 23:11:33 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:47:56 GMT + - Mon, 01 Feb 2021 23:11:49 GMT ms-cv: - - mmIpuZUqqkef3QRYHivU0A.0 + - BG9bH+KKnUKVYv606zg7lw.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 578ms + - 16675ms status: code: 204 message: No Content @@ -276,27 +320,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:47:58 GMT + - Mon, 01 Feb 2021 23:11:50 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:47:57 GMT + - Mon, 01 Feb 2021 23:12:05 GMT ms-cv: - - 8IzCnBcfDkeQ+vu1RA+arQ.0 + - PtxnGmASLE29V1z+TTQKIQ.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 608ms + - 16754ms status: code: 204 message: No Content @@ -312,23 +356,23 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 date: - - Wed, 02 Dec 2020 23:47:57 GMT + - Mon, 01 Feb 2021 23:12:06 GMT ms-cv: - - DeNIfD+tokmIsLmG4d3HaA.0 + - ujHEeveqfUSyStNeUhdt2g.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 152ms + - 291ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_list_messages.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_list_messages.yaml index d26f14361101..15297c7be324 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_list_messages.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_list_messages.yaml @@ -11,30 +11,30 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:48:06 GMT + - Mon, 01 Feb 2021 23:12:07 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:04 GMT + - Mon, 01 Feb 2021 23:12:06 GMT ms-cv: - - nLvuwJyzCEqOmRlRVwPieQ.0 + - Sj7h3LbAl0i9hyvAE6L6RA.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 209ms + - 56ms status: code: 200 message: OK @@ -52,30 +52,30 @@ interactions: Content-Type: - application/json Date: - - Wed, 02 Dec 2020 23:48:06 GMT + - Mon, 01 Feb 2021 23:12:07 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities/sanitized/token?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2020-12-03T23:48:04.9878314+00:00"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:12:05.9542699+00:00"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:05 GMT + - Mon, 01 Feb 2021 23:12:06 GMT ms-cv: - - EJmBjwtQCkC5FORYgjvp2Q.0 + - K235FSgb1kidl5278N5ziw.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 288ms + - 96ms status: code: 200 message: OK @@ -91,35 +91,35 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:48:07 GMT + - Mon, 01 Feb 2021 23:12:07 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:05 GMT + - Mon, 01 Feb 2021 23:12:06 GMT ms-cv: - - yV4WHAECv0iFswyl9dvHvw.0 + - w2/fYfVxi0mPbtHuAWLq7A.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 204ms + - 21ms status: code: 200 message: OK - request: - body: '{"topic": "test topic", "members": "sanitized"}' + body: '{"scopes": ["chat"]}' headers: Accept: - application/json @@ -128,36 +128,80 @@ interactions: Connection: - keep-alive Content-Length: - - '200' + - '20' Content-Type: - application/json + Date: + - Mon, 01 Feb 2021 23:12:07 GMT User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"multipleStatus": "sanitized"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:12:06.153305+00:00"}' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:06 GMT + - Mon, 01 Feb 2021 23:12:06 GMT ms-cv: - - yeWjKKKUqEiUzs/q2TaxyQ.0 + - CLtEXxBHgkyvn1tnNFijoA.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 295ms + - 90ms status: - code: 207 - message: Multi-Status + code: 200 + message: OK +- request: + body: '{"topic": "test topic", "participants": "sanitized"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '206' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - 15be76a1-7003-4647-a1fc-cc05d462a289 + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 + response: + body: '{"chatThread": {"id": "19:QiwZiY15O_F3chKHC9waSQP57ESVljAUkKeEW-yoQx41@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:12:07Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffbf-bc7b-b0b7-3a3a0d002fd1"}}' + headers: + api-supported-versions: + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:12:07 GMT + ms-cv: + - jsCsMRBiPkiHEwSVHT+osA.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 836ms + status: + code: 201 + message: Created - request: - body: '{"priority": "Normal", "content": "hello world", "senderDisplayName": "sender - name"}' + body: '{"content": "hello world", "senderDisplayName": "sender name", "type": + "text"}' headers: Accept: - application/json @@ -166,30 +210,30 @@ interactions: Connection: - keep-alive Content-Length: - - '84' + - '78' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?api-version=2020-11-01-preview3 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:07 GMT + - Mon, 01 Feb 2021 23:12:08 GMT ms-cv: - - g+U1IMtfwkmfdkcJ/dLXeQ.0 + - d7I+ZkOHlkS5dLbp580JqQ.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 135ms + - 837ms status: code: 201 message: Created @@ -203,26 +247,26 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?maxPageSize=1&api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?maxPageSize=1&api-version=2020-11-01-preview3 response: body: '{"value": "sanitized", "nextLink": "sanitized"}' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:09 GMT + - Mon, 01 Feb 2021 23:12:09 GMT ms-cv: - - 7U27XzEbKkudPC4UTOnGZQ.0 + - c0gVf1/fTEya3/2+70xxkQ.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 75ms + - 289ms status: code: 200 message: OK @@ -236,26 +280,26 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?syncState=sanitized&startTime=1%2F1%2F1970%2012%3A00%3A00%20AM%20%2B00%3A00&maxPageSize=1&api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?syncState=sanitized&startTime=1%2F1%2F1970%2012%3A00%3A00%20AM%20%2B00%3A00&maxPageSize=1&api-version=2020-11-01-preview3 response: body: '{"value": "sanitized", "nextLink": "sanitized"}' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:09 GMT + - Mon, 01 Feb 2021 23:12:09 GMT ms-cv: - - HY0zsn1BukaCd/q94HOnOg.0 + - vNK5whUAeUmf4w+/X8el2A.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 113ms + - 364ms status: code: 200 message: OK @@ -269,26 +313,26 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?syncState=sanitized&startTime=1%2F1%2F1970%2012%3A00%3A00%20AM%20%2B00%3A00&maxPageSize=1&api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?syncState=sanitized&startTime=1%2F1%2F1970%2012%3A00%3A00%20AM%20%2B00%3A00&maxPageSize=1&api-version=2020-11-01-preview3 response: body: '{"value": "sanitized", "nextLink": "sanitized"}' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:09 GMT + - Mon, 01 Feb 2021 23:12:09 GMT ms-cv: - - TDtUAjvK1kSNW2ivKJMnMQ.0 + - tF3JqAjl+kSWPNp3V0MwPQ.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 131ms + - 365ms status: code: 200 message: OK @@ -302,26 +346,26 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?syncState=sanitized&startTime=1%2F1%2F1970%2012%3A00%3A00%20AM%20%2B00%3A00&maxPageSize=1&api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?syncState=sanitized&startTime=1%2F1%2F1970%2012%3A00%3A00%20AM%20%2B00%3A00&maxPageSize=1&api-version=2020-11-01-preview3 response: body: '{"value": "sanitized"}' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:10 GMT + - Mon, 01 Feb 2021 23:12:10 GMT ms-cv: - - LbLy869FFEaMO5P9v3zGLQ.0 + - p9xt/RFcfE+scTMdUQInhA.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 115ms + - 359ms status: code: 200 message: OK @@ -337,27 +381,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:48:11 GMT + - Mon, 01 Feb 2021 23:12:11 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:48:11 GMT + - Mon, 01 Feb 2021 23:12:26 GMT ms-cv: - - GCpgfk1N6USYYyU0gz1PqA.0 + - qlR3Xdmn5Uekc2Jr1WkZVg.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 1207ms + - 16116ms status: code: 204 message: No Content @@ -373,27 +417,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:48:13 GMT + - Mon, 01 Feb 2021 23:12:27 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:48:12 GMT + - Mon, 01 Feb 2021 23:12:42 GMT ms-cv: - - nHhfvU1fn0GDB9OdzjYF5g.0 + - vk/5JNIo7UmqX8dnj969ng.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 575ms + - 15951ms status: code: 204 message: No Content @@ -409,23 +453,23 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 date: - - Wed, 02 Dec 2020 23:48:11 GMT + - Mon, 01 Feb 2021 23:12:43 GMT ms-cv: - - T6RB/qatYU26z+k74U9fsw.0 + - BiUEsvuFh0G9dHU3dkZv7w.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 145ms + - 291ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_list_participants.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_list_participants.yaml new file mode 100644 index 000000000000..4c25a1c4bfc2 --- /dev/null +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_list_participants.yaml @@ -0,0 +1,376 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:12:44 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:12:42 GMT + ms-cv: + - kIbPaGMRjkmQka1S4ARAUw.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 18ms + status: + code: 200 + message: OK +- request: + body: '{"scopes": ["chat"]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '20' + Content-Type: + - application/json + Date: + - Mon, 01 Feb 2021 23:12:44 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:12:42.7369269+00:00"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:12:42 GMT + ms-cv: + - i8Cy1HDlcECm+g75iVPGrg.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 90ms + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:12:44 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:12:43 GMT + ms-cv: + - 50WUMurQfUG8dsRwwthCFw.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 16ms + status: + code: 200 + message: OK +- request: + body: '{"scopes": ["chat"]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '20' + Content-Type: + - application/json + Date: + - Mon, 01 Feb 2021 23:12:44 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:12:42.9313819+00:00"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:12:43 GMT + ms-cv: + - hDlObaBR30SimCm+AhSwTg.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 91ms + status: + code: 200 + message: OK +- request: + body: '{"topic": "test topic", "participants": "sanitized"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '206' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - 7b0b36b3-3d23-4101-a02c-6a053a88b3d7 + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 + response: + body: '{"chatThread": {"id": "19:PvBn6mixYhQtG3hwCn7KwxcVy1X5r-28IHnpnh-nbdI1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:12:44Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffc0-4c3c-1655-373a0d0025d9"}}' + headers: + api-supported-versions: + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:12:44 GMT + ms-cv: + - SMzZYWyKtkOfdw2y8m9RXg.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 834ms + status: + code: 201 + message: Created +- request: + body: '{"participants": "sanitized"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '183' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/participants/:add?api-version=2020-11-01-preview3 + response: + body: '{}' + headers: + api-supported-versions: + - 2020-11-01-preview3, 2021-01-27-preview4 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:12:45 GMT + ms-cv: + - gUsyB6vyQkCaNrJIUn0rtQ.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 943ms + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/participants?maxPageSize=1&skip=1&api-version=2020-11-01-preview3 + response: + body: '{"value": "sanitized"}' + headers: + api-supported-versions: + - 2020-11-01-preview3, 2021-01-27-preview4 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:12:45 GMT + ms-cv: + - t55a2NIJUkmUufTeg5kiDw.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 269ms + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:12:47 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + date: + - Mon, 01 Feb 2021 23:13:03 GMT + ms-cv: + - APzhq35/xEe6tGdAjTFtzw.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 16705ms + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:13:04 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + date: + - Mon, 01 Feb 2021 23:13:19 GMT + ms-cv: + - 0y4kz4W45kqOIc0iDXED/w.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 16310ms + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + date: + - Mon, 01 Feb 2021 23:13:19 GMT + ms-cv: + - c4S5WfoS6U2LnxE7igMe/w.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 335ms + status: + code: 204 + message: No Content +version: 1 diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_list_read_receipts.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_list_read_receipts.yaml index d3106a1c6c1a..3fb3bb1c4a20 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_list_read_receipts.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_list_read_receipts.yaml @@ -11,30 +11,30 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:48:14 GMT + - Mon, 01 Feb 2021 23:13:20 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:13 GMT + - Mon, 01 Feb 2021 23:13:20 GMT ms-cv: - - UXFUbFpZ3Euhv6Wzs2SuOw.0 + - n0qQns0Hsk+5aIGutsAdxg.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 211ms + - 32ms status: code: 200 message: OK @@ -52,30 +52,30 @@ interactions: Content-Type: - application/json Date: - - Wed, 02 Dec 2020 23:48:14 GMT + - Mon, 01 Feb 2021 23:13:21 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities/sanitized/token?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2020-12-03T23:48:12.725889+00:00"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:13:19.501485+00:00"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:13 GMT + - Mon, 01 Feb 2021 23:13:20 GMT ms-cv: - - pgJuov9s8ECXEy34ytY0aA.0 + - jZvlWXnZR0iUs4jC/0/vnQ.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 279ms + - 262ms status: code: 200 message: OK @@ -91,35 +91,35 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:48:15 GMT + - Mon, 01 Feb 2021 23:13:21 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:13 GMT + - Mon, 01 Feb 2021 23:13:20 GMT ms-cv: - - VEZKAlxdbESfJ3Y0AcG68w.0 + - 6XqwUaeyhkS76K9l5V3Ylg.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 213ms + - 49ms status: code: 200 message: OK - request: - body: '{"topic": "test topic", "members": "sanitized"}' + body: '{"scopes": ["chat"]}' headers: Accept: - application/json @@ -128,36 +128,187 @@ interactions: Connection: - keep-alive Content-Length: - - '201' + - '20' Content-Type: - application/json + Date: + - Mon, 01 Feb 2021 23:13:21 GMT User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:13:19.7825279+00:00"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:13:20 GMT + ms-cv: + - Igp/5UmZjEi/byP4MnXjZA.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 110ms + status: + code: 200 + message: OK +- request: + body: '{"topic": "test topic", "participants": "sanitized"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '371' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - 25ee9edf-3c7c-45ec-bf01-65eaed8b9fbb + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 + response: + body: '{"chatThread": {"id": "19:OPtWDy6R6cNXXozGaPaBAVysKRxa6er8SZ2o6lOTEIw1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:13:21Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffc0-db3c-b0b7-3a3a0d002fd5"}}' + headers: + api-supported-versions: + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:13:21 GMT + ms-cv: + - 1OkOyIraVkmYNurO83SfGw.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 850ms + status: + code: 201 + message: Created +- request: + body: '{"content": "hello world", "senderDisplayName": "sender name", "type": + "text"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '78' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?api-version=2020-11-01-preview3 + response: + body: '{"id": "sanitized"}' + headers: + api-supported-versions: + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:13:21 GMT + ms-cv: + - bYxpzFv6N0KkUdUjZdVlCg.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 373ms + status: + code: 201 + message: Created +- request: + body: '{"chatMessageId": "sanitized"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '34' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/readReceipts?api-version=2020-11-01-preview3 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-length: + - '0' + date: + - Mon, 01 Feb 2021 23:13:22 GMT + ms-cv: + - T6MjZ2ekxEinUStlOzfaXg.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 898ms + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/readReceipts?api-version=2020-11-01-preview3 response: - body: '{"multipleStatus": "sanitized"}' + body: '{"value": "sanitized"}' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:13 GMT + - Mon, 01 Feb 2021 23:13:23 GMT ms-cv: - - kTQSGcUDw0iG13E7iuesgw.0 + - opHZex5MWESNjsY80GUijg.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 173ms + - 260ms status: - code: 207 - message: Multi-Status + code: 200 + message: OK - request: - body: '{"priority": "Normal", "content": "hello world", "senderDisplayName": "sender - name"}' + body: '{"content": "hello world", "senderDisplayName": "sender name", "type": + "text"}' headers: Accept: - application/json @@ -166,30 +317,30 @@ interactions: Connection: - keep-alive Content-Length: - - '84' + - '78' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?api-version=2020-11-01-preview3 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:14 GMT + - Mon, 01 Feb 2021 23:13:23 GMT ms-cv: - - M6UhXnur/EWHApSoq9UlAw.0 + - yqZuC3B260GKgRFW7OaWfA.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 242ms + - 384ms status: code: 201 message: Created @@ -207,28 +358,168 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readreceipts?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/readReceipts?api-version=2020-11-01-preview3 response: body: string: '' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-length: - '0' date: - - Wed, 02 Dec 2020 23:48:14 GMT + - Mon, 01 Feb 2021 23:13:23 GMT ms-cv: - - 4okukMqotEyFs2DnI3j6xg.0 + - gXjY7VV/8kmcPf0nJ8mVWg.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 143ms + - 498ms + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/readReceipts?api-version=2020-11-01-preview3 + response: + body: '{"value": "sanitized"}' + headers: + api-supported-versions: + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:13:25 GMT + ms-cv: + - 9K0uoDIxJE2fdvj7B03SIw.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 694ms + status: + code: 200 + message: OK +- request: + body: '{"content": "content", "senderDisplayName": "sender_display_name", "type": + "text"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '82' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?api-version=2020-11-01-preview3 + response: + body: '{"id": "sanitized"}' + headers: + api-supported-versions: + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:13:25 GMT + ms-cv: + - LwIYTspikEiHp9s/opWxYg.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 368ms status: code: 201 message: Created +- request: + body: '{"chatMessageId": "sanitized"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '34' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/readReceipts?api-version=2020-11-01-preview3 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-length: + - '0' + date: + - Mon, 01 Feb 2021 23:13:25 GMT + ms-cv: + - 1Zh447p3CEmKerITJM7JbA.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 474ms + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/readReceipts?api-version=2020-11-01-preview3 + response: + body: '{"value": "sanitized"}' + headers: + api-supported-versions: + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:13:26 GMT + ms-cv: + - Cwy2WeHt4EK+saImRu94aA.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 249ms + status: + code: 200 + message: OK - request: body: null headers: @@ -239,26 +530,26 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readreceipts?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/readReceipts?maxPageSize=2&skip=0&api-version=2020-11-01-preview3 response: body: '{"value": "sanitized"}' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:16 GMT + - Mon, 01 Feb 2021 23:13:26 GMT ms-cv: - - GLlZDghW0UWaWEVlLLqDLQ.0 + - i4qQAKxMvkGrCKeSzyI0Pw.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 53ms + - 261ms status: code: 200 message: OK @@ -274,27 +565,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:48:19 GMT + - Mon, 01 Feb 2021 23:13:28 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:48:18 GMT + - Mon, 01 Feb 2021 23:13:43 GMT ms-cv: - - DIZ569QpIUaOw7qNLl09ow.0 + - seA/Ib8X5EOcHNn4mUD/xw.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 784ms + - 16722ms status: code: 204 message: No Content @@ -310,27 +601,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:48:19 GMT + - Mon, 01 Feb 2021 23:13:45 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:48:19 GMT + - Mon, 01 Feb 2021 23:13:59 GMT ms-cv: - - TJcqiD+FFEmexjNdwAhT6A.0 + - eg5Zna69MUelcOMGYB9PoA.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 753ms + - 15933ms status: code: 204 message: No Content @@ -346,23 +637,23 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 date: - - Wed, 02 Dec 2020 23:48:18 GMT + - Mon, 01 Feb 2021 23:14:00 GMT ms-cv: - - FZsaFCyAQ0CMQT/xeCO0SA.0 + - c3gjQEc5w0q/9/MG90WUxQ.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 147ms + - 292ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_remove_participant.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_remove_participant.yaml new file mode 100644 index 000000000000..770e66674e0b --- /dev/null +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_remove_participant.yaml @@ -0,0 +1,375 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:14:01 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:14:00 GMT + ms-cv: + - EZm4ZV97KEm0bmO5QoCf5A.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 38ms + status: + code: 200 + message: OK +- request: + body: '{"scopes": ["chat"]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '20' + Content-Type: + - application/json + Date: + - Mon, 01 Feb 2021 23:14:01 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:14:00.2599102+00:00"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:14:00 GMT + ms-cv: + - U+n9c5UM90OQyXf+d0GRyg.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 115ms + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:14:02 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:14:00 GMT + ms-cv: + - iwwv12Y4QkqWRRqH0P3zQA.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 23ms + status: + code: 200 + message: OK +- request: + body: '{"scopes": ["chat"]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '20' + Content-Type: + - application/json + Date: + - Mon, 01 Feb 2021 23:14:02 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:14:00.4581206+00:00"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:14:00 GMT + ms-cv: + - /bW3cAQSkU+YKFSZdCQC4A.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 91ms + status: + code: 200 + message: OK +- request: + body: '{"topic": "test topic", "participants": "sanitized"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '206' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - e99db6c4-bef1-481d-8e92-528e8a290d0b + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 + response: + body: '{"chatThread": {"id": "19:4E8s1hIQeP0NL5a4RI5MHuFwoSUNhnLIm84cb-6qJtk1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:14:01Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffc1-7abd-b0b7-3a3a0d002fd9"}}' + headers: + api-supported-versions: + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:14:02 GMT + ms-cv: + - 7RNEOUTHk0GR//bh61Mcwg.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 849ms + status: + code: 201 + message: Created +- request: + body: '{"participants": "sanitized"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '183' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/participants/:add?api-version=2020-11-01-preview3 + response: + body: '{}' + headers: + api-supported-versions: + - 2020-11-01-preview3, 2021-01-27-preview4 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:14:02 GMT + ms-cv: + - WTe/ZJvW/UW+XLlyxEnIRQ.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 405ms + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/participants/8%3Aacs%3A46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffc1-7be5-b0b7-3a3a0d002fda?api-version=2020-11-01-preview3 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-11-01-preview3, 2021-01-27-preview4 + date: + - Mon, 01 Feb 2021 23:14:03 GMT + ms-cv: + - jkB6wPDKmUeaim9wAvflbg.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 452ms + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:14:04 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + date: + - Mon, 01 Feb 2021 23:14:19 GMT + ms-cv: + - oT4lJ//RSUahLSYWY6yTWw.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 16000ms + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:14:20 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + date: + - Mon, 01 Feb 2021 23:14:35 GMT + ms-cv: + - qg30GEqn+EWOdc+u9Nf7Ow.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 16565ms + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + date: + - Mon, 01 Feb 2021 23:14:36 GMT + ms-cv: + - lDW3jg3eiEqYxIvtlsTOxg.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 329ms + status: + code: 204 + message: No Content +version: 1 diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_send_message.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_send_message.yaml index 1522c9610320..669aba8894b2 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_send_message.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_send_message.yaml @@ -11,30 +11,30 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:48:26 GMT + - Mon, 01 Feb 2021 23:14:37 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:25 GMT + - Mon, 01 Feb 2021 23:14:36 GMT ms-cv: - - AAuokt9JZ06/sHReeOMfqg.0 + - PUk9KXg0hkO+CkCLwWzbdg.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 215ms + - 144ms status: code: 200 message: OK @@ -52,30 +52,30 @@ interactions: Content-Type: - application/json Date: - - Wed, 02 Dec 2020 23:48:26 GMT + - Mon, 01 Feb 2021 23:14:38 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities/sanitized/token?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2020-12-03T23:48:24.8997922+00:00"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:14:36.2310025+00:00"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:25 GMT + - Mon, 01 Feb 2021 23:14:36 GMT ms-cv: - - fjzCYbpw3UC08N3mjmThhw.0 + - i7Qr/LEEekyNydS6xC4pZg.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 287ms + - 130ms status: code: 200 message: OK @@ -91,35 +91,35 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:48:27 GMT + - Mon, 01 Feb 2021 23:14:38 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:25 GMT + - Mon, 01 Feb 2021 23:14:36 GMT ms-cv: - - +vSgDSIZtE20p1mJUy45Yg.0 + - Ww2NQm7lVESaKwXycU5e5w.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 212ms + - 21ms status: code: 200 message: OK - request: - body: '{"topic": "test topic", "members": "sanitized"}' + body: '{"scopes": ["chat"]}' headers: Accept: - application/json @@ -128,36 +128,80 @@ interactions: Connection: - keep-alive Content-Length: - - '201' + - '20' Content-Type: - application/json + Date: + - Mon, 01 Feb 2021 23:14:38 GMT User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"multipleStatus": "sanitized"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:14:36.4924069+00:00"}' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:26 GMT + - Mon, 01 Feb 2021 23:14:36 GMT ms-cv: - - RbB/1owxZUujMTqzyiuzMQ.0 + - rNpbJx8+3U6OUrimTrsi2A.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 236ms + - 143ms status: - code: 207 - message: Multi-Status + code: 200 + message: OK +- request: + body: '{"topic": "test topic", "participants": "sanitized"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '206' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - 40db38f0-3b14-4697-9513-4ab0d5de5bb0 + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 + response: + body: '{"chatThread": {"id": "19:2L9d8Kv3-nhipybg6fHvSKVtRcXPcmdDbTF4fi7fQP01@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:14:37Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffc2-077b-1db7-3a3a0d002bb5"}}' + headers: + api-supported-versions: + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:14:37 GMT + ms-cv: + - uWe3kVXQ6UOGBYAnbGxrqQ.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 834ms + status: + code: 201 + message: Created - request: - body: '{"priority": "Normal", "content": "hello world", "senderDisplayName": "sender - name"}' + body: '{"content": "hello world", "senderDisplayName": "sender name", "type": + "text"}' headers: Accept: - application/json @@ -166,30 +210,30 @@ interactions: Connection: - keep-alive Content-Length: - - '84' + - '78' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?api-version=2020-11-01-preview3 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:27 GMT + - Mon, 01 Feb 2021 23:14:39 GMT ms-cv: - - bCiIeO4wR02mtYYjyTl2xA.0 + - IJrEaNKVAkOUChnJIeg1jg.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 122ms + - 370ms status: code: 201 message: Created @@ -205,27 +249,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:48:28 GMT + - Mon, 01 Feb 2021 23:14:40 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:48:28 GMT + - Mon, 01 Feb 2021 23:14:55 GMT ms-cv: - - lPbfRbdo7UGWENSpTBBjvg.0 + - YfMJXVUq90mBonU+4Kqmmg.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 1708ms + - 16170ms status: code: 204 message: No Content @@ -241,27 +285,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:48:30 GMT + - Mon, 01 Feb 2021 23:14:56 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:48:29 GMT + - Mon, 01 Feb 2021 23:15:10 GMT ms-cv: - - igDoQ4EQxkm1Bk5Oyp2DwA.0 + - QygpUV62dU2p3dQH1i9EFw.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 551ms + - 15771ms status: code: 204 message: No Content @@ -277,23 +321,23 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 date: - - Wed, 02 Dec 2020 23:48:29 GMT + - Mon, 01 Feb 2021 23:15:11 GMT ms-cv: - - 5y9uh7SEakCypOrjfVL/JQ.0 + - SLGQK/S7UUiOyxLecoVsvg.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 215ms + - 296ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_send_read_receipt.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_send_read_receipt.yaml index 2f98fdbbacc2..5e4eb0b092dc 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_send_read_receipt.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_send_read_receipt.yaml @@ -11,30 +11,30 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:48:31 GMT + - Mon, 01 Feb 2021 23:15:12 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:30 GMT + - Mon, 01 Feb 2021 23:15:11 GMT ms-cv: - - q2ZoI9UyXUCh2YVS1DtFmQ.0 + - tSA9Uj5DZUW3a9cE/9Mf/Q.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 221ms + - 17ms status: code: 200 message: OK @@ -52,30 +52,30 @@ interactions: Content-Type: - application/json Date: - - Wed, 02 Dec 2020 23:48:32 GMT + - Mon, 01 Feb 2021 23:15:12 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities/sanitized/token?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2020-12-03T23:48:30.3534309+00:00"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:15:11.1099766+00:00"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:31 GMT + - Mon, 01 Feb 2021 23:15:11 GMT ms-cv: - - RifIfbEX8kuCWKzWt+IFgQ.0 + - VgBXYbYf9UurxmT5dzATFg.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 291ms + - 89ms status: code: 200 message: OK @@ -91,35 +91,35 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:48:32 GMT + - Mon, 01 Feb 2021 23:15:13 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:31 GMT + - Mon, 01 Feb 2021 23:15:11 GMT ms-cv: - - Oj/tnHcRhku6DocRa4L+XA.0 + - DbJCn67mX0aWj8C6ortl0A.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 218ms + - 17ms status: code: 200 message: OK - request: - body: '{"topic": "test topic", "members": "sanitized"}' + body: '{"scopes": ["chat"]}' headers: Accept: - application/json @@ -128,36 +128,39 @@ interactions: Connection: - keep-alive Content-Length: - - '201' + - '20' Content-Type: - application/json + Date: + - Mon, 01 Feb 2021 23:15:13 GMT User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"multipleStatus": "sanitized"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:15:11.320505+00:00"}' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:31 GMT + - Mon, 01 Feb 2021 23:15:11 GMT ms-cv: - - MZ9d4amrJ0Wa/g4uWZUWQg.0 + - zjn4ayBwyke1loffvhkcKA.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 217ms + - 87ms status: - code: 207 - message: Multi-Status + code: 200 + message: OK - request: - body: '{"priority": "Normal", "content": "hello world", "senderDisplayName": "sender - name"}' + body: '{"topic": "test topic", "participants": "sanitized"}' headers: Accept: - application/json @@ -166,30 +169,71 @@ interactions: Connection: - keep-alive Content-Length: - - '84' + - '206' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - 474491e3-6187-4de9-9d8a-28f6d540d871 method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 + response: + body: '{"chatThread": {"id": "19:t_E0OeuCTWPldGmzOPeMP1S_mSN6F6VTus185SOfXhM1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:15:12Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffc2-8fe4-1db7-3a3a0d002bb7"}}' + headers: + api-supported-versions: + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:15:13 GMT + ms-cv: + - r9Rq5GDG70a4hFfGeGY4Pg.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 827ms + status: + code: 201 + message: Created +- request: + body: '{"content": "hello world", "senderDisplayName": "sender name", "type": + "text"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '78' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?api-version=2020-11-01-preview3 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:32 GMT + - Mon, 01 Feb 2021 23:15:13 GMT ms-cv: - - VoTkSnRdmkC2VEHujr+jYA.0 + - PWZQZDAcBkCuAJZAkO8FGQ.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 133ms + - 371ms status: code: 201 message: Created @@ -207,28 +251,28 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readreceipts?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/readReceipts?api-version=2020-11-01-preview3 response: body: string: '' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-length: - '0' date: - - Wed, 02 Dec 2020 23:48:32 GMT + - Mon, 01 Feb 2021 23:15:14 GMT ms-cv: - - mT4t4G9eh0qEBCe/j4NIsg.0 + - Dmex4TI3t0KRUU5gjpnk0A.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 153ms + - 474ms status: - code: 201 - message: Created + code: 200 + message: OK - request: body: null headers: @@ -241,27 +285,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:48:34 GMT + - Mon, 01 Feb 2021 23:15:15 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:48:34 GMT + - Mon, 01 Feb 2021 23:15:30 GMT ms-cv: - - JsDFx89AZUCwuwcH1j5rGA.0 + - SmoIgTczqk2E5claXN641g.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 1568ms + - 16560ms status: code: 204 message: No Content @@ -277,27 +321,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:48:36 GMT + - Mon, 01 Feb 2021 23:15:32 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:48:35 GMT + - Mon, 01 Feb 2021 23:15:47 GMT ms-cv: - - PwTmpDMNfkSe6V5nvle0/Q.0 + - Y6csz9/irk6fnMs7V1j1kQ.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 871ms + - 16651ms status: code: 204 message: No Content @@ -313,23 +357,23 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 date: - - Wed, 02 Dec 2020 23:48:35 GMT + - Mon, 01 Feb 2021 23:15:47 GMT ms-cv: - - /mD4HYJ2mEKYOdaEunkGIg.0 + - vCDX2DXOBkalGHB9+mXItQ.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 140ms + - 330ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_send_typing_notification.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_send_typing_notification.yaml index 44bc880fce17..4f03008f9db2 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_send_typing_notification.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_send_typing_notification.yaml @@ -11,30 +11,30 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:48:37 GMT + - Mon, 01 Feb 2021 23:15:49 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:36 GMT + - Mon, 01 Feb 2021 23:15:47 GMT ms-cv: - - PsrtaVmqd0qzBl4SZpw12Q.0 + - XwHJSNWA7UqNR7ibkb9bbA.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 217ms + - 31ms status: code: 200 message: OK @@ -52,30 +52,30 @@ interactions: Content-Type: - application/json Date: - - Wed, 02 Dec 2020 23:48:38 GMT + - Mon, 01 Feb 2021 23:15:49 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities/sanitized/token?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2020-12-03T23:48:36.0084687+00:00"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:15:47.7123057+00:00"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:36 GMT + - Mon, 01 Feb 2021 23:15:47 GMT ms-cv: - - H7EUkVVamUiZnu8ebaxG5w.0 + - REHPP3i3bUSlTyS+tP9MWQ.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 282ms + - 88ms status: code: 200 message: OK @@ -91,35 +91,35 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:48:38 GMT + - Mon, 01 Feb 2021 23:15:49 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:36 GMT + - Mon, 01 Feb 2021 23:15:47 GMT ms-cv: - - kBimdgSPL0KtIu4zpDh+Tw.0 + - 1wfO7BOee0etC6vNcd4TbQ.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 216ms + - 18ms status: code: 200 message: OK - request: - body: '{"topic": "test topic", "members": "sanitized"}' + body: '{"scopes": ["chat"]}' headers: Accept: - application/json @@ -128,33 +128,77 @@ interactions: Connection: - keep-alive Content-Length: - - '201' + - '20' Content-Type: - application/json + Date: + - Mon, 01 Feb 2021 23:15:49 GMT User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"multipleStatus": "sanitized"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:15:47.9042925+00:00"}' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:37 GMT + - Mon, 01 Feb 2021 23:15:48 GMT ms-cv: - - C3VAO2ifHUCuKqnlnTv5Og.0 + - VAMXZsDHB0KnHjUxlKLzsg.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 285ms + - 84ms status: - code: 207 - message: Multi-Status + code: 200 + message: OK +- request: + body: '{"topic": "test topic", "participants": "sanitized"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '206' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - 332f1d84-d70a-41c9-896f-06ce225c9800 + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 + response: + body: '{"chatThread": {"id": "19:Fx3tz3AWBkwB0rNJLdwYEp93BWn9LDnjENQr-r6Q1tc1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:15:49Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffc3-1ede-1db7-3a3a0d002bbb"}}' + headers: + api-supported-versions: + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:15:49 GMT + ms-cv: + - 2ibp7R9uik+hT85AQshldw.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 835ms + status: + code: 201 + message: Created - request: body: null headers: @@ -167,25 +211,25 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/typing?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/typing?api-version=2020-11-01-preview3 response: body: string: '' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-length: - '0' date: - - Wed, 02 Dec 2020 23:48:38 GMT + - Mon, 01 Feb 2021 23:15:49 GMT ms-cv: - - 4gH9HXNHg0qFCUrbPHeFmw.0 + - 0206Ij0Tk02wqj686Ri0bw.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 84ms + - 380ms status: code: 200 message: OK @@ -201,27 +245,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:48:39 GMT + - Mon, 01 Feb 2021 23:15:51 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:48:39 GMT + - Mon, 01 Feb 2021 23:16:06 GMT ms-cv: - - b1sER/4MtEKJGAKhPjs4iQ.0 + - N6ZajPTp80iFBwopP6HvJw.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 1005ms + - 16195ms status: code: 204 message: No Content @@ -237,27 +281,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:48:41 GMT + - Mon, 01 Feb 2021 23:16:07 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:48:39 GMT + - Mon, 01 Feb 2021 23:16:22 GMT ms-cv: - - BXR1SfVSkEqcEcBCwnHA+Q.0 + - NgU0httyhECRLttIx+ALRg.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 612ms + - 16433ms status: code: 204 message: No Content @@ -273,23 +317,23 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 date: - - Wed, 02 Dec 2020 23:48:40 GMT + - Mon, 01 Feb 2021 23:16:22 GMT ms-cv: - - ojOXeX3c7EqwanSn/7Wvcw.0 + - r/yFRd7inkO5ZrdEaxelHQ.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 146ms + - 328ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_update_message.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_update_message.yaml index 7061988e2ce2..dec30f9dcf65 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_update_message.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_update_message.yaml @@ -11,30 +11,30 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:48:42 GMT + - Mon, 01 Feb 2021 23:16:24 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:41 GMT + - Mon, 01 Feb 2021 23:16:23 GMT ms-cv: - - FH4gaqMP5EyoOMXx8y9yGg.0 + - 2MymiP7VJ0OXSvRRMY2dyw.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 221ms + - 68ms status: code: 200 message: OK @@ -52,30 +52,30 @@ interactions: Content-Type: - application/json Date: - - Wed, 02 Dec 2020 23:48:42 GMT + - Mon, 01 Feb 2021 23:16:24 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities/sanitized/token?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2020-12-03T23:48:40.8988867+00:00"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:16:23.1422355+00:00"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:41 GMT + - Mon, 01 Feb 2021 23:16:23 GMT ms-cv: - - AHtcUw/WVEq3XSx3W9uNjw.0 + - 465Iq26z10GzxzZc6yHNwA.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 309ms + - 104ms status: code: 200 message: OK @@ -91,35 +91,35 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:48:43 GMT + - Mon, 01 Feb 2021 23:16:25 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:42 GMT + - Mon, 01 Feb 2021 23:16:23 GMT ms-cv: - - fllaL37CkU2F/KDAbi8+iA.0 + - JRpcxWLlK0yMKlUHiEFbMw.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 206ms + - 21ms status: code: 200 message: OK - request: - body: '{"topic": "test topic", "members": "sanitized"}' + body: '{"scopes": ["chat"]}' headers: Accept: - application/json @@ -128,36 +128,39 @@ interactions: Connection: - keep-alive Content-Length: - - '201' + - '20' Content-Type: - application/json + Date: + - Mon, 01 Feb 2021 23:16:25 GMT User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"multipleStatus": "sanitized"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:16:23.3432968+00:00"}' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:42 GMT + - Mon, 01 Feb 2021 23:16:23 GMT ms-cv: - - omxReFSmZEycvq7M/fXJUg.0 + - xhPcqG0KFUyk3F3rjxjZ0w.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 264ms + - 91ms status: - code: 207 - message: Multi-Status + code: 200 + message: OK - request: - body: '{"priority": "Normal", "content": "hello world", "senderDisplayName": "sender - name"}' + body: '{"topic": "test topic", "participants": "sanitized"}' headers: Accept: - application/json @@ -166,30 +169,71 @@ interactions: Connection: - keep-alive Content-Length: - - '84' + - '206' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - 7fc2e51d-55b0-40b2-a245-3c2dc6ceedc5 method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 + response: + body: '{"chatThread": {"id": "19:3x3XmwNlVkuiiXHmbSCmYuQ8JxeiRazrEShqq-oR3To1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:16:25Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffc3-a929-9c58-373a0d002de1"}}' + headers: + api-supported-versions: + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:16:26 GMT + ms-cv: + - yu7GP5ErZ0yDgI2tJvJ7aA.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 848ms + status: + code: 201 + message: Created +- request: + body: '{"content": "hello world", "senderDisplayName": "sender name", "type": + "text"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '78' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?api-version=2020-11-01-preview3 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:43 GMT + - Mon, 01 Feb 2021 23:16:27 GMT ms-cv: - - BFBjsE51lUWds9d72Rgtbg.0 + - OdIc18bb8kigrXOy5U4LKg.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 225ms + - 666ms status: code: 201 message: Created @@ -205,30 +249,28 @@ interactions: Content-Length: - '38' Content-Type: - - application/json + - application/merge-patch+json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: PATCH - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 - content-length: - - '0' + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 date: - - Wed, 02 Dec 2020 23:48:43 GMT + - Mon, 01 Feb 2021 23:16:27 GMT ms-cv: - - VSaPfNc1EkC5vZAEoh2ZnQ.0 + - LPkc4PDmrkaytAz03cTGBg.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 228ms + - 755ms status: - code: 200 - message: OK + code: 204 + message: No Content - request: body: null headers: @@ -241,27 +283,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:48:45 GMT + - Mon, 01 Feb 2021 23:16:28 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:48:45 GMT + - Mon, 01 Feb 2021 23:16:43 GMT ms-cv: - - luNIoqjUskKI7/Lpbw798A.0 + - tasO5sWXeEK9zfka3B0tyg.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 1584ms + - 16485ms status: code: 204 message: No Content @@ -277,27 +319,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:48:46 GMT + - Mon, 01 Feb 2021 23:16:45 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:48:46 GMT + - Mon, 01 Feb 2021 23:17:00 GMT ms-cv: - - uIKAA0zsA0OgdKGMwxsE5w.0 + - QV0+4+sWg0O2D5wOmS9L2g.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 750ms + - 16183ms status: code: 204 message: No Content @@ -313,23 +355,23 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: api-supported-versions: - - 2020-09-21-preview2, 2020-11-01-preview3 + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 date: - - Wed, 02 Dec 2020 23:48:45 GMT + - Mon, 01 Feb 2021 23:17:00 GMT ms-cv: - - 9gtdU5Wp3UW8iYVOgre2bg.0 + - tBMt51eRjkW0VBp/PLpN/A.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 142ms + - 294ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_update_topic.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_update_topic.yaml new file mode 100644 index 000000000000..ef81731f6a30 --- /dev/null +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e.test_update_topic.yaml @@ -0,0 +1,340 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:17:02 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:17:01 GMT + ms-cv: + - 4k4KwAmJEEWEHj0zcLzq6g.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 60ms + status: + code: 200 + message: OK +- request: + body: '{"scopes": ["chat"]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '20' + Content-Type: + - application/json + Date: + - Mon, 01 Feb 2021 23:17:02 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:17:00.8453508+00:00"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:17:01 GMT + ms-cv: + - rObRoGlwDUeiFVukiGVOqw.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 103ms + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:17:02 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:17:01 GMT + ms-cv: + - pFkPISUMA0q49e0tmLJH7w.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 24ms + status: + code: 200 + message: OK +- request: + body: '{"scopes": ["chat"]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '20' + Content-Type: + - application/json + Date: + - Mon, 01 Feb 2021 23:17:02 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:17:00.0712662+00:00"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:17:01 GMT + ms-cv: + - sP2KdfioK0mo8hlWKGtfCA.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 92ms + status: + code: 200 + message: OK +- request: + body: '{"topic": "test topic", "participants": "sanitized"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '206' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - 21dee0d5-0f45-4e22-8e21-ff7a831076ee + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 + response: + body: '{"chatThread": {"id": "19:MYM8rFp9eERFM1j8IRDD7gCnk7B0fmgKBh0GgAxYouU1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:17:02Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffc4-3c30-9c58-373a0d002de3"}}' + headers: + api-supported-versions: + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:17:02 GMT + ms-cv: + - mSXw7JSS2kqOtiKUIwWUIA.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 875ms + status: + code: 201 + message: Created +- request: + body: '{"topic": "update topic"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '25' + Content-Type: + - application/merge-patch+json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: PATCH + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + date: + - Mon, 01 Feb 2021 23:17:03 GMT + ms-cv: + - 15a+lb6U6EiowJbUL4xxpg.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 387ms + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:17:04 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + date: + - Mon, 01 Feb 2021 23:17:20 GMT + ms-cv: + - 7G+YH3zbsEiZiQC6pR+q9w.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 17151ms + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:17:21 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + date: + - Mon, 01 Feb 2021 23:17:36 GMT + ms-cv: + - xguohH3MNUSNItwjGBWWXA.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 16713ms + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + date: + - Mon, 01 Feb 2021 23:17:37 GMT + ms-cv: + - y7AhM8HUi0md4+LXkmghqw.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 338ms + status: + code: 204 + message: No Content +version: 1 diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_add_participant.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_add_participant.yaml new file mode 100644 index 000000000000..b2bd1b1654c0 --- /dev/null +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_add_participant.yaml @@ -0,0 +1,313 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:17:38 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:17:37 GMT + ms-cv: + - wiJNOcMEe0y2M7VRao265A.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 22ms + status: + code: 200 + message: OK +- request: + body: '{"scopes": ["chat"]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '20' + Content-Type: + - application/json + Date: + - Mon, 01 Feb 2021 23:17:39 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:17:37.4364651+00:00"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:17:37 GMT + ms-cv: + - 7jJJuoxd7ESniv5K0rURVw.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 87ms + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:17:39 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:17:37 GMT + ms-cv: + - 0aYZgAfC30agjwajckap0Q.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 22ms + status: + code: 200 + message: OK +- request: + body: '{"scopes": ["chat"]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '20' + Content-Type: + - application/json + Date: + - Mon, 01 Feb 2021 23:17:39 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:17:37.6483825+00:00"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:17:38 GMT + ms-cv: + - WZi9Z5P+mkmIXTZm+QF2Qg.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 87ms + status: + code: 200 + message: OK +- request: + body: '{"topic": "test topic", "participants": "sanitized"}' + headers: + Accept: + - application/json + Content-Length: + - '206' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - 8c32fba3-7d4e-4fc7-b934-9cc05e49c3ed + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 + response: + body: '{"chatThread": {"id": "19:aJmsyuJMYvoVvmtOiLuUT5R6rkKFRZvli7ahPU-bJaU1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:17:39Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffc4-cb7b-9c58-373a0d002de5"}}' + headers: + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-type: application/json; charset=utf-8 + date: Mon, 01 Feb 2021 23:17:39 GMT + ms-cv: ERPPmkWQc0SxCaIDt7lYNw.0 + strict-transport-security: max-age=2592000 + transfer-encoding: chunked + x-processing-time: 836ms + status: + code: 201 + message: Created + url: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 +- request: + body: '{"participants": "sanitized"}' + headers: + Accept: + - application/json + Content-Length: + - '183' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/participants/:add?api-version=2020-11-01-preview3 + response: + body: '{}' + headers: + api-supported-versions: 2020-11-01-preview3, 2021-01-27-preview4 + content-type: application/json; charset=utf-8 + date: Mon, 01 Feb 2021 23:17:40 GMT + ms-cv: +e5us/5vjUOFTQKkdfzraQ.0 + strict-transport-security: max-age=2592000 + transfer-encoding: chunked + x-processing-time: 842ms + status: + code: 201 + message: Created + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized/participants/:add?api-version=2020-11-01-preview3 +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 + response: + body: + string: '' + headers: + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + date: Mon, 01 Feb 2021 23:17:40 GMT + ms-cv: ExECFOZRLkSrucWivvZvBw.0 + strict-transport-security: max-age=2592000 + x-processing-time: 309ms + status: + code: 204 + message: No Content + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:17:41 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + date: + - Mon, 01 Feb 2021 23:17:57 GMT + ms-cv: + - pCklXNjJmEKS1gEqsrPa3A.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 16640ms + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:17:58 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + date: + - Mon, 01 Feb 2021 23:18:14 GMT + ms-cv: + - 2GSUOVKyNkudmSv9EM2ibA.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 16693ms + status: + code: 204 + message: No Content +version: 1 diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_add_participants.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_add_participants.yaml new file mode 100644 index 000000000000..893d7f5b0fdc --- /dev/null +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_add_participants.yaml @@ -0,0 +1,313 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:18:15 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:18:13 GMT + ms-cv: + - cuNmsy7nv0G1p/9GsngMgA.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 26ms + status: + code: 200 + message: OK +- request: + body: '{"scopes": ["chat"]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '20' + Content-Type: + - application/json + Date: + - Mon, 01 Feb 2021 23:18:15 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:18:13.8878372+00:00"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:18:14 GMT + ms-cv: + - tog85bh5u0aSJG6kumCQJg.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 104ms + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:18:15 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:18:14 GMT + ms-cv: + - 1zN9zRgwr0KAcqCHZ2BMJQ.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 18ms + status: + code: 200 + message: OK +- request: + body: '{"scopes": ["chat"]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '20' + Content-Type: + - application/json + Date: + - Mon, 01 Feb 2021 23:18:15 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:18:14.0825193+00:00"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:18:14 GMT + ms-cv: + - kblWrQzk+U6GNVsVxya2pA.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 87ms + status: + code: 200 + message: OK +- request: + body: '{"topic": "test topic", "participants": "sanitized"}' + headers: + Accept: + - application/json + Content-Length: + - '206' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - 3ad78fb8-0e55-4ace-b55b-445e910f95dd + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 + response: + body: '{"chatThread": {"id": "19:dY2LFZUfMSYMlUgFHOBK6JL5YCBEnV_7z6C1T5DyfvE1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:18:15Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffc5-59cd-dbb7-3a3a0d002e3d"}}' + headers: + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-type: application/json; charset=utf-8 + date: Mon, 01 Feb 2021 23:18:15 GMT + ms-cv: EpZGMSKCI027wfbMuz2U0w.0 + strict-transport-security: max-age=2592000 + transfer-encoding: chunked + x-processing-time: 840ms + status: + code: 201 + message: Created + url: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 +- request: + body: '{"participants": "sanitized"}' + headers: + Accept: + - application/json + Content-Length: + - '183' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/participants/:add?api-version=2020-11-01-preview3 + response: + body: '{}' + headers: + api-supported-versions: 2020-11-01-preview3, 2021-01-27-preview4 + content-type: application/json; charset=utf-8 + date: Mon, 01 Feb 2021 23:18:16 GMT + ms-cv: wrwsS4U4RkOTn7KepcXvdw.0 + strict-transport-security: max-age=2592000 + transfer-encoding: chunked + x-processing-time: 867ms + status: + code: 201 + message: Created + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized/participants/:add?api-version=2020-11-01-preview3 +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 + response: + body: + string: '' + headers: + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + date: Mon, 01 Feb 2021 23:18:16 GMT + ms-cv: XST1go/ahU6EyGpm+A2sXQ.0 + strict-transport-security: max-age=2592000 + x-processing-time: 344ms + status: + code: 204 + message: No Content + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:18:18 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + date: + - Mon, 01 Feb 2021 23:18:33 GMT + ms-cv: + - I1E/tzvZYUuzELOe3JTxLQ.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 16410ms + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:18:34 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + date: + - Mon, 01 Feb 2021 23:18:49 GMT + ms-cv: + - RzK4RXdR3EWzhN+5jVzmcA.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 15990ms + status: + code: 204 + message: No Content +version: 1 diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_delete_message.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_delete_message.yaml index f68e34af7d18..4038781d3dcc 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_delete_message.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_delete_message.yaml @@ -11,30 +11,30 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:48:57 GMT + - Mon, 01 Feb 2021 23:18:50 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:57 GMT + - Mon, 01 Feb 2021 23:18:49 GMT ms-cv: - - wdQV/lSBw0uN0UgYNlTfDg.0 + - 31OWtmSn3EiOkJXY25BbiQ.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 219ms + - 19ms status: code: 200 message: OK @@ -52,30 +52,30 @@ interactions: Content-Type: - application/json Date: - - Wed, 02 Dec 2020 23:48:58 GMT + - Mon, 01 Feb 2021 23:18:51 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities/sanitized/token?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2020-12-03T23:48:56.5214356+00:00"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:18:49.4008201+00:00"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:57 GMT + - Mon, 01 Feb 2021 23:18:49 GMT ms-cv: - - UqFVyAX9YEixkIKP3J7UBQ.0 + - nHqbbboWNUGZB8iLXcDEJA.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 278ms + - 84ms status: code: 200 message: OK @@ -91,132 +91,176 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:48:58 GMT + - Mon, 01 Feb 2021 23:18:51 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:48:57 GMT + - Mon, 01 Feb 2021 23:18:50 GMT ms-cv: - - mToUTQdVHUec9wq5UD6DbQ.0 + - wXZ/WKcf4k2NFRHHTQD5Sw.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 214ms + - 105ms status: code: 200 message: OK - request: - body: '{"topic": "test topic", "members": "sanitized"}' + body: '{"scopes": ["chat"]}' headers: Accept: - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive Content-Length: - - '201' + - '20' Content-Type: - application/json + Date: + - Mon, 01 Feb 2021 23:18:51 GMT User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"multipleStatus": "sanitized"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:18:49.7426359+00:00"}' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:18:50 GMT + ms-cv: + - yUabNjFxEkSSBdprrS/EVw.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 123ms + status: + code: 200 + message: OK +- request: + body: '{"topic": "test topic", "participants": "sanitized"}' + headers: + Accept: + - application/json + Content-Length: + - '205' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - 11076cec-3eed-4e04-a50a-7de1f5fa86cf + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 + response: + body: '{"chatThread": {"id": "19:hmrEwhvqrMyzs4L4bmVEFpa02a2DGHP3nK-1lIVbDgk1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:18:51Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffc5-e49b-dbb7-3a3a0d002e42"}}' + headers: + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: application/json; charset=utf-8 - date: Wed, 02 Dec 2020 23:48:57 GMT - ms-cv: Pl79ryteckyD7/eIWyoc4g.0 + date: Mon, 01 Feb 2021 23:18:51 GMT + ms-cv: /D11Li2mXUePQ+ea7zB/4A.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 181ms + x-processing-time: 1301ms status: - code: 207 - message: Multi-Status - url: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + code: 201 + message: Created + url: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 - request: - body: '{"priority": "Normal", "content": "hello world", "senderDisplayName": "sender - name"}' + body: '{"content": "hello world", "senderDisplayName": "sender name", "type": + "text"}' headers: Accept: - application/json Content-Length: - - '84' + - '78' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?api-version=2020-11-01-preview3 response: body: '{"id": "sanitized"}' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: application/json; charset=utf-8 - date: Wed, 02 Dec 2020 23:48:58 GMT - ms-cv: wwXa64V02ESSzUp0S2fHXg.0 + date: Mon, 01 Feb 2021 23:18:52 GMT + ms-cv: 0Rab5ME8YU+cr/32hQOi4g.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 96ms + x-processing-time: 839ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?api-version=2020-11-01-preview3 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 - date: Wed, 02 Dec 2020 23:48:58 GMT - ms-cv: UMYGLPAwMk29gF0ekSoXmw.0 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + date: Mon, 01 Feb 2021 23:18:52 GMT + ms-cv: VuWN90lDMUSIprmudU5tfw.0 strict-transport-security: max-age=2592000 - x-processing-time: 134ms + x-processing-time: 413ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages/sanitized?api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages/sanitized?api-version=2020-11-01-preview3 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 - date: Wed, 02 Dec 2020 23:48:58 GMT - ms-cv: rN4TAfZQX0ShISKaQdPZJg.0 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + date: Mon, 01 Feb 2021 23:18:53 GMT + ms-cv: As0acV4b/k2CWp8oO6NWnA.0 strict-transport-security: max-age=2592000 - x-processing-time: 90ms + x-processing-time: 296ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 - request: body: null headers: @@ -229,27 +273,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:49:00 GMT + - Mon, 01 Feb 2021 23:18:54 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:48:59 GMT + - Mon, 01 Feb 2021 23:19:08 GMT ms-cv: - - mxwbB5MM90GtEIYxR8f26w.0 + - 3TV+emzQ70KIiKWt3yytEg.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 862ms + - 15749ms status: code: 204 message: No Content @@ -265,27 +309,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:49:01 GMT + - Mon, 01 Feb 2021 23:19:10 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:49:00 GMT + - Mon, 01 Feb 2021 23:19:25 GMT ms-cv: - - Ze172zvq1EyndD3zTMN/CQ.0 + - 1txET329UkqLiKnywtlx+Q.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 714ms + - 16088ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_get_message.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_get_message.yaml index 485ec7eb93fa..4ae3fc2723f6 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_get_message.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_get_message.yaml @@ -11,30 +11,30 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:49:02 GMT + - Mon, 01 Feb 2021 23:19:26 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:49:00 GMT + - Mon, 01 Feb 2021 23:19:25 GMT ms-cv: - - zu48Wl0Kfk6OUBVpQ08CvA.0 + - V2iZBGO0mkSTbnFTez9x4g.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 210ms + - 25ms status: code: 200 message: OK @@ -52,30 +52,30 @@ interactions: Content-Type: - application/json Date: - - Wed, 02 Dec 2020 23:49:03 GMT + - Mon, 01 Feb 2021 23:19:27 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities/sanitized/token?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2020-12-03T23:49:01.0174082+00:00"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:19:25.7173945+00:00"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:49:01 GMT + - Mon, 01 Feb 2021 23:19:26 GMT ms-cv: - - oQpARCnnGE2oAIgjfIAYvw.0 + - so9sekwPGE2NMvzGzqVRNw.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 285ms + - 471ms status: code: 200 message: OK @@ -91,135 +91,179 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:49:03 GMT + - Mon, 01 Feb 2021 23:19:27 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:49:01 GMT + - Mon, 01 Feb 2021 23:19:26 GMT ms-cv: - - oanTIy+GDEysCij3YYokYg.0 + - clPvopIe3UesWCd2Wj25sw.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 209ms + - 21ms status: code: 200 message: OK - request: - body: '{"topic": "test topic", "members": "sanitized"}' + body: '{"scopes": ["chat"]}' headers: Accept: - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive Content-Length: - - '201' + - '20' Content-Type: - application/json + Date: + - Mon, 01 Feb 2021 23:19:27 GMT User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"multipleStatus": "sanitized"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:19:25.9587324+00:00"}' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:19:26 GMT + ms-cv: + - d58oeSyc6UmvhH2AX50Srg.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 123ms + status: + code: 200 + message: OK +- request: + body: '{"topic": "test topic", "participants": "sanitized"}' + headers: + Accept: + - application/json + Content-Length: + - '206' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - e2efabfd-9369-47bd-ba13-97a39cfe8dda + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 + response: + body: '{"chatThread": {"id": "19:sT4EAyNNsPFIlxwKDRvELElOjSy031rfHMJ9uDfCF1M1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:19:27Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffc6-70f4-dbb7-3a3a0d002e44"}}' + headers: + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: application/json; charset=utf-8 - date: Wed, 02 Dec 2020 23:49:02 GMT - ms-cv: QfNhINTJhU6JNCcUnefpkg.0 + date: Mon, 01 Feb 2021 23:19:27 GMT + ms-cv: oCcekLH9MkqjgXrV83zVsQ.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 177ms + x-processing-time: 887ms status: - code: 207 - message: Multi-Status - url: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + code: 201 + message: Created + url: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 - request: - body: '{"priority": "Normal", "content": "hello world", "senderDisplayName": "sender - name"}' + body: '{"content": "hello world", "senderDisplayName": "sender name", "type": + "text"}' headers: Accept: - application/json Content-Length: - - '84' + - '78' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?api-version=2020-11-01-preview3 response: body: '{"id": "sanitized"}' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: application/json; charset=utf-8 - date: Wed, 02 Dec 2020 23:49:02 GMT - ms-cv: x8RIG2jXd0+gIx3YBG9Jyw.0 + date: Mon, 01 Feb 2021 23:19:27 GMT + ms-cv: 8MxAY6OdU06P126LeQNbmA.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 90ms + x-processing-time: 386ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?api-version=2020-11-01-preview3 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages/sanitized?api-version=2020-11-01-preview3 response: - body: '{"id": "sanitized", "type": "Text", "priority": "Normal", "version": "1606952943205", - "content": "hello world", "senderDisplayName": "sender name", "createdOn": "2020-12-02T23:49:03Z", - "senderId": "sanitized"}' + body: '{"id": "sanitized", "type": "text", "sequenceId": "3", "version": "1612221568314", + "content": {"message": "hello world"}, "senderDisplayName": "sender name", "createdOn": + "2021-02-01T23:19:28Z", "senderId": "sanitized"}' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: application/json; charset=utf-8 - date: Wed, 02 Dec 2020 23:49:03 GMT - ms-cv: LTdlLLaAzE68H1ZoWZR4ow.0 + date: Mon, 01 Feb 2021 23:19:27 GMT + ms-cv: fAu0ovNwVUSs4266LM03ow.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 61ms + x-processing-time: 252ms status: code: 200 message: OK - url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages/sanitized?api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages/sanitized?api-version=2020-11-01-preview3 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 - date: Wed, 02 Dec 2020 23:49:03 GMT - ms-cv: 0uuyBLyiL0ScdJb6dbO1Cw.0 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + date: Mon, 01 Feb 2021 23:19:28 GMT + ms-cv: Dm1GewpLpkCW3li1QTQmew.0 strict-transport-security: max-age=2592000 - x-processing-time: 94ms + x-processing-time: 325ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 - request: body: null headers: @@ -232,27 +276,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:49:05 GMT + - Mon, 01 Feb 2021 23:19:30 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:49:04 GMT + - Mon, 01 Feb 2021 23:19:44 GMT ms-cv: - - TvIBxZGLb0CR+b34JWDftQ.0 + - fPF+rtnel0uXE6gx+3Ygcg.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 1055ms + - 16405ms status: code: 204 message: No Content @@ -268,27 +312,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:49:06 GMT + - Mon, 01 Feb 2021 23:19:46 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:49:04 GMT + - Mon, 01 Feb 2021 23:20:01 GMT ms-cv: - - fmDKuR5sKU6a8I4amar+bg.0 + - s8cK09kHJkGx8kD54uNCug.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 428ms + - 16382ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_list_messages.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_list_messages.yaml index 198baa7162ac..aaf00437b769 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_list_messages.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_list_messages.yaml @@ -11,30 +11,30 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:49:11 GMT + - Mon, 01 Feb 2021 23:20:02 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:49:10 GMT + - Mon, 01 Feb 2021 23:20:02 GMT ms-cv: - - 7ME8TRAENEKehSjODr/QGw.0 + - HbOjX7CMD0yIeSBDX2zgNQ.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 206ms + - 47ms status: code: 200 message: OK @@ -52,30 +52,30 @@ interactions: Content-Type: - application/json Date: - - Wed, 02 Dec 2020 23:49:12 GMT + - Mon, 01 Feb 2021 23:20:03 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities/sanitized/token?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2020-12-03T23:49:09.9850684+00:00"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:20:01.5625672+00:00"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:49:10 GMT + - Mon, 01 Feb 2021 23:20:02 GMT ms-cv: - - c2hgPqShoEWiVOtOQZQB/w.0 + - hQOqUjNxi0Odwu9Ddv6Ikw.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 274ms + - 125ms status: code: 200 message: OK @@ -91,202 +91,246 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:49:12 GMT + - Mon, 01 Feb 2021 23:20:03 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:49:10 GMT + - Mon, 01 Feb 2021 23:20:02 GMT ms-cv: - - tK3bl6NioU+tADWtID9wGQ.0 + - D1V4moi670yS3GAi9fxS0Q.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 203ms + - 37ms status: code: 200 message: OK - request: - body: '{"topic": "test topic", "members": "sanitized"}' + body: '{"scopes": ["chat"]}' headers: Accept: - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive Content-Length: - - '201' + - '20' Content-Type: - application/json + Date: + - Mon, 01 Feb 2021 23:20:03 GMT User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"multipleStatus": "sanitized"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:20:01.798267+00:00"}' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:20:02 GMT + ms-cv: + - Kpvd90J+E0ahUbg1233i/A.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 92ms + status: + code: 200 + message: OK +- request: + body: '{"topic": "test topic", "participants": "sanitized"}' + headers: + Accept: + - application/json + Content-Length: + - '205' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - ffed4204-b2d0-4c79-a2b9-167ea6ec6675 + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 + response: + body: '{"chatThread": {"id": "19:HAql5yFMs-s5ggcoC6lvfy4lMfV3CLDj02pJz5siXgM1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:20:03Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffc6-fe3e-1db7-3a3a0d002bbe"}}' + headers: + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: application/json; charset=utf-8 - date: Wed, 02 Dec 2020 23:49:10 GMT - ms-cv: enzEf1fxJk+/FJoX29owmg.0 + date: Mon, 01 Feb 2021 23:20:03 GMT + ms-cv: /DgfnofHcUSj7KMGEjtVVw.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 193ms + x-processing-time: 878ms status: - code: 207 - message: Multi-Status - url: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + code: 201 + message: Created + url: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 - request: - body: '{"priority": "Normal", "content": "hello world", "senderDisplayName": "sender - name"}' + body: '{"content": "hello world", "senderDisplayName": "sender name", "type": + "text"}' headers: Accept: - application/json Content-Length: - - '84' + - '78' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?api-version=2020-11-01-preview3 response: body: '{"id": "sanitized"}' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: application/json; charset=utf-8 - date: Wed, 02 Dec 2020 23:49:11 GMT - ms-cv: 1RBSMXu6yUW2PSmfjUfQwg.0 + date: Mon, 01 Feb 2021 23:20:03 GMT + ms-cv: l7iB83AiV0m0NcpVNhUF9w.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 102ms + x-processing-time: 401ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?api-version=2020-11-01-preview3 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?maxPageSize=1&api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?maxPageSize=1&api-version=2020-11-01-preview3 response: body: '{"value": "sanitized", "nextLink": "sanitized"}' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: application/json; charset=utf-8 - date: Wed, 02 Dec 2020 23:49:13 GMT - ms-cv: UelsWb9O9kaGCPs6VdkwwQ.0 + date: Mon, 01 Feb 2021 23:20:04 GMT + ms-cv: mUgKEDWKiUqzo52QfMm3Ig.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 76ms + x-processing-time: 266ms status: code: 200 message: OK - url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?maxPageSize=1&api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?maxPageSize=1&api-version=2020-11-01-preview3 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?syncState=sanitized&startTime=1/1/1970%2012:00:00%20AM%20%2B00:00&maxPageSize=1&api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?syncState=sanitized&startTime=1/1/1970%2012:00:00%20AM%20%2B00:00&maxPageSize=1&api-version=2020-11-01-preview3 response: body: '{"value": "sanitized", "nextLink": "sanitized"}' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: application/json; charset=utf-8 - date: Wed, 02 Dec 2020 23:49:13 GMT - ms-cv: YWRvY/whUUSNVufFPREvkA.0 + date: Mon, 01 Feb 2021 23:20:04 GMT + ms-cv: zGVUvEodWUW6VGCXzhsssQ.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 112ms + x-processing-time: 352ms status: code: 200 message: OK - url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?syncState=sanitized&startTime=1/1/1970%2012:00:00%20AM%20%2B00:00&maxPageSize=1&api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?syncState=sanitized&startTime=1/1/1970%2012:00:00%20AM%20%2B00:00&maxPageSize=1&api-version=2020-11-01-preview3 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?syncState=sanitized&startTime=1/1/1970%2012:00:00%20AM%20%2B00:00&maxPageSize=1&api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?syncState=sanitized&startTime=1/1/1970%2012:00:00%20AM%20%2B00:00&maxPageSize=1&api-version=2020-11-01-preview3 response: body: '{"value": "sanitized", "nextLink": "sanitized"}' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: application/json; charset=utf-8 - date: Wed, 02 Dec 2020 23:49:13 GMT - ms-cv: gVVFATwqW0Srp9eIHJnPHQ.0 + date: Mon, 01 Feb 2021 23:20:05 GMT + ms-cv: SJPKrSIwAk2eQS3jEUH62w.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 117ms + x-processing-time: 362ms status: code: 200 message: OK - url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?syncState=sanitized&startTime=1/1/1970%2012:00:00%20AM%20%2B00:00&maxPageSize=1&api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?syncState=sanitized&startTime=1/1/1970%2012:00:00%20AM%20%2B00:00&maxPageSize=1&api-version=2020-11-01-preview3 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?syncState=sanitized&startTime=1/1/1970%2012:00:00%20AM%20%2B00:00&maxPageSize=1&api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?syncState=sanitized&startTime=1/1/1970%2012:00:00%20AM%20%2B00:00&maxPageSize=1&api-version=2020-11-01-preview3 response: body: '{"value": "sanitized"}' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: application/json; charset=utf-8 - date: Wed, 02 Dec 2020 23:49:14 GMT - ms-cv: zig9f/IrUEqkjIy1G7eq7A.0 + date: Mon, 01 Feb 2021 23:20:05 GMT + ms-cv: zI4V2XnPNEWEc8ZMNL8EBw.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 166ms + x-processing-time: 365ms status: code: 200 message: OK - url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?syncState=sanitized&startTime=1/1/1970%2012:00:00%20AM%20%2B00:00&maxPageSize=1&api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?syncState=sanitized&startTime=1/1/1970%2012:00:00%20AM%20%2B00:00&maxPageSize=1&api-version=2020-11-01-preview3 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 - date: Wed, 02 Dec 2020 23:49:14 GMT - ms-cv: 2DvNW/CRRUe2Rp7NUGSx/Q.0 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + date: Mon, 01 Feb 2021 23:20:05 GMT + ms-cv: ZytCWmbx2kGM8kb86OFniQ.0 strict-transport-security: max-age=2592000 - x-processing-time: 93ms + x-processing-time: 325ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 - request: body: null headers: @@ -299,27 +343,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:49:16 GMT + - Mon, 01 Feb 2021 23:20:07 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:49:16 GMT + - Mon, 01 Feb 2021 23:20:21 GMT ms-cv: - - LaLObeySHUKZBW7N1cbvUQ.0 + - bBPNdiKgjEOOG4rufGohUQ.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 1276ms + - 15825ms status: code: 204 message: No Content @@ -335,27 +379,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:49:18 GMT + - Mon, 01 Feb 2021 23:20:23 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:49:17 GMT + - Mon, 01 Feb 2021 23:20:38 GMT ms-cv: - - KYTPvOKohkWYyAMC1ZQUqA.0 + - 9UV3osczJUioYNOWrKK/3w.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 622ms + - 16641ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_list_participants.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_list_participants.yaml new file mode 100644 index 000000000000..dec731d6e8e0 --- /dev/null +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_list_participants.yaml @@ -0,0 +1,336 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:20:40 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:20:39 GMT + ms-cv: + - f4Px5pwNZk6orW3lopLZZQ.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 23ms + status: + code: 200 + message: OK +- request: + body: '{"scopes": ["chat"]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '20' + Content-Type: + - application/json + Date: + - Mon, 01 Feb 2021 23:20:40 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:20:38.5900315+00:00"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:20:39 GMT + ms-cv: + - N2d84HZid06e2vITK6BKBA.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 87ms + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:20:40 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:20:39 GMT + ms-cv: + - Her44Xo2o0Gmx7P7HW8t1w.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 20ms + status: + code: 200 + message: OK +- request: + body: '{"scopes": ["chat"]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '20' + Content-Type: + - application/json + Date: + - Mon, 01 Feb 2021 23:20:40 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:20:38.7820752+00:00"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:20:39 GMT + ms-cv: + - I6P3k0H5n0e2XRkPODLJLQ.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 86ms + status: + code: 200 + message: OK +- request: + body: '{"topic": "test topic", "participants": "sanitized"}' + headers: + Accept: + - application/json + Content-Length: + - '206' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - 848b50dd-5e67-407f-8905-3e0e5b22f14b + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 + response: + body: '{"chatThread": {"id": "19:GHb4oV86Az3F4uT726U95jqsiEAXGu7_2Ks3dXUzfPg1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:20:40Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffc7-8f1a-dbb7-3a3a0d002e49"}}' + headers: + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-type: application/json; charset=utf-8 + date: Mon, 01 Feb 2021 23:20:40 GMT + ms-cv: PXXBFYPP30+ZG4uFJS7zvA.0 + strict-transport-security: max-age=2592000 + transfer-encoding: chunked + x-processing-time: 899ms + status: + code: 201 + message: Created + url: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 +- request: + body: '{"participants": "sanitized"}' + headers: + Accept: + - application/json + Content-Length: + - '183' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/participants/:add?api-version=2020-11-01-preview3 + response: + body: '{}' + headers: + api-supported-versions: 2020-11-01-preview3, 2021-01-27-preview4 + content-type: application/json; charset=utf-8 + date: Mon, 01 Feb 2021 23:20:41 GMT + ms-cv: Ngd8yj412UyG9R7fF3NR5g.0 + strict-transport-security: max-age=2592000 + transfer-encoding: chunked + x-processing-time: 901ms + status: + code: 201 + message: Created + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized/participants/:add?api-version=2020-11-01-preview3 +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/participants?maxPageSize=1&skip=1&api-version=2020-11-01-preview3 + response: + body: '{"value": "sanitized"}' + headers: + api-supported-versions: 2020-11-01-preview3, 2021-01-27-preview4 + content-type: application/json; charset=utf-8 + date: Mon, 01 Feb 2021 23:20:41 GMT + ms-cv: 7KvbKhAA50anUYAFvRsQVA.0 + strict-transport-security: max-age=2592000 + transfer-encoding: chunked + x-processing-time: 317ms + status: + code: 200 + message: OK + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized/participants?maxPageSize=1&skip=1&api-version=2020-11-01-preview3 +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 + response: + body: + string: '' + headers: + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + date: Mon, 01 Feb 2021 23:20:42 GMT + ms-cv: dJqxi4yQFUKlLySz39PCwA.0 + strict-transport-security: max-age=2592000 + x-processing-time: 335ms + status: + code: 204 + message: No Content + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:20:43 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + date: + - Mon, 01 Feb 2021 23:20:59 GMT + ms-cv: + - 921TROcHdkyOp7Xidgq8SQ.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 16773ms + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:21:00 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + date: + - Mon, 01 Feb 2021 23:21:14 GMT + ms-cv: + - w4LueWX/ZE6W7/oW0oef7w.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 16020ms + status: + code: 204 + message: No Content +version: 1 diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_list_read_receipts.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_list_read_receipts.yaml index 3b62ea31575f..72ea19e4dd18 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_list_read_receipts.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_list_read_receipts.yaml @@ -11,30 +11,30 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:49:18 GMT + - Mon, 01 Feb 2021 23:21:16 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:49:17 GMT + - Mon, 01 Feb 2021 23:21:15 GMT ms-cv: - - MFA0fCdWf0WD1s2GiIF6OQ.0 + - Y73NycmljUGoS+Fw5kOCxA.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 211ms + - 30ms status: code: 200 message: OK @@ -52,30 +52,30 @@ interactions: Content-Type: - application/json Date: - - Wed, 02 Dec 2020 23:49:19 GMT + - Mon, 01 Feb 2021 23:21:16 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities/sanitized/token?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2020-12-03T23:49:17.5284907+00:00"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:21:14.9303274+00:00"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:49:18 GMT + - Mon, 01 Feb 2021 23:21:15 GMT ms-cv: - - KfBFTejYlk+ojRPfQYeMjg.0 + - 8Rerr61n40O65GFy48Yfpw.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 285ms + - 85ms status: code: 200 message: OK @@ -91,88 +91,132 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:49:19 GMT + - Mon, 01 Feb 2021 23:21:16 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:49:18 GMT + - Mon, 01 Feb 2021 23:21:15 GMT ms-cv: - - Baa/47Q1fkybaZbIw/uq0g.0 + - S1xoSIQBSka4DV2LM4DnpQ.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 209ms + - 23ms status: code: 200 message: OK - request: - body: '{"topic": "test topic", "members": "sanitized"}' + body: '{"scopes": ["chat"]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '20' + Content-Type: + - application/json + Date: + - Mon, 01 Feb 2021 23:21:16 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:21:15.1228654+00:00"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:21:15 GMT + ms-cv: + - iEOfTZ9KsEG2sI4FO1ga6g.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 87ms + status: + code: 200 + message: OK +- request: + body: '{"topic": "test topic", "participants": "sanitized"}' headers: Accept: - application/json Content-Length: - - '201' + - '369' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - c605e6a2-8215-4f6b-9d5a-fe07213ad68f method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 response: - body: '{"multipleStatus": "sanitized"}' + body: '{"chatThread": {"id": "19:0nqHY0ienC2Fh3pX6izGvIIr1UoHjJnLIj6kP3pNlD41@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:21:16Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffc8-1d16-dbb7-3a3a0d002e4d"}}' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: application/json; charset=utf-8 - date: Wed, 02 Dec 2020 23:49:18 GMT - ms-cv: o8cJpVWVw0CBJgqRFYClIQ.0 + date: Mon, 01 Feb 2021 23:21:16 GMT + ms-cv: ohL958/JBkCZsObnMAC+Gg.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 234ms + x-processing-time: 924ms status: - code: 207 - message: Multi-Status - url: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + code: 201 + message: Created + url: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 - request: - body: '{"priority": "Normal", "content": "hello world", "senderDisplayName": "sender - name"}' + body: '{"content": "hello world", "senderDisplayName": "sender name", "type": + "text"}' headers: Accept: - application/json Content-Length: - - '84' + - '78' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?api-version=2020-11-01-preview3 response: body: '{"id": "sanitized"}' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: application/json; charset=utf-8 - date: Wed, 02 Dec 2020 23:49:19 GMT - ms-cv: 8bmNykKMgES/bLDPsFSGlA.0 + date: Mon, 01 Feb 2021 23:21:16 GMT + ms-cv: w+gQAUFmUUWPWkZ6BFJyXg.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 101ms + x-processing-time: 381ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?api-version=2020-11-01-preview3 - request: body: '{"chatMessageId": "sanitized"}' headers: @@ -183,68 +227,247 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readreceipts?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/readReceipts?api-version=2020-11-01-preview3 response: body: string: '' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-length: '0' - date: Wed, 02 Dec 2020 23:49:19 GMT - ms-cv: YaU2bQAQ2UC+/VO58sZFtg.0 + date: Mon, 01 Feb 2021 23:21:17 GMT + ms-cv: cFA048twuE6yynApi/p7iQ.0 + strict-transport-security: max-age=2592000 + x-processing-time: 485ms + status: + code: 200 + message: OK + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized/readReceipts?api-version=2020-11-01-preview3 +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/readReceipts?api-version=2020-11-01-preview3 + response: + body: '{"value": "sanitized"}' + headers: + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-type: application/json; charset=utf-8 + date: Mon, 01 Feb 2021 23:21:18 GMT + ms-cv: VAVsQp2XWEi13VL5yHn3OQ.0 + strict-transport-security: max-age=2592000 + transfer-encoding: chunked + x-processing-time: 721ms + status: + code: 200 + message: OK + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized/readReceipts?api-version=2020-11-01-preview3 +- request: + body: '{"content": "hello world", "senderDisplayName": "sender name", "type": + "text"}' + headers: + Accept: + - application/json + Content-Length: + - '78' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?api-version=2020-11-01-preview3 + response: + body: '{"id": "sanitized"}' + headers: + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-type: application/json; charset=utf-8 + date: Mon, 01 Feb 2021 23:21:18 GMT + ms-cv: KvHKUxhRAEesoAW7DQPTvA.0 strict-transport-security: max-age=2592000 - x-processing-time: 102ms + transfer-encoding: chunked + x-processing-time: 389ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads/sanitized/readreceipts?api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?api-version=2020-11-01-preview3 +- request: + body: '{"chatMessageId": "sanitized"}' + headers: + Accept: + - application/json + Content-Length: + - '34' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/readReceipts?api-version=2020-11-01-preview3 + response: + body: + string: '' + headers: + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-length: '0' + date: Mon, 01 Feb 2021 23:21:19 GMT + ms-cv: Kb6zsCFNk0SgwzOiNN7DxQ.0 + strict-transport-security: max-age=2592000 + x-processing-time: 493ms + status: + code: 200 + message: OK + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized/readReceipts?api-version=2020-11-01-preview3 +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/readReceipts?api-version=2020-11-01-preview3 + response: + body: '{"value": "sanitized"}' + headers: + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-type: application/json; charset=utf-8 + date: Mon, 01 Feb 2021 23:21:20 GMT + ms-cv: pTOwHhOssEq/bgvMPw4DBA.0 + strict-transport-security: max-age=2592000 + transfer-encoding: chunked + x-processing-time: 735ms + status: + code: 200 + message: OK + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized/readReceipts?api-version=2020-11-01-preview3 +- request: + body: '{"content": "content", "senderDisplayName": "sender_display_name", "type": + "text"}' + headers: + Accept: + - application/json + Content-Length: + - '82' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?api-version=2020-11-01-preview3 + response: + body: '{"id": "sanitized"}' + headers: + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-type: application/json; charset=utf-8 + date: Mon, 01 Feb 2021 23:21:21 GMT + ms-cv: TCjoJnr0F0ylKEzBDmJ7aw.0 + strict-transport-security: max-age=2592000 + transfer-encoding: chunked + x-processing-time: 403ms + status: + code: 201 + message: Created + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?api-version=2020-11-01-preview3 +- request: + body: '{"chatMessageId": "sanitized"}' + headers: + Accept: + - application/json + Content-Length: + - '34' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/readReceipts?api-version=2020-11-01-preview3 + response: + body: + string: '' + headers: + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-length: '0' + date: Mon, 01 Feb 2021 23:21:22 GMT + ms-cv: UqrPfAD6mk2xLTla3gk72g.0 + strict-transport-security: max-age=2592000 + x-processing-time: 1002ms + status: + code: 200 + message: OK + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized/readReceipts?api-version=2020-11-01-preview3 +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/readReceipts?api-version=2020-11-01-preview3 + response: + body: '{"value": "sanitized"}' + headers: + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-type: application/json; charset=utf-8 + date: Mon, 01 Feb 2021 23:21:22 GMT + ms-cv: w2knKYvDIkOg1tpARtJPPw.0 + strict-transport-security: max-age=2592000 + transfer-encoding: chunked + x-processing-time: 250ms + status: + code: 200 + message: OK + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized/readReceipts?api-version=2020-11-01-preview3 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: GET - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readreceipts?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/readReceipts?maxPageSize=2&skip=0&api-version=2020-11-01-preview3 response: body: '{"value": "sanitized"}' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: application/json; charset=utf-8 - date: Wed, 02 Dec 2020 23:49:22 GMT - ms-cv: qh3bQCWQaEunxY5Ph3rHPg.0 + date: Mon, 01 Feb 2021 23:21:22 GMT + ms-cv: bJGKQXjTz0G0vwtPXKB4Hg.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 59ms + x-processing-time: 283ms status: code: 200 message: OK - url: https://sanitized.communication.azure.com/chat/threads/sanitized/readreceipts?api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized/readReceipts?maxPageSize=2&skip=0&api-version=2020-11-01-preview3 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 - date: Wed, 02 Dec 2020 23:49:21 GMT - ms-cv: FjJ4Aqd2Z0+IQAxk9RRYNQ.0 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + date: Mon, 01 Feb 2021 23:21:22 GMT + ms-cv: ACuZGQSCyEerBjQBmkDQag.0 strict-transport-security: max-age=2592000 - x-processing-time: 90ms + x-processing-time: 348ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 - request: body: null headers: @@ -257,27 +480,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:49:23 GMT + - Mon, 01 Feb 2021 23:21:24 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:49:22 GMT + - Mon, 01 Feb 2021 23:21:40 GMT ms-cv: - - efHJEr2PCE63FYv7O+VO0Q.0 + - VBZIaGGgCkaB7VHTdOjuow.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 607ms + - 17051ms status: code: 204 message: No Content @@ -293,27 +516,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:49:24 GMT + - Mon, 01 Feb 2021 23:21:41 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:49:23 GMT + - Mon, 01 Feb 2021 23:21:57 GMT ms-cv: - - 9B5p6RxxZ0WoMuifWIhtlw.0 + - ey5vQHS020CIGdf+9PNl8A.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 730ms + - 16877ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_remove_participant.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_remove_participant.yaml new file mode 100644 index 000000000000..951f045d7e04 --- /dev/null +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_remove_participant.yaml @@ -0,0 +1,335 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:21:58 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:21:58 GMT + ms-cv: + - IR8qAgkkJkKbpyNsfz9ZFQ.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 43ms + status: + code: 200 + message: OK +- request: + body: '{"scopes": ["chat"]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '20' + Content-Type: + - application/json + Date: + - Mon, 01 Feb 2021 23:21:59 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:21:57.4850953+00:00"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:21:58 GMT + ms-cv: + - 6B5ozE6YiEuTvLaQmQuqcg.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 253ms + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:21:59 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:21:58 GMT + ms-cv: + - 4oXicPYGIEqwMQL31CyFmA.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 34ms + status: + code: 200 + message: OK +- request: + body: '{"scopes": ["chat"]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '20' + Content-Type: + - application/json + Date: + - Mon, 01 Feb 2021 23:21:59 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:21:57.9083946+00:00"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:21:58 GMT + ms-cv: + - zn2JZowMz0mTvt9WTVRIQw.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 171ms + status: + code: 200 + message: OK +- request: + body: '{"topic": "test topic", "participants": "sanitized"}' + headers: + Accept: + - application/json + Content-Length: + - '204' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - 4e005603-2996-4d73-9185-054a2f9de6ec + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 + response: + body: '{"chatThread": {"id": "19:QUVZHhXp9SwSg5OPq6PY8cBLtExh1Iy7xtkPahjchvk1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:21:59Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffc8-c2a0-dbb7-3a3a0d002e52"}}' + headers: + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-type: application/json; charset=utf-8 + date: Mon, 01 Feb 2021 23:21:59 GMT + ms-cv: 1rikER0eHk+1ImKysJ5OAA.0 + strict-transport-security: max-age=2592000 + transfer-encoding: chunked + x-processing-time: 913ms + status: + code: 201 + message: Created + url: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 +- request: + body: '{"participants": "sanitized"}' + headers: + Accept: + - application/json + Content-Length: + - '182' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/participants/:add?api-version=2020-11-01-preview3 + response: + body: '{}' + headers: + api-supported-versions: 2020-11-01-preview3, 2021-01-27-preview4 + content-type: application/json; charset=utf-8 + date: Mon, 01 Feb 2021 23:21:59 GMT + ms-cv: /EUWgZhWNUCZxw9/fFlqcQ.0 + strict-transport-security: max-age=2592000 + transfer-encoding: chunked + x-processing-time: 458ms + status: + code: 201 + message: Created + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized/participants/:add?api-version=2020-11-01-preview3 +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/participants/8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffc8-c494-b0b7-3a3a0d002fec?api-version=2020-11-01-preview3 + response: + body: + string: '' + headers: + api-supported-versions: 2020-11-01-preview3, 2021-01-27-preview4 + date: Mon, 01 Feb 2021 23:22:00 GMT + ms-cv: DK6rkh0u+ESV4EeUpATcXg.0 + strict-transport-security: max-age=2592000 + x-processing-time: 514ms + status: + code: 204 + message: No Content + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized/participants/8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffc8-c494-b0b7-3a3a0d002fec?api-version=2020-11-01-preview3 +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 + response: + body: + string: '' + headers: + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + date: Mon, 01 Feb 2021 23:22:01 GMT + ms-cv: LYAa3yRCpkSle1X1IUcmhA.0 + strict-transport-security: max-age=2592000 + x-processing-time: 338ms + status: + code: 204 + message: No Content + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:22:02 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + date: + - Mon, 01 Feb 2021 23:22:18 GMT + ms-cv: + - MFVGBbxcOUGCZXhAtKIbGA.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 16909ms + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:22:19 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + date: + - Mon, 01 Feb 2021 23:22:34 GMT + ms-cv: + - 3JviFuM7yUSGV0KU+tzvAw.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 16381ms + status: + code: 204 + message: No Content +version: 1 diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_send_message.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_send_message.yaml index eb7f861297b2..8536bdd64ea2 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_send_message.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_send_message.yaml @@ -11,30 +11,30 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:49:30 GMT + - Mon, 01 Feb 2021 23:22:35 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:49:29 GMT + - Mon, 01 Feb 2021 23:22:34 GMT ms-cv: - - +8PaTSWVY06U2QBrO6FkCg.0 + - vJ5pkAVuH0+w/zW8LYsK6w.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 268ms + - 19ms status: code: 200 message: OK @@ -52,30 +52,30 @@ interactions: Content-Type: - application/json Date: - - Wed, 02 Dec 2020 23:49:31 GMT + - Mon, 01 Feb 2021 23:22:36 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities/sanitized/token?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2020-12-03T23:49:29.121514+00:00"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:22:34.6115112+00:00"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:49:29 GMT + - Mon, 01 Feb 2021 23:22:35 GMT ms-cv: - - fBXm7ljQskS+Q2IUa1Secg.0 + - LRDW4x+ecUCNLMnP9KrgQA.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 295ms + - 91ms status: code: 200 message: OK @@ -91,110 +91,154 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:49:31 GMT + - Mon, 01 Feb 2021 23:22:36 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:49:30 GMT + - Mon, 01 Feb 2021 23:22:35 GMT ms-cv: - - WynRQVRPt0ec0bBm8M87jA.0 + - pFA2WIfndUSfRe7QQEp71w.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 220ms + - 22ms status: code: 200 message: OK - request: - body: '{"topic": "test topic", "members": "sanitized"}' + body: '{"scopes": ["chat"]}' headers: Accept: - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive Content-Length: - - '201' + - '20' Content-Type: - application/json + Date: + - Mon, 01 Feb 2021 23:22:36 GMT User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"multipleStatus": "sanitized"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:22:34.812464+00:00"}' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:22:35 GMT + ms-cv: + - +CjMpFq/d0mW021QBABxVw.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 93ms + status: + code: 200 + message: OK +- request: + body: '{"topic": "test topic", "participants": "sanitized"}' + headers: + Accept: + - application/json + Content-Length: + - '206' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - bc786b1c-d597-48ec-b853-a0c14973341e + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 + response: + body: '{"chatThread": {"id": "19:VVUbRAlWVhs2m5fmK1yxiA8-cIipUadN6HVJCSQ0X7w1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:22:36Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffc9-544c-9c58-373a0d002def"}}' + headers: + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: application/json; charset=utf-8 - date: Wed, 02 Dec 2020 23:49:30 GMT - ms-cv: bZFdHSIFBEK8vnf8e3xUtA.0 + date: Mon, 01 Feb 2021 23:22:36 GMT + ms-cv: 2QadoNBVw0+1kmPGyToDlA.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 152ms + x-processing-time: 1433ms status: - code: 207 - message: Multi-Status - url: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + code: 201 + message: Created + url: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 - request: - body: '{"priority": "Normal", "content": "hello world", "senderDisplayName": "sender - name"}' + body: '{"content": "hello world", "senderDisplayName": "sender name", "type": + "text"}' headers: Accept: - application/json Content-Length: - - '84' + - '78' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?api-version=2020-11-01-preview3 response: body: '{"id": "sanitized"}' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: application/json; charset=utf-8 - date: Wed, 02 Dec 2020 23:49:30 GMT - ms-cv: Cn+CKyy59UWPGNXmKkvxsA.0 + date: Mon, 01 Feb 2021 23:22:37 GMT + ms-cv: uQU0u5jR6EaupuKhQI9AnA.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 93ms + x-processing-time: 385ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?api-version=2020-11-01-preview3 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 - date: Wed, 02 Dec 2020 23:49:31 GMT - ms-cv: e2ldsvxP2kaoVBv+YyBU4Q.0 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + date: Mon, 01 Feb 2021 23:22:37 GMT + ms-cv: 3oVt89CM6EKRxcnf/8Osdw.0 strict-transport-security: max-age=2592000 - x-processing-time: 88ms + x-processing-time: 353ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 - request: body: null headers: @@ -207,27 +251,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:49:32 GMT + - Mon, 01 Feb 2021 23:22:39 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:49:32 GMT + - Mon, 01 Feb 2021 23:22:54 GMT ms-cv: - - 4D6dsqY9XE2tDXSwPCkyCQ.0 + - Bfl9O3aTg0mhInatUkltCg.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 1008ms + - 16542ms status: code: 204 message: No Content @@ -243,27 +287,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:49:33 GMT + - Mon, 01 Feb 2021 23:22:55 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:49:32 GMT + - Mon, 01 Feb 2021 23:23:11 GMT ms-cv: - - DK38g/F6nEyTEKhvBQeaMg.0 + - ieTBbeMSNE2DUYblodJyzA.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 535ms + - 16338ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_send_read_receipt.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_send_read_receipt.yaml index fb8c7f976b5d..314d10e97bb7 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_send_read_receipt.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_send_read_receipt.yaml @@ -11,30 +11,30 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:49:34 GMT + - Mon, 01 Feb 2021 23:23:12 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:49:33 GMT + - Mon, 01 Feb 2021 23:23:10 GMT ms-cv: - - EqUHOOM990aKfceOp0+UNw.0 + - 1PQm5xA2xEaSXsV8I18+iw.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 210ms + - 23ms status: code: 200 message: OK @@ -52,30 +52,30 @@ interactions: Content-Type: - application/json Date: - - Wed, 02 Dec 2020 23:49:35 GMT + - Mon, 01 Feb 2021 23:23:12 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities/sanitized/token?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2020-12-03T23:49:33.3418379+00:00"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:23:10.7955443+00:00"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:49:34 GMT + - Mon, 01 Feb 2021 23:23:10 GMT ms-cv: - - C3qV6vRLPkyZE0CzgYYOsA.0 + - QXZoCTJ+2k+xn7a2sjEcJg.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 277ms + - 124ms status: code: 200 message: OK @@ -91,88 +91,132 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:49:35 GMT + - Mon, 01 Feb 2021 23:23:12 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:49:34 GMT + - Mon, 01 Feb 2021 23:23:10 GMT ms-cv: - - g6S/+1jL5kuxzttgUMn3/w.0 + - QisxI+Bpgk6Jn/2IGZPgRQ.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 204ms + - 23ms status: code: 200 message: OK - request: - body: '{"topic": "test topic", "members": "sanitized"}' + body: '{"scopes": ["chat"]}' headers: Accept: - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive Content-Length: - - '200' + - '20' Content-Type: - application/json + Date: + - Mon, 01 Feb 2021 23:23:12 GMT User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"multipleStatus": "sanitized"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:23:10.9940038+00:00"}' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:23:11 GMT + ms-cv: + - 9W15esyoC02p75dxwK8onQ.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 90ms + status: + code: 200 + message: OK +- request: + body: '{"topic": "test topic", "participants": "sanitized"}' + headers: + Accept: + - application/json + Content-Length: + - '206' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - 1c1f2397-e606-4f51-88c4-d4f1d8245f84 + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 + response: + body: '{"chatThread": {"id": "19:BgfIWLP2boNcEYEZzzLs69MML9TI7T55P8BisDSQR-Q1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:23:12Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffc9-e181-9c58-373a0d002df1"}}' + headers: + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: application/json; charset=utf-8 - date: Wed, 02 Dec 2020 23:49:34 GMT - ms-cv: +aMkagNeI0uz+22koAwIlQ.0 + date: Mon, 01 Feb 2021 23:23:12 GMT + ms-cv: STB7amyigkKPCp3dLVeX2w.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 184ms + x-processing-time: 913ms status: - code: 207 - message: Multi-Status - url: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + code: 201 + message: Created + url: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 - request: - body: '{"priority": "Normal", "content": "hello world", "senderDisplayName": "sender - name"}' + body: '{"content": "hello world", "senderDisplayName": "sender name", "type": + "text"}' headers: Accept: - application/json Content-Length: - - '84' + - '78' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?api-version=2020-11-01-preview3 response: body: '{"id": "sanitized"}' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: application/json; charset=utf-8 - date: Wed, 02 Dec 2020 23:49:35 GMT - ms-cv: As/Nx6uGm0ieq9pJB9UCYQ.0 + date: Mon, 01 Feb 2021 23:23:13 GMT + ms-cv: ReCQ1NoYvkebEh2MVnaTuQ.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 101ms + x-processing-time: 740ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?api-version=2020-11-01-preview3 - request: body: '{"chatMessageId": "sanitized"}' headers: @@ -183,45 +227,45 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/readreceipts?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/readReceipts?api-version=2020-11-01-preview3 response: body: string: '' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-length: '0' - date: Wed, 02 Dec 2020 23:49:35 GMT - ms-cv: O1vfleRhn06HhPQxFA4BVw.0 + date: Mon, 01 Feb 2021 23:23:14 GMT + ms-cv: bckuD4xjEkSVT16+MYV33w.0 strict-transport-security: max-age=2592000 - x-processing-time: 132ms + x-processing-time: 983ms status: - code: 201 - message: Created - url: https://sanitized.communication.azure.com/chat/threads/sanitized/readreceipts?api-version=2020-09-21-preview2 + code: 200 + message: OK + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized/readReceipts?api-version=2020-11-01-preview3 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 - date: Wed, 02 Dec 2020 23:49:35 GMT - ms-cv: k/Z5h7zVaEKh02fSxpziuA.0 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + date: Mon, 01 Feb 2021 23:23:14 GMT + ms-cv: opHMk4nMwEWG8PnnjtulCA.0 strict-transport-security: max-age=2592000 - x-processing-time: 84ms + x-processing-time: 321ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 - request: body: null headers: @@ -234,27 +278,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:49:37 GMT + - Mon, 01 Feb 2021 23:23:16 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:49:36 GMT + - Mon, 01 Feb 2021 23:23:31 GMT ms-cv: - - Hx6vyiNcNU+Cvg6fQrfH7Q.0 + - kIDhxGSX1U+VB09tCJ0++w.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 717ms + - 16190ms status: code: 204 message: No Content @@ -270,27 +314,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:49:38 GMT + - Mon, 01 Feb 2021 23:23:32 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:49:37 GMT + - Mon, 01 Feb 2021 23:23:47 GMT ms-cv: - - MahryC6U5EiPJBP/sKQZzw.0 + - fOvspotyjEO9ckTKVxfhSA.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 545ms + - 15997ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_send_typing_notification.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_send_typing_notification.yaml index 2d49bce69a03..fc3420758429 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_send_typing_notification.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_send_typing_notification.yaml @@ -11,30 +11,30 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:49:39 GMT + - Mon, 01 Feb 2021 23:23:48 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:49:38 GMT + - Mon, 01 Feb 2021 23:23:47 GMT ms-cv: - - 7Jt2dt5lX0uFPkqrKMCPGQ.0 + - z9cXxjKO3kq2FNRq9Ut2nw.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 207ms + - 25ms status: code: 200 message: OK @@ -52,30 +52,30 @@ interactions: Content-Type: - application/json Date: - - Wed, 02 Dec 2020 23:49:39 GMT + - Mon, 01 Feb 2021 23:23:48 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities/sanitized/token?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2020-12-03T23:49:37.7069043+00:00"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:23:46.9704687+00:00"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:49:38 GMT + - Mon, 01 Feb 2021 23:23:47 GMT ms-cv: - - b07vxOLR7021fMgzSIYZgQ.0 + - ZDEm3qYXdECk2ZT/OOe1Uw.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 279ms + - 112ms status: code: 200 message: OK @@ -91,105 +91,149 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:49:40 GMT + - Mon, 01 Feb 2021 23:23:48 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:49:38 GMT + - Mon, 01 Feb 2021 23:23:47 GMT ms-cv: - - Rklj6F97LU2alkqFPs8RCw.0 + - cOJDgcuScESmBfAU8nR/KQ.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 204ms + - 20ms status: code: 200 message: OK - request: - body: '{"topic": "test topic", "members": "sanitized"}' + body: '{"scopes": ["chat"]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '20' + Content-Type: + - application/json + Date: + - Mon, 01 Feb 2021 23:23:48 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:23:47.250249+00:00"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:23:48 GMT + ms-cv: + - p8xayfoxmUKKyCjvuAx7Ng.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 153ms + status: + code: 200 + message: OK +- request: + body: '{"topic": "test topic", "participants": "sanitized"}' headers: Accept: - application/json Content-Length: - - '201' + - '206' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - 7aabb880-06f2-45e1-b093-018d3df07ce0 method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 response: - body: '{"multipleStatus": "sanitized"}' + body: '{"chatThread": {"id": "19:tEPkqgR1t_KWJSQMF31NKlB9SlRBgLnh3MsMO-pxdcw1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:23:48Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffca-6edb-dbb7-3a3a0d002e56"}}' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: application/json; charset=utf-8 - date: Wed, 02 Dec 2020 23:49:38 GMT - ms-cv: nHnPDZ9zske5zVqEeo1Rwg.0 + date: Mon, 01 Feb 2021 23:23:48 GMT + ms-cv: 7j8MQyBdkkuL/uA8vZ2J7A.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 171ms + x-processing-time: 882ms status: - code: 207 - message: Multi-Status - url: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + code: 201 + message: Created + url: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/typing?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/typing?api-version=2020-11-01-preview3 response: body: string: '' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-length: '0' - date: Wed, 02 Dec 2020 23:49:38 GMT - ms-cv: g2ibz0Lg70qp85EMy6B76g.0 + date: Mon, 01 Feb 2021 23:23:49 GMT + ms-cv: Krzp39HLdE20CGu8gO5XZw.0 strict-transport-security: max-age=2592000 - x-processing-time: 83ms + x-processing-time: 383ms status: code: 200 message: OK - url: https://sanitized.communication.azure.com/chat/threads/sanitized/typing?api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized/typing?api-version=2020-11-01-preview3 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 - date: Wed, 02 Dec 2020 23:49:39 GMT - ms-cv: T3jidqAjOkOL9Ni1PTjgXQ.0 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + date: Mon, 01 Feb 2021 23:23:49 GMT + ms-cv: xeRX+l4sQ0CKg5zWWLrF0g.0 strict-transport-security: max-age=2592000 - x-processing-time: 79ms + x-processing-time: 327ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 - request: body: null headers: @@ -202,27 +246,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:49:41 GMT + - Mon, 01 Feb 2021 23:23:51 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:49:40 GMT + - Mon, 01 Feb 2021 23:24:06 GMT ms-cv: - - sljkjsu7PEyQDqQfm6CNkQ.0 + - GF9toK+rIUOudaKkjzDpVw.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 717ms + - 16644ms status: code: 204 message: No Content @@ -238,27 +282,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:49:42 GMT + - Mon, 01 Feb 2021 23:24:07 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:49:41 GMT + - Mon, 01 Feb 2021 23:24:22 GMT ms-cv: - - k0P4W17ddEe7ENijf1dIkg.0 + - 6C5qXWa4E0WTbHl2lwG5RQ.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 703ms + - 16673ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_update_message.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_update_message.yaml index d81271abf4c1..8f7ab1f345ea 100644 --- a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_update_message.yaml +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_update_message.yaml @@ -11,30 +11,30 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:49:43 GMT + - Mon, 01 Feb 2021 23:24:24 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:49:41 GMT + - Mon, 01 Feb 2021 23:24:23 GMT ms-cv: - - N73rrWjhBkGSrNEbCrP6dg.0 + - NQueO+R7EkOZVyAtuON4yQ.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 209ms + - 20ms status: code: 200 message: OK @@ -52,30 +52,30 @@ interactions: Content-Type: - application/json Date: - - Wed, 02 Dec 2020 23:49:43 GMT + - Mon, 01 Feb 2021 23:24:24 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities/sanitized/token?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 response: - body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2020-12-03T23:49:41.6235498+00:00"}' + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:24:22.0437936+00:00"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:49:41 GMT + - Mon, 01 Feb 2021 23:24:23 GMT ms-cv: - - f07EHbw410O2qeMWD4ROjg.0 + - vkN9GtijPUq1zJMp5XnuAw.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 287ms + - 90ms status: code: 200 message: OK @@ -91,88 +91,132 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:49:44 GMT + - Mon, 01 Feb 2021 23:24:24 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: POST - uri: https://sanitized.communication.azure.com/identities?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 response: body: '{"id": "sanitized"}' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 content-type: - application/json; charset=utf-8 date: - - Wed, 02 Dec 2020 23:49:42 GMT + - Mon, 01 Feb 2021 23:24:23 GMT ms-cv: - - A+AAztbiYkuydc+P4qGkBQ.0 + - a/aMXilVbEy+ubNKyuKsQA.0 strict-transport-security: - max-age=2592000 transfer-encoding: - chunked x-processing-time: - - 208ms + - 20ms status: code: 200 message: OK - request: - body: '{"topic": "test topic", "members": "sanitized"}' + body: '{"scopes": ["chat"]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '20' + Content-Type: + - application/json + Date: + - Mon, 01 Feb 2021 23:24:25 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:24:23.2449312+00:00"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:24:23 GMT + ms-cv: + - MnmfPeTv+Ums0E1JwYDWYg.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 90ms + status: + code: 200 + message: OK +- request: + body: '{"topic": "test topic", "participants": "sanitized"}' headers: Accept: - application/json Content-Length: - - '201' + - '206' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - 3a6dd79b-034a-4896-8ee7-323f65ddbecd method: POST - uri: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 response: - body: '{"multipleStatus": "sanitized"}' + body: '{"chatThread": {"id": "19:2MTI6PTB0PTcFtLheTgRhizt-Nj8t_tXmaC40HyGsUs1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:24:25Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffca-fbd8-9c58-373a0d002df3"}}' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: application/json; charset=utf-8 - date: Wed, 02 Dec 2020 23:49:42 GMT - ms-cv: 5loZ2TqpTEm0pLkv/dqqwg.0 + date: Mon, 01 Feb 2021 23:24:25 GMT + ms-cv: AeoCrhUwQEm7knUWoXsJmw.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 181ms + x-processing-time: 1348ms status: - code: 207 - message: Multi-Status - url: https://sanitized.communication.azure.com/chat/threads?api-version=2020-09-21-preview2 + code: 201 + message: Created + url: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 - request: - body: '{"priority": "Normal", "content": "hello world", "senderDisplayName": "sender - name"}' + body: '{"content": "hello world", "senderDisplayName": "sender name", "type": + "text"}' headers: Accept: - application/json Content-Length: - - '84' + - '78' Content-Type: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: POST - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?api-version=2020-11-01-preview3 response: body: '{"id": "sanitized"}' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 content-type: application/json; charset=utf-8 - date: Wed, 02 Dec 2020 23:49:42 GMT - ms-cv: chFV9Sahr0Wlk83TRzePYA.0 + date: Mon, 01 Feb 2021 23:24:25 GMT + ms-cv: RaphM8ii4E62Td9Vy3tRzg.0 strict-transport-security: max-age=2592000 transfer-encoding: chunked - x-processing-time: 129ms + x-processing-time: 378ms status: code: 201 message: Created - url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages?api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages?api-version=2020-11-01-preview3 - request: body: '{"content": "updated message content"}' headers: @@ -181,47 +225,46 @@ interactions: Content-Length: - '38' Content-Type: - - application/json + - application/merge-patch+json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: PATCH - uri: https://sanitized.communication.azure.com/chat/threads/sanitized/messages/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 - content-length: '0' - date: Wed, 02 Dec 2020 23:49:43 GMT - ms-cv: NBx6Y45IU0uLuc8c8lOR0Q.0 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + date: Mon, 01 Feb 2021 23:24:26 GMT + ms-cv: 3UNeoTGzQU2LgfF85fTEJw.0 strict-transport-security: max-age=2592000 - x-processing-time: 150ms + x-processing-time: 689ms status: - code: 200 - message: OK - url: https://sanitized.communication.azure.com/chat/threads/sanitized/messages/sanitized?api-version=2020-09-21-preview2 + code: 204 + message: No Content + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized/messages/sanitized?api-version=2020-11-01-preview3 - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-communication-chat/1.0.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) method: DELETE - uri: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 response: body: string: '' headers: - api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3 - date: Wed, 02 Dec 2020 23:49:43 GMT - ms-cv: HKK87HnDKkKZg0QNYkB9Ow.0 + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + date: Mon, 01 Feb 2021 23:24:26 GMT + ms-cv: j0yeH8iha0aYMv7WFDihbQ.0 strict-transport-security: max-age=2592000 - x-processing-time: 83ms + x-processing-time: 292ms status: code: 204 message: No Content - url: https://sanitized.communication.azure.com/chat/threads/sanitized?api-version=2020-09-21-preview2 + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 - request: body: null headers: @@ -234,27 +277,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:49:45 GMT + - Mon, 01 Feb 2021 23:24:28 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:49:44 GMT + - Mon, 01 Feb 2021 23:24:42 GMT ms-cv: - - o+7XSgI0a0W7uiRuXA2eQw.0 + - BHz24HBbQUqWOnI43uiBmA.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 977ms + - 16392ms status: code: 204 message: No Content @@ -270,27 +313,27 @@ interactions: Content-Length: - '0' Date: - - Wed, 02 Dec 2020 23:49:46 GMT + - Mon, 01 Feb 2021 23:24:44 GMT User-Agent: - - azsdk-python-communication-administration/1.0.0b1 Python/3.8.5 (Windows-10-10.0.19041-SP0) + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/identities/sanitized?api-version=2020-07-20-preview2 + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 response: body: string: '' headers: api-supported-versions: - - 2020-01-15-preview3, 2020-07-20-preview1, 2020-07-20-preview2 + - 2020-07-20-preview2, 2021-03-07 date: - - Wed, 02 Dec 2020 23:49:45 GMT + - Mon, 01 Feb 2021 23:25:00 GMT ms-cv: - - nNACx7udx0moIlSNnZSOrA.0 + - T7RlBrl7pk2oGnwnOm3tgw.0 strict-transport-security: - max-age=2592000 x-processing-time: - - 819ms + - 16807ms status: code: 204 message: No Content diff --git a/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_update_topic.yaml b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_update_topic.yaml new file mode 100644 index 000000000000..08d69a5868bb --- /dev/null +++ b/sdk/communication/azure-communication-chat/tests/recordings/test_chat_thread_client_e2e_async.test_update_topic.yaml @@ -0,0 +1,312 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:25:01 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:25:00 GMT + ms-cv: + - 2dcZKwGztEOEKkZAsul9eQ.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 17ms + status: + code: 200 + message: OK +- request: + body: '{"scopes": ["chat"]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '20' + Content-Type: + - application/json + Date: + - Mon, 01 Feb 2021 23:25:01 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:24:59.2464733+00:00"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:25:00 GMT + ms-cv: + - fjhnvlxBckyB76BFwWBzDA.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 313ms + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:25:02 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:25:00 GMT + ms-cv: + - 9xbaB/WHXkKzoHd2WO9bWA.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 18ms + status: + code: 200 + message: OK +- request: + body: '{"scopes": ["chat"]}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '20' + Content-Type: + - application/json + Date: + - Mon, 01 Feb 2021 23:25:02 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.int.communication.azure.net/identities/sanitized/token?api-version=2020-07-20-preview2 + response: + body: '{"id": "sanitized", "token": "sanitized", "expiresOn": "2021-02-02T23:25:00.4460578+00:00"}' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 01 Feb 2021 23:25:01 GMT + ms-cv: + - S9tEyVnz6UCRoXkZtHAmJQ.0 + strict-transport-security: + - max-age=2592000 + transfer-encoding: + - chunked + x-processing-time: + - 97ms + status: + code: 200 + message: OK +- request: + body: '{"topic": "test topic", "participants": "sanitized"}' + headers: + Accept: + - application/json + Content-Length: + - '206' + Content-Type: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + repeatability-Request-ID: + - 5344baaa-3075-4ee4-8584-1f1266d2f48f + method: POST + uri: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 + response: + body: '{"chatThread": {"id": "19:c1g_oYg7_vPsF712L8A4rTSaGthY3oPMWbFopDEKJ-Q1@thread.v2", + "topic": "test topic", "createdOn": "2021-02-01T23:25:02Z", "createdBy": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-ffcb-8c56-1db7-3a3a0d002bc4"}}' + headers: + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + content-type: application/json; charset=utf-8 + date: Mon, 01 Feb 2021 23:25:02 GMT + ms-cv: 8nmV+pdLDUajx3HByK3wAw.0 + strict-transport-security: max-age=2592000 + transfer-encoding: chunked + x-processing-time: 1336ms + status: + code: 201 + message: Created + url: https://sanitized.int.communication.azure.net/chat/threads?api-version=2020-11-01-preview3 +- request: + body: '{"topic": "update topic"}' + headers: + Accept: + - application/json + Content-Length: + - '25' + Content-Type: + - application/merge-patch+json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: PATCH + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 + response: + body: + string: '' + headers: + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + date: Mon, 01 Feb 2021 23:25:03 GMT + ms-cv: fCHD61AmB0iauk0cKu51jA.0 + strict-transport-security: max-age=2592000 + x-processing-time: 519ms + status: + code: 204 + message: No Content + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-communication-chat/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 + response: + body: + string: '' + headers: + api-supported-versions: 2020-09-21-preview2, 2020-11-01-preview3, 2021-01-27-preview4 + date: Mon, 01 Feb 2021 23:25:03 GMT + ms-cv: 622slNwA/0GD/HwYJmKGyg.0 + strict-transport-security: max-age=2592000 + x-processing-time: 343ms + status: + code: 204 + message: No Content + url: https://sanitized.int.communication.azure.net/chat/threads/sanitized?api-version=2020-11-01-preview3 +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:25:04 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + date: + - Mon, 01 Feb 2021 23:25:20 GMT + ms-cv: + - 425u9POIzUiVuM3AMJf4sw.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 16594ms + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 01 Feb 2021 23:25:21 GMT + User-Agent: + - azsdk-python-communication-identity/1.0.0b4 Python/3.7.9 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.int.communication.azure.net/identities/sanitized?api-version=2020-07-20-preview2 + response: + body: + string: '' + headers: + api-supported-versions: + - 2020-07-20-preview2, 2021-03-07 + date: + - Mon, 01 Feb 2021 23:25:37 GMT + ms-cv: + - ooMUGjkXbkqGD3G4ZsL8tg.0 + strict-transport-security: + - max-age=2592000 + x-processing-time: + - 16964ms + status: + code: 204 + message: No Content +version: 1 diff --git a/sdk/communication/azure-communication-chat/tests/test_chat_client.py b/sdk/communication/azure-communication-chat/tests/test_chat_client.py index b38c1936aace..4c6d5e2affd3 100644 --- a/sdk/communication/azure-communication-chat/tests/test_chat_client.py +++ b/sdk/communication/azure-communication-chat/tests/test_chat_client.py @@ -11,7 +11,7 @@ from msrest.serialization import TZ_UTC from azure.communication.chat import ( ChatClient, - ChatThreadMember, + ChatThreadParticipant, CommunicationUserIdentifier, CommunicationTokenCredential ) @@ -37,19 +37,62 @@ def test_create_chat_thread(self): raised = False def mock_send(*_, **__): - return mock_response(status_code=207, json_payload={"multipleStatus": [{"id": thread_id, "statusCode": 201, "type": "Thread"}]}) + return mock_response(status_code=201, json_payload={ + "chatThread": { + "id": thread_id, + "topic": "test topic", + "createdOn": "2020-12-03T21:09:17Z", + "createdBy": "8:acs:57b9bac9-df6c-4d39-a73b-26e944adf6ea_9b0110-08007f1041" + } + }) chat_client = ChatClient("https://endpoint", TestChatClient.credential, transport=Mock(send=mock_send)) topic="test topic" user = CommunicationUserIdentifier("8:acs:57b9bac9-df6c-4d39-a73b-26e944adf6ea_9b0110-08007f1041") - members=[ChatThreadMember( + participants=[ChatThreadParticipant( user=user, display_name='name', share_history_time=datetime.utcnow() )] try: - chat_thread_client = chat_client.create_chat_thread(topic, members) + chat_thread_client = chat_client.create_chat_thread(topic, participants) + except: + raised = True + raise + + self.assertFalse(raised, 'Expected is no excpetion raised') + assert chat_thread_client.thread_id == thread_id + + def test_create_chat_thread_w_repeatability_request_id(self): + thread_id = "19:bcaebfba0d314c2aa3e920d38fa3df08@thread.v2" + chat_thread_client = None + raised = False + repeatability_request_id="b66d6031-fdcc-41df-8306-e524c9f226b8" + + def mock_send(*_, **__): + return mock_response(status_code=201, json_payload={ + "chatThread": { + "id": thread_id, + "topic": "test topic", + "createdOn": "2020-12-03T21:09:17Z", + "createdBy": "8:acs:57b9bac9-df6c-4d39-a73b-26e944adf6ea_9b0110-08007f1041" + } + }) + + chat_client = ChatClient("https://endpoint", TestChatClient.credential, transport=Mock(send=mock_send)) + + topic = "test topic" + user = CommunicationUserIdentifier("8:acs:57b9bac9-df6c-4d39-a73b-26e944adf6ea_9b0110-08007f1041") + participants = [ChatThreadParticipant( + user=user, + display_name='name', + share_history_time=datetime.utcnow() + )] + try: + chat_thread_client = chat_client.create_chat_thread(topic=topic, + thread_participants=participants, + repeatability_request_id=repeatability_request_id) except: raised = True raise @@ -64,13 +107,13 @@ def mock_send(*_, **__): topic="test topic", user = CommunicationUserIdentifier("8:acs:57b9bac9-df6c-4d39-a73b-26e944adf6ea_9b0110-08007f1041") - thread_members=[ChatThreadMember( + thread_participants=[ChatThreadParticipant( user=user, display_name='name', share_history_time=datetime.utcnow() )] - self.assertRaises(HttpResponseError, chat_client.create_chat_thread, topic=topic, thread_members=thread_members) + self.assertRaises(HttpResponseError, chat_client.create_chat_thread, topic=topic, thread_participants=thread_participants) def test_delete_chat_thread(self): thread_id = "19:bcaebfba0d314c2aa3e920d38fa3df08@thread.v2" @@ -95,7 +138,7 @@ def mock_send(*_, **__): return mock_response(status_code=200, json_payload={ "id": thread_id, "created_by": "8:acs:resource_user", - "members": [{"id": "", "display_name": "name", "share_history_time": "1970-01-01T00:00:00Z"}] + "participants": [{"id": "", "display_name": "name", "share_history_time": "1970-01-01T00:00:00Z"}] }) chat_client = ChatClient("https://endpoint", TestChatClient.credential, transport=Mock(send=mock_send)) diff --git a/sdk/communication/azure-communication-chat/tests/test_chat_client_async.py b/sdk/communication/azure-communication-chat/tests/test_chat_client_async.py index 2a409042748f..e76a0810ca56 100644 --- a/sdk/communication/azure-communication-chat/tests/test_chat_client_async.py +++ b/sdk/communication/azure-communication-chat/tests/test_chat_client_async.py @@ -5,11 +5,10 @@ # ------------------------------------------------------------------------- from azure.core.credentials import AccessToken from azure.communication.chat.aio import ( - ChatClient, - CommunicationTokenCredential + ChatClient ) from azure.communication.chat import ( - ChatThreadMember, + ChatThreadParticipant, CommunicationUserIdentifier ) from unittest_helpers import mock_response @@ -32,18 +31,53 @@ async def test_create_chat_thread(): thread_id = "19:bcaebfba0d314c2aa3e920d38fa3df08@thread.v2" async def mock_send(*_, **__): - return mock_response(status_code=207, json_payload={"multipleStatus": [{"id": thread_id, "statusCode": 201, "type": "Thread"}]}) + return mock_response(status_code=201, json_payload={ + "chatThread": { + "id": thread_id, + "topic": "test topic", + "createdOn": "2020-12-03T21:09:17Z", + "createdBy": "8:acs:57b9bac9-df6c-4d39-a73b-26e944adf6ea_9b0110-08007f1041" + } + }) + + chat_client = ChatClient("https://endpoint", credential, transport=Mock(send=mock_send)) + + topic="test topic" + user = CommunicationUserIdentifier("8:acs:57b9bac9-df6c-4d39-a73b-26e944adf6ea_9b0110-08007f1041") + participants=[ChatThreadParticipant( + user=user, + display_name='name', + share_history_time=datetime.utcnow() + )] + chat_thread_client = await chat_client.create_chat_thread(topic, participants) + assert chat_thread_client.thread_id == thread_id + +@pytest.mark.asyncio +async def test_create_chat_thread_w_repeatability_request_id(): + thread_id = "19:bcaebfba0d314c2aa3e920d38fa3df08@thread.v2" + repeatability_request_id = "b66d6031-fdcc-41df-8306-e524c9f226b8" + async def mock_send(*_, **__): + return mock_response(status_code=201, json_payload={ + "chatThread": { + "id": thread_id, + "topic": "test topic", + "createdOn": "2020-12-03T21:09:17Z", + "createdBy": "8:acs:57b9bac9-df6c-4d39-a73b-26e944adf6ea_9b0110-08007f1041" + } + }) chat_client = ChatClient("https://endpoint", credential, transport=Mock(send=mock_send)) topic="test topic" user = CommunicationUserIdentifier("8:acs:57b9bac9-df6c-4d39-a73b-26e944adf6ea_9b0110-08007f1041") - members=[ChatThreadMember( + participants=[ChatThreadParticipant( user=user, display_name='name', share_history_time=datetime.utcnow() )] - chat_thread_client = await chat_client.create_chat_thread(topic, members) + chat_thread_client = await chat_client.create_chat_thread(topic=topic, + thread_participants=participants, + repeatability_request_id=repeatability_request_id) assert chat_thread_client.thread_id == thread_id @pytest.mark.asyncio @@ -54,7 +88,7 @@ async def mock_send(*_, **__): topic="test topic", user = CommunicationUserIdentifier("8:acs:57b9bac9-df6c-4d39-a73b-26e944adf6ea_9b0110-08007f1041") - members=[ChatThreadMember( + participants=[ChatThreadParticipant( user=user, display_name='name', share_history_time=datetime.utcnow() @@ -62,7 +96,7 @@ async def mock_send(*_, **__): raised = False try: - await chat_client.create_chat_thread(topic=topic, thread_members=members) + await chat_client.create_chat_thread(topic=topic, thread_participants=participants) except: raised = True @@ -94,7 +128,7 @@ async def mock_send(*_, **__): return mock_response(status_code=200, json_payload={ "id": thread_id, "created_by": "8:acs:resource_user", - "members": [{"id": "", "display_name": "name", "share_history_time": "1970-01-01T00:00:00Z"}] + "participants": [{"id": "", "display_name": "name", "share_history_time": "1970-01-01T00:00:00Z"}] }) chat_client = ChatClient("https://endpoint", credential, transport=Mock(send=mock_send)) diff --git a/sdk/communication/azure-communication-chat/tests/test_chat_client_e2e.py b/sdk/communication/azure-communication-chat/tests/test_chat_client_e2e.py index 0036d0b263f4..c57f10713c36 100644 --- a/sdk/communication/azure-communication-chat/tests/test_chat_client_e2e.py +++ b/sdk/communication/azure-communication-chat/tests/test_chat_client_e2e.py @@ -9,13 +9,14 @@ from datetime import datetime from devtools_testutils import AzureTestCase from msrest.serialization import TZ_UTC +from uuid import uuid4 from azure.communication.identity import CommunicationIdentityClient from azure.communication.chat import ( ChatClient, CommunicationTokenCredential, CommunicationTokenRefreshOptions, - ChatThreadMember + ChatThreadParticipant ) from azure.communication.chat._shared.utils import parse_connection_str @@ -33,7 +34,7 @@ def setUp(self): super(ChatClientTest, self).setUp() self.recording_processors.extend([ - BodyReplacerProcessor(keys=["id", "token", "createdBy", "members", "multipleStatus", "value"]), + BodyReplacerProcessor(keys=["id", "token", "createdBy", "participants", "multipleStatus", "value"]), URIIdentityReplacer(), ChatURIReplacer()]) @@ -60,17 +61,17 @@ def tearDown(self): self.identity_client.delete_user(self.user) self.chat_client.delete_chat_thread(self.thread_id) - def _create_thread(self): + def _create_thread(self, repeatability_request_id=None): # create chat thread topic = "test topic" share_history_time = datetime.utcnow() share_history_time = share_history_time.replace(tzinfo=TZ_UTC) - members = [ChatThreadMember( + participants = [ChatThreadParticipant( user=self.user, display_name='name', share_history_time=share_history_time )] - chat_thread_client = self.chat_client.create_chat_thread(topic, members) + chat_thread_client = self.chat_client.create_chat_thread(topic, participants, repeatability_request_id) self.thread_id = chat_thread_client.thread_id @pytest.mark.live_test_only @@ -78,6 +79,19 @@ def test_create_chat_thread(self): self._create_thread() assert self.thread_id is not None + @pytest.mark.live_test_only + def test_create_chat_thread_w_repeatability_request_id(self): + repeatability_request_id = str(uuid4()) + # create thread + self._create_thread(repeatability_request_id=repeatability_request_id) + thread_id = self.thread_id + + # re-create thread with same repeatability_request_id + self._create_thread(repeatability_request_id=repeatability_request_id) + + # test idempotency + assert thread_id == self.thread_id + @pytest.mark.live_test_only def test_get_chat_thread(self): self._create_thread() diff --git a/sdk/communication/azure-communication-chat/tests/test_chat_client_e2e_async.py b/sdk/communication/azure-communication-chat/tests/test_chat_client_e2e_async.py index 72f727dcaeec..a71e749a2090 100644 --- a/sdk/communication/azure-communication-chat/tests/test_chat_client_e2e_async.py +++ b/sdk/communication/azure-communication-chat/tests/test_chat_client_e2e_async.py @@ -8,6 +8,7 @@ import os from datetime import datetime from msrest.serialization import TZ_UTC +from uuid import uuid4 from azure.communication.identity import CommunicationIdentityClient from azure.communication.chat.aio import ( @@ -16,7 +17,7 @@ CommunicationTokenRefreshOptions ) from azure.communication.chat import ( - ChatThreadMember + ChatThreadParticipant ) from azure.communication.identity._shared.utils import parse_connection_str from azure_devtools.scenario_tests import RecordingProcessor @@ -31,7 +32,7 @@ def setUp(self): super(ChatClientTestAsync, self).setUp() self.recording_processors.extend([ - BodyReplacerProcessor(keys=["id", "token", "createdBy", "members", "multipleStatus", "value"]), + BodyReplacerProcessor(keys=["id", "token", "createdBy", "participants", "multipleStatus", "value"]), URIIdentityReplacer(), ResponseReplacerProcessor(keys=[self._resource_name]), ChatURIReplacer()]) @@ -57,17 +58,17 @@ def tearDown(self): if not self.is_playback(): self.identity_client.delete_user(self.user) - async def _create_thread(self): + async def _create_thread(self, repeatability_request_id=None): # create chat thread topic = "test topic" share_history_time = datetime.utcnow() share_history_time = share_history_time.replace(tzinfo=TZ_UTC) - members = [ChatThreadMember( + participants = [ChatThreadParticipant( user=self.user, display_name='name', share_history_time=share_history_time )] - chat_thread_client = await self.chat_client.create_chat_thread(topic, members) + chat_thread_client = await self.chat_client.create_chat_thread(topic, participants, repeatability_request_id) self.thread_id = chat_thread_client.thread_id @pytest.mark.live_test_only @@ -81,6 +82,27 @@ async def test_create_chat_thread_async(self): if not self.is_playback(): await self.chat_client.delete_chat_thread(self.thread_id) + @pytest.mark.live_test_only + @AsyncCommunicationTestCase.await_prepared_test + async def test_create_chat_thread_w_repeatability_request_id_async(self): + async with self.chat_client: + repeatability_request_id = str(uuid4()) + + # create thread + await self._create_thread(repeatability_request_id=repeatability_request_id) + assert self.thread_id is not None + thread_id = self.thread_id + + # re-create thread + await self._create_thread(repeatability_request_id=repeatability_request_id) + assert thread_id == self.thread_id + + + # delete created users and chat threads + if not self.is_playback(): + await self.chat_client.delete_chat_thread(self.thread_id) + + @pytest.mark.live_test_only @AsyncCommunicationTestCase.await_prepared_test async def test_get_chat_thread(self): diff --git a/sdk/communication/azure-communication-chat/tests/test_chat_thread_client.py b/sdk/communication/azure-communication-chat/tests/test_chat_thread_client.py index b3cc8f3b4dfd..c4778586c2cc 100644 --- a/sdk/communication/azure-communication-chat/tests/test_chat_thread_client.py +++ b/sdk/communication/azure-communication-chat/tests/test_chat_thread_client.py @@ -11,10 +11,10 @@ from azure.core.exceptions import HttpResponseError from azure.communication.chat import ( ChatThreadClient, - ChatMessagePriority, - ChatThreadMember, + ChatThreadParticipant, CommunicationUserIdentifier, - CommunicationTokenCredential + CommunicationTokenCredential, + ChatMessageType ) from unittest_helpers import mock_response @@ -30,17 +30,17 @@ def setUpClass(cls, credential): credential.get_token = Mock(return_value=AccessToken("some_token", datetime.now().replace(tzinfo=TZ_UTC))) TestChatThreadClient.credential = credential - def test_update_thread(self): + def test_update_topic(self): thread_id = "19:bcaebfba0d314c2aa3e920d38fa3df08@thread.v2" raised = False def mock_send(*_, **__): - return mock_response(status_code=200) + return mock_response(status_code=204) chat_thread_client = ChatThreadClient("https://endpoint", TestChatThreadClient.credential, thread_id, transport=Mock(send=mock_send)) topic = "update topic" try: - chat_thread_client.update_thread(topic=topic) + chat_thread_client.update_topic(topic=topic) except: raised = True @@ -57,27 +57,128 @@ def mock_send(*_, **__): create_message_result = None try: - priority=ChatMessagePriority.NORMAL content='hello world' sender_display_name='sender name' - - create_message_result = chat_thread_client.send_message( - content, - priority=priority, + create_message_result_id = chat_thread_client.send_message( + content=content, sender_display_name=sender_display_name) except: raised = True self.assertFalse(raised, 'Expected is no excpetion raised') - assert create_message_result.id == message_id + assert create_message_result_id == message_id + + def test_send_message_w_type(self): + thread_id = "19:bcaebfba0d314c2aa3e920d38fa3df08@thread.v2" + message_id='1596823919339' + raised = False + message_str = "Hi I am Bob." + + chat_message_types = [ChatMessageType.TEXT, ChatMessageType.HTML, "text", "html"] + + for chat_message_type in chat_message_types: + + def mock_send(*_, **__): + return mock_response(status_code=201, json_payload={ + "id": message_id, + "type": chat_message_type, + "sequenceId": "3", + "version": message_id, + "content": { + "message": message_str, + "topic": "Lunch Chat thread", + "participants": [ + { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b", + "displayName": "Bob", + "shareHistoryTime": "2020-10-30T10:50:50Z" + } + ], + "initiator": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" + }, + "senderDisplayName": "Bob", + "createdOn": "2021-01-27T01:37:33Z", + "senderId": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-e155-1f06-1db7-3a3a0d00004b" + }) + + chat_thread_client = ChatThreadClient("https://endpoint", TestChatThreadClient.credential, thread_id, + transport=Mock(send=mock_send)) + + try: + content='hello world' + sender_display_name='sender name' + create_message_result_id = chat_thread_client.send_message( + content=content, + chat_message_type=chat_message_type, + sender_display_name=sender_display_name) + except: + raised = True + + self.assertFalse(raised, 'Expected is no excpetion raised') + assert create_message_result_id == message_id + + def test_send_message_w_invalid_type_throws_error(self): + thread_id = "19:bcaebfba0d314c2aa3e920d38fa3df08@thread.v2" + message_id='1596823919339' + raised = False + message_str = "Hi I am Bob." + + # the payload is irrelevant - it'll fail before + def mock_send(*_, **__): + return mock_response(status_code=201, json_payload={ + "id": message_id + }) + chat_thread_client = ChatThreadClient("https://endpoint", TestChatThreadClient.credential, thread_id, transport=Mock(send=mock_send)) + + create_message_result = None + + chat_message_types = [ChatMessageType.PARTICIPANT_ADDED, ChatMessageType.PARTICIPANT_REMOVED, + ChatMessageType.TOPIC_UPDATED, "participant_added", "participant_removed", "topic_updated", + "ChatMessageType.TEXT", "ChatMessageType.HTML", + "ChatMessageType.PARTICIPANT_ADDED", "ChatMessageType.PARTICIPANT_REMOVED", + "ChatMessageType.TOPIC_UPDATED"] + for chat_message_type in chat_message_types: + try: + content='hello world' + sender_display_name='sender name' + create_message_result_id = chat_thread_client.send_message( + content=content, + chat_message_type=chat_message_type, + sender_display_name=sender_display_name) + except: + raised = True + + self.assertTrue(raised, 'Expected is excpetion raised') + def test_get_message(self): thread_id = "19:bcaebfba0d314c2aa3e920d38fa3df08@thread.v2" message_id='1596823919339' raised = False + message_str = "Hi I am Bob." def mock_send(*_, **__): - return mock_response(status_code=200, json_payload={"id": message_id}) + return mock_response(status_code=200, json_payload={ + "id": message_id, + "type": "text", + "sequenceId": "3", + "version": message_id, + "content": { + "message": message_str, + "topic": "Lunch Chat thread", + "participants": [ + { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b", + "displayName": "Bob", + "shareHistoryTime": "2020-10-30T10:50:50Z" + } + ], + "initiator": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" + }, + "senderDisplayName": "Bob", + "createdOn": "2021-01-27T01:37:33Z", + "senderId": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-e155-1f06-1db7-3a3a0d00004b" + }) chat_thread_client = ChatThreadClient("https://endpoint", TestChatThreadClient.credential, thread_id, transport=Mock(send=mock_send)) message = None @@ -88,6 +189,9 @@ def mock_send(*_, **__): self.assertFalse(raised, 'Expected is no excpetion raised') assert message.id == message_id + assert message.content.message == message_str + assert message.type == ChatMessageType.TEXT + assert len(message.content.participants) > 0 def test_list_messages(self): thread_id = "19:bcaebfba0d314c2aa3e920d38fa3df08@thread.v2" @@ -95,7 +199,18 @@ def test_list_messages(self): raised = False def mock_send(*_, **__): - return mock_response(status_code=200, json_payload={"value": [{"id": message_id}]}) + return mock_response(status_code=200, json_payload={"value": [{ + "id": message_id, + "type": "text", + "sequenceId": "3", + "version": message_id, + "content": { + "message": "Hi I am Bob." + }, + "senderDisplayName": "Bob", + "createdOn": "2021-01-27T01:37:33Z", + "senderId": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-e155-1f06-1db7-3a3a0d00004b" + }]}) chat_thread_client = ChatThreadClient("https://endpoint", TestChatThreadClient.credential, thread_id, transport=Mock(send=mock_send)) chat_messages = None @@ -113,13 +228,45 @@ def mock_send(*_, **__): def test_list_messages_with_start_time(self): thread_id = "19:bcaebfba0d314c2aa3e920d38fa3df08@thread.v2" raised = False + message_id = '1596823919339' def mock_send(*_, **__): return mock_response(status_code=200, json_payload={ "value": [ - {"id": "message_id1", "createdOn": "2020-08-17T18:05:44Z"}, - {"id": "message_id2", "createdOn": "2020-08-17T23:13:33Z"} - ]}) + { + "id": message_id, + "type": "text", + "sequenceId": "3", + "version": message_id, + "content": { + "message": "Hi I am Bob." + }, + "senderDisplayName": "Bob", + "createdOn": "2021-01-27T01:37:33Z", + "senderId": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-e155-1f06-1db7-3a3a0d00004b" + }, + { + "id": message_id, + "type": "text", + "sequenceId": "3", + "version": message_id, + "content": { + "message": "Come one guys, lets go for lunch together.", + "topic": "Lunch Chat thread", + "participants": [ + { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b", + "displayName": "Bob", + "shareHistoryTime": "2020-10-30T10:50:50Z" + } + ], + "initiator": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" + }, + "senderDisplayName": "Bob", + "createdOn": "2021-01-27T01:37:33Z", + "senderId": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-e155-1f06-1db7-3a3a0d00004b" + } + ]}) chat_thread_client = ChatThreadClient("https://endpoint", TestChatThreadClient.credential, thread_id, transport=Mock(send=mock_send)) chat_messages = None @@ -141,7 +288,7 @@ def test_update_message(self): raised = False def mock_send(*_, **__): - return mock_response(status_code=200) + return mock_response(status_code=204) chat_thread_client = ChatThreadClient("https://endpoint", TestChatThreadClient.credential, thread_id, transport=Mock(send=mock_send)) try: @@ -168,52 +315,100 @@ def mock_send(*_, **__): self.assertFalse(raised, 'Expected is no excpetion raised') - def test_list_members(self): + def test_list_participants(self): thread_id = "19:bcaebfba0d314c2aa3e920d38fa3df08@thread.v2" - member_id="8:acs:57b9bac9-df6c-4d39-a73b-26e944adf6ea_9b0110-08007f1041" + participant_id="8:acs:57b9bac9-df6c-4d39-a73b-26e944adf6ea_9b0110-08007f1041" raised = False def mock_send(*_, **__): - return mock_response(status_code=200, json_payload={"value": [{"id": member_id}]}) + return mock_response(status_code=200, json_payload={"value": [{"id": participant_id}]}) chat_thread_client = ChatThreadClient("https://endpoint", TestChatThreadClient.credential, thread_id, transport=Mock(send=mock_send)) - chat_thread_members = None + chat_thread_participants = None try: - chat_thread_members = chat_thread_client.list_members() + chat_thread_participants = chat_thread_client.list_participants() except: raised = True self.assertFalse(raised, 'Expected is no excpetion raised') - for chat_thread_member_page in chat_thread_members.by_page(): - l = list(chat_thread_member_page) + for chat_thread_participant_page in chat_thread_participants.by_page(): + l = list(chat_thread_participant_page) assert len(l) == 1 - l[0].user.id = member_id + l[0].user.id = participant_id + + def test_list_participants_with_results_per_page(self): + thread_id = "19:81181a8abbf54b5695f87a0042ddcba9@thread.v2" + participant_id_1 = "8:acs:9b665d53-8164-4923-ad5d-5e983b07d2e7_00000006-5399-552c-b274-5a3a0d0000dc" + participant_id_2 = "8:acs:9b665d53-8164-4923-ad5d-5e983b07d2e7_00000006-9d32-35c9-557d-5a3a0d0002f1" + raised = False + + def mock_send(*_, **__): + return mock_response(status_code=200, json_payload={ + "value": [ + {"id": participant_id_1}, + {"id": participant_id_2} + ]}) + + chat_thread_client = ChatThreadClient("https://endpoint", TestChatThreadClient.credential, thread_id, + transport=Mock(send=mock_send)) - def test_add_members(self): + chat_thread_participants = None + try: + chat_thread_participants = chat_thread_client.list_participants(results_per_page=2) + except: + raised = True + + self.assertFalse(raised, 'Expected is no excpetion raised') + for chat_thread_participant_page in chat_thread_participants.by_page(): + l = list(chat_thread_participant_page) + assert len(l) == 2 + + def test_add_participant(self): thread_id = "19:bcaebfba0d314c2aa3e920d38fa3df08@thread.v2" - new_member_id="8:acs:57b9bac9-df6c-4d39-a73b-26e944adf6ea_9b0110-08007f1041" + new_participant_id="8:acs:57b9bac9-df6c-4d39-a73b-26e944adf6ea_9b0110-08007f1041" raised = False def mock_send(*_, **__): - return mock_response(status_code=207) + return mock_response(status_code=201) chat_thread_client = ChatThreadClient("https://endpoint", TestChatThreadClient.credential, thread_id, transport=Mock(send=mock_send)) - new_member = ChatThreadMember( - user=CommunicationUserIdentifier(new_member_id), + new_participant = ChatThreadParticipant( + user=CommunicationUserIdentifier(new_participant_id), display_name='name', share_history_time=datetime.utcnow()) - members = [new_member] try: - chat_thread_client.add_members(members) + chat_thread_client.add_participant(new_participant) except: raised = True self.assertFalse(raised, 'Expected is no excpetion raised') - def test_remove_member(self): + def test_add_participants(self): thread_id = "19:bcaebfba0d314c2aa3e920d38fa3df08@thread.v2" - member_id="8:acs:57b9bac9-df6c-4d39-a73b-26e944adf6ea_9b0110-08007f1041" + new_participant_id="8:acs:57b9bac9-df6c-4d39-a73b-26e944adf6ea_9b0110-08007f1041" + raised = False + + def mock_send(*_, **__): + return mock_response(status_code=201) + chat_thread_client = ChatThreadClient("https://endpoint", TestChatThreadClient.credential, thread_id, transport=Mock(send=mock_send)) + + new_participant = ChatThreadParticipant( + user=CommunicationUserIdentifier(new_participant_id), + display_name='name', + share_history_time=datetime.utcnow()) + participants = [new_participant] + + try: + chat_thread_client.add_participants(participants) + except: + raised = True + + self.assertFalse(raised, 'Expected is no excpetion raised') + + def test_remove_participant(self): + thread_id = "19:bcaebfba0d314c2aa3e920d38fa3df08@thread.v2" + participant_id="8:acs:57b9bac9-df6c-4d39-a73b-26e944adf6ea_9b0110-08007f1041" raised = False def mock_send(*_, **__): @@ -221,7 +416,7 @@ def mock_send(*_, **__): chat_thread_client = ChatThreadClient("https://endpoint", TestChatThreadClient.credential, thread_id, transport=Mock(send=mock_send)) try: - chat_thread_client.remove_member(CommunicationUserIdentifier(member_id)) + chat_thread_client.remove_participant(user=CommunicationUserIdentifier(participant_id)) except: raised = True @@ -248,7 +443,7 @@ def test_send_read_receipt(self): raised = False def mock_send(*_, **__): - return mock_response(status_code=201) + return mock_response(status_code=200) chat_thread_client = ChatThreadClient("https://endpoint", TestChatThreadClient.credential, thread_id, transport=Mock(send=mock_send)) try: @@ -278,6 +473,31 @@ def mock_send(*_, **__): l = list(read_receipt_page) assert len(l) == 1 + def test_list_read_receipts_with_results_per_page(self): + thread_id = "19:bcaebfba0d314c2aa3e920d38fa3df08@thread.v2" + message_id_1="1596823919339" + message_id_2="1596823919340" + raised = False + + def mock_send(*_, **__): + return mock_response(status_code=200, json_payload={ + "value": [ + {"chatMessageId": message_id_1}, + {"chatMessageId": message_id_2} + ]}) + chat_thread_client = ChatThreadClient("https://endpoint", TestChatThreadClient.credential, thread_id, transport=Mock(send=mock_send)) + + read_receipts = None + try: + read_receipts = chat_thread_client.list_read_receipts(results_per_page=2) + except: + raised = True + + self.assertFalse(raised, 'Expected is no excpetion raised') + for read_receipt_page in read_receipts.by_page(): + l = list(read_receipt_page) + assert len(l) == 2 + if __name__ == '__main__': unittest.main() diff --git a/sdk/communication/azure-communication-chat/tests/test_chat_thread_client_async.py b/sdk/communication/azure-communication-chat/tests/test_chat_thread_client_async.py index 946cbed5160a..bf404b459930 100644 --- a/sdk/communication/azure-communication-chat/tests/test_chat_thread_client_async.py +++ b/sdk/communication/azure-communication-chat/tests/test_chat_thread_client_async.py @@ -8,9 +8,9 @@ from msrest.serialization import TZ_UTC from azure.communication.chat.aio import ChatThreadClient from azure.communication.chat import ( - ChatMessagePriority, - ChatThreadMember, + ChatThreadParticipant, CommunicationUserIdentifier, + ChatMessageType ) from unittest_helpers import mock_response from azure.core.exceptions import HttpResponseError @@ -26,17 +26,17 @@ credential.get_token = Mock(return_value=AccessToken("some_token", datetime.now().replace(tzinfo=TZ_UTC))) @pytest.mark.asyncio -async def test_update_thread(): +async def test_update_topic(): thread_id = "19:bcaebfba0d314c2aa3e920d38fa3df08@thread.v2" raised = False async def mock_send(*_, **__): - return mock_response(status_code=200) + return mock_response(status_code=204) chat_thread_client = ChatThreadClient("https://endpoint", credential, thread_id, transport=Mock(send=mock_send)) topic = "update topic" try: - await chat_thread_client.update_thread(topic=topic) + await chat_thread_client.update_topic(topic=topic) except: raised = True @@ -52,30 +52,135 @@ async def mock_send(*_, **__): return mock_response(status_code=201, json_payload={"id": message_id}) chat_thread_client = ChatThreadClient("https://endpoint", credential, thread_id, transport=Mock(send=mock_send)) - create_message_result = None + create_message_result_id = None try: - priority=ChatMessagePriority.NORMAL content='hello world' sender_display_name='sender name' - create_message_result = await chat_thread_client.send_message( + create_message_result_id = await chat_thread_client.send_message( content, - priority=priority, sender_display_name=sender_display_name) except: raised = True assert raised == False - assert create_message_result.id == message_id + assert create_message_result_id == message_id + +@pytest.mark.asyncio +async def test_send_message_w_type(): + thread_id = "19:bcaebfba0d314c2aa3e920d38fa3df08@thread.v2" + message_id='1596823919339' + raised = False + message_str = "Hi I am Bob." + + create_message_result_id = None + + chat_message_types = [ChatMessageType.TEXT, ChatMessageType.HTML, "text", "html"] + + for chat_message_type in chat_message_types: + + async def mock_send(*_, **__): + return mock_response(status_code=201, json_payload={ + "id": message_id, + "type": chat_message_type, + "sequenceId": "3", + "version": message_id, + "content": { + "message": message_str, + "topic": "Lunch Chat thread", + "participants": [ + { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b", + "displayName": "Bob", + "shareHistoryTime": "2020-10-30T10:50:50Z" + } + ], + "initiator": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" + }, + "senderDisplayName": "Bob", + "createdOn": "2021-01-27T01:37:33Z", + "senderId": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-e155-1f06-1db7-3a3a0d00004b" + }) + + chat_thread_client = ChatThreadClient("https://endpoint", credential, thread_id, transport=Mock(send=mock_send)) + + try: + content='hello world' + sender_display_name='sender name' + + create_message_result_id = await chat_thread_client.send_message( + content, + chat_message_type=chat_message_type, + sender_display_name=sender_display_name) + except: + raised = True + + assert raised == False + assert create_message_result_id == message_id + +@pytest.mark.asyncio +async def test_send_message_w_invalid_type_throws_error(): + thread_id = "19:bcaebfba0d314c2aa3e920d38fa3df08@thread.v2" + message_id='1596823919339' + raised = False + + # the payload is irrelevant - it'll fail before + async def mock_send(*_, **__): + return mock_response(status_code=201, json_payload={"id": message_id}) + chat_thread_client = ChatThreadClient("https://endpoint", credential, thread_id, transport=Mock(send=mock_send)) + + create_message_result_id = None + + chat_message_types = [ChatMessageType.PARTICIPANT_ADDED, ChatMessageType.PARTICIPANT_REMOVED, + ChatMessageType.TOPIC_UPDATED, "participant_added", "participant_removed", "topic_updated", + "ChatMessageType.TEXT", "ChatMessageType.HTML", + "ChatMessageType.PARTICIPANT_ADDED", "ChatMessageType.PARTICIPANT_REMOVED", + "ChatMessageType.TOPIC_UPDATED"] + + for chat_message_type in chat_message_types: + try: + content='hello world' + sender_display_name='sender name' + + create_message_result_id = await chat_thread_client.send_message( + content, + chat_message_type=chat_message_type, + sender_display_name=sender_display_name) + except: + raised = True + + assert raised == True + @pytest.mark.asyncio async def test_get_message(): thread_id = "19:bcaebfba0d314c2aa3e920d38fa3df08@thread.v2" message_id='1596823919339' raised = False + message_str = "Hi I am Bob." async def mock_send(*_, **__): - return mock_response(status_code=200, json_payload={"id": message_id}) + return mock_response(status_code=200, json_payload={ + "id": message_id, + "type": "text", + "sequenceId": "3", + "version": message_id, + "content": { + "message": message_str, + "topic": "Lunch Chat thread", + "participants": [ + { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b", + "displayName": "Bob", + "shareHistoryTime": "2020-10-30T10:50:50Z" + } + ], + "initiator": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" + }, + "senderDisplayName": "Bob", + "createdOn": "2021-01-27T01:37:33Z", + "senderId": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-e155-1f06-1db7-3a3a0d00004b" + }) chat_thread_client = ChatThreadClient("https://endpoint", credential, thread_id, transport=Mock(send=mock_send)) message = None @@ -86,6 +191,9 @@ async def mock_send(*_, **__): assert raised == False assert message.id == message_id + assert message.type == ChatMessageType.TEXT + assert message.content.message == message_str + assert len(message.content.participants) > 0 @pytest.mark.asyncio async def test_list_messages(): @@ -94,7 +202,27 @@ async def test_list_messages(): raised = False async def mock_send(*_, **__): - return mock_response(status_code=200, json_payload={"value": [{"id": message_id}]}) + return mock_response(status_code=200, json_payload={"value": [{ + "id": message_id, + "type": "text", + "sequenceId": "3", + "version": message_id, + "content": { + "message": "message_str", + "topic": "Lunch Chat thread", + "participants": [ + { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b", + "displayName": "Bob", + "shareHistoryTime": "2020-10-30T10:50:50Z" + } + ], + "initiator": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" + }, + "senderDisplayName": "Bob", + "createdOn": "2021-01-27T01:37:33Z", + "senderId": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-e155-1f06-1db7-3a3a0d00004b" + }]}) chat_thread_client = ChatThreadClient("https://endpoint", credential, thread_id, transport=Mock(send=mock_send)) chat_messages = None @@ -121,9 +249,48 @@ async def test_list_messages_with_start_time(): async def mock_send(*_, **__): return mock_response(status_code=200, json_payload={ "value": [ - {"id": "message_id1", "createdOn": "2020-08-17T18:05:44Z"}, - {"id": "message_id2", "createdOn": "2020-08-17T23:13:33Z"} - ]}) + { + "id": "message_id1", + "type": "text", + "sequenceId": "3", + "version": "message_id1", + "content": { + "message": "message_str", + "topic": "Lunch Chat thread", + "participants": [ + { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b", + "displayName": "Bob", + "shareHistoryTime": "2020-10-30T10:50:50Z" + } + ], + "initiator": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" + }, + "senderDisplayName": "Bob", + "createdOn": "2020-08-17T18:05:44Z", + "senderId": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-e155-1f06-1db7-3a3a0d00004b" + }, + { + "id": "message_id2", + "type": "text", + "sequenceId": "3", + "version": "message_id2", + "content": { + "message": "message_str", + "topic": "Lunch Chat thread", + "participants": [ + { + "id": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b", + "displayName": "Bob", + "shareHistoryTime": "2020-10-30T10:50:50Z" + } + ], + "initiator": "8:acs:8540c0de-899f-5cce-acb5-3ec493af3800_0e59221d-0c1d-46ae-9544-c963ce56c10b" + }, + "senderDisplayName": "Bob", + "createdOn": "2020-08-17T23:13:33Z", + "senderId": "8:acs:46849534-eb08-4ab7-bde7-c36928cd1547_00000007-e155-1f06-1db7-3a3a0d00004b" + }]}) chat_thread_client = ChatThreadClient("https://endpoint", credential, thread_id, transport=Mock(send=mock_send)) chat_messages = None @@ -149,7 +316,7 @@ async def test_update_message(): raised = False async def mock_send(*_, **__): - return mock_response(status_code=200) + return mock_response(status_code=204) chat_thread_client = ChatThreadClient("https://endpoint", credential, thread_id, transport=Mock(send=mock_send)) try: @@ -178,56 +345,108 @@ async def mock_send(*_, **__): assert raised == False @pytest.mark.asyncio -async def test_list_members(): +async def test_list_participants(): thread_id = "19:bcaebfba0d314c2aa3e920d38fa3df08@thread.v2" - member_id="8:acs:57b9bac9-df6c-4d39-a73b-26e944adf6ea_9b0110-08007f1041" + participant_id="8:acs:57b9bac9-df6c-4d39-a73b-26e944adf6ea_9b0110-08007f1041" raised = False async def mock_send(*_, **__): - return mock_response(status_code=200, json_payload={"value": [{"id": member_id}]}) + return mock_response(status_code=200, json_payload={"value": [{"id": participant_id}]}) chat_thread_client = ChatThreadClient("https://endpoint", credential, thread_id, transport=Mock(send=mock_send)) - chat_thread_members = None + chat_thread_participants = None try: - chat_thread_members = chat_thread_client.list_members() + chat_thread_participants = chat_thread_client.list_participants() except: raised = True assert raised == False items = [] - async for item in chat_thread_members: + async for item in chat_thread_participants: items.append(item) assert len(items) == 1 @pytest.mark.asyncio -async def test_add_members(): +async def test_list_participants_with_results_per_page(): + thread_id = "19:bcaebfba0d314c2aa3e920d38fa3df08@thread.v2" + participant_id_1 = "8:acs:9b665d53-8164-4923-ad5d-5e983b07d2e7_00000006-5399-552c-b274-5a3a0d0000dc" + participant_id_2 = "8:acs:9b665d53-8164-4923-ad5d-5e983b07d2e7_00000006-9d32-35c9-557d-5a3a0d0002f1" + raised = False + + async def mock_send(*_, **__): + return mock_response(status_code=200, json_payload={ + "value": [ + {"id": participant_id_1}, + {"id": participant_id_2} + ]}) + chat_thread_client = ChatThreadClient("https://endpoint", credential, thread_id, transport=Mock(send=mock_send)) + + chat_thread_participants = None + try: + chat_thread_participants = chat_thread_client.list_participants(results_per_page=2) + except: + raised = True + + assert raised == False + + items = [] + async for item in chat_thread_participants: + items.append(item) + + assert len(items) == 2 + + +@pytest.mark.asyncio +async def test_add_participant(): thread_id = "19:bcaebfba0d314c2aa3e920d38fa3df08@thread.v2" - new_member_id="8:acs:57b9bac9-df6c-4d39-a73b-26e944adf6ea_9b0110-08007f1041" + new_participant_id="8:acs:57b9bac9-df6c-4d39-a73b-26e944adf6ea_9b0110-08007f1041" raised = False async def mock_send(*_, **__): - return mock_response(status_code=207) + return mock_response(status_code=201) chat_thread_client = ChatThreadClient("https://endpoint", credential, thread_id, transport=Mock(send=mock_send)) - new_member = ChatThreadMember( - user=CommunicationUserIdentifier(new_member_id), + new_participant = ChatThreadParticipant( + user=CommunicationUserIdentifier(new_participant_id), display_name='name', share_history_time=datetime.utcnow()) - members = [new_member] try: - await chat_thread_client.add_members(members) + await chat_thread_client.add_participant(new_participant) except: raised = True assert raised == False @pytest.mark.asyncio -async def test_remove_member(): +async def test_add_participants(): thread_id = "19:bcaebfba0d314c2aa3e920d38fa3df08@thread.v2" - member_id="8:acs:57b9bac9-df6c-4d39-a73b-26e944adf6ea_9b0110-08007f1041" + new_participant_id="8:acs:57b9bac9-df6c-4d39-a73b-26e944adf6ea_9b0110-08007f1041" + raised = False + + async def mock_send(*_, **__): + return mock_response(status_code=201) + chat_thread_client = ChatThreadClient("https://endpoint", credential, thread_id, transport=Mock(send=mock_send)) + + new_participant = ChatThreadParticipant( + user=CommunicationUserIdentifier(new_participant_id), + display_name='name', + share_history_time=datetime.utcnow()) + participants = [new_participant] + + try: + await chat_thread_client.add_participants(participants) + except: + raised = True + + assert raised == False + +@pytest.mark.asyncio +async def test_remove_participant(): + thread_id = "19:bcaebfba0d314c2aa3e920d38fa3df08@thread.v2" + participant_id="8:acs:57b9bac9-df6c-4d39-a73b-26e944adf6ea_9b0110-08007f1041" raised = False async def mock_send(*_, **__): @@ -235,7 +454,7 @@ async def mock_send(*_, **__): chat_thread_client = ChatThreadClient("https://endpoint", credential, thread_id, transport=Mock(send=mock_send)) try: - await chat_thread_client.remove_member(CommunicationUserIdentifier(member_id)) + await chat_thread_client.remove_participant(user=CommunicationUserIdentifier(participant_id)) except: raised = True @@ -264,7 +483,7 @@ async def test_send_read_receipt(): raised = False async def mock_send(*_, **__): - return mock_response(status_code=201) + return mock_response(status_code=200) chat_thread_client = ChatThreadClient("https://endpoint", credential, thread_id, transport=Mock(send=mock_send)) try: @@ -297,3 +516,59 @@ async def mock_send(*_, **__): items.append(item) assert len(items) == 1 + +@pytest.mark.asyncio +async def test_list_read_receipts_with_results_per_page(): + thread_id = "19:bcaebfba0d314c2aa3e920d38fa3df08@thread.v2" + message_id_1 = "1596823919339" + message_id_2 = "1596823919340" + raised = False + + async def mock_send(*_, **__): + return mock_response(status_code=200, json_payload={ + "value": [ + {"chatMessageId": message_id_1}, + {"chatMessageId": message_id_2} + ]}) + chat_thread_client = ChatThreadClient("https://endpoint", credential, thread_id, transport=Mock(send=mock_send)) + + read_receipts = None + try: + read_receipts = chat_thread_client.list_read_receipts(results_per_page=2) + except: + raised = True + + assert raised == False + + items = [] + async for item in read_receipts: + items.append(item) + + assert len(items) == 2 + +@pytest.mark.asyncio +async def test_list_read_receipts_with_results_per_page_and_skip(): + thread_id = "19:bcaebfba0d314c2aa3e920d38fa3df08@thread.v2" + message_id_1 = "1596823919339" + raised = False + + async def mock_send(*_, **__): + return mock_response(status_code=200, json_payload={ + "value": [ + {"chatMessageId": message_id_1} + ]}) + chat_thread_client = ChatThreadClient("https://endpoint", credential, thread_id, transport=Mock(send=mock_send)) + + read_receipts = None + try: + read_receipts = chat_thread_client.list_read_receipts(results_per_page=1, skip=1) + except: + raised = True + + assert raised == False + + items = [] + async for item in read_receipts: + items.append(item) + + assert len(items) == 1 diff --git a/sdk/communication/azure-communication-chat/tests/test_chat_thread_client_e2e.py b/sdk/communication/azure-communication-chat/tests/test_chat_thread_client_e2e.py index eadf9f8114ab..9bebfb355fcf 100644 --- a/sdk/communication/azure-communication-chat/tests/test_chat_thread_client_e2e.py +++ b/sdk/communication/azure-communication-chat/tests/test_chat_thread_client_e2e.py @@ -15,8 +15,8 @@ ChatClient, CommunicationTokenCredential, CommunicationTokenRefreshOptions, - ChatThreadMember, - ChatMessagePriority + ChatThreadParticipant, + ChatMessageType ) from azure.communication.chat._shared.utils import parse_connection_str @@ -33,7 +33,7 @@ class ChatThreadClientTest(CommunicationTestCase): def setUp(self): super(ChatThreadClientTest, self).setUp() self.recording_processors.extend([ - BodyReplacerProcessor(keys=["id", "token", "senderId", "chatMessageId", "nextLink", "members", "multipleStatus", "value"]), + BodyReplacerProcessor(keys=["id", "token", "senderId", "chatMessageId", "nextLink", "participants", "multipleStatus", "value"]), URIIdentityReplacer(), ChatURIReplacer()]) @@ -50,10 +50,14 @@ def setUp(self): # create another user self.new_user = self.identity_client.create_user() + tokenresponse = self.identity_client.issue_token(self.new_user, scopes=["chat"]) + self.token_new_user = tokenresponse.token # create ChatClient refresh_options = CommunicationTokenRefreshOptions(self.token) + refresh_options_new_user = CommunicationTokenRefreshOptions(self.token_new_user) self.chat_client = ChatClient(self.endpoint, CommunicationTokenCredential(refresh_options)) + self.chat_client_new_user = ChatClient(self.endpoint, CommunicationTokenCredential(refresh_options_new_user)) def tearDown(self): super(ChatThreadClientTest, self).tearDown() @@ -64,65 +68,87 @@ def tearDown(self): self.identity_client.delete_user(self.new_user) self.chat_client.delete_chat_thread(self.thread_id) - def _create_thread(self): + def _create_thread( + self, + **kwargs + ): # create chat thread, and ChatThreadClient topic = "test topic" share_history_time = datetime.utcnow() share_history_time = share_history_time.replace(tzinfo=TZ_UTC) - members = [ChatThreadMember( + participants = [ChatThreadParticipant( user=self.user, display_name='name', share_history_time=share_history_time )] - self.chat_thread_client = self.chat_client.create_chat_thread(topic, members) + self.chat_thread_client = self.chat_client.create_chat_thread(topic, participants) + self.thread_id = self.chat_thread_client.thread_id + + def _create_thread_w_two_users( + self, + **kwargs + ): + # create chat thread, and ChatThreadClient + topic = "test topic" + share_history_time = datetime.utcnow() + share_history_time = share_history_time.replace(tzinfo=TZ_UTC) + participants = [ + ChatThreadParticipant( + user=self.user, + display_name='name', + share_history_time=share_history_time + ), + ChatThreadParticipant( + user=self.new_user, + display_name='name', + share_history_time=share_history_time + ) + ] + self.chat_thread_client = self.chat_client.create_chat_thread(topic, participants) self.thread_id = self.chat_thread_client.thread_id - @pytest.mark.live_test_only def _send_message(self): # send a message - priority = ChatMessagePriority.NORMAL content = 'hello world' sender_display_name = 'sender name' - create_message_result = self.chat_thread_client.send_message( + create_message_result_id = self.chat_thread_client.send_message( content, - priority=priority, sender_display_name=sender_display_name) - self.message_id = create_message_result.id + message_id = create_message_result_id + return message_id @pytest.mark.live_test_only - def test_update_thread(self): + def test_update_topic(self): self._create_thread() topic = "update topic" - self.chat_thread_client.update_thread(topic=topic) + self.chat_thread_client.update_topic(topic=topic) @pytest.mark.live_test_only def test_send_message(self): self._create_thread() - priority = ChatMessagePriority.NORMAL content = 'hello world' sender_display_name = 'sender name' - create_message_result = self.chat_thread_client.send_message( + create_message_result_id = self.chat_thread_client.send_message( content, - priority=priority, sender_display_name=sender_display_name) - assert create_message_result.id is not None + assert create_message_result_id is not None @pytest.mark.live_test_only def test_get_message(self): self._create_thread() - self._send_message() - message = self.chat_thread_client.get_message(self.message_id) - assert message.id == self.message_id + message_id = self._send_message() + message = self.chat_thread_client.get_message(message_id) + assert message.id == message_id + assert message.type == ChatMessageType.TEXT + assert message.content.message == 'hello world' @pytest.mark.live_test_only def test_list_messages(self): self._create_thread() self._send_message() - if self.is_live: - time.sleep(2) chat_messages = self.chat_thread_client.list_messages(results_per_page=1) @@ -133,62 +159,88 @@ def test_list_messages(self): @pytest.mark.live_test_only def test_update_message(self): self._create_thread() - self._send_message() + message_id = self._send_message() content = "updated message content" - self.chat_thread_client.update_message(self.message_id, content=content) + self.chat_thread_client.update_message(message_id, content=content) @pytest.mark.live_test_only def test_delete_message(self): self._create_thread() - self._send_message() + message_id = self._send_message() - self.chat_thread_client.delete_message(self.message_id) + self.chat_thread_client.delete_message(message_id) @pytest.mark.live_test_only - def test_list_members(self): + def test_list_participants(self): self._create_thread() - if self.is_live: - time.sleep(2) - chat_thread_members = self.chat_thread_client.list_members() + # add another participant + share_history_time = datetime.utcnow() + share_history_time = share_history_time.replace(tzinfo=TZ_UTC) + new_participant = ChatThreadParticipant( + user=self.new_user, + display_name='name', + share_history_time=share_history_time) + + self.chat_thread_client.add_participant(new_participant) + + # fetch list of participants + chat_thread_participants = self.chat_thread_client.list_participants(results_per_page=1, skip=1) - for chat_thread_member_page in chat_thread_members.by_page(): - li = list(chat_thread_member_page) - assert len(li) == 1 + participant_count = 0 + + for chat_thread_participant_page in chat_thread_participants.by_page(): + li = list(chat_thread_participant_page) + assert len(li) <= 1 + participant_count += len(li) li[0].user.id = self.user.identifier + assert participant_count == 1 @pytest.mark.live_test_only - def test_add_members(self): + def test_add_participant(self): self._create_thread() share_history_time = datetime.utcnow() share_history_time = share_history_time.replace(tzinfo=TZ_UTC) - new_member = ChatThreadMember( + new_participant = ChatThreadParticipant( + user=self.new_user, + display_name='name', + share_history_time=share_history_time) + + self.chat_thread_client.add_participant(new_participant) + + @pytest.mark.live_test_only + def test_add_participants(self): + self._create_thread() + + share_history_time = datetime.utcnow() + share_history_time = share_history_time.replace(tzinfo=TZ_UTC) + new_participant = ChatThreadParticipant( user=self.new_user, display_name='name', share_history_time=share_history_time) - members = [new_member] + participants = [new_participant] - self.chat_thread_client.add_members(members) + self.chat_thread_client.add_participants(participants) @pytest.mark.live_test_only - def test_remove_member(self): + def test_remove_participant(self): self._create_thread() - # add member first + # add participant first share_history_time = datetime.utcnow() share_history_time = share_history_time.replace(tzinfo=TZ_UTC) - new_member = ChatThreadMember( + new_participant = ChatThreadParticipant( user=self.new_user, display_name='name', share_history_time=share_history_time) - members = [new_member] + participants = [new_participant] - self.chat_thread_client.add_members(members) + self.chat_thread_client.add_participants(participants) - # test remove member - self.chat_thread_client.remove_member(self.new_user) + # test remove participant + self.chat_thread_client.remove_participant(self.new_user) @pytest.mark.live_test_only def test_send_typing_notification(self): @@ -196,3 +248,63 @@ def test_send_typing_notification(self): self.chat_thread_client.send_typing_notification() + @pytest.mark.live_test_only + def test_send_read_receipt(self): + self._create_thread() + message_id = self._send_message() + + self.chat_thread_client.send_read_receipt(message_id) + + + def _wait_on_thread(self, chat_client, thread_id, message_id): + # print("Read Receipts Sent: ", read_receipts_sent) + chat_thread_client = chat_client.get_chat_thread_client(thread_id) + for _ in range(10): + read_receipts_paged = chat_thread_client.list_read_receipts() + chat_message_ids = [] + for page in read_receipts_paged.by_page(): + for item in page: + chat_message_ids.append(item.chat_message_id) + + if message_id in chat_message_ids: + return + else: + print("Sleeping for additional 2 secs") + time.sleep(2) + raise Exception("Read receipts not updated in 20 seconds. Failing.") + + + @pytest.mark.live_test_only + def test_list_read_receipts(self): + self._create_thread_w_two_users() + + # first user send 2 messages + # send messages and read receipts + for i in range(2): + message_id = self._send_message() + self.chat_thread_client.send_read_receipt(message_id) + + if self.is_live: + self._wait_on_thread(chat_client=self.chat_client, thread_id=self.thread_id, message_id=message_id) + + # get chat thread client for second user + chat_thread_client_new_user = self.chat_client_new_user.get_chat_thread_client(self.thread_id) + # second user sends 1 message + message_id_new_user = chat_thread_client_new_user.send_message( + "content", + sender_display_name="sender_display_name") + # send read receipt + chat_thread_client_new_user.send_read_receipt(message_id_new_user) + + if self.is_live: + self._wait_on_thread(chat_client=self.chat_client_new_user, thread_id=self.thread_id, message_id=message_id_new_user) + + # list read receipts + read_receipts = self.chat_thread_client.list_read_receipts(results_per_page=2, skip=0) + + items = [] + for page in read_receipts.by_page(): + for item in page: + items.append(item) + + assert len(items) == 2 diff --git a/sdk/communication/azure-communication-chat/tests/test_chat_thread_client_e2e_async.py b/sdk/communication/azure-communication-chat/tests/test_chat_thread_client_e2e_async.py index e3deffa02236..cacbcff1ed12 100644 --- a/sdk/communication/azure-communication-chat/tests/test_chat_thread_client_e2e_async.py +++ b/sdk/communication/azure-communication-chat/tests/test_chat_thread_client_e2e_async.py @@ -16,8 +16,8 @@ CommunicationTokenRefreshOptions ) from azure.communication.chat import ( - ChatThreadMember, - ChatMessagePriority + ChatThreadParticipant, + ChatMessageType ) from azure.communication.identity._shared.utils import parse_connection_str from azure_devtools.scenario_tests import RecordingProcessor @@ -32,7 +32,7 @@ def setUp(self): super(ChatThreadClientTestAsync, self).setUp() self.recording_processors.extend([ - BodyReplacerProcessor(keys=["id", "token", "senderId", "chatMessageId", "nextLink", "members", "multipleStatus", "value"]), + BodyReplacerProcessor(keys=["id", "token", "senderId", "chatMessageId", "nextLink", "participants", "multipleStatus", "value"]), URIIdentityReplacer(), ResponseReplacerProcessor(keys=[self._resource_name]), ChatURIReplacer()]) @@ -42,17 +42,25 @@ def setUp(self): self.identity_client = CommunicationIdentityClient.from_connection_string(self.connection_str) - # create user + self.users = [] + self.user_tokens = [] + self.chat_clients = [] + + # create user 1 self.user = self.identity_client.create_user() token_response = self.identity_client.issue_token(self.user, scopes=["chat"]) self.token = token_response.token - # create another user + # create user 2 self.new_user = self.identity_client.create_user() + token_response = self.identity_client.issue_token(self.new_user, scopes=["chat"]) + self.token_new_user = token_response.token # create ChatClient refresh_option = CommunicationTokenRefreshOptions(self.token) + refresh_option_new_user = CommunicationTokenRefreshOptions(self.token_new_user) self.chat_client = ChatClient(self.endpoint, CommunicationTokenCredential(refresh_option)) + self.chat_client_new_user = ChatClient(self.endpoint, CommunicationTokenCredential(refresh_option_new_user)) def tearDown(self): super(ChatThreadClientTestAsync, self).tearDown() @@ -67,34 +75,54 @@ async def _create_thread(self): topic = "test topic" share_history_time = datetime.utcnow() share_history_time = share_history_time.replace(tzinfo=TZ_UTC) - members = [ChatThreadMember( + participants = [ChatThreadParticipant( user=self.user, display_name='name', share_history_time=share_history_time )] - self.chat_thread_client = await self.chat_client.create_chat_thread(topic, members) + self.chat_thread_client = await self.chat_client.create_chat_thread(topic, participants) + self.thread_id = self.chat_thread_client.thread_id + + async def _create_thread_w_two_users(self): + # create chat thread + topic = "test topic" + share_history_time = datetime.utcnow() + share_history_time = share_history_time.replace(tzinfo=TZ_UTC) + participants = [ + ChatThreadParticipant( + user=self.user, + display_name='name', + share_history_time=share_history_time + ), + ChatThreadParticipant( + user=self.new_user, + display_name='name', + share_history_time=share_history_time + ) + ] + self.chat_thread_client = await self.chat_client.create_chat_thread(topic, participants) self.thread_id = self.chat_thread_client.thread_id + async def _send_message(self): # send a message - priority = ChatMessagePriority.NORMAL content = 'hello world' sender_display_name = 'sender name' - create_message_result = await self.chat_thread_client.send_message( + create_message_result_id = await self.chat_thread_client.send_message( content, - priority=priority, sender_display_name=sender_display_name) - self.message_id = create_message_result.id + message_id = create_message_result_id + return message_id @pytest.mark.live_test_only @AsyncCommunicationTestCase.await_prepared_test - async def test_update_thread(self): + async def test_update_topic(self): async with self.chat_client: await self._create_thread() topic = "update topic" async with self.chat_thread_client: - await self.chat_thread_client.update_thread(topic=topic) + await self.chat_thread_client.update_topic(topic=topic) # delete chat threads if not self.is_playback(): @@ -107,16 +135,14 @@ async def test_send_message(self): await self._create_thread() async with self.chat_thread_client: - priority = ChatMessagePriority.NORMAL content = 'hello world' sender_display_name = 'sender name' - create_message_result = await self.chat_thread_client.send_message( + create_message_result_id = await self.chat_thread_client.send_message( content, - priority=priority, sender_display_name=sender_display_name) - self.assertTrue(create_message_result.id) + self.assertTrue(create_message_result_id) # delete chat threads if not self.is_playback(): @@ -129,9 +155,11 @@ async def test_get_message(self): await self._create_thread() async with self.chat_thread_client: - await self._send_message() - message = await self.chat_thread_client.get_message(self.message_id) - assert message.id == self.message_id + message_id = await self._send_message() + message = await self.chat_thread_client.get_message(message_id) + assert message.id == message_id + assert message.type == ChatMessageType.TEXT + assert message.content.message == 'hello world' # delete chat threads if not self.is_playback(): @@ -145,8 +173,6 @@ async def test_list_messages(self): async with self.chat_thread_client: await self._send_message() - if self.is_live: - await asyncio.sleep(2) chat_messages = self.chat_thread_client.list_messages(results_per_page=1) @@ -167,10 +193,10 @@ async def test_update_message(self): await self._create_thread() async with self.chat_thread_client: - await self._send_message() + message_id = await self._send_message() content = "updated message content" - await self.chat_thread_client.update_message(self.message_id, content=content) + await self.chat_thread_client.update_message(message_id, content=content) # delete chat threads if not self.is_playback(): @@ -183,9 +209,9 @@ async def test_delete_message(self): await self._create_thread() async with self.chat_thread_client: - await self._send_message() + message_id = await self._send_message() - await self.chat_thread_client.delete_message(self.message_id) + await self.chat_thread_client.delete_message(message_id) # delete chat threads if not self.is_playback(): @@ -193,15 +219,25 @@ async def test_delete_message(self): @pytest.mark.live_test_only @AsyncCommunicationTestCase.await_prepared_test - async def test_list_members(self): + async def test_list_participants(self): async with self.chat_client: await self._create_thread() async with self.chat_thread_client: - chat_thread_members = self.chat_thread_client.list_members() + # add another participant + share_history_time = datetime.utcnow() + share_history_time = share_history_time.replace(tzinfo=TZ_UTC) + new_participant = ChatThreadParticipant( + user=self.new_user, + display_name='name', + share_history_time=share_history_time) + + await self.chat_thread_client.add_participant(new_participant) + + chat_thread_participants = self.chat_thread_client.list_participants(results_per_page=1, skip=1) items = [] - async for item in chat_thread_members: + async for item in chat_thread_participants: items.append(item) assert len(items) == 1 @@ -212,44 +248,63 @@ async def test_list_members(self): @pytest.mark.live_test_only @AsyncCommunicationTestCase.await_prepared_test - async def test_add_members(self): + async def test_add_participant(self): async with self.chat_client: await self._create_thread() async with self.chat_thread_client: share_history_time = datetime.utcnow() share_history_time = share_history_time.replace(tzinfo=TZ_UTC) - new_member = ChatThreadMember( + new_participant = ChatThreadParticipant( + user=self.new_user, + display_name='name', + share_history_time=share_history_time) + + await self.chat_thread_client.add_participant(new_participant) + + if not self.is_playback(): + await self.chat_client.delete_chat_thread(self.thread_id) + + @pytest.mark.live_test_only + @AsyncCommunicationTestCase.await_prepared_test + async def test_add_participants(self): + async with self.chat_client: + await self._create_thread() + + async with self.chat_thread_client: + share_history_time = datetime.utcnow() + share_history_time = share_history_time.replace(tzinfo=TZ_UTC) + new_participant = ChatThreadParticipant( user=self.new_user, display_name='name', share_history_time=share_history_time) - members = [new_member] + participants = [new_participant] - await self.chat_thread_client.add_members(members) + await self.chat_thread_client.add_participants(participants) if not self.is_playback(): await self.chat_client.delete_chat_thread(self.thread_id) @pytest.mark.live_test_only @AsyncCommunicationTestCase.await_prepared_test - async def test_remove_member(self): + async def test_remove_participant(self): async with self.chat_client: await self._create_thread() async with self.chat_thread_client: - # add member first + # add participant first share_history_time = datetime.utcnow() share_history_time = share_history_time.replace(tzinfo=TZ_UTC) - new_member = ChatThreadMember( + new_participant = ChatThreadParticipant( user=self.new_user, display_name='name', share_history_time=share_history_time) - members = [new_member] + participants = [new_participant] - await self.chat_thread_client.add_members(members) + await self.chat_thread_client.add_participants(participants) - # test remove member - await self.chat_thread_client.remove_member(self.new_user) + # test remove participant + await self.chat_thread_client.remove_participant(self.new_user) if not self.is_playback(): await self.chat_client.delete_chat_thread(self.thread_id) @@ -265,3 +320,79 @@ async def test_send_typing_notification(self): if not self.is_playback(): await self.chat_client.delete_chat_thread(self.thread_id) + + @pytest.mark.live_test_only + @AsyncCommunicationTestCase.await_prepared_test + async def test_send_read_receipt(self): + async with self.chat_client: + await self._create_thread() + + async with self.chat_thread_client: + message_id = await self._send_message() + + await self.chat_thread_client.send_read_receipt(message_id) + + if not self.is_playback(): + await self.chat_client.delete_chat_thread(self.thread_id) + + async def _wait_on_thread(self, chat_client, thread_id, message_id): + # print("Read Receipts Sent: ", read_receipts_sent) + chat_thread_client = chat_client.get_chat_thread_client(thread_id) + for _ in range(10): + read_receipts_paged = chat_thread_client.list_read_receipts() + chat_message_ids = [] + async for page in read_receipts_paged.by_page(): + async for item in page: + chat_message_ids.append(item.chat_message_id) + + if message_id in chat_message_ids: + return + else: + print("Sleeping for additional 2 secs") + await asyncio.sleep(2) + raise Exception("Read receipts not updated in 20 seconds. Failing.") + + @pytest.mark.live_test_only + @AsyncCommunicationTestCase.await_prepared_test + async def test_list_read_receipts(self): + async with self.chat_client: + await self._create_thread_w_two_users() + + async with self.chat_thread_client: + + # first user sends 2 messages + for i in range(2): + message_id = await self._send_message() + # send read receipts first + await self.chat_thread_client.send_read_receipt(message_id) + + if self.is_live: + await self._wait_on_thread(chat_client=self.chat_client, thread_id=self.thread_id, message_id=message_id) + + + + # get chat thread client for second user + chat_thread_client_new_user = self.chat_client_new_user.get_chat_thread_client(self.thread_id) + + # second user sends 1 message + message_id_new_user = await chat_thread_client_new_user.send_message( + "content", + sender_display_name="sender_display_name") + # send read receipt + await chat_thread_client_new_user.send_read_receipt(message_id_new_user) + + if self.is_live: + await self._wait_on_thread(chat_client=self.chat_client_new_user, thread_id=self.thread_id, message_id=message_id_new_user) + + # list read receipts + read_receipts = self.chat_thread_client.list_read_receipts(results_per_page=2, skip=0) + + items = [] + async for page in read_receipts.by_page(): + async for item in page: + items.append(item) + + assert len(items) == 2 + + if not self.is_playback(): + await self.chat_client.delete_chat_thread(self.thread_id)