diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_connection_client.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_connection_client.py index 3f10d4f555df..9082dead9a00 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_connection_client.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_connection_client.py @@ -840,7 +840,8 @@ def cancel_add_participant_operation( **kwargs ) -> CancelAddParticipantOperationResult: """Cancel add participant request sent out to a participant. - :param invitation_id: The invitation ID that was used to add the participant. + + :param invitation_id: The invitation ID that was used to add the participant. :type invitation_id: str :keyword operation_context: Value that can be used to track this call and its associated events. :paramtype operation_context: str @@ -877,19 +878,20 @@ def start_hold_music( **kwargs ) -> None: """Hold participant from call while playing music. + :param play_source: A PlaySource representing the source to play. :type play_source: ~azure.communication.callautomation.FileSource or ~azure.communication.callautomation.TextSource or ~azure.communication.callautomation.SsmlSource or list[~azure.communication.callautomation.FileSource or - ~azure.communication.callautomation.TextSource or - ~azure.communication.callautomation.SsmlSource] + ~azure.communication.callautomation.TextSource or + ~azure.communication.callautomation.SsmlSource] :param target_participant: The targets to play media to. Default value is 'all', to play media to all participants in the call. :type target_participant: list[~azure.communication.callautomation.CommunicationIdentifier] :keyword loop: Whether the media should be repeated until stopped. + **DEPRECATED**: 'loop' has been deprecated and will be removed from future releases. :paramtype loop: bool - **DEPRECATED**: 'loop' has been deprecated and will be removed from future releases. :keyword operation_context: Value that can be used to track this call and its associated events. :paramtype operation_context: str or None :return: None diff --git a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_connection_client_async.py b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_connection_client_async.py index ade8a828763d..567aefecf17b 100644 --- a/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_connection_client_async.py +++ b/sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_connection_client_async.py @@ -846,7 +846,8 @@ async def cancel_add_participant_operation( **kwargs ) -> CancelAddParticipantOperationResult: """Cancel add participant request sent out to a participant. - :param invitation_id: The invitation ID that was used to add the participant. + + :param invitation_id: The invitation ID that was used to add the participant. :type invitation_id: str :keyword operation_context: Value that can be used to track this call and its associated events. :paramtype operation_context: str @@ -883,19 +884,20 @@ async def start_hold_music( **kwargs ) -> None: """Hold participant from call while playing music. + :param play_source: A PlaySource representing the source to play. :type play_source: ~azure.communication.callautomation.FileSource or ~azure.communication.callautomation.TextSource or ~azure.communication.callautomation.SsmlSource or list[~azure.communication.callautomation.FileSource or - ~azure.communication.callautomation.TextSource or - ~azure.communication.callautomation.SsmlSource] + ~azure.communication.callautomation.TextSource or + ~azure.communication.callautomation.SsmlSource] :param target_participant: The targets to play media to. Default value is 'all', to play media to all participants in the call. :type target_participant: list[~azure.communication.callautomation.CommunicationIdentifier] :keyword loop: Whether the media should be repeated until stopped. + **DEPRECATED**: 'loop' has been deprecated and will be removed from future releases. :paramtype loop: bool - **DEPRECATED**: 'loop' has been deprecated and will be removed from future releases. :keyword operation_context: Value that can be used to track this call and its associated events. :paramtype operation_context: str or None :return: None diff --git a/sdk/communication/azure-communication-callautomation/pyproject.toml b/sdk/communication/azure-communication-callautomation/pyproject.toml index ff779a518143..c75e8bac159a 100644 --- a/sdk/communication/azure-communication-callautomation/pyproject.toml +++ b/sdk/communication/azure-communication-callautomation/pyproject.toml @@ -3,3 +3,4 @@ mypy = false pyright = false type_check_samples = false verifytypes = false +strict_sphinx = true diff --git a/sdk/communication/azure-communication-identity/README.md b/sdk/communication/azure-communication-identity/README.md index 0a3e9ab84fe6..207786c5ad86 100644 --- a/sdk/communication/azure-communication-identity/README.md +++ b/sdk/communication/azure-communication-identity/README.md @@ -13,11 +13,11 @@ Azure Communication Identity client package is intended to be used to setup the _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_ # Getting started -### Prerequisites +## Prerequisites - Python 3.8 or later is required to use this package. - You must have an [Azure subscription](https://azure.microsoft.com/free/) - A deployed Communication Services resource. You can use the [Azure Portal](https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp) or the [Azure PowerShell](https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice) to set it up. -### Install the package +## Install the package Install the Azure Communication Identity client library for Python with [pip](https://pypi.org/project/pip/): ```bash diff --git a/sdk/communication/azure-communication-identity/azure/communication/identity/_communication_identity_client.py b/sdk/communication/azure-communication-identity/azure/communication/identity/_communication_identity_client.py index 2f0fa0898be8..76d6997bd389 100644 --- a/sdk/communication/azure-communication-identity/azure/communication/identity/_communication_identity_client.py +++ b/sdk/communication/azure-communication-identity/azure/communication/identity/_communication_identity_client.py @@ -36,7 +36,6 @@ class CommunicationIdentityClient(object): .. literalinclude:: ../samples/identity_samples.py :language: python - :dedent: 8 """ def __init__( @@ -75,15 +74,6 @@ def from_connection_string( :param str conn_str: A connection string to an Azure Communication Service resource. :returns: Instance of CommunicationIdentityClient. :rtype: ~azure.communication.identity.CommunicationIdentityClient - - .. admonition:: Example: - - .. literalinclude:: ../samples/identity_samples.py - :start-after: [START auth_from_connection_string] - :end-before: [END auth_from_connection_string] - :language: python - :dedent: 8 - :caption: Creating the CommunicationIdentityClient from a connection string. """ endpoint, access_key = parse_connection_str(conn_str) diff --git a/sdk/communication/azure-communication-identity/azure/communication/identity/aio/_communication_identity_client_async.py b/sdk/communication/azure-communication-identity/azure/communication/identity/aio/_communication_identity_client_async.py index 6c749aca54dd..35a826db1d72 100644 --- a/sdk/communication/azure-communication-identity/azure/communication/identity/aio/_communication_identity_client_async.py +++ b/sdk/communication/azure-communication-identity/azure/communication/identity/aio/_communication_identity_client_async.py @@ -36,9 +36,8 @@ class CommunicationIdentityClient: .. admonition:: Example: - .. literalinclude:: ../../samples/identity_samples_async.py + .. literalinclude:: ../samples/identity_samples_async.py :language: python - :dedent: 8 """ def __init__( @@ -78,15 +77,6 @@ def from_connection_string( A connection string to an Azure Communication Service resource. :returns: Instance of CommunicationIdentityClient. :rtype: ~azure.communication.identity.aio.CommunicationIdentityClient - - .. admonition:: Example: - - .. literalinclude:: ../samples/identity_samples.py - :start-after: [START auth_from_connection_string] - :end-before: [END auth_from_connection_string] - :language: python - :dedent: 8 - :caption: Creating the CommunicationIdentityClient from a connection string. """ endpoint, access_key = parse_connection_str(conn_str) @@ -113,7 +103,8 @@ async def create_user(self, **kwargs) -> "CommunicationUserIdentifier": async def create_user_and_token( self, scopes: List[Union[str, "CommunicationTokenScope"]], **kwargs ) -> Tuple["CommunicationUserIdentifier", AccessToken]: - """create a single Communication user with an identity token. + """Create a single Communication user with an identity token. + :param scopes: List of scopes to be added to the token. :type scopes: list[str or ~azure.communication.identity.CommunicationTokenScope] diff --git a/sdk/communication/azure-communication-identity/pyproject.toml b/sdk/communication/azure-communication-identity/pyproject.toml index 7e21996d4317..fdde94224048 100644 --- a/sdk/communication/azure-communication-identity/pyproject.toml +++ b/sdk/communication/azure-communication-identity/pyproject.toml @@ -2,3 +2,4 @@ pyright = false type_check_samples = false verifytypes = false +strict_sphinx = true diff --git a/sdk/communication/azure-communication-jobrouter/azure/communication/jobrouter/_operations/_operations.py b/sdk/communication/azure-communication-jobrouter/azure/communication/jobrouter/_operations/_operations.py index e8f589872451..b6747c961542 100644 --- a/sdk/communication/azure-communication-jobrouter/azure/communication/jobrouter/_operations/_operations.py +++ b/sdk/communication/azure-communication-jobrouter/azure/communication/jobrouter/_operations/_operations.py @@ -1302,6 +1302,7 @@ def upsert_distribution_policy( Example: .. code-block:: python + # The response is polymorphic. The following are possible polymorphic responses based off discriminator "kind": @@ -1494,6 +1495,7 @@ def upsert_distribution_policy( Example: .. code-block:: python + # The response is polymorphic. The following are possible polymorphic responses based off discriminator "kind": @@ -2013,6 +2015,7 @@ def get_distribution_policy(self, distribution_policy_id: str, **kwargs: Any) -> Example: .. code-block:: python + # The response is polymorphic. The following are possible polymorphic responses based off discriminator "kind": @@ -2160,6 +2163,7 @@ def list_distribution_policies(self, **kwargs: Any) -> ItemPaged["_models.Distri Example: .. code-block:: python + # The response is polymorphic. The following are possible polymorphic responses based off discriminator "kind": @@ -2635,6 +2639,7 @@ def upsert_classification_policy( Example: .. code-block:: python + # The response is polymorphic. The following are possible polymorphic responses based off discriminator "kind": @@ -2791,6 +2796,7 @@ def upsert_classification_policy( Example: .. code-block:: python + # The response is polymorphic. The following are possible polymorphic responses based off discriminator "kind": @@ -3223,6 +3229,7 @@ def get_classification_policy(self, classification_policy_id: str, **kwargs: Any Example: .. code-block:: python + # The response is polymorphic. The following are possible polymorphic responses based off discriminator "kind": @@ -3356,6 +3363,7 @@ def list_classification_policies(self, **kwargs: Any) -> ItemPaged["_models.Clas Example: .. code-block:: python + # The response is polymorphic. The following are possible polymorphic responses based off discriminator "kind": @@ -5030,6 +5038,7 @@ def upsert_job( Example: .. code-block:: python + # The response is polymorphic. The following are possible polymorphic responses based off discriminator "kind": @@ -5202,6 +5211,7 @@ def upsert_job( Example: .. code-block:: python + # The response is polymorphic. The following are possible polymorphic responses based off discriminator "kind": @@ -5714,6 +5724,7 @@ def get_job(self, job_id: str, **kwargs: Any) -> _models.RouterJob: Example: .. code-block:: python + # The response is polymorphic. The following are possible polymorphic responses based off discriminator "kind": @@ -6469,6 +6480,7 @@ def list_jobs( Example: .. code-block:: python + # The response is polymorphic. The following are possible polymorphic responses based off discriminator "kind": diff --git a/sdk/communication/azure-communication-jobrouter/azure/communication/jobrouter/aio/_operations/_operations.py b/sdk/communication/azure-communication-jobrouter/azure/communication/jobrouter/aio/_operations/_operations.py index eaf994cd5d91..f56155fa52fb 100644 --- a/sdk/communication/azure-communication-jobrouter/azure/communication/jobrouter/aio/_operations/_operations.py +++ b/sdk/communication/azure-communication-jobrouter/azure/communication/jobrouter/aio/_operations/_operations.py @@ -393,6 +393,7 @@ async def upsert_distribution_policy( Example: .. code-block:: python + # The response is polymorphic. The following are possible polymorphic responses based off discriminator "kind": @@ -585,6 +586,7 @@ async def upsert_distribution_policy( Example: .. code-block:: python + # The response is polymorphic. The following are possible polymorphic responses based off discriminator "kind": @@ -1104,6 +1106,7 @@ async def get_distribution_policy(self, distribution_policy_id: str, **kwargs: A Example: .. code-block:: python + # The response is polymorphic. The following are possible polymorphic responses based off discriminator "kind": @@ -1252,6 +1255,7 @@ def list_distribution_policies(self, **kwargs: Any) -> AsyncItemPaged["_models.D Example: .. code-block:: python + # The response is polymorphic. The following are possible polymorphic responses based off discriminator "kind": @@ -1727,6 +1731,7 @@ async def upsert_classification_policy( Example: .. code-block:: python + # The response is polymorphic. The following are possible polymorphic responses based off discriminator "kind": @@ -1883,6 +1888,7 @@ async def upsert_classification_policy( Example: .. code-block:: python + # The response is polymorphic. The following are possible polymorphic responses based off discriminator "kind": @@ -2317,6 +2323,7 @@ async def get_classification_policy( Example: .. code-block:: python + # The response is polymorphic. The following are possible polymorphic responses based off discriminator "kind": @@ -2450,6 +2457,7 @@ def list_classification_policies(self, **kwargs: Any) -> AsyncItemPaged["_models Example: .. code-block:: python + # The response is polymorphic. The following are possible polymorphic responses based off discriminator "kind": @@ -4128,6 +4136,7 @@ async def upsert_job( Example: .. code-block:: python + # The response is polymorphic. The following are possible polymorphic responses based off discriminator "kind": @@ -4300,6 +4309,7 @@ async def upsert_job( Example: .. code-block:: python + # The response is polymorphic. The following are possible polymorphic responses based off discriminator "kind": @@ -4812,6 +4822,7 @@ async def get_job(self, job_id: str, **kwargs: Any) -> _models.RouterJob: Example: .. code-block:: python + # The response is polymorphic. The following are possible polymorphic responses based off discriminator "kind": @@ -5568,6 +5579,7 @@ def list_jobs( Example: .. code-block:: python + # The response is polymorphic. The following are possible polymorphic responses based off discriminator "kind": diff --git a/sdk/communication/azure-communication-jobrouter/azure/communication/jobrouter/aio/_patch.py b/sdk/communication/azure-communication-jobrouter/azure/communication/jobrouter/aio/_patch.py index 990a30b82914..299ff2881418 100644 --- a/sdk/communication/azure-communication-jobrouter/azure/communication/jobrouter/aio/_patch.py +++ b/sdk/communication/azure-communication-jobrouter/azure/communication/jobrouter/aio/_patch.py @@ -75,7 +75,7 @@ def from_connection_string(cls, conn_str: str, **kwargs: Any) -> "JobRouterClien .. admonition:: Example: - .. literalinclude:: ../samples/sample_authentication.py + .. literalinclude:: ../samples/sample_authentication_async.py :start-after: [START auth_from_connection_string_async] :end-before: [END auth_from_connection_string_async] :language: python @@ -141,7 +141,7 @@ def from_connection_string(cls, conn_str: str, **kwargs: Any) -> "JobRouterAdmin .. admonition:: Example: - .. literalinclude:: ../samples/sample_authentication.py + .. literalinclude:: ../samples/sample_authentication_async.py :start-after: [START admin_auth_from_connection_string_async] :end-before: [END admin_auth_from_connection_string_async] :language: python diff --git a/sdk/communication/azure-communication-messages/azure/communication/messages/_operations/_operations.py b/sdk/communication/azure-communication-messages/azure/communication/messages/_operations/_operations.py index 691900b9f8eb..e6cf4c1670a6 100644 --- a/sdk/communication/azure-communication-messages/azure/communication/messages/_operations/_operations.py +++ b/sdk/communication/azure-communication-messages/azure/communication/messages/_operations/_operations.py @@ -605,6 +605,7 @@ def list_templates( Example: .. code-block:: python + # The response is polymorphic. The following are possible polymorphic responses based off discriminator "kind": diff --git a/sdk/communication/azure-communication-messages/azure/communication/messages/_patch.py b/sdk/communication/azure-communication-messages/azure/communication/messages/_patch.py index 6692bfbb6a9b..acf74720bcfd 100644 --- a/sdk/communication/azure-communication-messages/azure/communication/messages/_patch.py +++ b/sdk/communication/azure-communication-messages/azure/communication/messages/_patch.py @@ -64,6 +64,7 @@ def __init__(self, endpoint: str, credential: Union[TokenCredential, AzureKeyCre @classmethod def from_connection_string(cls, conn_str: str, **kwargs: Any) -> "NotificationMessagesClient": """Create NotificationMessagesClient from a Connection String. + :param conn_str: Azure communication service connection string. Required. :type conn_str: str :return: instance of NotificationMessagesClient @@ -115,11 +116,12 @@ def __init__(self, endpoint: str, credential: Union[TokenCredential, AzureKeyCre @classmethod def from_connection_string(cls, conn_str: str, **kwargs: Any) -> "MessageTemplateClient": """Create MessageTemplateClient from a Connection String. + :param conn_str: Azure communication service connection string. Required. :type conn_str: str :return: instance of MessageTemplateClient :rtype: - ~azure.communication.messages.messagetemplateclient + ~azure.communication.messages.MessageTemplateClient """ endpoint, access_key = parse_connection_str(conn_str) return cls(endpoint, AzureKeyCredential(access_key), **kwargs) diff --git a/sdk/communication/azure-communication-messages/azure/communication/messages/aio/_operations/_operations.py b/sdk/communication/azure-communication-messages/azure/communication/messages/aio/_operations/_operations.py index 68dc602a8c96..f754eb60ef33 100644 --- a/sdk/communication/azure-communication-messages/azure/communication/messages/aio/_operations/_operations.py +++ b/sdk/communication/azure-communication-messages/azure/communication/messages/aio/_operations/_operations.py @@ -499,6 +499,7 @@ def list_templates( Example: .. code-block:: python + # The response is polymorphic. The following are possible polymorphic responses based off discriminator "kind": diff --git a/sdk/communication/azure-communication-messages/azure/communication/messages/aio/_patch.py b/sdk/communication/azure-communication-messages/azure/communication/messages/aio/_patch.py index c8480be8d240..409152840451 100644 --- a/sdk/communication/azure-communication-messages/azure/communication/messages/aio/_patch.py +++ b/sdk/communication/azure-communication-messages/azure/communication/messages/aio/_patch.py @@ -64,10 +64,11 @@ def __init__(self, endpoint: str, @classmethod def from_connection_string(cls, conn_str: str, **kwargs: Any) -> "NotificationMessagesClient": """Create NotificationMessagesClient from a Connection String. + :param conn_str: Azure Communication Service endpoint. Required. :type conn_str: str :return: instance of NotificationMessagesClient. - :rtype:~azure.communication.message.notificationmessagesclient + :rtype: ~azure.communication.message.NotificationMessagesClient """ endpoint, access_key = parse_connection_str(conn_str) return cls(endpoint, AzureKeyCredential(key=access_key), **kwargs) @@ -116,10 +117,11 @@ def __init__(self, endpoint: str, credential: Union[AsyncTokenCredential, @classmethod def from_connection_string(cls, conn_str: str, **kwargs: Any) -> "MessageTemplateClient": """Create MessageTemplateClient from a Connection String. + :param conn_str: Azure Communication Service endpoint. Required. :type conn_str: str :return: instance of MessageTemplateClient. - :rtype:~azure.communication.message.messagetemplateclient + :rtype: ~azure.communication.message.MessageTemplateClient """ endpoint, access_key = parse_connection_str(conn_str) return cls(endpoint, AzureKeyCredential(access_key), **kwargs) diff --git a/sdk/communication/azure-communication-messages/pyproject.toml b/sdk/communication/azure-communication-messages/pyproject.toml index 7e21996d4317..fdde94224048 100644 --- a/sdk/communication/azure-communication-messages/pyproject.toml +++ b/sdk/communication/azure-communication-messages/pyproject.toml @@ -2,3 +2,4 @@ pyright = false type_check_samples = false verifytypes = false +strict_sphinx = true diff --git a/sdk/communication/azure-communication-phonenumbers/README.md b/sdk/communication/azure-communication-phonenumbers/README.md index b8f64553d7f3..14e26027fb95 100644 --- a/sdk/communication/azure-communication-phonenumbers/README.md +++ b/sdk/communication/azure-communication-phonenumbers/README.md @@ -7,11 +7,11 @@ Azure Communication Phone Numbers client package is used to administer Phone Num _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_ # Getting started -### Prerequisites +## Prerequisites - Python 3.7 or later is required to use this package. - You must have an [Azure subscription](https://azure.microsoft.com/free/) - A deployed Communication Services resource. You can use the [Azure Portal](https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp) or the [Azure PowerShell](https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice) to set it up. -### Install the package +## Install the package Install the Azure Communication Phone Numbers client library for Python with [pip](https://pypi.org/project/pip/): ```bash diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py index 596e25b49cbf..2dd7d34b6ea3 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py @@ -43,6 +43,7 @@ class PhoneNumbersClient: """A client to interact with the AzureCommunicationService Phone Numbers gateway. This client provides operations to interact with the phone numbers service + :param str endpoint: The endpoint url for Azure Communication Service resource. :param Union[TokenCredential, AzureKeyCredential] credential: @@ -86,6 +87,7 @@ def from_connection_string( **kwargs: Any ) -> "PhoneNumbersClient": """Create PhoneNumbersClient from a Connection String. + :param str conn_str: A connection string to an Azure Communication Service resource. :returns: Instance of PhoneNumbersClient. @@ -389,19 +391,19 @@ def list_available_area_codes( :param country_code: The ISO 3166-2 country/region two letter code, e.g. US. Required. :type country_code: str :param phone_number_type: Filter by phone number type, e.g. Geographic, TollFree. Known values are: - "geographic" and "tollFree". Required. + "geographic" and "tollFree". Required. :type phone_number_type: ~azure.communication.phonenumbers.PhoneNumberType :keyword assignment_type: Filter by assignmentType, e.g. User, Application. Known values are: - "person" and "application". Default value is None. + "person" and "application". Default value is None. :paramtype assignment_type: ~azure.communication.phonenumbers.PhoneNumberAssignmentType :keyword locality: The name of locality in which to search for the area code. e.g. Seattle. - This is required if the phone number type is Geographic. Default value is None. + This is required if the phone number type is Geographic. Default value is None. :paramtype locality: str :keyword administrative_division: The name of the state or province in which to search for the - area code. e.g. California. Default value is None. + area code. e.g. California. Default value is None. :paramtype administrative_division: str :keyword skip: An optional parameter for how many entries to skip, for pagination purposes. The - default value is 0. Default value is 0. + default value is 0. Default value is 0. :paramtype skip: int :return: An iterator like instance of PhoneNumberAreaCode :rtype: ~azure.core.paging.ItemPaged[~azure.communication.phonenumbers.PhoneNumberAreaCode] diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py index 69a563e5faac..d4d2a965d4e2 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py @@ -43,6 +43,7 @@ class PhoneNumbersClient: """A client to interact with the AzureCommunicationService Phone Numbers gateway. This client provides operations to interact with the phone numbers service + :param str endpoint: The endpoint url for Azure Communication Service resource. :param Union[AsyncTokenCredential, AzureKeyCredential] credential: @@ -86,6 +87,7 @@ def from_connection_string( **kwargs: Any ) -> "PhoneNumbersClient": """Create PhoneNumbersClient from a Connection String. + :param str conn_str: A connection string to an Azure Communication Service resource. :returns: Instance of PhoneNumbersClient. @@ -385,19 +387,19 @@ def list_available_area_codes( :param country_code: The ISO 3166-2 country/region two letter code, e.g. US. Required. :type country_code: str :param phone_number_type: Filter by phone number type, e.g. Geographic, TollFree. Known values are: - "geographic" and "tollFree". Required. + "geographic" and "tollFree". Required. :type phone_number_type: ~azure.communication.phonenumbers.PhoneNumberType :keyword assignment_type: Filter by assignmentType, e.g. User, Application. Known values are: - "person" and "application". Default value is None. + "person" and "application". Default value is None. :paramtype assignment_type: ~azure.communication.phonenumbers.PhoneNumberAssignmentType :keyword locality: The name of locality in which to search for the area code. e.g. Seattle. - This is required if the phone number type is Geographic. Default value is None. + This is required if the phone number type is Geographic. Default value is None. :paramtype locality: str :keyword administrative_division: The name of the state or province in which to search for the - area code. e.g. California. Default value is None. + area code. e.g. California. Default value is None. :paramtype administrative_division: str :keyword skip: An optional parameter for how many entries to skip, for pagination purposes. The - default value is 0. Default value is 0. + default value is 0. Default value is 0. :paramtype skip: int :return: An iterator like instance of PhoneNumberAreaCode :rtype: ~azure.core.paging.ItemPaged[~azure.communication.phonenumbers.PhoneNumberAreaCode] diff --git a/sdk/communication/azure-communication-phonenumbers/pyproject.toml b/sdk/communication/azure-communication-phonenumbers/pyproject.toml index ff779a518143..c75e8bac159a 100644 --- a/sdk/communication/azure-communication-phonenumbers/pyproject.toml +++ b/sdk/communication/azure-communication-phonenumbers/pyproject.toml @@ -3,3 +3,4 @@ mypy = false pyright = false type_check_samples = false verifytypes = false +strict_sphinx = true diff --git a/sdk/communication/azure-communication-rooms/azure/communication/rooms/_models/_models.py b/sdk/communication/azure-communication-rooms/azure/communication/rooms/_models/_models.py index a712c490e924..2bc03879afde 100644 --- a/sdk/communication/azure-communication-rooms/azure/communication/rooms/_models/_models.py +++ b/sdk/communication/azure-communication-rooms/azure/communication/rooms/_models/_models.py @@ -91,7 +91,7 @@ class CommunicationRoom: in RFC3339 format: ``yyyy-MM-ddTHH:mm:ssZ``. :vartype valid_until: ~datetime.datetime :ivar pstn_dial_out_enabled: Set this flag to true if, at the time of the call, - dial out to a PSTN number is enabled in a particular room. By default, this flag is set to false. + dial out to a PSTN number is enabled in a particular room. By default, this flag is set to false. :vartype pstn_dial_out_enabled: bool """ diff --git a/sdk/communication/azure-communication-rooms/azure/communication/rooms/_rooms_client.py b/sdk/communication/azure-communication-rooms/azure/communication/rooms/_rooms_client.py index 9a0b0f0ca35f..54b76a0d5af7 100644 --- a/sdk/communication/azure-communication-rooms/azure/communication/rooms/_rooms_client.py +++ b/sdk/communication/azure-communication-rooms/azure/communication/rooms/_rooms_client.py @@ -28,15 +28,13 @@ class RoomsClient(object): This client provides operations to manage rooms. - This client provides operations to manage rooms. - :param str endpoint: - The endpoint url for Azure Communication Service resource. - param Union[TokenCredential, AzureKeyCredential] credential: - The access key we use to authenticate against the service. + The endpoint url for Azure Communication Service resource. + :param Union[TokenCredential, AzureKeyCredential] credential: + The access key we use to authenticate against the service. :keyword api_version: Azure Communication Rooms API version. - Default value is "2024-04-15". - Note that overriding this default value may result in unsupported behavior. + Default value is "2024-04-15". + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__( @@ -75,13 +73,13 @@ def from_connection_string(cls, conn_str: str, """Create RoomsClient from a Connection String. :param str conn_str: - A connection string to an Azure Communication Service resource. + A connection string to an Azure Communication Service resource. :returns: Instance of RoomsClient. :rtype: ~azure.communication.room.RoomsClient .. admonition:: Example: - .. literalinclude:: ../samples/Rooms_sample.py + .. literalinclude:: ../samples/rooms_client_sample.py :start-after: [START auth_from_connection_string] :end-before: [END auth_from_connection_string] :language: python @@ -107,7 +105,7 @@ def create_room( :keyword datetime valid_from: The timestamp from when the room is open for joining. Optional. :keyword datetime valid_until: The timestamp from when the room can no longer be joined. Optional. :keyword bool pstn_dial_out_enabled: Set this flag to true if, at the time of the call, - dial out to a PSTN number is enabled in a particular room. Optional. + dial out to a PSTN number is enabled in a particular room. Optional. :keyword List[RoomParticipant] participants: Collection of identities invited to the room. Optional. :type participants: List[~azure.communication.rooms.RoomParticipant] :returns: Created room. @@ -155,7 +153,6 @@ def delete_room( :returns: None. :rtype: None :raises: ~azure.core.exceptions.HttpResponseError - """ return self._rooms_service_client.rooms.delete(room_id=room_id, **kwargs) @@ -176,7 +173,7 @@ def update_room( :keyword datetime valid_from: The timestamp from when the room is open for joining. Optional. :keyword datetime valid_until: The timestamp from when the room can no longer be joined. Optional. :keyword bool pstn_dial_out_enabled: Set this flag to true if, at the time of the call, - dial out to a PSTN number is enabled in a particular room. Optional. + dial out to a PSTN number is enabled in a particular room. Optional. :returns: Updated room. :rtype: ~azure.communication.rooms.CommunicationRoom :raises: ~azure.core.exceptions.HttpResponseError, ValueError @@ -203,7 +200,6 @@ def get_room( :returns: Room with current attributes. :rtype: ~azure.communication.rooms.CommunicationRoom :raises: ~azure.core.exceptions.HttpResponseError - """ get_room_response = self._rooms_service_client.rooms.get(room_id=room_id, **kwargs) return CommunicationRoom(get_room_response) @@ -218,7 +214,6 @@ def list_rooms( :returns: An iterator like instance of CommunicationRoom. :rtype: ~azure.core.paging.ItemPaged[~azure.communication.rooms.CommunicationRoom] :raises: ~azure.core.exceptions.HttpResponseError - """ return self._rooms_service_client.rooms.list( cls=lambda rooms: [CommunicationRoom(r) for r in rooms], @@ -236,9 +231,10 @@ def add_or_update_participants( """Update participants to a room. It looks for the room participants based on their communication identifier and replace the existing participants with the value passed in this API. + :keyword str room_id: Required. Id of room to be updated :keyword List[RoomParticipant] participants: - Required. Collection of identities invited to be updated + Required. Collection of identities invited to be updated :returns: None. :rtype: None :raises: ~azure.core.exceptions.HttpResponseError, ValueError @@ -258,9 +254,10 @@ def remove_participants( **kwargs ) -> None: """Remove participants from a room + :keyword str room_id: Required. Id of room to be updated :keyword List[Union[RoomParticipant, CommunicationIdentifier]] participants: - Required. Collection of identities to be removed from the room. + Required. Collection of identities to be removed from the room. :returns: None. :rtype: None :raises: ~azure.core.exceptions.HttpResponseError, ValueError @@ -283,6 +280,7 @@ def list_participants( **kwargs )-> ItemPaged[RoomParticipant]: """Get participants of a room + :param room_id: Required. Id of room whose participants to be fetched. :type room_id: str :returns: An iterator like instance of RoomParticipant. diff --git a/sdk/communication/azure-communication-rooms/azure/communication/rooms/aio/_rooms_client_async.py b/sdk/communication/azure-communication-rooms/azure/communication/rooms/aio/_rooms_client_async.py index 76ab30e3c0a6..c097db525d24 100644 --- a/sdk/communication/azure-communication-rooms/azure/communication/rooms/aio/_rooms_client_async.py +++ b/sdk/communication/azure-communication-rooms/azure/communication/rooms/aio/_rooms_client_async.py @@ -31,12 +31,12 @@ class RoomsClient(object): This client provides operations to manage rooms. :param str endpoint: - The endpoint url for Azure Communication Service resource. - param Union[AsyncTokenCredential, AzureKeyCredential] credential: - The access key we use to authenticate against the service. + The endpoint url for Azure Communication Service resource. + :param Union[AsyncTokenCredential, AzureKeyCredential] credential: + The access key we use to authenticate against the service. :keyword api_version: Azure Communication Rooms API version. - Default value is "2023-06-14". - Note that overriding this default value may result in unsupported behavior. + Default value is "2023-06-14". + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__( @@ -75,15 +75,15 @@ def from_connection_string(cls, conn_str: str, """Create RoomsClient from a Connection String. :param str conn_str: - A connection string to an Azure Communication Service resource. + A connection string to an Azure Communication Service resource. :returns: Instance of RoomsClient. :rtype: ~azure.communication.room.RoomsClient .. admonition:: Example: - .. literalinclude:: ../samples/Rooms_sample.py - :start-after: [START auth_from_connection_string] - :end-before: [END auth_from_connection_string] + .. literalinclude:: ../samples/rooms_client_sample_async.py + :start-after: [START auth_from_connection_string_async] + :end-before: [END auth_from_connection_string_async] :language: python :dedent: 8 :caption: Creating the RoomsClient from a connection string. @@ -107,7 +107,7 @@ async def create_room( :keyword datetime valid_from: The timestamp from when the room is open for joining. Optional. :keyword datetime valid_until: The timestamp from when the room can no longer be joined. Optional. :keyword bool pstn_dial_out_enabled: Set this flag to true if, at the time of the call, - dial out to a PSTN number is enabled in a particular room. Optional. + dial out to a PSTN number is enabled in a particular room. Optional. :keyword List[RoomParticipant] participants: Collection of identities invited to the room. Optional. :returns: Created room. :rtype: ~azure.communication.rooms.CommunicationRoom @@ -173,7 +173,7 @@ async def update_room( :keyword datetime valid_from: The timestamp from when the room is open for joining. Optional. :keyword datetime valid_until: The timestamp from when the room can no longer be joined. Optional. :keyword bool pstn_dial_out_enabled: Optional. Set this flag to true if, at the time of the call, - dial out to a PSTN number is enabled in a particular room. By default, this flag is set to false. + dial out to a PSTN number is enabled in a particular room. By default, this flag is set to false. :returns: Updated room. :rtype: ~azure.communication.rooms.CommunicationRoom :raises: ~azure.core.exceptions.HttpResponseError, ValueError @@ -200,7 +200,6 @@ async def get_room( :returns: Room with current attributes. :rtype: ~azure.communication.rooms.CommunicationRoom :raises: ~azure.core.exceptions.HttpResponseError - """ get_room_response = await self._rooms_service_client.rooms.get(room_id=room_id, **kwargs) return CommunicationRoom(get_room_response) @@ -233,9 +232,10 @@ async def add_or_update_participants( """Update participants to a room. It looks for the room participants based on their communication identifier and replace those participants with the value passed in this API. + :keyword str room_id: Required. Id of room to be updated :keyword List[RoomParticipant] participants: - Required. Collection of identities invited to be updated + Required. Collection of identities invited to be updated :returns: None. :rtype: None :raises: ~azure.core.exceptions.HttpResponseError, ValueError @@ -255,9 +255,10 @@ async def remove_participants( **kwargs ) -> None: """Remove participants from a room + :keyword str room_id: Required. Id of room to be updated :keyword List[Union[RoomParticipant, CommunicationIdentifier]] participants: - Required. Collection of identities to be removed from the room. + Required. Collection of identities to be removed from the room. :returns: None. :rtype: None :raises: ~azure.core.exceptions.HttpResponseError, ValueError @@ -280,6 +281,7 @@ def list_participants( **kwargs ) -> AsyncItemPaged[RoomParticipant]: """Get participants of a room + :param room_id: Required. Id of room whose participants to be fetched. :type room_id: str :returns: An iterator like instance of RoomParticipant. diff --git a/sdk/communication/azure-communication-rooms/pyproject.toml b/sdk/communication/azure-communication-rooms/pyproject.toml index ff779a518143..c75e8bac159a 100644 --- a/sdk/communication/azure-communication-rooms/pyproject.toml +++ b/sdk/communication/azure-communication-rooms/pyproject.toml @@ -3,3 +3,4 @@ mypy = false pyright = false type_check_samples = false verifytypes = false +strict_sphinx = true diff --git a/sdk/communication/azure-communication-rooms/samples/rooms_client_sample.py b/sdk/communication/azure-communication-rooms/samples/rooms_client_sample.py index 4844ad94dea7..77b9cce0b7c6 100644 --- a/sdk/communication/azure-communication-rooms/samples/rooms_client_sample.py +++ b/sdk/communication/azure-communication-rooms/samples/rooms_client_sample.py @@ -41,9 +41,11 @@ class RoomsSample(object): def setUp(self): + # [START auth_from_connection_string] self.connection_string = os.getenv("COMMUNICATION_CONNECTION_STRING_ROOMS") self.rooms_client = RoomsClient.from_connection_string(self.connection_string) + # [END auth_from_connection_string] self.identity_client = CommunicationIdentityClient.from_connection_string( self.connection_string) self.rooms = [] diff --git a/sdk/communication/azure-communication-rooms/samples/rooms_client_sample_async.py b/sdk/communication/azure-communication-rooms/samples/rooms_client_sample_async.py index 9f27150c6161..57e8604bdca4 100644 --- a/sdk/communication/azure-communication-rooms/samples/rooms_client_sample_async.py +++ b/sdk/communication/azure-communication-rooms/samples/rooms_client_sample_async.py @@ -42,9 +42,11 @@ class RoomsSample(object): def setUp(self): + # [START auth_from_connection_string_async] self.connection_string = os.getenv("COMMUNICATION_CONNECTION_STRING_ROOMS") self.rooms_client = RoomsClient.from_connection_string(self.connection_string) + # [END auth_from_connection_string_async] self.identity_client = CommunicationIdentityClient.from_connection_string( self.connection_string) self.rooms = [] diff --git a/sdk/communication/azure-communication-sms/azure/communication/sms/_sms_client.py b/sdk/communication/azure-communication-sms/azure/communication/sms/_sms_client.py index 2f8d7a078056..a2fec62db6c8 100644 --- a/sdk/communication/azure-communication-sms/azure/communication/sms/_sms_client.py +++ b/sdk/communication/azure-communication-sms/azure/communication/sms/_sms_client.py @@ -63,11 +63,11 @@ def from_connection_string(cls, conn_str, # type: str :param str conn_str: A connection string to an Azure Communication Service resource. :returns: Instance of SmsClient. - :rtype: ~azure.communication.SmsClient + :rtype: ~azure.communication.sms.SmsClient .. admonition:: Example: - .. literalinclude:: ../samples/sms_sample.py + .. literalinclude:: ../samples/send_sms_to_single_recipient_sample.py :start-after: [START auth_from_connection_string] :end-before: [END auth_from_connection_string] :language: python diff --git a/sdk/communication/azure-communication-sms/azure/communication/sms/aio/_sms_client_async.py b/sdk/communication/azure-communication-sms/azure/communication/sms/aio/_sms_client_async.py index ddf89cb4b010..fb8ecc625250 100644 --- a/sdk/communication/azure-communication-sms/azure/communication/sms/aio/_sms_client_async.py +++ b/sdk/communication/azure-communication-sms/azure/communication/sms/aio/_sms_client_async.py @@ -27,7 +27,7 @@ class SmsClient(object): # pylint: disable=client-accepts-api-version-keyword This client provides operations to send an SMS via a phone number. - :param str endpoint: + :param str endpoint: The endpoint url for Azure Communication Service resource. :param Union[AsyncTokenCredential, AzureKeyCredential] credential: The credential we use to authenticate against the service. @@ -64,13 +64,13 @@ def from_connection_string(cls, conn_str: str, **kwargs: Any) -> 'SmsClient': :param str conn_str: A connection string to an Azure Communication Service resource. :returns: Instance of SmsClient. - :rtype: ~azure.communication.SmsClient + :rtype: ~azure.communication.sms.aio.SmsClient .. admonition:: Example: - .. literalinclude:: ../samples/sms_sample.py - :start-after: [START auth_from_connection_string] - :end-before: [END auth_from_connection_string] + .. literalinclude:: ../samples/send_sms_to_single_recipient_sample_async.py + :start-after: [START auth_from_connection_string_async] + :end-before: [END auth_from_connection_string_async] :language: python :dedent: 8 :caption: Creating the SmsClient from a connection string. diff --git a/sdk/communication/azure-communication-sms/pyproject.toml b/sdk/communication/azure-communication-sms/pyproject.toml index 8020b382137a..c75e8bac159a 100644 --- a/sdk/communication/azure-communication-sms/pyproject.toml +++ b/sdk/communication/azure-communication-sms/pyproject.toml @@ -2,4 +2,5 @@ mypy = false pyright = false type_check_samples = false -verifytypes = false \ No newline at end of file +verifytypes = false +strict_sphinx = true diff --git a/sdk/communication/azure-communication-sms/samples/send_sms_to_single_recipient_sample.py b/sdk/communication/azure-communication-sms/samples/send_sms_to_single_recipient_sample.py index 7baea575dca3..6aaf66bbef34 100644 --- a/sdk/communication/azure-communication-sms/samples/send_sms_to_single_recipient_sample.py +++ b/sdk/communication/azure-communication-sms/samples/send_sms_to_single_recipient_sample.py @@ -30,7 +30,9 @@ class SmsSingleRecipientSample(object): phone_number = os.getenv("SMS_PHONE_NUMBER") def send_sms_to_single_recipient(self): + # [START auth_from_connection_string] sms_client = SmsClient.from_connection_string(self.connection_string) + # [END auth_from_connection_string] # calling send() with sms values sms_responses = sms_client.send( diff --git a/sdk/communication/azure-communication-sms/samples/send_sms_to_single_recipient_sample_async.py b/sdk/communication/azure-communication-sms/samples/send_sms_to_single_recipient_sample_async.py index 82351c0bd642..ee098ff572c8 100644 --- a/sdk/communication/azure-communication-sms/samples/send_sms_to_single_recipient_sample_async.py +++ b/sdk/communication/azure-communication-sms/samples/send_sms_to_single_recipient_sample_async.py @@ -31,7 +31,9 @@ class SmsSingleRecipientSampleAsync(object): phone_number = os.getenv("SMS_PHONE_NUMBER") async def send_sms_to_single_recipient_async(self): + # [START auth_from_connection_string_async] sms_client = SmsClient.from_connection_string(self.connection_string) + # [END auth_from_connection_string_async] async with sms_client: try: