Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[AutoPR azure-communication-jobrouter] [ACS JobRouter] Python sdk customizations #5337

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions sdk/communication/azure-communication-jobrouter/_meta.json
Original file line number Diff line number Diff line change
@@ -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"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.

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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -80,9 +84,13 @@
"AcceptJobOfferResult",
"BestWorkerMode",
"CancelExceptionAction",
"CancelJobOptions",
"ClassificationPolicy",
"CloseJobOptions",
"CompleteJobOptions",
"ConditionalQueueSelectorAttachment",
"ConditionalWorkerSelectorAttachment",
"DeclineJobOfferOptions",
"DirectMapRouterRule",
"DistributionMode",
"DistributionPolicy",
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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."""
Expand Down Expand Up @@ -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."""
Expand All @@ -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."""
Expand Down Expand Up @@ -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."""
Expand Down
Original file line number Diff line number Diff line change
@@ -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