Skip to content

Commit a0d4e1f

Browse files
annatischVinothini Dharmaraj
authored andcommitted
communications linting fixes (#36142)
1 parent 504b748 commit a0d4e1f

File tree

5 files changed

+255
-297
lines changed

5 files changed

+255
-297
lines changed

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

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
Union,
1717
overload,
1818
IO,
19+
Literal,
1920
)
2021
from azure.core import MatchConditions
2122
from azure.core.paging import ItemPaged
@@ -27,11 +28,6 @@
2728
)
2829
from .._model_base import _deserialize_datetime as _convert_str_to_datetime # pylint:disable=protected-access
2930

30-
if sys.version_info >= (3, 8):
31-
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
32-
else:
33-
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
34-
3531
if sys.version_info >= (3, 9):
3632
from collections.abc import MutableMapping
3733
else:
@@ -44,7 +40,7 @@ class JobRouterAdministrationClientOperationsMixin(
4440
): # pylint:disable=too-many-lines,line-too-long,name-too-long
4541
# region ExceptionPolicy
4642
@overload
47-
def upsert_exception_policy( # pylint: disable=arguments-differ,unused-argument
43+
def upsert_exception_policy( # pylint: disable=arguments-differ
4844
self,
4945
exception_policy_id: str,
5046
*,
@@ -203,7 +199,7 @@ def upsert_exception_policy(
203199
:raises ~azure.core.exceptions.HttpResponseError:
204200
"""
205201

206-
def upsert_exception_policy(
202+
def upsert_exception_policy( # pylint: disable=docstring-missing-param
207203
self, exception_policy_id: str, *args: Union[_models.ExceptionPolicy, JSON, IO[bytes]], **kwargs: Any
208204
) -> _models.ExceptionPolicy:
209205
"""Update an exception policy.
@@ -302,7 +298,7 @@ def list_exception_policies(
302298

303299
# region DistributionPolicy
304300
@overload
305-
def upsert_distribution_policy( # pylint: disable=arguments-differ,unused-argument
301+
def upsert_distribution_policy( # pylint: disable=arguments-differ
306302
self,
307303
distribution_policy_id: str,
308304
*,
@@ -465,17 +461,13 @@ def upsert_distribution_policy(
465461
:raises ~azure.core.exceptions.HttpResponseError:
466462
"""
467463

468-
def upsert_distribution_policy(
464+
def upsert_distribution_policy( # pylint: disable=docstring-missing-param,docstring-should-be-keyword
469465
self, distribution_policy_id: str, *args: Union[_models.DistributionPolicy, JSON, IO[bytes]], **kwargs: Any
470466
) -> _models.DistributionPolicy:
471467
"""Update a distribution policy.
472468
473469
:param str distribution_policy_id: Id of the distribution policy.
474470
475-
:param distribution_policy: An instance of distribution policy. This is a positional-only parameter.
476-
Please provide either this or individual keyword parameters.
477-
:type distribution_policy: ~azure.communication.jobrouter.models.DistributionPolicy
478-
479471
:keyword Optional[float] offer_expires_after_seconds: The expiry time of any offers created under this policy
480472
will be governed by the offer time to live.
481473
@@ -574,7 +566,7 @@ def list_distribution_policies(
574566

575567
# region Queue
576568
@overload
577-
def upsert_queue( # pylint: disable=arguments-differ,unused-argument
569+
def upsert_queue( # pylint: disable=arguments-differ
578570
self,
579571
queue_id: str,
580572
*,
@@ -591,10 +583,6 @@ def upsert_queue( # pylint: disable=arguments-differ,unused-argument
591583
592584
:param str queue_id: Id of the queue.
593585
594-
:param queue: An instance of JobQueue. This is a positional-only parameter.
595-
Please provide either this or individual keyword parameters.
596-
:type queue: ~azure.communication.jobrouter.models.RouterQueue
597-
598586
:keyword Optional[str] distribution_policy_id: The ID of the distribution policy that will determine
599587
how a job is distributed to workers.
600588
@@ -744,17 +732,13 @@ def upsert_queue(
744732
:raises ~azure.core.exceptions.HttpResponseError:
745733
"""
746734

747-
def upsert_queue(
735+
def upsert_queue( # pylint: disable=docstring-missing-param
748736
self, queue_id: str, *args: Union[_models.RouterQueue, JSON, IO[bytes]], **kwargs: Any
749737
) -> _models.RouterQueue:
750738
"""Update a job queue
751739
752740
:param str queue_id: Id of the queue.
753741
754-
:param queue: An instance of JobQueue. This is a positional-only parameter.
755-
Please provide either this or individual keyword parameters.
756-
:type queue: ~azure.communication.jobrouter.models.RouterQueue
757-
758742
:keyword Optional[str] distribution_policy_id: The ID of the distribution policy that will determine
759743
how a job is distributed to workers.
760744
@@ -852,7 +836,7 @@ def list_queues(self, *, results_per_page: Optional[int] = None, **kwargs: Any)
852836

853837
# region ClassificationPolicy
854838
@overload
855-
def upsert_classification_policy( # pylint: disable=arguments-differ,unused-argument
839+
def upsert_classification_policy( # pylint: disable=arguments-differ
856840
self,
857841
classification_policy_id: str,
858842
*,
@@ -1061,7 +1045,7 @@ def upsert_classification_policy(
10611045
:raises ~azure.core.exceptions.HttpResponseError:
10621046
"""
10631047

1064-
def upsert_classification_policy(
1048+
def upsert_classification_policy( # pylint: disable=docstring-missing-param
10651049
self, classification_policy_id: str, *args: Union[_models.ClassificationPolicy, JSON, IO[bytes]], **kwargs: Any
10661050
) -> _models.ClassificationPolicy:
10671051
"""Update a classification policy
@@ -1189,7 +1173,7 @@ def list_classification_policies(
11891173
class JobRouterClientOperationsMixin(JobRouterClientOperationsMixinGenerated):
11901174
# region Worker
11911175
@overload
1192-
def upsert_worker( # pylint: disable=arguments-differ,unused-argument
1176+
def upsert_worker( # pylint: disable=arguments-differ
11931177
self,
11941178
worker_id: str,
11951179
*,
@@ -1390,7 +1374,7 @@ def upsert_worker(
13901374
:raises ~azure.core.exceptions.HttpResponseError:
13911375
"""
13921376

1393-
def upsert_worker(
1377+
def upsert_worker( # pylint: disable=docstring-missing-param
13941378
self, worker_id: str, *args: Union[_models.RouterWorker, JSON, IO[bytes]], **kwargs: Any
13951379
) -> _models.RouterWorker:
13961380
"""Update a router worker.
@@ -1570,7 +1554,7 @@ def list_workers(
15701554

15711555
# region Job
15721556
@overload
1573-
def upsert_job( # pylint: disable=arguments-differ,unused-argument
1557+
def upsert_job( # pylint: disable=arguments-differ
15741558
self,
15751559
job_id: str,
15761560
*,
@@ -1768,7 +1752,7 @@ def upsert_job(
17681752
:raises ~azure.core.exceptions.HttpResponseError:
17691753
"""
17701754

1771-
def upsert_job(
1755+
def upsert_job( # pylint: disable=docstring-missing-param
17721756
self,
17731757
job_id: str,
17741758
*args: Union[_models.RouterJob, JSON, IO[bytes]],

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

Lines changed: 22 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"""
99
import sys
1010
import datetime
11-
from typing import List, Any, Optional, Dict, Union, overload, IO
11+
from typing import List, Any, Optional, Dict, Union, overload, IO, Literal
1212

1313
from azure.core import MatchConditions
1414
from azure.core.tracing.decorator import distributed_trace
@@ -20,26 +20,23 @@
2020
JobRouterClientOperationsMixin as JobRouterClientOperationsMixinGenerated,
2121
JobRouterAdministrationClientOperationsMixin as JobRouterAdministrationClientOperationsMixinGenerated,
2222
)
23-
from ..._model_base import _deserialize_datetime as _convert_str_to_datetime # pylint:disable=protected-access
24-
25-
if sys.version_info >= (3, 8):
26-
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
27-
else:
28-
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
23+
from ..._model_base import _deserialize_datetime as _convert_str_to_datetime
2924

3025
if sys.version_info >= (3, 9):
3126
from collections.abc import MutableMapping
3227
else:
33-
from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
28+
from typing import MutableMapping # type: ignore
29+
30+
3431
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
3532

3633

3734
class JobRouterAdministrationClientOperationsMixin(
3835
JobRouterAdministrationClientOperationsMixinGenerated
39-
): # pylint:disable=too-many-lines,line-too-long,name-too-long,arguments-differ,unused-argument
36+
): # pylint:disable=too-many-lines,line-too-long,name-too-long,arguments-differ
4037
# region ExceptionPolicy
4138
@overload
42-
async def upsert_exception_policy( # pylint: disable=arguments-differ,unused-argument
39+
async def upsert_exception_policy( # pylint: disable=arguments-differ
4340
self,
4441
exception_policy_id: str,
4542
*,
@@ -53,26 +50,19 @@ async def upsert_exception_policy( # pylint: disable=arguments-differ,unused-ar
5350
"""Update an exception policy.
5451
5552
:param str exception_policy_id: Id of the exception policy.
56-
57-
:keyword exception_rules: (Optional) A collection of exception rules on the exception
58-
policy.
53+
:keyword exception_rules: (Optional) A collection of exception rules on the exception policy.
5954
:paramtype exception_rules: Optional[Dict[str, ~azure.communication.jobrouter.models.ExceptionRule]]
60-
6155
:keyword Optional[str] name: The name of this policy.
62-
6356
:keyword if_unmodified_since: The request should only proceed if the entity was not modified
6457
after this time. Default value is None.
6558
:paramtype if_unmodified_since: ~datetime.datetime
66-
:keyword etag: check if resource is changed. Set None to skip checking etag. Default value is
67-
None.
59+
:keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None.
6860
:paramtype etag: str
6961
:keyword match_condition: The match condition to use upon the etag. Default value is None.
7062
:paramtype match_condition: ~azure.core.MatchConditions
71-
7263
:return: Instance of ExceptionPolicy
7364
:rtype: ~azure.communication.jobrouter.models.ExceptionPolicy
74-
:raises: ~azure.core.exceptions.HttpResponseError, ValueError
75-
65+
:raises: ~azure.core.exceptions.HttpResponseError
7666
7767
.. admonition:: Example:
7868
@@ -148,8 +138,7 @@ async def upsert_exception_policy(
148138
:keyword if_unmodified_since: The request should only proceed if the entity was not modified
149139
after this time. Default value is None.
150140
:paramtype if_unmodified_since: ~datetime.datetime
151-
:keyword etag: check if resource is changed. Set None to skip checking etag. Default value is
152-
None.
141+
:keyword etag: check if resource is changed. Set None to skip checking etag. Default value is None.
153142
:paramtype etag: str
154143
:keyword match_condition: The match condition to use upon the etag. Default value is None.
155144
:paramtype match_condition: ~azure.core.MatchConditions
@@ -198,7 +187,7 @@ async def upsert_exception_policy(
198187
:raises ~azure.core.exceptions.HttpResponseError:
199188
"""
200189

201-
async def upsert_exception_policy(
190+
async def upsert_exception_policy( # pylint: disable=docstring-missing-param
202191
self, exception_policy_id: str, *args: Union[_models.ExceptionPolicy, JSON, IO[bytes]], **kwargs: Any
203192
) -> _models.ExceptionPolicy:
204193
"""Update an exception policy.
@@ -297,7 +286,7 @@ def list_exception_policies(
297286

298287
# region DistributionPolicy
299288
@overload
300-
async def upsert_distribution_policy( # pylint: disable=arguments-differ,unused-argument
289+
async def upsert_distribution_policy( # pylint: disable=arguments-differ
301290
self,
302291
distribution_policy_id: str,
303292
*,
@@ -460,7 +449,7 @@ async def upsert_distribution_policy(
460449
:raises ~azure.core.exceptions.HttpResponseError:
461450
"""
462451

463-
async def upsert_distribution_policy(
452+
async def upsert_distribution_policy( # pylint: disable=docstring-missing-param
464453
self, distribution_policy_id: str, *args: Union[_models.DistributionPolicy, JSON, IO[bytes]], **kwargs: Any
465454
) -> _models.DistributionPolicy:
466455
"""Update a distribution policy.
@@ -565,7 +554,7 @@ def list_distribution_policies(
565554

566555
# region Queue
567556
@overload
568-
async def upsert_queue( # pylint: disable=arguments-differ,unused-argument
557+
async def upsert_queue( # pylint: disable=arguments-differ
569558
self,
570559
queue_id: str,
571560
*,
@@ -731,7 +720,7 @@ async def upsert_queue(
731720
:raises ~azure.core.exceptions.HttpResponseError:
732721
"""
733722

734-
async def upsert_queue(
723+
async def upsert_queue( # pylint: disable=docstring-missing-param
735724
self, queue_id: str, *args: Union[_models.RouterQueue, JSON, IO[bytes]], **kwargs: Any
736725
) -> _models.RouterQueue:
737726
"""Update a job queue
@@ -838,7 +827,7 @@ def list_queues(
838827

839828
# region ClassificationPolicy
840829
@overload
841-
async def upsert_classification_policy( # pylint: disable=arguments-differ,unused-argument
830+
async def upsert_classification_policy( # pylint: disable=arguments-differ
842831
self,
843832
classification_policy_id: str,
844833
*,
@@ -1046,7 +1035,7 @@ async def upsert_classification_policy(
10461035
:raises ~azure.core.exceptions.HttpResponseError:
10471036
"""
10481037

1049-
async def upsert_classification_policy(
1038+
async def upsert_classification_policy( # pylint: disable=docstring-missing-param
10501039
self, classification_policy_id: str, *args: Union[_models.ClassificationPolicy, JSON, IO[bytes]], **kwargs: Any
10511040
) -> _models.ClassificationPolicy:
10521041
"""Update a classification policy
@@ -1174,7 +1163,7 @@ def list_classification_policies(
11741163
class JobRouterClientOperationsMixin(JobRouterClientOperationsMixinGenerated):
11751164
# region Worker
11761165
@overload
1177-
async def upsert_worker( # pylint: disable=arguments-differ,unused-argument
1166+
async def upsert_worker( # pylint: disable=arguments-differ
11781167
self,
11791168
worker_id: str,
11801169
*,
@@ -1384,7 +1373,7 @@ async def upsert_worker(
13841373
:raises ~azure.core.exceptions.HttpResponseError:
13851374
"""
13861375

1387-
async def upsert_worker(
1376+
async def upsert_worker( # pylint: disable=docstring-missing-param
13881377
self, worker_id: str, *args: Union[_models.RouterWorker, JSON, IO[bytes]], **kwargs: Any
13891378
) -> _models.RouterWorker:
13901379
"""Update a router worker.
@@ -1554,7 +1543,7 @@ def list_workers(
15541543

15551544
# region Job
15561545
@overload
1557-
async def upsert_job( # pylint: disable=arguments-differ,unused-argument
1546+
async def upsert_job( # pylint: disable=arguments-differ
15581547
self,
15591548
job_id: str,
15601549
*,
@@ -1752,7 +1741,7 @@ async def upsert_job(
17521741
:raises ~azure.core.exceptions.HttpResponseError:
17531742
"""
17541743

1755-
async def upsert_job(
1744+
async def upsert_job( # pylint: disable=docstring-missing-param
17561745
self, job_id: str, *args: Union[_models.RouterJob, JSON, IO[bytes]], **kwargs: Any
17571746
) -> _models.RouterJob:
17581747
"""Update a job.

0 commit comments

Comments
 (0)