Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apiview changes #16560

Merged
merged 2 commits into from
Feb 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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']
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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']
Expand Down Expand Up @@ -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']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -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.

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down