Skip to content

Commit 6632e13

Browse files
strict sphinx communication (#36111)
* strict sphinx communication-messages * sphinx callautomation * sphinx identity * jobrouter some fixes * sphinx phonenumbers * sphinx rooms * sphinx sms * fix
1 parent 444ed8b commit 6632e13

File tree

30 files changed

+121
-88
lines changed

30 files changed

+121
-88
lines changed

sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_call_connection_client.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,8 @@ def cancel_add_participant_operation(
840840
**kwargs
841841
) -> CancelAddParticipantOperationResult:
842842
"""Cancel add participant request sent out to a participant.
843-
:param invitation_id: The invitation ID that was used to add the participant.
843+
844+
:param invitation_id: The invitation ID that was used to add the participant.
844845
:type invitation_id: str
845846
:keyword operation_context: Value that can be used to track this call and its associated events.
846847
:paramtype operation_context: str
@@ -877,19 +878,20 @@ def start_hold_music(
877878
**kwargs
878879
) -> None:
879880
"""Hold participant from call while playing music.
881+
880882
:param play_source: A PlaySource representing the source to play.
881883
:type play_source: ~azure.communication.callautomation.FileSource or
882884
~azure.communication.callautomation.TextSource or
883885
~azure.communication.callautomation.SsmlSource or
884886
list[~azure.communication.callautomation.FileSource or
885-
~azure.communication.callautomation.TextSource or
886-
~azure.communication.callautomation.SsmlSource]
887+
~azure.communication.callautomation.TextSource or
888+
~azure.communication.callautomation.SsmlSource]
887889
:param target_participant: The targets to play media to. Default value is 'all', to play media
888890
to all participants in the call.
889891
:type target_participant: list[~azure.communication.callautomation.CommunicationIdentifier]
890892
:keyword loop: Whether the media should be repeated until stopped.
893+
**DEPRECATED**: 'loop' has been deprecated and will be removed from future releases.
891894
:paramtype loop: bool
892-
**DEPRECATED**: 'loop' has been deprecated and will be removed from future releases.
893895
:keyword operation_context: Value that can be used to track this call and its associated events.
894896
:paramtype operation_context: str or None
895897
:return: None

sdk/communication/azure-communication-callautomation/azure/communication/callautomation/aio/_call_connection_client_async.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,8 @@ async def cancel_add_participant_operation(
846846
**kwargs
847847
) -> CancelAddParticipantOperationResult:
848848
"""Cancel add participant request sent out to a participant.
849-
:param invitation_id: The invitation ID that was used to add the participant.
849+
850+
:param invitation_id: The invitation ID that was used to add the participant.
850851
:type invitation_id: str
851852
:keyword operation_context: Value that can be used to track this call and its associated events.
852853
:paramtype operation_context: str
@@ -883,19 +884,20 @@ async def start_hold_music(
883884
**kwargs
884885
) -> None:
885886
"""Hold participant from call while playing music.
887+
886888
:param play_source: A PlaySource representing the source to play.
887889
:type play_source: ~azure.communication.callautomation.FileSource or
888890
~azure.communication.callautomation.TextSource or
889891
~azure.communication.callautomation.SsmlSource or
890892
list[~azure.communication.callautomation.FileSource or
891-
~azure.communication.callautomation.TextSource or
892-
~azure.communication.callautomation.SsmlSource]
893+
~azure.communication.callautomation.TextSource or
894+
~azure.communication.callautomation.SsmlSource]
893895
:param target_participant: The targets to play media to. Default value is 'all', to play media
894896
to all participants in the call.
895897
:type target_participant: list[~azure.communication.callautomation.CommunicationIdentifier]
896898
:keyword loop: Whether the media should be repeated until stopped.
899+
**DEPRECATED**: 'loop' has been deprecated and will be removed from future releases.
897900
:paramtype loop: bool
898-
**DEPRECATED**: 'loop' has been deprecated and will be removed from future releases.
899901
:keyword operation_context: Value that can be used to track this call and its associated events.
900902
:paramtype operation_context: str or None
901903
:return: None

