diff --git a/specification/communication/Communication.JobRouter/client.tsp b/specification/communication/Communication.JobRouter/client.tsp index a7da6c4dda70..e6af226c38e0 100644 --- a/specification/communication/Communication.JobRouter/client.tsp +++ b/specification/communication/Communication.JobRouter/client.tsp @@ -42,8 +42,10 @@ interface JobRouterAdministrationRestClient { @access(Access.internal, "java") upsertExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertExceptionPolicy; + @access(Access.internal, "java") getExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getExceptionPolicy; + @access(Access.internal, "java") @access(Access.internal, "csharp") listExceptionPolicies is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listExceptionPolicies; diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index f720da962a83..f7e68448cf69 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -323,6 +323,7 @@ enum WorkerSelectorAttachmentKind { weightedAllocation, } +@projectedName("java", "ClassificationPolicyInternal") @resource("routing/classificationPolicies") @doc("A container for the rules that govern how jobs are classified.") model ClassificationPolicy { @@ -349,6 +350,7 @@ model ClassificationPolicy { workerSelectorAttachments?: WorkerSelectorAttachment[]; } +@projectedName("java", "RouterRuleInternal") @doc(""" A rule of one of the following types: StaticRule: A rule providing static rules that always return the same result, regardless of input. @@ -363,6 +365,7 @@ model RouterRule { kind: RouterRuleKind; } +@projectedName("java", "DistributionPolicyInternal") @resource("routing/distributionPolicies") @doc("Policy governing how jobs are distributed to workers") model DistributionPolicy { @@ -383,6 +386,7 @@ model DistributionPolicy { mode?: DistributionMode; } +@projectedName("java", "DistributionModeInternal") @doc("Abstract base class for defining a distribution mode.") @discriminator("kind") model DistributionMode { @@ -399,6 +403,7 @@ model DistributionMode { kind: DistributionModeKind; } +@projectedName("java", "ExceptionPolicyInternal") @resource("routing/exceptionPolicies") @doc("A policy that defines actions to execute when exception are triggered.") model ExceptionPolicy { @@ -416,6 +421,7 @@ model ExceptionPolicy { exceptionRules?: ExceptionRule[]; } +@projectedName("java", "ExceptionRuleInternal") @doc("A rule that defines actions to execute upon a specific trigger.") model ExceptionRule { @doc("Id of an exception rule.") @@ -428,6 +434,7 @@ model ExceptionRule { actions: ExceptionAction[]; } +@projectedName("java", "ExceptionTriggerInternal") @doc("Abstract base class for defining a trigger for exception rules.") @discriminator("kind") model ExceptionTrigger { @@ -444,6 +451,7 @@ model RouterJobNote { addedAt?: utcDateTime; } +@projectedName("java", "RouterJobInternal") @resource("routing/jobs") @doc("A unit of work to be routed") model RouterJob { @@ -510,6 +518,7 @@ model RouterJob { matchingMode?: JobMatchingMode; } +@projectedName("java", "RouterWorkerSelectorInternal") @doc("Describes a condition that must be met against a set of labels for worker selection.") model RouterWorkerSelector { @doc("The label key to query against.") @@ -592,6 +601,7 @@ model SuspendMode extends JobMatchingMode { kind: JobMatchingModeKind.suspend; } +@projectedName("java", "CancelJobOptionsInternal") @access(Access.public, "python") @doc("Request payload for cancelling a job.") model CancelJobOptions { @@ -602,6 +612,7 @@ model CancelJobOptions { dispositionCode?: string; } +@projectedName("java", "CompleteJobOptionsInternal") @access(Access.public, "python") @doc("Request payload for completing jobs.") model CompleteJobOptions { @@ -609,6 +620,7 @@ model CompleteJobOptions { note?: string; } +@projectedName("java", "CloseJobOptionsInternal") @access(Access.public, "python") @doc("Request payload for closing jobs") model CloseJobOptions { @@ -667,6 +679,7 @@ model AcceptJobOfferResult { workerId: string; } +@projectedName("java", "DeclineJobOfferOptionsInternal") @access(Access.public, "python") @doc("Request payload for declining offers.") model DeclineJobOfferOptions { @@ -674,6 +687,7 @@ model DeclineJobOfferOptions { retryOfferAt?: utcDateTime; } +@projectedName("java", "RouterQueueInternal") @resource("routing/queues") @doc("A queue that can contain jobs to be routed.") model RouterQueue { @@ -698,6 +712,7 @@ model RouterQueue { exceptionPolicyId?: string; } +@projectedName("java", "RouterQueueStatisticsInternal") @doc("Statistics for the queue.") model RouterQueueStatistics { @doc("Id of the queue these details are about.") @@ -713,6 +728,7 @@ model RouterQueueStatistics { longestJobWaitTimeMinutes?: float64; } +@projectedName("java", "RouterWorkerInternal") @resource("routing/workers") @doc("An entity for jobs to be routed to.") model RouterWorker { @@ -809,6 +825,7 @@ model RouterWorkerAssignment { assignedAt: utcDateTime; } +@projectedName("java", "BestWorkerModeInternal") @doc("Jobs are distributed to the worker with the strongest abilities available.") model BestWorkerMode extends DistributionMode { @doc("Define a scoring rule to use, when calculating a score to determine the best worker. If not set, will use a default scoring formula that uses the number of job labels that the worker labels match, as well as the number of label selectors the worker labels match and/or exceed using a logistic function (https://en.wikipedia.org/wiki/Logistic_function).") @@ -839,6 +856,7 @@ model ScoringRuleOptions { descendingOrder?: boolean = true; } +@projectedName("java", "CancelExceptionActionInternal") @doc("An action that marks a job as cancelled.") model CancelExceptionAction extends ExceptionAction { @doc("A note that will be appended to a job's notes collection with the current timestamp.") @@ -851,6 +869,7 @@ model CancelExceptionAction extends ExceptionAction { kind: ExceptionActionKind.cancel; } +@projectedName("java", "ExceptionActionInternal") @doc("The action to take when the exception is triggered.") @discriminator("kind") model ExceptionAction { @@ -861,6 +880,7 @@ model ExceptionAction { kind: ExceptionActionKind; } +@projectedName("java", "ConditionalQueueSelectorAttachmentInternal") @doc("Describes a set of queue selectors that will be attached if the given condition resolves to true.") model ConditionalQueueSelectorAttachment extends QueueSelectorAttachment { @doc("The condition that must be true for the queue selectors to be attached.") @@ -873,6 +893,7 @@ model ConditionalQueueSelectorAttachment extends QueueSelectorAttachment { kind: QueueSelectorAttachmentKind.conditional; } +@projectedName("java", "RouterQueueSelectorInternal") @doc("Describes a condition that must be met against a set of labels for queue selection.") model RouterQueueSelector { @doc("The label key to query against.") @@ -886,6 +907,7 @@ model RouterQueueSelector { value?: unknown; } +@projectedName("java", "QueueSelectorAttachmentInternal") @doc("An attachment of queue selectors to resolve a queue to a job from a classification policy.") @discriminator("kind") model QueueSelectorAttachment { @@ -893,6 +915,7 @@ model QueueSelectorAttachment { kind: QueueSelectorAttachmentKind; } +@projectedName("java", "ConditionalWorkerSelectorAttachmentInternal") @doc("Describes a set of worker selectors that will be attached if the given condition resolves to true.") model ConditionalWorkerSelectorAttachment extends WorkerSelectorAttachment { @doc("The condition that must be true for the worker selectors to be attached.") @@ -905,6 +928,7 @@ model ConditionalWorkerSelectorAttachment extends WorkerSelectorAttachment { kind: WorkerSelectorAttachmentKind.conditional; } +@projectedName("java", "WorkerSelectorAttachmentInternal") @doc("An attachment which attaches worker selectors to a job.") @discriminator("kind") model WorkerSelectorAttachment { @@ -912,12 +936,14 @@ model WorkerSelectorAttachment { kind: WorkerSelectorAttachmentKind; } +@projectedName("java", "DirectMapRouterRuleInternal") @doc("A rule that return the same labels as the input labels.") model DirectMapRouterRule extends RouterRule { @doc("The type discriminator describing a sub-type of Rule.") kind: RouterRuleKind.directMap; } +@projectedName("java", "ExpressionRouterRuleInternal") @doc("A rule providing inline expression rules.") model ExpressionRouterRule extends RouterRule { @doc("The expression language to compile to and execute.") @@ -930,6 +956,7 @@ model ExpressionRouterRule extends RouterRule { kind: RouterRuleKind.expression; } +@projectedName("java", "FunctionRouterRuleInternal") @doc("A rule providing a binding to an HTTP Triggered Azure Function.") model FunctionRouterRule extends RouterRule { @doc("URL for Azure Function.") @@ -954,12 +981,14 @@ model FunctionRouterRuleCredential { clientId?: string; } +@projectedName("java", "LongestIdleModeInternal") @doc("Jobs are directed to the worker who has been idle longest.") model LongestIdleMode extends DistributionMode { @doc("The type discriminator describing a sub-type of Mode.") kind: DistributionModeKind.longestIdle; } +@projectedName("java", "ManualReclassifyExceptionActionInternal") @doc("An action that manually reclassifies a job by providing the queue, priority and worker selectors.") model ManualReclassifyExceptionAction extends ExceptionAction { @doc("Updated QueueId.") @@ -985,6 +1014,7 @@ model OAuth2WebhookClientCredential { clientSecret?: string; } +@projectedName("java", "PassThroughQueueSelectorAttachmentInternal") @doc("Attaches a queue selector where the value is passed through from a job's label with the same key.") model PassThroughQueueSelectorAttachment extends QueueSelectorAttachment { @doc("The label key to query against.") @@ -997,6 +1027,7 @@ model PassThroughQueueSelectorAttachment extends QueueSelectorAttachment { kind: QueueSelectorAttachmentKind.passThrough; } +@projectedName("java", "PassThroughWorkerSelectorAttachmentInternal") @doc("Attaches a worker selector where the value is passed through from a job's label with the same key.") model PassThroughWorkerSelectorAttachment extends WorkerSelectorAttachment { @doc("The label key to query against.") @@ -1012,6 +1043,7 @@ model PassThroughWorkerSelectorAttachment extends WorkerSelectorAttachment { kind: WorkerSelectorAttachmentKind.passThrough; } +@projectedName("java", "QueueLengthExceptionTriggerInternal") @doc("Trigger for an exception action on exceeding queue length.") model QueueLengthExceptionTrigger extends ExceptionTrigger { @doc("Threshold of number of jobs ahead in the queue to for this trigger to fire.") @@ -1021,6 +1053,7 @@ model QueueLengthExceptionTrigger extends ExceptionTrigger { kind: ExceptionTriggerKind.queueLength; } +@projectedName("java", "QueueWeightedAllocationInternal") @doc("Contains the weight percentage and queue selectors to be applied if selected for weighted distributions.") model QueueWeightedAllocation { @doc("The percentage of this weight, expressed as a fraction of 1.") @@ -1030,6 +1063,7 @@ model QueueWeightedAllocation { queueSelectors: RouterQueueSelector[]; } +@projectedName("java", "ReclassifyExceptionActionInternal") @doc("An action that modifies labels on a job and then reclassifies it.") model ReclassifyExceptionAction extends ExceptionAction { @doc("The new classification policy that will determine queue, priority and worker selectors.") @@ -1043,12 +1077,14 @@ model ReclassifyExceptionAction extends ExceptionAction { kind: ExceptionActionKind.reclassify; } +@projectedName("java", "RoundRobinModeInternal") @doc("Jobs are distributed in order to workers, starting with the worker that is after the last worker to receive a job.") model RoundRobinMode extends DistributionMode { @doc("The type discriminator describing a sub-type of Mode.") kind: DistributionModeKind.roundRobin; } +@projectedName("java", "RuleEngineQueueSelectorAttachmentInternal") @doc("Attaches queue selectors to a job when the RouterRule is resolved.") model RuleEngineQueueSelectorAttachment extends QueueSelectorAttachment { @doc("A RouterRule that resolves a collection of queue selectors to attach.") @@ -1058,6 +1094,7 @@ model RuleEngineQueueSelectorAttachment extends QueueSelectorAttachment { kind: QueueSelectorAttachmentKind.ruleEngine; } +@projectedName("java", "RuleEngineWorkerSelectorAttachmentInternal") @doc("Attaches worker selectors to a job when a RouterRule is resolved.") model RuleEngineWorkerSelectorAttachment extends WorkerSelectorAttachment { @doc("A RouterRule that resolves a collection of worker selectors to attach.") @@ -1067,6 +1104,7 @@ model RuleEngineWorkerSelectorAttachment extends WorkerSelectorAttachment { kind: WorkerSelectorAttachmentKind.ruleEngine; } +@projectedName("java", "StaticQueueSelectorAttachmentInternal") @doc("Describes a queue selector that will be attached to a job.") model StaticQueueSelectorAttachment extends QueueSelectorAttachment { @doc("The queue selector to attach.") @@ -1076,6 +1114,7 @@ model StaticQueueSelectorAttachment extends QueueSelectorAttachment { kind: QueueSelectorAttachmentKind.static; } +@projectedName("java", "StaticRouterRuleInternal") @doc("A rule providing static rules that always return the same result, regardless of input.") model StaticRouterRule extends RouterRule { #suppress "@azure-tools/typespec-azure-core/no-unknown" "Unions are currently not allowed in spec." @@ -1086,6 +1125,7 @@ model StaticRouterRule extends RouterRule { kind: RouterRuleKind.static; } +@projectedName("java", "StaticWorkerSelectorAttachmentInternal") @doc("Describes a worker selector that will be attached to a job.") model StaticWorkerSelectorAttachment extends WorkerSelectorAttachment { @doc("The worker selector to attach.") @@ -1095,6 +1135,7 @@ model StaticWorkerSelectorAttachment extends WorkerSelectorAttachment { kind: WorkerSelectorAttachmentKind.static; } +@projectedName("java", "WaitTimeExceptionTriggerInternal") @doc("Trigger for an exception action on exceeding wait time.") model WaitTimeExceptionTrigger extends ExceptionTrigger { @doc("Threshold for wait time for this trigger.") @@ -1104,6 +1145,7 @@ model WaitTimeExceptionTrigger extends ExceptionTrigger { kind: ExceptionTriggerKind.waitTime; } +@projectedName("java", "WebhookRouterRuleInternal") @doc("A rule providing a binding to an external web server.") model WebhookRouterRule extends RouterRule { @doc("Uri for Authorization Server.") @@ -1119,6 +1161,7 @@ model WebhookRouterRule extends RouterRule { kind: RouterRuleKind.webhook; } +@projectedName("java", "WeightedAllocationQueueSelectorAttachmentInternal") @doc("Describes multiple sets of queue selectors, of which one will be selected and attached according to a weighting.") model WeightedAllocationQueueSelectorAttachment extends QueueSelectorAttachment { @@ -1129,6 +1172,7 @@ model WeightedAllocationQueueSelectorAttachment kind: QueueSelectorAttachmentKind.weightedAllocation; } +@projectedName("java", "WeightedAllocationWorkerSelectorAttachmentInternal") @doc("Describes multiple sets of worker selectors, of which one will be selected and attached according to a weighting.") model WeightedAllocationWorkerSelectorAttachment extends WorkerSelectorAttachment { @@ -1139,6 +1183,7 @@ model WeightedAllocationWorkerSelectorAttachment kind: WorkerSelectorAttachmentKind.weightedAllocation; } +@projectedName("java", "WorkerWeightedAllocationInternal") @doc("Contains the weight percentage and worker selectors to be applied if selected for weighted distributions.") model WorkerWeightedAllocation { @doc("The percentage of this weight, expressed as a fraction of 1.") @@ -1148,10 +1193,12 @@ model WorkerWeightedAllocation { workerSelectors: RouterWorkerSelector[]; } +@projectedName("java", "ReclassifyJobOptionsInternal") @access(Access.internal) @doc("Request payload for reclassifying jobs.") model ReclassifyJobOptions {} +@projectedName("java", "ReclassifyJobResultInternal") @access(Access.internal) @doc("Response payload from reclassifying a job.") model ReclassifyJobResult {} @@ -1167,6 +1214,7 @@ model ReclassifyJobResultWithOkResponse { _: 200; } +@projectedName("java", "CloseJobResultInternal") @access(Access.internal) @doc("Response payload from closing a job.") model CloseJobResult {} @@ -1182,6 +1230,7 @@ model CloseJobResultWithOkResponse { _: 200; } +@projectedName("java", "CancelJobResultInternal") @access(Access.internal) @doc("Response payload from cancelling a job.") model CancelJobResult {} @@ -1197,6 +1246,7 @@ model CancelJobResultWithOkResponse { _: 200; } +@projectedName("java", "CompleteJobResultInternal") @access(Access.internal) @doc("Response payload from completing a job.") model CompleteJobResult {} @@ -1212,6 +1262,7 @@ model CompleteJobResultWithOkResponse { _: 200; } +@projectedName("java", "DeclineJobOfferResultInternal") @access(Access.internal) @doc("Response payload from declining a job.") model DeclineJobOfferResult {} diff --git a/specification/communication/Communication.JobRouter/tspconfig.yaml b/specification/communication/Communication.JobRouter/tspconfig.yaml index 0a04f3cd0873..473ed7fef2f6 100644 --- a/specification/communication/Communication.JobRouter/tspconfig.yaml +++ b/specification/communication/Communication.JobRouter/tspconfig.yaml @@ -46,6 +46,8 @@ options: package-dir: "azure-communication-jobrouter" namespace: com.azure.communication.jobrouter partial-update: true + custom-types-subpackage: "implementation.models" + custom-types: "BestWorkerModeInternal,CancelExceptionActionInternal,ClassificationPolicyInternal,ConditionalQueueSelectorAttachmentInternal,ConditionalWorkerSelectorAttachmentInternal,DirectMapRouterRuleInternal,DistributionModeInternal,DistributionPolicyInternal,ExceptionActionInternal,ExceptionPolicyInternal,ExceptionRuleInternal,ExceptionTriggerInternal,ExpressionRouterRuleInternal,FunctionRouterRuleInternal,LongestIdleModeInternal,ManualReclassifyExceptionActionInternal,PassThroughQueueSelectorAttachmentInternal,PassThroughWorkerSelectorAttachmentInternal,QueueLengthExceptionTriggerInternal,QueueSelectorAttachmentInternal,QueueWeightedAllocationInternal,ReclassifyExceptionActionInternal,RoundRobinModeInternal,RouterJobInternal,RouterQueueInternal,RouterQueueSelectorInternal,RouterQueueStatisticsInternal,RouterRuleInternal,RouterWorkerInternal,RouterWorkerSelectorInternal,RuleEngineQueueSelectorAttachmentInternal,RuleEngineWorkerSelectorAttachmentInternal,StaticQueueSelectorAttachmentInternal,StaticRouterRuleInternal,StaticWorkerSelectorAttachmentInternal,WaitTimeExceptionTriggerInternal,WebhookRouterRuleInternal,WeightedAllocationQueueSelectorAttachmentInternal,WeightedAllocationWorkerSelectorAttachmentInternal,WorkerSelectorAttachmentInternal,WorkerWeightedAllocationInternal,CancelJobOptionsInternal,CancelJobResultInternal,CloseJobOptionsInternal,CloseJobResultInternal,CompleteJobOptionsInternal,CompleteJobResultInternal,DeclineJobOfferOptionsInternal,DeclineJobOfferResultInternal,ReclassifyJobOptionsInternal,ReclassifyJobResultInternal" "@azure-tools/typespec-ts": emitter-output-dir: "{js-sdk-folder}/sdk/{service-directory-name}/communication-job-router-rest" package-dir: "communication-job-router-rest"