From 904517962d32ae8a56093fb17497e34a76d378e6 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 9 Nov 2023 20:40:08 +0000 Subject: [PATCH] CodeGen from PR 26649 in Azure/azure-rest-api-specs Merge f6459f80353bb6b7453dfddf47d4476a595fe166 into e7cfe1b9a11a6c17fb263f2f83ba9570631a6ffb --- .../azure-communication-jobrouter/_meta.json | 6 ++ .../jobrouter/_operations/_operations.py | 16 ++-- .../jobrouter/aio/_operations/_operations.py | 16 ++-- .../jobrouter/models/__init__.py | 8 ++ .../communication/jobrouter/models/_models.py | 77 ++++++++++++++++++- .../tsp-location.yaml | 6 +- 6 files changed, 109 insertions(+), 20 deletions(-) create mode 100644 sdk/communication/azure-communication-jobrouter/_meta.json diff --git a/sdk/communication/azure-communication-jobrouter/_meta.json b/sdk/communication/azure-communication-jobrouter/_meta.json new file mode 100644 index 000000000000..f03261bd085b --- /dev/null +++ b/sdk/communication/azure-communication-jobrouter/_meta.json @@ -0,0 +1,6 @@ +{ + "commit": "55b04c4037f345b1f3220e2e2c9f423120f8ab7d", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "typespec_src": "specification/communication/Communication.JobRouter", + "@azure-tools/typespec-python": "0.15.12" +} \ No newline at end of file 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 65592b05b998..16e6338790de 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 @@ -3210,7 +3210,7 @@ def _reclassify_job( # pylint: disable=protected-access def _cancel_job( # pylint: disable=protected-access self, job_id: str, - options: Optional[_models._models.CancelJobOptions] = None, + options: Optional[_models.CancelJobOptions] = None, *, content_type: str = "application/json", **kwargs: Any @@ -3231,7 +3231,7 @@ def _cancel_job( # pylint: disable=protected-access @distributed_trace def _cancel_job( # pylint: disable=protected-access - self, job_id: str, options: Optional[Union[_models._models.CancelJobOptions, JSON, IO]] = None, **kwargs: Any + self, job_id: str, options: Optional[Union[_models.CancelJobOptions, JSON, IO]] = None, **kwargs: Any ) -> _models._models.CancelJobResult: """Submits request to cancel an existing job by Id while supplying free-form cancellation reason. @@ -3318,7 +3318,7 @@ def _complete_job( # pylint: disable=protected-access self, job_id: str, assignment_id: str, - options: Optional[_models._models.CompleteJobOptions] = None, + options: Optional[_models.CompleteJobOptions] = None, *, content_type: str = "application/json", **kwargs: Any @@ -3354,7 +3354,7 @@ def _complete_job( # pylint: disable=protected-access self, job_id: str, assignment_id: str, - options: Optional[Union[_models._models.CompleteJobOptions, JSON, IO]] = None, + options: Optional[Union[_models.CompleteJobOptions, JSON, IO]] = None, **kwargs: Any ) -> _models._models.CompleteJobResult: """Completes an assigned job. @@ -3445,7 +3445,7 @@ def _close_job( # pylint: disable=protected-access self, job_id: str, assignment_id: str, - options: Optional[_models._models.CloseJobOptions] = None, + options: Optional[_models.CloseJobOptions] = None, *, content_type: str = "application/json", **kwargs: Any @@ -3481,7 +3481,7 @@ def _close_job( # pylint: disable=protected-access self, job_id: str, assignment_id: str, - options: Optional[Union[_models._models.CloseJobOptions, JSON, IO]] = None, + options: Optional[Union[_models.CloseJobOptions, JSON, IO]] = None, **kwargs: Any ) -> _models._models.CloseJobResult: """Closes a completed job. @@ -4001,7 +4001,7 @@ def _decline_job_offer( # pylint: disable=protected-access self, worker_id: str, offer_id: str, - options: Optional[_models._models.DeclineJobOfferOptions] = None, + options: Optional[_models.DeclineJobOfferOptions] = None, *, content_type: str = "application/json", **kwargs: Any @@ -4037,7 +4037,7 @@ def _decline_job_offer( # pylint: disable=protected-access self, worker_id: str, offer_id: str, - options: Optional[Union[_models._models.DeclineJobOfferOptions, JSON, IO]] = None, + options: Optional[Union[_models.DeclineJobOfferOptions, JSON, IO]] = None, **kwargs: Any ) -> _models._models.DeclineJobOfferResult: """Declines an offer to work on a job. 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 4d6378126d3a..cdb40f3f4144 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 @@ -2308,7 +2308,7 @@ async def _reclassify_job( # pylint: disable=protected-access async def _cancel_job( # pylint: disable=protected-access self, job_id: str, - options: Optional[_models._models.CancelJobOptions] = None, + options: Optional[_models.CancelJobOptions] = None, *, content_type: str = "application/json", **kwargs: Any @@ -2329,7 +2329,7 @@ async def _cancel_job( # pylint: disable=protected-access @distributed_trace_async async def _cancel_job( # pylint: disable=protected-access - self, job_id: str, options: Optional[Union[_models._models.CancelJobOptions, JSON, IO]] = None, **kwargs: Any + self, job_id: str, options: Optional[Union[_models.CancelJobOptions, JSON, IO]] = None, **kwargs: Any ) -> _models._models.CancelJobResult: """Submits request to cancel an existing job by Id while supplying free-form cancellation reason. @@ -2416,7 +2416,7 @@ async def _complete_job( # pylint: disable=protected-access self, job_id: str, assignment_id: str, - options: Optional[_models._models.CompleteJobOptions] = None, + options: Optional[_models.CompleteJobOptions] = None, *, content_type: str = "application/json", **kwargs: Any @@ -2452,7 +2452,7 @@ async def _complete_job( # pylint: disable=protected-access self, job_id: str, assignment_id: str, - options: Optional[Union[_models._models.CompleteJobOptions, JSON, IO]] = None, + options: Optional[Union[_models.CompleteJobOptions, JSON, IO]] = None, **kwargs: Any ) -> _models._models.CompleteJobResult: """Completes an assigned job. @@ -2543,7 +2543,7 @@ async def _close_job( # pylint: disable=protected-access self, job_id: str, assignment_id: str, - options: Optional[_models._models.CloseJobOptions] = None, + options: Optional[_models.CloseJobOptions] = None, *, content_type: str = "application/json", **kwargs: Any @@ -2579,7 +2579,7 @@ async def _close_job( # pylint: disable=protected-access self, job_id: str, assignment_id: str, - options: Optional[Union[_models._models.CloseJobOptions, JSON, IO]] = None, + options: Optional[Union[_models.CloseJobOptions, JSON, IO]] = None, **kwargs: Any ) -> _models._models.CloseJobResult: """Closes a completed job. @@ -3100,7 +3100,7 @@ async def _decline_job_offer( # pylint: disable=protected-access self, worker_id: str, offer_id: str, - options: Optional[_models._models.DeclineJobOfferOptions] = None, + options: Optional[_models.DeclineJobOfferOptions] = None, *, content_type: str = "application/json", **kwargs: Any @@ -3136,7 +3136,7 @@ async def _decline_job_offer( # pylint: disable=protected-access self, worker_id: str, offer_id: str, - options: Optional[Union[_models._models.DeclineJobOfferOptions, JSON, IO]] = None, + options: Optional[Union[_models.DeclineJobOfferOptions, JSON, IO]] = None, **kwargs: Any ) -> _models._models.DeclineJobOfferResult: """Declines an offer to work on a job. diff --git a/sdk/communication/azure-communication-jobrouter/azure/communication/jobrouter/models/__init__.py b/sdk/communication/azure-communication-jobrouter/azure/communication/jobrouter/models/__init__.py index 984eb2d98f02..c0439ca773ec 100644 --- a/sdk/communication/azure-communication-jobrouter/azure/communication/jobrouter/models/__init__.py +++ b/sdk/communication/azure-communication-jobrouter/azure/communication/jobrouter/models/__init__.py @@ -9,9 +9,13 @@ from ._models import AcceptJobOfferResult from ._models import BestWorkerMode from ._models import CancelExceptionAction +from ._models import CancelJobOptions from ._models import ClassificationPolicy +from ._models import CloseJobOptions +from ._models import CompleteJobOptions from ._models import ConditionalQueueSelectorAttachment from ._models import ConditionalWorkerSelectorAttachment +from ._models import DeclineJobOfferOptions from ._models import DirectMapRouterRule from ._models import DistributionMode from ._models import DistributionPolicy @@ -80,9 +84,13 @@ "AcceptJobOfferResult", "BestWorkerMode", "CancelExceptionAction", + "CancelJobOptions", "ClassificationPolicy", + "CloseJobOptions", + "CompleteJobOptions", "ConditionalQueueSelectorAttachment", "ConditionalWorkerSelectorAttachment", + "DeclineJobOfferOptions", "DirectMapRouterRule", "DistributionMode", "DistributionPolicy", diff --git a/sdk/communication/azure-communication-jobrouter/azure/communication/jobrouter/models/_models.py b/sdk/communication/azure-communication-jobrouter/azure/communication/jobrouter/models/_models.py index f1ea8dc60655..bd413fc05a60 100644 --- a/sdk/communication/azure-communication-jobrouter/azure/communication/jobrouter/models/_models.py +++ b/sdk/communication/azure-communication-jobrouter/azure/communication/jobrouter/models/_models.py @@ -1,5 +1,5 @@ # coding=utf-8 -# pylint: disable=too-many-lines,anomalous-backslash-in-string,name-too-long +# pylint: disable=too-many-lines # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. @@ -297,6 +297,25 @@ class CancelJobOptions(_model_base.Model): """Indicates the outcome of the job, populate this field with your own custom values. If not provided, default value of \"Cancelled\" is set.""" + @overload + def __init__( + self, + *, + note: Optional[str] = None, + disposition_code: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + class CancelJobResult(_model_base.Model): """Response payload from cancelling a job.""" @@ -396,6 +415,26 @@ class CloseJobOptions(_model_base.Model): note: Optional[str] = rest_field() """A note that will be appended to the jobs' Notes collection with the current timestamp.""" + @overload + def __init__( + self, + *, + disposition_code: Optional[str] = None, + close_at: Optional[datetime.datetime] = None, + note: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + class CloseJobResult(_model_base.Model): """Response payload from closing a job.""" @@ -412,6 +451,24 @@ class CompleteJobOptions(_model_base.Model): note: Optional[str] = rest_field() """A note that will be appended to the jobs' Notes collection with the current timestamp.""" + @overload + def __init__( + self, + *, + note: Optional[str] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + class CompleteJobResult(_model_base.Model): """Response payload from completing a job.""" @@ -574,6 +631,24 @@ class DeclineJobOfferOptions(_model_base.Model): is provided, then the job will be re-matched to eligible workers at the retry time in UTC. The worker that declined the job will also be eligible for the job at that time.""" + @overload + def __init__( + self, + *, + retry_offer_at: Optional[datetime.datetime] = None, + ): + ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + class DeclineJobOfferResult(_model_base.Model): """Response payload from declining a job.""" diff --git a/sdk/communication/azure-communication-jobrouter/tsp-location.yaml b/sdk/communication/azure-communication-jobrouter/tsp-location.yaml index cc372f8e93ff..64679f4e3555 100644 --- a/sdk/communication/azure-communication-jobrouter/tsp-location.yaml +++ b/sdk/communication/azure-communication-jobrouter/tsp-location.yaml @@ -1,5 +1,5 @@ -repo: Azure/azure-rest-api-specs -additionalDirectories: [] directory: specification/communication/Communication.JobRouter -commit: de1ef0678497c007ddc66fcc42bbc96043fe029f +additionalDirectories: [] +commit: 55b04c4037f345b1f3220e2e2c9f423120f8ab7d +repo: Azure/azure-rest-api-specs