sdk/communication/azure-communication-callautomation/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ mypy = false
33
pyright = false
44
type_check_samples = false
55
verifytypes = false
6+
strict_sphinx = true

sdk/communication/azure-communication-identity/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ Azure Communication Identity client package is intended to be used to setup the
1313
_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_
1414

1515
# Getting started
16-
### Prerequisites
16+
## Prerequisites
1717
- Python 3.8 or later is required to use this package.
1818
- You must have an [Azure subscription](https://azure.microsoft.com/free/)
1919
- 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.
20-
### Install the package
20+
## Install the package
2121
Install the Azure Communication Identity client library for Python with [pip](https://pypi.org/project/pip/):
2222

2323
```bash

sdk/communication/azure-communication-identity/azure/communication/identity/_communication_identity_client.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ class CommunicationIdentityClient(object):
3636
3737
.. literalinclude:: ../samples/identity_samples.py
3838
:language: python
39-
:dedent: 8
4039
"""
4140

4241
def __init__(
@@ -75,15 +74,6 @@ def from_connection_string(
7574
:param str conn_str: A connection string to an Azure Communication Service resource.
7675
:returns: Instance of CommunicationIdentityClient.
7776
:rtype: ~azure.communication.identity.CommunicationIdentityClient
78-
79-
.. admonition:: Example:
80-
81-
.. literalinclude:: ../samples/identity_samples.py
82-
:start-after: [START auth_from_connection_string]
83-
:end-before: [END auth_from_connection_string]
84-
:language: python
85-
:dedent: 8
86-
:caption: Creating the CommunicationIdentityClient from a connection string.
8777
"""
8878
endpoint, access_key = parse_connection_str(conn_str)
8979

sdk/communication/azure-communication-identity/azure/communication/identity/aio/_communication_identity_client_async.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@ class CommunicationIdentityClient:
3636
3737
.. admonition:: Example:
3838
39-
.. literalinclude:: ../../samples/identity_samples_async.py
39+
.. literalinclude:: ../samples/identity_samples_async.py
4040
:language: python
41-
:dedent: 8
4241
"""
4342

4443
def __init__(
@@ -78,15 +77,6 @@ def from_connection_string(
7877
A connection string to an Azure Communication Service resource.
7978
:returns: Instance of CommunicationIdentityClient.
8079
:rtype: ~azure.communication.identity.aio.CommunicationIdentityClient
81-
82-
.. admonition:: Example:
83-
84-
.. literalinclude:: ../samples/identity_samples.py
85-
:start-after: [START auth_from_connection_string]
86-
:end-before: [END auth_from_connection_string]
87-
:language: python
88-
:dedent: 8
89-
:caption: Creating the CommunicationIdentityClient from a connection string.
9080
"""
9181
endpoint, access_key = parse_connection_str(conn_str)
9282

@@ -113,7 +103,8 @@ async def create_user(self, **kwargs) -> "CommunicationUserIdentifier":
113103
async def create_user_and_token(
114104
self, scopes: List[Union[str, "CommunicationTokenScope"]], **kwargs
115105
) -> Tuple["CommunicationUserIdentifier", AccessToken]:
116-
"""create a single Communication user with an identity token.
106+
"""Create a single Communication user with an identity token.
107+
117108
:param scopes:
118109
List of scopes to be added to the token.
119110
:type scopes: list[str or ~azure.communication.identity.CommunicationTokenScope]

sdk/communication/azure-communication-identity/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
pyright = false
33
type_check_samples = false
44
verifytypes = false
5+
strict_sphinx = true

sdk/communication/azure-communication-jobrouter/azure/communication/jobrouter/_operations/_operations.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,6 +1302,7 @@ def upsert_distribution_policy(
13021302
13031303
Example:
13041304
.. code-block:: python
1305+
13051306
# The response is polymorphic. The following are possible polymorphic responses based
13061307
off discriminator "kind":
13071308
@@ -1494,6 +1495,7 @@ def upsert_distribution_policy(
14941495
14951496
Example:
14961497
.. code-block:: python
1498+
14971499
# The response is polymorphic. The following are possible polymorphic responses based
14981500
off discriminator "kind":
14991501
@@ -2013,6 +2015,7 @@ def get_distribution_policy(self, distribution_policy_id: str, **kwargs: Any) ->
20132015
20142016
Example:
20152017
.. code-block:: python
2018+
20162019
# The response is polymorphic. The following are possible polymorphic responses based
20172020
off discriminator "kind":
20182021
@@ -2160,6 +2163,7 @@ def list_distribution_policies(self, **kwargs: Any) -> ItemPaged["_models.Distri
21602163
21612164
Example:
21622165
.. code-block:: python
2166+
21632167
# The response is polymorphic. The following are possible polymorphic responses based
21642168
off discriminator "kind":
21652169
@@ -2635,6 +2639,7 @@ def upsert_classification_policy(
26352639
26362640
Example:
26372641
.. code-block:: python
2642+
26382643
# The response is polymorphic. The following are possible polymorphic responses based
26392644
off discriminator "kind":
26402645
@@ -2791,6 +2796,7 @@ def upsert_classification_policy(
27912796
27922797
Example:
27932798
.. code-block:: python
2799+
27942800
# The response is polymorphic. The following are possible polymorphic responses based
27952801
off discriminator "kind":
27962802
@@ -3223,6 +3229,7 @@ def get_classification_policy(self, classification_policy_id: str, **kwargs: Any
32233229
32243230
Example:
32253231
.. code-block:: python
3232+
32263233
# The response is polymorphic. The following are possible polymorphic responses based
32273234
off discriminator "kind":
32283235
@@ -3356,6 +3363,7 @@ def list_classification_policies(self, **kwargs: Any) -> ItemPaged["_models.Clas
33563363
33573364
Example:
33583365
.. code-block:: python
3366+
33593367
# The response is polymorphic. The following are possible polymorphic responses based
33603368
off discriminator "kind":
33613369
@@ -5030,6 +5038,7 @@ def upsert_job(
50305038
50315039
Example:
50325040
.. code-block:: python
5041+
50335042
# The response is polymorphic. The following are possible polymorphic responses based
50345043
off discriminator "kind":
50355044
@@ -5202,6 +5211,7 @@ def upsert_job(
52025211
52035212
Example:
52045213
.. code-block:: python
5214+
52055215
# The response is polymorphic. The following are possible polymorphic responses based
52065216
off discriminator "kind":
52075217
@@ -5714,6 +5724,7 @@ def get_job(self, job_id: str, **kwargs: Any) -> _models.RouterJob:
57145724
57155725
Example:
57165726
.. code-block:: python
5727+
57175728
# The response is polymorphic. The following are possible polymorphic responses based
57185729
off discriminator "kind":
57195730
@@ -6469,6 +6480,7 @@ def list_jobs(
64696480
64706481
Example:
64716482
.. code-block:: python
6483+
64726484
# The response is polymorphic. The following are possible polymorphic responses based
64736485
off discriminator "kind":
64746486

sdk/communication/azure-communication-jobrouter/azure/communication/jobrouter/aio/_operations/_operations.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ async def upsert_distribution_policy(
393393
394394
Example:
395395
.. code-block:: python
396+
396397
# The response is polymorphic. The following are possible polymorphic responses based
397398
off discriminator "kind":
398399
@@ -585,6 +586,7 @@ async def upsert_distribution_policy(
585586
586587
Example:
587588
.. code-block:: python
589+
588590
# The response is polymorphic. The following are possible polymorphic responses based
589591
off discriminator "kind":
590592
@@ -1104,6 +1106,7 @@ async def get_distribution_policy(self, distribution_policy_id: str, **kwargs: A
11041106
11051107
Example:
11061108
.. code-block:: python
1109+
11071110
# The response is polymorphic. The following are possible polymorphic responses based
11081111
off discriminator "kind":
11091112
@@ -1252,6 +1255,7 @@ def list_distribution_policies(self, **kwargs: Any) -> AsyncItemPaged["_models.D
12521255
12531256
Example:
12541257
.. code-block:: python
1258+
12551259
# The response is polymorphic. The following are possible polymorphic responses based
12561260
off discriminator "kind":
12571261
@@ -1727,6 +1731,7 @@ async def upsert_classification_policy(
17271731
17281732
Example:
17291733
.. code-block:: python
1734+
17301735
# The response is polymorphic. The following are possible polymorphic responses based
17311736
off discriminator "kind":
17321737
@@ -1883,6 +1888,7 @@ async def upsert_classification_policy(
18831888
18841889
Example:
18851890
.. code-block:: python
1891+
18861892
# The response is polymorphic. The following are possible polymorphic responses based
18871893
off discriminator "kind":
18881894
@@ -2317,6 +2323,7 @@ async def get_classification_policy(
23172323
23182324
Example:
23192325
.. code-block:: python
2326+
23202327
# The response is polymorphic. The following are possible polymorphic responses based
23212328
off discriminator "kind":
23222329
@@ -2450,6 +2457,7 @@ def list_classification_policies(self, **kwargs: Any) -> AsyncItemPaged["_models
24502457
24512458
Example:
24522459
.. code-block:: python
2460+
24532461
# The response is polymorphic. The following are possible polymorphic responses based
24542462
off discriminator "kind":
24552463
@@ -4128,6 +4136,7 @@ async def upsert_job(
41284136
41294137
Example:
41304138
.. code-block:: python
4139+
41314140
# The response is polymorphic. The following are possible polymorphic responses based
41324141
off discriminator "kind":
41334142
@@ -4300,6 +4309,7 @@ async def upsert_job(
43004309
43014310
Example:
43024311
.. code-block:: python
4312+
43034313
# The response is polymorphic. The following are possible polymorphic responses based
43044314
off discriminator "kind":
43054315
@@ -4812,6 +4822,7 @@ async def get_job(self, job_id: str, **kwargs: Any) -> _models.RouterJob:
48124822
48134823
Example:
48144824
.. code-block:: python
4825+
48154826
# The response is polymorphic. The following are possible polymorphic responses based
48164827
off discriminator "kind":
48174828
@@ -5568,6 +5579,7 @@ def list_jobs(
55685579
55695580
Example:
55705581
.. code-block:: python
5582+
55715583
# The response is polymorphic. The following are possible polymorphic responses based
55725584
off discriminator "kind":
55735585

sdk/communication/azure-communication-jobrouter/azure/communication/jobrouter/aio/_patch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def from_connection_string(cls, conn_str: str, **kwargs: Any) -> "JobRouterClien
7575
7676
.. admonition:: Example:
7777
78-
.. literalinclude:: ../samples/sample_authentication.py
78+
.. literalinclude:: ../samples/sample_authentication_async.py
7979
:start-after: [START auth_from_connection_string_async]
8080
:end-before: [END auth_from_connection_string_async]
8181
:language: python
@@ -141,7 +141,7 @@ def from_connection_string(cls, conn_str: str, **kwargs: Any) -> "JobRouterAdmin
141141
142142
.. admonition:: Example:
143143
144-
.. literalinclude:: ../samples/sample_authentication.py
144+
.. literalinclude:: ../samples/sample_authentication_async.py
145145
:start-after: [START admin_auth_from_connection_string_async]
146146
:end-before: [END admin_auth_from_connection_string_async]
147147
:language: python

0 commit comments

Comments
 (0)