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 d2041fdf6499..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 @@ -222,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: 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 6e39b0b176db..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 @@ -191,8 +191,8 @@ def list_read_receipts( :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.ChatMessageReadReceipt`] - :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: @@ -341,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: @@ -448,8 +448,8 @@ def list_participants( :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.ChatThreadParticipant`] - :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: 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 30ca4fe3a95e..5055b1c40369 100644 --- a/sdk/communication/azure-communication-chat/azure/communication/chat/_models.py +++ b/sdk/communication/azure-communication-chat/azure/communication/chat/_models.py @@ -24,8 +24,10 @@ class ChatThreadParticipant(object): 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) @@ -80,8 +82,10 @@ class ChatMessage(object): def __init__( self, - **kwargs + **kwargs # type: Any ): + # type: (...) -> None + self.id = kwargs['id'] self.type = kwargs['type'] self.sequence_id = kwargs['sequence_id'] @@ -134,8 +138,10 @@ class ChatMessageContent(object): def __init__( self, - **kwargs + **kwargs # type: Any ): + # type: (...) -> None + self.message = kwargs.get('message', None) self.topic = kwargs.get('topic', None) self.participants = kwargs.get('participants', None) @@ -178,8 +184,9 @@ class ChatThread(object): 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'] @@ -213,8 +220,9 @@ class ChatMessageReadReceipt(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/aio/_chat_client_async.py b/sdk/communication/azure-communication-chat/azure/communication/chat/aio/_chat_client_async.py index dfb29899c234..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 @@ -59,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") @@ -85,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. @@ -123,6 +127,9 @@ async def create_chat_thread( repeatability_request_id: Optional[str] = None, **kwargs ) -> ChatThreadClient: + + # type: (...) -> ChatThreadClient + """Creates a chat thread. :param topic: Required. The thread topic. @@ -185,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. @@ -213,15 +221,15 @@ async def get_chat_thread( @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: 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 8a042712b7bc..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 @@ -73,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") @@ -180,14 +180,14 @@ async def send_read_receipt( @distributed_trace def list_read_receipts( self, - **kwargs - ) -> AsyncItemPaged[ChatMessageReadReceipt]: + **kwargs: Any + ): # type: (...) -> AsyncItemPaged[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. - :return: AsyncItemPaged[:class:`~azure.communication.chat.ChatMessageReadReceipt`] - :rtype: ~azure.core.async_paging.AsyncItemPaged + :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: @@ -325,15 +325,15 @@ async def get_message( @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: @@ -429,15 +429,15 @@ async def delete_message( @distributed_trace def list_participants( self, - **kwargs - ) -> AsyncItemPaged[ChatThreadParticipant]: + **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.ChatThreadParticipant`] - :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: