Skip to content

Commit

Permalink
CodeGen from PR 26658 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge db1f6f8b9299b3600e3cd3f7696cb96878e70ef0 into 42e2c0bcd77b0de6c523404668fa63511484d485
  • Loading branch information
SDKAuto committed Nov 10, 2023
1 parent 4039427 commit 602ea6f
Show file tree
Hide file tree
Showing 5 changed files with 350 additions and 237 deletions.
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": "b87d2bbace5e5e5474fff2b40ddb9995028bf7a0",
"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 @@ -68,14 +68,21 @@
from ._models import WorkerSelectorAttachment
from ._models import WorkerWeightedAllocation

from ._enums import DistributionModeKind
from ._enums import ExceptionActionKind
from ._enums import ExceptionTriggerKind
from ._enums import ExpressionRouterRuleLanguage
from ._enums import JobMatchingModeKind
from ._enums import LabelOperator
from ._enums import QueueSelectorAttachmentKind
from ._enums import RouterJobStatus
from ._enums import RouterJobStatusSelector
from ._enums import RouterRuleKind
from ._enums import RouterWorkerSelectorStatus
from ._enums import RouterWorkerState
from ._enums import RouterWorkerStateSelector
from ._enums import ScoringRuleParameterSelector
from ._enums import WorkerSelectorAttachmentKind
from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
from ._patch import patch_sdk as _patch_sdk
Expand Down Expand Up @@ -142,14 +149,21 @@
"WeightedAllocationWorkerSelectorAttachment",
"WorkerSelectorAttachment",
"WorkerWeightedAllocation",
"DistributionModeKind",
"ExceptionActionKind",
"ExceptionTriggerKind",
"ExpressionRouterRuleLanguage",
"JobMatchingModeKind",
"LabelOperator",
"QueueSelectorAttachmentKind",
"RouterJobStatus",
"RouterJobStatusSelector",
"RouterRuleKind",
"RouterWorkerSelectorStatus",
"RouterWorkerState",
"RouterWorkerStateSelector",
"ScoringRuleParameterSelector",
"WorkerSelectorAttachmentKind",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,55 @@
from azure.core import CaseInsensitiveEnumMeta


class DistributionModeKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Supported distribution mode types."""

BEST_WORKER = "bestWorker"
"""Discriminator value for BestWorkerMode."""
LONGEST_IDLE = "longestIdle"
"""Discriminator value for LongestIdleMode."""
ROUND_ROBIN = "roundRobin"
"""Discriminator value for RoundRobinMode."""


class ExceptionActionKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Supported exception action types."""

CANCEL = "cancel"
"""Discriminator value for CancelExceptionAction."""
MANUAL_RECLASSIFY = "manualReclassify"
"""Discriminator value for ManualReclassifyExceptionAction."""
RECLASSIFY = "reclassify"
"""Discriminator value for ReclassifyExceptionAction."""


class ExceptionTriggerKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Supported exception trigger types."""

QUEUE_LENGTH = "queueLength"
"""Discriminator value for QueueLengthExceptionTrigger."""
WAIT_TIME = "waitTime"
"""Discriminator value for WaitTimeExceptionTrigger."""


class ExpressionRouterRuleLanguage(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The available expression languages that can be configured."""

POWER_FX = "powerFx"
"""PowerFx"""


class JobMatchingModeKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Supported matching mode types."""

QUEUE_AND_MATCH = "queueAndMatch"
"""Discriminator value for QueueAndMatchMode."""
SCHEDULE_AND_SUSPEND = "scheduleAndSuspend"
"""Discriminator value for ScheduleAndSuspendMode."""
SUSPEND = "suspend"
"""Discriminator value for SuspendMode."""


class LabelOperator(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Describes supported operations on label values."""

Expand All @@ -34,6 +76,21 @@ class LabelOperator(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Greater than or equal"""


class QueueSelectorAttachmentKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Supported queue selector attachment types."""

CONDITIONAL = "conditional"
"""Discriminator value for ConditionalQueueSelectorAttachment."""
PASS_THROUGH = "passThrough"
"""Discriminator value for PassThroughQueueSelectorAttachment."""
RULE_ENGINE = "ruleEngine"
"""Discriminator value for RuleEngineQueueSelectorAttachment."""
STATIC = "static"
"""Discriminator value for StaticQueueSelectorAttachment."""
WEIGHTED_ALLOCATION = "weightedAllocation"
"""Discriminator value for WeightedAllocationQueueSelectorAttachment."""


class RouterJobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The status of the Job."""

Expand Down Expand Up @@ -97,6 +154,21 @@ class RouterJobStatusSelector(str, Enum, metaclass=CaseInsensitiveEnumMeta):
#: Completed or PendingSchedule or Scheduled or ScheduleFailed or WaitingForActivation."""


class RouterRuleKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Supported router rule types."""

DIRECT_MAP = "directMap"
"""Discriminator value for DirectMapRouterRule."""
EXPRESSION = "expression"
"""Discriminator value for ExpressionRouterRule."""
FUNCTION = "function"
"""Discriminator value for FunctionRouterRule."""
STATIC = "static"
"""Discriminator value for StaticRouterRule."""
WEBHOOK = "webhook"
"""Discriminator value for WebhookRouterRule."""


class RouterWorkerSelectorStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The status of the worker selector."""

Expand Down Expand Up @@ -140,3 +212,18 @@ class ScoringRuleParameterSelector(str, Enum, metaclass=CaseInsensitiveEnumMeta)
WORKER_SELECTORS = "workerSelectors"
"""Parameter to add worker selectors from the job to scoring payload. Property is sent as
#: ``selectors``."""


class WorkerSelectorAttachmentKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Supported worker selector attachment types."""

CONDITIONAL = "conditional"
"""Discriminator value for ConditionalWorkerSelectorAttachment."""
PASS_THROUGH = "passThrough"
"""Discriminator value for PassThroughWorkerSelectorAttachment."""
RULE_ENGINE = "ruleEngine"
"""Discriminator value for RuleEngineWorkerSelectorAttachment."""
STATIC = "static"
"""Discriminator value for StaticWorkerSelectorAttachment."""
WEIGHTED_ALLOCATION = "weightedAllocation"
"""Discriminator value for WeightedAllocationWorkerSelectorAttachment."""
Loading

0 comments on commit 602ea6f

Please sign in to comment.