From 089319aefa72122b794bf1b780a99a85344bd713 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Mon, 11 Sep 2023 20:36:33 -0700 Subject: [PATCH 001/113] jobrouter ga typespec initial commit --- .../communication/JobRouter/.gitignore | 2 + .../communication/JobRouter/client.tsp | 60 + ...onPolicies_CreateClassificationPolicy.json | 94 + ...onPolicies_DeleteClassificationPolicy.json | 12 + ...ationPolicies_GetClassificationPolicy.json | 46 + ...istClassificationPoliciesWithPageSize.json | 64 + ...onPolicies_UpdateClassificationPolicy.json | 72 + ...tionPolicies_CreateDistributionPolicy.json | 47 + ...tionPolicies_DeleteDistributionPolicy.json | 12 + ...ibutionPolicies_GetDistributionPolicy.json | 24 + ..._ListDistributionPoliciesWithPageSize.json | 46 + ...tionPolicies_UpdateDistributionPolicy.json | 47 + ...ceptionPolicies_CreateExceptionPolicy.json | 77 + ...ceptionPolicies_DeleteExceptionPolicy.json | 12 + .../ExceptionPolicies_GetExceptionPolicy.json | 34 + ...ies_ListExceptionPoliciesWithPageSize.json | 66 + ...ceptionPolicies_UpdateExceptionPolicy.json | 77 + .../examples/2023-11-01/Jobs_CloseJob.json | 22 + .../examples/2023-11-01/Jobs_CompleteJob.json | 18 + .../examples/2023-11-01/Jobs_CreateJob.json | 93 + .../2023-11-01/Jobs_CreateScheduledJob.json | 101 + .../examples/2023-11-01/Jobs_DeleteJob.json | 12 + .../2023-11-01/Jobs_GetInQueuePosition.json | 20 + .../examples/2023-11-01/Jobs_GetJob.json | 42 + .../2023-11-01/Jobs_GetJobsWithPageSize.json | 67 + .../2023-11-01/Jobs_ReclassifyJob.json | 15 + .../2023-11-01/Jobs_RequestJobCancel.json | 18 + .../examples/2023-11-01/Jobs_UnassignJob.json | 21 + .../examples/2023-11-01/Jobs_UpdateJob.json | 76 + .../2023-11-01/Offers_AcceptJobOffer.json | 19 + .../2023-11-01/Offers_DeclineJobOffer.json | 18 + .../2023-11-01/Queues_CreateQueue.json | 35 + .../2023-11-01/Queues_DeleteQueue.json | 12 + .../examples/2023-11-01/Queues_GetQueue.json | 20 + .../2023-11-01/Queues_GetQueueStatistics.json | 17 + .../Queues_ListQueuesWithPageSize.json | 38 + .../2023-11-01/Queues_UpdateQueue.json | 33 + .../2023-11-01/Workers_CreateWorker.json | 83 + .../2023-11-01/Workers_DeleteWorker.json | 12 + .../Workers_DeregisterActiveWorker.json | 67 + .../Workers_DeregisterInactiveWorker.json | 67 + .../Workers_GetAvailableWorkersByChannel.json | 76 + .../2023-11-01/Workers_GetWorker.json | 38 + .../Workers_GetWorkersWithPageSize.json | 74 + .../2023-11-01/Workers_RegisterWorker.json | 67 + .../2023-11-01/Workers_UpdateWorker.json | 83 + .../communication/JobRouter/main.tsp | 22 + .../communication/JobRouter/models.tsp | 1373 +++++++ .../communication/JobRouter/routes.tsp | 639 +++ .../communication/JobRouter/tspconfig.yaml | 39 + .../communicationservicejobrouter.json | 3588 +++++++++++++++++ 51 files changed, 7717 insertions(+) create mode 100644 specification/communication/JobRouter/.gitignore create mode 100644 specification/communication/JobRouter/client.tsp create mode 100644 specification/communication/JobRouter/examples/2023-11-01/ClassificationPolicies_CreateClassificationPolicy.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/ClassificationPolicies_DeleteClassificationPolicy.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/ClassificationPolicies_GetClassificationPolicy.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/ClassificationPolicies_UpdateClassificationPolicy.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/DistributionPolicies_CreateDistributionPolicy.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/DistributionPolicies_DeleteDistributionPolicy.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/DistributionPolicies_GetDistributionPolicy.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/DistributionPolicies_ListDistributionPoliciesWithPageSize.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/DistributionPolicies_UpdateDistributionPolicy.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/ExceptionPolicies_CreateExceptionPolicy.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/ExceptionPolicies_DeleteExceptionPolicy.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/ExceptionPolicies_GetExceptionPolicy.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/ExceptionPolicies_UpdateExceptionPolicy.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/Jobs_CloseJob.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/Jobs_CompleteJob.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/Jobs_CreateJob.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/Jobs_CreateScheduledJob.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/Jobs_DeleteJob.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/Jobs_GetInQueuePosition.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/Jobs_GetJob.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/Jobs_GetJobsWithPageSize.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/Jobs_ReclassifyJob.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/Jobs_RequestJobCancel.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/Jobs_UnassignJob.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/Jobs_UpdateJob.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/Offers_AcceptJobOffer.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/Offers_DeclineJobOffer.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/Queues_CreateQueue.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/Queues_DeleteQueue.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/Queues_GetQueue.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/Queues_GetQueueStatistics.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/Queues_ListQueuesWithPageSize.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/Queues_UpdateQueue.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/Workers_CreateWorker.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/Workers_DeleteWorker.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/Workers_DeregisterActiveWorker.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/Workers_DeregisterInactiveWorker.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/Workers_GetWorker.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/Workers_RegisterWorker.json create mode 100644 specification/communication/JobRouter/examples/2023-11-01/Workers_UpdateWorker.json create mode 100644 specification/communication/JobRouter/main.tsp create mode 100644 specification/communication/JobRouter/models.tsp create mode 100644 specification/communication/JobRouter/routes.tsp create mode 100644 specification/communication/JobRouter/tspconfig.yaml create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json diff --git a/specification/communication/JobRouter/.gitignore b/specification/communication/JobRouter/.gitignore new file mode 100644 index 000000000000..93d3320a42a9 --- /dev/null +++ b/specification/communication/JobRouter/.gitignore @@ -0,0 +1,2 @@ +**/package.json +**/package-lock.json \ No newline at end of file diff --git a/specification/communication/JobRouter/client.tsp b/specification/communication/JobRouter/client.tsp new file mode 100644 index 000000000000..38019df13ed2 --- /dev/null +++ b/specification/communication/JobRouter/client.tsp @@ -0,0 +1,60 @@ +// client.tsp +import "./main.tsp"; +import "@azure-tools/typespec-client-generator-core"; +import "@typespec/versioning"; + +import "./models.tsp"; + +using Azure.ClientGenerator.Core; +using TypeSpec.Versioning; + +@useDependency(AzureCommunicationRoutingService.Versions.c2023_11_01) +namespace ClientForAcsJobRouter; + +// Your customizations here +@@client(AzureCommunicationRoutingService,{ + name: "JobRouterAdministrationClient", + service: AzureCommunicationRoutingService +}) +interface JobRouterAdministrationClient { + upsertDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertDistributionPolicy; + getDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getDistributionPolicy; + listDistributionPolicies is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listDistributionPolicies; + deleteDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteDistributionPolicy; + upsertClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertClassificationPolicy; + getClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getClassificationPolicy; + listClassificationPolicies is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listClassificationPolicies; + deleteClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteClassificationPolicy; + upsertExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertExceptionPolicy; + getExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getExceptionPolicy; + listExceptionPolicies is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listExceptionPolicies; + deleteExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteExceptionPolicy; + upsertQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertQueue; + getQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getQueue; + listQueues is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listQueues; + deleteQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteQueue; +} + +@@client(AzureCommunicationRoutingService, { + name: "JobRouterClient", + service: AzureCommunicationRoutingService +}) +interface JobRouterClient { + upsertJob is AzureCommunicationRoutingService.JobRouterOperations.upsertJob; + getJob is AzureCommunicationRoutingService.JobRouterOperations.getJob; + deleteJob is AzureCommunicationRoutingService.JobRouterOperations.deleteJob; + reclassifyJob is AzureCommunicationRoutingService.JobRouterOperations.reclassifyJobAction; + cancelJob is AzureCommunicationRoutingService.JobRouterOperations.cancelJobAction; + completeJob is AzureCommunicationRoutingService.JobRouterOperations.completeJobAction; + closeJob is AzureCommunicationRoutingService.JobRouterOperations.closeJobAction; + listJobs is AzureCommunicationRoutingService.JobRouterOperations.listJobs; + getQueuePosition is AzureCommunicationRoutingService.JobRouterOperations.getInQueuePosition; + unassignJob is AzureCommunicationRoutingService.JobRouterOperations.unassignJobAction; + acceptJob is AzureCommunicationRoutingService.JobRouterOperations.acceptJobAction; + declineJob is AzureCommunicationRoutingService.JobRouterOperations.declineJobAction; + getQueueStatistics is AzureCommunicationRoutingService.JobRouterOperations.getQueueStatistics; + upsertWorker is AzureCommunicationRoutingService.JobRouterOperations.upsertWorker; + getWorker is AzureCommunicationRoutingService.JobRouterOperations.getWorker; + deleteWorker is AzureCommunicationRoutingService.JobRouterOperations.deleteWorker; + listWorkers is AzureCommunicationRoutingService.JobRouterOperations.listWorkers; +} \ No newline at end of file diff --git a/specification/communication/JobRouter/examples/2023-11-01/ClassificationPolicies_CreateClassificationPolicy.json b/specification/communication/JobRouter/examples/2023-11-01/ClassificationPolicies_CreateClassificationPolicy.json new file mode 100644 index 000000000000..c0bbee9c9c42 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/ClassificationPolicies_CreateClassificationPolicy.json @@ -0,0 +1,94 @@ +{ + "title": "Creates or updates a classification policy.", + "operationId": "upsertClassificationPolicy", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "90eb00c4-234e-4df7-a231-ef7895518384", + "patch": { + "name": "Main", + "fallbackQueueId": "MainQueue", + "queueSelectors": [ + { + "kind": "conditional", + "condition": { + "kind": "expression-rule", + "language": "PowerFx", + "expression": "1 = 1" + }, + "queueSelectors": [ + { + "key": "foo", + "labelOperator": "equal", + "value": "bar" + } + ] + } + ], + "prioritizationRule": { + "kind": "static-rule", + "value": "2" + } + } + }, + "responses": { + "200": { + "body": { + "id": "90eb00c4-234e-4df7-a231-ef7895518384", + "name": "Main", + "fallbackQueueId": "MainQueue", + "queueSelectors": [ + { + "kind": "conditional", + "condition": { + "kind": "expression-rule", + "language": "PowerFx", + "expression": "1 = 1" + }, + "queueSelectors": [ + { + "key": "foo", + "labelOperator": "equal", + "value": "bar" + } + ] + } + ], + "prioritizationRule": { + "kind": "static-rule", + "value": "2" + }, + "workerSelectors": [] + } + }, + "201": { + "body": { + "id": "90eb00c4-234e-4df7-a231-ef7895518384", + "name": "Main", + "fallbackQueueId": "MainQueue", + "queueSelectors": [ + { + "kind": "conditional", + "condition": { + "kind": "expression-rule", + "language": "PowerFx", + "expression": "1 = 1" + }, + "queueSelectors": [ + { + "key": "foo", + "labelOperator": "equal", + "value": "bar" + } + ] + } + ], + "prioritizationRule": { + "kind": "static-rule", + "value": "2" + }, + "workerSelectors": [] + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/ClassificationPolicies_DeleteClassificationPolicy.json b/specification/communication/JobRouter/examples/2023-11-01/ClassificationPolicies_DeleteClassificationPolicy.json new file mode 100644 index 000000000000..988f8952b7f3 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/ClassificationPolicies_DeleteClassificationPolicy.json @@ -0,0 +1,12 @@ +{ + "title": "Delete a classification policy by Id.", + "operationId": "deleteClassificationPolicy", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "MainClassificationPolicy" + }, + "responses": { + "204": {} + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/ClassificationPolicies_GetClassificationPolicy.json b/specification/communication/JobRouter/examples/2023-11-01/ClassificationPolicies_GetClassificationPolicy.json new file mode 100644 index 000000000000..09d501835619 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/ClassificationPolicies_GetClassificationPolicy.json @@ -0,0 +1,46 @@ +{ + "title": "Retrieves an existing classification policy by Id.", + "operationId": "getClassificationPolicy", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "MainClassificationPolicy" + }, + "responses": { + "200": { + "body": { + "id": "MainClassificationPolicy", + "name": "Main", + "fallbackQueueId": "MainQueue", + "queueSelectors": [ + { + "kind": "conditional", + "condition": { + "kind": "expression-rule", + "language": "PowerFx", + "expression": "1 = 1" + }, + "queueSelectors": [ + { + "key": "foo", + "labelOperator": "equal", + "value": "bar" + } + ] + } + ], + "prioritizationRule": { + "kind": "static-rule", + "value": "2" + }, + "workerSelectors": [ + { + "kind": "pass-through", + "key": "language", + "labelOperator": "equal" + } + ] + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json b/specification/communication/JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json new file mode 100644 index 000000000000..03303df5c951 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json @@ -0,0 +1,64 @@ +{ + "title": "Retrieves existing classification policies.", + "operationId": "listClassificationPolicies", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "maxpagesize": 2 + }, + "responses": { + "200": { + "body": { + "value": [ + { + "classificationPolicy": { + "id": "MainClassificationPolicy", + "name": "Main", + "fallbackQueueId": "MainQueue", + "queueSelectors": [ + { + "kind": "rule", + "rule": { + "kind": "expression-rule", + "language": "PowerFx", + "expression": "If(job.Escalated = true, \"SecondaryQueue\", \"MainQueue\")" + } + } + ], + "prioritizationRule": { + "kind": "static-rule", + "value": "2" + }, + "workerSelectors": [] + }, + "etag": "etag" + }, + { + "classificationPolicy": { + "id": "SecondaryClassificationPolicy", + "name": "Secondary", + "fallbackQueueId": "MainQueue", + "queueSelectors": [ + { + "kind": "rule", + "rule": { + "kind": "expression-rule", + "language": "PowerFx", + "expression": "If(job.VIP = true, \"VIPQueue\", \"MainQueue\")" + } + } + ], + "prioritizationRule": { + "kind": "static-rule", + "value": "1" + }, + "workerSelectors": [] + }, + "etag": "etag" + } + ], + "nextLink": "null" + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/ClassificationPolicies_UpdateClassificationPolicy.json b/specification/communication/JobRouter/examples/2023-11-01/ClassificationPolicies_UpdateClassificationPolicy.json new file mode 100644 index 000000000000..1b5c2deb83f5 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/ClassificationPolicies_UpdateClassificationPolicy.json @@ -0,0 +1,72 @@ +{ + "title": "Updates a classification policy.", + "operationId": "upsertClassificationPolicy", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "90eb00c4-234e-4df7-a231-ef7895518384", + "patch": { + "name": "MainUpdate" + } + }, + "responses": { + "200": { + "body": { + "id": "90eb00c4-234e-4df7-a231-ef7895518384", + "name": "MainUpdate", + "fallbackQueueId": "MainQueue", + "queueSelectors": [ + { + "kind": "conditional", + "condition": { + "kind": "expression-rule", + "language": "PowerFx", + "expression": "1 = 1" + }, + "queueSelectors": [ + { + "key": "foo", + "labelOperator": "equal", + "value": "bar" + } + ] + } + ], + "prioritizationRule": { + "kind": "static-rule", + "value": "2" + }, + "workerSelectors": [] + } + }, + "201": { + "body": { + "id": "90eb00c4-234e-4df7-a231-ef7895518384", + "name": "MainUpdate", + "fallbackQueueId": "MainQueue", + "queueSelectors": [ + { + "kind": "conditional", + "condition": { + "kind": "expression-rule", + "language": "PowerFx", + "expression": "1 = 1" + }, + "queueSelectors": [ + { + "key": "foo", + "labelOperator": "equal", + "value": "bar" + } + ] + } + ], + "prioritizationRule": { + "kind": "static-rule", + "value": "2" + }, + "workerSelectors": [] + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/DistributionPolicies_CreateDistributionPolicy.json b/specification/communication/JobRouter/examples/2023-11-01/DistributionPolicies_CreateDistributionPolicy.json new file mode 100644 index 000000000000..144342ededc9 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/DistributionPolicies_CreateDistributionPolicy.json @@ -0,0 +1,47 @@ +{ + "title": "Creates or updates a distribution policy.", + "operationId": "upsertDistributionPolicy", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "d9033d56-659c-437a-b5b7-4f3b14301dd4", + "patch": { + "mode": { + "kind": "longest-idle", + "minConcurrentOffers": 1, + "maxConcurrentOffers": 5, + "bypassSelectors": false + }, + "offerExpiresAfterSeconds": 300, + "name": "Main" + } + }, + "responses": { + "200": { + "body": { + "id": "d9033d56-659c-437a-b5b7-4f3b14301dd4", + "name": "Main", + "offerExpiresAfterSeconds": 300, + "mode": { + "kind": "longest-idle", + "minConcurrentOffers": 1, + "maxConcurrentOffers": 5, + "bypassSelectors": false + } + } + }, + "201": { + "body": { + "id": "d9033d56-659c-437a-b5b7-4f3b14301dd4", + "name": "Main", + "offerExpiresAfterSeconds": 300, + "mode": { + "kind": "longest-idle", + "minConcurrentOffers": 1, + "maxConcurrentOffers": 5, + "bypassSelectors": false + } + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/DistributionPolicies_DeleteDistributionPolicy.json b/specification/communication/JobRouter/examples/2023-11-01/DistributionPolicies_DeleteDistributionPolicy.json new file mode 100644 index 000000000000..ea005b13ce32 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/DistributionPolicies_DeleteDistributionPolicy.json @@ -0,0 +1,12 @@ +{ + "title": "Delete a distribution policy by Id.", + "operationId": "deleteDistributionPolicy", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "MainDistributionPolicy" + }, + "responses": { + "204": {} + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/DistributionPolicies_GetDistributionPolicy.json b/specification/communication/JobRouter/examples/2023-11-01/DistributionPolicies_GetDistributionPolicy.json new file mode 100644 index 000000000000..bcbe4db5d048 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/DistributionPolicies_GetDistributionPolicy.json @@ -0,0 +1,24 @@ +{ + "title": "Retrieves an existing distribution policy by Id.", + "operationId": "getDistributionPolicy", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "MainDistributionPolicy" + }, + "responses": { + "200": { + "body": { + "id": "MainDistributionPolicy", + "name": "Main", + "offerExpiresAfterSeconds": 300, + "mode": { + "kind": "longest-idle", + "minConcurrentOffers": 1, + "maxConcurrentOffers": 5, + "bypassSelectors": false + } + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/DistributionPolicies_ListDistributionPoliciesWithPageSize.json b/specification/communication/JobRouter/examples/2023-11-01/DistributionPolicies_ListDistributionPoliciesWithPageSize.json new file mode 100644 index 000000000000..6267b80e0326 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/DistributionPolicies_ListDistributionPoliciesWithPageSize.json @@ -0,0 +1,46 @@ +{ + "title": "Retrieves existing distribution policies.", + "operationId": "listDistributionPolicies", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "maxpagesize": 2 + }, + "responses": { + "200": { + "body": { + "value": [ + { + "distributionPolicy": { + "id": "SecondaryDistributionPolicy", + "name": "Secondary", + "offerExpiresAfterSeconds": 300, + "mode": { + "kind": "round-robin", + "minConcurrentOffers": 1, + "maxConcurrentOffers": 2, + "bypassSelectors": false + } + }, + "etag": "etag" + }, + { + "distributionPolicy": { + "id": "MainDistributionPolicy", + "name": "Main", + "offerExpiresAfterSeconds": 300, + "mode": { + "kind": "longest-idle", + "minConcurrentOffers": 1, + "maxConcurrentOffers": 5, + "bypassSelectors": false + } + }, + "etag": "etag" + } + ], + "nextLink": "null" + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/DistributionPolicies_UpdateDistributionPolicy.json b/specification/communication/JobRouter/examples/2023-11-01/DistributionPolicies_UpdateDistributionPolicy.json new file mode 100644 index 000000000000..2bd52b2c4d7c --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/DistributionPolicies_UpdateDistributionPolicy.json @@ -0,0 +1,47 @@ +{ + "title": "Updates a distribution policy.", + "operationId": "upsertDistributionPolicy", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "d9033d56-659c-437a-b5b7-4f3b14301dd4", + "patch": { + "mode": { + "kind": "longest-idle", + "minConcurrentOffers": 1, + "maxConcurrentOffers": 5, + "bypassSelectors": false + }, + "offerExpiresAfterSeconds": 300, + "name": "Main" + } + }, + "responses": { + "200": { + "body": { + "id": "d9033d56-659c-437a-b5b7-4f3b14301dd4", + "name": "Main", + "offerExpiresAfterSeconds": 300, + "mode": { + "kind": "longest-idle", + "minConcurrentOffers": 1, + "maxConcurrentOffers": 5, + "bypassSelectors": false + } + } + }, + "201": { + "body": { + "id": "d9033d56-659c-437a-b5b7-4f3b14301dd4", + "name": "Main", + "offerExpiresAfterSeconds": 300, + "mode": { + "kind": "longest-idle", + "minConcurrentOffers": 1, + "maxConcurrentOffers": 5, + "bypassSelectors": false + } + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/ExceptionPolicies_CreateExceptionPolicy.json b/specification/communication/JobRouter/examples/2023-11-01/ExceptionPolicies_CreateExceptionPolicy.json new file mode 100644 index 000000000000..2f199895ae66 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/ExceptionPolicies_CreateExceptionPolicy.json @@ -0,0 +1,77 @@ +{ + "title": "Creates or updates a exception policy.", + "operationId": "upsertExceptionPolicy", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "cf1cda69-6f41-45ac-b252-213293f1b1cb", + "patch": { + "name": "Main", + "exceptionRules": { + "MaxWaitTimeExceeded": { + "actions": { + "MoveJobToEscalatedQueue": { + "kind": "reclassify", + "classificationPolicyId": "Main", + "labelsToUpsert": { + "escalated": true + } + } + }, + "trigger": { + "kind": "wait-time", + "thresholdSeconds": 20 + } + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "cf1cda69-6f41-45ac-b252-213293f1b1cb", + "name": "Main", + "exceptionRules": { + "MaxWaitTimeExceeded": { + "trigger": { + "kind": "wait-time", + "thresholdSeconds": 20 + }, + "actions": { + "MoveJobToEscalatedQueue": { + "kind": "reclassify", + "classificationPolicyId": "Main", + "labelsToUpsert": { + "escalated": true + } + } + } + } + } + } + }, + "201": { + "body": { + "id": "cf1cda69-6f41-45ac-b252-213293f1b1cb", + "name": "Main", + "exceptionRules": { + "MaxWaitTimeExceeded": { + "trigger": { + "kind": "wait-time", + "thresholdSeconds": 20 + }, + "actions": { + "MoveJobToEscalatedQueue": { + "kind": "reclassify", + "classificationPolicyId": "Main", + "labelsToUpsert": { + "escalated": true + } + } + } + } + } + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/ExceptionPolicies_DeleteExceptionPolicy.json b/specification/communication/JobRouter/examples/2023-11-01/ExceptionPolicies_DeleteExceptionPolicy.json new file mode 100644 index 000000000000..3bfe46420477 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/ExceptionPolicies_DeleteExceptionPolicy.json @@ -0,0 +1,12 @@ +{ + "title": "Deletes a exception policy by Id.", + "operationId": "deleteExceptionPolicy", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "MainExceptionPolicy" + }, + "responses": { + "204": {} + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/ExceptionPolicies_GetExceptionPolicy.json b/specification/communication/JobRouter/examples/2023-11-01/ExceptionPolicies_GetExceptionPolicy.json new file mode 100644 index 000000000000..db8355c39a18 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/ExceptionPolicies_GetExceptionPolicy.json @@ -0,0 +1,34 @@ +{ + "title": "Retrieves an existing exception policy by Id.", + "operationId": "getExceptionPolicy", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "MainExceptionPolicy" + }, + "responses": { + "200": { + "body": { + "id": "MainExceptionPolicy", + "name": "Main", + "exceptionRules": { + "MaxWaitTimeExceeded": { + "trigger": { + "kind": "wait-time", + "thresholdSeconds": 20 + }, + "actions": { + "MoveJobToEscalatedQueue": { + "kind": "reclassify", + "classificationPolicyId": "Main", + "labelsToUpsert": { + "escalated": true + } + } + } + } + } + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json b/specification/communication/JobRouter/examples/2023-11-01/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json new file mode 100644 index 000000000000..e873ad5978e1 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json @@ -0,0 +1,66 @@ +{ + "title": "Retrieves existing exception policies.", + "operationId": "listExceptionPolicies", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "maxpagesize": 2 + }, + "responses": { + "200": { + "body": { + "value": [ + { + "exceptionPolicy": { + "id": "MainExceptionPolicy", + "name": "Main", + "exceptionRules": { + "MaxWaitTimeExceeded": { + "trigger": { + "kind": "wait-time", + "thresholdSeconds": 20 + }, + "actions": { + "MoveJobToEscalatedQueue": { + "kind": "reclassify", + "classificationPolicyId": "Main", + "labelsToUpsert": { + "escalated": true + } + } + } + } + } + }, + "etag": "etag" + }, + { + "exceptionPolicy": { + "id": "SecondaryExceptionPolicy", + "name": "Secondary", + "exceptionRules": { + "MaxWaitTimeExceeded": { + "trigger": { + "kind": "wait-time", + "thresholdSeconds": 50 + }, + "actions": { + "MoveJobToVIPQueue": { + "kind": "reclassify", + "classificationPolicyId": "Main", + "labelsToUpsert": { + "VIP": true + } + } + } + } + } + }, + "etag": "etag" + } + ], + "nextLink": "null" + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/ExceptionPolicies_UpdateExceptionPolicy.json b/specification/communication/JobRouter/examples/2023-11-01/ExceptionPolicies_UpdateExceptionPolicy.json new file mode 100644 index 000000000000..a2ccad3dfa85 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/ExceptionPolicies_UpdateExceptionPolicy.json @@ -0,0 +1,77 @@ +{ + "title": "Updates a exception policy.", + "operationId": "upsertExceptionPolicy", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "cf1cda69-6f41-45ac-b252-213293f1b1cb", + "patch": { + "name": "Main test", + "exceptionRules": { + "MaxWaitTimeExceeded": { + "actions": { + "MoveJobToEscalatedQueue": { + "kind": "reclassify", + "classificationPolicyId": "Main", + "labelsToUpsert": { + "escalated": true + } + } + }, + "trigger": { + "kind": "wait-time", + "thresholdSeconds": 20 + } + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "cf1cda69-6f41-45ac-b252-213293f1b1cb", + "name": "Main test", + "exceptionRules": { + "MaxWaitTimeExceeded": { + "trigger": { + "kind": "wait-time", + "thresholdSeconds": 20 + }, + "actions": { + "MoveJobToEscalatedQueue": { + "kind": "reclassify", + "classificationPolicyId": "Main", + "labelsToUpsert": { + "escalated": true + } + } + } + } + } + } + }, + "201": { + "body": { + "id": "cf1cda69-6f41-45ac-b252-213293f1b1cb", + "name": "Main test", + "exceptionRules": { + "MaxWaitTimeExceeded": { + "trigger": { + "kind": "wait-time", + "thresholdSeconds": 20 + }, + "actions": { + "MoveJobToEscalatedQueue": { + "kind": "reclassify", + "classificationPolicyId": "Main", + "labelsToUpsert": { + "escalated": true + } + } + } + } + } + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/Jobs_CloseJob.json b/specification/communication/JobRouter/examples/2023-11-01/Jobs_CloseJob.json new file mode 100644 index 000000000000..273f1bda9c74 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/Jobs_CloseJob.json @@ -0,0 +1,22 @@ +{ + "title": "Closes a completed job.", + "operationId": "closeJobAction", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "8780b28c-7079-4de1-9143-4d369289e958", + "closeJobRequest": { + "assignmentId": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "dispositionCode": "JobCompleted.", + "note": "Closing job" + } + }, + "responses": { + "200": { + "body": {} + }, + "202": { + "body": {} + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/Jobs_CompleteJob.json b/specification/communication/JobRouter/examples/2023-11-01/Jobs_CompleteJob.json new file mode 100644 index 000000000000..42f7b1900a83 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/Jobs_CompleteJob.json @@ -0,0 +1,18 @@ +{ + "title": "Completes an assigned job.", + "operationId": "completeJobAction", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "8780b28c-7079-4de1-9143-4d369289e958", + "completeJobRequest": { + "assignmentId": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "note": "Completing job" + } + }, + "responses": { + "200": { + "body": {} + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/Jobs_CreateJob.json b/specification/communication/JobRouter/examples/2023-11-01/Jobs_CreateJob.json new file mode 100644 index 000000000000..ac53895d17cc --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/Jobs_CreateJob.json @@ -0,0 +1,93 @@ +{ + "title": "Creates or updates a router job.", + "operationId": "upsertJob", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "JobId", + "patch": { + "channelId": "CustomChatChannel", + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "queueId": "MainQueue", + "priority": 5, + "requestedWorkerSelectors": [ + { + "key": "Sales", + "labelOperator": "equal", + "value": true + } + ], + "labels": {}, + "matchingMode": { + "modeType": "queueAndMatchMode", + "queueAndMatchMode": {}, + "scheduleAndSuspendMode": null, + "suspendMode": null + } + } + }, + "responses": { + "200": { + "body": { + "id": "JobId", + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "status": "queued", + "enqueuedAt": "2021-09-30T23:59:04.5311999+00:00", + "channelId": "CustomChatChannel", + "classificationPolicyId": null, + "queueId": "MainQueue", + "priority": 5, + "dispositionCode": null, + "requestedWorkerSelectors": [ + { + "key": "Sales", + "labelOperator": "equal", + "value": true, + "expiresAfterSeconds": null + } + ], + "attachedWorkerSelectors": [], + "labels": {}, + "assignments": {}, + "notes": {}, + "matchingMode": { + "modeType": "queueAndMatchMode", + "queueAndMatchMode": {}, + "scheduleAndSuspendMode": null, + "suspendMode": null + } + } + }, + "201": { + "body": { + "id": "JobId", + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "status": "queued", + "enqueuedAt": "2021-09-30T23:59:04.5311999+00:00", + "channelId": "CustomChatChannel", + "classificationPolicyId": null, + "queueId": "MainQueue", + "priority": 5, + "dispositionCode": null, + "requestedWorkerSelectors": [ + { + "key": "Sales", + "labelOperator": "equal", + "value": true, + "expiresAfterSeconds": null + } + ], + "attachedWorkerSelectors": [], + "labels": {}, + "assignments": {}, + "notes": {}, + "matchingMode": { + "modeType": "queueAndMatchMode", + "queueAndMatchMode": {}, + "scheduleAndSuspendMode": null, + "suspendMode": null + } + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/Jobs_CreateScheduledJob.json b/specification/communication/JobRouter/examples/2023-11-01/Jobs_CreateScheduledJob.json new file mode 100644 index 000000000000..61fe9a8ba83f --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/Jobs_CreateScheduledJob.json @@ -0,0 +1,101 @@ +{ + "title": "Creates or updates a scheduled router job.", + "operationId": "upsertJob", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "JobId", + "patch": { + "channelId": "CustomChatChannel", + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "queueId": "MainQueue", + "priority": 5, + "requestedWorkerSelectors": [ + { + "key": "Sales", + "labelOperator": "equal", + "value": true + } + ], + "labels": {}, + "matchingMode": { + "modeType": "scheduleAndSuspendMode", + "queueAndMatchMode": null, + "scheduleAndSuspendMode": { + "scheduleAt": "2023-05-26T23:22:12.0774222+00:00" + }, + "suspendMode": null + } + } + }, + "responses": { + "200": { + "body": { + "id": "JobId", + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "status": "queued", + "enqueuedAt": "2021-09-30T23:59:04.5311999+00:00", + "channelId": "CustomChatChannel", + "classificationPolicyId": null, + "queueId": "MainQueue", + "priority": 5, + "dispositionCode": null, + "requestedWorkerSelectors": [ + { + "key": "Sales", + "labelOperator": "equal", + "value": true, + "expiresAfterSeconds": null + } + ], + "attachedWorkerSelectors": [], + "labels": {}, + "assignments": {}, + "notes": {}, + "matchingMode": { + "modeType": "scheduleAndSuspendMode", + "queueAndMatchMode": null, + "scheduleAndSuspendMode": { + "scheduleAt": "2023-05-26T23:22:12.0774222+00:00" + }, + "suspendMode": null + }, + "scheduledAt": null + } + }, + "201": { + "body": { + "id": "JobId", + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "status": "queued", + "enqueuedAt": "2021-09-30T23:59:04.5311999+00:00", + "channelId": "CustomChatChannel", + "classificationPolicyId": null, + "queueId": "MainQueue", + "priority": 5, + "dispositionCode": null, + "requestedWorkerSelectors": [ + { + "key": "Sales", + "labelOperator": "equal", + "value": true, + "expiresAfterSeconds": null + } + ], + "attachedWorkerSelectors": [], + "labels": {}, + "assignments": {}, + "notes": {}, + "matchingMode": { + "modeType": "scheduleAndSuspendMode", + "queueAndMatchMode": null, + "scheduleAndSuspendMode": { + "scheduleAt": "2023-05-26T23:22:12.0774222+00:00" + }, + "suspendMode": null + }, + "scheduledAt": null + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/Jobs_DeleteJob.json b/specification/communication/JobRouter/examples/2023-11-01/Jobs_DeleteJob.json new file mode 100644 index 000000000000..10823014e574 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/Jobs_DeleteJob.json @@ -0,0 +1,12 @@ +{ + "title": "Deletes a job and all of its traces.", + "operationId": "deleteJob", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "8780b28c-7079-4de1-9143-4d369289e958" + }, + "responses": { + "204": {} + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/Jobs_GetInQueuePosition.json b/specification/communication/JobRouter/examples/2023-11-01/Jobs_GetInQueuePosition.json new file mode 100644 index 000000000000..7eea6f88f65c --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/Jobs_GetInQueuePosition.json @@ -0,0 +1,20 @@ +{ + "title": "Gets a job's position details.", + "operationId": "getInQueuePosition", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "8780b28c-7079-4de1-9143-4d369289e958" + }, + "responses": { + "200": { + "body": { + "jobId": "383541b3-5637-4af6-8aac-3391da8a578a", + "position": 1, + "queueId": "MainQueue", + "queueLength": 3, + "estimatedWaitTimeMinutes": 4 + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/Jobs_GetJob.json b/specification/communication/JobRouter/examples/2023-11-01/Jobs_GetJob.json new file mode 100644 index 000000000000..7a1710fff3c0 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/Jobs_GetJob.json @@ -0,0 +1,42 @@ +{ + "title": "Retrieves an existing job by Id.", + "operationId": "getJob", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "8780b28c-7079-4de1-9143-4d369289e958" + }, + "responses": { + "200": { + "body": { + "id": "8780b28c-7079-4de1-9143-4d369289e958", + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "status": "queued", + "enqueuedAt": "2021-09-30T23:59:04.5311999+00:00", + "channelId": "CustomVoiceChannel", + "classificationPolicyId": null, + "queueId": "MainQueue", + "priority": 5, + "dispositionCode": null, + "requestedWorkerSelectors": [ + { + "key": "Sales", + "labelOperator": "equal", + "value": true, + "expiresAfterSeconds": null + } + ], + "attachedWorkerSelectors": [], + "labels": {}, + "assignments": {}, + "notes": {}, + "matchingMode": { + "modeType": "queueAndMatchMode", + "queueAndMatchMode": {}, + "scheduleAndSuspendMode": null, + "suspendMode": null + } + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/Jobs_GetJobsWithPageSize.json b/specification/communication/JobRouter/examples/2023-11-01/Jobs_GetJobsWithPageSize.json new file mode 100644 index 000000000000..13e3dba7d2b6 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/Jobs_GetJobsWithPageSize.json @@ -0,0 +1,67 @@ +{ + "title": "Retrieves list of active jobs with page size", + "operationId": "listJobs", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "status": "active", + "queueId": null, + "channelId": null, + "maxpagesize": 2 + }, + "responses": { + "200": { + "body": { + "value": [ + { + "job": { + "id": "383541b3-5637-4af6-8aac-3391da8a578a", + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "status": "queued", + "enqueuedAt": "2021-09-30T23:56:21.883322+00:00", + "channelId": "CustomChatChannel", + "classificationPolicyId": null, + "queueId": "MainQueue", + "priority": 5, + "dispositionCode": null, + "labels": {}, + "assignments": {}, + "notes": {}, + "matchingMode": { + "modeType": "queueAndMatchMode", + "queueAndMatchMode": {}, + "scheduleAndSuspendMode": null, + "suspendMode": null + } + }, + "etag": "etag" + }, + { + "job": { + "id": "c571dd84-1ca7-4606-a77a-f38d9e4ae513", + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "status": "queued", + "enqueuedAt": "2021-09-30T23:57:54.041179+00:00", + "channelId": "CustomChatChannel2", + "classificationPolicyId": null, + "queueId": "MainQueue", + "priority": 5, + "dispositionCode": null, + "labels": {}, + "assignments": {}, + "notes": {}, + "matchingMode": { + "modeType": "queueAndMatchMode", + "queueAndMatchMode": {}, + "scheduleAndSuspendMode": null, + "suspendMode": null + } + }, + "etag": "etag" + } + ], + "nextLink": "null" + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/Jobs_ReclassifyJob.json b/specification/communication/JobRouter/examples/2023-11-01/Jobs_ReclassifyJob.json new file mode 100644 index 000000000000..7768c840a2e3 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/Jobs_ReclassifyJob.json @@ -0,0 +1,15 @@ +{ + "title": "Reclassify a job.", + "operationId": "reclassifyJobAction", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "8780b28c-7079-4de1-9143-4d369289e958", + "reclassifyJobRequest": {} + }, + "responses": { + "200": { + "body": {} + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/Jobs_RequestJobCancel.json b/specification/communication/JobRouter/examples/2023-11-01/Jobs_RequestJobCancel.json new file mode 100644 index 000000000000..5de5bea923dc --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/Jobs_RequestJobCancel.json @@ -0,0 +1,18 @@ +{ + "title": "Submits request to cancel an existing job by Id.", + "operationId": "cancelJobAction", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "8780b28c-7079-4de1-9143-4d369289e958", + "cancelJobRequest": { + "note": "User hung up while waiting in queue.", + "dispositionCode": "Disconnected" + } + }, + "responses": { + "200": { + "body": {} + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/Jobs_UnassignJob.json b/specification/communication/JobRouter/examples/2023-11-01/Jobs_UnassignJob.json new file mode 100644 index 000000000000..5e67be00a5df --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/Jobs_UnassignJob.json @@ -0,0 +1,21 @@ +{ + "title": "Un-assign a job.", + "operationId": "unassignJobAction", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "8780b28c-7079-4de1-9143-4d369289e958", + "assignmentId": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "unassignJobRequest": { + "suspendMatching": false + } + }, + "responses": { + "200": { + "body": { + "jobId": "8780b28c-7079-4de1-9143-4d369289e958", + "unassignmentCount": 1 + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/Jobs_UpdateJob.json b/specification/communication/JobRouter/examples/2023-11-01/Jobs_UpdateJob.json new file mode 100644 index 000000000000..b02b22dcd905 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/Jobs_UpdateJob.json @@ -0,0 +1,76 @@ +{ + "title": "Updates a router job.", + "operationId": "upsertJob", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "8780b28c-7079-4de1-9143-4d369289e958", + "patch": { + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af" + } + }, + "responses": { + "200": { + "body": { + "id": "383541b3-5637-4af6-8aac-3391da8a578a", + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "status": "queued", + "enqueuedAt": "2021-09-30T23:59:04.5311999+00:00", + "channelId": "CustomVoiceChannel", + "classificationPolicyId": null, + "queueId": "MainQueue", + "priority": 5, + "dispositionCode": null, + "requestedWorkerSelectors": [ + { + "key": "Sales", + "labelOperator": "equal", + "value": true, + "expiresAfterSeconds": null + } + ], + "attachedWorkerSelectors": [], + "labels": {}, + "assignments": {}, + "notes": {}, + "matchingMode": { + "modeType": "queueAndMatchMode", + "queueAndMatchMode": {}, + "scheduleAndSuspendMode": null, + "suspendMode": null + } + } + }, + "201": { + "body": { + "id": "383541b3-5637-4af6-8aac-3391da8a578a", + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "status": "queued", + "enqueuedAt": "2021-09-30T23:59:04.5311999+00:00", + "channelId": "CustomVoiceChannel", + "classificationPolicyId": null, + "queueId": "MainQueue", + "priority": 5, + "dispositionCode": null, + "requestedWorkerSelectors": [ + { + "key": "Sales", + "labelOperator": "equal", + "value": true, + "expiresAfterSeconds": null + } + ], + "attachedWorkerSelectors": [], + "labels": {}, + "assignments": {}, + "notes": {}, + "matchingMode": { + "modeType": "queueAndMatchMode", + "queueAndMatchMode": {}, + "scheduleAndSuspendMode": null, + "suspendMode": null + } + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/Offers_AcceptJobOffer.json b/specification/communication/JobRouter/examples/2023-11-01/Offers_AcceptJobOffer.json new file mode 100644 index 000000000000..042b312a9181 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/Offers_AcceptJobOffer.json @@ -0,0 +1,19 @@ +{ + "title": "Accepts an offer to work on a job.", + "operationId": "acceptJobAction", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "workerId": "DefaultWorker", + "offerId": "1d5896f3-8b54-40be-82d3-910323f5e2af" + }, + "responses": { + "200": { + "body": { + "assignmentId": "246d5a06-c04a-4b6b-8a34-02bbd9fdad68", + "jobId": "632f5345-220b-4e46-b31f-aeaf03cc2df9", + "workerId": "DefaultWorker" + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/Offers_DeclineJobOffer.json b/specification/communication/JobRouter/examples/2023-11-01/Offers_DeclineJobOffer.json new file mode 100644 index 000000000000..b20f5ab6bfb1 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/Offers_DeclineJobOffer.json @@ -0,0 +1,18 @@ +{ + "title": "Declines an offer to work on a job.", + "operationId": "declineJobAction", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "workerId": "DefaultWorker", + "offerId": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "declineJobOfferRequest": { + "retryOfferAt": "2023-05-26T00:00:00.0000000Z" + } + }, + "responses": { + "200": { + "body": {} + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/Queues_CreateQueue.json b/specification/communication/JobRouter/examples/2023-11-01/Queues_CreateQueue.json new file mode 100644 index 000000000000..27559ba5af6f --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/Queues_CreateQueue.json @@ -0,0 +1,35 @@ +{ + "title": "Creates or updates a queue.", + "operationId": "upsertQueue", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "QueueId", + "patch": { + "distributionPolicyId": "MainDistributionPolicy", + "name": "Main", + "labels": {}, + "exceptionPolicyId": "MainExceptionPolicy" + } + }, + "responses": { + "200": { + "body": { + "id": "246d5a06-c04a-4b6b-8a34-02bbd9fdad68", + "name": "Main", + "distributionPolicyId": "MainDistributionPolicy", + "labels": {}, + "exceptionPolicyId": "MainExceptionPolicy" + } + }, + "201": { + "body": { + "id": "246d5a06-c04a-4b6b-8a34-02bbd9fdad68", + "name": "Main", + "distributionPolicyId": "MainDistributionPolicy", + "labels": {}, + "exceptionPolicyId": "MainExceptionPolicy" + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/Queues_DeleteQueue.json b/specification/communication/JobRouter/examples/2023-11-01/Queues_DeleteQueue.json new file mode 100644 index 000000000000..6400dc7270a6 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/Queues_DeleteQueue.json @@ -0,0 +1,12 @@ +{ + "title": "Deletes a queue by Id.", + "operationId": "deleteQueue", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "MainQueue" + }, + "responses": { + "204": {} + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/Queues_GetQueue.json b/specification/communication/JobRouter/examples/2023-11-01/Queues_GetQueue.json new file mode 100644 index 000000000000..c5b5a85905e5 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/Queues_GetQueue.json @@ -0,0 +1,20 @@ +{ + "title": "Retrieves an existing queue by Id.", + "operationId": "getQueue", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "MainQueue" + }, + "responses": { + "200": { + "body": { + "id": "MainQueue", + "name": "Main", + "distributionPolicyId": "MainDistributionPolicy", + "labels": {}, + "exceptionPolicyId": "MainExceptionPolicy" + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/Queues_GetQueueStatistics.json b/specification/communication/JobRouter/examples/2023-11-01/Queues_GetQueueStatistics.json new file mode 100644 index 000000000000..bb47dc464d6c --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/Queues_GetQueueStatistics.json @@ -0,0 +1,17 @@ +{ + "title": "Retrieves a queue's statistics.", + "operationId": "getQueueStatistics", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "MainQueue" + }, + "responses": { + "200": { + "body": { + "queueId": "MainQueue", + "length": 5 + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/Queues_ListQueuesWithPageSize.json b/specification/communication/JobRouter/examples/2023-11-01/Queues_ListQueuesWithPageSize.json new file mode 100644 index 000000000000..9bc02b6005c2 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/Queues_ListQueuesWithPageSize.json @@ -0,0 +1,38 @@ +{ + "title": "Retrieves existing queues.", + "operationId": "listQueues", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "maxpagesize": 2 + }, + "responses": { + "200": { + "body": { + "value": [ + { + "queue": { + "id": "MainQueue", + "name": "Main", + "distributionPolicyId": "MainDistributionPolicy", + "labels": {}, + "exceptionPolicyId": "MainExceptionPolicy" + }, + "etag": "etag" + }, + { + "queue": { + "id": "SecondaryQueue", + "name": "Secondary", + "distributionPolicyId": "SecondaryDistributionPolicy", + "labels": {}, + "exceptionPolicyId": "SecondaryExceptionPolicy" + }, + "etag": "etag" + } + ], + "nextLink": "null" + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/Queues_UpdateQueue.json b/specification/communication/JobRouter/examples/2023-11-01/Queues_UpdateQueue.json new file mode 100644 index 000000000000..7219bb223977 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/Queues_UpdateQueue.json @@ -0,0 +1,33 @@ +{ + "title": "Updates a queue.", + "operationId": "upsertQueue", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "MainQueue", + "patch": { + "distributionPolicyId": "MainDistributionPolicy", + "name": "Main" + } + }, + "responses": { + "200": { + "body": { + "id": "MainQueue", + "name": "Main", + "distributionPolicyId": "MainDistributionPolicy", + "labels": {}, + "exceptionPolicyId": "MainExceptionPolicy" + } + }, + "201": { + "body": { + "id": "MainQueue", + "name": "Main", + "distributionPolicyId": "MainDistributionPolicy", + "labels": {}, + "exceptionPolicyId": "MainExceptionPolicy" + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/Workers_CreateWorker.json b/specification/communication/JobRouter/examples/2023-11-01/Workers_CreateWorker.json new file mode 100644 index 000000000000..514072f0e9fd --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/Workers_CreateWorker.json @@ -0,0 +1,83 @@ +{ + "title": "Creates or updates a worker.", + "operationId": "upsertWorker", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "workerId": "WorkerId", + "patch": { + "totalCapacity": 10, + "queueAssignments": { + "MainQueue": {}, + "SecondaryQueue": null + }, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 11, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 1 + } + }, + "availableForOffers": false + } + }, + "responses": { + "200": { + "body": { + "id": "WorkerId", + "state": "inactive", + "queueAssignments": { + "MainQueue": {} + }, + "totalCapacity": 10, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 11, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 1 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": false + } + }, + "201": { + "body": { + "id": "WorkerId", + "state": "inactive", + "queueAssignments": { + "MainQueue": {} + }, + "totalCapacity": 10, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 11, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 1 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": false + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/Workers_DeleteWorker.json b/specification/communication/JobRouter/examples/2023-11-01/Workers_DeleteWorker.json new file mode 100644 index 000000000000..6ac3ad6c1437 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/Workers_DeleteWorker.json @@ -0,0 +1,12 @@ +{ + "title": "Deletes a worker and all of its traces.", + "operationId": "deleteWorker", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "workerId": "DefaultWorker" + }, + "responses": { + "204": {} + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/Workers_DeregisterActiveWorker.json b/specification/communication/JobRouter/examples/2023-11-01/Workers_DeregisterActiveWorker.json new file mode 100644 index 000000000000..ccb09ae72395 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/Workers_DeregisterActiveWorker.json @@ -0,0 +1,67 @@ +{ + "title": "De-register an active worker", + "operationId": "upsertWorker", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "workerId": "WorkerId", + "patch": { + "availableForOffers": false, + "totalCapacity": 10 + } + }, + "responses": { + "200": { + "body": { + "id": "WorkerId", + "state": "draining", + "queueAssignments": { + "MainQueue": {} + }, + "totalCapacity": 10, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 11, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 1 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": false + } + }, + "201": { + "body": { + "id": "WorkerId", + "state": "draining", + "queueAssignments": { + "MainQueue": {} + }, + "totalCapacity": 10, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 11, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 1 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": false + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/Workers_DeregisterInactiveWorker.json b/specification/communication/JobRouter/examples/2023-11-01/Workers_DeregisterInactiveWorker.json new file mode 100644 index 000000000000..94390ad3ed88 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/Workers_DeregisterInactiveWorker.json @@ -0,0 +1,67 @@ +{ + "title": "De-register an inactive worker", + "operationId": "upsertWorker", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "workerId": "WorkerId", + "patch": { + "availableForOffers": false, + "totalCapacity": 10 + } + }, + "responses": { + "200": { + "body": { + "id": "WorkerId", + "state": "inactive", + "queueAssignments": { + "MainQueue": {} + }, + "totalCapacity": 10, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 11, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 1 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": false + } + }, + "201": { + "body": { + "id": "WorkerId", + "state": "inactive", + "queueAssignments": { + "MainQueue": {} + }, + "totalCapacity": 10, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 11, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 1 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": false + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json b/specification/communication/JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json new file mode 100644 index 000000000000..1481fd60af75 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json @@ -0,0 +1,76 @@ +{ + "title": "Retrieves available worker filtered by channel", + "operationId": "listWorkers", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "state": "active", + "channelId": "CustomChatChannel", + "hasCapacity": true + }, + "responses": { + "200": { + "body": { + "value": [ + { + "worker": { + "id": "DefaultWorker", + "state": "active", + "queueAssignments": { + "MainQueue": {}, + "SecondaryQueue": {} + }, + "totalCapacity": 100, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 100, + "maxNumberOfJobs": 1 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": true + }, + "etag": "etag" + }, + { + "worker": { + "id": "SecondWorker", + "state": "active", + "queueAssignments": { + "MainQueue": {}, + "SecondaryQueue": {} + }, + "totalCapacity": 100, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 100, + "maxNumberOfJobs": 1 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": true + }, + "etag": "etag" + } + ], + "nextLink": "null" + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/Workers_GetWorker.json b/specification/communication/JobRouter/examples/2023-11-01/Workers_GetWorker.json new file mode 100644 index 000000000000..1cb931459c89 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/Workers_GetWorker.json @@ -0,0 +1,38 @@ +{ + "title": "Retrieves an existing worker by Id.", + "operationId": "getWorker", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "workerId": "DefaultWorker" + }, + "responses": { + "200": { + "body": { + "id": "DefaultWorker", + "state": "active", + "queueAssignments": { + "MainQueue": {}, + "SecondaryQueue": {} + }, + "totalCapacity": 100, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 100, + "maxNumberOfJobs": 1 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": true + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json b/specification/communication/JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json new file mode 100644 index 000000000000..dd2898b663d1 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json @@ -0,0 +1,74 @@ +{ + "title": "Retrieves list of workers with page size", + "operationId": "listWorkers", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "maxpagesize": 2 + }, + "responses": { + "200": { + "body": { + "value": [ + { + "worker": { + "id": "DefaultWorker", + "state": "active", + "queueAssignments": { + "MainQueue": {}, + "SecondaryQueue": {} + }, + "totalCapacity": 100, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 100, + "maxNumberOfJobs": 1 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": true + }, + "etag": "etag" + }, + { + "worker": { + "id": "SecondWorker", + "state": "active", + "queueAssignments": { + "MainQueue": {}, + "SecondaryQueue": {} + }, + "totalCapacity": 100, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomEmailChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 4 + }, + "CustomSMSChannel": { + "capacityCostPerJob": 100, + "maxNumberOfJobs": 1 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": true + }, + "etag": "etag" + } + ], + "nextLink": "null" + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/Workers_RegisterWorker.json b/specification/communication/JobRouter/examples/2023-11-01/Workers_RegisterWorker.json new file mode 100644 index 000000000000..29444a6b3dcb --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/Workers_RegisterWorker.json @@ -0,0 +1,67 @@ +{ + "title": "Register a worker", + "operationId": "upsertWorker", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "workerId": "WorkerId", + "patch": { + "availableForOffers": true, + "totalCapacity": 10 + } + }, + "responses": { + "200": { + "body": { + "id": "WorkerId", + "state": "active", + "queueAssignments": { + "MainQueue": {} + }, + "totalCapacity": 10, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 11, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 1 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": true + } + }, + "201": { + "body": { + "id": "WorkerId", + "state": "active", + "queueAssignments": { + "MainQueue": {} + }, + "totalCapacity": 10, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 11, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 1 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": true + } + } + } +} diff --git a/specification/communication/JobRouter/examples/2023-11-01/Workers_UpdateWorker.json b/specification/communication/JobRouter/examples/2023-11-01/Workers_UpdateWorker.json new file mode 100644 index 000000000000..90843008c715 --- /dev/null +++ b/specification/communication/JobRouter/examples/2023-11-01/Workers_UpdateWorker.json @@ -0,0 +1,83 @@ +{ + "title": "Updates a worker", + "operationId": "upsertWorker", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "workerId": "WorkerId", + "patch": { + "totalCapacity": 10, + "queueAssignments": { + "MainQueue": {}, + "SecondaryQueue": null + }, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 11, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 1 + } + }, + "availableForOffers": false + } + }, + "responses": { + "200": { + "body": { + "id": "WorkerId", + "state": "inactive", + "queueAssignments": { + "MainQueue": {} + }, + "totalCapacity": 10, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 11, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 1 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": false + } + }, + "201": { + "body": { + "id": "WorkerId", + "state": "inactive", + "queueAssignments": { + "MainQueue": {} + }, + "totalCapacity": 10, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 11, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 1 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": false + } + } + } +} diff --git a/specification/communication/JobRouter/main.tsp b/specification/communication/JobRouter/main.tsp new file mode 100644 index 000000000000..a0cb2b022677 --- /dev/null +++ b/specification/communication/JobRouter/main.tsp @@ -0,0 +1,22 @@ +import "@typespec/rest"; +import "@typespec/http"; +import "@typespec/versioning"; +import "./routes.tsp"; + +using TypeSpec.Rest; +using TypeSpec.Http; +using TypeSpec.Versioning; + +@service({ + title: "Azure Communication Routing Service", +}) +@server( + "{endpoint}", + "Azure Communication Routing Service", + { + endpoint: string, + } +) +@versioned(Versions) +@doc("Azure Communication Routing Service") +namespace AzureCommunicationRoutingService; diff --git a/specification/communication/JobRouter/models.tsp b/specification/communication/JobRouter/models.tsp new file mode 100644 index 000000000000..848646be9e7f --- /dev/null +++ b/specification/communication/JobRouter/models.tsp @@ -0,0 +1,1373 @@ +import "@typespec/http"; +import "@typespec/rest"; +import "@typespec/versioning"; +import "@azure-tools/typespec-autorest"; +import "@azure-tools/typespec-azure-core"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Azure.Core; +using Azure.Core.Traits; + +@versioned(AzureCommunicationRoutingService.Versions) +namespace AzureCommunicationRoutingService; + +@doc("The status of the Job.") +enum RouterJobStatus { + @doc("Job is waiting to be classified.") + pendingClassification, + + @doc("Job has been queued.") + queued, + + @doc("Job has been assigned to a worker.") + assigned, + + @doc("Job has been completed by a worker.") + completed, + + @doc("Job has been closed by a worker.") + closed, + + @doc("Job has been cancelled.") + cancelled, + + @doc("Classification process failed for the job.") + classificationFailed, + + @doc("Job has been created.") + created, + + @doc("Job has been created but not been scheduled yet.") + pendingSchedule, + + @doc("Job has been scheduled successfully.") + scheduled, + + @doc("Job scheduling failed.") + scheduleFailed, + + @doc("Job is in a suspended state and waiting for an update.") + waitingForActivation, +} + +@doc("Describes supported operations on label values.") +enum LabelOperator { + @doc("Equal") + equal, + + @doc("Not Equal") + notEqual, + + @doc("Less than") + lessThan, + + @doc("Less than or equal") + lessThanEqual, + + @doc("Greater than") + greaterThan, + + @doc("Greater than or equal") + greaterThanEqual, +} + +@doc("The status of the worker selector.") +enum RouterWorkerSelectorStatus { + @doc("Active") + active, + + @doc("Expired") + expired, +} + +@doc("Discriminator values for supported matching mode types.") +enum JobMatchModeType { + @doc("Discriminator used when matching worker to a job is required to be done right after job is queued.") + queueAndMatchMode, + + @doc("Discriminator used for scheduling jobs to be queued at a future time.") + scheduleAndSuspendMode, + + @doc("Discriminator used when matching workers to a job needs to be suspended.") + suspendMode, +} + +@doc("Enums used to filters jobs by state") +enum RouterJobStatusSelector { + @doc("Default") + all, + + @doc("Job is waiting to be classified.") + pendingClassification, + + @doc("Job has been queued.") + queued, + + @doc("Job has been assigned to a worker.") + assigned, + + @doc("Job has been completed by a worker.") + completed, + + @doc("Job has been closed by a worker.") + closed, + + @doc("Job has been cancelled.") + cancelled, + + @doc("Classification process failed for the job.") + classificationFailed, + + @doc("Job has been created.") + created, + + @doc("Job has been created but not been scheduled yet.") + pendingSchedule, + + @doc("Job has been scheduled successfully.") + scheduled, + + @doc("Job scheduling failed.") + scheduleFailed, + + @doc("Job is in a suspended state and waiting for an update.") + waitingForActivation, + + @doc("Job is in a state of PendingClassification or Queued or Assigned or ClassificationFailed or Completed or PendingSchedule or Scheduled or ScheduleFailed or WaitingForActivation.") + active, +} + +@doc("Enums for worker status") +enum RouterWorkerState { + @doc("Worker is active and available to take offers.") + active, + + @doc("Worker is not active, if there are existing offers they are being revoked. No new offers are sent.") + draining, + + @doc("Worker is not active. No new offers are sent.") + inactive, +} + +@doc("Enums used to filters workers by state") +enum RouterWorkerStateSelector { + @doc("Worker is active and available to take offers.") + active, + + @doc("Worker is not active, if there are existing offers they are being revoked. No new offers are sent.") + draining, + + @doc("Worker is not active. No new offers are sent.") + inactive, + + @doc("Worker is active or draining or inactive.") + all, +} + +@doc("Supported parameters for scoring workers") +enum ScoringRuleParameterSelector { + @doc("Parameter to add job labels to scoring payload. Property is sent as `job`.") + jobLabels, + + @doc("Parameter to add worker selectors from the job to scoring payload. Property is sent as `selectors`.") + workerSelectors, +} + +@doc("The available expression languages that can be configured") +enum ExpressionRouterRuleLanguage { + @doc("PowerFx") + powerFx, +} + +@doc("A container for the rules that govern how jobs are classified.") +model ClassificationPolicy { + @doc("Unique identifier of this policy.") + @visibility("read") + id?: string; + + @doc("Friendly name of this policy.") + name?: string; + + @doc("The fallback queue to select if the queue selector doesn't find a match.") + fallbackQueueId?: string; + + @doc("The queue selectors to resolve a queue for a given job.") + queueSelectors?: QueueSelectorAttachment[]; + + @doc(""" +A rule of one of the following types: + +StaticRule: A rule +providing static rules that always return the same result, regardless of +input. +DirectMapRule: A rule that return the same labels as the input +labels. +ExpressionRule: A rule providing inline expression +rules. +AzureFunctionRule: A rule providing a binding to an HTTP Triggered Azure +Function. +WebhookRule: A rule providing a binding to a webserver following +OAuth2.0 authentication protocol. +""") + prioritizationRule?: RouterRule; + + @doc("The worker label selectors to attach to a given job.") + workerSelectors?: WorkerSelectorAttachment[]; +} + +@doc(""" +A rule of one of the following types: + +StaticRule: A rule +providing static rules that always return the same result, regardless of +input. +DirectMapRule: A rule that return the same labels as the input +labels. +ExpressionRule: A rule providing inline expression +rules. +AzureFunctionRule: A rule providing a binding to an HTTP Triggered Azure +Function. +WebhookRule: A rule providing a binding to a webserver following +OAuth2.0 authentication protocol. +""") +@discriminator("kind") +model RouterRule {} + +@doc("The Communication Services error.") +@error +model CommunicationErrorResponse { + @doc("The Communication Services error.") + error: CommunicationError; +} + +@doc("The Communication Services error.") +model CommunicationError { + @doc("The error code.") + code: string; + + @doc("The error message.") + message: string; + + @doc("The error target.") + @visibility("read") + target?: string; + + @doc("Further details about specific errors that led to this error.") + @visibility("read") + details?: CommunicationError[]; + + @doc("The inner error if any.") + @visibility("read") + @projectedName("json", "innererror") + innerError?: CommunicationError; +} + +@doc("A paged collection of classification policies.") +model ClassificationPolicyCollection + is Azure.Core.Page; + +@doc("Paged instance of ClassificationPolicy") +model ClassificationPolicyItem { + @doc("A container for the rules that govern how jobs are classified.") + classificationPolicy?: ClassificationPolicy; + + @doc("(Optional) The Concurrency Token.") + etag?: string; +} + +@doc("Policy governing how jobs are distributed to workers") +model DistributionPolicy { + @doc("The unique identifier of the policy.") + @visibility("read") + id?: string; + + @doc("The human readable name of the policy.") + name?: string; + + @doc(""" +The number of seconds after which any offers created under this policy will be +expired. +""") + offerExpiresAfterSeconds?: float32; + + @doc("Abstract base class for defining a distribution mode") + mode?: DistributionMode; +} + +@doc("Abstract base class for defining a distribution mode") +@discriminator("kind") +model DistributionMode { + @doc("Governs the minimum desired number of active concurrent offers a job can have.") + minConcurrentOffers?: int32; + + @doc("Governs the maximum number of active concurrent offers a job can have.") + maxConcurrentOffers?: int32; + + @doc(""" +(Optional) +If set to true, then router will match workers to jobs even if they +don't match label selectors. +Warning: You may get workers that are not +qualified for the job they are matched with if you set this +variable to true. +This flag is intended more for temporary usage. +By default, set to false. +""") + bypassSelectors?: boolean; +} + +@doc("A paged collection of distribution policies.") +model DistributionPolicyCollection is Azure.Core.Page; + +@doc("Paged instance of DistributionPolicy") +model DistributionPolicyItem { + @doc("Policy governing how jobs are distributed to workers") + distributionPolicy?: DistributionPolicy; + + @doc("(Optional) The Concurrency Token.") + etag?: string; +} + +@doc("A policy that defines actions to execute when exception are triggered.") +model ExceptionPolicy { + @doc("The Id of the exception policy") + @visibility("read") + id?: string; + + @doc("(Optional) The name of the exception policy.") + name?: string; + + @doc(""" +(Optional) A dictionary collection of exception rules on the exception policy. +Key is the Id of each exception rule. +""") + exceptionRules?: Record; +} + +@doc("A rule that defines actions to execute upon a specific trigger.") +model ExceptionRule { + @doc("The trigger for this exception rule") + trigger: ExceptionTrigger; + + @doc(""" +A dictionary collection of actions to perform once the exception is triggered. +Key is the Id of each exception action. +""") + actions: Record; +} + +@doc("The trigger for this exception rule") +@discriminator("kind") +model ExceptionTrigger {} + +@doc("A paged collection of exception policies.") +model ExceptionPolicyCollection is Azure.Core.Page; + +@doc("Paged instance of ExceptionPolicy") +model ExceptionPolicyItem { + @doc("A policy that defines actions to execute when exception are triggered.") + exceptionPolicy?: ExceptionPolicy; + + @doc("(Optional) The Concurrency Token.") + etag?: string; +} + +@doc("A unit of work to be routed") +model RouterJob { + @doc("The id of the job.") + @visibility("read") + id?: string; + + @doc("Reference to an external parent context, eg. call ID.") + channelReference?: string; + + @doc("The status of the Job.") + @visibility("read") + status?: RouterJobStatus; + + @doc("The time a job was queued in UTC.") + @visibility("read") + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + enqueuedAt?: utcDateTime; + + @doc("The channel identifier. eg. voice, chat, etc.") + channelId?: string; + + @doc("The Id of the Classification policy used for classifying a job.") + classificationPolicyId?: string; + + @doc("The Id of the Queue that this job is queued to.") + queueId?: string; + + @doc("The priority of this job.") + priority?: int32; + + @doc("Reason code for cancelled or closed jobs.") + dispositionCode?: string; + + @doc(""" +A collection of manually specified label selectors, which a worker must satisfy +in order to process this job. +""") + requestedWorkerSelectors?: RouterWorkerSelector[]; + + @doc(""" +A collection of label selectors attached by a classification policy, which a +worker must satisfy in order to process this job. +""") + @visibility("read") + attachedWorkerSelectors?: RouterWorkerSelector[]; + + @doc(""" +A set of key/value pairs that are identifying attributes used by the rules +engines to make decisions. +""") + labels?: Record; + + @doc(""" +A collection of the assignments of the job. +Key is AssignmentId. +""") + @visibility("read") + assignments?: Record; + + @doc("A set of non-identifying attributes attached to this job") + tags?: Record; + + @doc("Notes attached to a job, sorted by timestamp") + notes?: Record; + + @doc("If set, job will be scheduled to be enqueued at a given time") + @visibility("read") + scheduledAt?: utcDateTime; + + @doc(""" +The matching mode to be applied to this job. + +Supported types: + + +QueueAndMatchMode: Used when matching worker to a job is required to be +done right after job is queued. +ScheduleAndSuspendMode: Used for scheduling +jobs to be queued at a future time. At specified time, matching of a worker to +the job will not start automatically. +SuspendMode: Used when matching workers +to a job needs to be suspended. +""") + matchingMode?: JobMatchingMode; +} + +@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") + key: string; + + @doc(""" +Describes how the value of the label is compared to the value defined on the +label selector +""") + labelOperator: LabelOperator; + + @doc("The value to compare against the actual label value with the given operator") + value?: unknown; + + @doc("Describes how long this label selector is valid in seconds.") + expiresAfterSeconds?: float32; + + @doc("Pushes the job to the front of the queue as long as this selector is active.") + expedite?: boolean; + + @doc("The status of the worker selector.") + @visibility("read") + status?: RouterWorkerSelectorStatus; + + @doc("The time at which this worker selector expires in UTC") + @visibility("read") + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + expiresAt?: utcDateTime; +} + +@doc("Assignment details of a job to a worker") +model RouterJobAssignment { + @doc("The Id of the job assignment.") + assignmentId: string; + + @doc("The Id of the Worker assigned to the job.") + workerId?: string; + + @doc("The assignment time of the job in UTC.") + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + assignedAt: utcDateTime; + + @doc("The time the job was marked as completed after being assigned in UTC.") + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + completedAt?: utcDateTime; + + @doc("The time the job was marked as closed after being completed in UTC.") + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + closedAt?: utcDateTime; +} + +@doc(""" +The matching mode to be applied to this job. + +Supported types: + + +QueueAndMatchMode: Used when matching worker to a job is required to be +done right after job is queued. +ScheduleAndSuspendMode: Used for scheduling +jobs to be queued at a future time. At specified time, matching of a worker to +the job will not start automatically. +SuspendMode: Used when matching workers +to a job needs to be suspended. +""") +model JobMatchingMode { + @doc("Discriminator value used to differentiate between supported matching mode types.") + modeType?: JobMatchModeType; + + @doc(""" +Describes a matching mode where matching worker to a job is automatically +started after job is queued successfully. +""") + queueAndMatchMode?: {}; + + @doc(""" +Describes a matching mode used for scheduling jobs to be queued at a future +time. +At the specified time, matching worker to a job will not start +automatically. +""") + scheduleAndSuspendMode?: ScheduleAndSuspendMode; + + @doc("Describes a matching mode where matching worker to a job is suspended.") + suspendMode?: {}; +} + +@doc(""" +Describes a matching mode used for scheduling jobs to be queued at a future +time. +At the specified time, matching worker to a job will not start +automatically. +""") +model ScheduleAndSuspendMode { + @doc("Scheduled time.") + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + scheduleAt?: utcDateTime; +} + +@doc("Request payload for deleting a job") +model CancelJobRequest { + @doc(""" +(Optional) A note that will be appended to the jobs' Notes collection with the +current timestamp. +""") + note?: string; + + @doc(""" +Indicates the outcome of the job, populate this field with your own custom +values. +If not provided, default value of \"Cancelled\" is set. +""") + dispositionCode?: string; +} + +@doc("Request payload for completing jobs") +model CompleteJobRequest { + @doc("The assignment within the job to complete.") + assignmentId: string; + + @doc(""" +(Optional) A note that will be appended to the jobs' Notes collection with the +current timestamp. +""") + note?: string; +} + +@doc("Request payload for closing jobs") +model CloseJobRequest { + @doc("The assignment within which the job is to be closed.") + assignmentId: string; + + @doc(""" +Indicates the outcome of the job, populate this field with your own custom +values. +""") + dispositionCode?: string; + + @doc(""" +If not provided, worker capacity is released immediately along with a +JobClosedEvent notification. +If provided, worker capacity is released along +with a JobClosedEvent notification at a future time in UTC. +""") + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + closeAt?: utcDateTime; + + @doc(""" +(Optional) A note that will be appended to the jobs' Notes collection with the +current timestamp. +""") + note?: string; +} + +@doc("A paged collection of jobs.") +model RouterJobCollection is Azure.Core.Page; + +@doc("Paged instance of RouterJob") +model RouterJobItem { + @doc("A unit of work to be routed") + job?: RouterJob; + + @doc("(Optional) The Concurrency Token.") + etag?: string; +} + +@doc("Position and estimated wait time for a job.") +model RouterJobPositionDetails { + @doc("Id of the job these details are about.") + jobId: string; + + @doc("Position of the job in question within that queue.") + position: int32; + + @doc("Id of the queue this job is enqueued in.") + queueId: string; + + @doc("Length of the queue: total number of enqueued jobs.") + queueLength: int32; + + @doc("Estimated wait time of the job rounded up to the nearest minute") + estimatedWaitTimeMinutes: float32; +} + +@doc("Request payload for unassigning a job.") +model UnassignJobRequest { + @doc(""" +If SuspendMatching is true, then the job is not queued for re-matching with a +worker. +""") + suspendMatching?: boolean; +} + +@doc("Response payload after a job has been successfully unassigned.") +model UnassignJobResult { + @doc("The Id of the job unassigned.") + jobId: string; + + @doc("The number of times a job is unassigned. At a maximum 3.") + unassignmentCount: int32; +} + +@doc(""" +Response containing Id's for the worker, job, and assignment from an accepted +offer +""") +model AcceptJobOfferResult { + @doc("The assignment Id that assigns a worker that has accepted an offer to a job.") + assignmentId: string; + + @doc("The Id of the job assigned.") + jobId: string; + + @doc("The Id of the worker that has been assigned this job.") + workerId: string; +} + +@doc("Request payload for declining offers") +model DeclineJobOfferRequest { + @doc(""" +If the RetryOfferAt is not provided, then this job will not be offered again to +the worker who declined this job unless +the worker is de-registered and +re-registered. If a RetryOfferAt time 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. +""") + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + retryOfferAt?: utcDateTime; +} + +@doc("A queue that can contain jobs to be routed.") +model RouterQueue { + @doc("The Id of this queue") + @visibility("read") + id?: string; + + @doc("The name of this queue.") + name?: string; + + @doc(""" +The ID of the distribution policy that will determine how a job is distributed +to workers. +""") + distributionPolicyId?: string; + + @doc(""" +A set of key/value pairs that are identifying attributes used by the rules +engines to make decisions. +""") + labels?: Record; + + @doc(""" +(Optional) The ID of the exception policy that determines various job +escalation rules. +""") + exceptionPolicyId?: string; +} + +@doc("A paged collection of queues.") +model RouterQueueCollection is Azure.Core.Page; + +@doc("Paged instance of RouterQueue") +model RouterQueueItem { + @doc("A queue that can contain jobs to be routed.") + queue?: RouterQueue; + + @doc("(Optional) The Concurrency Token.") + etag?: string; +} + +@doc("Statistics for the queue") +model RouterQueueStatistics { + @doc("Id of the queue these details are about.") + queueId: string; + + @doc("Length of the queue: total number of enqueued jobs.") + length: int32; + + @doc(""" +The estimated wait time of this queue rounded up to the nearest minute, grouped +by job priority +""") + estimatedWaitTimeMinutes?: Record; + + @doc("The wait time of the job that has been enqueued in this queue for the longest.") + longestJobWaitTimeMinutes?: float32; +} + +@doc("An entity for jobs to be routed to") +model RouterWorker { + @doc("Id of the worker.") + @visibility("read") + id?: string; + + @doc("The current state of the worker.") + @visibility("read") + state?: RouterWorkerState; + + @doc("The queue(s) that this worker can receive work from.") + queueAssignments?: Record; + + @doc("The total capacity score this worker has to manage multiple concurrent jobs.") + totalCapacity?: int32; + + @doc(""" +A set of key/value pairs that are identifying attributes used by the rules +engines to make decisions. +""") + labels?: Record; + + @doc("A set of non-identifying attributes attached to this worker.") + tags?: Record; + + @doc("The channel(s) this worker can handle and their impact on the workers capacity.") + channelConfigurations?: Record; + + @doc("A list of active offers issued to this worker.") + @visibility("read") + offers?: RouterJobOffer[]; + + @doc("A list of assigned jobs attached to this worker.") + @visibility("read") + assignedJobs?: RouterWorkerAssignment[]; + + @doc(""" +A value indicating the workers capacity. A value of '1' means all capacity is +consumed. A value of '0' means no capacity is currently consumed. +""") + @visibility("read") + loadRatio?: float32; + + @doc("A flag indicating this worker is open to receive offers or not.") + availableForOffers?: boolean; +} + +@doc("Represents the capacity a job in this channel will consume from a worker") +model ChannelConfiguration { + @doc(""" +The amount of capacity that an instance of a job of this channel will consume +of the total worker capacity. +""") + capacityCostPerJob: int32; + + @doc("The maximum number of jobs that can be supported concurrently for this channel.") + maxNumberOfJobs?: int32; +} + +@doc("An offer of a job to a worker") +model RouterJobOffer { + @doc("The Id of the offer.") + offerId: string; + + @doc("The Id of the job.") + jobId: string; + + @doc("The capacity cost consumed by the job offer.") + capacityCost: int32; + + @doc("The time the offer was created in UTC.") + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + offeredAt?: utcDateTime; + + @doc("The time that the offer will expire in UTC.") + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + expiresAt?: utcDateTime; +} + +@doc("The assignment for a worker to a job") +model RouterWorkerAssignment { + @doc("The Id of the assignment.") + assignmentId: string; + + @doc("The Id of the Job assigned.") + jobId: string; + + @doc("The amount of capacity this assignment has consumed on the worker.") + capacityCost: int32; + + @doc("The assignment time of the job in UTC.") + // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + assignedAt: utcDateTime; +} + +@doc("A paged collection of workers.") +model RouterWorkerCollection is Azure.Core.Page; + +@doc("Paged instance of RouterWorker") +model RouterWorkerItem { + @doc("An entity for jobs to be routed to") + worker?: RouterWorker; + + @doc("(Optional) The Concurrency Token.") + etag?: string; +} + +@doc("Jobs are distributed to the worker with the strongest abilities available.") +model BestWorkerMode extends DistributionMode { + @doc(""" +A rule of one of the following types: + +StaticRule: A rule +providing static rules that always return the same result, regardless of +input. +DirectMapRule: A rule that return the same labels as the input +labels. +ExpressionRule: A rule providing inline expression +rules. +AzureFunctionRule: A rule providing a binding to an HTTP Triggered Azure +Function. +WebhookRule: A rule providing a binding to a webserver following +OAuth2.0 authentication protocol. +""") + scoringRule?: RouterRule; + + @doc(""" +Encapsulates all options that can be passed as parameters for scoring rule with +BestWorkerMode +""") + scoringRuleOptions?: ScoringRuleOptions; + + @doc("The type discriminator describing a sub-type of Mode") + kind: "best-worker"; +} + +@doc(""" +Encapsulates all options that can be passed as parameters for scoring rule with +BestWorkerMode +""") +model ScoringRuleOptions { + @doc(""" +(Optional) Set batch size when AllowScoringBatchOfWorkers is set to true. +Defaults to 20 if not configured. +""") + batchSize?: int32; + + @doc(""" +(Optional) List of extra parameters from the job that will be sent as part of +the payload to scoring rule. +If not set, the job's labels (sent in the payload +as `job`) and the job's worker selectors (sent in the payload as +`selectors`) +are added to the payload of the scoring rule by default. +Note: +Worker labels are always sent with scoring payload. +""") + scoringParameters?: ScoringRuleParameterSelector[]; + + @doc(""" +(Optional) +If set to true, will score workers in batches, and the parameter +name of the worker labels will be sent as `workers`. +By default, set to false +and the parameter name for the worker labels will be sent as `worker`. +Note: If +enabled, use BatchSize to set batch size. +""") + allowScoringBatchOfWorkers?: boolean; + + @doc(""" +(Optional) +If false, will sort scores by ascending order. By default, set to +true. +""") + descendingOrder?: boolean; +} + +@doc("An action that marks a job as cancelled") +model CancelExceptionAction extends ExceptionAction { + @doc(""" +(Optional) A note that will be appended to the jobs' Notes collection with the +current timestamp. +""") + note?: string; + + @doc(""" +(Optional) Indicates the outcome of the job, populate this field with your own +custom values. +""") + dispositionCode?: string; + + @doc("The type discriminator describing a sub-type of ExceptionAction") + kind: "cancel"; +} + +@doc("The action to take when the exception is triggered") +@discriminator("kind") +model ExceptionAction {} + +@doc(""" +Describes a set of queue selectors that will be attached if the given condition +resolves to true +""") +model ConditionalQueueSelectorAttachment extends QueueSelectorAttachment { + @doc(""" +A rule of one of the following types: + +StaticRule: A rule +providing static rules that always return the same result, regardless of +input. +DirectMapRule: A rule that return the same labels as the input +labels. +ExpressionRule: A rule providing inline expression +rules. +AzureFunctionRule: A rule providing a binding to an HTTP Triggered Azure +Function. +WebhookRule: A rule providing a binding to a webserver following +OAuth2.0 authentication protocol. +""") + condition: RouterRule; + + @doc("The queue selectors to attach") + queueSelectors: RouterQueueSelector[]; + + @doc("The type discriminator describing the type of queue selector attachment") + kind: "conditional"; +} + +@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") + key: string; + + @doc(""" +Describes how the value of the label is compared to the value defined on the +label selector +""") + labelOperator: LabelOperator; + + @doc("The value to compare against the actual label value with the given operator") + value?: unknown; +} + +@doc(""" +An attachment of queue selectors to resolve a queue to a job from a +classification policy +""") +@discriminator("kind") +model QueueSelectorAttachment {} + +@doc(""" +Describes a set of worker selectors that will be attached if the given +condition resolves to true +""") +model ConditionalWorkerSelectorAttachment extends WorkerSelectorAttachment { + @doc(""" +A rule of one of the following types: + +StaticRule: A rule +providing static rules that always return the same result, regardless of +input. +DirectMapRule: A rule that return the same labels as the input +labels. +ExpressionRule: A rule providing inline expression +rules. +AzureFunctionRule: A rule providing a binding to an HTTP Triggered Azure +Function. +WebhookRule: A rule providing a binding to a webserver following +OAuth2.0 authentication protocol. +""") + condition: RouterRule; + + @doc("The worker selectors to attach") + workerSelectors: RouterWorkerSelector[]; + + @doc("The type discriminator describing the type of worker selector attachment") + kind: "conditional"; +} + +@doc("An attachment which attaches worker selectors to a job") +@discriminator("kind") +model WorkerSelectorAttachment {} + +@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: "direct-map-rule"; +} + +@doc("A rule providing inline expression rules.") +model ExpressionRouterRule extends RouterRule { + @doc("The expression language to compile to and execute") + language?: ExpressionRouterRuleLanguage; + + @doc(""" +The string containing the expression to evaluate. Should contain return +statement with calculated values. +""") + expression: string; + + @doc("The type discriminator describing a sub-type of Rule") + kind: "expression-rule"; +} + +@doc("A rule providing a binding to an HTTP Triggered Azure Function.") +model FunctionRouterRule extends RouterRule { + @doc("URL for Azure Function") + functionUri: string; + + @doc("Credentials used to access Azure function rule") + credential?: FunctionRouterRuleCredential; + + @doc("The type discriminator describing a sub-type of Rule") + kind: "azure-function-rule"; +} + +@doc("Credentials used to access Azure function rule") +model FunctionRouterRuleCredential { + @doc("(Optional) Access key scoped to a particular function") + functionKey?: string; + + @doc(""" +(Optional) Access key scoped to a Azure Function app. +This key grants access to +all functions under the app. +""") + appKey?: string; + + @doc(""" +(Optional) Client id, when AppKey is provided +In context of Azure function, +this is usually the name of the key +""") + clientId?: string; +} + +@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: "longest-idle"; +} + +@doc(""" +An action that manually reclassifies a job by providing the queue, priority and +worker selectors. +""") +model ManualReclassifyExceptionAction extends ExceptionAction { + @doc("Updated QueueId.") + queueId?: string; + + @doc("Updated Priority.") + priority?: int32; + + @doc("Updated WorkerSelectors.") + workerSelectors?: RouterWorkerSelector[]; + + @doc("The type discriminator describing a sub-type of ExceptionAction") + kind: "manual-reclassify"; +} + +@doc(""" +OAuth2.0 Credentials used to Contoso's Authorization server. +Reference: +https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/ +""") +model Oauth2ClientCredential { + @doc("ClientId for Contoso Authorization server.") + clientId?: string; + + @doc("Client secret for Contoso Authorization server.") + clientSecret?: string; +} + +@doc(""" +Attaches a queue selector where the value is passed through from the job label +with the same key +""") +model PassThroughQueueSelectorAttachment extends QueueSelectorAttachment { + @doc("The label key to query against") + key: string; + + @doc("Describes how the value of the label is compared to the value pass through") + labelOperator: LabelOperator; + + @doc("The type discriminator describing the type of queue selector attachment") + kind: "pass-through"; +} + +@doc(""" +Attaches a worker selector where the value is passed through from the job label +with the same key +""") +model PassThroughWorkerSelectorAttachment extends WorkerSelectorAttachment { + @doc("The label key to query against") + key: string; + + @doc("Describes how the value of the label is compared to the value pass through") + labelOperator: LabelOperator; + + @doc("Describes how long the attached label selector is valid in seconds.") + expiresAfterSeconds?: float32; + + @doc("The type discriminator describing the type of worker selector attachment") + kind: "pass-through"; +} + +@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.") + threshold: int32; + + @doc("The type discriminator describing a sub-type of ExceptionTrigger") + kind: "queue-length"; +} + +@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.") + weight: float32; + + @doc(""" +A collection of queue selectors that will be applied if this allocation is +selected. +""") + queueSelectors: RouterQueueSelector[]; +} + +@doc("An action that modifies labels on a job and then reclassifies it") +model ReclassifyExceptionAction extends ExceptionAction { + @doc(""" +(optional) The new classification policy that will determine queue, priority +and worker selectors. +""") + classificationPolicyId?: string; + + @doc(""" +(optional) Dictionary containing the labels to update (or add if not existing) +in key-value pairs +""") + labelsToUpsert?: Record; + + @doc("The type discriminator describing a sub-type of ExceptionAction") + kind: "reclassify"; +} + +@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: "round-robin"; +} + +@doc("Attaches queue selectors to a job when the RouterRule is resolved") +model RuleEngineQueueSelectorAttachment extends QueueSelectorAttachment { + @doc(""" +A rule of one of the following types: + +StaticRule: A rule +providing static rules that always return the same result, regardless of +input. +DirectMapRule: A rule that return the same labels as the input +labels. +ExpressionRule: A rule providing inline expression +rules. +AzureFunctionRule: A rule providing a binding to an HTTP Triggered Azure +Function. +WebhookRule: A rule providing a binding to a webserver following +OAuth2.0 authentication protocol. +""") + rule: RouterRule; + + @doc("The type discriminator describing the type of queue selector attachment") + kind: "rule-engine"; +} + +@doc("Attaches worker selectors to a job when a RouterRule is resolved") +model RuleEngineWorkerSelectorAttachment extends WorkerSelectorAttachment { + @doc(""" +A rule of one of the following types: + +StaticRule: A rule +providing static rules that always return the same result, regardless of +input. +DirectMapRule: A rule that return the same labels as the input +labels. +ExpressionRule: A rule providing inline expression +rules. +AzureFunctionRule: A rule providing a binding to an HTTP Triggered Azure +Function. +WebhookRule: A rule providing a binding to a webserver following +OAuth2.0 authentication protocol. +""") + rule: RouterRule; + + @doc("The type discriminator describing the type of worker selector attachment") + kind: "rule-engine"; +} + +@doc("Describes a queue selector that will be attached to the job") +model StaticQueueSelectorAttachment extends QueueSelectorAttachment { + @doc(""" +Describes a condition that must be met against a set of labels for queue +selection +""") + queueSelector: RouterQueueSelector; + + @doc("The type discriminator describing the type of queue selector attachment") + kind: "static"; +} + +@doc(""" +A rule providing static rules that always return the same result, regardless of +input. +""") +model StaticRouterRule extends RouterRule { + @doc("The static value this rule always returns.") + value?: unknown; + + @doc("The type discriminator describing a sub-type of Rule") + kind: "static-rule"; +} + +@doc("Describes a worker selector that will be attached to the job") +model StaticWorkerSelectorAttachment extends WorkerSelectorAttachment { + @doc(""" +Describes a condition that must be met against a set of labels for worker +selection +""") + workerSelector: RouterWorkerSelector; + + @doc("The type discriminator describing the type of worker selector attachment") + kind: "static"; +} + +@doc("Trigger for an exception action on exceeding wait time") +model WaitTimeExceptionTrigger extends ExceptionTrigger { + @doc("Threshold for wait time for this trigger.") + thresholdSeconds: float32; + + @doc("The type discriminator describing a sub-type of ExceptionTrigger") + kind: "wait-time"; +} + +@doc("A rule providing a binding to an external web server.") +model WebhookRouterRule extends RouterRule { + @doc("Uri for Authorization Server.") + authorizationServerUri?: string; + + @doc(""" +OAuth2.0 Credentials used to Contoso's Authorization server. +Reference: +https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/ +""") + clientCredential?: Oauth2ClientCredential; + + @doc("Uri for Contoso's Web Server.") + webhookUri?: string; + + @doc("The type discriminator describing a sub-type of Rule") + kind: "webhook-rule"; +} + +@doc(""" +Describes multiple sets of queue selectors, of which one will be selected and +attached according to a weighting +""") +model WeightedAllocationQueueSelectorAttachment + extends QueueSelectorAttachment { + @doc("A collection of percentage based weighted allocations.") + allocations: QueueWeightedAllocation[]; + + @doc("The type discriminator describing the type of queue selector attachment") + kind: "weighted-allocation-queue-selector"; +} + +@doc(""" +Describes multiple sets of worker selectors, of which one will be selected and +attached according to a weighting +""") +model WeightedAllocationWorkerSelectorAttachment + extends WorkerSelectorAttachment { + @doc("A collection of percentage based weighted allocations.") + allocations: WorkerWeightedAllocation[]; + + @doc("The type discriminator describing the type of worker selector attachment") + kind: "weighted-allocation-worker-selector"; +} + +@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.") + weight: float32; + + @doc(""" +A collection of worker selectors that will be applied if this allocation is +selected. +""") + workerSelectors: RouterWorkerSelector[]; +} + +@doc("JobRouter Versions") +enum Versions { + @doc("JobRouter 2023-11-01 api version") + @useDependency(Azure.Core.Versions.v1_0_Preview_2) + c2023_11_01: "2023-11-01", +} diff --git a/specification/communication/JobRouter/routes.tsp b/specification/communication/JobRouter/routes.tsp new file mode 100644 index 000000000000..b9589c06cfd8 --- /dev/null +++ b/specification/communication/JobRouter/routes.tsp @@ -0,0 +1,639 @@ +import "@azure-tools/typespec-azure-core"; +import "@typespec/rest"; +import "./models.tsp"; + +using TypeSpec.Rest; +using TypeSpec.Http; + +namespace AzureCommunicationRoutingService; + +interface JobRouterAdministrationOperations { + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary("Creates or updates a classification policy.") + @doc("Creates or updates a classification policy.") + @route("/routing/classificationPolicies/{id}") + @patch + upsertClassificationPolicy is Azure.Core.Foundations.Operation< + { + @doc("Id of the classification policy.") + @path + id: string; + + @doc(""" +Model of classification policy properties to be patched. See also: +https://datatracker.ietf.org/doc/html/rfc7386. +""") + @body + patch: ClassificationPolicy; + }, + { + @statusCode statuscode: 200 | 201; + + @body result: ClassificationPolicy; + } + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary("Retrieves an existing classification policy by Id.") + @doc("Retrieves an existing classification policy by Id.") + @route("/routing/classificationPolicies/{id}") + @get + getClassificationPolicy is Azure.Core.Foundations.Operation< + { + @doc("Id of the classification policy.") + @path + id: string; + }, + ClassificationPolicy + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary("Delete a classification policy by Id.") + @doc("Delete a classification policy by Id.") + @route("/routing/classificationPolicies/{id}") + @delete + deleteClassificationPolicy is Azure.Core.Foundations.Operation< + { + @doc("Id of the classification policy.") + @path + id: string; + }, + void + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary("Retrieves existing classification policies.") + @doc("Retrieves existing classification policies.") + @route("/routing/classificationPolicies") + @get + listClassificationPolicies is Azure.Core.Foundations.Operation< + { + @doc("Maximum page size.") + @query + maxpagesize: int32; + }, + ClassificationPolicyCollection + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary("Creates or updates a distribution policy.") + @doc("Creates or updates a distribution policy.") + @route("/routing/distributionPolicies/{id}") + @patch + upsertDistributionPolicy is Azure.Core.Foundations.Operation< + { + @doc("Id of the distribution policy.") + @path + id: string; + + @doc(""" +Model of distribution policy properties to be patched. See also: +https://datatracker.ietf.org/doc/html/rfc7386. +""") + @body + patch: DistributionPolicy; + }, + { + @statusCode statuscode: 200 | 201; + + @body result: DistributionPolicy; + } + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary("Retrieves an existing distribution policy by Id.") + @doc("Retrieves an existing distribution policy by Id.") + @route("/routing/distributionPolicies/{id}") + @get + getDistributionPolicy is Azure.Core.Foundations.Operation< + { + @doc("Id of the distribution policy.") + @path + id: string; + }, + DistributionPolicy + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary("Delete a distribution policy by Id.") + @doc("Delete a distribution policy by Id.") + @route("/routing/distributionPolicies/{id}") + @delete + deleteDistributionPolicy is Azure.Core.Foundations.Operation< + { + @doc("Id of the distribution policy.") + @path + id: string; + }, + void + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary("Retrieves existing distribution policies.") + @doc("Retrieves existing distribution policies.") + @route("/routing/distributionPolicies") + @get + listDistributionPolicies is Azure.Core.Foundations.Operation< + { + @doc("Maximum page size.") + @query + maxpagesize: int32; + }, + DistributionPolicyCollection + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary("Creates or updates a exception policy.") + @doc("Creates or updates a exception policy.") + @route("/routing/exceptionPolicies/{id}") + @patch + upsertExceptionPolicy is Azure.Core.Foundations.Operation< + { + @doc("Id of the exception policy.") + @path + id: string; + + @doc(""" +Model of exception policy properties to be patched. See also: +https://datatracker.ietf.org/doc/html/rfc7386 +""") + @body + patch: ExceptionPolicy; + }, + { + @statusCode statuscode: 200 | 201; + + @body result: ExceptionPolicy; + } + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary("Retrieves an existing exception policy by Id.") + @doc("Retrieves an existing exception policy by Id.") + @route("/routing/exceptionPolicies/{id}") + @get + getExceptionPolicy is Azure.Core.Foundations.Operation< + { + @doc("Id of the exception policy to retrieve.") + @path + id: string; + }, + ExceptionPolicy + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary("Deletes a exception policy by Id.") + @doc("Deletes a exception policy by Id.") + @route("/routing/exceptionPolicies/{id}") + @delete + deleteExceptionPolicy is Azure.Core.Foundations.Operation< + { + @doc("Id of the exception policy to delete.") + @path + id: string; + }, + void + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary("Retrieves existing exception policies.") + @doc("Retrieves existing exception policies.") + @route("/routing/exceptionPolicies") + @get + listExceptionPolicies is Azure.Core.Foundations.Operation< + { + @doc("Number of objects to return per page.") + @query + maxpagesize: int32; + }, + ExceptionPolicyCollection + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary("Creates or updates a queue.") + @doc("Creates or updates a queue.") + @route("/routing/queues/{id}") + @patch + upsertQueue is Azure.Core.Foundations.Operation< + { + @doc("Id of the queue.") + @path + id: string; + + @doc(""" +Model of queue properties to be patched. See also: +https://datatracker.ietf.org/doc/html/rfc7386. +""") + @body + patch: RouterQueue; + }, + { + @statusCode statuscode: 200 | 201; + + @body result: RouterQueue; + } + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary("Retrieves an existing queue by Id.") + @doc("Retrieves an existing queue by Id.") + @route("/routing/queues/{id}") + @get + getQueue is Azure.Core.Foundations.Operation< + { + @doc("Id of the queue to retrieve.") + @path + id: string; + }, + RouterQueue + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary("Deletes a queue by Id.") + @doc("Deletes a queue by Id.") + @route("/routing/queues/{id}") + @delete + deleteQueue is Azure.Core.Foundations.Operation< + { + @doc("Id of the queue to delete.") + @path + id: string; + }, + void + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary("Retrieves existing queues.") + @doc("Retrieves existing queues.") + @route("/routing/queues") + @get + listQueues is Azure.Core.Foundations.Operation< + { + @doc("Number of objects to return per page.") + @query + maxpagesize: int32; + }, + RouterQueueCollection + >; +} + +interface JobRouterOperations { + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary("Creates or updates a router job.") + @doc("Creates or updates a router job.") + @route("/routing/jobs/{id}") + @patch + upsertJob is Azure.Core.Foundations.Operation< + { + @doc("Id of the job.") + @path + id: string; + + @doc(""" +Model of job properties to be created or patched. See also: +https://datatracker.ietf.org/doc/html/rfc7386. +""") + @body + patch: RouterJob; + }, + { + @statusCode statuscode: 200 | 201; + + @body result: RouterJob; + } + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary("Retrieves an existing job by Id.") + @doc("Retrieves an existing job by Id.") + @route("/routing/jobs/{id}") + @get + getJob is Azure.Core.Foundations.Operation< + { + @doc("Id of the job to retrieve.") + @path + id: string; + }, + RouterJob + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary("Deletes a job and all of its traces.") + @doc("Deletes a job and all of its traces.") + @route("/routing/jobs/{id}") + @delete + deleteJob is Azure.Core.Foundations.Operation< + { + @doc("Id of the job.") + @path + id: string; + }, + void + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary("Reclassify a job.") + @doc("Reclassify a job.") + @route("/routing/jobs/{id}:reclassify") + @post + reclassifyJobAction is Azure.Core.Foundations.Operation< + { + @doc("Id of the job.") + @path + id: string; + + @doc("Request object for reclassifying a job.") + @body + reclassifyJobRequest: {}; + }, + void + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary(""" +Submits request to cancel an existing job by Id while supplying free-form +cancellation reason. +""") + @doc(""" +Submits request to cancel an existing job by Id while supplying free-form +cancellation reason. +""") + @route("/routing/jobs/{id}:cancel") + @post + cancelJobAction is Azure.Core.Foundations.Operation< + { + @doc("Id of the job.") + @path + id: string; + + @doc("Request model for cancelling job.") + @body + cancelJobRequest: CancelJobRequest; + }, + void + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary("Completes an assigned job.") + @doc("Completes an assigned job.") + @route("/routing/jobs/{id}:complete") + @post + completeJobAction is Azure.Core.Foundations.Operation< + { + @doc("Id of the job.") + @path + id: string; + + @doc("Request model for completing job.") + @body + completeJobRequest: CompleteJobRequest; + }, + void + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary("Closes a completed job.") + @doc("Closes a completed job.") + @route("/routing/jobs/{id}:close") + @post + closeJobAction is Azure.Core.Foundations.Operation< + { + @doc("Id of the job.") + @path + id: string; + + @doc("Request model for closing job.") + @body + closeJobRequest: CloseJobRequest; + }, + void + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary("Retrieves list of jobs based on filter parameters.") + @doc("Retrieves list of jobs based on filter parameters.") + @route("/routing/jobs") + @get + listJobs is Azure.Core.Foundations.Operation< + { + @doc("If specified, filter jobs by status.") + @query + status: RouterJobStatusSelector; + + @doc("If specified, filter jobs by queue.") + @query + queueId: string; + + @doc("If specified, filter jobs by channel.") + @query + channelId: string; + + @doc("If specified, filter jobs by classificationPolicy.") + @query + classificationPolicyId: string; + + @doc(""" +If specified, filter on jobs that was scheduled before or at given timestamp. +Range: (-Inf, scheduledBefore]. +""") + @query + scheduledBefore: utcDateTime; + + @doc(""" +If specified, filter on jobs that was scheduled at or after given value. Range: +[scheduledAfter, +Inf). +""") + @query + scheduledAfter: utcDateTime; + + @doc("Number of objects to return per page.") + @query + maxpagesize: int32; + }, + RouterJobCollection + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary("Gets a job's position details.") + @doc("Gets a job's position details.") + @route("/routing/jobs/{id}/position") + @get + getInQueuePosition is Azure.Core.Foundations.Operation< + { + @doc("Id of the job.") + @path + id: string; + }, + RouterJobPositionDetails + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary("Un-assign a job.") + @doc("Un-assign a job.") + @route("/routing/jobs/{id}/assignments/{assignmentId}:unassign") + @post + unassignJobAction is Azure.Core.Foundations.Operation< + { + @doc("Id of the job to un-assign.") + @path + id: string; + + @doc("Id of the assignment to un-assign.") + @path + assignmentId: string; + + @doc("Request body for unassign route.") + @body + unassignJobRequest: UnassignJobRequest; + }, + UnassignJobResult + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary(""" +Accepts an offer to work on a job and returns a 409/Conflict if another agent +accepted the job already. +""") + @doc(""" +Accepts an offer to work on a job and returns a 409/Conflict if another agent +accepted the job already. +""") + @route("/routing/workers/{workerId}/offers/{offerId}:accept") + @post + acceptJobAction is Azure.Core.Foundations.Operation< + { + @doc("Id of the worker.") + @path + workerId: string; + + @doc("Id of the offer.") + @path + offerId: string; + }, + AcceptJobOfferResult + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary("Declines an offer to work on a job.") + @doc("Declines an offer to work on a job.") + @route("/routing/workers/{workerId}/offers/{offerId}:decline") + @post + declineJobAction is Azure.Core.Foundations.Operation< + { + @doc("Id of the worker.") + @path + workerId: string; + + @doc("Id of the offer.") + @path + offerId: string; + + @doc("Request model for declining offer.") + @body + declineJobOfferRequest: DeclineJobOfferRequest; + }, + void + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary("Retrieves a queue's statistics.") + @doc("Retrieves a queue's statistics.") + @route("/routing/queues/{id}/statistics") + @get + getQueueStatistics is Azure.Core.Foundations.Operation< + { + @doc("Id of the queue to retrieve statistics.") + @path + id: string; + }, + RouterQueueStatistics + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary("Creates or updates a worker.") + @doc("Creates or updates a worker.") + @route("/routing/workers/{workerId}") + @patch + upsertWorker is Azure.Core.Foundations.Operation< + { + @doc("Id of the worker.") + @path + workerId: string; + + @doc(""" +Model of worker properties to be created or patched. See also: +https://datatracker.ietf.org/doc/html/rfc7386. +""") + @body + patch: RouterWorker; + }, + { + @statusCode statuscode: 200 | 201; + + @body result: RouterWorker; + } + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary("Retrieves an existing worker by Id.") + @doc("Retrieves an existing worker by Id.") + @route("/routing/workers/{workerId}") + @get + getWorker is Azure.Core.Foundations.Operation< + { + @doc("Id of the worker to retrieve.") + @path + workerId: string; + }, + RouterWorker + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary("Deletes a worker and all of its traces.") + @doc("Deletes a worker and all of its traces.") + @route("/routing/workers/{workerId}") + @delete + deleteWorker is Azure.Core.Foundations.Operation< + { + @doc("Id of the worker to delete.") + @path + workerId: string; + }, + void + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @summary("Retrieves existing workers.") + @doc("Retrieves existing workers.") + @route("/routing/workers") + @get + listWorkers is Azure.Core.Foundations.Operation< + { + @doc("If specified, select workers by worker state.") + @query + state: RouterWorkerStateSelector; + + @doc("If specified, select workers who have a channel configuration with this channel.") + @query + channelId: string; + + @doc("If specified, select workers who are assigned to this queue.") + @query + queueId: string; + + @doc(""" +If set to true, select only workers who have capacity for the channel specified +by `channelId` or for any channel if `channelId` not specified. If set to +false, then will return all workers including workers without any capacity for +jobs. Defaults to false. +""") + @query + hasCapacity: boolean; + + @doc("Number of objects to return per page.") + @query + maxpagesize: int32; + }, + RouterWorkerCollection + >; +} diff --git a/specification/communication/JobRouter/tspconfig.yaml b/specification/communication/JobRouter/tspconfig.yaml new file mode 100644 index 000000000000..b14d76bafb8d --- /dev/null +++ b/specification/communication/JobRouter/tspconfig.yaml @@ -0,0 +1,39 @@ +parameters: + "python-sdk-folder": + default: "{project-root}/azure-sdk-for-python/" + "java-sdk-folder": + default: "{project-root}/azure-sdk-for-java/" + "js-sdk-folder": + default: "{project-root}/azure-sdk-for-js/" + "csharp-sdk-folder": + default: "{project-root}/azure-sdk-for-csharp/" + "service-directory-name": + default: "communication" +emit: [ + "@azure-tools/typespec-autorest", +] + +options: + "@azure-tools/typespec-autorest": + examples-directory: examples + omit-unreachable-types: true + output-file: communicationservicejobrouter.json + emitter-output-dir: "{project-root}/../data-plane/JobRouter/stable/2023-11-01" + "@azure-tools/typespec-csharp": + clear-output-folder: true + model-namespace: false + emitter-output-dir: "{csharp-sdk-folder}/sdk/{service-directory-name}/{namespace}/src" + namespace: Azure.Communication.JobRouter + "@azure-tools/typespec-python": + emitter-output-dir: "{python-sdk-folder}/sdk/{service-directory-name}/{package-name}" + package-name: "azure-communication-jobrouter" + "@azure-tools/typespec-java": + emitter-output-dir: "{java-sdk-folder}/sdk/{service-directory-name}/azure-communication-jobrouter" + namespace: com.azure.communication.jobrouter + "@azure-tools/typespec-ts": + emitter-output-dir: "{js-sdk-folder}/sdk/{service-directory-name}/communication-job-router" + generateMetadata: true + generateTest: true + packageDetails: + name: "@azure/communication-job-router" + description: "Azure client library for Azure Communication Job Router services" \ No newline at end of file diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json new file mode 100644 index 000000000000..5f04f356052f --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -0,0 +1,3588 @@ +{ + "swagger": "2.0", + "info": { + "title": "Azure Communication Routing Service", + "version": "2023-11-01", + "description": "Azure Communication Routing Service", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "x-ms-parameterized-host": { + "hostTemplate": "{endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "name": "endpoint", + "in": "path", + "required": true, + "type": "string" + } + ] + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "tags": [], + "paths": { + "/routing/classificationPolicies": { + "get": { + "operationId": "JobRouterAdministrationOperations_ListClassificationPolicies", + "summary": "Retrieves existing classification policies.", + "description": "Retrieves existing classification policies.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "maxpagesize", + "in": "query", + "description": "Maximum page size.", + "required": true, + "type": "integer", + "format": "int32" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedClassificationPolicyItem" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/routing/classificationPolicies/{id}": { + "get": { + "operationId": "JobRouterAdministrationOperations_GetClassificationPolicy", + "summary": "Retrieves an existing classification policy by Id.", + "description": "Retrieves an existing classification policy by Id.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "id", + "in": "path", + "description": "Id of the classification policy.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/ClassificationPolicy" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + } + }, + "patch": { + "operationId": "JobRouterAdministrationOperations_UpsertClassificationPolicy", + "summary": "Creates or updates a classification policy.", + "description": "Creates or updates a classification policy.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "id", + "in": "path", + "description": "Id of the classification policy.", + "required": true, + "type": "string" + }, + { + "name": "patch", + "in": "body", + "description": "Model of classification policy properties to be patched. See also:\nhttps://datatracker.ietf.org/doc/html/rfc7386.", + "required": true, + "schema": { + "$ref": "#/definitions/ClassificationPolicy" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/ClassificationPolicy" + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/ClassificationPolicy" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + } + }, + "delete": { + "operationId": "JobRouterAdministrationOperations_DeleteClassificationPolicy", + "summary": "Delete a classification policy by Id.", + "description": "Delete a classification policy by Id.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "id", + "in": "path", + "description": "Id of the classification policy.", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + } + } + }, + "/routing/distributionPolicies": { + "get": { + "operationId": "JobRouterAdministrationOperations_ListDistributionPolicies", + "summary": "Retrieves existing distribution policies.", + "description": "Retrieves existing distribution policies.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "maxpagesize", + "in": "query", + "description": "Maximum page size.", + "required": true, + "type": "integer", + "format": "int32" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedDistributionPolicyItem" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/routing/distributionPolicies/{id}": { + "get": { + "operationId": "JobRouterAdministrationOperations_GetDistributionPolicy", + "summary": "Retrieves an existing distribution policy by Id.", + "description": "Retrieves an existing distribution policy by Id.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "id", + "in": "path", + "description": "Id of the distribution policy.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/DistributionPolicy" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + } + }, + "patch": { + "operationId": "JobRouterAdministrationOperations_UpsertDistributionPolicy", + "summary": "Creates or updates a distribution policy.", + "description": "Creates or updates a distribution policy.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "id", + "in": "path", + "description": "Id of the distribution policy.", + "required": true, + "type": "string" + }, + { + "name": "patch", + "in": "body", + "description": "Model of distribution policy properties to be patched. See also:\nhttps://datatracker.ietf.org/doc/html/rfc7386.", + "required": true, + "schema": { + "$ref": "#/definitions/DistributionPolicy" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/DistributionPolicy" + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/DistributionPolicy" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + } + }, + "delete": { + "operationId": "JobRouterAdministrationOperations_DeleteDistributionPolicy", + "summary": "Delete a distribution policy by Id.", + "description": "Delete a distribution policy by Id.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "id", + "in": "path", + "description": "Id of the distribution policy.", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + } + } + }, + "/routing/exceptionPolicies": { + "get": { + "operationId": "JobRouterAdministrationOperations_ListExceptionPolicies", + "summary": "Retrieves existing exception policies.", + "description": "Retrieves existing exception policies.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "maxpagesize", + "in": "query", + "description": "Number of objects to return per page.", + "required": true, + "type": "integer", + "format": "int32" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedExceptionPolicyItem" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/routing/exceptionPolicies/{id}": { + "get": { + "operationId": "JobRouterAdministrationOperations_GetExceptionPolicy", + "summary": "Retrieves an existing exception policy by Id.", + "description": "Retrieves an existing exception policy by Id.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "id", + "in": "path", + "description": "Id of the exception policy to retrieve.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/ExceptionPolicy" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + } + }, + "patch": { + "operationId": "JobRouterAdministrationOperations_UpsertExceptionPolicy", + "summary": "Creates or updates a exception policy.", + "description": "Creates or updates a exception policy.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "id", + "in": "path", + "description": "Id of the exception policy.", + "required": true, + "type": "string" + }, + { + "name": "patch", + "in": "body", + "description": "Model of exception policy properties to be patched. See also:\nhttps://datatracker.ietf.org/doc/html/rfc7386", + "required": true, + "schema": { + "$ref": "#/definitions/ExceptionPolicy" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/ExceptionPolicy" + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/ExceptionPolicy" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + } + }, + "delete": { + "operationId": "JobRouterAdministrationOperations_DeleteExceptionPolicy", + "summary": "Deletes a exception policy by Id.", + "description": "Deletes a exception policy by Id.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "id", + "in": "path", + "description": "Id of the exception policy to delete.", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + } + } + }, + "/routing/jobs": { + "get": { + "operationId": "JobRouterOperations_ListJobs", + "summary": "Retrieves list of jobs based on filter parameters.", + "description": "Retrieves list of jobs based on filter parameters.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "status", + "in": "query", + "description": "If specified, filter jobs by status.", + "required": true, + "type": "string", + "enum": [ + "all", + "pendingClassification", + "queued", + "assigned", + "completed", + "closed", + "cancelled", + "classificationFailed", + "created", + "pendingSchedule", + "scheduled", + "scheduleFailed", + "waitingForActivation", + "active" + ], + "x-ms-enum": { + "name": "RouterJobStatusSelector", + "modelAsString": true, + "values": [ + { + "name": "all", + "value": "all", + "description": "Default" + }, + { + "name": "pendingClassification", + "value": "pendingClassification", + "description": "Job is waiting to be classified." + }, + { + "name": "queued", + "value": "queued", + "description": "Job has been queued." + }, + { + "name": "assigned", + "value": "assigned", + "description": "Job has been assigned to a worker." + }, + { + "name": "completed", + "value": "completed", + "description": "Job has been completed by a worker." + }, + { + "name": "closed", + "value": "closed", + "description": "Job has been closed by a worker." + }, + { + "name": "cancelled", + "value": "cancelled", + "description": "Job has been cancelled." + }, + { + "name": "classificationFailed", + "value": "classificationFailed", + "description": "Classification process failed for the job." + }, + { + "name": "created", + "value": "created", + "description": "Job has been created." + }, + { + "name": "pendingSchedule", + "value": "pendingSchedule", + "description": "Job has been created but not been scheduled yet." + }, + { + "name": "scheduled", + "value": "scheduled", + "description": "Job has been scheduled successfully." + }, + { + "name": "scheduleFailed", + "value": "scheduleFailed", + "description": "Job scheduling failed." + }, + { + "name": "waitingForActivation", + "value": "waitingForActivation", + "description": "Job is in a suspended state and waiting for an update." + }, + { + "name": "active", + "value": "active", + "description": "Job is in a state of PendingClassification or Queued or Assigned or ClassificationFailed or Completed or PendingSchedule or Scheduled or ScheduleFailed or WaitingForActivation." + } + ] + } + }, + { + "name": "queueId", + "in": "query", + "description": "If specified, filter jobs by queue.", + "required": true, + "type": "string" + }, + { + "name": "channelId", + "in": "query", + "description": "If specified, filter jobs by channel.", + "required": true, + "type": "string" + }, + { + "name": "classificationPolicyId", + "in": "query", + "description": "If specified, filter jobs by classificationPolicy.", + "required": true, + "type": "string" + }, + { + "name": "scheduledBefore", + "in": "query", + "description": "If specified, filter on jobs that was scheduled before or at given timestamp.\nRange: (-Inf, scheduledBefore].", + "required": true, + "type": "string", + "format": "date-time" + }, + { + "name": "scheduledAfter", + "in": "query", + "description": "If specified, filter on jobs that was scheduled at or after given value. Range:\n[scheduledAfter, +Inf).", + "required": true, + "type": "string", + "format": "date-time" + }, + { + "name": "maxpagesize", + "in": "query", + "description": "Number of objects to return per page.", + "required": true, + "type": "integer", + "format": "int32" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedRouterJobItem" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/routing/jobs/{id}": { + "get": { + "operationId": "JobRouterOperations_GetJob", + "summary": "Retrieves an existing job by Id.", + "description": "Retrieves an existing job by Id.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "id", + "in": "path", + "description": "Id of the job to retrieve.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/RouterJob" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + } + }, + "patch": { + "operationId": "JobRouterOperations_UpsertJob", + "summary": "Creates or updates a router job.", + "description": "Creates or updates a router job.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "id", + "in": "path", + "description": "Id of the job.", + "required": true, + "type": "string" + }, + { + "name": "patch", + "in": "body", + "description": "Model of job properties to be created or patched. See also:\nhttps://datatracker.ietf.org/doc/html/rfc7386.", + "required": true, + "schema": { + "$ref": "#/definitions/RouterJob" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/RouterJob" + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/RouterJob" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + } + }, + "delete": { + "operationId": "JobRouterOperations_DeleteJob", + "summary": "Deletes a job and all of its traces.", + "description": "Deletes a job and all of its traces.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "id", + "in": "path", + "description": "Id of the job.", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + } + } + }, + "/routing/jobs/{id}:reclassify": { + "post": { + "operationId": "JobRouterOperations_ReclassifyJobAction", + "summary": "Reclassify a job.", + "description": "Reclassify a job.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "id", + "in": "path", + "description": "Id of the job.", + "required": true, + "type": "string" + }, + { + "name": "reclassifyJobRequest", + "in": "body", + "description": "Request object for reclassifying a job.", + "required": true, + "schema": { + "type": "object", + "properties": {} + } + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + } + } + }, + "/routing/jobs/{id}:cancel": { + "post": { + "operationId": "JobRouterOperations_CancelJobAction", + "summary": "Submits request to cancel an existing job by Id while supplying free-form\ncancellation reason.", + "description": "Submits request to cancel an existing job by Id while supplying free-form\ncancellation reason.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "id", + "in": "path", + "description": "Id of the job.", + "required": true, + "type": "string" + }, + { + "name": "cancelJobRequest", + "in": "body", + "description": "Request model for cancelling job.", + "required": true, + "schema": { + "$ref": "#/definitions/CancelJobRequest" + } + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + } + } + }, + "/routing/jobs/{id}:complete": { + "post": { + "operationId": "JobRouterOperations_CompleteJobAction", + "summary": "Completes an assigned job.", + "description": "Completes an assigned job.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "id", + "in": "path", + "description": "Id of the job.", + "required": true, + "type": "string" + }, + { + "name": "completeJobRequest", + "in": "body", + "description": "Request model for completing job.", + "required": true, + "schema": { + "$ref": "#/definitions/CompleteJobRequest" + } + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + } + } + }, + "/routing/jobs/{id}:close": { + "post": { + "operationId": "JobRouterOperations_CloseJobAction", + "summary": "Closes a completed job.", + "description": "Closes a completed job.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "id", + "in": "path", + "description": "Id of the job.", + "required": true, + "type": "string" + }, + { + "name": "closeJobRequest", + "in": "body", + "description": "Request model for closing job.", + "required": true, + "schema": { + "$ref": "#/definitions/CloseJobRequest" + } + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + } + } + }, + "/routing/jobs/{id}/assignments/{assignmentId}:unassign": { + "post": { + "operationId": "JobRouterOperations_UnassignJobAction", + "summary": "Un-assign a job.", + "description": "Un-assign a job.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "id", + "in": "path", + "description": "Id of the job to un-assign.", + "required": true, + "type": "string" + }, + { + "name": "assignmentId", + "in": "path", + "description": "Id of the assignment to un-assign.", + "required": true, + "type": "string" + }, + { + "name": "unassignJobRequest", + "in": "body", + "description": "Request body for unassign route.", + "required": true, + "schema": { + "$ref": "#/definitions/UnassignJobRequest" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/UnassignJobResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + } + } + }, + "/routing/jobs/{id}/position": { + "get": { + "operationId": "JobRouterOperations_GetInQueuePosition", + "summary": "Gets a job's position details.", + "description": "Gets a job's position details.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "id", + "in": "path", + "description": "Id of the job.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/RouterJobPositionDetails" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + } + } + }, + "/routing/queues": { + "get": { + "operationId": "JobRouterAdministrationOperations_ListQueues", + "summary": "Retrieves existing queues.", + "description": "Retrieves existing queues.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "maxpagesize", + "in": "query", + "description": "Number of objects to return per page.", + "required": true, + "type": "integer", + "format": "int32" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedRouterQueueItem" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/routing/queues/{id}": { + "get": { + "operationId": "JobRouterAdministrationOperations_GetQueue", + "summary": "Retrieves an existing queue by Id.", + "description": "Retrieves an existing queue by Id.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "id", + "in": "path", + "description": "Id of the queue to retrieve.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/RouterQueue" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + } + }, + "patch": { + "operationId": "JobRouterAdministrationOperations_UpsertQueue", + "summary": "Creates or updates a queue.", + "description": "Creates or updates a queue.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "id", + "in": "path", + "description": "Id of the queue.", + "required": true, + "type": "string" + }, + { + "name": "patch", + "in": "body", + "description": "Model of queue properties to be patched. See also:\nhttps://datatracker.ietf.org/doc/html/rfc7386.", + "required": true, + "schema": { + "$ref": "#/definitions/RouterQueue" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/RouterQueue" + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/RouterQueue" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + } + }, + "delete": { + "operationId": "JobRouterAdministrationOperations_DeleteQueue", + "summary": "Deletes a queue by Id.", + "description": "Deletes a queue by Id.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "id", + "in": "path", + "description": "Id of the queue to delete.", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + } + } + }, + "/routing/queues/{id}/statistics": { + "get": { + "operationId": "JobRouterOperations_GetQueueStatistics", + "summary": "Retrieves a queue's statistics.", + "description": "Retrieves a queue's statistics.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "id", + "in": "path", + "description": "Id of the queue to retrieve statistics.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/RouterQueueStatistics" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + } + } + }, + "/routing/workers": { + "get": { + "operationId": "JobRouterOperations_ListWorkers", + "summary": "Retrieves existing workers.", + "description": "Retrieves existing workers.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "state", + "in": "query", + "description": "If specified, select workers by worker state.", + "required": true, + "type": "string", + "enum": [ + "active", + "draining", + "inactive", + "all" + ], + "x-ms-enum": { + "name": "RouterWorkerStateSelector", + "modelAsString": true, + "values": [ + { + "name": "active", + "value": "active", + "description": "Worker is active and available to take offers." + }, + { + "name": "draining", + "value": "draining", + "description": "Worker is not active, if there are existing offers they are being revoked. No new offers are sent." + }, + { + "name": "inactive", + "value": "inactive", + "description": "Worker is not active. No new offers are sent." + }, + { + "name": "all", + "value": "all", + "description": "Worker is active or draining or inactive." + } + ] + } + }, + { + "name": "channelId", + "in": "query", + "description": "If specified, select workers who have a channel configuration with this channel.", + "required": true, + "type": "string" + }, + { + "name": "queueId", + "in": "query", + "description": "If specified, select workers who are assigned to this queue.", + "required": true, + "type": "string" + }, + { + "name": "hasCapacity", + "in": "query", + "description": "If set to true, select only workers who have capacity for the channel specified\nby `channelId` or for any channel if `channelId` not specified. If set to\nfalse, then will return all workers including workers without any capacity for\njobs. Defaults to false.", + "required": true, + "type": "boolean" + }, + { + "name": "maxpagesize", + "in": "query", + "description": "Number of objects to return per page.", + "required": true, + "type": "integer", + "format": "int32" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedRouterWorkerItem" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/routing/workers/{workerId}": { + "get": { + "operationId": "JobRouterOperations_GetWorker", + "summary": "Retrieves an existing worker by Id.", + "description": "Retrieves an existing worker by Id.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "workerId", + "in": "path", + "description": "Id of the worker to retrieve.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/RouterWorker" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + } + }, + "patch": { + "operationId": "JobRouterOperations_UpsertWorker", + "summary": "Creates or updates a worker.", + "description": "Creates or updates a worker.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "workerId", + "in": "path", + "description": "Id of the worker.", + "required": true, + "type": "string" + }, + { + "name": "patch", + "in": "body", + "description": "Model of worker properties to be created or patched. See also:\nhttps://datatracker.ietf.org/doc/html/rfc7386.", + "required": true, + "schema": { + "$ref": "#/definitions/RouterWorker" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/RouterWorker" + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/RouterWorker" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + } + }, + "delete": { + "operationId": "JobRouterOperations_DeleteWorker", + "summary": "Deletes a worker and all of its traces.", + "description": "Deletes a worker and all of its traces.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "workerId", + "in": "path", + "description": "Id of the worker to delete.", + "required": true, + "type": "string" + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + } + } + }, + "/routing/workers/{workerId}/offers/{offerId}:accept": { + "post": { + "operationId": "JobRouterOperations_AcceptJobAction", + "summary": "Accepts an offer to work on a job and returns a 409/Conflict if another agent\naccepted the job already.", + "description": "Accepts an offer to work on a job and returns a 409/Conflict if another agent\naccepted the job already.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "workerId", + "in": "path", + "description": "Id of the worker.", + "required": true, + "type": "string" + }, + { + "name": "offerId", + "in": "path", + "description": "Id of the offer.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/AcceptJobOfferResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + } + } + }, + "/routing/workers/{workerId}/offers/{offerId}:decline": { + "post": { + "operationId": "JobRouterOperations_DeclineJobAction", + "summary": "Declines an offer to work on a job.", + "description": "Declines an offer to work on a job.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "workerId", + "in": "path", + "description": "Id of the worker.", + "required": true, + "type": "string" + }, + { + "name": "offerId", + "in": "path", + "description": "Id of the offer.", + "required": true, + "type": "string" + }, + { + "name": "declineJobOfferRequest", + "in": "body", + "description": "Request model for declining offer.", + "required": true, + "schema": { + "$ref": "#/definitions/DeclineJobOfferRequest" + } + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "description": "String error code indicating what went wrong.", + "type": "string" + } + } + } + } + } + } + }, + "definitions": { + "AcceptJobOfferResult": { + "type": "object", + "description": "Response containing Id's for the worker, job, and assignment from an accepted\noffer", + "properties": { + "assignmentId": { + "type": "string", + "description": "The assignment Id that assigns a worker that has accepted an offer to a job." + }, + "jobId": { + "type": "string", + "description": "The Id of the job assigned." + }, + "workerId": { + "type": "string", + "description": "The Id of the worker that has been assigned this job." + } + }, + "required": [ + "assignmentId", + "jobId", + "workerId" + ] + }, + "Azure.Core.Foundations.Error": { + "type": "object", + "description": "The error object.", + "properties": { + "code": { + "type": "string", + "description": "One of a server-defined set of error codes." + }, + "message": { + "type": "string", + "description": "A human-readable representation of the error." + }, + "target": { + "type": "string", + "description": "The target of the error." + }, + "details": { + "type": "array", + "description": "An array of details about specific errors that led to this reported error.", + "items": { + "$ref": "#/definitions/Azure.Core.Foundations.Error" + }, + "x-ms-identifiers": [] + }, + "innererror": { + "$ref": "#/definitions/Azure.Core.Foundations.InnerError", + "description": "An object containing more specific information than the current object about the error." + } + }, + "required": [ + "code", + "message" + ] + }, + "Azure.Core.Foundations.ErrorResponse": { + "type": "object", + "description": "A response containing error details.", + "properties": { + "error": { + "$ref": "#/definitions/Azure.Core.Foundations.Error", + "description": "The error object." + } + }, + "required": [ + "error" + ] + }, + "Azure.Core.Foundations.InnerError": { + "type": "object", + "description": "An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.", + "properties": { + "code": { + "type": "string", + "description": "One of a server-defined set of error codes." + }, + "innererror": { + "$ref": "#/definitions/Azure.Core.Foundations.InnerError", + "description": "Inner error." + } + } + }, + "BestWorkerMode": { + "type": "object", + "description": "Jobs are distributed to the worker with the strongest abilities available.", + "properties": { + "scoringRule": { + "$ref": "#/definitions/RouterRule", + "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nAzureFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol." + }, + "scoringRuleOptions": { + "$ref": "#/definitions/ScoringRuleOptions", + "description": "Encapsulates all options that can be passed as parameters for scoring rule with\nBestWorkerMode" + } + }, + "allOf": [ + { + "$ref": "#/definitions/DistributionMode" + } + ], + "x-ms-discriminator-value": "best-worker" + }, + "CancelExceptionAction": { + "type": "object", + "description": "An action that marks a job as cancelled", + "properties": { + "note": { + "type": "string", + "description": "(Optional) A note that will be appended to the jobs' Notes collection with the\ncurrent timestamp." + }, + "dispositionCode": { + "type": "string", + "description": "(Optional) Indicates the outcome of the job, populate this field with your own\ncustom values." + } + }, + "allOf": [ + { + "$ref": "#/definitions/ExceptionAction" + } + ], + "x-ms-discriminator-value": "cancel" + }, + "CancelJobRequest": { + "type": "object", + "description": "Request payload for deleting a job", + "properties": { + "note": { + "type": "string", + "description": "(Optional) A note that will be appended to the jobs' Notes collection with the\ncurrent timestamp." + }, + "dispositionCode": { + "type": "string", + "description": "Indicates the outcome of the job, populate this field with your own custom\nvalues.\nIf not provided, default value of \"Cancelled\" is set." + } + } + }, + "ChannelConfiguration": { + "type": "object", + "description": "Represents the capacity a job in this channel will consume from a worker", + "properties": { + "capacityCostPerJob": { + "type": "integer", + "format": "int32", + "description": "The amount of capacity that an instance of a job of this channel will consume\nof the total worker capacity." + }, + "maxNumberOfJobs": { + "type": "integer", + "format": "int32", + "description": "The maximum number of jobs that can be supported concurrently for this channel." + } + }, + "required": [ + "capacityCostPerJob" + ] + }, + "ClassificationPolicy": { + "type": "object", + "description": "A container for the rules that govern how jobs are classified.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier of this policy.", + "readOnly": true + }, + "name": { + "type": "string", + "description": "Friendly name of this policy." + }, + "fallbackQueueId": { + "type": "string", + "description": "The fallback queue to select if the queue selector doesn't find a match." + }, + "queueSelectors": { + "type": "array", + "description": "The queue selectors to resolve a queue for a given job.", + "items": { + "$ref": "#/definitions/QueueSelectorAttachment" + }, + "x-ms-identifiers": [] + }, + "prioritizationRule": { + "$ref": "#/definitions/RouterRule", + "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nAzureFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol." + }, + "workerSelectors": { + "type": "array", + "description": "The worker label selectors to attach to a given job.", + "items": { + "$ref": "#/definitions/WorkerSelectorAttachment" + }, + "x-ms-identifiers": [] + } + } + }, + "ClassificationPolicyItem": { + "type": "object", + "description": "Paged instance of ClassificationPolicy", + "properties": { + "classificationPolicy": { + "$ref": "#/definitions/ClassificationPolicy", + "description": "A container for the rules that govern how jobs are classified." + }, + "etag": { + "type": "string", + "description": "(Optional) The Concurrency Token." + } + } + }, + "CloseJobRequest": { + "type": "object", + "description": "Request payload for closing jobs", + "properties": { + "assignmentId": { + "type": "string", + "description": "The assignment within which the job is to be closed." + }, + "dispositionCode": { + "type": "string", + "description": "Indicates the outcome of the job, populate this field with your own custom\nvalues." + }, + "closeAt": { + "type": "string", + "format": "date-time", + "description": "If not provided, worker capacity is released immediately along with a\nJobClosedEvent notification.\nIf provided, worker capacity is released along\nwith a JobClosedEvent notification at a future time in UTC." + }, + "note": { + "type": "string", + "description": "(Optional) A note that will be appended to the jobs' Notes collection with the\ncurrent timestamp." + } + }, + "required": [ + "assignmentId" + ] + }, + "CompleteJobRequest": { + "type": "object", + "description": "Request payload for completing jobs", + "properties": { + "assignmentId": { + "type": "string", + "description": "The assignment within the job to complete." + }, + "note": { + "type": "string", + "description": "(Optional) A note that will be appended to the jobs' Notes collection with the\ncurrent timestamp." + } + }, + "required": [ + "assignmentId" + ] + }, + "ConditionalQueueSelectorAttachment": { + "type": "object", + "description": "Describes a set of queue selectors that will be attached if the given condition\nresolves to true", + "properties": { + "condition": { + "$ref": "#/definitions/RouterRule", + "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nAzureFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol." + }, + "queueSelectors": { + "type": "array", + "description": "The queue selectors to attach", + "items": { + "$ref": "#/definitions/RouterQueueSelector" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "condition", + "queueSelectors" + ], + "allOf": [ + { + "$ref": "#/definitions/QueueSelectorAttachment" + } + ], + "x-ms-discriminator-value": "conditional" + }, + "ConditionalWorkerSelectorAttachment": { + "type": "object", + "description": "Describes a set of worker selectors that will be attached if the given\ncondition resolves to true", + "properties": { + "condition": { + "$ref": "#/definitions/RouterRule", + "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nAzureFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol." + }, + "workerSelectors": { + "type": "array", + "description": "The worker selectors to attach", + "items": { + "$ref": "#/definitions/RouterWorkerSelector" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "condition", + "workerSelectors" + ], + "allOf": [ + { + "$ref": "#/definitions/WorkerSelectorAttachment" + } + ], + "x-ms-discriminator-value": "conditional" + }, + "DeclineJobOfferRequest": { + "type": "object", + "description": "Request payload for declining offers", + "properties": { + "retryOfferAt": { + "type": "string", + "format": "date-time", + "description": "If the RetryOfferAt is not provided, then this job will not be offered again to\nthe worker who declined this job unless\nthe worker is de-registered and\nre-registered. If a RetryOfferAt time is provided, then the job will be\nre-matched to\neligible workers at the retry time in UTC. The worker that\ndeclined the job will also be eligible for the job at that time." + } + } + }, + "DirectMapRouterRule": { + "type": "object", + "description": "A rule that return the same labels as the input labels.", + "properties": {}, + "allOf": [ + { + "$ref": "#/definitions/RouterRule" + } + ], + "x-ms-discriminator-value": "direct-map-rule" + }, + "DistributionMode": { + "type": "object", + "description": "Abstract base class for defining a distribution mode", + "properties": { + "kind": { + "type": "string", + "description": "Discriminator property for DistributionMode." + }, + "minConcurrentOffers": { + "type": "integer", + "format": "int32", + "description": "Governs the minimum desired number of active concurrent offers a job can have." + }, + "maxConcurrentOffers": { + "type": "integer", + "format": "int32", + "description": "Governs the maximum number of active concurrent offers a job can have." + }, + "bypassSelectors": { + "type": "boolean", + "description": "(Optional)\nIf set to true, then router will match workers to jobs even if they\ndon't match label selectors.\nWarning: You may get workers that are not\nqualified for the job they are matched with if you set this\nvariable to true.\nThis flag is intended more for temporary usage.\nBy default, set to false." + } + }, + "discriminator": "kind", + "required": [ + "kind" + ] + }, + "DistributionPolicy": { + "type": "object", + "description": "Policy governing how jobs are distributed to workers", + "properties": { + "id": { + "type": "string", + "description": "The unique identifier of the policy.", + "readOnly": true + }, + "name": { + "type": "string", + "description": "The human readable name of the policy." + }, + "offerExpiresAfterSeconds": { + "type": "number", + "format": "float", + "description": "The number of seconds after which any offers created under this policy will be\nexpired." + }, + "mode": { + "$ref": "#/definitions/DistributionMode", + "description": "Abstract base class for defining a distribution mode" + } + } + }, + "DistributionPolicyItem": { + "type": "object", + "description": "Paged instance of DistributionPolicy", + "properties": { + "distributionPolicy": { + "$ref": "#/definitions/DistributionPolicy", + "description": "Policy governing how jobs are distributed to workers" + }, + "etag": { + "type": "string", + "description": "(Optional) The Concurrency Token." + } + } + }, + "ExceptionAction": { + "type": "object", + "description": "The action to take when the exception is triggered", + "properties": { + "kind": { + "type": "string", + "description": "Discriminator property for ExceptionAction." + } + }, + "discriminator": "kind", + "required": [ + "kind" + ] + }, + "ExceptionPolicy": { + "type": "object", + "description": "A policy that defines actions to execute when exception are triggered.", + "properties": { + "id": { + "type": "string", + "description": "The Id of the exception policy", + "readOnly": true + }, + "name": { + "type": "string", + "description": "(Optional) The name of the exception policy." + }, + "exceptionRules": { + "type": "object", + "description": "(Optional) A dictionary collection of exception rules on the exception policy.\nKey is the Id of each exception rule.", + "additionalProperties": { + "$ref": "#/definitions/ExceptionRule" + } + } + } + }, + "ExceptionPolicyItem": { + "type": "object", + "description": "Paged instance of ExceptionPolicy", + "properties": { + "exceptionPolicy": { + "$ref": "#/definitions/ExceptionPolicy", + "description": "A policy that defines actions to execute when exception are triggered." + }, + "etag": { + "type": "string", + "description": "(Optional) The Concurrency Token." + } + } + }, + "ExceptionRule": { + "type": "object", + "description": "A rule that defines actions to execute upon a specific trigger.", + "properties": { + "trigger": { + "$ref": "#/definitions/ExceptionTrigger", + "description": "The trigger for this exception rule" + }, + "actions": { + "type": "object", + "description": "A dictionary collection of actions to perform once the exception is triggered.\nKey is the Id of each exception action.", + "additionalProperties": { + "$ref": "#/definitions/ExceptionAction" + } + } + }, + "required": [ + "trigger", + "actions" + ] + }, + "ExceptionTrigger": { + "type": "object", + "description": "The trigger for this exception rule", + "properties": { + "kind": { + "type": "string", + "description": "Discriminator property for ExceptionTrigger." + } + }, + "discriminator": "kind", + "required": [ + "kind" + ] + }, + "ExpressionRouterRule": { + "type": "object", + "description": "A rule providing inline expression rules.", + "properties": { + "language": { + "$ref": "#/definitions/ExpressionRouterRuleLanguage", + "description": "The expression language to compile to and execute" + }, + "expression": { + "type": "string", + "description": "The string containing the expression to evaluate. Should contain return\nstatement with calculated values." + } + }, + "required": [ + "expression" + ], + "allOf": [ + { + "$ref": "#/definitions/RouterRule" + } + ], + "x-ms-discriminator-value": "expression-rule" + }, + "ExpressionRouterRuleLanguage": { + "type": "string", + "description": "The available expression languages that can be configured", + "enum": [ + "powerFx" + ], + "x-ms-enum": { + "name": "ExpressionRouterRuleLanguage", + "modelAsString": true, + "values": [ + { + "name": "powerFx", + "value": "powerFx", + "description": "PowerFx" + } + ] + } + }, + "FunctionRouterRule": { + "type": "object", + "description": "A rule providing a binding to an HTTP Triggered Azure Function.", + "properties": { + "functionUri": { + "type": "string", + "description": "URL for Azure Function" + }, + "credential": { + "$ref": "#/definitions/FunctionRouterRuleCredential", + "description": "Credentials used to access Azure function rule" + } + }, + "required": [ + "functionUri" + ], + "allOf": [ + { + "$ref": "#/definitions/RouterRule" + } + ], + "x-ms-discriminator-value": "azure-function-rule" + }, + "FunctionRouterRuleCredential": { + "type": "object", + "description": "Credentials used to access Azure function rule", + "properties": { + "functionKey": { + "type": "string", + "description": "(Optional) Access key scoped to a particular function" + }, + "appKey": { + "type": "string", + "description": "(Optional) Access key scoped to a Azure Function app.\nThis key grants access to\nall functions under the app." + }, + "clientId": { + "type": "string", + "description": "(Optional) Client id, when AppKey is provided\nIn context of Azure function,\nthis is usually the name of the key" + } + } + }, + "JobMatchModeType": { + "type": "string", + "description": "Discriminator values for supported matching mode types.", + "enum": [ + "queueAndMatchMode", + "scheduleAndSuspendMode", + "suspendMode" + ], + "x-ms-enum": { + "name": "JobMatchModeType", + "modelAsString": true, + "values": [ + { + "name": "queueAndMatchMode", + "value": "queueAndMatchMode", + "description": "Discriminator used when matching worker to a job is required to be done right after job is queued." + }, + { + "name": "scheduleAndSuspendMode", + "value": "scheduleAndSuspendMode", + "description": "Discriminator used for scheduling jobs to be queued at a future time." + }, + { + "name": "suspendMode", + "value": "suspendMode", + "description": "Discriminator used when matching workers to a job needs to be suspended." + } + ] + } + }, + "JobMatchingMode": { + "type": "object", + "description": "The matching mode to be applied to this job.\n \nSupported types:\n \n \nQueueAndMatchMode: Used when matching worker to a job is required to be\ndone right after job is queued.\nScheduleAndSuspendMode: Used for scheduling\njobs to be queued at a future time. At specified time, matching of a worker to\nthe job will not start automatically.\nSuspendMode: Used when matching workers\nto a job needs to be suspended.", + "properties": { + "modeType": { + "$ref": "#/definitions/JobMatchModeType", + "description": "Discriminator value used to differentiate between supported matching mode types." + }, + "queueAndMatchMode": { + "type": "object", + "description": "Describes a matching mode where matching worker to a job is automatically\nstarted after job is queued successfully.", + "properties": {} + }, + "scheduleAndSuspendMode": { + "$ref": "#/definitions/ScheduleAndSuspendMode", + "description": "Describes a matching mode used for scheduling jobs to be queued at a future\ntime.\nAt the specified time, matching worker to a job will not start\nautomatically." + }, + "suspendMode": { + "type": "object", + "description": "Describes a matching mode where matching worker to a job is suspended.", + "properties": {} + } + } + }, + "LabelOperator": { + "type": "string", + "description": "Describes supported operations on label values.", + "enum": [ + "equal", + "notEqual", + "lessThan", + "lessThanEqual", + "greaterThan", + "greaterThanEqual" + ], + "x-ms-enum": { + "name": "LabelOperator", + "modelAsString": true, + "values": [ + { + "name": "equal", + "value": "equal", + "description": "Equal" + }, + { + "name": "notEqual", + "value": "notEqual", + "description": "Not Equal" + }, + { + "name": "lessThan", + "value": "lessThan", + "description": "Less than" + }, + { + "name": "lessThanEqual", + "value": "lessThanEqual", + "description": "Less than or equal" + }, + { + "name": "greaterThan", + "value": "greaterThan", + "description": "Greater than" + }, + { + "name": "greaterThanEqual", + "value": "greaterThanEqual", + "description": "Greater than or equal" + } + ] + } + }, + "LongestIdleMode": { + "type": "object", + "description": "Jobs are directed to the worker who has been idle longest.", + "properties": {}, + "allOf": [ + { + "$ref": "#/definitions/DistributionMode" + } + ], + "x-ms-discriminator-value": "longest-idle" + }, + "ManualReclassifyExceptionAction": { + "type": "object", + "description": "An action that manually reclassifies a job by providing the queue, priority and\nworker selectors.", + "properties": { + "queueId": { + "type": "string", + "description": "Updated QueueId." + }, + "priority": { + "type": "integer", + "format": "int32", + "description": "Updated Priority." + }, + "workerSelectors": { + "type": "array", + "description": "Updated WorkerSelectors.", + "items": { + "$ref": "#/definitions/RouterWorkerSelector" + }, + "x-ms-identifiers": [] + } + }, + "allOf": [ + { + "$ref": "#/definitions/ExceptionAction" + } + ], + "x-ms-discriminator-value": "manual-reclassify" + }, + "Oauth2ClientCredential": { + "type": "object", + "description": "OAuth2.0 Credentials used to Contoso's Authorization server.\nReference:\nhttps://www.oauth.com/oauth2-servers/access-tokens/client-credentials/", + "properties": { + "clientId": { + "type": "string", + "description": "ClientId for Contoso Authorization server." + }, + "clientSecret": { + "type": "string", + "description": "Client secret for Contoso Authorization server." + } + } + }, + "PagedClassificationPolicyItem": { + "type": "object", + "description": "A paged collection of classification policies.", + "properties": { + "value": { + "type": "array", + "description": "The ClassificationPolicyItem items on this page", + "items": { + "$ref": "#/definitions/ClassificationPolicyItem" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PagedDistributionPolicyItem": { + "type": "object", + "description": "A paged collection of distribution policies.", + "properties": { + "value": { + "type": "array", + "description": "The DistributionPolicyItem items on this page", + "items": { + "$ref": "#/definitions/DistributionPolicyItem" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PagedExceptionPolicyItem": { + "type": "object", + "description": "A paged collection of exception policies.", + "properties": { + "value": { + "type": "array", + "description": "The ExceptionPolicyItem items on this page", + "items": { + "$ref": "#/definitions/ExceptionPolicyItem" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PagedRouterJobItem": { + "type": "object", + "description": "A paged collection of jobs.", + "properties": { + "value": { + "type": "array", + "description": "The RouterJobItem items on this page", + "items": { + "$ref": "#/definitions/RouterJobItem" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PagedRouterQueueItem": { + "type": "object", + "description": "A paged collection of queues.", + "properties": { + "value": { + "type": "array", + "description": "The RouterQueueItem items on this page", + "items": { + "$ref": "#/definitions/RouterQueueItem" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PagedRouterWorkerItem": { + "type": "object", + "description": "A paged collection of workers.", + "properties": { + "value": { + "type": "array", + "description": "The RouterWorkerItem items on this page", + "items": { + "$ref": "#/definitions/RouterWorkerItem" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PassThroughQueueSelectorAttachment": { + "type": "object", + "description": "Attaches a queue selector where the value is passed through from the job label\nwith the same key", + "properties": { + "key": { + "type": "string", + "description": "The label key to query against" + }, + "labelOperator": { + "$ref": "#/definitions/LabelOperator", + "description": "Describes how the value of the label is compared to the value pass through" + } + }, + "required": [ + "key", + "labelOperator" + ], + "allOf": [ + { + "$ref": "#/definitions/QueueSelectorAttachment" + } + ], + "x-ms-discriminator-value": "pass-through" + }, + "PassThroughWorkerSelectorAttachment": { + "type": "object", + "description": "Attaches a worker selector where the value is passed through from the job label\nwith the same key", + "properties": { + "key": { + "type": "string", + "description": "The label key to query against" + }, + "labelOperator": { + "$ref": "#/definitions/LabelOperator", + "description": "Describes how the value of the label is compared to the value pass through" + }, + "expiresAfterSeconds": { + "type": "number", + "format": "float", + "description": "Describes how long the attached label selector is valid in seconds." + } + }, + "required": [ + "key", + "labelOperator" + ], + "allOf": [ + { + "$ref": "#/definitions/WorkerSelectorAttachment" + } + ], + "x-ms-discriminator-value": "pass-through" + }, + "QueueLengthExceptionTrigger": { + "type": "object", + "description": "Trigger for an exception action on exceeding queue length", + "properties": { + "threshold": { + "type": "integer", + "format": "int32", + "description": "Threshold of number of jobs ahead in the queue to for this trigger to fire." + } + }, + "required": [ + "threshold" + ], + "allOf": [ + { + "$ref": "#/definitions/ExceptionTrigger" + } + ], + "x-ms-discriminator-value": "queue-length" + }, + "QueueSelectorAttachment": { + "type": "object", + "description": "An attachment of queue selectors to resolve a queue to a job from a\nclassification policy", + "properties": { + "kind": { + "type": "string", + "description": "Discriminator property for QueueSelectorAttachment." + } + }, + "discriminator": "kind", + "required": [ + "kind" + ] + }, + "QueueWeightedAllocation": { + "type": "object", + "description": "Contains the weight percentage and queue selectors to be applied if selected\nfor weighted distributions.", + "properties": { + "weight": { + "type": "number", + "format": "float", + "description": "The percentage of this weight, expressed as a fraction of 1." + }, + "queueSelectors": { + "type": "array", + "description": "A collection of queue selectors that will be applied if this allocation is\nselected.", + "items": { + "$ref": "#/definitions/RouterQueueSelector" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "weight", + "queueSelectors" + ] + }, + "ReclassifyExceptionAction": { + "type": "object", + "description": "An action that modifies labels on a job and then reclassifies it", + "properties": { + "classificationPolicyId": { + "type": "string", + "description": "(optional) The new classification policy that will determine queue, priority\nand worker selectors." + }, + "labelsToUpsert": { + "type": "object", + "description": "(optional) Dictionary containing the labels to update (or add if not existing)\nin key-value pairs", + "additionalProperties": true + } + }, + "allOf": [ + { + "$ref": "#/definitions/ExceptionAction" + } + ], + "x-ms-discriminator-value": "reclassify" + }, + "RoundRobinMode": { + "type": "object", + "description": "Jobs are distributed in order to workers, starting with the worker that is\nafter the last worker to receive a job.", + "properties": {}, + "allOf": [ + { + "$ref": "#/definitions/DistributionMode" + } + ], + "x-ms-discriminator-value": "round-robin" + }, + "RouterJob": { + "type": "object", + "description": "A unit of work to be routed", + "properties": { + "id": { + "type": "string", + "description": "The id of the job.", + "readOnly": true + }, + "channelReference": { + "type": "string", + "description": "Reference to an external parent context, eg. call ID." + }, + "status": { + "$ref": "#/definitions/RouterJobStatus", + "description": "The status of the Job.", + "readOnly": true + }, + "enqueuedAt": { + "type": "string", + "format": "date-time", + "description": "The time a job was queued in UTC.", + "readOnly": true + }, + "channelId": { + "type": "string", + "description": "The channel identifier. eg. voice, chat, etc." + }, + "classificationPolicyId": { + "type": "string", + "description": "The Id of the Classification policy used for classifying a job." + }, + "queueId": { + "type": "string", + "description": "The Id of the Queue that this job is queued to." + }, + "priority": { + "type": "integer", + "format": "int32", + "description": "The priority of this job." + }, + "dispositionCode": { + "type": "string", + "description": "Reason code for cancelled or closed jobs." + }, + "requestedWorkerSelectors": { + "type": "array", + "description": "A collection of manually specified label selectors, which a worker must satisfy\nin order to process this job.", + "items": { + "$ref": "#/definitions/RouterWorkerSelector" + }, + "x-ms-identifiers": [] + }, + "attachedWorkerSelectors": { + "type": "array", + "description": "A collection of label selectors attached by a classification policy, which a\nworker must satisfy in order to process this job.", + "items": { + "$ref": "#/definitions/RouterWorkerSelector" + }, + "readOnly": true, + "x-ms-identifiers": [] + }, + "labels": { + "type": "object", + "description": "A set of key/value pairs that are identifying attributes used by the rules\nengines to make decisions.", + "additionalProperties": true + }, + "assignments": { + "type": "object", + "description": "A collection of the assignments of the job.\nKey is AssignmentId.", + "additionalProperties": { + "$ref": "#/definitions/RouterJobAssignment" + }, + "readOnly": true + }, + "tags": { + "type": "object", + "description": "A set of non-identifying attributes attached to this job", + "additionalProperties": true + }, + "notes": { + "type": "object", + "description": "Notes attached to a job, sorted by timestamp", + "additionalProperties": { + "type": "string" + } + }, + "scheduledAt": { + "type": "string", + "format": "date-time", + "description": "If set, job will be scheduled to be enqueued at a given time", + "readOnly": true + }, + "matchingMode": { + "$ref": "#/definitions/JobMatchingMode", + "description": "The matching mode to be applied to this job.\n \nSupported types:\n \n \nQueueAndMatchMode: Used when matching worker to a job is required to be\ndone right after job is queued.\nScheduleAndSuspendMode: Used for scheduling\njobs to be queued at a future time. At specified time, matching of a worker to\nthe job will not start automatically.\nSuspendMode: Used when matching workers\nto a job needs to be suspended." + } + } + }, + "RouterJobAssignment": { + "type": "object", + "description": "Assignment details of a job to a worker", + "properties": { + "assignmentId": { + "type": "string", + "description": "The Id of the job assignment." + }, + "workerId": { + "type": "string", + "description": "The Id of the Worker assigned to the job." + }, + "assignedAt": { + "type": "string", + "format": "date-time", + "description": "The assignment time of the job in UTC." + }, + "completedAt": { + "type": "string", + "format": "date-time", + "description": "The time the job was marked as completed after being assigned in UTC." + }, + "closedAt": { + "type": "string", + "format": "date-time", + "description": "The time the job was marked as closed after being completed in UTC." + } + }, + "required": [ + "assignmentId", + "assignedAt" + ] + }, + "RouterJobItem": { + "type": "object", + "description": "Paged instance of RouterJob", + "properties": { + "job": { + "$ref": "#/definitions/RouterJob", + "description": "A unit of work to be routed" + }, + "etag": { + "type": "string", + "description": "(Optional) The Concurrency Token." + } + } + }, + "RouterJobOffer": { + "type": "object", + "description": "An offer of a job to a worker", + "properties": { + "offerId": { + "type": "string", + "description": "The Id of the offer." + }, + "jobId": { + "type": "string", + "description": "The Id of the job." + }, + "capacityCost": { + "type": "integer", + "format": "int32", + "description": "The capacity cost consumed by the job offer." + }, + "offeredAt": { + "type": "string", + "format": "date-time", + "description": "The time the offer was created in UTC." + }, + "expiresAt": { + "type": "string", + "format": "date-time", + "description": "The time that the offer will expire in UTC." + } + }, + "required": [ + "offerId", + "jobId", + "capacityCost" + ] + }, + "RouterJobPositionDetails": { + "type": "object", + "description": "Position and estimated wait time for a job.", + "properties": { + "jobId": { + "type": "string", + "description": "Id of the job these details are about." + }, + "position": { + "type": "integer", + "format": "int32", + "description": "Position of the job in question within that queue." + }, + "queueId": { + "type": "string", + "description": "Id of the queue this job is enqueued in." + }, + "queueLength": { + "type": "integer", + "format": "int32", + "description": "Length of the queue: total number of enqueued jobs." + }, + "estimatedWaitTimeMinutes": { + "type": "number", + "format": "float", + "description": "Estimated wait time of the job rounded up to the nearest minute" + } + }, + "required": [ + "jobId", + "position", + "queueId", + "queueLength", + "estimatedWaitTimeMinutes" + ] + }, + "RouterJobStatus": { + "type": "string", + "description": "The status of the Job.", + "enum": [ + "pendingClassification", + "queued", + "assigned", + "completed", + "closed", + "cancelled", + "classificationFailed", + "created", + "pendingSchedule", + "scheduled", + "scheduleFailed", + "waitingForActivation" + ], + "x-ms-enum": { + "name": "RouterJobStatus", + "modelAsString": true, + "values": [ + { + "name": "pendingClassification", + "value": "pendingClassification", + "description": "Job is waiting to be classified." + }, + { + "name": "queued", + "value": "queued", + "description": "Job has been queued." + }, + { + "name": "assigned", + "value": "assigned", + "description": "Job has been assigned to a worker." + }, + { + "name": "completed", + "value": "completed", + "description": "Job has been completed by a worker." + }, + { + "name": "closed", + "value": "closed", + "description": "Job has been closed by a worker." + }, + { + "name": "cancelled", + "value": "cancelled", + "description": "Job has been cancelled." + }, + { + "name": "classificationFailed", + "value": "classificationFailed", + "description": "Classification process failed for the job." + }, + { + "name": "created", + "value": "created", + "description": "Job has been created." + }, + { + "name": "pendingSchedule", + "value": "pendingSchedule", + "description": "Job has been created but not been scheduled yet." + }, + { + "name": "scheduled", + "value": "scheduled", + "description": "Job has been scheduled successfully." + }, + { + "name": "scheduleFailed", + "value": "scheduleFailed", + "description": "Job scheduling failed." + }, + { + "name": "waitingForActivation", + "value": "waitingForActivation", + "description": "Job is in a suspended state and waiting for an update." + } + ] + } + }, + "RouterQueue": { + "type": "object", + "description": "A queue that can contain jobs to be routed.", + "properties": { + "id": { + "type": "string", + "description": "The Id of this queue", + "readOnly": true + }, + "name": { + "type": "string", + "description": "The name of this queue." + }, + "distributionPolicyId": { + "type": "string", + "description": "The ID of the distribution policy that will determine how a job is distributed\nto workers." + }, + "labels": { + "type": "object", + "description": "A set of key/value pairs that are identifying attributes used by the rules\nengines to make decisions.", + "additionalProperties": true + }, + "exceptionPolicyId": { + "type": "string", + "description": "(Optional) The ID of the exception policy that determines various job\nescalation rules." + } + } + }, + "RouterQueueItem": { + "type": "object", + "description": "Paged instance of RouterQueue", + "properties": { + "queue": { + "$ref": "#/definitions/RouterQueue", + "description": "A queue that can contain jobs to be routed." + }, + "etag": { + "type": "string", + "description": "(Optional) The Concurrency Token." + } + } + }, + "RouterQueueSelector": { + "type": "object", + "description": "Describes a condition that must be met against a set of labels for queue\nselection", + "properties": { + "key": { + "type": "string", + "description": "The label key to query against" + }, + "labelOperator": { + "$ref": "#/definitions/LabelOperator", + "description": "Describes how the value of the label is compared to the value defined on the\nlabel selector" + }, + "value": { + "description": "The value to compare against the actual label value with the given operator" + } + }, + "required": [ + "key", + "labelOperator" + ] + }, + "RouterQueueStatistics": { + "type": "object", + "description": "Statistics for the queue", + "properties": { + "queueId": { + "type": "string", + "description": "Id of the queue these details are about." + }, + "length": { + "type": "integer", + "format": "int32", + "description": "Length of the queue: total number of enqueued jobs." + }, + "estimatedWaitTimeMinutes": { + "type": "object", + "description": "The estimated wait time of this queue rounded up to the nearest minute, grouped\nby job priority", + "additionalProperties": { + "format": "float", + "type": "number" + } + }, + "longestJobWaitTimeMinutes": { + "type": "number", + "format": "float", + "description": "The wait time of the job that has been enqueued in this queue for the longest." + } + }, + "required": [ + "queueId", + "length" + ] + }, + "RouterRule": { + "type": "object", + "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nAzureFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol.", + "properties": { + "kind": { + "type": "string", + "description": "Discriminator property for RouterRule." + } + }, + "discriminator": "kind", + "required": [ + "kind" + ] + }, + "RouterWorker": { + "type": "object", + "description": "An entity for jobs to be routed to", + "properties": { + "id": { + "type": "string", + "description": "Id of the worker.", + "readOnly": true + }, + "state": { + "$ref": "#/definitions/RouterWorkerState", + "description": "The current state of the worker.", + "readOnly": true + }, + "queueAssignments": { + "type": "object", + "description": "The queue(s) that this worker can receive work from.", + "additionalProperties": true + }, + "totalCapacity": { + "type": "integer", + "format": "int32", + "description": "The total capacity score this worker has to manage multiple concurrent jobs." + }, + "labels": { + "type": "object", + "description": "A set of key/value pairs that are identifying attributes used by the rules\nengines to make decisions.", + "additionalProperties": true + }, + "tags": { + "type": "object", + "description": "A set of non-identifying attributes attached to this worker.", + "additionalProperties": true + }, + "channelConfigurations": { + "type": "object", + "description": "The channel(s) this worker can handle and their impact on the workers capacity.", + "additionalProperties": { + "$ref": "#/definitions/ChannelConfiguration" + } + }, + "offers": { + "type": "array", + "description": "A list of active offers issued to this worker.", + "items": { + "$ref": "#/definitions/RouterJobOffer" + }, + "readOnly": true, + "x-ms-identifiers": [] + }, + "assignedJobs": { + "type": "array", + "description": "A list of assigned jobs attached to this worker.", + "items": { + "$ref": "#/definitions/RouterWorkerAssignment" + }, + "readOnly": true, + "x-ms-identifiers": [] + }, + "loadRatio": { + "type": "number", + "format": "float", + "description": "A value indicating the workers capacity. A value of '1' means all capacity is\nconsumed. A value of '0' means no capacity is currently consumed.", + "readOnly": true + }, + "availableForOffers": { + "type": "boolean", + "description": "A flag indicating this worker is open to receive offers or not." + } + } + }, + "RouterWorkerAssignment": { + "type": "object", + "description": "The assignment for a worker to a job", + "properties": { + "assignmentId": { + "type": "string", + "description": "The Id of the assignment." + }, + "jobId": { + "type": "string", + "description": "The Id of the Job assigned." + }, + "capacityCost": { + "type": "integer", + "format": "int32", + "description": "The amount of capacity this assignment has consumed on the worker." + }, + "assignedAt": { + "type": "string", + "format": "date-time", + "description": "The assignment time of the job in UTC." + } + }, + "required": [ + "assignmentId", + "jobId", + "capacityCost", + "assignedAt" + ] + }, + "RouterWorkerItem": { + "type": "object", + "description": "Paged instance of RouterWorker", + "properties": { + "worker": { + "$ref": "#/definitions/RouterWorker", + "description": "An entity for jobs to be routed to" + }, + "etag": { + "type": "string", + "description": "(Optional) The Concurrency Token." + } + } + }, + "RouterWorkerSelector": { + "type": "object", + "description": "Describes a condition that must be met against a set of labels for worker\nselection", + "properties": { + "key": { + "type": "string", + "description": "The label key to query against" + }, + "labelOperator": { + "$ref": "#/definitions/LabelOperator", + "description": "Describes how the value of the label is compared to the value defined on the\nlabel selector" + }, + "value": { + "description": "The value to compare against the actual label value with the given operator" + }, + "expiresAfterSeconds": { + "type": "number", + "format": "float", + "description": "Describes how long this label selector is valid in seconds." + }, + "expedite": { + "type": "boolean", + "description": "Pushes the job to the front of the queue as long as this selector is active." + }, + "status": { + "$ref": "#/definitions/RouterWorkerSelectorStatus", + "description": "The status of the worker selector.", + "readOnly": true + }, + "expiresAt": { + "type": "string", + "format": "date-time", + "description": "The time at which this worker selector expires in UTC", + "readOnly": true + } + }, + "required": [ + "key", + "labelOperator" + ] + }, + "RouterWorkerSelectorStatus": { + "type": "string", + "description": "The status of the worker selector.", + "enum": [ + "active", + "expired" + ], + "x-ms-enum": { + "name": "RouterWorkerSelectorStatus", + "modelAsString": true, + "values": [ + { + "name": "active", + "value": "active", + "description": "Active" + }, + { + "name": "expired", + "value": "expired", + "description": "Expired" + } + ] + } + }, + "RouterWorkerState": { + "type": "string", + "description": "Enums for worker status", + "enum": [ + "active", + "draining", + "inactive" + ], + "x-ms-enum": { + "name": "RouterWorkerState", + "modelAsString": true, + "values": [ + { + "name": "active", + "value": "active", + "description": "Worker is active and available to take offers." + }, + { + "name": "draining", + "value": "draining", + "description": "Worker is not active, if there are existing offers they are being revoked. No new offers are sent." + }, + { + "name": "inactive", + "value": "inactive", + "description": "Worker is not active. No new offers are sent." + } + ] + } + }, + "RuleEngineQueueSelectorAttachment": { + "type": "object", + "description": "Attaches queue selectors to a job when the RouterRule is resolved", + "properties": { + "rule": { + "$ref": "#/definitions/RouterRule", + "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nAzureFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol." + } + }, + "required": [ + "rule" + ], + "allOf": [ + { + "$ref": "#/definitions/QueueSelectorAttachment" + } + ], + "x-ms-discriminator-value": "rule-engine" + }, + "RuleEngineWorkerSelectorAttachment": { + "type": "object", + "description": "Attaches worker selectors to a job when a RouterRule is resolved", + "properties": { + "rule": { + "$ref": "#/definitions/RouterRule", + "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nAzureFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol." + } + }, + "required": [ + "rule" + ], + "allOf": [ + { + "$ref": "#/definitions/WorkerSelectorAttachment" + } + ], + "x-ms-discriminator-value": "rule-engine" + }, + "ScheduleAndSuspendMode": { + "type": "object", + "description": "Describes a matching mode used for scheduling jobs to be queued at a future\ntime.\nAt the specified time, matching worker to a job will not start\nautomatically.", + "properties": { + "scheduleAt": { + "type": "string", + "format": "date-time", + "description": "Scheduled time." + } + } + }, + "ScoringRuleOptions": { + "type": "object", + "description": "Encapsulates all options that can be passed as parameters for scoring rule with\nBestWorkerMode", + "properties": { + "batchSize": { + "type": "integer", + "format": "int32", + "description": "(Optional) Set batch size when AllowScoringBatchOfWorkers is set to true.\nDefaults to 20 if not configured." + }, + "scoringParameters": { + "type": "array", + "description": "(Optional) List of extra parameters from the job that will be sent as part of\nthe payload to scoring rule.\nIf not set, the job's labels (sent in the payload\nas `job`) and the job's worker selectors (sent in the payload as\n`selectors`)\nare added to the payload of the scoring rule by default.\nNote:\nWorker labels are always sent with scoring payload.", + "items": { + "$ref": "#/definitions/ScoringRuleParameterSelector" + } + }, + "allowScoringBatchOfWorkers": { + "type": "boolean", + "description": "(Optional)\nIf set to true, will score workers in batches, and the parameter\nname of the worker labels will be sent as `workers`.\nBy default, set to false\nand the parameter name for the worker labels will be sent as `worker`.\nNote: If\nenabled, use BatchSize to set batch size." + }, + "descendingOrder": { + "type": "boolean", + "description": "(Optional)\nIf false, will sort scores by ascending order. By default, set to\ntrue." + } + } + }, + "ScoringRuleParameterSelector": { + "type": "string", + "description": "Supported parameters for scoring workers", + "enum": [ + "jobLabels", + "workerSelectors" + ], + "x-ms-enum": { + "name": "ScoringRuleParameterSelector", + "modelAsString": true, + "values": [ + { + "name": "jobLabels", + "value": "jobLabels", + "description": "Parameter to add job labels to scoring payload. Property is sent as `job`." + }, + { + "name": "workerSelectors", + "value": "workerSelectors", + "description": "Parameter to add worker selectors from the job to scoring payload. Property is sent as `selectors`." + } + ] + } + }, + "StaticQueueSelectorAttachment": { + "type": "object", + "description": "Describes a queue selector that will be attached to the job", + "properties": { + "queueSelector": { + "$ref": "#/definitions/RouterQueueSelector", + "description": "Describes a condition that must be met against a set of labels for queue\nselection" + } + }, + "required": [ + "queueSelector" + ], + "allOf": [ + { + "$ref": "#/definitions/QueueSelectorAttachment" + } + ], + "x-ms-discriminator-value": "static" + }, + "StaticRouterRule": { + "type": "object", + "description": "A rule providing static rules that always return the same result, regardless of\ninput.", + "properties": { + "value": { + "description": "The static value this rule always returns." + } + }, + "allOf": [ + { + "$ref": "#/definitions/RouterRule" + } + ], + "x-ms-discriminator-value": "static-rule" + }, + "StaticWorkerSelectorAttachment": { + "type": "object", + "description": "Describes a worker selector that will be attached to the job", + "properties": { + "workerSelector": { + "$ref": "#/definitions/RouterWorkerSelector", + "description": "Describes a condition that must be met against a set of labels for worker\nselection" + } + }, + "required": [ + "workerSelector" + ], + "allOf": [ + { + "$ref": "#/definitions/WorkerSelectorAttachment" + } + ], + "x-ms-discriminator-value": "static" + }, + "UnassignJobRequest": { + "type": "object", + "description": "Request payload for unassigning a job.", + "properties": { + "suspendMatching": { + "type": "boolean", + "description": "If SuspendMatching is true, then the job is not queued for re-matching with a\nworker." + } + } + }, + "UnassignJobResult": { + "type": "object", + "description": "Response payload after a job has been successfully unassigned.", + "properties": { + "jobId": { + "type": "string", + "description": "The Id of the job unassigned." + }, + "unassignmentCount": { + "type": "integer", + "format": "int32", + "description": "The number of times a job is unassigned. At a maximum 3." + } + }, + "required": [ + "jobId", + "unassignmentCount" + ] + }, + "WaitTimeExceptionTrigger": { + "type": "object", + "description": "Trigger for an exception action on exceeding wait time", + "properties": { + "thresholdSeconds": { + "type": "number", + "format": "float", + "description": "Threshold for wait time for this trigger." + } + }, + "required": [ + "thresholdSeconds" + ], + "allOf": [ + { + "$ref": "#/definitions/ExceptionTrigger" + } + ], + "x-ms-discriminator-value": "wait-time" + }, + "WebhookRouterRule": { + "type": "object", + "description": "A rule providing a binding to an external web server.", + "properties": { + "authorizationServerUri": { + "type": "string", + "description": "Uri for Authorization Server." + }, + "clientCredential": { + "$ref": "#/definitions/Oauth2ClientCredential", + "description": "OAuth2.0 Credentials used to Contoso's Authorization server.\nReference:\nhttps://www.oauth.com/oauth2-servers/access-tokens/client-credentials/" + }, + "webhookUri": { + "type": "string", + "description": "Uri for Contoso's Web Server." + } + }, + "allOf": [ + { + "$ref": "#/definitions/RouterRule" + } + ], + "x-ms-discriminator-value": "webhook-rule" + }, + "WeightedAllocationQueueSelectorAttachment": { + "type": "object", + "description": "Describes multiple sets of queue selectors, of which one will be selected and\nattached according to a weighting", + "properties": { + "allocations": { + "type": "array", + "description": "A collection of percentage based weighted allocations.", + "items": { + "$ref": "#/definitions/QueueWeightedAllocation" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "allocations" + ], + "allOf": [ + { + "$ref": "#/definitions/QueueSelectorAttachment" + } + ], + "x-ms-discriminator-value": "weighted-allocation-queue-selector" + }, + "WeightedAllocationWorkerSelectorAttachment": { + "type": "object", + "description": "Describes multiple sets of worker selectors, of which one will be selected and\nattached according to a weighting", + "properties": { + "allocations": { + "type": "array", + "description": "A collection of percentage based weighted allocations.", + "items": { + "$ref": "#/definitions/WorkerWeightedAllocation" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "allocations" + ], + "allOf": [ + { + "$ref": "#/definitions/WorkerSelectorAttachment" + } + ], + "x-ms-discriminator-value": "weighted-allocation-worker-selector" + }, + "WorkerSelectorAttachment": { + "type": "object", + "description": "An attachment which attaches worker selectors to a job", + "properties": { + "kind": { + "type": "string", + "description": "Discriminator property for WorkerSelectorAttachment." + } + }, + "discriminator": "kind", + "required": [ + "kind" + ] + }, + "WorkerWeightedAllocation": { + "type": "object", + "description": "Contains the weight percentage and worker selectors to be applied if selected\nfor weighted distributions.", + "properties": { + "weight": { + "type": "number", + "format": "float", + "description": "The percentage of this weight, expressed as a fraction of 1." + }, + "workerSelectors": { + "type": "array", + "description": "A collection of worker selectors that will be applied if this allocation is\nselected.", + "items": { + "$ref": "#/definitions/RouterWorkerSelector" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "weight", + "workerSelectors" + ] + } + }, + "parameters": { + "Azure.Core.Foundations.ApiVersionParameter": { + "name": "api-version", + "in": "query", + "description": "The API version to use for this operation.", + "required": true, + "type": "string", + "minLength": 1, + "x-ms-parameter-location": "method", + "x-ms-client-name": "apiVersion" + } + } +} From 2775145e38eab66a51d6428172cd9ca209a543d9 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 12 Sep 2023 10:50:13 -0700 Subject: [PATCH 002/113] add x-ms-example --- .../communication/JobRouter/models.tsp | 29 ------------------- .../communication/JobRouter/routes.tsp | 2 ++ .../communication/JobRouter/tspconfig.yaml | 7 +++-- .../communicationservicejobrouter.json | 5 ++++ 4 files changed, 11 insertions(+), 32 deletions(-) diff --git a/specification/communication/JobRouter/models.tsp b/specification/communication/JobRouter/models.tsp index 848646be9e7f..adba66947126 100644 --- a/specification/communication/JobRouter/models.tsp +++ b/specification/communication/JobRouter/models.tsp @@ -235,35 +235,6 @@ OAuth2.0 authentication protocol. @discriminator("kind") model RouterRule {} -@doc("The Communication Services error.") -@error -model CommunicationErrorResponse { - @doc("The Communication Services error.") - error: CommunicationError; -} - -@doc("The Communication Services error.") -model CommunicationError { - @doc("The error code.") - code: string; - - @doc("The error message.") - message: string; - - @doc("The error target.") - @visibility("read") - target?: string; - - @doc("Further details about specific errors that led to this error.") - @visibility("read") - details?: CommunicationError[]; - - @doc("The inner error if any.") - @visibility("read") - @projectedName("json", "innererror") - innerError?: CommunicationError; -} - @doc("A paged collection of classification policies.") model ClassificationPolicyCollection is Azure.Core.Page; diff --git a/specification/communication/JobRouter/routes.tsp b/specification/communication/JobRouter/routes.tsp index b9589c06cfd8..9e9f874ac365 100644 --- a/specification/communication/JobRouter/routes.tsp +++ b/specification/communication/JobRouter/routes.tsp @@ -4,6 +4,7 @@ import "./models.tsp"; using TypeSpec.Rest; using TypeSpec.Http; +using Autorest; namespace AzureCommunicationRoutingService; @@ -11,6 +12,7 @@ interface JobRouterAdministrationOperations { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Creates or updates a classification policy.") @doc("Creates or updates a classification policy.") + @example("./ClassificationPolicies_CreateClassificationPolicy.json", "upsertClassificationPolicy") @route("/routing/classificationPolicies/{id}") @patch upsertClassificationPolicy is Azure.Core.Foundations.Operation< diff --git a/specification/communication/JobRouter/tspconfig.yaml b/specification/communication/JobRouter/tspconfig.yaml index b14d76bafb8d..d4f16568f2c9 100644 --- a/specification/communication/JobRouter/tspconfig.yaml +++ b/specification/communication/JobRouter/tspconfig.yaml @@ -15,10 +15,11 @@ emit: [ options: "@azure-tools/typespec-autorest": - examples-directory: examples + azure-resource-provider-folder: "data-plane" + output-file: "{azure-resource-provider-folder}/JobRouter/{version-status}/{version}/communicationservicejobrouter.json" + emitter-output-dir: "{project-root}/.." omit-unreachable-types: true - output-file: communicationservicejobrouter.json - emitter-output-dir: "{project-root}/../data-plane/JobRouter/stable/2023-11-01" + examples-directory: "{project-root}/examples" "@azure-tools/typespec-csharp": clear-output-folder: true model-namespace: false diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index 5f04f356052f..485434f97ed3 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -164,6 +164,11 @@ } } } + }, + "x-ms-examples": { + "upsertClassificationPolicy": { + "$ref": "./ClassificationPolicies_CreateClassificationPolicy.json" + } } }, "delete": { From d0795809f82c5c7a2e1ca6f67550bbb81a8c7a7c Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 12 Sep 2023 15:28:27 -0700 Subject: [PATCH 003/113] change unknown to object --- .../communication/JobRouter/client.tsp | 64 +++++++++++++++++++ .../communication/JobRouter/models.tsp | 22 +++---- .../communication/JobRouter/tspconfig.yaml | 8 ++- .../communicationservicejobrouter.json | 47 +++++++++++--- 4 files changed, 118 insertions(+), 23 deletions(-) diff --git a/specification/communication/JobRouter/client.tsp b/specification/communication/JobRouter/client.tsp index 38019df13ed2..dd05266422d3 100644 --- a/specification/communication/JobRouter/client.tsp +++ b/specification/communication/JobRouter/client.tsp @@ -17,21 +17,52 @@ namespace ClientForAcsJobRouter; service: AzureCommunicationRoutingService }) interface JobRouterAdministrationClient { + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" upsertDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertDistributionPolicy; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" getDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getDistributionPolicy; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" listDistributionPolicies is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listDistributionPolicies; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" deleteDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteDistributionPolicy; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" upsertClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertClassificationPolicy; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" getClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getClassificationPolicy; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" listClassificationPolicies is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listClassificationPolicies; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" deleteClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteClassificationPolicy; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" upsertExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertExceptionPolicy; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" getExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getExceptionPolicy; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" listExceptionPolicies is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listExceptionPolicies; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" deleteExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteExceptionPolicy; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" upsertQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertQueue; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" getQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getQueue; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" listQueues is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listQueues; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" deleteQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteQueue; } @@ -40,21 +71,54 @@ interface JobRouterAdministrationClient { service: AzureCommunicationRoutingService }) interface JobRouterClient { + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" upsertJob is AzureCommunicationRoutingService.JobRouterOperations.upsertJob; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" getJob is AzureCommunicationRoutingService.JobRouterOperations.getJob; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" deleteJob is AzureCommunicationRoutingService.JobRouterOperations.deleteJob; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" reclassifyJob is AzureCommunicationRoutingService.JobRouterOperations.reclassifyJobAction; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" cancelJob is AzureCommunicationRoutingService.JobRouterOperations.cancelJobAction; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" completeJob is AzureCommunicationRoutingService.JobRouterOperations.completeJobAction; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" closeJob is AzureCommunicationRoutingService.JobRouterOperations.closeJobAction; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" listJobs is AzureCommunicationRoutingService.JobRouterOperations.listJobs; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" getQueuePosition is AzureCommunicationRoutingService.JobRouterOperations.getInQueuePosition; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" unassignJob is AzureCommunicationRoutingService.JobRouterOperations.unassignJobAction; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" acceptJob is AzureCommunicationRoutingService.JobRouterOperations.acceptJobAction; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" declineJob is AzureCommunicationRoutingService.JobRouterOperations.declineJobAction; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" getQueueStatistics is AzureCommunicationRoutingService.JobRouterOperations.getQueueStatistics; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" upsertWorker is AzureCommunicationRoutingService.JobRouterOperations.upsertWorker; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" getWorker is AzureCommunicationRoutingService.JobRouterOperations.getWorker; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" deleteWorker is AzureCommunicationRoutingService.JobRouterOperations.deleteWorker; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" listWorkers is AzureCommunicationRoutingService.JobRouterOperations.listWorkers; } \ No newline at end of file diff --git a/specification/communication/JobRouter/models.tsp b/specification/communication/JobRouter/models.tsp index adba66947126..179181f8e20b 100644 --- a/specification/communication/JobRouter/models.tsp +++ b/specification/communication/JobRouter/models.tsp @@ -395,7 +395,7 @@ worker must satisfy in order to process this job. A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. """) - labels?: Record; + labels?: Record<{}>; @doc(""" A collection of the assignments of the job. @@ -405,7 +405,7 @@ Key is AssignmentId. assignments?: Record; @doc("A set of non-identifying attributes attached to this job") - tags?: Record; + tags?: Record<{}>; @doc("Notes attached to a job, sorted by timestamp") notes?: Record; @@ -446,7 +446,7 @@ label selector labelOperator: LabelOperator; @doc("The value to compare against the actual label value with the given operator") - value?: unknown; + value?: {}; @doc("Describes how long this label selector is valid in seconds.") expiresAfterSeconds?: float32; @@ -685,7 +685,7 @@ to workers. A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. """) - labels?: Record; + labels?: Record<{}>; @doc(""" (Optional) The ID of the exception policy that determines various job @@ -733,9 +733,9 @@ model RouterWorker { @doc("The current state of the worker.") @visibility("read") state?: RouterWorkerState; - + @doc("The queue(s) that this worker can receive work from.") - queueAssignments?: Record; + queueAssignments?: Record<{}>; @doc("The total capacity score this worker has to manage multiple concurrent jobs.") totalCapacity?: int32; @@ -744,10 +744,10 @@ model RouterWorker { A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. """) - labels?: Record; + labels?: Record<{}>; @doc("A set of non-identifying attributes attached to this worker.") - tags?: Record; + tags?: Record<{}>; @doc("The channel(s) this worker can handle and their impact on the workers capacity.") channelConfigurations?: Record; @@ -968,7 +968,7 @@ label selector labelOperator: LabelOperator; @doc("The value to compare against the actual label value with the given operator") - value?: unknown; + value?: {}; } @doc(""" @@ -1170,7 +1170,7 @@ and worker selectors. (optional) Dictionary containing the labels to update (or add if not existing) in key-value pairs """) - labelsToUpsert?: Record; + labelsToUpsert?: Record<{}>; @doc("The type discriminator describing a sub-type of ExceptionAction") kind: "reclassify"; @@ -1249,7 +1249,7 @@ input. """) model StaticRouterRule extends RouterRule { @doc("The static value this rule always returns.") - value?: unknown; + value?: {}; @doc("The type discriminator describing a sub-type of Rule") kind: "static-rule"; diff --git a/specification/communication/JobRouter/tspconfig.yaml b/specification/communication/JobRouter/tspconfig.yaml index d4f16568f2c9..64c0b9781138 100644 --- a/specification/communication/JobRouter/tspconfig.yaml +++ b/specification/communication/JobRouter/tspconfig.yaml @@ -6,11 +6,13 @@ parameters: "js-sdk-folder": default: "{project-root}/azure-sdk-for-js/" "csharp-sdk-folder": - default: "{project-root}/azure-sdk-for-csharp/" + default: "{project-root}/azure-sdk-for-net/" "service-directory-name": default: "communication" + "service-dir": + default: "sdk/communication" emit: [ - "@azure-tools/typespec-autorest", + "@azure-tools/typespec-autorest" ] options: @@ -25,6 +27,8 @@ options: model-namespace: false emitter-output-dir: "{csharp-sdk-folder}/sdk/{service-directory-name}/{namespace}/src" namespace: Azure.Communication.JobRouter + package-dir: "Azure.Communication.JobRouter" + save-inputs: true "@azure-tools/typespec-python": emitter-output-dir: "{python-sdk-folder}/sdk/{service-directory-name}/{package-name}" package-name: "azure-communication-jobrouter" diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index 485434f97ed3..45dcb4d10a92 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -2629,7 +2629,10 @@ "labelsToUpsert": { "type": "object", "description": "(optional) Dictionary containing the labels to update (or add if not existing)\nin key-value pairs", - "additionalProperties": true + "additionalProperties": { + "properties": {}, + "type": "object" + } } }, "allOf": [ @@ -2715,7 +2718,10 @@ "labels": { "type": "object", "description": "A set of key/value pairs that are identifying attributes used by the rules\nengines to make decisions.", - "additionalProperties": true + "additionalProperties": { + "properties": {}, + "type": "object" + } }, "assignments": { "type": "object", @@ -2728,7 +2734,10 @@ "tags": { "type": "object", "description": "A set of non-identifying attributes attached to this job", - "additionalProperties": true + "additionalProperties": { + "properties": {}, + "type": "object" + } }, "notes": { "type": "object", @@ -2970,7 +2979,10 @@ "labels": { "type": "object", "description": "A set of key/value pairs that are identifying attributes used by the rules\nengines to make decisions.", - "additionalProperties": true + "additionalProperties": { + "properties": {}, + "type": "object" + } }, "exceptionPolicyId": { "type": "string", @@ -3005,7 +3017,9 @@ "description": "Describes how the value of the label is compared to the value defined on the\nlabel selector" }, "value": { - "description": "The value to compare against the actual label value with the given operator" + "type": "object", + "description": "The value to compare against the actual label value with the given operator", + "properties": {} } }, "required": [ @@ -3076,7 +3090,10 @@ "queueAssignments": { "type": "object", "description": "The queue(s) that this worker can receive work from.", - "additionalProperties": true + "additionalProperties": { + "properties": {}, + "type": "object" + } }, "totalCapacity": { "type": "integer", @@ -3086,12 +3103,18 @@ "labels": { "type": "object", "description": "A set of key/value pairs that are identifying attributes used by the rules\nengines to make decisions.", - "additionalProperties": true + "additionalProperties": { + "properties": {}, + "type": "object" + } }, "tags": { "type": "object", "description": "A set of non-identifying attributes attached to this worker.", - "additionalProperties": true + "additionalProperties": { + "properties": {}, + "type": "object" + } }, "channelConfigurations": { "type": "object", @@ -3187,7 +3210,9 @@ "description": "Describes how the value of the label is compared to the value defined on the\nlabel selector" }, "value": { - "description": "The value to compare against the actual label value with the given operator" + "type": "object", + "description": "The value to compare against the actual label value with the given operator", + "properties": {} }, "expiresAfterSeconds": { "type": "number", @@ -3392,7 +3417,9 @@ "description": "A rule providing static rules that always return the same result, regardless of\ninput.", "properties": { "value": { - "description": "The static value this rule always returns." + "type": "object", + "description": "The static value this rule always returns.", + "properties": {} } }, "allOf": [ From 3b132ed001588339e1bf5b0965f790b17b428f37 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 12 Sep 2023 16:03:25 -0700 Subject: [PATCH 004/113] fix consumes for upsert routes --- .../communication/JobRouter/routes.tsp | 27 ++++++++++++++++++- .../communicationservicejobrouter.json | 18 +++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/specification/communication/JobRouter/routes.tsp b/specification/communication/JobRouter/routes.tsp index 9e9f874ac365..4cbbd66b5848 100644 --- a/specification/communication/JobRouter/routes.tsp +++ b/specification/communication/JobRouter/routes.tsp @@ -5,6 +5,7 @@ import "./models.tsp"; using TypeSpec.Rest; using TypeSpec.Http; using Autorest; +using Azure.Core.Traits; namespace AzureCommunicationRoutingService; @@ -17,10 +18,14 @@ interface JobRouterAdministrationOperations { @patch upsertClassificationPolicy is Azure.Core.Foundations.Operation< { + @doc("content type") + @header("content-type") + contentType: "application/merge-patch+json"; + @doc("Id of the classification policy.") @path id: string; - + @doc(""" Model of classification policy properties to be patched. See also: https://datatracker.ietf.org/doc/html/rfc7386. @@ -84,6 +89,10 @@ https://datatracker.ietf.org/doc/html/rfc7386. @patch upsertDistributionPolicy is Azure.Core.Foundations.Operation< { + @doc("content type") + @header("content-type") + contentType: "application/merge-patch+json"; + @doc("Id of the distribution policy.") @path id: string; @@ -151,6 +160,10 @@ https://datatracker.ietf.org/doc/html/rfc7386. @patch upsertExceptionPolicy is Azure.Core.Foundations.Operation< { + @doc("content type") + @header("content-type") + contentType: "application/merge-patch+json"; + @doc("Id of the exception policy.") @path id: string; @@ -218,6 +231,10 @@ https://datatracker.ietf.org/doc/html/rfc7386 @patch upsertQueue is Azure.Core.Foundations.Operation< { + @doc("content type") + @header("content-type") + contentType: "application/merge-patch+json"; + @doc("Id of the queue.") @path id: string; @@ -287,6 +304,10 @@ interface JobRouterOperations { @patch upsertJob is Azure.Core.Foundations.Operation< { + @doc("content type") + @header("content-type") + contentType: "application/merge-patch+json"; + @doc("Id of the job.") @path id: string; @@ -558,6 +579,10 @@ accepted the job already. @patch upsertWorker is Azure.Core.Foundations.Operation< { + @doc("content type") + @header("content-type") + contentType: "application/merge-patch+json"; + @doc("Id of the worker.") @path workerId: string; diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index 45dcb4d10a92..d78224bb08e9 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -118,6 +118,9 @@ "operationId": "JobRouterAdministrationOperations_UpsertClassificationPolicy", "summary": "Creates or updates a classification policy.", "description": "Creates or updates a classification policy.", + "consumes": [ + "application/merge-patch+json" + ], "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -291,6 +294,9 @@ "operationId": "JobRouterAdministrationOperations_UpsertDistributionPolicy", "summary": "Creates or updates a distribution policy.", "description": "Creates or updates a distribution policy.", + "consumes": [ + "application/merge-patch+json" + ], "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -459,6 +465,9 @@ "operationId": "JobRouterAdministrationOperations_UpsertExceptionPolicy", "summary": "Creates or updates a exception policy.", "description": "Creates or updates a exception policy.", + "consumes": [ + "application/merge-patch+json" + ], "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -763,6 +772,9 @@ "operationId": "JobRouterOperations_UpsertJob", "summary": "Creates or updates a router job.", "description": "Creates or updates a router job.", + "consumes": [ + "application/merge-patch+json" + ], "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -1206,6 +1218,9 @@ "operationId": "JobRouterAdministrationOperations_UpsertQueue", "summary": "Creates or updates a queue.", "description": "Creates or updates a queue.", + "consumes": [ + "application/merge-patch+json" + ], "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -1473,6 +1488,9 @@ "operationId": "JobRouterOperations_UpsertWorker", "summary": "Creates or updates a worker.", "description": "Creates or updates a worker.", + "consumes": [ + "application/merge-patch+json" + ], "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" From 2025a7bd327e67bbffb7b8263d42df644cda7a0d Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 12 Sep 2023 16:50:30 -0700 Subject: [PATCH 005/113] fix naming validation error --- .../{JobRouter => Communication.JobRouter}/.gitignore | 0 .../{JobRouter => Communication.JobRouter}/client.tsp | 0 .../ClassificationPolicies_CreateClassificationPolicy.json | 0 .../ClassificationPolicies_DeleteClassificationPolicy.json | 0 .../ClassificationPolicies_GetClassificationPolicy.json | 0 ...ificationPolicies_ListClassificationPoliciesWithPageSize.json | 0 .../ClassificationPolicies_UpdateClassificationPolicy.json | 0 .../DistributionPolicies_CreateDistributionPolicy.json | 0 .../DistributionPolicies_DeleteDistributionPolicy.json | 0 .../2023-11-01/DistributionPolicies_GetDistributionPolicy.json | 0 ...istributionPolicies_ListDistributionPoliciesWithPageSize.json | 0 .../DistributionPolicies_UpdateDistributionPolicy.json | 0 .../2023-11-01/ExceptionPolicies_CreateExceptionPolicy.json | 0 .../2023-11-01/ExceptionPolicies_DeleteExceptionPolicy.json | 0 .../2023-11-01/ExceptionPolicies_GetExceptionPolicy.json | 0 .../ExceptionPolicies_ListExceptionPoliciesWithPageSize.json | 0 .../2023-11-01/ExceptionPolicies_UpdateExceptionPolicy.json | 0 .../examples/2023-11-01/Jobs_CloseJob.json | 0 .../examples/2023-11-01/Jobs_CompleteJob.json | 0 .../examples/2023-11-01/Jobs_CreateJob.json | 0 .../examples/2023-11-01/Jobs_CreateScheduledJob.json | 0 .../examples/2023-11-01/Jobs_DeleteJob.json | 0 .../examples/2023-11-01/Jobs_GetInQueuePosition.json | 0 .../examples/2023-11-01/Jobs_GetJob.json | 0 .../examples/2023-11-01/Jobs_GetJobsWithPageSize.json | 0 .../examples/2023-11-01/Jobs_ReclassifyJob.json | 0 .../examples/2023-11-01/Jobs_RequestJobCancel.json | 0 .../examples/2023-11-01/Jobs_UnassignJob.json | 0 .../examples/2023-11-01/Jobs_UpdateJob.json | 0 .../examples/2023-11-01/Offers_AcceptJobOffer.json | 0 .../examples/2023-11-01/Offers_DeclineJobOffer.json | 0 .../examples/2023-11-01/Queues_CreateQueue.json | 0 .../examples/2023-11-01/Queues_DeleteQueue.json | 0 .../examples/2023-11-01/Queues_GetQueue.json | 0 .../examples/2023-11-01/Queues_GetQueueStatistics.json | 0 .../examples/2023-11-01/Queues_ListQueuesWithPageSize.json | 0 .../examples/2023-11-01/Queues_UpdateQueue.json | 0 .../examples/2023-11-01/Workers_CreateWorker.json | 0 .../examples/2023-11-01/Workers_DeleteWorker.json | 0 .../examples/2023-11-01/Workers_DeregisterActiveWorker.json | 0 .../examples/2023-11-01/Workers_DeregisterInactiveWorker.json | 0 .../2023-11-01/Workers_GetAvailableWorkersByChannel.json | 0 .../examples/2023-11-01/Workers_GetWorker.json | 0 .../examples/2023-11-01/Workers_GetWorkersWithPageSize.json | 0 .../examples/2023-11-01/Workers_RegisterWorker.json | 0 .../examples/2023-11-01/Workers_UpdateWorker.json | 0 .../{JobRouter => Communication.JobRouter}/main.tsp | 0 .../{JobRouter => Communication.JobRouter}/models.tsp | 1 - .../{JobRouter => Communication.JobRouter}/routes.tsp | 1 + .../{JobRouter => Communication.JobRouter}/tspconfig.yaml | 0 50 files changed, 1 insertion(+), 1 deletion(-) rename specification/communication/{JobRouter => Communication.JobRouter}/.gitignore (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/client.tsp (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/ClassificationPolicies_CreateClassificationPolicy.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/ClassificationPolicies_DeleteClassificationPolicy.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/ClassificationPolicies_GetClassificationPolicy.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/ClassificationPolicies_UpdateClassificationPolicy.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/DistributionPolicies_CreateDistributionPolicy.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/DistributionPolicies_DeleteDistributionPolicy.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/DistributionPolicies_GetDistributionPolicy.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/DistributionPolicies_ListDistributionPoliciesWithPageSize.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/DistributionPolicies_UpdateDistributionPolicy.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/ExceptionPolicies_CreateExceptionPolicy.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/ExceptionPolicies_DeleteExceptionPolicy.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/ExceptionPolicies_GetExceptionPolicy.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/ExceptionPolicies_UpdateExceptionPolicy.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/Jobs_CloseJob.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/Jobs_CompleteJob.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/Jobs_CreateJob.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/Jobs_CreateScheduledJob.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/Jobs_DeleteJob.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/Jobs_GetInQueuePosition.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/Jobs_GetJob.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/Jobs_GetJobsWithPageSize.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/Jobs_ReclassifyJob.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/Jobs_RequestJobCancel.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/Jobs_UnassignJob.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/Jobs_UpdateJob.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/Offers_AcceptJobOffer.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/Offers_DeclineJobOffer.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/Queues_CreateQueue.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/Queues_DeleteQueue.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/Queues_GetQueue.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/Queues_GetQueueStatistics.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/Queues_ListQueuesWithPageSize.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/Queues_UpdateQueue.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/Workers_CreateWorker.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/Workers_DeleteWorker.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/Workers_DeregisterActiveWorker.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/Workers_DeregisterInactiveWorker.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/Workers_GetWorker.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/Workers_GetWorkersWithPageSize.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/Workers_RegisterWorker.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/examples/2023-11-01/Workers_UpdateWorker.json (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/main.tsp (100%) rename specification/communication/{JobRouter => Communication.JobRouter}/models.tsp (99%) rename specification/communication/{JobRouter => Communication.JobRouter}/routes.tsp (99%) rename specification/communication/{JobRouter => Communication.JobRouter}/tspconfig.yaml (100%) diff --git a/specification/communication/JobRouter/.gitignore b/specification/communication/Communication.JobRouter/.gitignore similarity index 100% rename from specification/communication/JobRouter/.gitignore rename to specification/communication/Communication.JobRouter/.gitignore diff --git a/specification/communication/JobRouter/client.tsp b/specification/communication/Communication.JobRouter/client.tsp similarity index 100% rename from specification/communication/JobRouter/client.tsp rename to specification/communication/Communication.JobRouter/client.tsp diff --git a/specification/communication/JobRouter/examples/2023-11-01/ClassificationPolicies_CreateClassificationPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_CreateClassificationPolicy.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/ClassificationPolicies_CreateClassificationPolicy.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_CreateClassificationPolicy.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/ClassificationPolicies_DeleteClassificationPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_DeleteClassificationPolicy.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/ClassificationPolicies_DeleteClassificationPolicy.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_DeleteClassificationPolicy.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/ClassificationPolicies_GetClassificationPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_GetClassificationPolicy.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/ClassificationPolicies_GetClassificationPolicy.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_GetClassificationPolicy.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/ClassificationPolicies_UpdateClassificationPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_UpdateClassificationPolicy.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/ClassificationPolicies_UpdateClassificationPolicy.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_UpdateClassificationPolicy.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/DistributionPolicies_CreateDistributionPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_CreateDistributionPolicy.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/DistributionPolicies_CreateDistributionPolicy.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_CreateDistributionPolicy.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/DistributionPolicies_DeleteDistributionPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_DeleteDistributionPolicy.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/DistributionPolicies_DeleteDistributionPolicy.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_DeleteDistributionPolicy.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/DistributionPolicies_GetDistributionPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_GetDistributionPolicy.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/DistributionPolicies_GetDistributionPolicy.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_GetDistributionPolicy.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/DistributionPolicies_ListDistributionPoliciesWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_ListDistributionPoliciesWithPageSize.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/DistributionPolicies_ListDistributionPoliciesWithPageSize.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_ListDistributionPoliciesWithPageSize.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/DistributionPolicies_UpdateDistributionPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_UpdateDistributionPolicy.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/DistributionPolicies_UpdateDistributionPolicy.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_UpdateDistributionPolicy.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/ExceptionPolicies_CreateExceptionPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_CreateExceptionPolicy.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/ExceptionPolicies_CreateExceptionPolicy.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_CreateExceptionPolicy.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/ExceptionPolicies_DeleteExceptionPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_DeleteExceptionPolicy.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/ExceptionPolicies_DeleteExceptionPolicy.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_DeleteExceptionPolicy.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/ExceptionPolicies_GetExceptionPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_GetExceptionPolicy.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/ExceptionPolicies_GetExceptionPolicy.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_GetExceptionPolicy.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/ExceptionPolicies_UpdateExceptionPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_UpdateExceptionPolicy.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/ExceptionPolicies_UpdateExceptionPolicy.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_UpdateExceptionPolicy.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/Jobs_CloseJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CloseJob.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/Jobs_CloseJob.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CloseJob.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/Jobs_CompleteJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CompleteJob.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/Jobs_CompleteJob.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CompleteJob.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/Jobs_CreateJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateJob.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/Jobs_CreateJob.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateJob.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/Jobs_CreateScheduledJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateScheduledJob.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/Jobs_CreateScheduledJob.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateScheduledJob.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/Jobs_DeleteJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_DeleteJob.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/Jobs_DeleteJob.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_DeleteJob.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/Jobs_GetInQueuePosition.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetInQueuePosition.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/Jobs_GetInQueuePosition.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetInQueuePosition.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/Jobs_GetJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJob.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/Jobs_GetJob.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJob.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/Jobs_GetJobsWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJobsWithPageSize.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/Jobs_GetJobsWithPageSize.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJobsWithPageSize.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/Jobs_ReclassifyJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_ReclassifyJob.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/Jobs_ReclassifyJob.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_ReclassifyJob.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/Jobs_RequestJobCancel.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_RequestJobCancel.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/Jobs_RequestJobCancel.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_RequestJobCancel.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/Jobs_UnassignJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UnassignJob.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/Jobs_UnassignJob.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UnassignJob.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/Jobs_UpdateJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UpdateJob.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/Jobs_UpdateJob.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UpdateJob.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/Offers_AcceptJobOffer.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_AcceptJobOffer.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/Offers_AcceptJobOffer.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_AcceptJobOffer.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/Offers_DeclineJobOffer.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_DeclineJobOffer.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/Offers_DeclineJobOffer.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_DeclineJobOffer.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/Queues_CreateQueue.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_CreateQueue.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/Queues_CreateQueue.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_CreateQueue.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/Queues_DeleteQueue.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_DeleteQueue.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/Queues_DeleteQueue.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_DeleteQueue.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/Queues_GetQueue.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_GetQueue.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/Queues_GetQueue.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_GetQueue.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/Queues_GetQueueStatistics.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_GetQueueStatistics.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/Queues_GetQueueStatistics.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_GetQueueStatistics.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/Queues_ListQueuesWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_ListQueuesWithPageSize.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/Queues_ListQueuesWithPageSize.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_ListQueuesWithPageSize.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/Queues_UpdateQueue.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_UpdateQueue.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/Queues_UpdateQueue.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_UpdateQueue.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/Workers_CreateWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_CreateWorker.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/Workers_CreateWorker.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_CreateWorker.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/Workers_DeleteWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeleteWorker.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/Workers_DeleteWorker.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeleteWorker.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/Workers_DeregisterActiveWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterActiveWorker.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/Workers_DeregisterActiveWorker.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterActiveWorker.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/Workers_DeregisterInactiveWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterInactiveWorker.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/Workers_DeregisterInactiveWorker.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterInactiveWorker.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/Workers_GetWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorker.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/Workers_GetWorker.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorker.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/Workers_RegisterWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_RegisterWorker.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/Workers_RegisterWorker.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_RegisterWorker.json diff --git a/specification/communication/JobRouter/examples/2023-11-01/Workers_UpdateWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_UpdateWorker.json similarity index 100% rename from specification/communication/JobRouter/examples/2023-11-01/Workers_UpdateWorker.json rename to specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_UpdateWorker.json diff --git a/specification/communication/JobRouter/main.tsp b/specification/communication/Communication.JobRouter/main.tsp similarity index 100% rename from specification/communication/JobRouter/main.tsp rename to specification/communication/Communication.JobRouter/main.tsp diff --git a/specification/communication/JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp similarity index 99% rename from specification/communication/JobRouter/models.tsp rename to specification/communication/Communication.JobRouter/models.tsp index 179181f8e20b..7ff44aacec9d 100644 --- a/specification/communication/JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -1,7 +1,6 @@ import "@typespec/http"; import "@typespec/rest"; import "@typespec/versioning"; -import "@azure-tools/typespec-autorest"; import "@azure-tools/typespec-azure-core"; using TypeSpec.Http; diff --git a/specification/communication/JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp similarity index 99% rename from specification/communication/JobRouter/routes.tsp rename to specification/communication/Communication.JobRouter/routes.tsp index 4cbbd66b5848..68cc4df5bef2 100644 --- a/specification/communication/JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -1,3 +1,4 @@ +import "@azure-tools/typespec-autorest"; import "@azure-tools/typespec-azure-core"; import "@typespec/rest"; import "./models.tsp"; diff --git a/specification/communication/JobRouter/tspconfig.yaml b/specification/communication/Communication.JobRouter/tspconfig.yaml similarity index 100% rename from specification/communication/JobRouter/tspconfig.yaml rename to specification/communication/Communication.JobRouter/tspconfig.yaml From 36281c6ace4336d7eca0ff882be3b4e62caf6d81 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 12 Sep 2023 16:54:46 -0700 Subject: [PATCH 006/113] remove x-ms-examples --- .../communication/Communication.JobRouter/routes.tsp | 3 --- .../stable/2023-11-01/communicationservicejobrouter.json | 5 ----- 2 files changed, 8 deletions(-) diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index 68cc4df5bef2..c1be0cf0a498 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -1,11 +1,9 @@ -import "@azure-tools/typespec-autorest"; import "@azure-tools/typespec-azure-core"; import "@typespec/rest"; import "./models.tsp"; using TypeSpec.Rest; using TypeSpec.Http; -using Autorest; using Azure.Core.Traits; namespace AzureCommunicationRoutingService; @@ -14,7 +12,6 @@ interface JobRouterAdministrationOperations { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Creates or updates a classification policy.") @doc("Creates or updates a classification policy.") - @example("./ClassificationPolicies_CreateClassificationPolicy.json", "upsertClassificationPolicy") @route("/routing/classificationPolicies/{id}") @patch upsertClassificationPolicy is Azure.Core.Foundations.Operation< diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index d78224bb08e9..631f0320cd44 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -167,11 +167,6 @@ } } } - }, - "x-ms-examples": { - "upsertClassificationPolicy": { - "$ref": "./ClassificationPolicies_CreateClassificationPolicy.json" - } } }, "delete": { From 2ea312a19139d485eb385c2e84928e18f50001c1 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 12 Sep 2023 17:03:33 -0700 Subject: [PATCH 007/113] unreferenced json file validation fix --- .../communication/data-plane/JobRouter/readme.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/specification/communication/data-plane/JobRouter/readme.md b/specification/communication/data-plane/JobRouter/readme.md index 9fb06a381347..07a7d5517817 100644 --- a/specification/communication/data-plane/JobRouter/readme.md +++ b/specification/communication/data-plane/JobRouter/readme.md @@ -26,7 +26,16 @@ These are the global settings for the communicationservices. ```yaml openapi-type: data-plane -tag: package-jobrouter-2022-07-18-preview +tag: package-jobrouter-2023-11-01 +``` + +### Tag: package-jobrouter-2023-11-01 + +These settings apply only when `--tag=package-jobrouter-2023-11-01` is specified on the command line. + +```yaml $(tag) == 'package-jobrouter-2023-11-01' +input-file: + - stable/2023-11-01/communicationservicejobrouter.json ``` ### Tag: package-jobrouter-2022-07-18-preview From f06c16b4bc3829ef6e6e25f2652c463ecf09b5e6 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Wed, 13 Sep 2023 10:57:37 -0700 Subject: [PATCH 008/113] change to using unknown --- .../Communication.JobRouter/models.tsp | 24 ++++---- .../communicationservicejobrouter.json | 55 ++++--------------- 2 files changed, 24 insertions(+), 55 deletions(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 7ff44aacec9d..839db784c2a6 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -394,7 +394,7 @@ worker must satisfy in order to process this job. A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. """) - labels?: Record<{}>; + labels?: Record; @doc(""" A collection of the assignments of the job. @@ -404,7 +404,7 @@ Key is AssignmentId. assignments?: Record; @doc("A set of non-identifying attributes attached to this job") - tags?: Record<{}>; + tags?: Record; @doc("Notes attached to a job, sorted by timestamp") notes?: Record; @@ -445,7 +445,7 @@ label selector labelOperator: LabelOperator; @doc("The value to compare against the actual label value with the given operator") - value?: {}; + value?: unknown; @doc("Describes how long this label selector is valid in seconds.") expiresAfterSeconds?: float32; @@ -506,7 +506,7 @@ model JobMatchingMode { Describes a matching mode where matching worker to a job is automatically started after job is queued successfully. """) - queueAndMatchMode?: {}; + queueAndMatchMode?: unknown; @doc(""" Describes a matching mode used for scheduling jobs to be queued at a future @@ -517,7 +517,7 @@ automatically. scheduleAndSuspendMode?: ScheduleAndSuspendMode; @doc("Describes a matching mode where matching worker to a job is suspended.") - suspendMode?: {}; + suspendMode?: unknown; } @doc(""" @@ -684,7 +684,7 @@ to workers. A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. """) - labels?: Record<{}>; + labels?: Record; @doc(""" (Optional) The ID of the exception policy that determines various job @@ -734,7 +734,7 @@ model RouterWorker { state?: RouterWorkerState; @doc("The queue(s) that this worker can receive work from.") - queueAssignments?: Record<{}>; + queueAssignments?: Record; @doc("The total capacity score this worker has to manage multiple concurrent jobs.") totalCapacity?: int32; @@ -743,10 +743,10 @@ model RouterWorker { A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. """) - labels?: Record<{}>; + labels?: Record; @doc("A set of non-identifying attributes attached to this worker.") - tags?: Record<{}>; + tags?: Record; @doc("The channel(s) this worker can handle and their impact on the workers capacity.") channelConfigurations?: Record; @@ -967,7 +967,7 @@ label selector labelOperator: LabelOperator; @doc("The value to compare against the actual label value with the given operator") - value?: {}; + value?: unknown; } @doc(""" @@ -1169,7 +1169,7 @@ and worker selectors. (optional) Dictionary containing the labels to update (or add if not existing) in key-value pairs """) - labelsToUpsert?: Record<{}>; + labelsToUpsert?: Record; @doc("The type discriminator describing a sub-type of ExceptionAction") kind: "reclassify"; @@ -1248,7 +1248,7 @@ input. """) model StaticRouterRule extends RouterRule { @doc("The static value this rule always returns.") - value?: {}; + value?: unknown; @doc("The type discriminator describing a sub-type of Rule") kind: "static-rule"; diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index 631f0320cd44..a624cc08accc 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -2272,18 +2272,14 @@ "description": "Discriminator value used to differentiate between supported matching mode types." }, "queueAndMatchMode": { - "type": "object", - "description": "Describes a matching mode where matching worker to a job is automatically\nstarted after job is queued successfully.", - "properties": {} + "description": "Describes a matching mode where matching worker to a job is automatically\nstarted after job is queued successfully." }, "scheduleAndSuspendMode": { "$ref": "#/definitions/ScheduleAndSuspendMode", "description": "Describes a matching mode used for scheduling jobs to be queued at a future\ntime.\nAt the specified time, matching worker to a job will not start\nautomatically." }, "suspendMode": { - "type": "object", - "description": "Describes a matching mode where matching worker to a job is suspended.", - "properties": {} + "description": "Describes a matching mode where matching worker to a job is suspended." } } }, @@ -2642,10 +2638,7 @@ "labelsToUpsert": { "type": "object", "description": "(optional) Dictionary containing the labels to update (or add if not existing)\nin key-value pairs", - "additionalProperties": { - "properties": {}, - "type": "object" - } + "additionalProperties": true } }, "allOf": [ @@ -2731,10 +2724,7 @@ "labels": { "type": "object", "description": "A set of key/value pairs that are identifying attributes used by the rules\nengines to make decisions.", - "additionalProperties": { - "properties": {}, - "type": "object" - } + "additionalProperties": true }, "assignments": { "type": "object", @@ -2747,10 +2737,7 @@ "tags": { "type": "object", "description": "A set of non-identifying attributes attached to this job", - "additionalProperties": { - "properties": {}, - "type": "object" - } + "additionalProperties": true }, "notes": { "type": "object", @@ -2992,10 +2979,7 @@ "labels": { "type": "object", "description": "A set of key/value pairs that are identifying attributes used by the rules\nengines to make decisions.", - "additionalProperties": { - "properties": {}, - "type": "object" - } + "additionalProperties": true }, "exceptionPolicyId": { "type": "string", @@ -3030,9 +3014,7 @@ "description": "Describes how the value of the label is compared to the value defined on the\nlabel selector" }, "value": { - "type": "object", - "description": "The value to compare against the actual label value with the given operator", - "properties": {} + "description": "The value to compare against the actual label value with the given operator" } }, "required": [ @@ -3103,10 +3085,7 @@ "queueAssignments": { "type": "object", "description": "The queue(s) that this worker can receive work from.", - "additionalProperties": { - "properties": {}, - "type": "object" - } + "additionalProperties": true }, "totalCapacity": { "type": "integer", @@ -3116,18 +3095,12 @@ "labels": { "type": "object", "description": "A set of key/value pairs that are identifying attributes used by the rules\nengines to make decisions.", - "additionalProperties": { - "properties": {}, - "type": "object" - } + "additionalProperties": true }, "tags": { "type": "object", "description": "A set of non-identifying attributes attached to this worker.", - "additionalProperties": { - "properties": {}, - "type": "object" - } + "additionalProperties": true }, "channelConfigurations": { "type": "object", @@ -3223,9 +3196,7 @@ "description": "Describes how the value of the label is compared to the value defined on the\nlabel selector" }, "value": { - "type": "object", - "description": "The value to compare against the actual label value with the given operator", - "properties": {} + "description": "The value to compare against the actual label value with the given operator" }, "expiresAfterSeconds": { "type": "number", @@ -3430,9 +3401,7 @@ "description": "A rule providing static rules that always return the same result, regardless of\ninput.", "properties": { "value": { - "type": "object", - "description": "The static value this rule always returns.", - "properties": {} + "description": "The static value this rule always returns." } }, "allOf": [ From a71bfced33ff7a5e1d9ef58a14e4237121375454 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Wed, 13 Sep 2023 12:38:53 -0700 Subject: [PATCH 009/113] rename generated client to XXXXXRestClient --- .../communication/Communication.JobRouter/client.tsp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/specification/communication/Communication.JobRouter/client.tsp b/specification/communication/Communication.JobRouter/client.tsp index dd05266422d3..f960dee18584 100644 --- a/specification/communication/Communication.JobRouter/client.tsp +++ b/specification/communication/Communication.JobRouter/client.tsp @@ -12,11 +12,11 @@ using TypeSpec.Versioning; namespace ClientForAcsJobRouter; // Your customizations here -@@client(AzureCommunicationRoutingService,{ - name: "JobRouterAdministrationClient", +@client({ + name: "JobRouterAdministrationRestClient", service: AzureCommunicationRoutingService }) -interface JobRouterAdministrationClient { +interface JobRouterAdministrationRestClient { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" upsertDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertDistributionPolicy; @@ -66,11 +66,11 @@ interface JobRouterAdministrationClient { deleteQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteQueue; } -@@client(AzureCommunicationRoutingService, { - name: "JobRouterClient", +@client({ + name: "JobRouterRestClient", service: AzureCommunicationRoutingService }) -interface JobRouterClient { +interface JobRouterRestClient { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" upsertJob is AzureCommunicationRoutingService.JobRouterOperations.upsertJob; From fe44514140352df5239578c76beff97ce83712e3 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Fri, 15 Sep 2023 10:54:24 -0700 Subject: [PATCH 010/113] test generating convenience methods --- .../communication/Communication.JobRouter/tspconfig.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/specification/communication/Communication.JobRouter/tspconfig.yaml b/specification/communication/Communication.JobRouter/tspconfig.yaml index 64c0b9781138..4e33b9f8fc70 100644 --- a/specification/communication/Communication.JobRouter/tspconfig.yaml +++ b/specification/communication/Communication.JobRouter/tspconfig.yaml @@ -29,6 +29,7 @@ options: namespace: Azure.Communication.JobRouter package-dir: "Azure.Communication.JobRouter" save-inputs: true + generate-convenience-methods: true "@azure-tools/typespec-python": emitter-output-dir: "{python-sdk-folder}/sdk/{service-directory-name}/{package-name}" package-name: "azure-communication-jobrouter" @@ -37,6 +38,7 @@ options: namespace: com.azure.communication.jobrouter "@azure-tools/typespec-ts": emitter-output-dir: "{js-sdk-folder}/sdk/{service-directory-name}/communication-job-router" + package-dir: "communication-job-router" generateMetadata: true generateTest: true packageDetails: From e0b925f5a615c8d3362ab312bbdab5294b5cea12 Mon Sep 17 00:00:00 2001 From: Adam Tuck Date: Wed, 13 Sep 2023 13:45:40 -0700 Subject: [PATCH 011/113] add line --- .../communication/Communication.JobRouter/tspconfig.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/communication/Communication.JobRouter/tspconfig.yaml b/specification/communication/Communication.JobRouter/tspconfig.yaml index 4e33b9f8fc70..b54b33bcf026 100644 --- a/specification/communication/Communication.JobRouter/tspconfig.yaml +++ b/specification/communication/Communication.JobRouter/tspconfig.yaml @@ -41,6 +41,7 @@ options: package-dir: "communication-job-router" generateMetadata: true generateTest: true + package-dir: "communication-job-router" packageDetails: name: "@azure/communication-job-router" description: "Azure client library for Azure Communication Job Router services" \ No newline at end of file From d3ac5de1b1dff1bc112735850d64b8f8a9423e0f Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Fri, 15 Sep 2023 10:55:43 -0700 Subject: [PATCH 012/113] rebased --- .../communication/Communication.JobRouter/tspconfig.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/communication/Communication.JobRouter/tspconfig.yaml b/specification/communication/Communication.JobRouter/tspconfig.yaml index b54b33bcf026..de255e147263 100644 --- a/specification/communication/Communication.JobRouter/tspconfig.yaml +++ b/specification/communication/Communication.JobRouter/tspconfig.yaml @@ -38,7 +38,6 @@ options: namespace: com.azure.communication.jobrouter "@azure-tools/typespec-ts": emitter-output-dir: "{js-sdk-folder}/sdk/{service-directory-name}/communication-job-router" - package-dir: "communication-job-router" generateMetadata: true generateTest: true package-dir: "communication-job-router" From de5ce6ef2d4cf5ba096bfbf817d018c1e4332d9b Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Fri, 15 Sep 2023 13:55:21 -0700 Subject: [PATCH 013/113] correctly represent uri --- .../Communication.JobRouter/models.tsp | 20 +++++++++---------- .../communicationservicejobrouter.json | 17 +++++++++------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 839db784c2a6..2029690921fa 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -205,7 +205,7 @@ DirectMapRule: A rule that return the same labels as the input labels. ExpressionRule: A rule providing inline expression rules. -AzureFunctionRule: A rule providing a binding to an HTTP Triggered Azure +FunctionRule: A rule providing a binding to an HTTP Triggered Azure Function. WebhookRule: A rule providing a binding to a webserver following OAuth2.0 authentication protocol. @@ -226,7 +226,7 @@ DirectMapRule: A rule that return the same labels as the input labels. ExpressionRule: A rule providing inline expression rules. -AzureFunctionRule: A rule providing a binding to an HTTP Triggered Azure +FunctionRule: A rule providing a binding to an HTTP Triggered Azure Function. WebhookRule: A rule providing a binding to a webserver following OAuth2.0 authentication protocol. @@ -842,7 +842,7 @@ DirectMapRule: A rule that return the same labels as the input labels. ExpressionRule: A rule providing inline expression rules. -AzureFunctionRule: A rule providing a binding to an HTTP Triggered Azure +FunctionRule: A rule providing a binding to an HTTP Triggered Azure Function. WebhookRule: A rule providing a binding to a webserver following OAuth2.0 authentication protocol. @@ -938,7 +938,7 @@ DirectMapRule: A rule that return the same labels as the input labels. ExpressionRule: A rule providing inline expression rules. -AzureFunctionRule: A rule providing a binding to an HTTP Triggered Azure +FunctionRule: A rule providing a binding to an HTTP Triggered Azure Function. WebhookRule: A rule providing a binding to a webserver following OAuth2.0 authentication protocol. @@ -992,7 +992,7 @@ DirectMapRule: A rule that return the same labels as the input labels. ExpressionRule: A rule providing inline expression rules. -AzureFunctionRule: A rule providing a binding to an HTTP Triggered Azure +FunctionRule: A rule providing a binding to an HTTP Triggered Azure Function. WebhookRule: A rule providing a binding to a webserver following OAuth2.0 authentication protocol. @@ -1034,7 +1034,7 @@ statement with calculated values. @doc("A rule providing a binding to an HTTP Triggered Azure Function.") model FunctionRouterRule extends RouterRule { @doc("URL for Azure Function") - functionUri: string; + functionUri: url; @doc("Credentials used to access Azure function rule") credential?: FunctionRouterRuleCredential; @@ -1196,7 +1196,7 @@ DirectMapRule: A rule that return the same labels as the input labels. ExpressionRule: A rule providing inline expression rules. -AzureFunctionRule: A rule providing a binding to an HTTP Triggered Azure +FunctionRule: A rule providing a binding to an HTTP Triggered Azure Function. WebhookRule: A rule providing a binding to a webserver following OAuth2.0 authentication protocol. @@ -1219,7 +1219,7 @@ DirectMapRule: A rule that return the same labels as the input labels. ExpressionRule: A rule providing inline expression rules. -AzureFunctionRule: A rule providing a binding to an HTTP Triggered Azure +FunctionRule: A rule providing a binding to an HTTP Triggered Azure Function. WebhookRule: A rule providing a binding to a webserver following OAuth2.0 authentication protocol. @@ -1278,7 +1278,7 @@ model WaitTimeExceptionTrigger extends ExceptionTrigger { @doc("A rule providing a binding to an external web server.") model WebhookRouterRule extends RouterRule { @doc("Uri for Authorization Server.") - authorizationServerUri?: string; + authorizationServerUri?: url; @doc(""" OAuth2.0 Credentials used to Contoso's Authorization server. @@ -1288,7 +1288,7 @@ https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/ clientCredential?: Oauth2ClientCredential; @doc("Uri for Contoso's Web Server.") - webhookUri?: string; + webhookUri?: url; @doc("The type discriminator describing a sub-type of Rule") kind: "webhook-rule"; diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index a624cc08accc..7cbc05669155 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -1759,7 +1759,7 @@ "properties": { "scoringRule": { "$ref": "#/definitions/RouterRule", - "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nAzureFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol." + "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol." }, "scoringRuleOptions": { "$ref": "#/definitions/ScoringRuleOptions", @@ -1853,7 +1853,7 @@ }, "prioritizationRule": { "$ref": "#/definitions/RouterRule", - "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nAzureFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol." + "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol." }, "workerSelectors": { "type": "array", @@ -1928,7 +1928,7 @@ "properties": { "condition": { "$ref": "#/definitions/RouterRule", - "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nAzureFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol." + "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol." }, "queueSelectors": { "type": "array", @@ -1956,7 +1956,7 @@ "properties": { "condition": { "$ref": "#/definitions/RouterRule", - "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nAzureFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol." + "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol." }, "workerSelectors": { "type": "array", @@ -2198,6 +2198,7 @@ "properties": { "functionUri": { "type": "string", + "format": "uri", "description": "URL for Azure Function" }, "credential": { @@ -3056,7 +3057,7 @@ }, "RouterRule": { "type": "object", - "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nAzureFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol.", + "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol.", "properties": { "kind": { "type": "string", @@ -3284,7 +3285,7 @@ "properties": { "rule": { "$ref": "#/definitions/RouterRule", - "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nAzureFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol." + "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol." } }, "required": [ @@ -3303,7 +3304,7 @@ "properties": { "rule": { "$ref": "#/definitions/RouterRule", - "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nAzureFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol." + "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol." } }, "required": [ @@ -3485,6 +3486,7 @@ "properties": { "authorizationServerUri": { "type": "string", + "format": "uri", "description": "Uri for Authorization Server." }, "clientCredential": { @@ -3493,6 +3495,7 @@ }, "webhookUri": { "type": "string", + "format": "uri", "description": "Uri for Contoso's Web Server." } }, From d922de48dfbf9e3eae35c1685857d767083cda8a Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Mon, 18 Sep 2023 15:43:12 -0700 Subject: [PATCH 014/113] try out standard operations for classification policy --- .../Communication.JobRouter/models.tsp | 4 +- .../Communication.JobRouter/routes.tsp | 63 +++++++++++-------- .../communicationservicejobrouter.json | 47 ++++++++++++-- 3 files changed, 82 insertions(+), 32 deletions(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 2029690921fa..b52bee05f4d2 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -180,11 +180,13 @@ enum ExpressionRouterRuleLanguage { powerFx, } +@resource("classificationPolicies") @doc("A container for the rules that govern how jobs are classified.") model ClassificationPolicy { + @key("id") @doc("Unique identifier of this policy.") @visibility("read") - id?: string; + id: string; @doc("Friendly name of this policy.") name?: string; diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index c1be0cf0a498..d464499d6881 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -8,35 +8,46 @@ using Azure.Core.Traits; namespace AzureCommunicationRoutingService; +alias ServiceTraits = NoRepeatableRequests & + NoConditionalRequests & NoClientRequestId; + +alias Operations = Azure.Core.ResourceOperations; + interface JobRouterAdministrationOperations { - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" +// #suppress "@azure-tools/typespec-azure-core/use-standard-operations" +// @summary("Creates or updates a classification policy.") +// @doc("Creates or updates a classification policy.") +// @route("/routing/classificationPolicies/{id}") +// @patch +// upsertClassificationPolicy is Azure.Core.Foundations.Operation< +// { +// @doc("content type") +// @header("content-type") +// contentType: "application/merge-patch+json"; + +// @doc("Id of the classification policy.") +// @path +// id: string; + +// @doc(""" +// Model of classification policy properties to be patched. See also: +// https://datatracker.ietf.org/doc/html/rfc7386. +// """) +// @body +// patch: ClassificationPolicy; +// }, +// { +// @statusCode statuscode: 200 | 201; + +// @body result: ClassificationPolicy; +// } +// >; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" + @route("/routing") @summary("Creates or updates a classification policy.") @doc("Creates or updates a classification policy.") - @route("/routing/classificationPolicies/{id}") - @patch - upsertClassificationPolicy is Azure.Core.Foundations.Operation< - { - @doc("content type") - @header("content-type") - contentType: "application/merge-patch+json"; - - @doc("Id of the classification policy.") - @path - id: string; - - @doc(""" -Model of classification policy properties to be patched. See also: -https://datatracker.ietf.org/doc/html/rfc7386. -""") - @body - patch: ClassificationPolicy; - }, - { - @statusCode statuscode: 200 | 201; - - @body result: ClassificationPolicy; - } - >; + upsertClassificationPolicy is Operations.ResourceCreateOrUpdate; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves an existing classification policy by Id.") diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index 7cbc05669155..7564f8b56745 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -128,17 +128,17 @@ { "name": "id", "in": "path", - "description": "Id of the classification policy.", + "description": "Unique identifier of this policy.", "required": true, "type": "string" }, { - "name": "patch", + "name": "resource", "in": "body", - "description": "Model of classification policy properties to be patched. See also:\nhttps://datatracker.ietf.org/doc/html/rfc7386.", + "description": "The resource instance.", "required": true, "schema": { - "$ref": "#/definitions/ClassificationPolicy" + "$ref": "#/definitions/ClassificationPolicyUpdate" } } ], @@ -1863,7 +1863,10 @@ }, "x-ms-identifiers": [] } - } + }, + "required": [ + "id" + ] }, "ClassificationPolicyItem": { "type": "object", @@ -1879,6 +1882,40 @@ } } }, + "ClassificationPolicyUpdate": { + "type": "object", + "description": "A container for the rules that govern how jobs are classified.", + "properties": { + "name": { + "type": "string", + "description": "Friendly name of this policy." + }, + "fallbackQueueId": { + "type": "string", + "description": "The fallback queue to select if the queue selector doesn't find a match." + }, + "queueSelectors": { + "type": "array", + "description": "The queue selectors to resolve a queue for a given job.", + "items": { + "$ref": "#/definitions/QueueSelectorAttachment" + }, + "x-ms-identifiers": [] + }, + "prioritizationRule": { + "$ref": "#/definitions/RouterRule", + "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol." + }, + "workerSelectors": { + "type": "array", + "description": "The worker label selectors to attach to a given job.", + "items": { + "$ref": "#/definitions/WorkerSelectorAttachment" + }, + "x-ms-identifiers": [] + } + } + }, "CloseJobRequest": { "type": "object", "description": "Request payload for closing jobs", From 7a16decb2c65aa6d95115033e74e2d26eb4ad803 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Mon, 18 Sep 2023 16:30:01 -0700 Subject: [PATCH 015/113] use standard ops wherever possible --- .../Communication.JobRouter/models.tsp | 20 +- .../Communication.JobRouter/routes.tsp | 339 ++---------------- .../communicationservicejobrouter.json | 278 ++++++++++++-- 3 files changed, 290 insertions(+), 347 deletions(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index b52bee05f4d2..864cdfef965c 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -249,11 +249,13 @@ model ClassificationPolicyItem { etag?: string; } +@resource("distributionPolicies") @doc("Policy governing how jobs are distributed to workers") model DistributionPolicy { + @key("id") @doc("The unique identifier of the policy.") @visibility("read") - id?: string; + id: string; @doc("The human readable name of the policy.") name?: string; @@ -302,11 +304,13 @@ model DistributionPolicyItem { etag?: string; } +@resource("exceptionPolicies") @doc("A policy that defines actions to execute when exception are triggered.") model ExceptionPolicy { + @key("id") @doc("The Id of the exception policy") @visibility("read") - id?: string; + id: string; @doc("(Optional) The name of the exception policy.") name?: string; @@ -346,11 +350,13 @@ model ExceptionPolicyItem { etag?: string; } +@resource("jobs") @doc("A unit of work to be routed") model RouterJob { + @key("id") @doc("The id of the job.") @visibility("read") - id?: string; + id: string; @doc("Reference to an external parent context, eg. call ID.") channelReference?: string; @@ -667,11 +673,13 @@ declined the job will also be eligible for the job at that time. retryOfferAt?: utcDateTime; } +@resource("queues") @doc("A queue that can contain jobs to be routed.") model RouterQueue { + @key("id") @doc("The Id of this queue") @visibility("read") - id?: string; + id: string; @doc("The name of this queue.") name?: string; @@ -725,11 +733,13 @@ by job priority longestJobWaitTimeMinutes?: float32; } +@resource("workers") @doc("An entity for jobs to be routed to") model RouterWorker { + @key("workerId") @doc("Id of the worker.") @visibility("read") - id?: string; + id: string; @doc("The current state of the worker.") @visibility("read") diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index d464499d6881..fc2a20349c62 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -13,74 +13,26 @@ alias ServiceTraits = NoRepeatableRequests & alias Operations = Azure.Core.ResourceOperations; +@route("/routing") interface JobRouterAdministrationOperations { -// #suppress "@azure-tools/typespec-azure-core/use-standard-operations" -// @summary("Creates or updates a classification policy.") -// @doc("Creates or updates a classification policy.") -// @route("/routing/classificationPolicies/{id}") -// @patch -// upsertClassificationPolicy is Azure.Core.Foundations.Operation< -// { -// @doc("content type") -// @header("content-type") -// contentType: "application/merge-patch+json"; - -// @doc("Id of the classification policy.") -// @path -// id: string; - -// @doc(""" -// Model of classification policy properties to be patched. See also: -// https://datatracker.ietf.org/doc/html/rfc7386. -// """) -// @body -// patch: ClassificationPolicy; -// }, -// { -// @statusCode statuscode: 200 | 201; - -// @body result: ClassificationPolicy; -// } -// >; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" - @route("/routing") @summary("Creates or updates a classification policy.") @doc("Creates or updates a classification policy.") upsertClassificationPolicy is Operations.ResourceCreateOrUpdate; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves an existing classification policy by Id.") @doc("Retrieves an existing classification policy by Id.") - @route("/routing/classificationPolicies/{id}") @get - getClassificationPolicy is Azure.Core.Foundations.Operation< - { - @doc("Id of the classification policy.") - @path - id: string; - }, - ClassificationPolicy - >; + getClassificationPolicy is Operations.ResourceRead; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Delete a classification policy by Id.") @doc("Delete a classification policy by Id.") - @route("/routing/classificationPolicies/{id}") - @delete - deleteClassificationPolicy is Azure.Core.Foundations.Operation< - { - @doc("Id of the classification policy.") - @path - id: string; - }, - void - >; + deleteClassificationPolicy is Operations.ResourceDelete; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves existing classification policies.") @doc("Retrieves existing classification policies.") - @route("/routing/classificationPolicies") + @route("/classificationPolicies") @get listClassificationPolicies is Azure.Core.Foundations.Operation< { @@ -91,67 +43,22 @@ interface JobRouterAdministrationOperations { ClassificationPolicyCollection >; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Creates or updates a distribution policy.") @doc("Creates or updates a distribution policy.") - @route("/routing/distributionPolicies/{id}") - @patch - upsertDistributionPolicy is Azure.Core.Foundations.Operation< - { - @doc("content type") - @header("content-type") - contentType: "application/merge-patch+json"; - - @doc("Id of the distribution policy.") - @path - id: string; - - @doc(""" -Model of distribution policy properties to be patched. See also: -https://datatracker.ietf.org/doc/html/rfc7386. -""") - @body - patch: DistributionPolicy; - }, - { - @statusCode statuscode: 200 | 201; - - @body result: DistributionPolicy; - } - >; + upsertDistributionPolicy is Operations.ResourceCreateOrUpdate; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves an existing distribution policy by Id.") @doc("Retrieves an existing distribution policy by Id.") - @route("/routing/distributionPolicies/{id}") - @get - getDistributionPolicy is Azure.Core.Foundations.Operation< - { - @doc("Id of the distribution policy.") - @path - id: string; - }, - DistributionPolicy - >; + getDistributionPolicy is Operations.ResourceRead; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Delete a distribution policy by Id.") @doc("Delete a distribution policy by Id.") - @route("/routing/distributionPolicies/{id}") - @delete - deleteDistributionPolicy is Azure.Core.Foundations.Operation< - { - @doc("Id of the distribution policy.") - @path - id: string; - }, - void - >; + deleteDistributionPolicy is Operations.ResourceDelete; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves existing distribution policies.") @doc("Retrieves existing distribution policies.") - @route("/routing/distributionPolicies") + @route("/distributionPolicies") @get listDistributionPolicies is Azure.Core.Foundations.Operation< { @@ -162,67 +69,22 @@ https://datatracker.ietf.org/doc/html/rfc7386. DistributionPolicyCollection >; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Creates or updates a exception policy.") @doc("Creates or updates a exception policy.") - @route("/routing/exceptionPolicies/{id}") - @patch - upsertExceptionPolicy is Azure.Core.Foundations.Operation< - { - @doc("content type") - @header("content-type") - contentType: "application/merge-patch+json"; - - @doc("Id of the exception policy.") - @path - id: string; - - @doc(""" -Model of exception policy properties to be patched. See also: -https://datatracker.ietf.org/doc/html/rfc7386 -""") - @body - patch: ExceptionPolicy; - }, - { - @statusCode statuscode: 200 | 201; - - @body result: ExceptionPolicy; - } - >; + upsertExceptionPolicy is Operations.ResourceCreateOrUpdate; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves an existing exception policy by Id.") @doc("Retrieves an existing exception policy by Id.") - @route("/routing/exceptionPolicies/{id}") - @get - getExceptionPolicy is Azure.Core.Foundations.Operation< - { - @doc("Id of the exception policy to retrieve.") - @path - id: string; - }, - ExceptionPolicy - >; + getExceptionPolicy is Operations.ResourceRead; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Deletes a exception policy by Id.") @doc("Deletes a exception policy by Id.") - @route("/routing/exceptionPolicies/{id}") - @delete - deleteExceptionPolicy is Azure.Core.Foundations.Operation< - { - @doc("Id of the exception policy to delete.") - @path - id: string; - }, - void - >; + deleteExceptionPolicy is Operations.ResourceDelete; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves existing exception policies.") @doc("Retrieves existing exception policies.") - @route("/routing/exceptionPolicies") + @route("/exceptionPolicies") @get listExceptionPolicies is Azure.Core.Foundations.Operation< { @@ -233,67 +95,22 @@ https://datatracker.ietf.org/doc/html/rfc7386 ExceptionPolicyCollection >; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Creates or updates a queue.") @doc("Creates or updates a queue.") - @route("/routing/queues/{id}") - @patch - upsertQueue is Azure.Core.Foundations.Operation< - { - @doc("content type") - @header("content-type") - contentType: "application/merge-patch+json"; - - @doc("Id of the queue.") - @path - id: string; - - @doc(""" -Model of queue properties to be patched. See also: -https://datatracker.ietf.org/doc/html/rfc7386. -""") - @body - patch: RouterQueue; - }, - { - @statusCode statuscode: 200 | 201; - - @body result: RouterQueue; - } - >; + upsertQueue is Operations.ResourceCreateOrUpdate; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves an existing queue by Id.") @doc("Retrieves an existing queue by Id.") - @route("/routing/queues/{id}") - @get - getQueue is Azure.Core.Foundations.Operation< - { - @doc("Id of the queue to retrieve.") - @path - id: string; - }, - RouterQueue - >; + getQueue is Operations.ResourceRead; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Deletes a queue by Id.") @doc("Deletes a queue by Id.") - @route("/routing/queues/{id}") - @delete - deleteQueue is Azure.Core.Foundations.Operation< - { - @doc("Id of the queue to delete.") - @path - id: string; - }, - void - >; + deleteQueue is Operations.ResourceDelete; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves existing queues.") @doc("Retrieves existing queues.") - @route("/routing/queues") + @route("/queues") @get listQueues is Azure.Core.Foundations.Operation< { @@ -305,68 +122,25 @@ https://datatracker.ietf.org/doc/html/rfc7386. >; } +@route("/routing") interface JobRouterOperations { - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Creates or updates a router job.") @doc("Creates or updates a router job.") - @route("/routing/jobs/{id}") - @patch - upsertJob is Azure.Core.Foundations.Operation< - { - @doc("content type") - @header("content-type") - contentType: "application/merge-patch+json"; - - @doc("Id of the job.") - @path - id: string; - - @doc(""" -Model of job properties to be created or patched. See also: -https://datatracker.ietf.org/doc/html/rfc7386. -""") - @body - patch: RouterJob; - }, - { - @statusCode statuscode: 200 | 201; - - @body result: RouterJob; - } - >; + upsertJob is Operations.ResourceCreateOrUpdate; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves an existing job by Id.") @doc("Retrieves an existing job by Id.") - @route("/routing/jobs/{id}") - @get - getJob is Azure.Core.Foundations.Operation< - { - @doc("Id of the job to retrieve.") - @path - id: string; - }, - RouterJob - >; + getJob is Operations.ResourceRead; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Deletes a job and all of its traces.") @doc("Deletes a job and all of its traces.") - @route("/routing/jobs/{id}") - @delete - deleteJob is Azure.Core.Foundations.Operation< - { - @doc("Id of the job.") - @path - id: string; - }, - void - >; + deleteJob is Operations.ResourceDelete; + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Reclassify a job.") @doc("Reclassify a job.") - @route("/routing/jobs/{id}:reclassify") + @route("/jobs/{id}:reclassify") @post reclassifyJobAction is Azure.Core.Foundations.Operation< { @@ -390,7 +164,7 @@ cancellation reason. Submits request to cancel an existing job by Id while supplying free-form cancellation reason. """) - @route("/routing/jobs/{id}:cancel") + @route("/jobs/{id}:cancel") @post cancelJobAction is Azure.Core.Foundations.Operation< { @@ -408,7 +182,7 @@ cancellation reason. #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Completes an assigned job.") @doc("Completes an assigned job.") - @route("/routing/jobs/{id}:complete") + @route("/jobs/{id}:complete") @post completeJobAction is Azure.Core.Foundations.Operation< { @@ -426,7 +200,7 @@ cancellation reason. #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Closes a completed job.") @doc("Closes a completed job.") - @route("/routing/jobs/{id}:close") + @route("/jobs/{id}:close") @post closeJobAction is Azure.Core.Foundations.Operation< { @@ -444,7 +218,7 @@ cancellation reason. #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves list of jobs based on filter parameters.") @doc("Retrieves list of jobs based on filter parameters.") - @route("/routing/jobs") + @route("/jobs") @get listJobs is Azure.Core.Foundations.Operation< { @@ -488,7 +262,7 @@ If specified, filter on jobs that was scheduled at or after given value. Range: #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Gets a job's position details.") @doc("Gets a job's position details.") - @route("/routing/jobs/{id}/position") + @route("/jobs/{id}/position") @get getInQueuePosition is Azure.Core.Foundations.Operation< { @@ -502,7 +276,7 @@ If specified, filter on jobs that was scheduled at or after given value. Range: #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Un-assign a job.") @doc("Un-assign a job.") - @route("/routing/jobs/{id}/assignments/{assignmentId}:unassign") + @route("/jobs/{id}/assignments/{assignmentId}:unassign") @post unassignJobAction is Azure.Core.Foundations.Operation< { @@ -530,7 +304,7 @@ accepted the job already. Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already. """) - @route("/routing/workers/{workerId}/offers/{offerId}:accept") + @route("/workers/{workerId}/offers/{offerId}:accept") @post acceptJobAction is Azure.Core.Foundations.Operation< { @@ -548,7 +322,7 @@ accepted the job already. #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Declines an offer to work on a job.") @doc("Declines an offer to work on a job.") - @route("/routing/workers/{workerId}/offers/{offerId}:decline") + @route("/workers/{workerId}/offers/{offerId}:decline") @post declineJobAction is Azure.Core.Foundations.Operation< { @@ -570,7 +344,7 @@ accepted the job already. #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves a queue's statistics.") @doc("Retrieves a queue's statistics.") - @route("/routing/queues/{id}/statistics") + @route("/queues/{id}/statistics") @get getQueueStatistics is Azure.Core.Foundations.Operation< { @@ -581,62 +355,17 @@ accepted the job already. RouterQueueStatistics >; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Creates or updates a worker.") @doc("Creates or updates a worker.") - @route("/routing/workers/{workerId}") - @patch - upsertWorker is Azure.Core.Foundations.Operation< - { - @doc("content type") - @header("content-type") - contentType: "application/merge-patch+json"; - - @doc("Id of the worker.") - @path - workerId: string; - - @doc(""" -Model of worker properties to be created or patched. See also: -https://datatracker.ietf.org/doc/html/rfc7386. -""") - @body - patch: RouterWorker; - }, - { - @statusCode statuscode: 200 | 201; - - @body result: RouterWorker; - } - >; + upsertWorker is Operations.ResourceCreateOrUpdate; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves an existing worker by Id.") @doc("Retrieves an existing worker by Id.") - @route("/routing/workers/{workerId}") - @get - getWorker is Azure.Core.Foundations.Operation< - { - @doc("Id of the worker to retrieve.") - @path - workerId: string; - }, - RouterWorker - >; + getWorker is Operations.ResourceRead; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Deletes a worker and all of its traces.") @doc("Deletes a worker and all of its traces.") - @route("/routing/workers/{workerId}") - @delete - deleteWorker is Azure.Core.Foundations.Operation< - { - @doc("Id of the worker to delete.") - @path - workerId: string; - }, - void - >; + deleteWorker is Operations.ResourceDelete; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves existing workers.") diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index 7564f8b56745..e8811b1aebfa 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -88,7 +88,7 @@ { "name": "id", "in": "path", - "description": "Id of the classification policy.", + "description": "Unique identifier of this policy.", "required": true, "type": "string" } @@ -180,7 +180,7 @@ { "name": "id", "in": "path", - "description": "Id of the classification policy.", + "description": "Unique identifier of this policy.", "required": true, "type": "string" } @@ -259,7 +259,7 @@ { "name": "id", "in": "path", - "description": "Id of the distribution policy.", + "description": "The unique identifier of the policy.", "required": true, "type": "string" } @@ -299,17 +299,17 @@ { "name": "id", "in": "path", - "description": "Id of the distribution policy.", + "description": "The unique identifier of the policy.", "required": true, "type": "string" }, { - "name": "patch", + "name": "resource", "in": "body", - "description": "Model of distribution policy properties to be patched. See also:\nhttps://datatracker.ietf.org/doc/html/rfc7386.", + "description": "The resource instance.", "required": true, "schema": { - "$ref": "#/definitions/DistributionPolicy" + "$ref": "#/definitions/DistributionPolicyUpdate" } } ], @@ -351,7 +351,7 @@ { "name": "id", "in": "path", - "description": "Id of the distribution policy.", + "description": "The unique identifier of the policy.", "required": true, "type": "string" } @@ -430,7 +430,7 @@ { "name": "id", "in": "path", - "description": "Id of the exception policy to retrieve.", + "description": "The Id of the exception policy", "required": true, "type": "string" } @@ -470,17 +470,17 @@ { "name": "id", "in": "path", - "description": "Id of the exception policy.", + "description": "The Id of the exception policy", "required": true, "type": "string" }, { - "name": "patch", + "name": "resource", "in": "body", - "description": "Model of exception policy properties to be patched. See also:\nhttps://datatracker.ietf.org/doc/html/rfc7386", + "description": "The resource instance.", "required": true, "schema": { - "$ref": "#/definitions/ExceptionPolicy" + "$ref": "#/definitions/ExceptionPolicyUpdate" } } ], @@ -522,7 +522,7 @@ { "name": "id", "in": "path", - "description": "Id of the exception policy to delete.", + "description": "The Id of the exception policy", "required": true, "type": "string" } @@ -737,7 +737,7 @@ { "name": "id", "in": "path", - "description": "Id of the job to retrieve.", + "description": "The id of the job.", "required": true, "type": "string" } @@ -777,17 +777,17 @@ { "name": "id", "in": "path", - "description": "Id of the job.", + "description": "The id of the job.", "required": true, "type": "string" }, { - "name": "patch", + "name": "resource", "in": "body", - "description": "Model of job properties to be created or patched. See also:\nhttps://datatracker.ietf.org/doc/html/rfc7386.", + "description": "The resource instance.", "required": true, "schema": { - "$ref": "#/definitions/RouterJob" + "$ref": "#/definitions/RouterJobUpdate" } } ], @@ -829,7 +829,7 @@ { "name": "id", "in": "path", - "description": "Id of the job.", + "description": "The id of the job.", "required": true, "type": "string" } @@ -1183,7 +1183,7 @@ { "name": "id", "in": "path", - "description": "Id of the queue to retrieve.", + "description": "The Id of this queue", "required": true, "type": "string" } @@ -1223,17 +1223,17 @@ { "name": "id", "in": "path", - "description": "Id of the queue.", + "description": "The Id of this queue", "required": true, "type": "string" }, { - "name": "patch", + "name": "resource", "in": "body", - "description": "Model of queue properties to be patched. See also:\nhttps://datatracker.ietf.org/doc/html/rfc7386.", + "description": "The resource instance.", "required": true, "schema": { - "$ref": "#/definitions/RouterQueue" + "$ref": "#/definitions/RouterQueueUpdate" } } ], @@ -1275,7 +1275,7 @@ { "name": "id", "in": "path", - "description": "Id of the queue to delete.", + "description": "The Id of this queue", "required": true, "type": "string" } @@ -1338,7 +1338,7 @@ } } }, - "/routing/workers": { + "/routing/routing/workers": { "get": { "operationId": "JobRouterOperations_ListWorkers", "summary": "Retrieves existing workers.", @@ -1453,7 +1453,7 @@ { "name": "workerId", "in": "path", - "description": "Id of the worker to retrieve.", + "description": "Id of the worker.", "required": true, "type": "string" } @@ -1498,12 +1498,12 @@ "type": "string" }, { - "name": "patch", + "name": "resource", "in": "body", - "description": "Model of worker properties to be created or patched. See also:\nhttps://datatracker.ietf.org/doc/html/rfc7386.", + "description": "The resource instance.", "required": true, "schema": { - "$ref": "#/definitions/RouterWorker" + "$ref": "#/definitions/RouterWorkerUpdate" } } ], @@ -1545,7 +1545,7 @@ { "name": "workerId", "in": "path", - "description": "Id of the worker to delete.", + "description": "Id of the worker.", "required": true, "type": "string" } @@ -1826,6 +1826,22 @@ "capacityCostPerJob" ] }, + "ChannelConfigurationUpdate": { + "type": "object", + "description": "Represents the capacity a job in this channel will consume from a worker", + "properties": { + "capacityCostPerJob": { + "type": "integer", + "format": "int32", + "description": "The amount of capacity that an instance of a job of this channel will consume\nof the total worker capacity." + }, + "maxNumberOfJobs": { + "type": "integer", + "format": "int32", + "description": "The maximum number of jobs that can be supported concurrently for this channel." + } + } + }, "ClassificationPolicy": { "type": "object", "description": "A container for the rules that govern how jobs are classified.", @@ -2087,7 +2103,10 @@ "$ref": "#/definitions/DistributionMode", "description": "Abstract base class for defining a distribution mode" } - } + }, + "required": [ + "id" + ] }, "DistributionPolicyItem": { "type": "object", @@ -2103,6 +2122,25 @@ } } }, + "DistributionPolicyUpdate": { + "type": "object", + "description": "Policy governing how jobs are distributed to workers", + "properties": { + "name": { + "type": "string", + "description": "The human readable name of the policy." + }, + "offerExpiresAfterSeconds": { + "type": "number", + "format": "float", + "description": "The number of seconds after which any offers created under this policy will be\nexpired." + }, + "mode": { + "$ref": "#/definitions/DistributionMode", + "description": "Abstract base class for defining a distribution mode" + } + } + }, "ExceptionAction": { "type": "object", "description": "The action to take when the exception is triggered", @@ -2137,7 +2175,10 @@ "$ref": "#/definitions/ExceptionRule" } } - } + }, + "required": [ + "id" + ] }, "ExceptionPolicyItem": { "type": "object", @@ -2153,6 +2194,23 @@ } } }, + "ExceptionPolicyUpdate": { + "type": "object", + "description": "A policy that defines actions to execute when exception are triggered.", + "properties": { + "name": { + "type": "string", + "description": "(Optional) The name of the exception policy." + }, + "exceptionRules": { + "type": "object", + "description": "(Optional) A dictionary collection of exception rules on the exception policy.\nKey is the Id of each exception rule.", + "additionalProperties": { + "$ref": "#/definitions/ExceptionRuleUpdate" + } + } + } + }, "ExceptionRule": { "type": "object", "description": "A rule that defines actions to execute upon a specific trigger.", @@ -2174,6 +2232,23 @@ "actions" ] }, + "ExceptionRuleUpdate": { + "type": "object", + "description": "A rule that defines actions to execute upon a specific trigger.", + "properties": { + "trigger": { + "$ref": "#/definitions/ExceptionTrigger", + "description": "The trigger for this exception rule" + }, + "actions": { + "type": "object", + "description": "A dictionary collection of actions to perform once the exception is triggered.\nKey is the Id of each exception action.", + "additionalProperties": { + "$ref": "#/definitions/ExceptionAction" + } + } + } + }, "ExceptionTrigger": { "type": "object", "description": "The trigger for this exception rule", @@ -2794,7 +2869,10 @@ "$ref": "#/definitions/JobMatchingMode", "description": "The matching mode to be applied to this job.\n \nSupported types:\n \n \nQueueAndMatchMode: Used when matching worker to a job is required to be\ndone right after job is queued.\nScheduleAndSuspendMode: Used for scheduling\njobs to be queued at a future time. At specified time, matching of a worker to\nthe job will not start automatically.\nSuspendMode: Used when matching workers\nto a job needs to be suspended." } - } + }, + "required": [ + "id" + ] }, "RouterJobAssignment": { "type": "object", @@ -2997,6 +3075,66 @@ ] } }, + "RouterJobUpdate": { + "type": "object", + "description": "A unit of work to be routed", + "properties": { + "channelReference": { + "type": "string", + "description": "Reference to an external parent context, eg. call ID." + }, + "channelId": { + "type": "string", + "description": "The channel identifier. eg. voice, chat, etc." + }, + "classificationPolicyId": { + "type": "string", + "description": "The Id of the Classification policy used for classifying a job." + }, + "queueId": { + "type": "string", + "description": "The Id of the Queue that this job is queued to." + }, + "priority": { + "type": "integer", + "format": "int32", + "description": "The priority of this job." + }, + "dispositionCode": { + "type": "string", + "description": "Reason code for cancelled or closed jobs." + }, + "requestedWorkerSelectors": { + "type": "array", + "description": "A collection of manually specified label selectors, which a worker must satisfy\nin order to process this job.", + "items": { + "$ref": "#/definitions/RouterWorkerSelector" + }, + "x-ms-identifiers": [] + }, + "labels": { + "type": "object", + "description": "A set of key/value pairs that are identifying attributes used by the rules\nengines to make decisions.", + "additionalProperties": true + }, + "tags": { + "type": "object", + "description": "A set of non-identifying attributes attached to this job", + "additionalProperties": true + }, + "notes": { + "type": "object", + "description": "Notes attached to a job, sorted by timestamp", + "additionalProperties": { + "type": "string" + } + }, + "matchingMode": { + "$ref": "#/definitions/JobMatchingMode", + "description": "The matching mode to be applied to this job.\n \nSupported types:\n \n \nQueueAndMatchMode: Used when matching worker to a job is required to be\ndone right after job is queued.\nScheduleAndSuspendMode: Used for scheduling\njobs to be queued at a future time. At specified time, matching of a worker to\nthe job will not start automatically.\nSuspendMode: Used when matching workers\nto a job needs to be suspended." + } + } + }, "RouterQueue": { "type": "object", "description": "A queue that can contain jobs to be routed.", @@ -3023,7 +3161,10 @@ "type": "string", "description": "(Optional) The ID of the exception policy that determines various job\nescalation rules." } - } + }, + "required": [ + "id" + ] }, "RouterQueueItem": { "type": "object", @@ -3092,6 +3233,29 @@ "length" ] }, + "RouterQueueUpdate": { + "type": "object", + "description": "A queue that can contain jobs to be routed.", + "properties": { + "name": { + "type": "string", + "description": "The name of this queue." + }, + "distributionPolicyId": { + "type": "string", + "description": "The ID of the distribution policy that will determine how a job is distributed\nto workers." + }, + "labels": { + "type": "object", + "description": "A set of key/value pairs that are identifying attributes used by the rules\nengines to make decisions.", + "additionalProperties": true + }, + "exceptionPolicyId": { + "type": "string", + "description": "(Optional) The ID of the exception policy that determines various job\nescalation rules." + } + } + }, "RouterRule": { "type": "object", "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol.", @@ -3175,7 +3339,10 @@ "type": "boolean", "description": "A flag indicating this worker is open to receive offers or not." } - } + }, + "required": [ + "id" + ] }, "RouterWorkerAssignment": { "type": "object", @@ -3316,6 +3483,43 @@ ] } }, + "RouterWorkerUpdate": { + "type": "object", + "description": "An entity for jobs to be routed to", + "properties": { + "queueAssignments": { + "type": "object", + "description": "The queue(s) that this worker can receive work from.", + "additionalProperties": true + }, + "totalCapacity": { + "type": "integer", + "format": "int32", + "description": "The total capacity score this worker has to manage multiple concurrent jobs." + }, + "labels": { + "type": "object", + "description": "A set of key/value pairs that are identifying attributes used by the rules\nengines to make decisions.", + "additionalProperties": true + }, + "tags": { + "type": "object", + "description": "A set of non-identifying attributes attached to this worker.", + "additionalProperties": true + }, + "channelConfigurations": { + "type": "object", + "description": "The channel(s) this worker can handle and their impact on the workers capacity.", + "additionalProperties": { + "$ref": "#/definitions/ChannelConfigurationUpdate" + } + }, + "availableForOffers": { + "type": "boolean", + "description": "A flag indicating this worker is open to receive offers or not." + } + } + }, "RuleEngineQueueSelectorAttachment": { "type": "object", "description": "Attaches queue selectors to a job when the RouterRule is resolved", From a2ea7e7bef548efbf9e354bd67b6e4a78a1cee65 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Mon, 18 Sep 2023 16:38:09 -0700 Subject: [PATCH 016/113] try placing route decorator at namespace level --- specification/communication/Communication.JobRouter/routes.tsp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index fc2a20349c62..3086abf27d0a 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -6,6 +6,7 @@ using TypeSpec.Rest; using TypeSpec.Http; using Azure.Core.Traits; +@route("/routing") namespace AzureCommunicationRoutingService; alias ServiceTraits = NoRepeatableRequests & @@ -13,7 +14,6 @@ alias ServiceTraits = NoRepeatableRequests & alias Operations = Azure.Core.ResourceOperations; -@route("/routing") interface JobRouterAdministrationOperations { @summary("Creates or updates a classification policy.") @@ -122,7 +122,6 @@ interface JobRouterAdministrationOperations { >; } -@route("/routing") interface JobRouterOperations { @summary("Creates or updates a router job.") @doc("Creates or updates a router job.") From 2fc837310e7b907d2f5a45f75ffe71a3be2ae332 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Mon, 18 Sep 2023 16:52:35 -0700 Subject: [PATCH 017/113] remove router decorator from namespace --- .../Communication.JobRouter/routes.tsp | 67 ++++++++++++++----- .../communicationservicejobrouter.json | 2 +- 2 files changed, 51 insertions(+), 18 deletions(-) diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index 3086abf27d0a..05c415f8e2e8 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -6,7 +6,6 @@ using TypeSpec.Rest; using TypeSpec.Http; using Azure.Core.Traits; -@route("/routing") namespace AzureCommunicationRoutingService; alias ServiceTraits = NoRepeatableRequests & @@ -15,24 +14,28 @@ alias ServiceTraits = NoRepeatableRequests & alias Operations = Azure.Core.ResourceOperations; interface JobRouterAdministrationOperations { - + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a classification policy.") @doc("Creates or updates a classification policy.") + @route("/routing") upsertClassificationPolicy is Operations.ResourceCreateOrUpdate; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing classification policy by Id.") @doc("Retrieves an existing classification policy by Id.") - @get + @route("/routing") getClassificationPolicy is Operations.ResourceRead; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Delete a classification policy by Id.") @doc("Delete a classification policy by Id.") + @route("/routing") deleteClassificationPolicy is Operations.ResourceDelete; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves existing classification policies.") @doc("Retrieves existing classification policies.") - @route("/classificationPolicies") + @route("/routing/classificationPolicies") @get listClassificationPolicies is Azure.Core.Foundations.Operation< { @@ -43,22 +46,28 @@ interface JobRouterAdministrationOperations { ClassificationPolicyCollection >; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a distribution policy.") @doc("Creates or updates a distribution policy.") + @route("/routing") upsertDistributionPolicy is Operations.ResourceCreateOrUpdate; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing distribution policy by Id.") @doc("Retrieves an existing distribution policy by Id.") + @route("/routing") getDistributionPolicy is Operations.ResourceRead; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Delete a distribution policy by Id.") @doc("Delete a distribution policy by Id.") + @route("/routing") deleteDistributionPolicy is Operations.ResourceDelete; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves existing distribution policies.") @doc("Retrieves existing distribution policies.") - @route("/distributionPolicies") + @route("/routing/distributionPolicies") @get listDistributionPolicies is Azure.Core.Foundations.Operation< { @@ -69,22 +78,28 @@ interface JobRouterAdministrationOperations { DistributionPolicyCollection >; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a exception policy.") @doc("Creates or updates a exception policy.") + @route("/routing") upsertExceptionPolicy is Operations.ResourceCreateOrUpdate; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing exception policy by Id.") @doc("Retrieves an existing exception policy by Id.") + @route("/routing") getExceptionPolicy is Operations.ResourceRead; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Deletes a exception policy by Id.") @doc("Deletes a exception policy by Id.") + @route("/routing") deleteExceptionPolicy is Operations.ResourceDelete; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves existing exception policies.") @doc("Retrieves existing exception policies.") - @route("/exceptionPolicies") + @route("/routing/exceptionPolicies") @get listExceptionPolicies is Azure.Core.Foundations.Operation< { @@ -95,22 +110,28 @@ interface JobRouterAdministrationOperations { ExceptionPolicyCollection >; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a queue.") @doc("Creates or updates a queue.") + @route("/routing") upsertQueue is Operations.ResourceCreateOrUpdate; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing queue by Id.") @doc("Retrieves an existing queue by Id.") + @route("/routing") getQueue is Operations.ResourceRead; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Deletes a queue by Id.") @doc("Deletes a queue by Id.") + @route("/routing") deleteQueue is Operations.ResourceDelete; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves existing queues.") @doc("Retrieves existing queues.") - @route("/queues") + @route("/routing/queues") @get listQueues is Azure.Core.Foundations.Operation< { @@ -123,23 +144,29 @@ interface JobRouterAdministrationOperations { } interface JobRouterOperations { + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a router job.") @doc("Creates or updates a router job.") + @route("/routing") upsertJob is Operations.ResourceCreateOrUpdate; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing job by Id.") @doc("Retrieves an existing job by Id.") + @route("/routing") getJob is Operations.ResourceRead; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Deletes a job and all of its traces.") @doc("Deletes a job and all of its traces.") + @route("/routing") deleteJob is Operations.ResourceDelete; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Reclassify a job.") @doc("Reclassify a job.") - @route("/jobs/{id}:reclassify") + @route("/routing/jobs/{id}:reclassify") @post reclassifyJobAction is Azure.Core.Foundations.Operation< { @@ -163,7 +190,7 @@ cancellation reason. Submits request to cancel an existing job by Id while supplying free-form cancellation reason. """) - @route("/jobs/{id}:cancel") + @route("/routing/jobs/{id}:cancel") @post cancelJobAction is Azure.Core.Foundations.Operation< { @@ -181,7 +208,7 @@ cancellation reason. #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Completes an assigned job.") @doc("Completes an assigned job.") - @route("/jobs/{id}:complete") + @route("/routing/jobs/{id}:complete") @post completeJobAction is Azure.Core.Foundations.Operation< { @@ -199,7 +226,7 @@ cancellation reason. #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Closes a completed job.") @doc("Closes a completed job.") - @route("/jobs/{id}:close") + @route("/routing/jobs/{id}:close") @post closeJobAction is Azure.Core.Foundations.Operation< { @@ -217,7 +244,7 @@ cancellation reason. #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves list of jobs based on filter parameters.") @doc("Retrieves list of jobs based on filter parameters.") - @route("/jobs") + @route("/routing/jobs") @get listJobs is Azure.Core.Foundations.Operation< { @@ -261,7 +288,7 @@ If specified, filter on jobs that was scheduled at or after given value. Range: #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Gets a job's position details.") @doc("Gets a job's position details.") - @route("/jobs/{id}/position") + @route("/routing/jobs/{id}/position") @get getInQueuePosition is Azure.Core.Foundations.Operation< { @@ -275,7 +302,7 @@ If specified, filter on jobs that was scheduled at or after given value. Range: #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Un-assign a job.") @doc("Un-assign a job.") - @route("/jobs/{id}/assignments/{assignmentId}:unassign") + @route("/routing/jobs/{id}/assignments/{assignmentId}:unassign") @post unassignJobAction is Azure.Core.Foundations.Operation< { @@ -303,7 +330,7 @@ accepted the job already. Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already. """) - @route("/workers/{workerId}/offers/{offerId}:accept") + @route("/routing/workers/{workerId}/offers/{offerId}:accept") @post acceptJobAction is Azure.Core.Foundations.Operation< { @@ -321,7 +348,7 @@ accepted the job already. #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Declines an offer to work on a job.") @doc("Declines an offer to work on a job.") - @route("/workers/{workerId}/offers/{offerId}:decline") + @route("/routing/workers/{workerId}/offers/{offerId}:decline") @post declineJobAction is Azure.Core.Foundations.Operation< { @@ -343,7 +370,7 @@ accepted the job already. #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves a queue's statistics.") @doc("Retrieves a queue's statistics.") - @route("/queues/{id}/statistics") + @route("/routing/queues/{id}/statistics") @get getQueueStatistics is Azure.Core.Foundations.Operation< { @@ -354,16 +381,22 @@ accepted the job already. RouterQueueStatistics >; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a worker.") @doc("Creates or updates a worker.") + @route("/routing") upsertWorker is Operations.ResourceCreateOrUpdate; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing worker by Id.") @doc("Retrieves an existing worker by Id.") + @route("/routing") getWorker is Operations.ResourceRead; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Deletes a worker and all of its traces.") @doc("Deletes a worker and all of its traces.") + @route("/routing") deleteWorker is Operations.ResourceDelete; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index e8811b1aebfa..28b6f25be756 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -1338,7 +1338,7 @@ } } }, - "/routing/routing/workers": { + "/routing/workers": { "get": { "operationId": "JobRouterOperations_ListWorkers", "summary": "Retrieves existing workers.", From 8fb85c5a12c9a30ae31cc89ad40a4737be8ed2ea Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Mon, 18 Sep 2023 17:00:24 -0700 Subject: [PATCH 018/113] update tspconfig --- .../communication/Communication.JobRouter/tspconfig.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/communication/Communication.JobRouter/tspconfig.yaml b/specification/communication/Communication.JobRouter/tspconfig.yaml index de255e147263..9dcdb9714185 100644 --- a/specification/communication/Communication.JobRouter/tspconfig.yaml +++ b/specification/communication/Communication.JobRouter/tspconfig.yaml @@ -29,7 +29,6 @@ options: namespace: Azure.Communication.JobRouter package-dir: "Azure.Communication.JobRouter" save-inputs: true - generate-convenience-methods: true "@azure-tools/typespec-python": emitter-output-dir: "{python-sdk-folder}/sdk/{service-directory-name}/{package-name}" package-name: "azure-communication-jobrouter" From 49d0ac2deac2b537a6ab1e40de6738e776ccbebc Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 19 Sep 2023 16:08:06 -0700 Subject: [PATCH 019/113] add conditional headers --- .../Communication.JobRouter/models.tsp | 53 ++++ .../Communication.JobRouter/routes.tsp | 28 ++- .../communicationservicejobrouter.json | 235 ++++++++++++++++++ 3 files changed, 304 insertions(+), 12 deletions(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 864cdfef965c..5410dec4aa85 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -6,12 +6,65 @@ import "@azure-tools/typespec-azure-core"; using TypeSpec.Http; using TypeSpec.Rest; using TypeSpec.Versioning; +using TypeSpec.Reflection; using Azure.Core; using Azure.Core.Traits; @versioned(AzureCommunicationRoutingService.Versions) namespace AzureCommunicationRoutingService; + +@doc("Provides the 'Last-Modified' header to enable conditional (cached) requests") +model LastModifiedResponseEnvelope { + @header("Last-Modified") + @visibility("read") + @doc("The last modified timestamp.") + lastModifiedTimestamp?: string; +} + +// https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#conditional-requests + +@doc("Provides the 'If-*' headers to enable conditional (cached) responses for JobRouter.") +model RouterConditionalRequestHeaders { + @visibility("read", "query", "create", "update", "delete") + @header("If-Match") + @doc("The request should only proceed if an entity matches this string.") + ifMatch?: string; + + @visibility("read", "query", "create", "update", "delete") + @header("If-Unmodified-Since") + @doc("The request should only proceed if the entity was not modified after this time.") + ifUnmodifiedSince?: utcDateTime; +} + +/** + * Provides conditional request headers for requests and ETag headers for responses for JobRouter. + * JobRouter support conditional updates based on 'If-Match' and/or 'If-Unmodified-Since' headers only. + * @template TVersionAdded The version when the trait was added to the specification. + * Leave this empty if the trait is always supported. + */ +@trait("ConditionalRequests") +@traitAdded(TVersionAdded) +model SupportsRouterConditionalPatchUpdateRequests { + #suppress "@azure-tools/typespec-providerhub/no-inline-model" "This inline model is never used directly in operations." + conditionalRequests: { + @traitContext(TraitContext.Update) + @traitLocation(TraitLocation.Parameters) + parameters: RouterConditionalRequestHeaders; + }; +} + +@trait("RouterReturnConditionalResponseHeaders") +@traitAdded(TVersionAdded) +model RouterReturnConditionalResponseHeaders { + conditionalResponseHeaders: { + @traitContext(TraitContext.Create | TraitContext.Update | TraitContext.Read) + @traitLocation(TraitLocation.Response) + response: EtagResponseEnvelope & LastModifiedResponseEnvelope; + }; +} + + @doc("The status of the Job.") enum RouterJobStatus { @doc("Job is waiting to be classified.") diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index 05c415f8e2e8..0deebcf370a2 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -10,21 +10,25 @@ namespace AzureCommunicationRoutingService; alias ServiceTraits = NoRepeatableRequests & NoConditionalRequests & NoClientRequestId; +alias PatchOperationTraits = NoRepeatableRequests & NoClientRequestId & SupportsRouterConditionalPatchUpdateRequests & RouterReturnConditionalResponseHeaders; +alias GetOperationTraits = ServiceTraits & RouterReturnConditionalResponseHeaders; alias Operations = Azure.Core.ResourceOperations; +alias GetOperations = Azure.Core.ResourceOperations; +alias PatchOperations = Azure.Core.ResourceOperations; interface JobRouterAdministrationOperations { #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a classification policy.") @doc("Creates or updates a classification policy.") @route("/routing") - upsertClassificationPolicy is Operations.ResourceCreateOrUpdate; + upsertClassificationPolicy is PatchOperations.ResourceCreateOrUpdate; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing classification policy by Id.") @doc("Retrieves an existing classification policy by Id.") @route("/routing") - getClassificationPolicy is Operations.ResourceRead; + getClassificationPolicy is GetOperations.ResourceRead; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Delete a classification policy by Id.") @@ -50,13 +54,13 @@ interface JobRouterAdministrationOperations { @summary("Creates or updates a distribution policy.") @doc("Creates or updates a distribution policy.") @route("/routing") - upsertDistributionPolicy is Operations.ResourceCreateOrUpdate; + upsertDistributionPolicy is PatchOperations.ResourceCreateOrUpdate; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing distribution policy by Id.") @doc("Retrieves an existing distribution policy by Id.") @route("/routing") - getDistributionPolicy is Operations.ResourceRead; + getDistributionPolicy is GetOperations.ResourceRead; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Delete a distribution policy by Id.") @@ -82,13 +86,13 @@ interface JobRouterAdministrationOperations { @summary("Creates or updates a exception policy.") @doc("Creates or updates a exception policy.") @route("/routing") - upsertExceptionPolicy is Operations.ResourceCreateOrUpdate; + upsertExceptionPolicy is PatchOperations.ResourceCreateOrUpdate; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing exception policy by Id.") @doc("Retrieves an existing exception policy by Id.") @route("/routing") - getExceptionPolicy is Operations.ResourceRead; + getExceptionPolicy is GetOperations.ResourceRead; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Deletes a exception policy by Id.") @@ -114,13 +118,13 @@ interface JobRouterAdministrationOperations { @summary("Creates or updates a queue.") @doc("Creates or updates a queue.") @route("/routing") - upsertQueue is Operations.ResourceCreateOrUpdate; + upsertQueue is PatchOperations.ResourceCreateOrUpdate; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing queue by Id.") @doc("Retrieves an existing queue by Id.") @route("/routing") - getQueue is Operations.ResourceRead; + getQueue is GetOperations.ResourceRead; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Deletes a queue by Id.") @@ -148,13 +152,13 @@ interface JobRouterOperations { @summary("Creates or updates a router job.") @doc("Creates or updates a router job.") @route("/routing") - upsertJob is Operations.ResourceCreateOrUpdate; + upsertJob is PatchOperations.ResourceCreateOrUpdate; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing job by Id.") @doc("Retrieves an existing job by Id.") @route("/routing") - getJob is Operations.ResourceRead; + getJob is GetOperations.ResourceRead; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Deletes a job and all of its traces.") @@ -385,13 +389,13 @@ accepted the job already. @summary("Creates or updates a worker.") @doc("Creates or updates a worker.") @route("/routing") - upsertWorker is Operations.ResourceCreateOrUpdate; + upsertWorker is PatchOperations.ResourceCreateOrUpdate; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing worker by Id.") @doc("Retrieves an existing worker by Id.") @route("/routing") - getWorker is Operations.ResourceRead; + getWorker is GetOperations.ResourceRead; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Deletes a worker and all of its traces.") diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index 28b6f25be756..609a9dfacca8 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -98,6 +98,16 @@ "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/ClassificationPolicy" + }, + "headers": { + "ETag": { + "type": "string", + "description": "The entity tag for the response." + }, + "Last-Modified": { + "type": "string", + "description": "The last modified timestamp." + } } }, "default": { @@ -132,6 +142,12 @@ "required": true, "type": "string" }, + { + "$ref": "#/parameters/RouterConditionalRequestHeaders.ifMatch" + }, + { + "$ref": "#/parameters/RouterConditionalRequestHeaders.ifUnmodifiedSince" + }, { "name": "resource", "in": "body", @@ -147,12 +163,32 @@ "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/ClassificationPolicy" + }, + "headers": { + "ETag": { + "type": "string", + "description": "The entity tag for the response." + }, + "Last-Modified": { + "type": "string", + "description": "The last modified timestamp." + } } }, "201": { "description": "The request has succeeded and a new resource has been created as a result.", "schema": { "$ref": "#/definitions/ClassificationPolicy" + }, + "headers": { + "ETag": { + "type": "string", + "description": "The entity tag for the response." + }, + "Last-Modified": { + "type": "string", + "description": "The last modified timestamp." + } } }, "default": { @@ -269,6 +305,16 @@ "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/DistributionPolicy" + }, + "headers": { + "ETag": { + "type": "string", + "description": "The entity tag for the response." + }, + "Last-Modified": { + "type": "string", + "description": "The last modified timestamp." + } } }, "default": { @@ -303,6 +349,12 @@ "required": true, "type": "string" }, + { + "$ref": "#/parameters/RouterConditionalRequestHeaders.ifMatch" + }, + { + "$ref": "#/parameters/RouterConditionalRequestHeaders.ifUnmodifiedSince" + }, { "name": "resource", "in": "body", @@ -318,12 +370,32 @@ "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/DistributionPolicy" + }, + "headers": { + "ETag": { + "type": "string", + "description": "The entity tag for the response." + }, + "Last-Modified": { + "type": "string", + "description": "The last modified timestamp." + } } }, "201": { "description": "The request has succeeded and a new resource has been created as a result.", "schema": { "$ref": "#/definitions/DistributionPolicy" + }, + "headers": { + "ETag": { + "type": "string", + "description": "The entity tag for the response." + }, + "Last-Modified": { + "type": "string", + "description": "The last modified timestamp." + } } }, "default": { @@ -440,6 +512,16 @@ "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/ExceptionPolicy" + }, + "headers": { + "ETag": { + "type": "string", + "description": "The entity tag for the response." + }, + "Last-Modified": { + "type": "string", + "description": "The last modified timestamp." + } } }, "default": { @@ -474,6 +556,12 @@ "required": true, "type": "string" }, + { + "$ref": "#/parameters/RouterConditionalRequestHeaders.ifMatch" + }, + { + "$ref": "#/parameters/RouterConditionalRequestHeaders.ifUnmodifiedSince" + }, { "name": "resource", "in": "body", @@ -489,12 +577,32 @@ "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/ExceptionPolicy" + }, + "headers": { + "ETag": { + "type": "string", + "description": "The entity tag for the response." + }, + "Last-Modified": { + "type": "string", + "description": "The last modified timestamp." + } } }, "201": { "description": "The request has succeeded and a new resource has been created as a result.", "schema": { "$ref": "#/definitions/ExceptionPolicy" + }, + "headers": { + "ETag": { + "type": "string", + "description": "The entity tag for the response." + }, + "Last-Modified": { + "type": "string", + "description": "The last modified timestamp." + } } }, "default": { @@ -747,6 +855,16 @@ "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/RouterJob" + }, + "headers": { + "ETag": { + "type": "string", + "description": "The entity tag for the response." + }, + "Last-Modified": { + "type": "string", + "description": "The last modified timestamp." + } } }, "default": { @@ -781,6 +899,12 @@ "required": true, "type": "string" }, + { + "$ref": "#/parameters/RouterConditionalRequestHeaders.ifMatch" + }, + { + "$ref": "#/parameters/RouterConditionalRequestHeaders.ifUnmodifiedSince" + }, { "name": "resource", "in": "body", @@ -796,12 +920,32 @@ "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/RouterJob" + }, + "headers": { + "ETag": { + "type": "string", + "description": "The entity tag for the response." + }, + "Last-Modified": { + "type": "string", + "description": "The last modified timestamp." + } } }, "201": { "description": "The request has succeeded and a new resource has been created as a result.", "schema": { "$ref": "#/definitions/RouterJob" + }, + "headers": { + "ETag": { + "type": "string", + "description": "The entity tag for the response." + }, + "Last-Modified": { + "type": "string", + "description": "The last modified timestamp." + } } }, "default": { @@ -1193,6 +1337,16 @@ "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/RouterQueue" + }, + "headers": { + "ETag": { + "type": "string", + "description": "The entity tag for the response." + }, + "Last-Modified": { + "type": "string", + "description": "The last modified timestamp." + } } }, "default": { @@ -1227,6 +1381,12 @@ "required": true, "type": "string" }, + { + "$ref": "#/parameters/RouterConditionalRequestHeaders.ifMatch" + }, + { + "$ref": "#/parameters/RouterConditionalRequestHeaders.ifUnmodifiedSince" + }, { "name": "resource", "in": "body", @@ -1242,12 +1402,32 @@ "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/RouterQueue" + }, + "headers": { + "ETag": { + "type": "string", + "description": "The entity tag for the response." + }, + "Last-Modified": { + "type": "string", + "description": "The last modified timestamp." + } } }, "201": { "description": "The request has succeeded and a new resource has been created as a result.", "schema": { "$ref": "#/definitions/RouterQueue" + }, + "headers": { + "ETag": { + "type": "string", + "description": "The entity tag for the response." + }, + "Last-Modified": { + "type": "string", + "description": "The last modified timestamp." + } } }, "default": { @@ -1463,6 +1643,16 @@ "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/RouterWorker" + }, + "headers": { + "ETag": { + "type": "string", + "description": "The entity tag for the response." + }, + "Last-Modified": { + "type": "string", + "description": "The last modified timestamp." + } } }, "default": { @@ -1497,6 +1687,12 @@ "required": true, "type": "string" }, + { + "$ref": "#/parameters/RouterConditionalRequestHeaders.ifMatch" + }, + { + "$ref": "#/parameters/RouterConditionalRequestHeaders.ifUnmodifiedSince" + }, { "name": "resource", "in": "body", @@ -1512,12 +1708,32 @@ "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/RouterWorker" + }, + "headers": { + "ETag": { + "type": "string", + "description": "The entity tag for the response." + }, + "Last-Modified": { + "type": "string", + "description": "The last modified timestamp." + } } }, "201": { "description": "The request has succeeded and a new resource has been created as a result.", "schema": { "$ref": "#/definitions/RouterWorker" + }, + "headers": { + "ETag": { + "type": "string", + "description": "The entity tag for the response." + }, + "Last-Modified": { + "type": "string", + "description": "The last modified timestamp." + } } }, "default": { @@ -3841,6 +4057,25 @@ "minLength": 1, "x-ms-parameter-location": "method", "x-ms-client-name": "apiVersion" + }, + "RouterConditionalRequestHeaders.ifMatch": { + "name": "If-Match", + "in": "header", + "description": "The request should only proceed if an entity matches this string.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-client-name": "ifMatch" + }, + "RouterConditionalRequestHeaders.ifUnmodifiedSince": { + "name": "If-Unmodified-Since", + "in": "header", + "description": "The request should only proceed if the entity was not modified after this time.", + "required": false, + "type": "string", + "format": "date-time", + "x-ms-parameter-location": "method", + "x-ms-client-name": "ifUnmodifiedSince" } } } From 0fb329b6f3d97c72bb43293237556c2ff69bcedc Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Wed, 20 Sep 2023 14:59:56 -0700 Subject: [PATCH 020/113] use azure core etag --- .../Communication.JobRouter/models.tsp | 45 ++++++++-------- .../communicationservicejobrouter.json | 53 ++++++++++++++----- 2 files changed, 63 insertions(+), 35 deletions(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 5410dec4aa85..0a4310ea86e7 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -296,10 +296,10 @@ model ClassificationPolicyCollection @doc("Paged instance of ClassificationPolicy") model ClassificationPolicyItem { @doc("A container for the rules that govern how jobs are classified.") - classificationPolicy?: ClassificationPolicy; + classificationPolicy: ClassificationPolicy; @doc("(Optional) The Concurrency Token.") - etag?: string; + etag: eTag; } @resource("distributionPolicies") @@ -351,10 +351,10 @@ model DistributionPolicyCollection is Azure.Core.Page; @doc("Paged instance of DistributionPolicy") model DistributionPolicyItem { @doc("Policy governing how jobs are distributed to workers") - distributionPolicy?: DistributionPolicy; + distributionPolicy: DistributionPolicy; @doc("(Optional) The Concurrency Token.") - etag?: string; + etag: eTag; } @resource("exceptionPolicies") @@ -397,10 +397,10 @@ model ExceptionPolicyCollection is Azure.Core.Page; @doc("Paged instance of ExceptionPolicy") model ExceptionPolicyItem { @doc("A policy that defines actions to execute when exception are triggered.") - exceptionPolicy?: ExceptionPolicy; + exceptionPolicy: ExceptionPolicy; @doc("(Optional) The Concurrency Token.") - etag?: string; + etag: eTag; } @resource("jobs") @@ -420,7 +420,6 @@ model RouterJob { @doc("The time a job was queued in UTC.") @visibility("read") - // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. enqueuedAt?: utcDateTime; @doc("The channel identifier. eg. voice, chat, etc.") @@ -520,7 +519,7 @@ label selector @doc("The time at which this worker selector expires in UTC") @visibility("read") - // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + expiresAt?: utcDateTime; } @@ -533,15 +532,15 @@ model RouterJobAssignment { workerId?: string; @doc("The assignment time of the job in UTC.") - // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + assignedAt: utcDateTime; @doc("The time the job was marked as completed after being assigned in UTC.") - // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + completedAt?: utcDateTime; @doc("The time the job was marked as closed after being completed in UTC.") - // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + closedAt?: utcDateTime; } @@ -589,7 +588,7 @@ automatically. """) model ScheduleAndSuspendMode { @doc("Scheduled time.") - // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + scheduleAt?: utcDateTime; } @@ -638,7 +637,7 @@ JobClosedEvent notification. If provided, worker capacity is released along with a JobClosedEvent notification at a future time in UTC. """) - // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + closeAt?: utcDateTime; @doc(""" @@ -654,10 +653,10 @@ model RouterJobCollection is Azure.Core.Page; @doc("Paged instance of RouterJob") model RouterJobItem { @doc("A unit of work to be routed") - job?: RouterJob; + job: RouterJob; @doc("(Optional) The Concurrency Token.") - etag?: string; + etag: eTag; } @doc("Position and estimated wait time for a job.") @@ -722,7 +721,7 @@ 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. """) - // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + retryOfferAt?: utcDateTime; } @@ -762,10 +761,10 @@ model RouterQueueCollection is Azure.Core.Page; @doc("Paged instance of RouterQueue") model RouterQueueItem { @doc("A queue that can contain jobs to be routed.") - queue?: RouterQueue; + queue: RouterQueue; @doc("(Optional) The Concurrency Token.") - etag?: string; + etag: eTag; } @doc("Statistics for the queue") @@ -859,11 +858,11 @@ model RouterJobOffer { capacityCost: int32; @doc("The time the offer was created in UTC.") - // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + offeredAt?: utcDateTime; @doc("The time that the offer will expire in UTC.") - // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + expiresAt?: utcDateTime; } @@ -879,7 +878,7 @@ model RouterWorkerAssignment { capacityCost: int32; @doc("The assignment time of the job in UTC.") - // FIXME: (utcDateTime) Please double check that this is the correct type for your scenario. + assignedAt: utcDateTime; } @@ -889,10 +888,10 @@ model RouterWorkerCollection is Azure.Core.Page; @doc("Paged instance of RouterWorker") model RouterWorkerItem { @doc("An entity for jobs to be routed to") - worker?: RouterWorker; + worker: RouterWorker; @doc("(Optional) The Concurrency Token.") - etag?: string; + etag: eTag; } @doc("Jobs are distributed to the worker with the strongest abilities available.") diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index 609a9dfacca8..f66a91cd6081 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -1969,6 +1969,11 @@ } } }, + "Azure.Core.eTag": { + "type": "string", + "format": "eTag", + "description": "The ETag (or entity tag) HTTP response header is an identifier for a specific version of a resource.\nIt lets caches be more efficient and save bandwidth, as a web server does not need to resend a full response if the content was not changed.\n\nIt is a string of ASCII characters placed between double quotes, like \"675af34563dc-tr34\"." + }, "BestWorkerMode": { "type": "object", "description": "Jobs are distributed to the worker with the strongest abilities available.", @@ -2109,10 +2114,14 @@ "description": "A container for the rules that govern how jobs are classified." }, "etag": { - "type": "string", + "$ref": "#/definitions/Azure.Core.eTag", "description": "(Optional) The Concurrency Token." } - } + }, + "required": [ + "classificationPolicy", + "etag" + ] }, "ClassificationPolicyUpdate": { "type": "object", @@ -2333,10 +2342,14 @@ "description": "Policy governing how jobs are distributed to workers" }, "etag": { - "type": "string", + "$ref": "#/definitions/Azure.Core.eTag", "description": "(Optional) The Concurrency Token." } - } + }, + "required": [ + "distributionPolicy", + "etag" + ] }, "DistributionPolicyUpdate": { "type": "object", @@ -2405,10 +2418,14 @@ "description": "A policy that defines actions to execute when exception are triggered." }, "etag": { - "type": "string", + "$ref": "#/definitions/Azure.Core.eTag", "description": "(Optional) The Concurrency Token." } - } + }, + "required": [ + "exceptionPolicy", + "etag" + ] }, "ExceptionPolicyUpdate": { "type": "object", @@ -3132,10 +3149,14 @@ "description": "A unit of work to be routed" }, "etag": { - "type": "string", + "$ref": "#/definitions/Azure.Core.eTag", "description": "(Optional) The Concurrency Token." } - } + }, + "required": [ + "job", + "etag" + ] }, "RouterJobOffer": { "type": "object", @@ -3391,10 +3412,14 @@ "description": "A queue that can contain jobs to be routed." }, "etag": { - "type": "string", + "$ref": "#/definitions/Azure.Core.eTag", "description": "(Optional) The Concurrency Token." } - } + }, + "required": [ + "queue", + "etag" + ] }, "RouterQueueSelector": { "type": "object", @@ -3599,10 +3624,14 @@ "description": "An entity for jobs to be routed to" }, "etag": { - "type": "string", + "$ref": "#/definitions/Azure.Core.eTag", "description": "(Optional) The Concurrency Token." } - } + }, + "required": [ + "worker", + "etag" + ] }, "RouterWorkerSelector": { "type": "object", From 8b1e2c3faf93243389ba87e8e7523bcde0c43a3f Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Wed, 20 Sep 2023 15:16:27 -0700 Subject: [PATCH 021/113] fix floats to doubles --- .../Communication.JobRouter/models.tsp | 20 ++++++++--------- .../communicationservicejobrouter.json | 22 +++++++++---------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 0a4310ea86e7..8c06393e5304 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -317,7 +317,7 @@ model DistributionPolicy { The number of seconds after which any offers created under this policy will be expired. """) - offerExpiresAfterSeconds?: float32; + offerExpiresAfterSeconds?: float64; @doc("Abstract base class for defining a distribution mode") mode?: DistributionMode; @@ -508,7 +508,7 @@ label selector value?: unknown; @doc("Describes how long this label selector is valid in seconds.") - expiresAfterSeconds?: float32; + expiresAfterSeconds?: float64; @doc("Pushes the job to the front of the queue as long as this selector is active.") expedite?: boolean; @@ -674,7 +674,7 @@ model RouterJobPositionDetails { queueLength: int32; @doc("Estimated wait time of the job rounded up to the nearest minute") - estimatedWaitTimeMinutes: float32; + estimatedWaitTimeMinutes: float64; } @doc("Request payload for unassigning a job.") @@ -779,10 +779,10 @@ model RouterQueueStatistics { The estimated wait time of this queue rounded up to the nearest minute, grouped by job priority """) - estimatedWaitTimeMinutes?: Record; + estimatedWaitTimeMinutes?: Record; @doc("The wait time of the job that has been enqueued in this queue for the longest.") - longestJobWaitTimeMinutes?: float32; + longestJobWaitTimeMinutes?: float64; } @resource("workers") @@ -828,7 +828,7 @@ A value indicating the workers capacity. A value of '1' means all capacity is consumed. A value of '0' means no capacity is currently consumed. """) @visibility("read") - loadRatio?: float32; + loadRatio?: float64; @doc("A flag indicating this worker is open to receive offers or not.") availableForOffers?: boolean; @@ -1191,7 +1191,7 @@ model PassThroughWorkerSelectorAttachment extends WorkerSelectorAttachment { labelOperator: LabelOperator; @doc("Describes how long the attached label selector is valid in seconds.") - expiresAfterSeconds?: float32; + expiresAfterSeconds?: float64; @doc("The type discriminator describing the type of worker selector attachment") kind: "pass-through"; @@ -1212,7 +1212,7 @@ for weighted distributions. """) model QueueWeightedAllocation { @doc("The percentage of this weight, expressed as a fraction of 1.") - weight: float32; + weight: float64; @doc(""" A collection of queue selectors that will be applied if this allocation is @@ -1333,7 +1333,7 @@ selection @doc("Trigger for an exception action on exceeding wait time") model WaitTimeExceptionTrigger extends ExceptionTrigger { @doc("Threshold for wait time for this trigger.") - thresholdSeconds: float32; + thresholdSeconds: float64; @doc("The type discriminator describing a sub-type of ExceptionTrigger") kind: "wait-time"; @@ -1390,7 +1390,7 @@ for weighted distributions. """) model WorkerWeightedAllocation { @doc("The percentage of this weight, expressed as a fraction of 1.") - weight: float32; + weight: float64; @doc(""" A collection of worker selectors that will be applied if this allocation is diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index f66a91cd6081..fe631aeb0cff 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -2321,7 +2321,7 @@ }, "offerExpiresAfterSeconds": { "type": "number", - "format": "float", + "format": "double", "description": "The number of seconds after which any offers created under this policy will be\nexpired." }, "mode": { @@ -2361,7 +2361,7 @@ }, "offerExpiresAfterSeconds": { "type": "number", - "format": "float", + "format": "double", "description": "The number of seconds after which any offers created under this policy will be\nexpired." }, "mode": { @@ -2901,7 +2901,7 @@ }, "expiresAfterSeconds": { "type": "number", - "format": "float", + "format": "double", "description": "Describes how long the attached label selector is valid in seconds." } }, @@ -2956,7 +2956,7 @@ "properties": { "weight": { "type": "number", - "format": "float", + "format": "double", "description": "The percentage of this weight, expressed as a fraction of 1." }, "queueSelectors": { @@ -3216,7 +3216,7 @@ }, "estimatedWaitTimeMinutes": { "type": "number", - "format": "float", + "format": "double", "description": "Estimated wait time of the job rounded up to the nearest minute" } }, @@ -3459,13 +3459,13 @@ "type": "object", "description": "The estimated wait time of this queue rounded up to the nearest minute, grouped\nby job priority", "additionalProperties": { - "format": "float", + "format": "double", "type": "number" } }, "longestJobWaitTimeMinutes": { "type": "number", - "format": "float", + "format": "double", "description": "The wait time of the job that has been enqueued in this queue for the longest." } }, @@ -3572,7 +3572,7 @@ }, "loadRatio": { "type": "number", - "format": "float", + "format": "double", "description": "A value indicating the workers capacity. A value of '1' means all capacity is\nconsumed. A value of '0' means no capacity is currently consumed.", "readOnly": true }, @@ -3650,7 +3650,7 @@ }, "expiresAfterSeconds": { "type": "number", - "format": "float", + "format": "double", "description": "Describes how long this label selector is valid in seconds." }, "expedite": { @@ -3952,7 +3952,7 @@ "properties": { "thresholdSeconds": { "type": "number", - "format": "float", + "format": "double", "description": "Threshold for wait time for this trigger." } }, @@ -4058,7 +4058,7 @@ "properties": { "weight": { "type": "number", - "format": "float", + "format": "double", "description": "The percentage of this weight, expressed as a fraction of 1." }, "workerSelectors": { From ba480219e25149a886741e331a665c9481aa817b Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Thu, 21 Sep 2023 16:16:12 -0700 Subject: [PATCH 022/113] update typespec-python options + regenerate rest specs --- .../Communication.JobRouter/tspconfig.yaml | 5 +- .../communicationservicejobrouter.json | 510 +++++++++--------- 2 files changed, 257 insertions(+), 258 deletions(-) diff --git a/specification/communication/Communication.JobRouter/tspconfig.yaml b/specification/communication/Communication.JobRouter/tspconfig.yaml index 9dcdb9714185..69a364041c89 100644 --- a/specification/communication/Communication.JobRouter/tspconfig.yaml +++ b/specification/communication/Communication.JobRouter/tspconfig.yaml @@ -30,8 +30,11 @@ options: package-dir: "Azure.Communication.JobRouter" save-inputs: true "@azure-tools/typespec-python": + package-pprint-name: "\"Azure Communication Job Router Service\"" + package-mode: "dataplane" emitter-output-dir: "{python-sdk-folder}/sdk/{service-directory-name}/{package-name}" - package-name: "azure-communication-jobrouter" + package-dir: "azure-communication-jobrouter" + package-name: "{package-dir}" "@azure-tools/typespec-java": emitter-output-dir: "{java-sdk-folder}/sdk/{service-directory-name}/azure-communication-jobrouter" namespace: com.azure.communication.jobrouter diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index fe631aeb0cff..c38613fe95b6 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -65,8 +65,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -117,8 +117,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -154,7 +154,7 @@ "description": "The resource instance.", "required": true, "schema": { - "$ref": "#/definitions/ClassificationPolicyUpdate" + "$ref": "#/definitions/ClassificationPolicyCreateOrUpdate" } } ], @@ -198,8 +198,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -232,8 +232,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -272,8 +272,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -324,8 +324,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -361,7 +361,7 @@ "description": "The resource instance.", "required": true, "schema": { - "$ref": "#/definitions/DistributionPolicyUpdate" + "$ref": "#/definitions/DistributionPolicyCreateOrUpdate" } } ], @@ -405,8 +405,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -439,8 +439,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -479,8 +479,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -531,8 +531,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -568,7 +568,7 @@ "description": "The resource instance.", "required": true, "schema": { - "$ref": "#/definitions/ExceptionPolicyUpdate" + "$ref": "#/definitions/ExceptionPolicyCreateOrUpdate" } } ], @@ -612,8 +612,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -646,8 +646,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -822,8 +822,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -874,8 +874,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -911,7 +911,7 @@ "description": "The resource instance.", "required": true, "schema": { - "$ref": "#/definitions/RouterJobUpdate" + "$ref": "#/definitions/RouterJobCreateOrUpdate" } } ], @@ -955,8 +955,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -989,8 +989,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -1019,8 +1019,7 @@ "description": "Request object for reclassifying a job.", "required": true, "schema": { - "type": "object", - "properties": {} + "type": "object" } } ], @@ -1035,8 +1034,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -1080,8 +1079,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -1125,8 +1124,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -1170,8 +1169,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -1225,8 +1224,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -1264,8 +1263,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -1304,8 +1303,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -1356,8 +1355,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -1393,7 +1392,7 @@ "description": "The resource instance.", "required": true, "schema": { - "$ref": "#/definitions/RouterQueueUpdate" + "$ref": "#/definitions/RouterQueueCreateOrUpdate" } } ], @@ -1437,8 +1436,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -1471,8 +1470,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -1510,8 +1509,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -1610,8 +1609,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -1662,8 +1661,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -1699,7 +1698,7 @@ "description": "The resource instance.", "required": true, "schema": { - "$ref": "#/definitions/RouterWorkerUpdate" + "$ref": "#/definitions/RouterWorkerCreateOrUpdate" } } ], @@ -1743,8 +1742,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -1777,8 +1776,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -1823,8 +1822,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -1875,8 +1874,8 @@ }, "headers": { "x-ms-error-code": { - "description": "String error code indicating what went wrong.", - "type": "string" + "type": "string", + "description": "String error code indicating what went wrong." } } } @@ -2047,7 +2046,7 @@ "capacityCostPerJob" ] }, - "ChannelConfigurationUpdate": { + "ChannelConfigurationCreateOrUpdate": { "type": "object", "description": "Represents the capacity a job in this channel will consume from a worker", "properties": { @@ -2105,25 +2104,7 @@ "id" ] }, - "ClassificationPolicyItem": { - "type": "object", - "description": "Paged instance of ClassificationPolicy", - "properties": { - "classificationPolicy": { - "$ref": "#/definitions/ClassificationPolicy", - "description": "A container for the rules that govern how jobs are classified." - }, - "etag": { - "$ref": "#/definitions/Azure.Core.eTag", - "description": "(Optional) The Concurrency Token." - } - }, - "required": [ - "classificationPolicy", - "etag" - ] - }, - "ClassificationPolicyUpdate": { + "ClassificationPolicyCreateOrUpdate": { "type": "object", "description": "A container for the rules that govern how jobs are classified.", "properties": { @@ -2157,6 +2138,24 @@ } } }, + "ClassificationPolicyItem": { + "type": "object", + "description": "Paged instance of ClassificationPolicy", + "properties": { + "classificationPolicy": { + "$ref": "#/definitions/ClassificationPolicy", + "description": "A container for the rules that govern how jobs are classified." + }, + "etag": { + "$ref": "#/definitions/Azure.Core.eTag", + "description": "(Optional) The Concurrency Token." + } + }, + "required": [ + "classificationPolicy", + "etag" + ] + }, "CloseJobRequest": { "type": "object", "description": "Request payload for closing jobs", @@ -2270,7 +2269,6 @@ "DirectMapRouterRule": { "type": "object", "description": "A rule that return the same labels as the input labels.", - "properties": {}, "allOf": [ { "$ref": "#/definitions/RouterRule" @@ -2333,25 +2331,7 @@ "id" ] }, - "DistributionPolicyItem": { - "type": "object", - "description": "Paged instance of DistributionPolicy", - "properties": { - "distributionPolicy": { - "$ref": "#/definitions/DistributionPolicy", - "description": "Policy governing how jobs are distributed to workers" - }, - "etag": { - "$ref": "#/definitions/Azure.Core.eTag", - "description": "(Optional) The Concurrency Token." - } - }, - "required": [ - "distributionPolicy", - "etag" - ] - }, - "DistributionPolicyUpdate": { + "DistributionPolicyCreateOrUpdate": { "type": "object", "description": "Policy governing how jobs are distributed to workers", "properties": { @@ -2370,6 +2350,24 @@ } } }, + "DistributionPolicyItem": { + "type": "object", + "description": "Paged instance of DistributionPolicy", + "properties": { + "distributionPolicy": { + "$ref": "#/definitions/DistributionPolicy", + "description": "Policy governing how jobs are distributed to workers" + }, + "etag": { + "$ref": "#/definitions/Azure.Core.eTag", + "description": "(Optional) The Concurrency Token." + } + }, + "required": [ + "distributionPolicy", + "etag" + ] + }, "ExceptionAction": { "type": "object", "description": "The action to take when the exception is triggered", @@ -2409,6 +2407,23 @@ "id" ] }, + "ExceptionPolicyCreateOrUpdate": { + "type": "object", + "description": "A policy that defines actions to execute when exception are triggered.", + "properties": { + "name": { + "type": "string", + "description": "(Optional) The name of the exception policy." + }, + "exceptionRules": { + "type": "object", + "description": "(Optional) A dictionary collection of exception rules on the exception policy.\nKey is the Id of each exception rule.", + "additionalProperties": { + "$ref": "#/definitions/ExceptionRuleCreateOrUpdate" + } + } + } + }, "ExceptionPolicyItem": { "type": "object", "description": "Paged instance of ExceptionPolicy", @@ -2427,23 +2442,6 @@ "etag" ] }, - "ExceptionPolicyUpdate": { - "type": "object", - "description": "A policy that defines actions to execute when exception are triggered.", - "properties": { - "name": { - "type": "string", - "description": "(Optional) The name of the exception policy." - }, - "exceptionRules": { - "type": "object", - "description": "(Optional) A dictionary collection of exception rules on the exception policy.\nKey is the Id of each exception rule.", - "additionalProperties": { - "$ref": "#/definitions/ExceptionRuleUpdate" - } - } - } - }, "ExceptionRule": { "type": "object", "description": "A rule that defines actions to execute upon a specific trigger.", @@ -2465,7 +2463,7 @@ "actions" ] }, - "ExceptionRuleUpdate": { + "ExceptionRuleCreateOrUpdate": { "type": "object", "description": "A rule that defines actions to execute upon a specific trigger.", "properties": { @@ -2680,7 +2678,6 @@ "LongestIdleMode": { "type": "object", "description": "Jobs are directed to the worker who has been idle longest.", - "properties": {}, "allOf": [ { "$ref": "#/definitions/DistributionMode" @@ -2984,7 +2981,7 @@ "labelsToUpsert": { "type": "object", "description": "(optional) Dictionary containing the labels to update (or add if not existing)\nin key-value pairs", - "additionalProperties": true + "additionalProperties": {} } }, "allOf": [ @@ -2997,7 +2994,6 @@ "RoundRobinMode": { "type": "object", "description": "Jobs are distributed in order to workers, starting with the worker that is\nafter the last worker to receive a job.", - "properties": {}, "allOf": [ { "$ref": "#/definitions/DistributionMode" @@ -3070,7 +3066,7 @@ "labels": { "type": "object", "description": "A set of key/value pairs that are identifying attributes used by the rules\nengines to make decisions.", - "additionalProperties": true + "additionalProperties": {} }, "assignments": { "type": "object", @@ -3083,7 +3079,7 @@ "tags": { "type": "object", "description": "A set of non-identifying attributes attached to this job", - "additionalProperties": true + "additionalProperties": {} }, "notes": { "type": "object", @@ -3140,6 +3136,66 @@ "assignedAt" ] }, + "RouterJobCreateOrUpdate": { + "type": "object", + "description": "A unit of work to be routed", + "properties": { + "channelReference": { + "type": "string", + "description": "Reference to an external parent context, eg. call ID." + }, + "channelId": { + "type": "string", + "description": "The channel identifier. eg. voice, chat, etc." + }, + "classificationPolicyId": { + "type": "string", + "description": "The Id of the Classification policy used for classifying a job." + }, + "queueId": { + "type": "string", + "description": "The Id of the Queue that this job is queued to." + }, + "priority": { + "type": "integer", + "format": "int32", + "description": "The priority of this job." + }, + "dispositionCode": { + "type": "string", + "description": "Reason code for cancelled or closed jobs." + }, + "requestedWorkerSelectors": { + "type": "array", + "description": "A collection of manually specified label selectors, which a worker must satisfy\nin order to process this job.", + "items": { + "$ref": "#/definitions/RouterWorkerSelector" + }, + "x-ms-identifiers": [] + }, + "labels": { + "type": "object", + "description": "A set of key/value pairs that are identifying attributes used by the rules\nengines to make decisions.", + "additionalProperties": {} + }, + "tags": { + "type": "object", + "description": "A set of non-identifying attributes attached to this job", + "additionalProperties": {} + }, + "notes": { + "type": "object", + "description": "Notes attached to a job, sorted by timestamp", + "additionalProperties": { + "type": "string" + } + }, + "matchingMode": { + "$ref": "#/definitions/JobMatchingMode", + "description": "The matching mode to be applied to this job.\n \nSupported types:\n \n \nQueueAndMatchMode: Used when matching worker to a job is required to be\ndone right after job is queued.\nScheduleAndSuspendMode: Used for scheduling\njobs to be queued at a future time. At specified time, matching of a worker to\nthe job will not start automatically.\nSuspendMode: Used when matching workers\nto a job needs to be suspended." + } + } + }, "RouterJobItem": { "type": "object", "description": "Paged instance of RouterJob", @@ -3312,75 +3368,41 @@ ] } }, - "RouterJobUpdate": { + "RouterQueue": { "type": "object", - "description": "A unit of work to be routed", + "description": "A queue that can contain jobs to be routed.", "properties": { - "channelReference": { - "type": "string", - "description": "Reference to an external parent context, eg. call ID." - }, - "channelId": { - "type": "string", - "description": "The channel identifier. eg. voice, chat, etc." - }, - "classificationPolicyId": { + "id": { "type": "string", - "description": "The Id of the Classification policy used for classifying a job." + "description": "The Id of this queue", + "readOnly": true }, - "queueId": { + "name": { "type": "string", - "description": "The Id of the Queue that this job is queued to." - }, - "priority": { - "type": "integer", - "format": "int32", - "description": "The priority of this job." + "description": "The name of this queue." }, - "dispositionCode": { + "distributionPolicyId": { "type": "string", - "description": "Reason code for cancelled or closed jobs." - }, - "requestedWorkerSelectors": { - "type": "array", - "description": "A collection of manually specified label selectors, which a worker must satisfy\nin order to process this job.", - "items": { - "$ref": "#/definitions/RouterWorkerSelector" - }, - "x-ms-identifiers": [] + "description": "The ID of the distribution policy that will determine how a job is distributed\nto workers." }, "labels": { "type": "object", "description": "A set of key/value pairs that are identifying attributes used by the rules\nengines to make decisions.", - "additionalProperties": true - }, - "tags": { - "type": "object", - "description": "A set of non-identifying attributes attached to this job", - "additionalProperties": true - }, - "notes": { - "type": "object", - "description": "Notes attached to a job, sorted by timestamp", - "additionalProperties": { - "type": "string" - } + "additionalProperties": {} }, - "matchingMode": { - "$ref": "#/definitions/JobMatchingMode", - "description": "The matching mode to be applied to this job.\n \nSupported types:\n \n \nQueueAndMatchMode: Used when matching worker to a job is required to be\ndone right after job is queued.\nScheduleAndSuspendMode: Used for scheduling\njobs to be queued at a future time. At specified time, matching of a worker to\nthe job will not start automatically.\nSuspendMode: Used when matching workers\nto a job needs to be suspended." + "exceptionPolicyId": { + "type": "string", + "description": "(Optional) The ID of the exception policy that determines various job\nescalation rules." } - } + }, + "required": [ + "id" + ] }, - "RouterQueue": { + "RouterQueueCreateOrUpdate": { "type": "object", "description": "A queue that can contain jobs to be routed.", "properties": { - "id": { - "type": "string", - "description": "The Id of this queue", - "readOnly": true - }, "name": { "type": "string", "description": "The name of this queue." @@ -3392,16 +3414,13 @@ "labels": { "type": "object", "description": "A set of key/value pairs that are identifying attributes used by the rules\nengines to make decisions.", - "additionalProperties": true + "additionalProperties": {} }, "exceptionPolicyId": { "type": "string", "description": "(Optional) The ID of the exception policy that determines various job\nescalation rules." } - }, - "required": [ - "id" - ] + } }, "RouterQueueItem": { "type": "object", @@ -3474,29 +3493,6 @@ "length" ] }, - "RouterQueueUpdate": { - "type": "object", - "description": "A queue that can contain jobs to be routed.", - "properties": { - "name": { - "type": "string", - "description": "The name of this queue." - }, - "distributionPolicyId": { - "type": "string", - "description": "The ID of the distribution policy that will determine how a job is distributed\nto workers." - }, - "labels": { - "type": "object", - "description": "A set of key/value pairs that are identifying attributes used by the rules\nengines to make decisions.", - "additionalProperties": true - }, - "exceptionPolicyId": { - "type": "string", - "description": "(Optional) The ID of the exception policy that determines various job\nescalation rules." - } - } - }, "RouterRule": { "type": "object", "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol.", @@ -3528,7 +3524,7 @@ "queueAssignments": { "type": "object", "description": "The queue(s) that this worker can receive work from.", - "additionalProperties": true + "additionalProperties": {} }, "totalCapacity": { "type": "integer", @@ -3538,12 +3534,12 @@ "labels": { "type": "object", "description": "A set of key/value pairs that are identifying attributes used by the rules\nengines to make decisions.", - "additionalProperties": true + "additionalProperties": {} }, "tags": { "type": "object", "description": "A set of non-identifying attributes attached to this worker.", - "additionalProperties": true + "additionalProperties": {} }, "channelConfigurations": { "type": "object", @@ -3615,6 +3611,43 @@ "assignedAt" ] }, + "RouterWorkerCreateOrUpdate": { + "type": "object", + "description": "An entity for jobs to be routed to", + "properties": { + "queueAssignments": { + "type": "object", + "description": "The queue(s) that this worker can receive work from.", + "additionalProperties": {} + }, + "totalCapacity": { + "type": "integer", + "format": "int32", + "description": "The total capacity score this worker has to manage multiple concurrent jobs." + }, + "labels": { + "type": "object", + "description": "A set of key/value pairs that are identifying attributes used by the rules\nengines to make decisions.", + "additionalProperties": {} + }, + "tags": { + "type": "object", + "description": "A set of non-identifying attributes attached to this worker.", + "additionalProperties": {} + }, + "channelConfigurations": { + "type": "object", + "description": "The channel(s) this worker can handle and their impact on the workers capacity.", + "additionalProperties": { + "$ref": "#/definitions/ChannelConfigurationCreateOrUpdate" + } + }, + "availableForOffers": { + "type": "boolean", + "description": "A flag indicating this worker is open to receive offers or not." + } + } + }, "RouterWorkerItem": { "type": "object", "description": "Paged instance of RouterWorker", @@ -3728,43 +3761,6 @@ ] } }, - "RouterWorkerUpdate": { - "type": "object", - "description": "An entity for jobs to be routed to", - "properties": { - "queueAssignments": { - "type": "object", - "description": "The queue(s) that this worker can receive work from.", - "additionalProperties": true - }, - "totalCapacity": { - "type": "integer", - "format": "int32", - "description": "The total capacity score this worker has to manage multiple concurrent jobs." - }, - "labels": { - "type": "object", - "description": "A set of key/value pairs that are identifying attributes used by the rules\nengines to make decisions.", - "additionalProperties": true - }, - "tags": { - "type": "object", - "description": "A set of non-identifying attributes attached to this worker.", - "additionalProperties": true - }, - "channelConfigurations": { - "type": "object", - "description": "The channel(s) this worker can handle and their impact on the workers capacity.", - "additionalProperties": { - "$ref": "#/definitions/ChannelConfigurationUpdate" - } - }, - "availableForOffers": { - "type": "boolean", - "description": "A flag indicating this worker is open to receive offers or not." - } - } - }, "RuleEngineQueueSelectorAttachment": { "type": "object", "description": "Attaches queue selectors to a job when the RouterRule is resolved", From 9f78614dd38cb3cd72605f1c538960c62b58d9f3 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Mon, 25 Sep 2023 15:52:47 -0700 Subject: [PATCH 023/113] fix lint errors --- .../Communication.JobRouter/README.md | 68 +++++++++++++++++++ ...onPolicies_UpdateClassificationPolicy.json | 2 +- ...tionPolicies_UpdateDistributionPolicy.json | 2 +- ...ceptionPolicies_UpdateExceptionPolicy.json | 2 +- .../2023-11-01/Jobs_CreateScheduledJob.json | 2 +- .../Workers_DeregisterActiveWorker.json | 2 +- .../Workers_DeregisterInactiveWorker.json | 2 +- .../Workers_GetAvailableWorkersByChannel.json | 2 +- .../2023-11-01/Workers_RegisterWorker.json | 2 +- .../2023-11-01/Workers_UpdateWorker.json | 2 +- .../Communication.JobRouter/main.tsp | 3 + .../Communication.JobRouter/models.tsp | 15 +++- .../Communication.JobRouter/routes.tsp | 1 + .../communicationservicejobrouter.json | 22 +++++- 14 files changed, 113 insertions(+), 14 deletions(-) create mode 100644 specification/communication/Communication.JobRouter/README.md diff --git a/specification/communication/Communication.JobRouter/README.md b/specification/communication/Communication.JobRouter/README.md new file mode 100644 index 000000000000..7f3eede87c66 --- /dev/null +++ b/specification/communication/Communication.JobRouter/README.md @@ -0,0 +1,68 @@ +# Azure Communication Job Router TypeSpec Specification + +The TypeSpec and generated API specification for the Azure Communication Job Router. + +## Development Environment + +0. Change directory into the `specification\communication\Communication.JobRouter\` directory. + +1. Install Node.js 16 LTS and ensure you are able to run the npm command in a command prompt: + + ```console + npm --version + ``` + +2. Install Azure DevOps Auth helper for npm to pull the libraries from the secured feed + + ```console + npm install -g vsts-npm-auth + vsts-npm-auth -config .npmrc + ``` + +3. Install TypeSpec compiler and libraries: + + ```console + npm install -g @typespec/compiler + ``` + +4. (Optional) Install the TypeSpec extension for your editor of choice: + + - Visual Studio Code + + ``` console + tsp code install + ``` + + - Visual Studio + + ``` console + tsp vs install + ``` + +5. Install node package dependencies: + + ```console + tsp install + ``` + +6. Compile TypeSpec to Swagger. This will update the files in the directory `..\data-plane\JobRouter\\\communicationservicejobrouter.json`: + + ```console + npx tsp compile specification\communication\Communication.JobRouter + ``` + +7. To re-generate examples, download and install the [OAV + tool](https://github.com/Azure/oav) and run it: note: This directory is taken + from [azure-rest-api-specs](https://github.com/Azure/azure-rest-api-specs), + and the following commands should be run from there. + + ```console + npm install -g oav@latest + oav generate-examples + ``` + +## Testing and Viewing API as an Interface + +1. Visit the official [Swagger Editor](https://editor.swagger.io/). + +2. Copy the generated Swagger from `communicationservicejobrouter.json` and paste it into the editor. \ No newline at end of file diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_UpdateClassificationPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_UpdateClassificationPolicy.json index 1b5c2deb83f5..4bddbb10e9bb 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_UpdateClassificationPolicy.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_UpdateClassificationPolicy.json @@ -1,6 +1,6 @@ { "title": "Updates a classification policy.", - "operationId": "upsertClassificationPolicy", + "operationId": "updateClassificationPolicy", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_UpdateDistributionPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_UpdateDistributionPolicy.json index 2bd52b2c4d7c..eda13eb06acb 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_UpdateDistributionPolicy.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_UpdateDistributionPolicy.json @@ -1,6 +1,6 @@ { "title": "Updates a distribution policy.", - "operationId": "upsertDistributionPolicy", + "operationId": "updateDistributionPolicy", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_UpdateExceptionPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_UpdateExceptionPolicy.json index a2ccad3dfa85..b1f24206410e 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_UpdateExceptionPolicy.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_UpdateExceptionPolicy.json @@ -1,6 +1,6 @@ { "title": "Updates a exception policy.", - "operationId": "upsertExceptionPolicy", + "operationId": "updateExceptionPolicy", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateScheduledJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateScheduledJob.json index 61fe9a8ba83f..11b37c9be798 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateScheduledJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateScheduledJob.json @@ -1,6 +1,6 @@ { "title": "Creates or updates a scheduled router job.", - "operationId": "upsertJob", + "operationId": "upsertScheduledJob", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterActiveWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterActiveWorker.json index ccb09ae72395..c01624291b5b 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterActiveWorker.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterActiveWorker.json @@ -1,6 +1,6 @@ { "title": "De-register an active worker", - "operationId": "upsertWorker", + "operationId": "deregisterActiveWorker", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterInactiveWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterInactiveWorker.json index 94390ad3ed88..6e309d90e600 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterInactiveWorker.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterInactiveWorker.json @@ -1,6 +1,6 @@ { "title": "De-register an inactive worker", - "operationId": "upsertWorker", + "operationId": "deregisterInactiveWorker", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json index 1481fd60af75..4220427f911e 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json @@ -1,6 +1,6 @@ { "title": "Retrieves available worker filtered by channel", - "operationId": "listWorkers", + "operationId": "listActiveWorkersByChannel", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_RegisterWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_RegisterWorker.json index 29444a6b3dcb..2a4ee193b8d3 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_RegisterWorker.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_RegisterWorker.json @@ -1,6 +1,6 @@ { "title": "Register a worker", - "operationId": "upsertWorker", + "operationId": "registerWorker", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_UpdateWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_UpdateWorker.json index 90843008c715..19889a4e160f 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_UpdateWorker.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_UpdateWorker.json @@ -1,6 +1,6 @@ { "title": "Updates a worker", - "operationId": "upsertWorker", + "operationId": "updateWorker", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/main.tsp b/specification/communication/Communication.JobRouter/main.tsp index a0cb2b022677..4899dcbaae78 100644 --- a/specification/communication/Communication.JobRouter/main.tsp +++ b/specification/communication/Communication.JobRouter/main.tsp @@ -1,3 +1,6 @@ +// cheat-sheet - https://microsoft.github.io/typespec/standard-library/http/cheat-sheet +// tsp compile main.tsp --emit @azure-tools/typespec-autorest + import "@typespec/rest"; import "@typespec/http"; import "@typespec/versioning"; diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 8c06393e5304..ef94b58d671c 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -566,7 +566,7 @@ model JobMatchingMode { Describes a matching mode where matching worker to a job is automatically started after job is queued successfully. """) - queueAndMatchMode?: unknown; + queueAndMatchMode?: QueueAndMatchMode; @doc(""" Describes a matching mode used for scheduling jobs to be queued at a future @@ -577,7 +577,7 @@ automatically. scheduleAndSuspendMode?: ScheduleAndSuspendMode; @doc("Describes a matching mode where matching worker to a job is suspended.") - suspendMode?: unknown; + suspendMode?: SuspendMode; } @doc(""" @@ -592,6 +592,12 @@ model ScheduleAndSuspendMode { scheduleAt?: utcDateTime; } +@doc("Describes a matching mode where matching worker to a job is automatically started after job is queued successfully.") +model QueueAndMatchMode {} + +@doc("Describes a matching mode where matching worker to a job is suspended.") +model SuspendMode {} + @doc("Request payload for deleting a job") model CancelJobRequest { @doc(""" @@ -785,6 +791,9 @@ by job priority longestJobWaitTimeMinutes?: float64; } +@doc("An assignment of a worker to a queue") +model RouterQueueAssignment {} + @resource("workers") @doc("An entity for jobs to be routed to") model RouterWorker { @@ -798,7 +807,7 @@ model RouterWorker { state?: RouterWorkerState; @doc("The queue(s) that this worker can receive work from.") - queueAssignments?: Record; + queueAssignments?: Record; @doc("The total capacity score this worker has to manage multiple concurrent jobs.") totalCapacity?: int32; diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index 0deebcf370a2..279b1dd10303 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -1,4 +1,5 @@ import "@azure-tools/typespec-azure-core"; +import "@typespec/http"; import "@typespec/rest"; import "./models.tsp"; diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index c38613fe95b6..44fc9567f70d 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -2616,6 +2616,7 @@ "description": "Discriminator value used to differentiate between supported matching mode types." }, "queueAndMatchMode": { + "$ref": "#/definitions/QueueAndMatchMode", "description": "Describes a matching mode where matching worker to a job is automatically\nstarted after job is queued successfully." }, "scheduleAndSuspendMode": { @@ -2623,6 +2624,7 @@ "description": "Describes a matching mode used for scheduling jobs to be queued at a future\ntime.\nAt the specified time, matching worker to a job will not start\nautomatically." }, "suspendMode": { + "$ref": "#/definitions/SuspendMode", "description": "Describes a matching mode where matching worker to a job is suspended." } } @@ -2913,6 +2915,10 @@ ], "x-ms-discriminator-value": "pass-through" }, + "QueueAndMatchMode": { + "type": "object", + "description": "Describes a matching mode where matching worker to a job is automatically started after job is queued successfully." + }, "QueueLengthExceptionTrigger": { "type": "object", "description": "Trigger for an exception action on exceeding queue length", @@ -3399,6 +3405,10 @@ "id" ] }, + "RouterQueueAssignment": { + "type": "object", + "description": "An assignment of a worker to a queue" + }, "RouterQueueCreateOrUpdate": { "type": "object", "description": "A queue that can contain jobs to be routed.", @@ -3524,7 +3534,9 @@ "queueAssignments": { "type": "object", "description": "The queue(s) that this worker can receive work from.", - "additionalProperties": {} + "additionalProperties": { + "$ref": "#/definitions/RouterQueueAssignment" + } }, "totalCapacity": { "type": "integer", @@ -3618,7 +3630,9 @@ "queueAssignments": { "type": "object", "description": "The queue(s) that this worker can receive work from.", - "additionalProperties": {} + "additionalProperties": { + "$ref": "#/definitions/RouterQueueAssignment" + } }, "totalCapacity": { "type": "integer", @@ -3913,6 +3927,10 @@ ], "x-ms-discriminator-value": "static" }, + "SuspendMode": { + "type": "object", + "description": "Describes a matching mode where matching worker to a job is suspended." + }, "UnassignJobRequest": { "type": "object", "description": "Request payload for unassigning a job.", From c020c433e3eb7eb7e87113fd9c3a92fdf31fb8da Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Mon, 25 Sep 2023 16:16:43 -0700 Subject: [PATCH 024/113] add examples --- .../Communication.JobRouter/routes.tsp | 46 ++++ .../communicationservicejobrouter.json | 198 ++++++++++++++++++ ...onPolicies_CreateClassificationPolicy.json | 94 +++++++++ ...onPolicies_DeleteClassificationPolicy.json | 12 ++ ...ationPolicies_GetClassificationPolicy.json | 46 ++++ ...istClassificationPoliciesWithPageSize.json | 64 ++++++ ...onPolicies_UpdateClassificationPolicy.json | 72 +++++++ ...tionPolicies_CreateDistributionPolicy.json | 47 +++++ ...tionPolicies_DeleteDistributionPolicy.json | 12 ++ ...ibutionPolicies_GetDistributionPolicy.json | 24 +++ ..._ListDistributionPoliciesWithPageSize.json | 46 ++++ ...tionPolicies_UpdateDistributionPolicy.json | 47 +++++ ...ceptionPolicies_CreateExceptionPolicy.json | 77 +++++++ ...ceptionPolicies_DeleteExceptionPolicy.json | 12 ++ .../ExceptionPolicies_GetExceptionPolicy.json | 34 +++ ...ies_ListExceptionPoliciesWithPageSize.json | 66 ++++++ ...ceptionPolicies_UpdateExceptionPolicy.json | 77 +++++++ .../2023-11-01/examples/Jobs_CloseJob.json | 22 ++ .../2023-11-01/examples/Jobs_CompleteJob.json | 18 ++ .../2023-11-01/examples/Jobs_CreateJob.json | 93 ++++++++ .../examples/Jobs_CreateScheduledJob.json | 101 +++++++++ .../2023-11-01/examples/Jobs_DeleteJob.json | 12 ++ .../examples/Jobs_GetInQueuePosition.json | 20 ++ .../2023-11-01/examples/Jobs_GetJob.json | 42 ++++ .../examples/Jobs_GetJobsWithPageSize.json | 67 ++++++ .../examples/Jobs_ReclassifyJob.json | 15 ++ .../examples/Jobs_RequestJobCancel.json | 18 ++ .../2023-11-01/examples/Jobs_UnassignJob.json | 21 ++ .../2023-11-01/examples/Jobs_UpdateJob.json | 76 +++++++ .../examples/Offers_AcceptJobOffer.json | 19 ++ .../examples/Offers_DeclineJobOffer.json | 18 ++ .../examples/Queues_CreateQueue.json | 35 ++++ .../examples/Queues_DeleteQueue.json | 12 ++ .../2023-11-01/examples/Queues_GetQueue.json | 20 ++ .../examples/Queues_GetQueueStatistics.json | 17 ++ .../Queues_ListQueuesWithPageSize.json | 38 ++++ .../examples/Queues_UpdateQueue.json | 33 +++ .../examples/Workers_CreateWorker.json | 83 ++++++++ .../examples/Workers_DeleteWorker.json | 12 ++ .../Workers_DeregisterActiveWorker.json | 67 ++++++ .../Workers_DeregisterInactiveWorker.json | 67 ++++++ .../Workers_GetAvailableWorkersByChannel.json | 76 +++++++ .../examples/Workers_GetWorker.json | 38 ++++ .../Workers_GetWorkersWithPageSize.json | 74 +++++++ .../examples/Workers_RegisterWorker.json | 67 ++++++ .../examples/Workers_UpdateWorker.json | 83 ++++++++ 46 files changed, 2238 insertions(+) create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_CreateClassificationPolicy.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_DeleteClassificationPolicy.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_GetClassificationPolicy.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_UpdateClassificationPolicy.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_CreateDistributionPolicy.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_DeleteDistributionPolicy.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_GetDistributionPolicy.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_UpdateDistributionPolicy.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_CreateExceptionPolicy.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_DeleteExceptionPolicy.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_GetExceptionPolicy.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_UpdateExceptionPolicy.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CompleteJob.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateJob.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateScheduledJob.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_DeleteJob.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetInQueuePosition.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJob.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJobsWithPageSize.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_ReclassifyJob.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_RequestJobCancel.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UnassignJob.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UpdateJob.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_AcceptJobOffer.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_DeclineJobOffer.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_CreateQueue.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_DeleteQueue.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_GetQueue.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_GetQueueStatistics.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_ListQueuesWithPageSize.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_UpdateQueue.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_CreateWorker.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeleteWorker.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterActiveWorker.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterInactiveWorker.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorker.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_RegisterWorker.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_UpdateWorker.json diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index 279b1dd10303..5e494b8a236e 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -1,4 +1,5 @@ import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-autorest"; import "@typespec/http"; import "@typespec/rest"; import "./models.tsp"; @@ -6,6 +7,7 @@ import "./models.tsp"; using TypeSpec.Rest; using TypeSpec.Http; using Azure.Core.Traits; +using Autorest; namespace AzureCommunicationRoutingService; @@ -22,24 +24,29 @@ interface JobRouterAdministrationOperations { #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a classification policy.") @doc("Creates or updates a classification policy.") + @example("./examples/ClassificationPolicies_CreateClassificationPolicy.json", "Creates a Classification Policy") + @example("./examples/ClassificationPolicies_UpdateClassificationPolicy.json", "Updates a Classification Policy") @route("/routing") upsertClassificationPolicy is PatchOperations.ResourceCreateOrUpdate; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing classification policy by Id.") @doc("Retrieves an existing classification policy by Id.") + @example("./examples/ClassificationPolicies_GetClassificationPolicy.json", "Get a single Classification policy") @route("/routing") getClassificationPolicy is GetOperations.ResourceRead; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Delete a classification policy by Id.") @doc("Delete a classification policy by Id.") + @example("./examples/ClassificationPolicies_DeleteClassificationPolicy.json", "Delete a Classification policy") @route("/routing") deleteClassificationPolicy is Operations.ResourceDelete; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves existing classification policies.") @doc("Retrieves existing classification policies.") + @example("./examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json", "Get Classification policies with pagination (max page size)") @route("/routing/classificationPolicies") @get listClassificationPolicies is Azure.Core.Foundations.Operation< @@ -54,24 +61,29 @@ interface JobRouterAdministrationOperations { #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a distribution policy.") @doc("Creates or updates a distribution policy.") + @example("./examples/DistributionPolicies_CreateDistributionPolicy.json", "Creates a Distribution policy") + @example("./examples/DistributionPolicies_UpdateDistributionPolicy.json", "Update a Distribution policy") @route("/routing") upsertDistributionPolicy is PatchOperations.ResourceCreateOrUpdate; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing distribution policy by Id.") @doc("Retrieves an existing distribution policy by Id.") + @example("./examples/DistributionPolicies_GetDistributionPolicy.json", "Get a single Distribution policy") @route("/routing") getDistributionPolicy is GetOperations.ResourceRead; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Delete a distribution policy by Id.") @doc("Delete a distribution policy by Id.") + @example("./examples/DistributionPolicies_DeleteDistributionPolicy.json", "Delete a Distribution policy") @route("/routing") deleteDistributionPolicy is Operations.ResourceDelete; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves existing distribution policies.") @doc("Retrieves existing distribution policies.") + @example("./examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json", "Get Distribution policies with pagination (max page size)") @route("/routing/distributionPolicies") @get listDistributionPolicies is Azure.Core.Foundations.Operation< @@ -86,24 +98,29 @@ interface JobRouterAdministrationOperations { #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a exception policy.") @doc("Creates or updates a exception policy.") + @example("./examples/ExceptionPolicies_CreateExceptionPolicy.json", "Creates a Exception policy") + @example("./examples/ExceptionPolicies_UpdateExceptionPolicy.json", "Update a Exception policy") @route("/routing") upsertExceptionPolicy is PatchOperations.ResourceCreateOrUpdate; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing exception policy by Id.") @doc("Retrieves an existing exception policy by Id.") + @example("./examples/ExceptionPolicies_GetExceptionPolicy.json", "Get a single Exception policy") @route("/routing") getExceptionPolicy is GetOperations.ResourceRead; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Deletes a exception policy by Id.") @doc("Deletes a exception policy by Id.") + @example("./examples/ExceptionPolicies_DeleteExceptionPolicy.json", "Delete a Exception policy") @route("/routing") deleteExceptionPolicy is Operations.ResourceDelete; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves existing exception policies.") @doc("Retrieves existing exception policies.") + @example("./examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json", "Get Exception policies with pagination (max page size)") @route("/routing/exceptionPolicies") @get listExceptionPolicies is Azure.Core.Foundations.Operation< @@ -118,24 +135,29 @@ interface JobRouterAdministrationOperations { #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a queue.") @doc("Creates or updates a queue.") + @example("./examples/Queues_CreateQueue.json", "Create a Queue") + @example("./examples/Queues_UpdateQueue.json", "Update a Queue") @route("/routing") upsertQueue is PatchOperations.ResourceCreateOrUpdate; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing queue by Id.") @doc("Retrieves an existing queue by Id.") + @example("./examples/Queues_GetQueue.json", "Get a single Queue") @route("/routing") getQueue is GetOperations.ResourceRead; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Deletes a queue by Id.") @doc("Deletes a queue by Id.") + @example("./examples/Queues_DeleteQueue.json", "Delete a Queue") @route("/routing") deleteQueue is Operations.ResourceDelete; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves existing queues.") @doc("Retrieves existing queues.") + @example("./examples/Queues_ListQueuesWithPageSize.json", "Get Queues with pagination (max page size)") @route("/routing/queues") @get listQueues is Azure.Core.Foundations.Operation< @@ -152,18 +174,23 @@ interface JobRouterOperations { #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a router job.") @doc("Creates or updates a router job.") + @example("./examples/Jobs_CreateJob.json", "Creates a new Job") + @example("./examples/Jobs_CreateScheduledJob.json", "Creates a scheduled job") + @example("./examples/Jobs_UpdateJob.json", "Update a job") @route("/routing") upsertJob is PatchOperations.ResourceCreateOrUpdate; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing job by Id.") @doc("Retrieves an existing job by Id.") + @example("./examples/Jobs_GetJob.json", "Get a single Job") @route("/routing") getJob is GetOperations.ResourceRead; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Deletes a job and all of its traces.") @doc("Deletes a job and all of its traces.") + @example("./examples/Jobs_DeleteJob.json", "Deletes a job and all of its traces") @route("/routing") deleteJob is Operations.ResourceDelete; @@ -171,6 +198,7 @@ interface JobRouterOperations { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Reclassify a job.") @doc("Reclassify a job.") + @example("./examples/Jobs_ReclassifyJob.json", "Reclassify a job") @route("/routing/jobs/{id}:reclassify") @post reclassifyJobAction is Azure.Core.Foundations.Operation< @@ -195,6 +223,7 @@ cancellation reason. Submits request to cancel an existing job by Id while supplying free-form cancellation reason. """) + @example("./examples/Jobs_RequestJobCancel.json", "Cancels a job") @route("/routing/jobs/{id}:cancel") @post cancelJobAction is Azure.Core.Foundations.Operation< @@ -213,6 +242,7 @@ cancellation reason. #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Completes an assigned job.") @doc("Completes an assigned job.") + @example("./examples/Jobs_CompleteJob.json", "Completes a job") @route("/routing/jobs/{id}:complete") @post completeJobAction is Azure.Core.Foundations.Operation< @@ -231,6 +261,7 @@ cancellation reason. #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Closes a completed job.") @doc("Closes a completed job.") + @example("./examples/Jobs_CloseJob.json", "Closes a job") @route("/routing/jobs/{id}:close") @post closeJobAction is Azure.Core.Foundations.Operation< @@ -249,6 +280,7 @@ cancellation reason. #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves list of jobs based on filter parameters.") @doc("Retrieves list of jobs based on filter parameters.") + @example("./examples/Jobs_GetJobsWithPageSize.json", "Gets a list of jobs with pagination (max page size)") @route("/routing/jobs") @get listJobs is Azure.Core.Foundations.Operation< @@ -293,6 +325,7 @@ If specified, filter on jobs that was scheduled at or after given value. Range: #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Gets a job's position details.") @doc("Gets a job's position details.") + @example("./examples/Jobs_GetInQueuePosition.json", "Gets a job position in a queue") @route("/routing/jobs/{id}/position") @get getInQueuePosition is Azure.Core.Foundations.Operation< @@ -307,6 +340,7 @@ If specified, filter on jobs that was scheduled at or after given value. Range: #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Un-assign a job.") @doc("Un-assign a job.") + @example("./examples/Jobs_UnassignJob.json", "Unassigns a job") @route("/routing/jobs/{id}/assignments/{assignmentId}:unassign") @post unassignJobAction is Azure.Core.Foundations.Operation< @@ -335,6 +369,7 @@ accepted the job already. Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already. """) + @example("./examples/Offers_AcceptJobOffer.json", "Accept a Job Offer") @route("/routing/workers/{workerId}/offers/{offerId}:accept") @post acceptJobAction is Azure.Core.Foundations.Operation< @@ -353,6 +388,7 @@ accepted the job already. #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Declines an offer to work on a job.") @doc("Declines an offer to work on a job.") + @example("./examples/Offers_DeclineJobOffer.json", "Decline a Job Offer") @route("/routing/workers/{workerId}/offers/{offerId}:decline") @post declineJobAction is Azure.Core.Foundations.Operation< @@ -375,6 +411,7 @@ accepted the job already. #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves a queue's statistics.") @doc("Retrieves a queue's statistics.") + @example("./examples/Queues_GetQueueStatistics.json", "Get a single Queue statistics") @route("/routing/queues/{id}/statistics") @get getQueueStatistics is Azure.Core.Foundations.Operation< @@ -389,24 +426,33 @@ accepted the job already. #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a worker.") @doc("Creates or updates a worker.") + @example("./examples/Workers_CreateWorker.json", "Create a Worker") + @example("./examples/Workers_UpdateWorker.json", "Update a Worker properties") + @example("./examples/Workers_RegisterWorker.json", "Register a Worker") + @example("./examples/Workers_DeregisterActiveWorker.json", "Deregister an active Worker") + @example("./examples/Workers_DeregisterInactiveWorker.json", "Deregister a inactive Worker") @route("/routing") upsertWorker is PatchOperations.ResourceCreateOrUpdate; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing worker by Id.") @doc("Retrieves an existing worker by Id.") + @example("./examples/Workers_GetWorker.json", "Get a single Worker") @route("/routing") getWorker is GetOperations.ResourceRead; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Deletes a worker and all of its traces.") @doc("Deletes a worker and all of its traces.") + @example("./examples/Workers_DeleteWorker.json", "Delete a Worker and all of its traces") @route("/routing") deleteWorker is Operations.ResourceDelete; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves existing workers.") @doc("Retrieves existing workers.") + @example("./examples/Workers_GetWorkersWithPageSize.json", "List workers with pagination (max page size)") + @example("./examples/Workers_GetAvailableWorkersByChannel.json", "List available Workers by channel") @route("/routing/workers") @get listWorkers is Azure.Core.Foundations.Operation< diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index 44fc9567f70d..a9f01d02bb0d 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -71,6 +71,11 @@ } } }, + "x-ms-examples": { + "Get Classification policies with pagination (max page size)": { + "$ref": "./examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json" + } + }, "x-ms-pageable": { "nextLinkName": "nextLink" } @@ -122,6 +127,11 @@ } } } + }, + "x-ms-examples": { + "Get a single Classification policy": { + "$ref": "./examples/ClassificationPolicies_GetClassificationPolicy.json" + } } }, "patch": { @@ -203,6 +213,14 @@ } } } + }, + "x-ms-examples": { + "Creates a Classification Policy": { + "$ref": "./examples/ClassificationPolicies_CreateClassificationPolicy.json" + }, + "Updates a Classification Policy": { + "$ref": "./examples/ClassificationPolicies_UpdateClassificationPolicy.json" + } } }, "delete": { @@ -237,6 +255,11 @@ } } } + }, + "x-ms-examples": { + "Delete a Classification policy": { + "$ref": "./examples/ClassificationPolicies_DeleteClassificationPolicy.json" + } } } }, @@ -278,6 +301,11 @@ } } }, + "x-ms-examples": { + "Get Distribution policies with pagination (max page size)": { + "$ref": "./examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json" + } + }, "x-ms-pageable": { "nextLinkName": "nextLink" } @@ -329,6 +357,11 @@ } } } + }, + "x-ms-examples": { + "Get a single Distribution policy": { + "$ref": "./examples/DistributionPolicies_GetDistributionPolicy.json" + } } }, "patch": { @@ -410,6 +443,14 @@ } } } + }, + "x-ms-examples": { + "Creates a Distribution policy": { + "$ref": "./examples/DistributionPolicies_CreateDistributionPolicy.json" + }, + "Update a Distribution policy": { + "$ref": "./examples/DistributionPolicies_UpdateDistributionPolicy.json" + } } }, "delete": { @@ -444,6 +485,11 @@ } } } + }, + "x-ms-examples": { + "Delete a Distribution policy": { + "$ref": "./examples/DistributionPolicies_DeleteDistributionPolicy.json" + } } } }, @@ -485,6 +531,11 @@ } } }, + "x-ms-examples": { + "Get Exception policies with pagination (max page size)": { + "$ref": "./examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json" + } + }, "x-ms-pageable": { "nextLinkName": "nextLink" } @@ -536,6 +587,11 @@ } } } + }, + "x-ms-examples": { + "Get a single Exception policy": { + "$ref": "./examples/ExceptionPolicies_GetExceptionPolicy.json" + } } }, "patch": { @@ -617,6 +673,14 @@ } } } + }, + "x-ms-examples": { + "Creates a Exception policy": { + "$ref": "./examples/ExceptionPolicies_CreateExceptionPolicy.json" + }, + "Update a Exception policy": { + "$ref": "./examples/ExceptionPolicies_UpdateExceptionPolicy.json" + } } }, "delete": { @@ -651,6 +715,11 @@ } } } + }, + "x-ms-examples": { + "Delete a Exception policy": { + "$ref": "./examples/ExceptionPolicies_DeleteExceptionPolicy.json" + } } } }, @@ -828,6 +897,11 @@ } } }, + "x-ms-examples": { + "Gets a list of jobs with pagination (max page size)": { + "$ref": "./examples/Jobs_GetJobsWithPageSize.json" + } + }, "x-ms-pageable": { "nextLinkName": "nextLink" } @@ -879,6 +953,11 @@ } } } + }, + "x-ms-examples": { + "Get a single Job": { + "$ref": "./examples/Jobs_GetJob.json" + } } }, "patch": { @@ -960,6 +1039,17 @@ } } } + }, + "x-ms-examples": { + "Creates a new Job": { + "$ref": "./examples/Jobs_CreateJob.json" + }, + "Creates a scheduled job": { + "$ref": "./examples/Jobs_CreateScheduledJob.json" + }, + "Update a job": { + "$ref": "./examples/Jobs_UpdateJob.json" + } } }, "delete": { @@ -994,6 +1084,11 @@ } } } + }, + "x-ms-examples": { + "Deletes a job and all of its traces": { + "$ref": "./examples/Jobs_DeleteJob.json" + } } } }, @@ -1039,6 +1134,11 @@ } } } + }, + "x-ms-examples": { + "Reclassify a job": { + "$ref": "./examples/Jobs_ReclassifyJob.json" + } } } }, @@ -1084,6 +1184,11 @@ } } } + }, + "x-ms-examples": { + "Cancels a job": { + "$ref": "./examples/Jobs_RequestJobCancel.json" + } } } }, @@ -1129,6 +1234,11 @@ } } } + }, + "x-ms-examples": { + "Completes a job": { + "$ref": "./examples/Jobs_CompleteJob.json" + } } } }, @@ -1174,6 +1284,11 @@ } } } + }, + "x-ms-examples": { + "Closes a job": { + "$ref": "./examples/Jobs_CloseJob.json" + } } } }, @@ -1229,6 +1344,11 @@ } } } + }, + "x-ms-examples": { + "Unassigns a job": { + "$ref": "./examples/Jobs_UnassignJob.json" + } } } }, @@ -1268,6 +1388,11 @@ } } } + }, + "x-ms-examples": { + "Gets a job position in a queue": { + "$ref": "./examples/Jobs_GetInQueuePosition.json" + } } } }, @@ -1309,6 +1434,11 @@ } } }, + "x-ms-examples": { + "Get Queues with pagination (max page size)": { + "$ref": "./examples/Queues_ListQueuesWithPageSize.json" + } + }, "x-ms-pageable": { "nextLinkName": "nextLink" } @@ -1360,6 +1490,11 @@ } } } + }, + "x-ms-examples": { + "Get a single Queue": { + "$ref": "./examples/Queues_GetQueue.json" + } } }, "patch": { @@ -1441,6 +1576,14 @@ } } } + }, + "x-ms-examples": { + "Create a Queue": { + "$ref": "./examples/Queues_CreateQueue.json" + }, + "Update a Queue": { + "$ref": "./examples/Queues_UpdateQueue.json" + } } }, "delete": { @@ -1475,6 +1618,11 @@ } } } + }, + "x-ms-examples": { + "Delete a Queue": { + "$ref": "./examples/Queues_DeleteQueue.json" + } } } }, @@ -1514,6 +1662,11 @@ } } } + }, + "x-ms-examples": { + "Get a single Queue statistics": { + "$ref": "./examples/Queues_GetQueueStatistics.json" + } } } }, @@ -1615,6 +1768,14 @@ } } }, + "x-ms-examples": { + "List available Workers by channel": { + "$ref": "./examples/Workers_GetAvailableWorkersByChannel.json" + }, + "List workers with pagination (max page size)": { + "$ref": "./examples/Workers_GetWorkersWithPageSize.json" + } + }, "x-ms-pageable": { "nextLinkName": "nextLink" } @@ -1666,6 +1827,11 @@ } } } + }, + "x-ms-examples": { + "Get a single Worker": { + "$ref": "./examples/Workers_GetWorker.json" + } } }, "patch": { @@ -1747,6 +1913,23 @@ } } } + }, + "x-ms-examples": { + "Create a Worker": { + "$ref": "./examples/Workers_CreateWorker.json" + }, + "Deregister a inactive Worker": { + "$ref": "./examples/Workers_DeregisterInactiveWorker.json" + }, + "Deregister an active Worker": { + "$ref": "./examples/Workers_DeregisterActiveWorker.json" + }, + "Register a Worker": { + "$ref": "./examples/Workers_RegisterWorker.json" + }, + "Update a Worker properties": { + "$ref": "./examples/Workers_UpdateWorker.json" + } } }, "delete": { @@ -1781,6 +1964,11 @@ } } } + }, + "x-ms-examples": { + "Delete a Worker and all of its traces": { + "$ref": "./examples/Workers_DeleteWorker.json" + } } } }, @@ -1827,6 +2015,11 @@ } } } + }, + "x-ms-examples": { + "Accept a Job Offer": { + "$ref": "./examples/Offers_AcceptJobOffer.json" + } } } }, @@ -1879,6 +2072,11 @@ } } } + }, + "x-ms-examples": { + "Decline a Job Offer": { + "$ref": "./examples/Offers_DeclineJobOffer.json" + } } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_CreateClassificationPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_CreateClassificationPolicy.json new file mode 100644 index 000000000000..c0bbee9c9c42 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_CreateClassificationPolicy.json @@ -0,0 +1,94 @@ +{ + "title": "Creates or updates a classification policy.", + "operationId": "upsertClassificationPolicy", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "90eb00c4-234e-4df7-a231-ef7895518384", + "patch": { + "name": "Main", + "fallbackQueueId": "MainQueue", + "queueSelectors": [ + { + "kind": "conditional", + "condition": { + "kind": "expression-rule", + "language": "PowerFx", + "expression": "1 = 1" + }, + "queueSelectors": [ + { + "key": "foo", + "labelOperator": "equal", + "value": "bar" + } + ] + } + ], + "prioritizationRule": { + "kind": "static-rule", + "value": "2" + } + } + }, + "responses": { + "200": { + "body": { + "id": "90eb00c4-234e-4df7-a231-ef7895518384", + "name": "Main", + "fallbackQueueId": "MainQueue", + "queueSelectors": [ + { + "kind": "conditional", + "condition": { + "kind": "expression-rule", + "language": "PowerFx", + "expression": "1 = 1" + }, + "queueSelectors": [ + { + "key": "foo", + "labelOperator": "equal", + "value": "bar" + } + ] + } + ], + "prioritizationRule": { + "kind": "static-rule", + "value": "2" + }, + "workerSelectors": [] + } + }, + "201": { + "body": { + "id": "90eb00c4-234e-4df7-a231-ef7895518384", + "name": "Main", + "fallbackQueueId": "MainQueue", + "queueSelectors": [ + { + "kind": "conditional", + "condition": { + "kind": "expression-rule", + "language": "PowerFx", + "expression": "1 = 1" + }, + "queueSelectors": [ + { + "key": "foo", + "labelOperator": "equal", + "value": "bar" + } + ] + } + ], + "prioritizationRule": { + "kind": "static-rule", + "value": "2" + }, + "workerSelectors": [] + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_DeleteClassificationPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_DeleteClassificationPolicy.json new file mode 100644 index 000000000000..988f8952b7f3 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_DeleteClassificationPolicy.json @@ -0,0 +1,12 @@ +{ + "title": "Delete a classification policy by Id.", + "operationId": "deleteClassificationPolicy", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "MainClassificationPolicy" + }, + "responses": { + "204": {} + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_GetClassificationPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_GetClassificationPolicy.json new file mode 100644 index 000000000000..09d501835619 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_GetClassificationPolicy.json @@ -0,0 +1,46 @@ +{ + "title": "Retrieves an existing classification policy by Id.", + "operationId": "getClassificationPolicy", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "MainClassificationPolicy" + }, + "responses": { + "200": { + "body": { + "id": "MainClassificationPolicy", + "name": "Main", + "fallbackQueueId": "MainQueue", + "queueSelectors": [ + { + "kind": "conditional", + "condition": { + "kind": "expression-rule", + "language": "PowerFx", + "expression": "1 = 1" + }, + "queueSelectors": [ + { + "key": "foo", + "labelOperator": "equal", + "value": "bar" + } + ] + } + ], + "prioritizationRule": { + "kind": "static-rule", + "value": "2" + }, + "workerSelectors": [ + { + "kind": "pass-through", + "key": "language", + "labelOperator": "equal" + } + ] + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json new file mode 100644 index 000000000000..03303df5c951 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json @@ -0,0 +1,64 @@ +{ + "title": "Retrieves existing classification policies.", + "operationId": "listClassificationPolicies", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "maxpagesize": 2 + }, + "responses": { + "200": { + "body": { + "value": [ + { + "classificationPolicy": { + "id": "MainClassificationPolicy", + "name": "Main", + "fallbackQueueId": "MainQueue", + "queueSelectors": [ + { + "kind": "rule", + "rule": { + "kind": "expression-rule", + "language": "PowerFx", + "expression": "If(job.Escalated = true, \"SecondaryQueue\", \"MainQueue\")" + } + } + ], + "prioritizationRule": { + "kind": "static-rule", + "value": "2" + }, + "workerSelectors": [] + }, + "etag": "etag" + }, + { + "classificationPolicy": { + "id": "SecondaryClassificationPolicy", + "name": "Secondary", + "fallbackQueueId": "MainQueue", + "queueSelectors": [ + { + "kind": "rule", + "rule": { + "kind": "expression-rule", + "language": "PowerFx", + "expression": "If(job.VIP = true, \"VIPQueue\", \"MainQueue\")" + } + } + ], + "prioritizationRule": { + "kind": "static-rule", + "value": "1" + }, + "workerSelectors": [] + }, + "etag": "etag" + } + ], + "nextLink": "null" + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_UpdateClassificationPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_UpdateClassificationPolicy.json new file mode 100644 index 000000000000..4bddbb10e9bb --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_UpdateClassificationPolicy.json @@ -0,0 +1,72 @@ +{ + "title": "Updates a classification policy.", + "operationId": "updateClassificationPolicy", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "90eb00c4-234e-4df7-a231-ef7895518384", + "patch": { + "name": "MainUpdate" + } + }, + "responses": { + "200": { + "body": { + "id": "90eb00c4-234e-4df7-a231-ef7895518384", + "name": "MainUpdate", + "fallbackQueueId": "MainQueue", + "queueSelectors": [ + { + "kind": "conditional", + "condition": { + "kind": "expression-rule", + "language": "PowerFx", + "expression": "1 = 1" + }, + "queueSelectors": [ + { + "key": "foo", + "labelOperator": "equal", + "value": "bar" + } + ] + } + ], + "prioritizationRule": { + "kind": "static-rule", + "value": "2" + }, + "workerSelectors": [] + } + }, + "201": { + "body": { + "id": "90eb00c4-234e-4df7-a231-ef7895518384", + "name": "MainUpdate", + "fallbackQueueId": "MainQueue", + "queueSelectors": [ + { + "kind": "conditional", + "condition": { + "kind": "expression-rule", + "language": "PowerFx", + "expression": "1 = 1" + }, + "queueSelectors": [ + { + "key": "foo", + "labelOperator": "equal", + "value": "bar" + } + ] + } + ], + "prioritizationRule": { + "kind": "static-rule", + "value": "2" + }, + "workerSelectors": [] + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_CreateDistributionPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_CreateDistributionPolicy.json new file mode 100644 index 000000000000..144342ededc9 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_CreateDistributionPolicy.json @@ -0,0 +1,47 @@ +{ + "title": "Creates or updates a distribution policy.", + "operationId": "upsertDistributionPolicy", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "d9033d56-659c-437a-b5b7-4f3b14301dd4", + "patch": { + "mode": { + "kind": "longest-idle", + "minConcurrentOffers": 1, + "maxConcurrentOffers": 5, + "bypassSelectors": false + }, + "offerExpiresAfterSeconds": 300, + "name": "Main" + } + }, + "responses": { + "200": { + "body": { + "id": "d9033d56-659c-437a-b5b7-4f3b14301dd4", + "name": "Main", + "offerExpiresAfterSeconds": 300, + "mode": { + "kind": "longest-idle", + "minConcurrentOffers": 1, + "maxConcurrentOffers": 5, + "bypassSelectors": false + } + } + }, + "201": { + "body": { + "id": "d9033d56-659c-437a-b5b7-4f3b14301dd4", + "name": "Main", + "offerExpiresAfterSeconds": 300, + "mode": { + "kind": "longest-idle", + "minConcurrentOffers": 1, + "maxConcurrentOffers": 5, + "bypassSelectors": false + } + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_DeleteDistributionPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_DeleteDistributionPolicy.json new file mode 100644 index 000000000000..ea005b13ce32 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_DeleteDistributionPolicy.json @@ -0,0 +1,12 @@ +{ + "title": "Delete a distribution policy by Id.", + "operationId": "deleteDistributionPolicy", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "MainDistributionPolicy" + }, + "responses": { + "204": {} + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_GetDistributionPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_GetDistributionPolicy.json new file mode 100644 index 000000000000..bcbe4db5d048 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_GetDistributionPolicy.json @@ -0,0 +1,24 @@ +{ + "title": "Retrieves an existing distribution policy by Id.", + "operationId": "getDistributionPolicy", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "MainDistributionPolicy" + }, + "responses": { + "200": { + "body": { + "id": "MainDistributionPolicy", + "name": "Main", + "offerExpiresAfterSeconds": 300, + "mode": { + "kind": "longest-idle", + "minConcurrentOffers": 1, + "maxConcurrentOffers": 5, + "bypassSelectors": false + } + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json new file mode 100644 index 000000000000..6267b80e0326 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json @@ -0,0 +1,46 @@ +{ + "title": "Retrieves existing distribution policies.", + "operationId": "listDistributionPolicies", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "maxpagesize": 2 + }, + "responses": { + "200": { + "body": { + "value": [ + { + "distributionPolicy": { + "id": "SecondaryDistributionPolicy", + "name": "Secondary", + "offerExpiresAfterSeconds": 300, + "mode": { + "kind": "round-robin", + "minConcurrentOffers": 1, + "maxConcurrentOffers": 2, + "bypassSelectors": false + } + }, + "etag": "etag" + }, + { + "distributionPolicy": { + "id": "MainDistributionPolicy", + "name": "Main", + "offerExpiresAfterSeconds": 300, + "mode": { + "kind": "longest-idle", + "minConcurrentOffers": 1, + "maxConcurrentOffers": 5, + "bypassSelectors": false + } + }, + "etag": "etag" + } + ], + "nextLink": "null" + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_UpdateDistributionPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_UpdateDistributionPolicy.json new file mode 100644 index 000000000000..eda13eb06acb --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_UpdateDistributionPolicy.json @@ -0,0 +1,47 @@ +{ + "title": "Updates a distribution policy.", + "operationId": "updateDistributionPolicy", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "d9033d56-659c-437a-b5b7-4f3b14301dd4", + "patch": { + "mode": { + "kind": "longest-idle", + "minConcurrentOffers": 1, + "maxConcurrentOffers": 5, + "bypassSelectors": false + }, + "offerExpiresAfterSeconds": 300, + "name": "Main" + } + }, + "responses": { + "200": { + "body": { + "id": "d9033d56-659c-437a-b5b7-4f3b14301dd4", + "name": "Main", + "offerExpiresAfterSeconds": 300, + "mode": { + "kind": "longest-idle", + "minConcurrentOffers": 1, + "maxConcurrentOffers": 5, + "bypassSelectors": false + } + } + }, + "201": { + "body": { + "id": "d9033d56-659c-437a-b5b7-4f3b14301dd4", + "name": "Main", + "offerExpiresAfterSeconds": 300, + "mode": { + "kind": "longest-idle", + "minConcurrentOffers": 1, + "maxConcurrentOffers": 5, + "bypassSelectors": false + } + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_CreateExceptionPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_CreateExceptionPolicy.json new file mode 100644 index 000000000000..2f199895ae66 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_CreateExceptionPolicy.json @@ -0,0 +1,77 @@ +{ + "title": "Creates or updates a exception policy.", + "operationId": "upsertExceptionPolicy", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "cf1cda69-6f41-45ac-b252-213293f1b1cb", + "patch": { + "name": "Main", + "exceptionRules": { + "MaxWaitTimeExceeded": { + "actions": { + "MoveJobToEscalatedQueue": { + "kind": "reclassify", + "classificationPolicyId": "Main", + "labelsToUpsert": { + "escalated": true + } + } + }, + "trigger": { + "kind": "wait-time", + "thresholdSeconds": 20 + } + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "cf1cda69-6f41-45ac-b252-213293f1b1cb", + "name": "Main", + "exceptionRules": { + "MaxWaitTimeExceeded": { + "trigger": { + "kind": "wait-time", + "thresholdSeconds": 20 + }, + "actions": { + "MoveJobToEscalatedQueue": { + "kind": "reclassify", + "classificationPolicyId": "Main", + "labelsToUpsert": { + "escalated": true + } + } + } + } + } + } + }, + "201": { + "body": { + "id": "cf1cda69-6f41-45ac-b252-213293f1b1cb", + "name": "Main", + "exceptionRules": { + "MaxWaitTimeExceeded": { + "trigger": { + "kind": "wait-time", + "thresholdSeconds": 20 + }, + "actions": { + "MoveJobToEscalatedQueue": { + "kind": "reclassify", + "classificationPolicyId": "Main", + "labelsToUpsert": { + "escalated": true + } + } + } + } + } + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_DeleteExceptionPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_DeleteExceptionPolicy.json new file mode 100644 index 000000000000..3bfe46420477 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_DeleteExceptionPolicy.json @@ -0,0 +1,12 @@ +{ + "title": "Deletes a exception policy by Id.", + "operationId": "deleteExceptionPolicy", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "MainExceptionPolicy" + }, + "responses": { + "204": {} + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_GetExceptionPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_GetExceptionPolicy.json new file mode 100644 index 000000000000..db8355c39a18 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_GetExceptionPolicy.json @@ -0,0 +1,34 @@ +{ + "title": "Retrieves an existing exception policy by Id.", + "operationId": "getExceptionPolicy", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "MainExceptionPolicy" + }, + "responses": { + "200": { + "body": { + "id": "MainExceptionPolicy", + "name": "Main", + "exceptionRules": { + "MaxWaitTimeExceeded": { + "trigger": { + "kind": "wait-time", + "thresholdSeconds": 20 + }, + "actions": { + "MoveJobToEscalatedQueue": { + "kind": "reclassify", + "classificationPolicyId": "Main", + "labelsToUpsert": { + "escalated": true + } + } + } + } + } + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json new file mode 100644 index 000000000000..e873ad5978e1 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json @@ -0,0 +1,66 @@ +{ + "title": "Retrieves existing exception policies.", + "operationId": "listExceptionPolicies", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "maxpagesize": 2 + }, + "responses": { + "200": { + "body": { + "value": [ + { + "exceptionPolicy": { + "id": "MainExceptionPolicy", + "name": "Main", + "exceptionRules": { + "MaxWaitTimeExceeded": { + "trigger": { + "kind": "wait-time", + "thresholdSeconds": 20 + }, + "actions": { + "MoveJobToEscalatedQueue": { + "kind": "reclassify", + "classificationPolicyId": "Main", + "labelsToUpsert": { + "escalated": true + } + } + } + } + } + }, + "etag": "etag" + }, + { + "exceptionPolicy": { + "id": "SecondaryExceptionPolicy", + "name": "Secondary", + "exceptionRules": { + "MaxWaitTimeExceeded": { + "trigger": { + "kind": "wait-time", + "thresholdSeconds": 50 + }, + "actions": { + "MoveJobToVIPQueue": { + "kind": "reclassify", + "classificationPolicyId": "Main", + "labelsToUpsert": { + "VIP": true + } + } + } + } + } + }, + "etag": "etag" + } + ], + "nextLink": "null" + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_UpdateExceptionPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_UpdateExceptionPolicy.json new file mode 100644 index 000000000000..b1f24206410e --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_UpdateExceptionPolicy.json @@ -0,0 +1,77 @@ +{ + "title": "Updates a exception policy.", + "operationId": "updateExceptionPolicy", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "cf1cda69-6f41-45ac-b252-213293f1b1cb", + "patch": { + "name": "Main test", + "exceptionRules": { + "MaxWaitTimeExceeded": { + "actions": { + "MoveJobToEscalatedQueue": { + "kind": "reclassify", + "classificationPolicyId": "Main", + "labelsToUpsert": { + "escalated": true + } + } + }, + "trigger": { + "kind": "wait-time", + "thresholdSeconds": 20 + } + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "cf1cda69-6f41-45ac-b252-213293f1b1cb", + "name": "Main test", + "exceptionRules": { + "MaxWaitTimeExceeded": { + "trigger": { + "kind": "wait-time", + "thresholdSeconds": 20 + }, + "actions": { + "MoveJobToEscalatedQueue": { + "kind": "reclassify", + "classificationPolicyId": "Main", + "labelsToUpsert": { + "escalated": true + } + } + } + } + } + } + }, + "201": { + "body": { + "id": "cf1cda69-6f41-45ac-b252-213293f1b1cb", + "name": "Main test", + "exceptionRules": { + "MaxWaitTimeExceeded": { + "trigger": { + "kind": "wait-time", + "thresholdSeconds": 20 + }, + "actions": { + "MoveJobToEscalatedQueue": { + "kind": "reclassify", + "classificationPolicyId": "Main", + "labelsToUpsert": { + "escalated": true + } + } + } + } + } + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json new file mode 100644 index 000000000000..273f1bda9c74 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json @@ -0,0 +1,22 @@ +{ + "title": "Closes a completed job.", + "operationId": "closeJobAction", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "8780b28c-7079-4de1-9143-4d369289e958", + "closeJobRequest": { + "assignmentId": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "dispositionCode": "JobCompleted.", + "note": "Closing job" + } + }, + "responses": { + "200": { + "body": {} + }, + "202": { + "body": {} + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CompleteJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CompleteJob.json new file mode 100644 index 000000000000..42f7b1900a83 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CompleteJob.json @@ -0,0 +1,18 @@ +{ + "title": "Completes an assigned job.", + "operationId": "completeJobAction", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "8780b28c-7079-4de1-9143-4d369289e958", + "completeJobRequest": { + "assignmentId": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "note": "Completing job" + } + }, + "responses": { + "200": { + "body": {} + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateJob.json new file mode 100644 index 000000000000..ac53895d17cc --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateJob.json @@ -0,0 +1,93 @@ +{ + "title": "Creates or updates a router job.", + "operationId": "upsertJob", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "JobId", + "patch": { + "channelId": "CustomChatChannel", + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "queueId": "MainQueue", + "priority": 5, + "requestedWorkerSelectors": [ + { + "key": "Sales", + "labelOperator": "equal", + "value": true + } + ], + "labels": {}, + "matchingMode": { + "modeType": "queueAndMatchMode", + "queueAndMatchMode": {}, + "scheduleAndSuspendMode": null, + "suspendMode": null + } + } + }, + "responses": { + "200": { + "body": { + "id": "JobId", + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "status": "queued", + "enqueuedAt": "2021-09-30T23:59:04.5311999+00:00", + "channelId": "CustomChatChannel", + "classificationPolicyId": null, + "queueId": "MainQueue", + "priority": 5, + "dispositionCode": null, + "requestedWorkerSelectors": [ + { + "key": "Sales", + "labelOperator": "equal", + "value": true, + "expiresAfterSeconds": null + } + ], + "attachedWorkerSelectors": [], + "labels": {}, + "assignments": {}, + "notes": {}, + "matchingMode": { + "modeType": "queueAndMatchMode", + "queueAndMatchMode": {}, + "scheduleAndSuspendMode": null, + "suspendMode": null + } + } + }, + "201": { + "body": { + "id": "JobId", + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "status": "queued", + "enqueuedAt": "2021-09-30T23:59:04.5311999+00:00", + "channelId": "CustomChatChannel", + "classificationPolicyId": null, + "queueId": "MainQueue", + "priority": 5, + "dispositionCode": null, + "requestedWorkerSelectors": [ + { + "key": "Sales", + "labelOperator": "equal", + "value": true, + "expiresAfterSeconds": null + } + ], + "attachedWorkerSelectors": [], + "labels": {}, + "assignments": {}, + "notes": {}, + "matchingMode": { + "modeType": "queueAndMatchMode", + "queueAndMatchMode": {}, + "scheduleAndSuspendMode": null, + "suspendMode": null + } + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateScheduledJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateScheduledJob.json new file mode 100644 index 000000000000..11b37c9be798 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateScheduledJob.json @@ -0,0 +1,101 @@ +{ + "title": "Creates or updates a scheduled router job.", + "operationId": "upsertScheduledJob", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "JobId", + "patch": { + "channelId": "CustomChatChannel", + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "queueId": "MainQueue", + "priority": 5, + "requestedWorkerSelectors": [ + { + "key": "Sales", + "labelOperator": "equal", + "value": true + } + ], + "labels": {}, + "matchingMode": { + "modeType": "scheduleAndSuspendMode", + "queueAndMatchMode": null, + "scheduleAndSuspendMode": { + "scheduleAt": "2023-05-26T23:22:12.0774222+00:00" + }, + "suspendMode": null + } + } + }, + "responses": { + "200": { + "body": { + "id": "JobId", + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "status": "queued", + "enqueuedAt": "2021-09-30T23:59:04.5311999+00:00", + "channelId": "CustomChatChannel", + "classificationPolicyId": null, + "queueId": "MainQueue", + "priority": 5, + "dispositionCode": null, + "requestedWorkerSelectors": [ + { + "key": "Sales", + "labelOperator": "equal", + "value": true, + "expiresAfterSeconds": null + } + ], + "attachedWorkerSelectors": [], + "labels": {}, + "assignments": {}, + "notes": {}, + "matchingMode": { + "modeType": "scheduleAndSuspendMode", + "queueAndMatchMode": null, + "scheduleAndSuspendMode": { + "scheduleAt": "2023-05-26T23:22:12.0774222+00:00" + }, + "suspendMode": null + }, + "scheduledAt": null + } + }, + "201": { + "body": { + "id": "JobId", + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "status": "queued", + "enqueuedAt": "2021-09-30T23:59:04.5311999+00:00", + "channelId": "CustomChatChannel", + "classificationPolicyId": null, + "queueId": "MainQueue", + "priority": 5, + "dispositionCode": null, + "requestedWorkerSelectors": [ + { + "key": "Sales", + "labelOperator": "equal", + "value": true, + "expiresAfterSeconds": null + } + ], + "attachedWorkerSelectors": [], + "labels": {}, + "assignments": {}, + "notes": {}, + "matchingMode": { + "modeType": "scheduleAndSuspendMode", + "queueAndMatchMode": null, + "scheduleAndSuspendMode": { + "scheduleAt": "2023-05-26T23:22:12.0774222+00:00" + }, + "suspendMode": null + }, + "scheduledAt": null + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_DeleteJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_DeleteJob.json new file mode 100644 index 000000000000..10823014e574 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_DeleteJob.json @@ -0,0 +1,12 @@ +{ + "title": "Deletes a job and all of its traces.", + "operationId": "deleteJob", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "8780b28c-7079-4de1-9143-4d369289e958" + }, + "responses": { + "204": {} + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetInQueuePosition.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetInQueuePosition.json new file mode 100644 index 000000000000..7eea6f88f65c --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetInQueuePosition.json @@ -0,0 +1,20 @@ +{ + "title": "Gets a job's position details.", + "operationId": "getInQueuePosition", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "8780b28c-7079-4de1-9143-4d369289e958" + }, + "responses": { + "200": { + "body": { + "jobId": "383541b3-5637-4af6-8aac-3391da8a578a", + "position": 1, + "queueId": "MainQueue", + "queueLength": 3, + "estimatedWaitTimeMinutes": 4 + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJob.json new file mode 100644 index 000000000000..7a1710fff3c0 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJob.json @@ -0,0 +1,42 @@ +{ + "title": "Retrieves an existing job by Id.", + "operationId": "getJob", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "8780b28c-7079-4de1-9143-4d369289e958" + }, + "responses": { + "200": { + "body": { + "id": "8780b28c-7079-4de1-9143-4d369289e958", + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "status": "queued", + "enqueuedAt": "2021-09-30T23:59:04.5311999+00:00", + "channelId": "CustomVoiceChannel", + "classificationPolicyId": null, + "queueId": "MainQueue", + "priority": 5, + "dispositionCode": null, + "requestedWorkerSelectors": [ + { + "key": "Sales", + "labelOperator": "equal", + "value": true, + "expiresAfterSeconds": null + } + ], + "attachedWorkerSelectors": [], + "labels": {}, + "assignments": {}, + "notes": {}, + "matchingMode": { + "modeType": "queueAndMatchMode", + "queueAndMatchMode": {}, + "scheduleAndSuspendMode": null, + "suspendMode": null + } + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJobsWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJobsWithPageSize.json new file mode 100644 index 000000000000..13e3dba7d2b6 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJobsWithPageSize.json @@ -0,0 +1,67 @@ +{ + "title": "Retrieves list of active jobs with page size", + "operationId": "listJobs", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "status": "active", + "queueId": null, + "channelId": null, + "maxpagesize": 2 + }, + "responses": { + "200": { + "body": { + "value": [ + { + "job": { + "id": "383541b3-5637-4af6-8aac-3391da8a578a", + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "status": "queued", + "enqueuedAt": "2021-09-30T23:56:21.883322+00:00", + "channelId": "CustomChatChannel", + "classificationPolicyId": null, + "queueId": "MainQueue", + "priority": 5, + "dispositionCode": null, + "labels": {}, + "assignments": {}, + "notes": {}, + "matchingMode": { + "modeType": "queueAndMatchMode", + "queueAndMatchMode": {}, + "scheduleAndSuspendMode": null, + "suspendMode": null + } + }, + "etag": "etag" + }, + { + "job": { + "id": "c571dd84-1ca7-4606-a77a-f38d9e4ae513", + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "status": "queued", + "enqueuedAt": "2021-09-30T23:57:54.041179+00:00", + "channelId": "CustomChatChannel2", + "classificationPolicyId": null, + "queueId": "MainQueue", + "priority": 5, + "dispositionCode": null, + "labels": {}, + "assignments": {}, + "notes": {}, + "matchingMode": { + "modeType": "queueAndMatchMode", + "queueAndMatchMode": {}, + "scheduleAndSuspendMode": null, + "suspendMode": null + } + }, + "etag": "etag" + } + ], + "nextLink": "null" + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_ReclassifyJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_ReclassifyJob.json new file mode 100644 index 000000000000..7768c840a2e3 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_ReclassifyJob.json @@ -0,0 +1,15 @@ +{ + "title": "Reclassify a job.", + "operationId": "reclassifyJobAction", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "8780b28c-7079-4de1-9143-4d369289e958", + "reclassifyJobRequest": {} + }, + "responses": { + "200": { + "body": {} + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_RequestJobCancel.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_RequestJobCancel.json new file mode 100644 index 000000000000..5de5bea923dc --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_RequestJobCancel.json @@ -0,0 +1,18 @@ +{ + "title": "Submits request to cancel an existing job by Id.", + "operationId": "cancelJobAction", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "8780b28c-7079-4de1-9143-4d369289e958", + "cancelJobRequest": { + "note": "User hung up while waiting in queue.", + "dispositionCode": "Disconnected" + } + }, + "responses": { + "200": { + "body": {} + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UnassignJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UnassignJob.json new file mode 100644 index 000000000000..5e67be00a5df --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UnassignJob.json @@ -0,0 +1,21 @@ +{ + "title": "Un-assign a job.", + "operationId": "unassignJobAction", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "8780b28c-7079-4de1-9143-4d369289e958", + "assignmentId": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "unassignJobRequest": { + "suspendMatching": false + } + }, + "responses": { + "200": { + "body": { + "jobId": "8780b28c-7079-4de1-9143-4d369289e958", + "unassignmentCount": 1 + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UpdateJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UpdateJob.json new file mode 100644 index 000000000000..b02b22dcd905 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UpdateJob.json @@ -0,0 +1,76 @@ +{ + "title": "Updates a router job.", + "operationId": "upsertJob", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "8780b28c-7079-4de1-9143-4d369289e958", + "patch": { + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af" + } + }, + "responses": { + "200": { + "body": { + "id": "383541b3-5637-4af6-8aac-3391da8a578a", + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "status": "queued", + "enqueuedAt": "2021-09-30T23:59:04.5311999+00:00", + "channelId": "CustomVoiceChannel", + "classificationPolicyId": null, + "queueId": "MainQueue", + "priority": 5, + "dispositionCode": null, + "requestedWorkerSelectors": [ + { + "key": "Sales", + "labelOperator": "equal", + "value": true, + "expiresAfterSeconds": null + } + ], + "attachedWorkerSelectors": [], + "labels": {}, + "assignments": {}, + "notes": {}, + "matchingMode": { + "modeType": "queueAndMatchMode", + "queueAndMatchMode": {}, + "scheduleAndSuspendMode": null, + "suspendMode": null + } + } + }, + "201": { + "body": { + "id": "383541b3-5637-4af6-8aac-3391da8a578a", + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "status": "queued", + "enqueuedAt": "2021-09-30T23:59:04.5311999+00:00", + "channelId": "CustomVoiceChannel", + "classificationPolicyId": null, + "queueId": "MainQueue", + "priority": 5, + "dispositionCode": null, + "requestedWorkerSelectors": [ + { + "key": "Sales", + "labelOperator": "equal", + "value": true, + "expiresAfterSeconds": null + } + ], + "attachedWorkerSelectors": [], + "labels": {}, + "assignments": {}, + "notes": {}, + "matchingMode": { + "modeType": "queueAndMatchMode", + "queueAndMatchMode": {}, + "scheduleAndSuspendMode": null, + "suspendMode": null + } + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_AcceptJobOffer.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_AcceptJobOffer.json new file mode 100644 index 000000000000..042b312a9181 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_AcceptJobOffer.json @@ -0,0 +1,19 @@ +{ + "title": "Accepts an offer to work on a job.", + "operationId": "acceptJobAction", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "workerId": "DefaultWorker", + "offerId": "1d5896f3-8b54-40be-82d3-910323f5e2af" + }, + "responses": { + "200": { + "body": { + "assignmentId": "246d5a06-c04a-4b6b-8a34-02bbd9fdad68", + "jobId": "632f5345-220b-4e46-b31f-aeaf03cc2df9", + "workerId": "DefaultWorker" + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_DeclineJobOffer.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_DeclineJobOffer.json new file mode 100644 index 000000000000..b20f5ab6bfb1 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_DeclineJobOffer.json @@ -0,0 +1,18 @@ +{ + "title": "Declines an offer to work on a job.", + "operationId": "declineJobAction", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "workerId": "DefaultWorker", + "offerId": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "declineJobOfferRequest": { + "retryOfferAt": "2023-05-26T00:00:00.0000000Z" + } + }, + "responses": { + "200": { + "body": {} + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_CreateQueue.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_CreateQueue.json new file mode 100644 index 000000000000..27559ba5af6f --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_CreateQueue.json @@ -0,0 +1,35 @@ +{ + "title": "Creates or updates a queue.", + "operationId": "upsertQueue", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "QueueId", + "patch": { + "distributionPolicyId": "MainDistributionPolicy", + "name": "Main", + "labels": {}, + "exceptionPolicyId": "MainExceptionPolicy" + } + }, + "responses": { + "200": { + "body": { + "id": "246d5a06-c04a-4b6b-8a34-02bbd9fdad68", + "name": "Main", + "distributionPolicyId": "MainDistributionPolicy", + "labels": {}, + "exceptionPolicyId": "MainExceptionPolicy" + } + }, + "201": { + "body": { + "id": "246d5a06-c04a-4b6b-8a34-02bbd9fdad68", + "name": "Main", + "distributionPolicyId": "MainDistributionPolicy", + "labels": {}, + "exceptionPolicyId": "MainExceptionPolicy" + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_DeleteQueue.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_DeleteQueue.json new file mode 100644 index 000000000000..6400dc7270a6 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_DeleteQueue.json @@ -0,0 +1,12 @@ +{ + "title": "Deletes a queue by Id.", + "operationId": "deleteQueue", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "MainQueue" + }, + "responses": { + "204": {} + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_GetQueue.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_GetQueue.json new file mode 100644 index 000000000000..c5b5a85905e5 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_GetQueue.json @@ -0,0 +1,20 @@ +{ + "title": "Retrieves an existing queue by Id.", + "operationId": "getQueue", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "MainQueue" + }, + "responses": { + "200": { + "body": { + "id": "MainQueue", + "name": "Main", + "distributionPolicyId": "MainDistributionPolicy", + "labels": {}, + "exceptionPolicyId": "MainExceptionPolicy" + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_GetQueueStatistics.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_GetQueueStatistics.json new file mode 100644 index 000000000000..bb47dc464d6c --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_GetQueueStatistics.json @@ -0,0 +1,17 @@ +{ + "title": "Retrieves a queue's statistics.", + "operationId": "getQueueStatistics", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "MainQueue" + }, + "responses": { + "200": { + "body": { + "queueId": "MainQueue", + "length": 5 + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_ListQueuesWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_ListQueuesWithPageSize.json new file mode 100644 index 000000000000..9bc02b6005c2 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_ListQueuesWithPageSize.json @@ -0,0 +1,38 @@ +{ + "title": "Retrieves existing queues.", + "operationId": "listQueues", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "maxpagesize": 2 + }, + "responses": { + "200": { + "body": { + "value": [ + { + "queue": { + "id": "MainQueue", + "name": "Main", + "distributionPolicyId": "MainDistributionPolicy", + "labels": {}, + "exceptionPolicyId": "MainExceptionPolicy" + }, + "etag": "etag" + }, + { + "queue": { + "id": "SecondaryQueue", + "name": "Secondary", + "distributionPolicyId": "SecondaryDistributionPolicy", + "labels": {}, + "exceptionPolicyId": "SecondaryExceptionPolicy" + }, + "etag": "etag" + } + ], + "nextLink": "null" + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_UpdateQueue.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_UpdateQueue.json new file mode 100644 index 000000000000..7219bb223977 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_UpdateQueue.json @@ -0,0 +1,33 @@ +{ + "title": "Updates a queue.", + "operationId": "upsertQueue", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "id": "MainQueue", + "patch": { + "distributionPolicyId": "MainDistributionPolicy", + "name": "Main" + } + }, + "responses": { + "200": { + "body": { + "id": "MainQueue", + "name": "Main", + "distributionPolicyId": "MainDistributionPolicy", + "labels": {}, + "exceptionPolicyId": "MainExceptionPolicy" + } + }, + "201": { + "body": { + "id": "MainQueue", + "name": "Main", + "distributionPolicyId": "MainDistributionPolicy", + "labels": {}, + "exceptionPolicyId": "MainExceptionPolicy" + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_CreateWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_CreateWorker.json new file mode 100644 index 000000000000..514072f0e9fd --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_CreateWorker.json @@ -0,0 +1,83 @@ +{ + "title": "Creates or updates a worker.", + "operationId": "upsertWorker", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "workerId": "WorkerId", + "patch": { + "totalCapacity": 10, + "queueAssignments": { + "MainQueue": {}, + "SecondaryQueue": null + }, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 11, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 1 + } + }, + "availableForOffers": false + } + }, + "responses": { + "200": { + "body": { + "id": "WorkerId", + "state": "inactive", + "queueAssignments": { + "MainQueue": {} + }, + "totalCapacity": 10, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 11, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 1 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": false + } + }, + "201": { + "body": { + "id": "WorkerId", + "state": "inactive", + "queueAssignments": { + "MainQueue": {} + }, + "totalCapacity": 10, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 11, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 1 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": false + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeleteWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeleteWorker.json new file mode 100644 index 000000000000..6ac3ad6c1437 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeleteWorker.json @@ -0,0 +1,12 @@ +{ + "title": "Deletes a worker and all of its traces.", + "operationId": "deleteWorker", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "workerId": "DefaultWorker" + }, + "responses": { + "204": {} + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterActiveWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterActiveWorker.json new file mode 100644 index 000000000000..c01624291b5b --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterActiveWorker.json @@ -0,0 +1,67 @@ +{ + "title": "De-register an active worker", + "operationId": "deregisterActiveWorker", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "workerId": "WorkerId", + "patch": { + "availableForOffers": false, + "totalCapacity": 10 + } + }, + "responses": { + "200": { + "body": { + "id": "WorkerId", + "state": "draining", + "queueAssignments": { + "MainQueue": {} + }, + "totalCapacity": 10, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 11, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 1 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": false + } + }, + "201": { + "body": { + "id": "WorkerId", + "state": "draining", + "queueAssignments": { + "MainQueue": {} + }, + "totalCapacity": 10, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 11, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 1 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": false + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterInactiveWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterInactiveWorker.json new file mode 100644 index 000000000000..6e309d90e600 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterInactiveWorker.json @@ -0,0 +1,67 @@ +{ + "title": "De-register an inactive worker", + "operationId": "deregisterInactiveWorker", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "workerId": "WorkerId", + "patch": { + "availableForOffers": false, + "totalCapacity": 10 + } + }, + "responses": { + "200": { + "body": { + "id": "WorkerId", + "state": "inactive", + "queueAssignments": { + "MainQueue": {} + }, + "totalCapacity": 10, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 11, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 1 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": false + } + }, + "201": { + "body": { + "id": "WorkerId", + "state": "inactive", + "queueAssignments": { + "MainQueue": {} + }, + "totalCapacity": 10, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 11, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 1 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": false + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json new file mode 100644 index 000000000000..4220427f911e --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json @@ -0,0 +1,76 @@ +{ + "title": "Retrieves available worker filtered by channel", + "operationId": "listActiveWorkersByChannel", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "state": "active", + "channelId": "CustomChatChannel", + "hasCapacity": true + }, + "responses": { + "200": { + "body": { + "value": [ + { + "worker": { + "id": "DefaultWorker", + "state": "active", + "queueAssignments": { + "MainQueue": {}, + "SecondaryQueue": {} + }, + "totalCapacity": 100, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 100, + "maxNumberOfJobs": 1 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": true + }, + "etag": "etag" + }, + { + "worker": { + "id": "SecondWorker", + "state": "active", + "queueAssignments": { + "MainQueue": {}, + "SecondaryQueue": {} + }, + "totalCapacity": 100, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 100, + "maxNumberOfJobs": 1 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": true + }, + "etag": "etag" + } + ], + "nextLink": "null" + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorker.json new file mode 100644 index 000000000000..1cb931459c89 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorker.json @@ -0,0 +1,38 @@ +{ + "title": "Retrieves an existing worker by Id.", + "operationId": "getWorker", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "workerId": "DefaultWorker" + }, + "responses": { + "200": { + "body": { + "id": "DefaultWorker", + "state": "active", + "queueAssignments": { + "MainQueue": {}, + "SecondaryQueue": {} + }, + "totalCapacity": 100, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 100, + "maxNumberOfJobs": 1 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": true + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json new file mode 100644 index 000000000000..dd2898b663d1 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json @@ -0,0 +1,74 @@ +{ + "title": "Retrieves list of workers with page size", + "operationId": "listWorkers", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "maxpagesize": 2 + }, + "responses": { + "200": { + "body": { + "value": [ + { + "worker": { + "id": "DefaultWorker", + "state": "active", + "queueAssignments": { + "MainQueue": {}, + "SecondaryQueue": {} + }, + "totalCapacity": 100, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 100, + "maxNumberOfJobs": 1 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": true + }, + "etag": "etag" + }, + { + "worker": { + "id": "SecondWorker", + "state": "active", + "queueAssignments": { + "MainQueue": {}, + "SecondaryQueue": {} + }, + "totalCapacity": 100, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomEmailChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 4 + }, + "CustomSMSChannel": { + "capacityCostPerJob": 100, + "maxNumberOfJobs": 1 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": true + }, + "etag": "etag" + } + ], + "nextLink": "null" + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_RegisterWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_RegisterWorker.json new file mode 100644 index 000000000000..2a4ee193b8d3 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_RegisterWorker.json @@ -0,0 +1,67 @@ +{ + "title": "Register a worker", + "operationId": "registerWorker", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "workerId": "WorkerId", + "patch": { + "availableForOffers": true, + "totalCapacity": 10 + } + }, + "responses": { + "200": { + "body": { + "id": "WorkerId", + "state": "active", + "queueAssignments": { + "MainQueue": {} + }, + "totalCapacity": 10, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 11, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 1 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": true + } + }, + "201": { + "body": { + "id": "WorkerId", + "state": "active", + "queueAssignments": { + "MainQueue": {} + }, + "totalCapacity": 10, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 11, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 1 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": true + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_UpdateWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_UpdateWorker.json new file mode 100644 index 000000000000..19889a4e160f --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_UpdateWorker.json @@ -0,0 +1,83 @@ +{ + "title": "Updates a worker", + "operationId": "updateWorker", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "workerId": "WorkerId", + "patch": { + "totalCapacity": 10, + "queueAssignments": { + "MainQueue": {}, + "SecondaryQueue": null + }, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 11, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 1 + } + }, + "availableForOffers": false + } + }, + "responses": { + "200": { + "body": { + "id": "WorkerId", + "state": "inactive", + "queueAssignments": { + "MainQueue": {} + }, + "totalCapacity": 10, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 11, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 1 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": false + } + }, + "201": { + "body": { + "id": "WorkerId", + "state": "inactive", + "queueAssignments": { + "MainQueue": {} + }, + "totalCapacity": 10, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 11, + "maxNumberOfJobs": 4 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 10, + "maxNumberOfJobs": 1 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": false + } + } + } +} From dc0bf129b082cf4a11ea18387a13b66c3a4167b6 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 26 Sep 2023 09:57:30 -0700 Subject: [PATCH 025/113] ci fixes 2 --- .../Communication.JobRouter/models.tsp | 27 +++++++++ .../Communication.JobRouter/routes.tsp | 42 ++++++------- .../communicationservicejobrouter.json | 59 +++++++++++-------- ...onPolicies_CreateClassificationPolicy.json | 8 +-- ...ationPolicies_GetClassificationPolicy.json | 2 +- ...istClassificationPoliciesWithPageSize.json | 7 +-- ...onPolicies_UpdateClassificationPolicy.json | 6 +- ...tionPolicies_CreateDistributionPolicy.json | 2 +- ..._ListDistributionPoliciesWithPageSize.json | 3 +- ...tionPolicies_UpdateDistributionPolicy.json | 2 +- ...ceptionPolicies_CreateExceptionPolicy.json | 2 +- ...ies_ListExceptionPoliciesWithPageSize.json | 3 +- ...ceptionPolicies_UpdateExceptionPolicy.json | 2 +- .../2023-11-01/examples/Jobs_CreateJob.json | 2 +- .../examples/Jobs_CreateScheduledJob.json | 2 +- .../examples/Jobs_GetJobsWithPageSize.json | 3 +- .../2023-11-01/examples/Jobs_UpdateJob.json | 2 +- 17 files changed, 103 insertions(+), 71 deletions(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index ef94b58d671c..bd7c13a1af98 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -1408,6 +1408,33 @@ selected. workerSelectors: RouterWorkerSelector[]; } +@doc("Request payload for reclassifying jobs") +model ReclassifyJobRequest {} + +@doc("Response payload from reclassifying a job") +model ReclassifyJobResult {} + +alias ReclassfiyJobOkReponse = TypeSpec.Http.Response<200> & ReclassifyJobResult; + +@doc("Response payload from closing a job") +model CloseJobResult {} + +alias CloseJobResultWithOkResponse = TypeSpec.Http.Response<200> & CloseJobResult; + +alias CloseJobResultWithAcceptedResponse = TypeSpec.Http.Response<202> & CloseJobResult; + +alias CloseJobResultResponse = CloseJobResultWithOkResponse | CloseJobResultWithAcceptedResponse; + +@doc("Response payload from cancelling a job") +model CancelJobResult {} + +alias CancelJobResultWithOkResponse = TypeSpec.Http.Response<200> & CancelJobResult; + +@doc("Response payload from completing a job") +model CompleteJobResult {} + +alias CompleteJobResultWithOkResponse = TypeSpec.Http.Response<200> & CompleteJobResult; + @doc("JobRouter Versions") enum Versions { @doc("JobRouter 2023-11-01 api version") diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index 5e494b8a236e..d48e0620e733 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -53,7 +53,7 @@ interface JobRouterAdministrationOperations { { @doc("Maximum page size.") @query - maxpagesize: int32; + maxpagesize?: int32; }, ClassificationPolicyCollection >; @@ -90,7 +90,7 @@ interface JobRouterAdministrationOperations { { @doc("Maximum page size.") @query - maxpagesize: int32; + maxpagesize?: int32; }, DistributionPolicyCollection >; @@ -127,7 +127,7 @@ interface JobRouterAdministrationOperations { { @doc("Number of objects to return per page.") @query - maxpagesize: int32; + maxpagesize?: int32; }, ExceptionPolicyCollection >; @@ -164,7 +164,7 @@ interface JobRouterAdministrationOperations { { @doc("Number of objects to return per page.") @query - maxpagesize: int32; + maxpagesize?: int32; }, RouterQueueCollection >; @@ -209,9 +209,9 @@ interface JobRouterOperations { @doc("Request object for reclassifying a job.") @body - reclassifyJobRequest: {}; + reclassifyJobRequest: ReclassifyJobRequest; }, - void + ReclassfiyJobOkReponse >; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -236,7 +236,7 @@ cancellation reason. @body cancelJobRequest: CancelJobRequest; }, - void + CancelJobResultWithOkResponse >; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -255,7 +255,7 @@ cancellation reason. @body completeJobRequest: CompleteJobRequest; }, - void + CompleteJobResultWithOkResponse >; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -274,7 +274,7 @@ cancellation reason. @body closeJobRequest: CloseJobRequest; }, - void + CloseJobResultResponse >; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -287,37 +287,37 @@ cancellation reason. { @doc("If specified, filter jobs by status.") @query - status: RouterJobStatusSelector; + status?: RouterJobStatusSelector = RouterJobStatusSelector.all; @doc("If specified, filter jobs by queue.") @query - queueId: string; + queueId?: string; @doc("If specified, filter jobs by channel.") @query - channelId: string; + channelId?: string; @doc("If specified, filter jobs by classificationPolicy.") @query - classificationPolicyId: string; + classificationPolicyId?: string; @doc(""" If specified, filter on jobs that was scheduled before or at given timestamp. Range: (-Inf, scheduledBefore]. """) @query - scheduledBefore: utcDateTime; + scheduledBefore?: utcDateTime; @doc(""" If specified, filter on jobs that was scheduled at or after given value. Range: [scheduledAfter, +Inf). """) @query - scheduledAfter: utcDateTime; + scheduledAfter?: utcDateTime; @doc("Number of objects to return per page.") @query - maxpagesize: int32; + maxpagesize?: int32; }, RouterJobCollection >; @@ -459,15 +459,15 @@ accepted the job already. { @doc("If specified, select workers by worker state.") @query - state: RouterWorkerStateSelector; + state?: RouterWorkerStateSelector = RouterWorkerStateSelector.all; @doc("If specified, select workers who have a channel configuration with this channel.") @query - channelId: string; + channelId?: string; @doc("If specified, select workers who are assigned to this queue.") @query - queueId: string; + queueId?: string; @doc(""" If set to true, select only workers who have capacity for the channel specified @@ -476,11 +476,11 @@ false, then will return all workers including workers without any capacity for jobs. Defaults to false. """) @query - hasCapacity: boolean; + hasCapacity?: boolean; @doc("Number of objects to return per page.") @query - maxpagesize: int32; + maxpagesize?: int32; }, RouterWorkerCollection >; diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index a9f01d02bb0d..5905ab30faa5 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -46,7 +46,7 @@ "name": "maxpagesize", "in": "query", "description": "Maximum page size.", - "required": true, + "required": false, "type": "integer", "format": "int32" } @@ -276,7 +276,7 @@ "name": "maxpagesize", "in": "query", "description": "Maximum page size.", - "required": true, + "required": false, "type": "integer", "format": "int32" } @@ -506,7 +506,7 @@ "name": "maxpagesize", "in": "query", "description": "Number of objects to return per page.", - "required": true, + "required": false, "type": "integer", "format": "int32" } @@ -736,8 +736,9 @@ "name": "status", "in": "query", "description": "If specified, filter jobs by status.", - "required": true, + "required": false, "type": "string", + "default": "all", "enum": [ "all", "pendingClassification", @@ -835,28 +836,28 @@ "name": "queueId", "in": "query", "description": "If specified, filter jobs by queue.", - "required": true, + "required": false, "type": "string" }, { "name": "channelId", "in": "query", "description": "If specified, filter jobs by channel.", - "required": true, + "required": false, "type": "string" }, { "name": "classificationPolicyId", "in": "query", "description": "If specified, filter jobs by classificationPolicy.", - "required": true, + "required": false, "type": "string" }, { "name": "scheduledBefore", "in": "query", "description": "If specified, filter on jobs that was scheduled before or at given timestamp.\nRange: (-Inf, scheduledBefore].", - "required": true, + "required": false, "type": "string", "format": "date-time" }, @@ -864,7 +865,7 @@ "name": "scheduledAfter", "in": "query", "description": "If specified, filter on jobs that was scheduled at or after given value. Range:\n[scheduledAfter, +Inf).", - "required": true, + "required": false, "type": "string", "format": "date-time" }, @@ -872,7 +873,7 @@ "name": "maxpagesize", "in": "query", "description": "Number of objects to return per page.", - "required": true, + "required": false, "type": "integer", "format": "int32" } @@ -1114,13 +1115,13 @@ "description": "Request object for reclassifying a job.", "required": true, "schema": { - "type": "object" + "$ref": "#/definitions/ReclassifyJobRequest" } } ], "responses": { - "204": { - "description": "There is no content to send for this request, but the headers may be useful. " + "200": { + "description": "The request has succeeded." }, "default": { "description": "An unexpected error response.", @@ -1169,8 +1170,8 @@ } ], "responses": { - "204": { - "description": "There is no content to send for this request, but the headers may be useful. " + "200": { + "description": "The request has succeeded." }, "default": { "description": "An unexpected error response.", @@ -1219,8 +1220,8 @@ } ], "responses": { - "204": { - "description": "There is no content to send for this request, but the headers may be useful. " + "200": { + "description": "The request has succeeded." }, "default": { "description": "An unexpected error response.", @@ -1269,8 +1270,11 @@ } ], "responses": { - "204": { - "description": "There is no content to send for this request, but the headers may be useful. " + "200": { + "description": "The request has succeeded." + }, + "202": { + "description": "The request has been accepted for processing, but processing has not yet completed." }, "default": { "description": "An unexpected error response.", @@ -1409,7 +1413,7 @@ "name": "maxpagesize", "in": "query", "description": "Number of objects to return per page.", - "required": true, + "required": false, "type": "integer", "format": "int32" } @@ -1683,8 +1687,9 @@ "name": "state", "in": "query", "description": "If specified, select workers by worker state.", - "required": true, + "required": false, "type": "string", + "default": "all", "enum": [ "active", "draining", @@ -1722,28 +1727,28 @@ "name": "channelId", "in": "query", "description": "If specified, select workers who have a channel configuration with this channel.", - "required": true, + "required": false, "type": "string" }, { "name": "queueId", "in": "query", "description": "If specified, select workers who are assigned to this queue.", - "required": true, + "required": false, "type": "string" }, { "name": "hasCapacity", "in": "query", "description": "If set to true, select only workers who have capacity for the channel specified\nby `channelId` or for any channel if `channelId` not specified. If set to\nfalse, then will return all workers including workers without any capacity for\njobs. Defaults to false.", - "required": true, + "required": false, "type": "boolean" }, { "name": "maxpagesize", "in": "query", "description": "Number of objects to return per page.", - "required": true, + "required": false, "type": "integer", "format": "int32" } @@ -3195,6 +3200,10 @@ ], "x-ms-discriminator-value": "reclassify" }, + "ReclassifyJobRequest": { + "type": "object", + "description": "Request payload for reclassifying jobs" + }, "RoundRobinMode": { "type": "object", "description": "Jobs are distributed in order to workers, starting with the worker that is\nafter the last worker to receive a job.", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_CreateClassificationPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_CreateClassificationPolicy.json index c0bbee9c9c42..511c344eae6b 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_CreateClassificationPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_CreateClassificationPolicy.json @@ -5,7 +5,7 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "id": "90eb00c4-234e-4df7-a231-ef7895518384", - "patch": { + "resource": { "name": "Main", "fallbackQueueId": "MainQueue", "queueSelectors": [ @@ -13,7 +13,7 @@ "kind": "conditional", "condition": { "kind": "expression-rule", - "language": "PowerFx", + "language": "powerFx", "expression": "1 = 1" }, "queueSelectors": [ @@ -42,7 +42,7 @@ "kind": "conditional", "condition": { "kind": "expression-rule", - "language": "PowerFx", + "language": "powerFx", "expression": "1 = 1" }, "queueSelectors": [ @@ -71,7 +71,7 @@ "kind": "conditional", "condition": { "kind": "expression-rule", - "language": "PowerFx", + "language": "powerFx", "expression": "1 = 1" }, "queueSelectors": [ diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_GetClassificationPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_GetClassificationPolicy.json index 09d501835619..d18827e4b5a0 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_GetClassificationPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_GetClassificationPolicy.json @@ -17,7 +17,7 @@ "kind": "conditional", "condition": { "kind": "expression-rule", - "language": "PowerFx", + "language": "powerFx", "expression": "1 = 1" }, "queueSelectors": [ diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json index 03303df5c951..20eee19ddc2a 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json @@ -17,7 +17,7 @@ "fallbackQueueId": "MainQueue", "queueSelectors": [ { - "kind": "rule", + "kind": "rule-engine", "rule": { "kind": "expression-rule", "language": "PowerFx", @@ -40,7 +40,7 @@ "fallbackQueueId": "MainQueue", "queueSelectors": [ { - "kind": "rule", + "kind": "rule-engine", "rule": { "kind": "expression-rule", "language": "PowerFx", @@ -56,8 +56,7 @@ }, "etag": "etag" } - ], - "nextLink": "null" + ] } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_UpdateClassificationPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_UpdateClassificationPolicy.json index 4bddbb10e9bb..c5c14aab65ce 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_UpdateClassificationPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_UpdateClassificationPolicy.json @@ -5,7 +5,7 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "id": "90eb00c4-234e-4df7-a231-ef7895518384", - "patch": { + "resource": { "name": "MainUpdate" } }, @@ -20,7 +20,7 @@ "kind": "conditional", "condition": { "kind": "expression-rule", - "language": "PowerFx", + "language": "powerFx", "expression": "1 = 1" }, "queueSelectors": [ @@ -49,7 +49,7 @@ "kind": "conditional", "condition": { "kind": "expression-rule", - "language": "PowerFx", + "language": "powerFx", "expression": "1 = 1" }, "queueSelectors": [ diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_CreateDistributionPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_CreateDistributionPolicy.json index 144342ededc9..b72dcc58b7c6 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_CreateDistributionPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_CreateDistributionPolicy.json @@ -5,7 +5,7 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "id": "d9033d56-659c-437a-b5b7-4f3b14301dd4", - "patch": { + "resource": { "mode": { "kind": "longest-idle", "minConcurrentOffers": 1, diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json index 6267b80e0326..6062ae2abdca 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json @@ -38,8 +38,7 @@ }, "etag": "etag" } - ], - "nextLink": "null" + ] } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_UpdateDistributionPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_UpdateDistributionPolicy.json index eda13eb06acb..06f60fa92305 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_UpdateDistributionPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_UpdateDistributionPolicy.json @@ -5,7 +5,7 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "id": "d9033d56-659c-437a-b5b7-4f3b14301dd4", - "patch": { + "resource": { "mode": { "kind": "longest-idle", "minConcurrentOffers": 1, diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_CreateExceptionPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_CreateExceptionPolicy.json index 2f199895ae66..322a430044ee 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_CreateExceptionPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_CreateExceptionPolicy.json @@ -5,7 +5,7 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "id": "cf1cda69-6f41-45ac-b252-213293f1b1cb", - "patch": { + "resource": { "name": "Main", "exceptionRules": { "MaxWaitTimeExceeded": { diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json index e873ad5978e1..a014d79c853b 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json @@ -58,8 +58,7 @@ }, "etag": "etag" } - ], - "nextLink": "null" + ] } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_UpdateExceptionPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_UpdateExceptionPolicy.json index b1f24206410e..46d0be39e4b3 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_UpdateExceptionPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_UpdateExceptionPolicy.json @@ -5,7 +5,7 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "id": "cf1cda69-6f41-45ac-b252-213293f1b1cb", - "patch": { + "resource": { "name": "Main test", "exceptionRules": { "MaxWaitTimeExceeded": { diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateJob.json index ac53895d17cc..562027f151ea 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateJob.json @@ -5,7 +5,7 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "id": "JobId", - "patch": { + "resource": { "channelId": "CustomChatChannel", "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", "queueId": "MainQueue", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateScheduledJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateScheduledJob.json index 11b37c9be798..456e5a17810c 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateScheduledJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateScheduledJob.json @@ -5,7 +5,7 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "id": "JobId", - "patch": { + "resource": { "channelId": "CustomChatChannel", "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", "queueId": "MainQueue", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJobsWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJobsWithPageSize.json index 13e3dba7d2b6..c67326408653 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJobsWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJobsWithPageSize.json @@ -59,8 +59,7 @@ }, "etag": "etag" } - ], - "nextLink": "null" + ] } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UpdateJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UpdateJob.json index b02b22dcd905..5fb75dc8ba4f 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UpdateJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UpdateJob.json @@ -5,7 +5,7 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "id": "8780b28c-7079-4de1-9143-4d369289e958", - "patch": { + "resource": { "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af" } }, From 980a1ddf02457cd68e5bcbbe93a20031256a3c8b Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 26 Sep 2023 12:00:40 -0700 Subject: [PATCH 026/113] ci fixes 3 --- .../Communication.JobRouter/models.tsp | 16 +++++++++++----- .../Communication.JobRouter/routes.tsp | 2 +- .../communicationservicejobrouter.json | 4 ++-- ...s_ListClassificationPoliciesWithPageSize.json | 4 ++-- .../2023-11-01/examples/Queues_CreateQueue.json | 2 +- .../examples/Queues_ListQueuesWithPageSize.json | 3 +-- .../2023-11-01/examples/Queues_UpdateQueue.json | 2 +- .../examples/Workers_CreateWorker.json | 2 +- .../examples/Workers_DeregisterActiveWorker.json | 2 +- .../Workers_DeregisterInactiveWorker.json | 2 +- .../Workers_GetAvailableWorkersByChannel.json | 3 +-- .../examples/Workers_GetWorkersWithPageSize.json | 3 +-- .../examples/Workers_RegisterWorker.json | 2 +- .../examples/Workers_UpdateWorker.json | 2 +- 14 files changed, 26 insertions(+), 23 deletions(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index bd7c13a1af98..187a56102800 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -9,6 +9,7 @@ using TypeSpec.Versioning; using TypeSpec.Reflection; using Azure.Core; using Azure.Core.Traits; +using Azure.Core.Foundations; @versioned(AzureCommunicationRoutingService.Versions) namespace AzureCommunicationRoutingService; @@ -1414,26 +1415,31 @@ model ReclassifyJobRequest {} @doc("Response payload from reclassifying a job") model ReclassifyJobResult {} -alias ReclassfiyJobOkReponse = TypeSpec.Http.Response<200> & ReclassifyJobResult; +alias ReclassfiyJobOkReponse = ResourceOkResponse; @doc("Response payload from closing a job") model CloseJobResult {} -alias CloseJobResultWithOkResponse = TypeSpec.Http.Response<200> & CloseJobResult; +alias CloseJobResultWithOkResponse = ResourceOkResponse; -alias CloseJobResultWithAcceptedResponse = TypeSpec.Http.Response<202> & CloseJobResult; +alias CloseJobResultWithAcceptedResponse = Azure.Core.Foundations.AcceptedResponse; alias CloseJobResultResponse = CloseJobResultWithOkResponse | CloseJobResultWithAcceptedResponse; @doc("Response payload from cancelling a job") model CancelJobResult {} -alias CancelJobResultWithOkResponse = TypeSpec.Http.Response<200> & CancelJobResult; +alias CancelJobResultWithOkResponse = ResourceOkResponse; @doc("Response payload from completing a job") model CompleteJobResult {} -alias CompleteJobResultWithOkResponse = TypeSpec.Http.Response<200> & CompleteJobResult; +alias CompleteJobResultWithOkResponse = ResourceOkResponse; + +@doc("Response payload from declining a job") +model DeclineJobOfferResult {} + +alias DeclineJobOfferResultWithOkResponse = ResourceOkResponse; @doc("JobRouter Versions") enum Versions { diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index d48e0620e733..bb7539328fa7 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -405,7 +405,7 @@ accepted the job already. @body declineJobOfferRequest: DeclineJobOfferRequest; }, - void + DeclineJobOfferResultWithOkResponse >; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index 5905ab30faa5..178fc336f1f5 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -2062,8 +2062,8 @@ } ], "responses": { - "204": { - "description": "There is no content to send for this request, but the headers may be useful. " + "200": { + "description": "The request has succeeded." }, "default": { "description": "An unexpected error response.", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json index 20eee19ddc2a..51405f4aa382 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json @@ -20,7 +20,7 @@ "kind": "rule-engine", "rule": { "kind": "expression-rule", - "language": "PowerFx", + "language": "powerFx", "expression": "If(job.Escalated = true, \"SecondaryQueue\", \"MainQueue\")" } } @@ -43,7 +43,7 @@ "kind": "rule-engine", "rule": { "kind": "expression-rule", - "language": "PowerFx", + "language": "powerFx", "expression": "If(job.VIP = true, \"VIPQueue\", \"MainQueue\")" } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_CreateQueue.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_CreateQueue.json index 27559ba5af6f..b772fd6601a6 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_CreateQueue.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_CreateQueue.json @@ -5,7 +5,7 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "id": "QueueId", - "patch": { + "resource": { "distributionPolicyId": "MainDistributionPolicy", "name": "Main", "labels": {}, diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_ListQueuesWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_ListQueuesWithPageSize.json index 9bc02b6005c2..f2cc7fd729a7 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_ListQueuesWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_ListQueuesWithPageSize.json @@ -30,8 +30,7 @@ }, "etag": "etag" } - ], - "nextLink": "null" + ] } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_UpdateQueue.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_UpdateQueue.json index 7219bb223977..4f8a4ed470c5 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_UpdateQueue.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_UpdateQueue.json @@ -5,7 +5,7 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "id": "MainQueue", - "patch": { + "resource": { "distributionPolicyId": "MainDistributionPolicy", "name": "Main" } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_CreateWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_CreateWorker.json index 514072f0e9fd..99540ae0de2b 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_CreateWorker.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_CreateWorker.json @@ -5,7 +5,7 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "workerId": "WorkerId", - "patch": { + "resource": { "totalCapacity": 10, "queueAssignments": { "MainQueue": {}, diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterActiveWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterActiveWorker.json index c01624291b5b..d6065baeac13 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterActiveWorker.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterActiveWorker.json @@ -5,7 +5,7 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "workerId": "WorkerId", - "patch": { + "resource": { "availableForOffers": false, "totalCapacity": 10 } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterInactiveWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterInactiveWorker.json index 6e309d90e600..295df3e2b4bb 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterInactiveWorker.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterInactiveWorker.json @@ -5,7 +5,7 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "workerId": "WorkerId", - "patch": { + "resource": { "availableForOffers": false, "totalCapacity": 10 } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json index 4220427f911e..b209d91a81dc 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json @@ -68,8 +68,7 @@ }, "etag": "etag" } - ], - "nextLink": "null" + ] } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json index dd2898b663d1..4fa126ec2aa3 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json @@ -66,8 +66,7 @@ }, "etag": "etag" } - ], - "nextLink": "null" + ] } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_RegisterWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_RegisterWorker.json index 2a4ee193b8d3..af1eb435d9b3 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_RegisterWorker.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_RegisterWorker.json @@ -5,7 +5,7 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "workerId": "WorkerId", - "patch": { + "resource": { "availableForOffers": true, "totalCapacity": 10 } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_UpdateWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_UpdateWorker.json index 19889a4e160f..261a33b847cc 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_UpdateWorker.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_UpdateWorker.json @@ -5,7 +5,7 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "workerId": "WorkerId", - "patch": { + "resource": { "totalCapacity": 10, "queueAssignments": { "MainQueue": {}, From 378b1ab0ca3f421f38bc641a1c7f19b89f46554b Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 26 Sep 2023 12:33:24 -0700 Subject: [PATCH 027/113] remove reference to Azure.Core.Etag (throws lint error) --- .../Communication.JobRouter/models.tsp | 20 ++++++++--------- .../communicationservicejobrouter.json | 22 +++++++++---------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 187a56102800..9089e674f0b3 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -300,7 +300,7 @@ model ClassificationPolicyItem { classificationPolicy: ClassificationPolicy; @doc("(Optional) The Concurrency Token.") - etag: eTag; + etag: string; } @resource("distributionPolicies") @@ -355,7 +355,7 @@ model DistributionPolicyItem { distributionPolicy: DistributionPolicy; @doc("(Optional) The Concurrency Token.") - etag: eTag; + etag: string; } @resource("exceptionPolicies") @@ -401,7 +401,7 @@ model ExceptionPolicyItem { exceptionPolicy: ExceptionPolicy; @doc("(Optional) The Concurrency Token.") - etag: eTag; + etag: string; } @resource("jobs") @@ -663,7 +663,7 @@ model RouterJobItem { job: RouterJob; @doc("(Optional) The Concurrency Token.") - etag: eTag; + etag: string; } @doc("Position and estimated wait time for a job.") @@ -771,7 +771,7 @@ model RouterQueueItem { queue: RouterQueue; @doc("(Optional) The Concurrency Token.") - etag: eTag; + etag: string; } @doc("Statistics for the queue") @@ -901,7 +901,7 @@ model RouterWorkerItem { worker: RouterWorker; @doc("(Optional) The Concurrency Token.") - etag: eTag; + etag: string; } @doc("Jobs are distributed to the worker with the strongest abilities available.") @@ -1410,7 +1410,7 @@ selected. } @doc("Request payload for reclassifying jobs") -model ReclassifyJobRequest {} +model ReclassifyJobRequest is Record; @doc("Response payload from reclassifying a job") model ReclassifyJobResult {} @@ -1418,7 +1418,7 @@ model ReclassifyJobResult {} alias ReclassfiyJobOkReponse = ResourceOkResponse; @doc("Response payload from closing a job") -model CloseJobResult {} +model CloseJobResult {}; alias CloseJobResultWithOkResponse = ResourceOkResponse; @@ -1432,12 +1432,12 @@ model CancelJobResult {} alias CancelJobResultWithOkResponse = ResourceOkResponse; @doc("Response payload from completing a job") -model CompleteJobResult {} +model CompleteJobResult {}; alias CompleteJobResultWithOkResponse = ResourceOkResponse; @doc("Response payload from declining a job") -model DeclineJobOfferResult {} +model DeclineJobOfferResult {}; alias DeclineJobOfferResultWithOkResponse = ResourceOkResponse; diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index 178fc336f1f5..fa5456bd63b7 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -2171,11 +2171,6 @@ } } }, - "Azure.Core.eTag": { - "type": "string", - "format": "eTag", - "description": "The ETag (or entity tag) HTTP response header is an identifier for a specific version of a resource.\nIt lets caches be more efficient and save bandwidth, as a web server does not need to resend a full response if the content was not changed.\n\nIt is a string of ASCII characters placed between double quotes, like \"675af34563dc-tr34\"." - }, "BestWorkerMode": { "type": "object", "description": "Jobs are distributed to the worker with the strongest abilities available.", @@ -2350,7 +2345,7 @@ "description": "A container for the rules that govern how jobs are classified." }, "etag": { - "$ref": "#/definitions/Azure.Core.eTag", + "type": "string", "description": "(Optional) The Concurrency Token." } }, @@ -2562,7 +2557,7 @@ "description": "Policy governing how jobs are distributed to workers" }, "etag": { - "$ref": "#/definitions/Azure.Core.eTag", + "type": "string", "description": "(Optional) The Concurrency Token." } }, @@ -2636,7 +2631,7 @@ "description": "A policy that defines actions to execute when exception are triggered." }, "etag": { - "$ref": "#/definitions/Azure.Core.eTag", + "type": "string", "description": "(Optional) The Concurrency Token." } }, @@ -3202,7 +3197,10 @@ }, "ReclassifyJobRequest": { "type": "object", - "description": "Request payload for reclassifying jobs" + "description": "Request payload for reclassifying jobs", + "additionalProperties": { + "type": "string" + } }, "RoundRobinMode": { "type": "object", @@ -3418,7 +3416,7 @@ "description": "A unit of work to be routed" }, "etag": { - "$ref": "#/definitions/Azure.Core.eTag", + "type": "string", "description": "(Optional) The Concurrency Token." } }, @@ -3648,7 +3646,7 @@ "description": "A queue that can contain jobs to be routed." }, "etag": { - "$ref": "#/definitions/Azure.Core.eTag", + "type": "string", "description": "(Optional) The Concurrency Token." } }, @@ -3878,7 +3876,7 @@ "description": "An entity for jobs to be routed to" }, "etag": { - "$ref": "#/definitions/Azure.Core.eTag", + "type": "string", "description": "(Optional) The Concurrency Token." } }, From 9c6e52e5e8204296333ad9b41a4b47a8b11ea1fa Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 26 Sep 2023 15:15:04 -0700 Subject: [PATCH 028/113] review feedback --- .../communication/Communication.JobRouter/routes.tsp | 8 ++++---- .../stable/2023-11-01/communicationservicejobrouter.json | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index bb7539328fa7..a746a6426045 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -209,7 +209,7 @@ interface JobRouterOperations { @doc("Request object for reclassifying a job.") @body - reclassifyJobRequest: ReclassifyJobRequest; + reclassifyJobRequest?: ReclassifyJobRequest; }, ReclassfiyJobOkReponse >; @@ -234,7 +234,7 @@ cancellation reason. @doc("Request model for cancelling job.") @body - cancelJobRequest: CancelJobRequest; + cancelJobRequest?: CancelJobRequest; }, CancelJobResultWithOkResponse >; @@ -355,7 +355,7 @@ If specified, filter on jobs that was scheduled at or after given value. Range: @doc("Request body for unassign route.") @body - unassignJobRequest: UnassignJobRequest; + unassignJobRequest?: UnassignJobRequest; }, UnassignJobResult >; @@ -403,7 +403,7 @@ accepted the job already. @doc("Request model for declining offer.") @body - declineJobOfferRequest: DeclineJobOfferRequest; + declineJobOfferRequest?: DeclineJobOfferRequest; }, DeclineJobOfferResultWithOkResponse >; diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index fa5456bd63b7..a5ac24a39d8f 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -1113,7 +1113,7 @@ "name": "reclassifyJobRequest", "in": "body", "description": "Request object for reclassifying a job.", - "required": true, + "required": false, "schema": { "$ref": "#/definitions/ReclassifyJobRequest" } @@ -1163,7 +1163,7 @@ "name": "cancelJobRequest", "in": "body", "description": "Request model for cancelling job.", - "required": true, + "required": false, "schema": { "$ref": "#/definitions/CancelJobRequest" } @@ -1323,7 +1323,7 @@ "name": "unassignJobRequest", "in": "body", "description": "Request body for unassign route.", - "required": true, + "required": false, "schema": { "$ref": "#/definitions/UnassignJobRequest" } @@ -2055,7 +2055,7 @@ "name": "declineJobOfferRequest", "in": "body", "description": "Request model for declining offer.", - "required": true, + "required": false, "schema": { "$ref": "#/definitions/DeclineJobOfferRequest" } From 45b578e799322c8129f8658ee886d9f677058599 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 26 Sep 2023 16:19:06 -0700 Subject: [PATCH 029/113] added list query params --- .../Communication.JobRouter/models.tsp | 81 ++++ .../Communication.JobRouter/routes.tsp | 87 +--- .../communicationservicejobrouter.json | 416 ++++++++++-------- 3 files changed, 315 insertions(+), 269 deletions(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 9089e674f0b3..fa5847221b63 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -1441,6 +1441,87 @@ model DeclineJobOfferResult {}; alias DeclineJobOfferResultWithOkResponse = ResourceOkResponse; +alias CommonListParams = { + @doc("Number of objects to return per page.") + @query + maxpagesize?: int32; +}; + +model ListJobQueryParams { + ...CommonListParams; + + @doc("If specified, filter jobs by status.") + @query + status?: RouterJobStatusSelector = RouterJobStatusSelector.all; + + @doc("If specified, filter jobs by queue.") + @query + queueId?: string; + + @doc("If specified, filter jobs by channel.") + @query + channelId?: string; + + @doc("If specified, filter jobs by classificationPolicy.") + @query + classificationPolicyId?: string; + + @doc(""" +If specified, filter on jobs that was scheduled before or at given timestamp. +Range: (-Inf, scheduledBefore]. +""") + @query + scheduledBefore?: utcDateTime; + + @doc(""" +If specified, filter on jobs that was scheduled at or after given value. Range: +[scheduledAfter, +Inf). +""") + @query + scheduledAfter?: utcDateTime; +} + +model ListClassificationPoliciesQueryParams { + ...CommonListParams; +} + +model ListDistributionPoliciesQueryParams { + ...CommonListParams; +} + +model ListExceptionPoliciesQueryParams { + ...CommonListParams; +} + +model ListQueuesQueryParams { + ...CommonListParams; +} + +model ListWorkerQueryParams { + ...CommonListParams; + + @doc("If specified, select workers by worker state.") + @query + state?: RouterWorkerStateSelector = RouterWorkerStateSelector.all; + + @doc("If specified, select workers who have a channel configuration with this channel.") + @query + channelId?: string; + + @doc("If specified, select workers who are assigned to this queue.") + @query + queueId?: string; + + @doc(""" +If set to true, select only workers who have capacity for the channel specified +by `channelId` or for any channel if `channelId` not specified. If set to +false, then will return all workers including workers without any capacity for +jobs. Defaults to false. +""") + @query + hasCapacity?: boolean; +} + @doc("JobRouter Versions") enum Versions { @doc("JobRouter 2023-11-01 api version") diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index a746a6426045..05a0fb1a7068 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -50,11 +50,7 @@ interface JobRouterAdministrationOperations { @route("/routing/classificationPolicies") @get listClassificationPolicies is Azure.Core.Foundations.Operation< - { - @doc("Maximum page size.") - @query - maxpagesize?: int32; - }, + ListClassificationPoliciesQueryParams, ClassificationPolicyCollection >; @@ -87,11 +83,7 @@ interface JobRouterAdministrationOperations { @route("/routing/distributionPolicies") @get listDistributionPolicies is Azure.Core.Foundations.Operation< - { - @doc("Maximum page size.") - @query - maxpagesize?: int32; - }, + ListDistributionPoliciesQueryParams, DistributionPolicyCollection >; @@ -124,11 +116,7 @@ interface JobRouterAdministrationOperations { @route("/routing/exceptionPolicies") @get listExceptionPolicies is Azure.Core.Foundations.Operation< - { - @doc("Number of objects to return per page.") - @query - maxpagesize?: int32; - }, + ListExceptionPoliciesQueryParams, ExceptionPolicyCollection >; @@ -161,11 +149,7 @@ interface JobRouterAdministrationOperations { @route("/routing/queues") @get listQueues is Azure.Core.Foundations.Operation< - { - @doc("Number of objects to return per page.") - @query - maxpagesize?: int32; - }, + ListQueuesQueryParams, RouterQueueCollection >; } @@ -284,41 +268,7 @@ cancellation reason. @route("/routing/jobs") @get listJobs is Azure.Core.Foundations.Operation< - { - @doc("If specified, filter jobs by status.") - @query - status?: RouterJobStatusSelector = RouterJobStatusSelector.all; - - @doc("If specified, filter jobs by queue.") - @query - queueId?: string; - - @doc("If specified, filter jobs by channel.") - @query - channelId?: string; - - @doc("If specified, filter jobs by classificationPolicy.") - @query - classificationPolicyId?: string; - - @doc(""" -If specified, filter on jobs that was scheduled before or at given timestamp. -Range: (-Inf, scheduledBefore]. -""") - @query - scheduledBefore?: utcDateTime; - - @doc(""" -If specified, filter on jobs that was scheduled at or after given value. Range: -[scheduledAfter, +Inf). -""") - @query - scheduledAfter?: utcDateTime; - - @doc("Number of objects to return per page.") - @query - maxpagesize?: int32; - }, + ListJobQueryParams, RouterJobCollection >; @@ -456,32 +406,7 @@ accepted the job already. @route("/routing/workers") @get listWorkers is Azure.Core.Foundations.Operation< - { - @doc("If specified, select workers by worker state.") - @query - state?: RouterWorkerStateSelector = RouterWorkerStateSelector.all; - - @doc("If specified, select workers who have a channel configuration with this channel.") - @query - channelId?: string; - - @doc("If specified, select workers who are assigned to this queue.") - @query - queueId?: string; - - @doc(""" -If set to true, select only workers who have capacity for the channel specified -by `channelId` or for any channel if `channelId` not specified. If set to -false, then will return all workers including workers without any capacity for -jobs. Defaults to false. -""") - @query - hasCapacity?: boolean; - - @doc("Number of objects to return per page.") - @query - maxpagesize?: int32; - }, + ListWorkerQueryParams, RouterWorkerCollection >; } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index a5ac24a39d8f..3a1ebaaa8377 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -45,7 +45,7 @@ { "name": "maxpagesize", "in": "query", - "description": "Maximum page size.", + "description": "Number of objects to return per page.", "required": false, "type": "integer", "format": "int32" @@ -275,7 +275,7 @@ { "name": "maxpagesize", "in": "query", - "description": "Maximum page size.", + "description": "Number of objects to return per page.", "required": false, "type": "integer", "format": "int32" @@ -733,149 +733,30 @@ "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "status", + "name": "maxpagesize", "in": "query", - "description": "If specified, filter jobs by status.", + "description": "Number of objects to return per page.", "required": false, - "type": "string", - "default": "all", - "enum": [ - "all", - "pendingClassification", - "queued", - "assigned", - "completed", - "closed", - "cancelled", - "classificationFailed", - "created", - "pendingSchedule", - "scheduled", - "scheduleFailed", - "waitingForActivation", - "active" - ], - "x-ms-enum": { - "name": "RouterJobStatusSelector", - "modelAsString": true, - "values": [ - { - "name": "all", - "value": "all", - "description": "Default" - }, - { - "name": "pendingClassification", - "value": "pendingClassification", - "description": "Job is waiting to be classified." - }, - { - "name": "queued", - "value": "queued", - "description": "Job has been queued." - }, - { - "name": "assigned", - "value": "assigned", - "description": "Job has been assigned to a worker." - }, - { - "name": "completed", - "value": "completed", - "description": "Job has been completed by a worker." - }, - { - "name": "closed", - "value": "closed", - "description": "Job has been closed by a worker." - }, - { - "name": "cancelled", - "value": "cancelled", - "description": "Job has been cancelled." - }, - { - "name": "classificationFailed", - "value": "classificationFailed", - "description": "Classification process failed for the job." - }, - { - "name": "created", - "value": "created", - "description": "Job has been created." - }, - { - "name": "pendingSchedule", - "value": "pendingSchedule", - "description": "Job has been created but not been scheduled yet." - }, - { - "name": "scheduled", - "value": "scheduled", - "description": "Job has been scheduled successfully." - }, - { - "name": "scheduleFailed", - "value": "scheduleFailed", - "description": "Job scheduling failed." - }, - { - "name": "waitingForActivation", - "value": "waitingForActivation", - "description": "Job is in a suspended state and waiting for an update." - }, - { - "name": "active", - "value": "active", - "description": "Job is in a state of PendingClassification or Queued or Assigned or ClassificationFailed or Completed or PendingSchedule or Scheduled or ScheduleFailed or WaitingForActivation." - } - ] - } + "type": "integer", + "format": "int32" }, { - "name": "queueId", - "in": "query", - "description": "If specified, filter jobs by queue.", - "required": false, - "type": "string" + "$ref": "#/parameters/ListJobQueryParams.status" }, { - "name": "channelId", - "in": "query", - "description": "If specified, filter jobs by channel.", - "required": false, - "type": "string" + "$ref": "#/parameters/ListJobQueryParams.queueId" }, { - "name": "classificationPolicyId", - "in": "query", - "description": "If specified, filter jobs by classificationPolicy.", - "required": false, - "type": "string" + "$ref": "#/parameters/ListJobQueryParams.channelId" }, { - "name": "scheduledBefore", - "in": "query", - "description": "If specified, filter on jobs that was scheduled before or at given timestamp.\nRange: (-Inf, scheduledBefore].", - "required": false, - "type": "string", - "format": "date-time" + "$ref": "#/parameters/ListJobQueryParams.classificationPolicyId" }, { - "name": "scheduledAfter", - "in": "query", - "description": "If specified, filter on jobs that was scheduled at or after given value. Range:\n[scheduledAfter, +Inf).", - "required": false, - "type": "string", - "format": "date-time" + "$ref": "#/parameters/ListJobQueryParams.scheduledBefore" }, { - "name": "maxpagesize", - "in": "query", - "description": "Number of objects to return per page.", - "required": false, - "type": "integer", - "format": "int32" + "$ref": "#/parameters/ListJobQueryParams.scheduledAfter" } ], "responses": { @@ -1684,73 +1565,24 @@ "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "state", + "name": "maxpagesize", "in": "query", - "description": "If specified, select workers by worker state.", + "description": "Number of objects to return per page.", "required": false, - "type": "string", - "default": "all", - "enum": [ - "active", - "draining", - "inactive", - "all" - ], - "x-ms-enum": { - "name": "RouterWorkerStateSelector", - "modelAsString": true, - "values": [ - { - "name": "active", - "value": "active", - "description": "Worker is active and available to take offers." - }, - { - "name": "draining", - "value": "draining", - "description": "Worker is not active, if there are existing offers they are being revoked. No new offers are sent." - }, - { - "name": "inactive", - "value": "inactive", - "description": "Worker is not active. No new offers are sent." - }, - { - "name": "all", - "value": "all", - "description": "Worker is active or draining or inactive." - } - ] - } + "type": "integer", + "format": "int32" }, { - "name": "channelId", - "in": "query", - "description": "If specified, select workers who have a channel configuration with this channel.", - "required": false, - "type": "string" + "$ref": "#/parameters/ListWorkerQueryParams.state" }, { - "name": "queueId", - "in": "query", - "description": "If specified, select workers who are assigned to this queue.", - "required": false, - "type": "string" + "$ref": "#/parameters/ListWorkerQueryParams.channelId" }, { - "name": "hasCapacity", - "in": "query", - "description": "If set to true, select only workers who have capacity for the channel specified\nby `channelId` or for any channel if `channelId` not specified. If set to\nfalse, then will return all workers including workers without any capacity for\njobs. Defaults to false.", - "required": false, - "type": "boolean" + "$ref": "#/parameters/ListWorkerQueryParams.queueId" }, { - "name": "maxpagesize", - "in": "query", - "description": "Number of objects to return per page.", - "required": false, - "type": "integer", - "format": "int32" + "$ref": "#/parameters/ListWorkerQueryParams.hasCapacity" } ], "responses": { @@ -4306,6 +4138,214 @@ "x-ms-parameter-location": "method", "x-ms-client-name": "apiVersion" }, + "ListJobQueryParams.channelId": { + "name": "channelId", + "in": "query", + "description": "If specified, filter jobs by channel.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + }, + "ListJobQueryParams.classificationPolicyId": { + "name": "classificationPolicyId", + "in": "query", + "description": "If specified, filter jobs by classificationPolicy.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + }, + "ListJobQueryParams.queueId": { + "name": "queueId", + "in": "query", + "description": "If specified, filter jobs by queue.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + }, + "ListJobQueryParams.scheduledAfter": { + "name": "scheduledAfter", + "in": "query", + "description": "If specified, filter on jobs that was scheduled at or after given value. Range:\n[scheduledAfter, +Inf).", + "required": false, + "type": "string", + "format": "date-time", + "x-ms-parameter-location": "method" + }, + "ListJobQueryParams.scheduledBefore": { + "name": "scheduledBefore", + "in": "query", + "description": "If specified, filter on jobs that was scheduled before or at given timestamp.\nRange: (-Inf, scheduledBefore].", + "required": false, + "type": "string", + "format": "date-time", + "x-ms-parameter-location": "method" + }, + "ListJobQueryParams.status": { + "name": "status", + "in": "query", + "description": "If specified, filter jobs by status.", + "required": false, + "type": "string", + "default": "all", + "enum": [ + "all", + "pendingClassification", + "queued", + "assigned", + "completed", + "closed", + "cancelled", + "classificationFailed", + "created", + "pendingSchedule", + "scheduled", + "scheduleFailed", + "waitingForActivation", + "active" + ], + "x-ms-enum": { + "name": "RouterJobStatusSelector", + "modelAsString": true, + "values": [ + { + "name": "all", + "value": "all", + "description": "Default" + }, + { + "name": "pendingClassification", + "value": "pendingClassification", + "description": "Job is waiting to be classified." + }, + { + "name": "queued", + "value": "queued", + "description": "Job has been queued." + }, + { + "name": "assigned", + "value": "assigned", + "description": "Job has been assigned to a worker." + }, + { + "name": "completed", + "value": "completed", + "description": "Job has been completed by a worker." + }, + { + "name": "closed", + "value": "closed", + "description": "Job has been closed by a worker." + }, + { + "name": "cancelled", + "value": "cancelled", + "description": "Job has been cancelled." + }, + { + "name": "classificationFailed", + "value": "classificationFailed", + "description": "Classification process failed for the job." + }, + { + "name": "created", + "value": "created", + "description": "Job has been created." + }, + { + "name": "pendingSchedule", + "value": "pendingSchedule", + "description": "Job has been created but not been scheduled yet." + }, + { + "name": "scheduled", + "value": "scheduled", + "description": "Job has been scheduled successfully." + }, + { + "name": "scheduleFailed", + "value": "scheduleFailed", + "description": "Job scheduling failed." + }, + { + "name": "waitingForActivation", + "value": "waitingForActivation", + "description": "Job is in a suspended state and waiting for an update." + }, + { + "name": "active", + "value": "active", + "description": "Job is in a state of PendingClassification or Queued or Assigned or ClassificationFailed or Completed or PendingSchedule or Scheduled or ScheduleFailed or WaitingForActivation." + } + ] + }, + "x-ms-parameter-location": "method" + }, + "ListWorkerQueryParams.channelId": { + "name": "channelId", + "in": "query", + "description": "If specified, select workers who have a channel configuration with this channel.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + }, + "ListWorkerQueryParams.hasCapacity": { + "name": "hasCapacity", + "in": "query", + "description": "If set to true, select only workers who have capacity for the channel specified\nby `channelId` or for any channel if `channelId` not specified. If set to\nfalse, then will return all workers including workers without any capacity for\njobs. Defaults to false.", + "required": false, + "type": "boolean", + "x-ms-parameter-location": "method" + }, + "ListWorkerQueryParams.queueId": { + "name": "queueId", + "in": "query", + "description": "If specified, select workers who are assigned to this queue.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + }, + "ListWorkerQueryParams.state": { + "name": "state", + "in": "query", + "description": "If specified, select workers by worker state.", + "required": false, + "type": "string", + "default": "all", + "enum": [ + "active", + "draining", + "inactive", + "all" + ], + "x-ms-enum": { + "name": "RouterWorkerStateSelector", + "modelAsString": true, + "values": [ + { + "name": "active", + "value": "active", + "description": "Worker is active and available to take offers." + }, + { + "name": "draining", + "value": "draining", + "description": "Worker is not active, if there are existing offers they are being revoked. No new offers are sent." + }, + { + "name": "inactive", + "value": "inactive", + "description": "Worker is not active. No new offers are sent." + }, + { + "name": "all", + "value": "all", + "description": "Worker is active or draining or inactive." + } + ] + }, + "x-ms-parameter-location": "method" + }, "RouterConditionalRequestHeaders.ifMatch": { "name": "If-Match", "in": "header", From c2b7262db9beeb045735fd05c00924cdb13861a8 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 26 Sep 2023 17:28:29 -0700 Subject: [PATCH 030/113] try codegen without url scalar --- .../communication/Communication.JobRouter/models.tsp | 6 +++--- .../stable/2023-11-01/communicationservicejobrouter.json | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index fa5847221b63..22545931fce2 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -1108,7 +1108,7 @@ statement with calculated values. @doc("A rule providing a binding to an HTTP Triggered Azure Function.") model FunctionRouterRule extends RouterRule { @doc("URL for Azure Function") - functionUri: url; + functionUri: string; @doc("Credentials used to access Azure function rule") credential?: FunctionRouterRuleCredential; @@ -1352,7 +1352,7 @@ model WaitTimeExceptionTrigger extends ExceptionTrigger { @doc("A rule providing a binding to an external web server.") model WebhookRouterRule extends RouterRule { @doc("Uri for Authorization Server.") - authorizationServerUri?: url; + authorizationServerUri?: string; @doc(""" OAuth2.0 Credentials used to Contoso's Authorization server. @@ -1362,7 +1362,7 @@ https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/ clientCredential?: Oauth2ClientCredential; @doc("Uri for Contoso's Web Server.") - webhookUri?: url; + webhookUri?: string; @doc("The type discriminator describing a sub-type of Rule") kind: "webhook-rule"; diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index 3a1ebaaa8377..0d0d84da6b3d 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -2571,7 +2571,6 @@ "properties": { "functionUri": { "type": "string", - "format": "uri", "description": "URL for Azure Function" }, "credential": { @@ -4023,7 +4022,6 @@ "properties": { "authorizationServerUri": { "type": "string", - "format": "uri", "description": "Uri for Authorization Server." }, "clientCredential": { @@ -4032,7 +4030,6 @@ }, "webhookUri": { "type": "string", - "format": "uri", "description": "Uri for Contoso's Web Server." } }, From 801fa10f596c5f7c2b9cc03b53ec40e9512d5aea Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 26 Sep 2023 17:46:45 -0700 Subject: [PATCH 031/113] retry python emitter with url fix --- .../Communication.JobRouter/models.tsp | 25 ++++++++++++++----- .../Communication.JobRouter/routes.tsp | 12 ++++----- .../communicationservicejobrouter.json | 6 ----- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 22545931fce2..b826dade4e4e 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -292,7 +292,7 @@ model RouterRule {} @doc("A paged collection of classification policies.") model ClassificationPolicyCollection - is Azure.Core.Page; + is RouterPagedCollection; @doc("Paged instance of ClassificationPolicy") model ClassificationPolicyItem { @@ -347,7 +347,7 @@ By default, set to false. } @doc("A paged collection of distribution policies.") -model DistributionPolicyCollection is Azure.Core.Page; +model DistributionPolicyCollection is RouterPagedCollection; @doc("Paged instance of DistributionPolicy") model DistributionPolicyItem { @@ -393,7 +393,7 @@ Key is the Id of each exception action. model ExceptionTrigger {} @doc("A paged collection of exception policies.") -model ExceptionPolicyCollection is Azure.Core.Page; +model ExceptionPolicyCollection is RouterPagedCollection; @doc("Paged instance of ExceptionPolicy") model ExceptionPolicyItem { @@ -655,7 +655,7 @@ current timestamp. } @doc("A paged collection of jobs.") -model RouterJobCollection is Azure.Core.Page; +model RouterJobCollection is RouterPagedCollection; @doc("Paged instance of RouterJob") model RouterJobItem { @@ -763,7 +763,7 @@ escalation rules. } @doc("A paged collection of queues.") -model RouterQueueCollection is Azure.Core.Page; +model RouterQueueCollection is RouterPagedCollection; @doc("Paged instance of RouterQueue") model RouterQueueItem { @@ -893,7 +893,7 @@ model RouterWorkerAssignment { } @doc("A paged collection of workers.") -model RouterWorkerCollection is Azure.Core.Page; +model RouterWorkerCollection is RouterPagedCollection; @doc("Paged instance of RouterWorker") model RouterWorkerItem { @@ -1522,6 +1522,19 @@ jobs. Defaults to false. hasCapacity?: boolean; } +@pagedResult +@friendlyName("Paged{name}", TResource) +@doc("Paged collection of {name} items", TResource) +model RouterPagedCollection { + @doc("The {name} items on this page", TResource) + @items + value: TResource[]; + + @doc("The link to the next page of items") + @nextLink + nextLink?: string; +} + @doc("JobRouter Versions") enum Versions { @doc("JobRouter 2023-11-01 api version") diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index 05a0fb1a7068..56d73f6daea7 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -48,7 +48,7 @@ interface JobRouterAdministrationOperations { @doc("Retrieves existing classification policies.") @example("./examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json", "Get Classification policies with pagination (max page size)") @route("/routing/classificationPolicies") - @get + @list listClassificationPolicies is Azure.Core.Foundations.Operation< ListClassificationPoliciesQueryParams, ClassificationPolicyCollection @@ -81,7 +81,7 @@ interface JobRouterAdministrationOperations { @doc("Retrieves existing distribution policies.") @example("./examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json", "Get Distribution policies with pagination (max page size)") @route("/routing/distributionPolicies") - @get + @list listDistributionPolicies is Azure.Core.Foundations.Operation< ListDistributionPoliciesQueryParams, DistributionPolicyCollection @@ -114,7 +114,7 @@ interface JobRouterAdministrationOperations { @doc("Retrieves existing exception policies.") @example("./examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json", "Get Exception policies with pagination (max page size)") @route("/routing/exceptionPolicies") - @get + @list listExceptionPolicies is Azure.Core.Foundations.Operation< ListExceptionPoliciesQueryParams, ExceptionPolicyCollection @@ -147,7 +147,7 @@ interface JobRouterAdministrationOperations { @doc("Retrieves existing queues.") @example("./examples/Queues_ListQueuesWithPageSize.json", "Get Queues with pagination (max page size)") @route("/routing/queues") - @get + @list listQueues is Azure.Core.Foundations.Operation< ListQueuesQueryParams, RouterQueueCollection @@ -266,7 +266,7 @@ cancellation reason. @doc("Retrieves list of jobs based on filter parameters.") @example("./examples/Jobs_GetJobsWithPageSize.json", "Gets a list of jobs with pagination (max page size)") @route("/routing/jobs") - @get + @list listJobs is Azure.Core.Foundations.Operation< ListJobQueryParams, RouterJobCollection @@ -404,7 +404,7 @@ accepted the job already. @example("./examples/Workers_GetWorkersWithPageSize.json", "List workers with pagination (max page size)") @example("./examples/Workers_GetAvailableWorkersByChannel.json", "List available Workers by channel") @route("/routing/workers") - @get + @list listWorkers is Azure.Core.Foundations.Operation< ListWorkerQueryParams, RouterWorkerCollection diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index 0d0d84da6b3d..bb499a10249b 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -2773,7 +2773,6 @@ }, "nextLink": { "type": "string", - "format": "uri", "description": "The link to the next page of items" } }, @@ -2795,7 +2794,6 @@ }, "nextLink": { "type": "string", - "format": "uri", "description": "The link to the next page of items" } }, @@ -2817,7 +2815,6 @@ }, "nextLink": { "type": "string", - "format": "uri", "description": "The link to the next page of items" } }, @@ -2839,7 +2836,6 @@ }, "nextLink": { "type": "string", - "format": "uri", "description": "The link to the next page of items" } }, @@ -2861,7 +2857,6 @@ }, "nextLink": { "type": "string", - "format": "uri", "description": "The link to the next page of items" } }, @@ -2883,7 +2878,6 @@ }, "nextLink": { "type": "string", - "format": "uri", "description": "The link to the next page of items" } }, From de430d811df42594d47fdd9220fdcf02fc4eb859 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Wed, 27 Sep 2023 01:23:52 -0700 Subject: [PATCH 032/113] try specifying python output directory --- .../communication/Communication.JobRouter/tspconfig.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/specification/communication/Communication.JobRouter/tspconfig.yaml b/specification/communication/Communication.JobRouter/tspconfig.yaml index 69a364041c89..392781ce1a60 100644 --- a/specification/communication/Communication.JobRouter/tspconfig.yaml +++ b/specification/communication/Communication.JobRouter/tspconfig.yaml @@ -11,6 +11,8 @@ parameters: default: "communication" "service-dir": default: "sdk/communication" + "python-output-dir": + default: "azure/communication/jobrouter/_generated" emit: [ "@azure-tools/typespec-autorest" ] @@ -32,7 +34,7 @@ options: "@azure-tools/typespec-python": package-pprint-name: "\"Azure Communication Job Router Service\"" package-mode: "dataplane" - emitter-output-dir: "{python-sdk-folder}/sdk/{service-directory-name}/{package-name}" + emitter-output-dir: "{python-sdk-folder}/sdk/{service-directory-name}/{package-name}/{python-output-dir}" package-dir: "azure-communication-jobrouter" package-name: "{package-dir}" "@azure-tools/typespec-java": From 5eb48b43213dd1ba6a2fe37dd9b65af52869f6b2 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Wed, 27 Sep 2023 11:17:11 -0700 Subject: [PATCH 033/113] python emitter - change package-mode to azure-dataplane --- .../communication/Communication.JobRouter/tspconfig.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/communication/Communication.JobRouter/tspconfig.yaml b/specification/communication/Communication.JobRouter/tspconfig.yaml index 392781ce1a60..a2257825ca62 100644 --- a/specification/communication/Communication.JobRouter/tspconfig.yaml +++ b/specification/communication/Communication.JobRouter/tspconfig.yaml @@ -33,7 +33,7 @@ options: save-inputs: true "@azure-tools/typespec-python": package-pprint-name: "\"Azure Communication Job Router Service\"" - package-mode: "dataplane" + package-mode: "azure-dataplane" emitter-output-dir: "{python-sdk-folder}/sdk/{service-directory-name}/{package-name}/{python-output-dir}" package-dir: "azure-communication-jobrouter" package-name: "{package-dir}" From 9d957d6f539ee77b098004703694baa5affb2318 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Wed, 27 Sep 2023 15:10:34 -0700 Subject: [PATCH 034/113] remove @example decorator --- ...onPolicies_CreateClassificationPolicy.json | 12 +-- ...onPolicies_DeleteClassificationPolicy.json | 4 +- ...ationPolicies_GetClassificationPolicy.json | 4 +- ...istClassificationPoliciesWithPageSize.json | 11 ++- ...onPolicies_UpdateClassificationPolicy.json | 10 +-- ...tionPolicies_CreateDistributionPolicy.json | 6 +- ...tionPolicies_DeleteDistributionPolicy.json | 4 +- ...ibutionPolicies_GetDistributionPolicy.json | 4 +- ..._ListDistributionPoliciesWithPageSize.json | 7 +- ...tionPolicies_UpdateDistributionPolicy.json | 6 +- ...ceptionPolicies_CreateExceptionPolicy.json | 6 +- ...ceptionPolicies_DeleteExceptionPolicy.json | 4 +- .../ExceptionPolicies_GetExceptionPolicy.json | 4 +- ...ies_ListExceptionPoliciesWithPageSize.json | 7 +- ...ceptionPolicies_UpdateExceptionPolicy.json | 6 +- .../examples/2023-11-01/Jobs_CloseJob.json | 4 +- .../examples/2023-11-01/Jobs_CompleteJob.json | 4 +- .../examples/2023-11-01/Jobs_CreateJob.json | 6 +- .../2023-11-01/Jobs_CreateScheduledJob.json | 6 +- .../examples/2023-11-01/Jobs_DeleteJob.json | 4 +- .../2023-11-01/Jobs_GetInQueuePosition.json | 4 +- .../examples/2023-11-01/Jobs_GetJob.json | 4 +- .../2023-11-01/Jobs_GetJobsWithPageSize.json | 4 +- .../2023-11-01/Jobs_ReclassifyJob.json | 4 +- .../2023-11-01/Jobs_RequestJobCancel.json | 4 +- .../examples/2023-11-01/Jobs_UnassignJob.json | 4 +- .../examples/2023-11-01/Jobs_UpdateJob.json | 6 +- .../2023-11-01/Offers_AcceptJobOffer.json | 4 +- .../2023-11-01/Offers_DeclineJobOffer.json | 4 +- .../2023-11-01/Queues_CreateQueue.json | 6 +- .../2023-11-01/Queues_DeleteQueue.json | 4 +- .../examples/2023-11-01/Queues_GetQueue.json | 4 +- .../2023-11-01/Queues_GetQueueStatistics.json | 4 +- .../Queues_ListQueuesWithPageSize.json | 4 +- .../2023-11-01/Queues_UpdateQueue.json | 6 +- .../2023-11-01/Workers_CreateWorker.json | 6 +- .../2023-11-01/Workers_DeleteWorker.json | 4 +- .../Workers_DeregisterActiveWorker.json | 2 +- .../Workers_DeregisterInactiveWorker.json | 2 +- .../Workers_GetAvailableWorkersByChannel.json | 2 +- .../2023-11-01/Workers_GetWorker.json | 4 +- .../Workers_GetWorkersWithPageSize.json | 4 +- .../2023-11-01/Workers_RegisterWorker.json | 2 +- .../2023-11-01/Workers_UpdateWorker.json | 4 +- .../Communication.JobRouter/routes.tsp | 44 ---------- .../communicationservicejobrouter.json | 82 +++++++++---------- ...onPolicies_CreateClassificationPolicy.json | 4 +- ...onPolicies_DeleteClassificationPolicy.json | 4 +- ...ationPolicies_GetClassificationPolicy.json | 6 +- ...istClassificationPoliciesWithPageSize.json | 8 +- ...onPolicies_UpdateClassificationPolicy.json | 4 +- ...tionPolicies_CreateDistributionPolicy.json | 4 +- ...tionPolicies_DeleteDistributionPolicy.json | 4 +- ...ibutionPolicies_GetDistributionPolicy.json | 4 +- ..._ListDistributionPoliciesWithPageSize.json | 4 +- ...tionPolicies_UpdateDistributionPolicy.json | 4 +- ...ceptionPolicies_CreateExceptionPolicy.json | 4 +- ...ceptionPolicies_DeleteExceptionPolicy.json | 4 +- .../ExceptionPolicies_GetExceptionPolicy.json | 4 +- ...ies_ListExceptionPoliciesWithPageSize.json | 4 +- ...ceptionPolicies_UpdateExceptionPolicy.json | 4 +- .../2023-11-01/examples/Jobs_CloseJob.json | 4 +- .../2023-11-01/examples/Jobs_CompleteJob.json | 4 +- .../2023-11-01/examples/Jobs_CreateJob.json | 4 +- .../examples/Jobs_CreateScheduledJob.json | 4 +- .../2023-11-01/examples/Jobs_DeleteJob.json | 4 +- .../examples/Jobs_GetInQueuePosition.json | 4 +- .../2023-11-01/examples/Jobs_GetJob.json | 4 +- .../examples/Jobs_GetJobsWithPageSize.json | 7 +- .../examples/Jobs_ReclassifyJob.json | 4 +- .../examples/Jobs_RequestJobCancel.json | 4 +- .../2023-11-01/examples/Jobs_UnassignJob.json | 4 +- .../2023-11-01/examples/Jobs_UpdateJob.json | 4 +- .../examples/Offers_AcceptJobOffer.json | 4 +- .../examples/Offers_DeclineJobOffer.json | 4 +- .../examples/Queues_CreateQueue.json | 4 +- .../examples/Queues_DeleteQueue.json | 4 +- .../2023-11-01/examples/Queues_GetQueue.json | 4 +- .../examples/Queues_GetQueueStatistics.json | 4 +- .../Queues_ListQueuesWithPageSize.json | 7 +- .../examples/Queues_UpdateQueue.json | 4 +- .../examples/Workers_CreateWorker.json | 4 +- .../examples/Workers_DeleteWorker.json | 4 +- .../Workers_DeregisterActiveWorker.json | 4 +- .../Workers_DeregisterInactiveWorker.json | 4 +- .../Workers_GetAvailableWorkersByChannel.json | 5 +- .../examples/Workers_GetWorker.json | 4 +- .../Workers_GetWorkersWithPageSize.json | 7 +- .../examples/Workers_RegisterWorker.json | 4 +- .../examples/Workers_UpdateWorker.json | 2 +- 90 files changed, 244 insertions(+), 287 deletions(-) diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_CreateClassificationPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_CreateClassificationPolicy.json index c0bbee9c9c42..cbc04cab0fbe 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_CreateClassificationPolicy.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_CreateClassificationPolicy.json @@ -1,11 +1,11 @@ { - "title": "Creates or updates a classification policy.", - "operationId": "upsertClassificationPolicy", + "title": "Creates a Classification Policy", + "operationId": "JobRouterAdministrationOperations_UpsertClassificationPolicy", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "id": "90eb00c4-234e-4df7-a231-ef7895518384", - "patch": { + "resource": { "name": "Main", "fallbackQueueId": "MainQueue", "queueSelectors": [ @@ -13,7 +13,7 @@ "kind": "conditional", "condition": { "kind": "expression-rule", - "language": "PowerFx", + "language": "powerFx", "expression": "1 = 1" }, "queueSelectors": [ @@ -42,7 +42,7 @@ "kind": "conditional", "condition": { "kind": "expression-rule", - "language": "PowerFx", + "language": "powerFx", "expression": "1 = 1" }, "queueSelectors": [ @@ -71,7 +71,7 @@ "kind": "conditional", "condition": { "kind": "expression-rule", - "language": "PowerFx", + "language": "powerFx", "expression": "1 = 1" }, "queueSelectors": [ diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_DeleteClassificationPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_DeleteClassificationPolicy.json index 988f8952b7f3..b332dd1dfd94 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_DeleteClassificationPolicy.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_DeleteClassificationPolicy.json @@ -1,6 +1,6 @@ { - "title": "Delete a classification policy by Id.", - "operationId": "deleteClassificationPolicy", + "title": "Delete a classification policy", + "operationId": "JobRouterAdministrationOperations_DeleteClassificationPolicy", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_GetClassificationPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_GetClassificationPolicy.json index 09d501835619..623140823b66 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_GetClassificationPolicy.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_GetClassificationPolicy.json @@ -1,6 +1,6 @@ { - "title": "Retrieves an existing classification policy by Id.", - "operationId": "getClassificationPolicy", + "title": "Retrieves an existing classification policy by Id", + "operationId": "JobRouterAdministrationOperations_GetClassificationPolicy", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json index 03303df5c951..9da946e90cb5 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json @@ -1,6 +1,6 @@ { - "title": "Retrieves existing classification policies.", - "operationId": "listClassificationPolicies", + "title": "Retrieves existing classification policies", + "operationId": "JobRouterAdministrationOperations_ListClassificationPolicies", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", @@ -17,7 +17,7 @@ "fallbackQueueId": "MainQueue", "queueSelectors": [ { - "kind": "rule", + "kind": "rule-engine", "rule": { "kind": "expression-rule", "language": "PowerFx", @@ -40,7 +40,7 @@ "fallbackQueueId": "MainQueue", "queueSelectors": [ { - "kind": "rule", + "kind": "rule-engine", "rule": { "kind": "expression-rule", "language": "PowerFx", @@ -56,8 +56,7 @@ }, "etag": "etag" } - ], - "nextLink": "null" + ] } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_UpdateClassificationPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_UpdateClassificationPolicy.json index 4bddbb10e9bb..a10e1c597471 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_UpdateClassificationPolicy.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_UpdateClassificationPolicy.json @@ -1,11 +1,11 @@ { - "title": "Updates a classification policy.", - "operationId": "updateClassificationPolicy", + "title": "Updates a Classification Policy", + "operationId": "JobRouterAdministrationOperations_UpsertClassificationPolicy", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "id": "90eb00c4-234e-4df7-a231-ef7895518384", - "patch": { + "resource": { "name": "MainUpdate" } }, @@ -20,7 +20,7 @@ "kind": "conditional", "condition": { "kind": "expression-rule", - "language": "PowerFx", + "language": "powerFx", "expression": "1 = 1" }, "queueSelectors": [ @@ -49,7 +49,7 @@ "kind": "conditional", "condition": { "kind": "expression-rule", - "language": "PowerFx", + "language": "powerFx", "expression": "1 = 1" }, "queueSelectors": [ diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_CreateDistributionPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_CreateDistributionPolicy.json index 144342ededc9..251becb83c1c 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_CreateDistributionPolicy.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_CreateDistributionPolicy.json @@ -1,11 +1,11 @@ { - "title": "Creates or updates a distribution policy.", - "operationId": "upsertDistributionPolicy", + "title": "Creates a Distribution policy", + "operationId": "JobRouterAdministrationOperations_UpsertDistributionPolicy", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "id": "d9033d56-659c-437a-b5b7-4f3b14301dd4", - "patch": { + "resource": { "mode": { "kind": "longest-idle", "minConcurrentOffers": 1, diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_DeleteDistributionPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_DeleteDistributionPolicy.json index ea005b13ce32..ed4fd7a76ca7 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_DeleteDistributionPolicy.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_DeleteDistributionPolicy.json @@ -1,6 +1,6 @@ { - "title": "Delete a distribution policy by Id.", - "operationId": "deleteDistributionPolicy", + "title": "Delete a distribution policy", + "operationId": "JobRouterAdministrationOperations_DeleteDistributionPolicy", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_GetDistributionPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_GetDistributionPolicy.json index bcbe4db5d048..9a9dd0aedd8a 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_GetDistributionPolicy.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_GetDistributionPolicy.json @@ -1,6 +1,6 @@ { - "title": "Retrieves an existing distribution policy by Id.", - "operationId": "getDistributionPolicy", + "title": "Retrieves an existing distribution policy by Id", + "operationId": "JobRouterAdministrationOperations_GetDistributionPolicy", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_ListDistributionPoliciesWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_ListDistributionPoliciesWithPageSize.json index 6267b80e0326..750faba99a1d 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_ListDistributionPoliciesWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_ListDistributionPoliciesWithPageSize.json @@ -1,6 +1,6 @@ { - "title": "Retrieves existing distribution policies.", - "operationId": "listDistributionPolicies", + "title": "Retrieves existing distribution policies", + "operationId": "JobRouterAdministrationOperations_ListDistributionPolicies", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", @@ -38,8 +38,7 @@ }, "etag": "etag" } - ], - "nextLink": "null" + ] } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_UpdateDistributionPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_UpdateDistributionPolicy.json index eda13eb06acb..8cd91486e71a 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_UpdateDistributionPolicy.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_UpdateDistributionPolicy.json @@ -1,11 +1,11 @@ { - "title": "Updates a distribution policy.", - "operationId": "updateDistributionPolicy", + "title": "Updates a distribution policy", + "operationId": "JobRouterAdministrationOperations_UpsertDistributionPolicy", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "id": "d9033d56-659c-437a-b5b7-4f3b14301dd4", - "patch": { + "resource": { "mode": { "kind": "longest-idle", "minConcurrentOffers": 1, diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_CreateExceptionPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_CreateExceptionPolicy.json index 2f199895ae66..0c7a01b854ad 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_CreateExceptionPolicy.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_CreateExceptionPolicy.json @@ -1,11 +1,11 @@ { - "title": "Creates or updates a exception policy.", - "operationId": "upsertExceptionPolicy", + "title": "Creates an exception policy", + "operationId": "JobRouterAdministrationOperations_UpsertExceptionPolicy", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "id": "cf1cda69-6f41-45ac-b252-213293f1b1cb", - "patch": { + "resource": { "name": "Main", "exceptionRules": { "MaxWaitTimeExceeded": { diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_DeleteExceptionPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_DeleteExceptionPolicy.json index 3bfe46420477..83a2f3ceadbe 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_DeleteExceptionPolicy.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_DeleteExceptionPolicy.json @@ -1,6 +1,6 @@ { - "title": "Deletes a exception policy by Id.", - "operationId": "deleteExceptionPolicy", + "title": "Deletes a exception policy", + "operationId": "JobRouterAdministrationOperations_DeleteExceptionPolicy", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_GetExceptionPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_GetExceptionPolicy.json index db8355c39a18..97031421924b 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_GetExceptionPolicy.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_GetExceptionPolicy.json @@ -1,6 +1,6 @@ { - "title": "Retrieves an existing exception policy by Id.", - "operationId": "getExceptionPolicy", + "title": "Retrieves an existing exception policy by Id", + "operationId": "JobRouterAdministrationOperations_GetExceptionPolicy", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json index e873ad5978e1..a549f8154445 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json @@ -1,6 +1,6 @@ { - "title": "Retrieves existing exception policies.", - "operationId": "listExceptionPolicies", + "title": "Retrieves existing exception policies", + "operationId": "JobRouterAdministrationOperations_ListExceptionPolicies", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", @@ -58,8 +58,7 @@ }, "etag": "etag" } - ], - "nextLink": "null" + ] } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_UpdateExceptionPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_UpdateExceptionPolicy.json index b1f24206410e..fc874e46783f 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_UpdateExceptionPolicy.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_UpdateExceptionPolicy.json @@ -1,11 +1,11 @@ { - "title": "Updates a exception policy.", - "operationId": "updateExceptionPolicy", + "title": "Updates an exception policy", + "operationId": "JobRouterAdministrationOperations_UpsertExceptionPolicy", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "id": "cf1cda69-6f41-45ac-b252-213293f1b1cb", - "patch": { + "resource": { "name": "Main test", "exceptionRules": { "MaxWaitTimeExceeded": { diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CloseJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CloseJob.json index 273f1bda9c74..f54efb2382db 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CloseJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CloseJob.json @@ -1,6 +1,6 @@ { - "title": "Closes a completed job.", - "operationId": "closeJobAction", + "title": "Closes a completed job", + "operationId": "JobRouterOperations_CloseJobAction", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CompleteJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CompleteJob.json index 42f7b1900a83..a07b88617993 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CompleteJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CompleteJob.json @@ -1,6 +1,6 @@ { - "title": "Completes an assigned job.", - "operationId": "completeJobAction", + "title": "Completes an assigned job", + "operationId": "JobRouterOperations_CompleteJobAction", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateJob.json index ac53895d17cc..000f33eda73c 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateJob.json @@ -1,11 +1,11 @@ { - "title": "Creates or updates a router job.", - "operationId": "upsertJob", + "title": "Creates a new job", + "operationId": "JobRouterOperations_UpsertJob", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "id": "JobId", - "patch": { + "resource": { "channelId": "CustomChatChannel", "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", "queueId": "MainQueue", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateScheduledJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateScheduledJob.json index 11b37c9be798..95212a18d5a9 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateScheduledJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateScheduledJob.json @@ -1,11 +1,11 @@ { - "title": "Creates or updates a scheduled router job.", - "operationId": "upsertScheduledJob", + "title": "Creates a new scheduled router job", + "operationId": "JobRouterOperations_UpsertJob", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "id": "JobId", - "patch": { + "resource": { "channelId": "CustomChatChannel", "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", "queueId": "MainQueue", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_DeleteJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_DeleteJob.json index 10823014e574..0a51428e1b83 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_DeleteJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_DeleteJob.json @@ -1,6 +1,6 @@ { - "title": "Deletes a job and all of its traces.", - "operationId": "deleteJob", + "title": "Deletes a job and all of its traces", + "operationId": "JobRouterOperations_DeleteJob", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetInQueuePosition.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetInQueuePosition.json index 7eea6f88f65c..8756de32109b 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetInQueuePosition.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetInQueuePosition.json @@ -1,6 +1,6 @@ { - "title": "Gets a job's position details.", - "operationId": "getInQueuePosition", + "title": "Gets a job's position details", + "operationId": "JobRouterOperations_GetInQueuePosition", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJob.json index 7a1710fff3c0..ddc0328f620d 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJob.json @@ -1,6 +1,6 @@ { - "title": "Retrieves an existing job by Id.", - "operationId": "getJob", + "title": "Retrieves an existing job by Id", + "operationId": "JobRouterOperations_GetJob", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJobsWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJobsWithPageSize.json index 13e3dba7d2b6..0a99fa84001a 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJobsWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJobsWithPageSize.json @@ -1,6 +1,6 @@ { - "title": "Retrieves list of active jobs with page size", - "operationId": "listJobs", + "title": "Retrieves list of active jobs", + "operationId": "JobRouterOperations_ListJobs", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_ReclassifyJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_ReclassifyJob.json index 7768c840a2e3..6bb9cdc04a5a 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_ReclassifyJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_ReclassifyJob.json @@ -1,6 +1,6 @@ { - "title": "Reclassify a job.", - "operationId": "reclassifyJobAction", + "title": "Reclassify a job", + "operationId": "JobRouterOperations_ReclassifyJobAction", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_RequestJobCancel.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_RequestJobCancel.json index 5de5bea923dc..d0ddfd51c0dd 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_RequestJobCancel.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_RequestJobCancel.json @@ -1,6 +1,6 @@ { - "title": "Submits request to cancel an existing job by Id.", - "operationId": "cancelJobAction", + "title": "Submits request to cancel an existing job", + "operationId": "JobRouterOperations_CancelJobAction", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UnassignJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UnassignJob.json index 5e67be00a5df..a3a4e4904d78 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UnassignJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UnassignJob.json @@ -1,6 +1,6 @@ { - "title": "Un-assign a job.", - "operationId": "unassignJobAction", + "title": "Un-assign a job", + "operationId": "JobRouterOperations_UnassignJobAction", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UpdateJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UpdateJob.json index b02b22dcd905..684269f7901c 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UpdateJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UpdateJob.json @@ -1,11 +1,11 @@ { - "title": "Updates a router job.", - "operationId": "upsertJob", + "title": "Updates a router job", + "operationId": "JobRouterOperations_UpsertJob", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "id": "8780b28c-7079-4de1-9143-4d369289e958", - "patch": { + "resource": { "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af" } }, diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_AcceptJobOffer.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_AcceptJobOffer.json index 042b312a9181..b1a60204783d 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_AcceptJobOffer.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_AcceptJobOffer.json @@ -1,6 +1,6 @@ { - "title": "Accepts an offer to work on a job.", - "operationId": "acceptJobAction", + "title": "Accepts an offer to work on a job", + "operationId": "JobRouterOperations_AcceptJobAction", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_DeclineJobOffer.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_DeclineJobOffer.json index b20f5ab6bfb1..78f699cf386d 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_DeclineJobOffer.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_DeclineJobOffer.json @@ -1,6 +1,6 @@ { - "title": "Declines an offer to work on a job.", - "operationId": "declineJobAction", + "title": "Declines an offer to work on a job", + "operationId": "JobRouterOperations_DeclineJobAction", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_CreateQueue.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_CreateQueue.json index 27559ba5af6f..c5330d1a1e3a 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_CreateQueue.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_CreateQueue.json @@ -1,11 +1,11 @@ { - "title": "Creates or updates a queue.", - "operationId": "upsertQueue", + "title": "Creates a queue", + "operationId": "JobRouterAdministrationOperations_UpsertQueue", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "id": "QueueId", - "patch": { + "resource": { "distributionPolicyId": "MainDistributionPolicy", "name": "Main", "labels": {}, diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_DeleteQueue.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_DeleteQueue.json index 6400dc7270a6..527bfc15af8f 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_DeleteQueue.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_DeleteQueue.json @@ -1,6 +1,6 @@ { - "title": "Deletes a queue by Id.", - "operationId": "deleteQueue", + "title": "Deletes a queue", + "operationId": "JobRouterAdministrationOperations_DeleteQueue", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_GetQueue.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_GetQueue.json index c5b5a85905e5..4ffb4670596a 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_GetQueue.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_GetQueue.json @@ -1,6 +1,6 @@ { - "title": "Retrieves an existing queue by Id.", - "operationId": "getQueue", + "title": "Retrieves an existing queue by Id", + "operationId": "JobRouterAdministrationOperations_GetQueue", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_GetQueueStatistics.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_GetQueueStatistics.json index bb47dc464d6c..1c5a914ac62f 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_GetQueueStatistics.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_GetQueueStatistics.json @@ -1,6 +1,6 @@ { - "title": "Retrieves a queue's statistics.", - "operationId": "getQueueStatistics", + "title": "Retrieves a queue's statistics", + "operationId": "JobRouterOperations_GetQueueStatistics", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_ListQueuesWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_ListQueuesWithPageSize.json index 9bc02b6005c2..c3ff96fa37cb 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_ListQueuesWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_ListQueuesWithPageSize.json @@ -1,6 +1,6 @@ { - "title": "Retrieves existing queues.", - "operationId": "listQueues", + "title": "Retrieves existing queues", + "operationId": "JobRouterAdministrationOperations_ListQueues", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_UpdateQueue.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_UpdateQueue.json index 7219bb223977..b3162f4be126 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_UpdateQueue.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_UpdateQueue.json @@ -1,11 +1,11 @@ { - "title": "Updates a queue.", - "operationId": "upsertQueue", + "title": "Updates a queue", + "operationId": "JobRouterAdministrationOperations_UpsertQueue", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "id": "MainQueue", - "patch": { + "resource": { "distributionPolicyId": "MainDistributionPolicy", "name": "Main" } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_CreateWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_CreateWorker.json index 514072f0e9fd..5309f9796ea0 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_CreateWorker.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_CreateWorker.json @@ -1,11 +1,11 @@ { - "title": "Creates or updates a worker.", - "operationId": "upsertWorker", + "title": "Creates a worker", + "operationId": "JobRouterOperations_UpsertWorker", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "workerId": "WorkerId", - "patch": { + "resource": { "totalCapacity": 10, "queueAssignments": { "MainQueue": {}, diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeleteWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeleteWorker.json index 6ac3ad6c1437..bbddb2cb7074 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeleteWorker.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeleteWorker.json @@ -1,6 +1,6 @@ { - "title": "Deletes a worker and all of its traces.", - "operationId": "deleteWorker", + "title": "Deletes a worker and all of its traces", + "operationId": "JobRouterOperations_DeleteWorker", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterActiveWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterActiveWorker.json index c01624291b5b..3fd02de5ae99 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterActiveWorker.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterActiveWorker.json @@ -1,6 +1,6 @@ { "title": "De-register an active worker", - "operationId": "deregisterActiveWorker", + "operationId": "JobRouterOperations_UpsertWorker", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterInactiveWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterInactiveWorker.json index 6e309d90e600..a961bc1b9927 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterInactiveWorker.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterInactiveWorker.json @@ -1,6 +1,6 @@ { "title": "De-register an inactive worker", - "operationId": "deregisterInactiveWorker", + "operationId": "JobRouterOperations_UpsertWorker", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json index 4220427f911e..cfd66c766787 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json @@ -1,6 +1,6 @@ { "title": "Retrieves available worker filtered by channel", - "operationId": "listActiveWorkersByChannel", + "operationId": "JobRouterOperations_ListWorkers", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorker.json index 1cb931459c89..807e63483e9d 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorker.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorker.json @@ -1,6 +1,6 @@ { - "title": "Retrieves an existing worker by Id.", - "operationId": "getWorker", + "title": "Retrieves an existing worker by Id", + "operationId": "JobRouterOperations_GetWorker", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json index dd2898b663d1..b70a11228ef0 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json @@ -1,6 +1,6 @@ { - "title": "Retrieves list of workers with page size", - "operationId": "listWorkers", + "title": "Retrieves list of workers", + "operationId": "JobRouterOperations_ListWorkers", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_RegisterWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_RegisterWorker.json index 2a4ee193b8d3..1ae781cd0c56 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_RegisterWorker.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_RegisterWorker.json @@ -1,6 +1,6 @@ { "title": "Register a worker", - "operationId": "registerWorker", + "operationId": "JobRouterOperations_UpsertWorker", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_UpdateWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_UpdateWorker.json index 19889a4e160f..1b0c1cd96c83 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_UpdateWorker.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_UpdateWorker.json @@ -1,11 +1,11 @@ { "title": "Updates a worker", - "operationId": "updateWorker", + "operationId": "JobRouterOperations_UpsertWorker", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "workerId": "WorkerId", - "patch": { + "resource": { "totalCapacity": 10, "queueAssignments": { "MainQueue": {}, diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index 56d73f6daea7..95ce8d937b63 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -24,29 +24,24 @@ interface JobRouterAdministrationOperations { #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a classification policy.") @doc("Creates or updates a classification policy.") - @example("./examples/ClassificationPolicies_CreateClassificationPolicy.json", "Creates a Classification Policy") - @example("./examples/ClassificationPolicies_UpdateClassificationPolicy.json", "Updates a Classification Policy") @route("/routing") upsertClassificationPolicy is PatchOperations.ResourceCreateOrUpdate; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing classification policy by Id.") @doc("Retrieves an existing classification policy by Id.") - @example("./examples/ClassificationPolicies_GetClassificationPolicy.json", "Get a single Classification policy") @route("/routing") getClassificationPolicy is GetOperations.ResourceRead; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Delete a classification policy by Id.") @doc("Delete a classification policy by Id.") - @example("./examples/ClassificationPolicies_DeleteClassificationPolicy.json", "Delete a Classification policy") @route("/routing") deleteClassificationPolicy is Operations.ResourceDelete; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves existing classification policies.") @doc("Retrieves existing classification policies.") - @example("./examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json", "Get Classification policies with pagination (max page size)") @route("/routing/classificationPolicies") @list listClassificationPolicies is Azure.Core.Foundations.Operation< @@ -57,29 +52,24 @@ interface JobRouterAdministrationOperations { #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a distribution policy.") @doc("Creates or updates a distribution policy.") - @example("./examples/DistributionPolicies_CreateDistributionPolicy.json", "Creates a Distribution policy") - @example("./examples/DistributionPolicies_UpdateDistributionPolicy.json", "Update a Distribution policy") @route("/routing") upsertDistributionPolicy is PatchOperations.ResourceCreateOrUpdate; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing distribution policy by Id.") @doc("Retrieves an existing distribution policy by Id.") - @example("./examples/DistributionPolicies_GetDistributionPolicy.json", "Get a single Distribution policy") @route("/routing") getDistributionPolicy is GetOperations.ResourceRead; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Delete a distribution policy by Id.") @doc("Delete a distribution policy by Id.") - @example("./examples/DistributionPolicies_DeleteDistributionPolicy.json", "Delete a Distribution policy") @route("/routing") deleteDistributionPolicy is Operations.ResourceDelete; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves existing distribution policies.") @doc("Retrieves existing distribution policies.") - @example("./examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json", "Get Distribution policies with pagination (max page size)") @route("/routing/distributionPolicies") @list listDistributionPolicies is Azure.Core.Foundations.Operation< @@ -90,29 +80,24 @@ interface JobRouterAdministrationOperations { #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a exception policy.") @doc("Creates or updates a exception policy.") - @example("./examples/ExceptionPolicies_CreateExceptionPolicy.json", "Creates a Exception policy") - @example("./examples/ExceptionPolicies_UpdateExceptionPolicy.json", "Update a Exception policy") @route("/routing") upsertExceptionPolicy is PatchOperations.ResourceCreateOrUpdate; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing exception policy by Id.") @doc("Retrieves an existing exception policy by Id.") - @example("./examples/ExceptionPolicies_GetExceptionPolicy.json", "Get a single Exception policy") @route("/routing") getExceptionPolicy is GetOperations.ResourceRead; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Deletes a exception policy by Id.") @doc("Deletes a exception policy by Id.") - @example("./examples/ExceptionPolicies_DeleteExceptionPolicy.json", "Delete a Exception policy") @route("/routing") deleteExceptionPolicy is Operations.ResourceDelete; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves existing exception policies.") @doc("Retrieves existing exception policies.") - @example("./examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json", "Get Exception policies with pagination (max page size)") @route("/routing/exceptionPolicies") @list listExceptionPolicies is Azure.Core.Foundations.Operation< @@ -123,29 +108,24 @@ interface JobRouterAdministrationOperations { #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a queue.") @doc("Creates or updates a queue.") - @example("./examples/Queues_CreateQueue.json", "Create a Queue") - @example("./examples/Queues_UpdateQueue.json", "Update a Queue") @route("/routing") upsertQueue is PatchOperations.ResourceCreateOrUpdate; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing queue by Id.") @doc("Retrieves an existing queue by Id.") - @example("./examples/Queues_GetQueue.json", "Get a single Queue") @route("/routing") getQueue is GetOperations.ResourceRead; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Deletes a queue by Id.") @doc("Deletes a queue by Id.") - @example("./examples/Queues_DeleteQueue.json", "Delete a Queue") @route("/routing") deleteQueue is Operations.ResourceDelete; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves existing queues.") @doc("Retrieves existing queues.") - @example("./examples/Queues_ListQueuesWithPageSize.json", "Get Queues with pagination (max page size)") @route("/routing/queues") @list listQueues is Azure.Core.Foundations.Operation< @@ -158,23 +138,18 @@ interface JobRouterOperations { #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a router job.") @doc("Creates or updates a router job.") - @example("./examples/Jobs_CreateJob.json", "Creates a new Job") - @example("./examples/Jobs_CreateScheduledJob.json", "Creates a scheduled job") - @example("./examples/Jobs_UpdateJob.json", "Update a job") @route("/routing") upsertJob is PatchOperations.ResourceCreateOrUpdate; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing job by Id.") @doc("Retrieves an existing job by Id.") - @example("./examples/Jobs_GetJob.json", "Get a single Job") @route("/routing") getJob is GetOperations.ResourceRead; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Deletes a job and all of its traces.") @doc("Deletes a job and all of its traces.") - @example("./examples/Jobs_DeleteJob.json", "Deletes a job and all of its traces") @route("/routing") deleteJob is Operations.ResourceDelete; @@ -182,7 +157,6 @@ interface JobRouterOperations { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Reclassify a job.") @doc("Reclassify a job.") - @example("./examples/Jobs_ReclassifyJob.json", "Reclassify a job") @route("/routing/jobs/{id}:reclassify") @post reclassifyJobAction is Azure.Core.Foundations.Operation< @@ -207,7 +181,6 @@ cancellation reason. Submits request to cancel an existing job by Id while supplying free-form cancellation reason. """) - @example("./examples/Jobs_RequestJobCancel.json", "Cancels a job") @route("/routing/jobs/{id}:cancel") @post cancelJobAction is Azure.Core.Foundations.Operation< @@ -226,7 +199,6 @@ cancellation reason. #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Completes an assigned job.") @doc("Completes an assigned job.") - @example("./examples/Jobs_CompleteJob.json", "Completes a job") @route("/routing/jobs/{id}:complete") @post completeJobAction is Azure.Core.Foundations.Operation< @@ -245,7 +217,6 @@ cancellation reason. #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Closes a completed job.") @doc("Closes a completed job.") - @example("./examples/Jobs_CloseJob.json", "Closes a job") @route("/routing/jobs/{id}:close") @post closeJobAction is Azure.Core.Foundations.Operation< @@ -264,7 +235,6 @@ cancellation reason. #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves list of jobs based on filter parameters.") @doc("Retrieves list of jobs based on filter parameters.") - @example("./examples/Jobs_GetJobsWithPageSize.json", "Gets a list of jobs with pagination (max page size)") @route("/routing/jobs") @list listJobs is Azure.Core.Foundations.Operation< @@ -275,7 +245,6 @@ cancellation reason. #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Gets a job's position details.") @doc("Gets a job's position details.") - @example("./examples/Jobs_GetInQueuePosition.json", "Gets a job position in a queue") @route("/routing/jobs/{id}/position") @get getInQueuePosition is Azure.Core.Foundations.Operation< @@ -290,7 +259,6 @@ cancellation reason. #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Un-assign a job.") @doc("Un-assign a job.") - @example("./examples/Jobs_UnassignJob.json", "Unassigns a job") @route("/routing/jobs/{id}/assignments/{assignmentId}:unassign") @post unassignJobAction is Azure.Core.Foundations.Operation< @@ -319,7 +287,6 @@ accepted the job already. Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already. """) - @example("./examples/Offers_AcceptJobOffer.json", "Accept a Job Offer") @route("/routing/workers/{workerId}/offers/{offerId}:accept") @post acceptJobAction is Azure.Core.Foundations.Operation< @@ -338,7 +305,6 @@ accepted the job already. #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Declines an offer to work on a job.") @doc("Declines an offer to work on a job.") - @example("./examples/Offers_DeclineJobOffer.json", "Decline a Job Offer") @route("/routing/workers/{workerId}/offers/{offerId}:decline") @post declineJobAction is Azure.Core.Foundations.Operation< @@ -361,7 +327,6 @@ accepted the job already. #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves a queue's statistics.") @doc("Retrieves a queue's statistics.") - @example("./examples/Queues_GetQueueStatistics.json", "Get a single Queue statistics") @route("/routing/queues/{id}/statistics") @get getQueueStatistics is Azure.Core.Foundations.Operation< @@ -376,33 +341,24 @@ accepted the job already. #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a worker.") @doc("Creates or updates a worker.") - @example("./examples/Workers_CreateWorker.json", "Create a Worker") - @example("./examples/Workers_UpdateWorker.json", "Update a Worker properties") - @example("./examples/Workers_RegisterWorker.json", "Register a Worker") - @example("./examples/Workers_DeregisterActiveWorker.json", "Deregister an active Worker") - @example("./examples/Workers_DeregisterInactiveWorker.json", "Deregister a inactive Worker") @route("/routing") upsertWorker is PatchOperations.ResourceCreateOrUpdate; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing worker by Id.") @doc("Retrieves an existing worker by Id.") - @example("./examples/Workers_GetWorker.json", "Get a single Worker") @route("/routing") getWorker is GetOperations.ResourceRead; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Deletes a worker and all of its traces.") @doc("Deletes a worker and all of its traces.") - @example("./examples/Workers_DeleteWorker.json", "Delete a Worker and all of its traces") @route("/routing") deleteWorker is Operations.ResourceDelete; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves existing workers.") @doc("Retrieves existing workers.") - @example("./examples/Workers_GetWorkersWithPageSize.json", "List workers with pagination (max page size)") - @example("./examples/Workers_GetAvailableWorkersByChannel.json", "List available Workers by channel") @route("/routing/workers") @list listWorkers is Azure.Core.Foundations.Operation< diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index bb499a10249b..758b9c7d033c 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -72,7 +72,7 @@ } }, "x-ms-examples": { - "Get Classification policies with pagination (max page size)": { + "Retrieves existing classification policies": { "$ref": "./examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json" } }, @@ -129,7 +129,7 @@ } }, "x-ms-examples": { - "Get a single Classification policy": { + "Retrieves an existing classification policy by Id": { "$ref": "./examples/ClassificationPolicies_GetClassificationPolicy.json" } } @@ -257,7 +257,7 @@ } }, "x-ms-examples": { - "Delete a Classification policy": { + "Delete a classification policy": { "$ref": "./examples/ClassificationPolicies_DeleteClassificationPolicy.json" } } @@ -302,7 +302,7 @@ } }, "x-ms-examples": { - "Get Distribution policies with pagination (max page size)": { + "Retrieves existing distribution policies": { "$ref": "./examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json" } }, @@ -359,7 +359,7 @@ } }, "x-ms-examples": { - "Get a single Distribution policy": { + "Retrieves an existing distribution policy by Id": { "$ref": "./examples/DistributionPolicies_GetDistributionPolicy.json" } } @@ -448,7 +448,7 @@ "Creates a Distribution policy": { "$ref": "./examples/DistributionPolicies_CreateDistributionPolicy.json" }, - "Update a Distribution policy": { + "Updates a distribution policy": { "$ref": "./examples/DistributionPolicies_UpdateDistributionPolicy.json" } } @@ -487,7 +487,7 @@ } }, "x-ms-examples": { - "Delete a Distribution policy": { + "Delete a distribution policy": { "$ref": "./examples/DistributionPolicies_DeleteDistributionPolicy.json" } } @@ -532,7 +532,7 @@ } }, "x-ms-examples": { - "Get Exception policies with pagination (max page size)": { + "Retrieves existing exception policies": { "$ref": "./examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json" } }, @@ -589,7 +589,7 @@ } }, "x-ms-examples": { - "Get a single Exception policy": { + "Retrieves an existing exception policy by Id": { "$ref": "./examples/ExceptionPolicies_GetExceptionPolicy.json" } } @@ -675,10 +675,10 @@ } }, "x-ms-examples": { - "Creates a Exception policy": { + "Creates an exception policy": { "$ref": "./examples/ExceptionPolicies_CreateExceptionPolicy.json" }, - "Update a Exception policy": { + "Updates an exception policy": { "$ref": "./examples/ExceptionPolicies_UpdateExceptionPolicy.json" } } @@ -717,7 +717,7 @@ } }, "x-ms-examples": { - "Delete a Exception policy": { + "Deletes a exception policy": { "$ref": "./examples/ExceptionPolicies_DeleteExceptionPolicy.json" } } @@ -780,7 +780,7 @@ } }, "x-ms-examples": { - "Gets a list of jobs with pagination (max page size)": { + "Retrieves list of active jobs": { "$ref": "./examples/Jobs_GetJobsWithPageSize.json" } }, @@ -837,7 +837,7 @@ } }, "x-ms-examples": { - "Get a single Job": { + "Retrieves an existing job by Id": { "$ref": "./examples/Jobs_GetJob.json" } } @@ -923,13 +923,13 @@ } }, "x-ms-examples": { - "Creates a new Job": { + "Creates a new job": { "$ref": "./examples/Jobs_CreateJob.json" }, - "Creates a scheduled job": { + "Creates a new scheduled router job": { "$ref": "./examples/Jobs_CreateScheduledJob.json" }, - "Update a job": { + "Updates a router job": { "$ref": "./examples/Jobs_UpdateJob.json" } } @@ -1068,7 +1068,7 @@ } }, "x-ms-examples": { - "Cancels a job": { + "Submits request to cancel an existing job": { "$ref": "./examples/Jobs_RequestJobCancel.json" } } @@ -1118,7 +1118,7 @@ } }, "x-ms-examples": { - "Completes a job": { + "Completes an assigned job": { "$ref": "./examples/Jobs_CompleteJob.json" } } @@ -1171,7 +1171,7 @@ } }, "x-ms-examples": { - "Closes a job": { + "Closes a completed job": { "$ref": "./examples/Jobs_CloseJob.json" } } @@ -1231,7 +1231,7 @@ } }, "x-ms-examples": { - "Unassigns a job": { + "Un-assign a job": { "$ref": "./examples/Jobs_UnassignJob.json" } } @@ -1275,7 +1275,7 @@ } }, "x-ms-examples": { - "Gets a job position in a queue": { + "Gets a job's position details": { "$ref": "./examples/Jobs_GetInQueuePosition.json" } } @@ -1320,7 +1320,7 @@ } }, "x-ms-examples": { - "Get Queues with pagination (max page size)": { + "Retrieves existing queues": { "$ref": "./examples/Queues_ListQueuesWithPageSize.json" } }, @@ -1377,7 +1377,7 @@ } }, "x-ms-examples": { - "Get a single Queue": { + "Retrieves an existing queue by Id": { "$ref": "./examples/Queues_GetQueue.json" } } @@ -1463,10 +1463,10 @@ } }, "x-ms-examples": { - "Create a Queue": { + "Creates a queue": { "$ref": "./examples/Queues_CreateQueue.json" }, - "Update a Queue": { + "Updates a queue": { "$ref": "./examples/Queues_UpdateQueue.json" } } @@ -1505,7 +1505,7 @@ } }, "x-ms-examples": { - "Delete a Queue": { + "Deletes a queue": { "$ref": "./examples/Queues_DeleteQueue.json" } } @@ -1549,7 +1549,7 @@ } }, "x-ms-examples": { - "Get a single Queue statistics": { + "Retrieves a queue's statistics": { "$ref": "./examples/Queues_GetQueueStatistics.json" } } @@ -1606,10 +1606,10 @@ } }, "x-ms-examples": { - "List available Workers by channel": { + "Retrieves available worker filtered by channel": { "$ref": "./examples/Workers_GetAvailableWorkersByChannel.json" }, - "List workers with pagination (max page size)": { + "Retrieves list of workers": { "$ref": "./examples/Workers_GetWorkersWithPageSize.json" } }, @@ -1666,7 +1666,7 @@ } }, "x-ms-examples": { - "Get a single Worker": { + "Retrieves an existing worker by Id": { "$ref": "./examples/Workers_GetWorker.json" } } @@ -1752,19 +1752,19 @@ } }, "x-ms-examples": { - "Create a Worker": { + "Creates a worker": { "$ref": "./examples/Workers_CreateWorker.json" }, - "Deregister a inactive Worker": { - "$ref": "./examples/Workers_DeregisterInactiveWorker.json" - }, - "Deregister an active Worker": { + "De-register an active worker": { "$ref": "./examples/Workers_DeregisterActiveWorker.json" }, - "Register a Worker": { + "De-register an inactive worker": { + "$ref": "./examples/Workers_DeregisterInactiveWorker.json" + }, + "Register a worker": { "$ref": "./examples/Workers_RegisterWorker.json" }, - "Update a Worker properties": { + "Updates a worker": { "$ref": "./examples/Workers_UpdateWorker.json" } } @@ -1803,7 +1803,7 @@ } }, "x-ms-examples": { - "Delete a Worker and all of its traces": { + "Deletes a worker and all of its traces": { "$ref": "./examples/Workers_DeleteWorker.json" } } @@ -1854,7 +1854,7 @@ } }, "x-ms-examples": { - "Accept a Job Offer": { + "Accepts an offer to work on a job": { "$ref": "./examples/Offers_AcceptJobOffer.json" } } @@ -1911,7 +1911,7 @@ } }, "x-ms-examples": { - "Decline a Job Offer": { + "Declines an offer to work on a job": { "$ref": "./examples/Offers_DeclineJobOffer.json" } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_CreateClassificationPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_CreateClassificationPolicy.json index 511c344eae6b..cbc04cab0fbe 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_CreateClassificationPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_CreateClassificationPolicy.json @@ -1,6 +1,6 @@ { - "title": "Creates or updates a classification policy.", - "operationId": "upsertClassificationPolicy", + "title": "Creates a Classification Policy", + "operationId": "JobRouterAdministrationOperations_UpsertClassificationPolicy", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_DeleteClassificationPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_DeleteClassificationPolicy.json index 988f8952b7f3..b332dd1dfd94 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_DeleteClassificationPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_DeleteClassificationPolicy.json @@ -1,6 +1,6 @@ { - "title": "Delete a classification policy by Id.", - "operationId": "deleteClassificationPolicy", + "title": "Delete a classification policy", + "operationId": "JobRouterAdministrationOperations_DeleteClassificationPolicy", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_GetClassificationPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_GetClassificationPolicy.json index d18827e4b5a0..623140823b66 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_GetClassificationPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_GetClassificationPolicy.json @@ -1,6 +1,6 @@ { - "title": "Retrieves an existing classification policy by Id.", - "operationId": "getClassificationPolicy", + "title": "Retrieves an existing classification policy by Id", + "operationId": "JobRouterAdministrationOperations_GetClassificationPolicy", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", @@ -17,7 +17,7 @@ "kind": "conditional", "condition": { "kind": "expression-rule", - "language": "powerFx", + "language": "PowerFx", "expression": "1 = 1" }, "queueSelectors": [ diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json index 51405f4aa382..9da946e90cb5 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json @@ -1,6 +1,6 @@ { - "title": "Retrieves existing classification policies.", - "operationId": "listClassificationPolicies", + "title": "Retrieves existing classification policies", + "operationId": "JobRouterAdministrationOperations_ListClassificationPolicies", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", @@ -20,7 +20,7 @@ "kind": "rule-engine", "rule": { "kind": "expression-rule", - "language": "powerFx", + "language": "PowerFx", "expression": "If(job.Escalated = true, \"SecondaryQueue\", \"MainQueue\")" } } @@ -43,7 +43,7 @@ "kind": "rule-engine", "rule": { "kind": "expression-rule", - "language": "powerFx", + "language": "PowerFx", "expression": "If(job.VIP = true, \"VIPQueue\", \"MainQueue\")" } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_UpdateClassificationPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_UpdateClassificationPolicy.json index c5c14aab65ce..a10e1c597471 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_UpdateClassificationPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_UpdateClassificationPolicy.json @@ -1,6 +1,6 @@ { - "title": "Updates a classification policy.", - "operationId": "updateClassificationPolicy", + "title": "Updates a Classification Policy", + "operationId": "JobRouterAdministrationOperations_UpsertClassificationPolicy", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_CreateDistributionPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_CreateDistributionPolicy.json index b72dcc58b7c6..251becb83c1c 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_CreateDistributionPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_CreateDistributionPolicy.json @@ -1,6 +1,6 @@ { - "title": "Creates or updates a distribution policy.", - "operationId": "upsertDistributionPolicy", + "title": "Creates a Distribution policy", + "operationId": "JobRouterAdministrationOperations_UpsertDistributionPolicy", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_DeleteDistributionPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_DeleteDistributionPolicy.json index ea005b13ce32..ed4fd7a76ca7 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_DeleteDistributionPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_DeleteDistributionPolicy.json @@ -1,6 +1,6 @@ { - "title": "Delete a distribution policy by Id.", - "operationId": "deleteDistributionPolicy", + "title": "Delete a distribution policy", + "operationId": "JobRouterAdministrationOperations_DeleteDistributionPolicy", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_GetDistributionPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_GetDistributionPolicy.json index bcbe4db5d048..9a9dd0aedd8a 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_GetDistributionPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_GetDistributionPolicy.json @@ -1,6 +1,6 @@ { - "title": "Retrieves an existing distribution policy by Id.", - "operationId": "getDistributionPolicy", + "title": "Retrieves an existing distribution policy by Id", + "operationId": "JobRouterAdministrationOperations_GetDistributionPolicy", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json index 6062ae2abdca..750faba99a1d 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json @@ -1,6 +1,6 @@ { - "title": "Retrieves existing distribution policies.", - "operationId": "listDistributionPolicies", + "title": "Retrieves existing distribution policies", + "operationId": "JobRouterAdministrationOperations_ListDistributionPolicies", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_UpdateDistributionPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_UpdateDistributionPolicy.json index 06f60fa92305..8cd91486e71a 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_UpdateDistributionPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_UpdateDistributionPolicy.json @@ -1,6 +1,6 @@ { - "title": "Updates a distribution policy.", - "operationId": "updateDistributionPolicy", + "title": "Updates a distribution policy", + "operationId": "JobRouterAdministrationOperations_UpsertDistributionPolicy", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_CreateExceptionPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_CreateExceptionPolicy.json index 322a430044ee..0c7a01b854ad 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_CreateExceptionPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_CreateExceptionPolicy.json @@ -1,6 +1,6 @@ { - "title": "Creates or updates a exception policy.", - "operationId": "upsertExceptionPolicy", + "title": "Creates an exception policy", + "operationId": "JobRouterAdministrationOperations_UpsertExceptionPolicy", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_DeleteExceptionPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_DeleteExceptionPolicy.json index 3bfe46420477..83a2f3ceadbe 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_DeleteExceptionPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_DeleteExceptionPolicy.json @@ -1,6 +1,6 @@ { - "title": "Deletes a exception policy by Id.", - "operationId": "deleteExceptionPolicy", + "title": "Deletes a exception policy", + "operationId": "JobRouterAdministrationOperations_DeleteExceptionPolicy", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_GetExceptionPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_GetExceptionPolicy.json index db8355c39a18..97031421924b 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_GetExceptionPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_GetExceptionPolicy.json @@ -1,6 +1,6 @@ { - "title": "Retrieves an existing exception policy by Id.", - "operationId": "getExceptionPolicy", + "title": "Retrieves an existing exception policy by Id", + "operationId": "JobRouterAdministrationOperations_GetExceptionPolicy", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json index a014d79c853b..a549f8154445 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json @@ -1,6 +1,6 @@ { - "title": "Retrieves existing exception policies.", - "operationId": "listExceptionPolicies", + "title": "Retrieves existing exception policies", + "operationId": "JobRouterAdministrationOperations_ListExceptionPolicies", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_UpdateExceptionPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_UpdateExceptionPolicy.json index 46d0be39e4b3..fc874e46783f 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_UpdateExceptionPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_UpdateExceptionPolicy.json @@ -1,6 +1,6 @@ { - "title": "Updates a exception policy.", - "operationId": "updateExceptionPolicy", + "title": "Updates an exception policy", + "operationId": "JobRouterAdministrationOperations_UpsertExceptionPolicy", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json index 273f1bda9c74..f54efb2382db 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json @@ -1,6 +1,6 @@ { - "title": "Closes a completed job.", - "operationId": "closeJobAction", + "title": "Closes a completed job", + "operationId": "JobRouterOperations_CloseJobAction", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CompleteJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CompleteJob.json index 42f7b1900a83..a07b88617993 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CompleteJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CompleteJob.json @@ -1,6 +1,6 @@ { - "title": "Completes an assigned job.", - "operationId": "completeJobAction", + "title": "Completes an assigned job", + "operationId": "JobRouterOperations_CompleteJobAction", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateJob.json index 562027f151ea..000f33eda73c 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateJob.json @@ -1,6 +1,6 @@ { - "title": "Creates or updates a router job.", - "operationId": "upsertJob", + "title": "Creates a new job", + "operationId": "JobRouterOperations_UpsertJob", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateScheduledJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateScheduledJob.json index 456e5a17810c..95212a18d5a9 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateScheduledJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateScheduledJob.json @@ -1,6 +1,6 @@ { - "title": "Creates or updates a scheduled router job.", - "operationId": "upsertScheduledJob", + "title": "Creates a new scheduled router job", + "operationId": "JobRouterOperations_UpsertJob", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_DeleteJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_DeleteJob.json index 10823014e574..0a51428e1b83 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_DeleteJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_DeleteJob.json @@ -1,6 +1,6 @@ { - "title": "Deletes a job and all of its traces.", - "operationId": "deleteJob", + "title": "Deletes a job and all of its traces", + "operationId": "JobRouterOperations_DeleteJob", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetInQueuePosition.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetInQueuePosition.json index 7eea6f88f65c..8756de32109b 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetInQueuePosition.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetInQueuePosition.json @@ -1,6 +1,6 @@ { - "title": "Gets a job's position details.", - "operationId": "getInQueuePosition", + "title": "Gets a job's position details", + "operationId": "JobRouterOperations_GetInQueuePosition", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJob.json index 7a1710fff3c0..ddc0328f620d 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJob.json @@ -1,6 +1,6 @@ { - "title": "Retrieves an existing job by Id.", - "operationId": "getJob", + "title": "Retrieves an existing job by Id", + "operationId": "JobRouterOperations_GetJob", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJobsWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJobsWithPageSize.json index c67326408653..0a99fa84001a 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJobsWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJobsWithPageSize.json @@ -1,6 +1,6 @@ { - "title": "Retrieves list of active jobs with page size", - "operationId": "listJobs", + "title": "Retrieves list of active jobs", + "operationId": "JobRouterOperations_ListJobs", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", @@ -59,7 +59,8 @@ }, "etag": "etag" } - ] + ], + "nextLink": "null" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_ReclassifyJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_ReclassifyJob.json index 7768c840a2e3..6bb9cdc04a5a 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_ReclassifyJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_ReclassifyJob.json @@ -1,6 +1,6 @@ { - "title": "Reclassify a job.", - "operationId": "reclassifyJobAction", + "title": "Reclassify a job", + "operationId": "JobRouterOperations_ReclassifyJobAction", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_RequestJobCancel.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_RequestJobCancel.json index 5de5bea923dc..d0ddfd51c0dd 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_RequestJobCancel.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_RequestJobCancel.json @@ -1,6 +1,6 @@ { - "title": "Submits request to cancel an existing job by Id.", - "operationId": "cancelJobAction", + "title": "Submits request to cancel an existing job", + "operationId": "JobRouterOperations_CancelJobAction", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UnassignJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UnassignJob.json index 5e67be00a5df..a3a4e4904d78 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UnassignJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UnassignJob.json @@ -1,6 +1,6 @@ { - "title": "Un-assign a job.", - "operationId": "unassignJobAction", + "title": "Un-assign a job", + "operationId": "JobRouterOperations_UnassignJobAction", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UpdateJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UpdateJob.json index 5fb75dc8ba4f..684269f7901c 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UpdateJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UpdateJob.json @@ -1,6 +1,6 @@ { - "title": "Updates a router job.", - "operationId": "upsertJob", + "title": "Updates a router job", + "operationId": "JobRouterOperations_UpsertJob", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_AcceptJobOffer.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_AcceptJobOffer.json index 042b312a9181..b1a60204783d 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_AcceptJobOffer.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_AcceptJobOffer.json @@ -1,6 +1,6 @@ { - "title": "Accepts an offer to work on a job.", - "operationId": "acceptJobAction", + "title": "Accepts an offer to work on a job", + "operationId": "JobRouterOperations_AcceptJobAction", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_DeclineJobOffer.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_DeclineJobOffer.json index b20f5ab6bfb1..78f699cf386d 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_DeclineJobOffer.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_DeclineJobOffer.json @@ -1,6 +1,6 @@ { - "title": "Declines an offer to work on a job.", - "operationId": "declineJobAction", + "title": "Declines an offer to work on a job", + "operationId": "JobRouterOperations_DeclineJobAction", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_CreateQueue.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_CreateQueue.json index b772fd6601a6..c5330d1a1e3a 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_CreateQueue.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_CreateQueue.json @@ -1,6 +1,6 @@ { - "title": "Creates or updates a queue.", - "operationId": "upsertQueue", + "title": "Creates a queue", + "operationId": "JobRouterAdministrationOperations_UpsertQueue", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_DeleteQueue.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_DeleteQueue.json index 6400dc7270a6..527bfc15af8f 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_DeleteQueue.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_DeleteQueue.json @@ -1,6 +1,6 @@ { - "title": "Deletes a queue by Id.", - "operationId": "deleteQueue", + "title": "Deletes a queue", + "operationId": "JobRouterAdministrationOperations_DeleteQueue", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_GetQueue.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_GetQueue.json index c5b5a85905e5..4ffb4670596a 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_GetQueue.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_GetQueue.json @@ -1,6 +1,6 @@ { - "title": "Retrieves an existing queue by Id.", - "operationId": "getQueue", + "title": "Retrieves an existing queue by Id", + "operationId": "JobRouterAdministrationOperations_GetQueue", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_GetQueueStatistics.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_GetQueueStatistics.json index bb47dc464d6c..1c5a914ac62f 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_GetQueueStatistics.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_GetQueueStatistics.json @@ -1,6 +1,6 @@ { - "title": "Retrieves a queue's statistics.", - "operationId": "getQueueStatistics", + "title": "Retrieves a queue's statistics", + "operationId": "JobRouterOperations_GetQueueStatistics", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_ListQueuesWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_ListQueuesWithPageSize.json index f2cc7fd729a7..c3ff96fa37cb 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_ListQueuesWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_ListQueuesWithPageSize.json @@ -1,6 +1,6 @@ { - "title": "Retrieves existing queues.", - "operationId": "listQueues", + "title": "Retrieves existing queues", + "operationId": "JobRouterAdministrationOperations_ListQueues", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", @@ -30,7 +30,8 @@ }, "etag": "etag" } - ] + ], + "nextLink": "null" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_UpdateQueue.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_UpdateQueue.json index 4f8a4ed470c5..b3162f4be126 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_UpdateQueue.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_UpdateQueue.json @@ -1,6 +1,6 @@ { - "title": "Updates a queue.", - "operationId": "upsertQueue", + "title": "Updates a queue", + "operationId": "JobRouterAdministrationOperations_UpsertQueue", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_CreateWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_CreateWorker.json index 99540ae0de2b..5309f9796ea0 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_CreateWorker.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_CreateWorker.json @@ -1,6 +1,6 @@ { - "title": "Creates or updates a worker.", - "operationId": "upsertWorker", + "title": "Creates a worker", + "operationId": "JobRouterOperations_UpsertWorker", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeleteWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeleteWorker.json index 6ac3ad6c1437..bbddb2cb7074 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeleteWorker.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeleteWorker.json @@ -1,6 +1,6 @@ { - "title": "Deletes a worker and all of its traces.", - "operationId": "deleteWorker", + "title": "Deletes a worker and all of its traces", + "operationId": "JobRouterOperations_DeleteWorker", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterActiveWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterActiveWorker.json index d6065baeac13..3fd02de5ae99 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterActiveWorker.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterActiveWorker.json @@ -1,11 +1,11 @@ { "title": "De-register an active worker", - "operationId": "deregisterActiveWorker", + "operationId": "JobRouterOperations_UpsertWorker", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "workerId": "WorkerId", - "resource": { + "patch": { "availableForOffers": false, "totalCapacity": 10 } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterInactiveWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterInactiveWorker.json index 295df3e2b4bb..a961bc1b9927 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterInactiveWorker.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterInactiveWorker.json @@ -1,11 +1,11 @@ { "title": "De-register an inactive worker", - "operationId": "deregisterInactiveWorker", + "operationId": "JobRouterOperations_UpsertWorker", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "workerId": "WorkerId", - "resource": { + "patch": { "availableForOffers": false, "totalCapacity": 10 } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json index b209d91a81dc..cfd66c766787 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json @@ -1,6 +1,6 @@ { "title": "Retrieves available worker filtered by channel", - "operationId": "listActiveWorkersByChannel", + "operationId": "JobRouterOperations_ListWorkers", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", @@ -68,7 +68,8 @@ }, "etag": "etag" } - ] + ], + "nextLink": "null" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorker.json index 1cb931459c89..807e63483e9d 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorker.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorker.json @@ -1,6 +1,6 @@ { - "title": "Retrieves an existing worker by Id.", - "operationId": "getWorker", + "title": "Retrieves an existing worker by Id", + "operationId": "JobRouterOperations_GetWorker", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json index 4fa126ec2aa3..b70a11228ef0 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json @@ -1,6 +1,6 @@ { - "title": "Retrieves list of workers with page size", - "operationId": "listWorkers", + "title": "Retrieves list of workers", + "operationId": "JobRouterOperations_ListWorkers", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", @@ -66,7 +66,8 @@ }, "etag": "etag" } - ] + ], + "nextLink": "null" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_RegisterWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_RegisterWorker.json index af1eb435d9b3..1ae781cd0c56 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_RegisterWorker.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_RegisterWorker.json @@ -1,11 +1,11 @@ { "title": "Register a worker", - "operationId": "registerWorker", + "operationId": "JobRouterOperations_UpsertWorker", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "workerId": "WorkerId", - "resource": { + "patch": { "availableForOffers": true, "totalCapacity": 10 } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_UpdateWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_UpdateWorker.json index 261a33b847cc..1b0c1cd96c83 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_UpdateWorker.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_UpdateWorker.json @@ -1,6 +1,6 @@ { "title": "Updates a worker", - "operationId": "updateWorker", + "operationId": "JobRouterOperations_UpsertWorker", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", From 79bdc825b76571e545782d501624b8254dc426e9 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Wed, 27 Sep 2023 15:13:37 -0700 Subject: [PATCH 035/113] remove redundant imports --- specification/communication/Communication.JobRouter/routes.tsp | 2 -- 1 file changed, 2 deletions(-) diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index 95ce8d937b63..95b545c9fdaa 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -1,5 +1,4 @@ import "@azure-tools/typespec-azure-core"; -import "@azure-tools/typespec-autorest"; import "@typespec/http"; import "@typespec/rest"; import "./models.tsp"; @@ -7,7 +6,6 @@ import "./models.tsp"; using TypeSpec.Rest; using TypeSpec.Http; using Azure.Core.Traits; -using Autorest; namespace AzureCommunicationRoutingService; From 5848746fb072b52ed898829f5b79c443d7b862ed Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Wed, 27 Sep 2023 15:25:29 -0700 Subject: [PATCH 036/113] fix examples --- .../ClassificationPolicies_GetClassificationPolicy.json | 2 +- ...cationPolicies_ListClassificationPoliciesWithPageSize.json | 4 ++-- .../examples/2023-11-01/Workers_DeregisterActiveWorker.json | 2 +- .../examples/2023-11-01/Workers_DeregisterInactiveWorker.json | 2 +- .../examples/2023-11-01/Workers_RegisterWorker.json | 2 +- .../ClassificationPolicies_GetClassificationPolicy.json | 2 +- ...cationPolicies_ListClassificationPoliciesWithPageSize.json | 4 ++-- .../2023-11-01/examples/Workers_DeregisterActiveWorker.json | 2 +- .../2023-11-01/examples/Workers_DeregisterInactiveWorker.json | 2 +- .../stable/2023-11-01/examples/Workers_RegisterWorker.json | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_GetClassificationPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_GetClassificationPolicy.json index 623140823b66..b0db0bfc86af 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_GetClassificationPolicy.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_GetClassificationPolicy.json @@ -17,7 +17,7 @@ "kind": "conditional", "condition": { "kind": "expression-rule", - "language": "PowerFx", + "language": "powerFx", "expression": "1 = 1" }, "queueSelectors": [ diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json index 9da946e90cb5..dfc005a35353 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json @@ -20,7 +20,7 @@ "kind": "rule-engine", "rule": { "kind": "expression-rule", - "language": "PowerFx", + "language": "powerFx", "expression": "If(job.Escalated = true, \"SecondaryQueue\", \"MainQueue\")" } } @@ -43,7 +43,7 @@ "kind": "rule-engine", "rule": { "kind": "expression-rule", - "language": "PowerFx", + "language": "powerFx", "expression": "If(job.VIP = true, \"VIPQueue\", \"MainQueue\")" } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterActiveWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterActiveWorker.json index 3fd02de5ae99..f5147634e20d 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterActiveWorker.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterActiveWorker.json @@ -5,7 +5,7 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "workerId": "WorkerId", - "patch": { + "resource": { "availableForOffers": false, "totalCapacity": 10 } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterInactiveWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterInactiveWorker.json index a961bc1b9927..934647c11074 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterInactiveWorker.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterInactiveWorker.json @@ -5,7 +5,7 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "workerId": "WorkerId", - "patch": { + "resource": { "availableForOffers": false, "totalCapacity": 10 } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_RegisterWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_RegisterWorker.json index 1ae781cd0c56..aec14fcfa51b 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_RegisterWorker.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_RegisterWorker.json @@ -5,7 +5,7 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "workerId": "WorkerId", - "patch": { + "resource": { "availableForOffers": true, "totalCapacity": 10 } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_GetClassificationPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_GetClassificationPolicy.json index 623140823b66..b0db0bfc86af 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_GetClassificationPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_GetClassificationPolicy.json @@ -17,7 +17,7 @@ "kind": "conditional", "condition": { "kind": "expression-rule", - "language": "PowerFx", + "language": "powerFx", "expression": "1 = 1" }, "queueSelectors": [ diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json index 9da946e90cb5..dfc005a35353 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json @@ -20,7 +20,7 @@ "kind": "rule-engine", "rule": { "kind": "expression-rule", - "language": "PowerFx", + "language": "powerFx", "expression": "If(job.Escalated = true, \"SecondaryQueue\", \"MainQueue\")" } } @@ -43,7 +43,7 @@ "kind": "rule-engine", "rule": { "kind": "expression-rule", - "language": "PowerFx", + "language": "powerFx", "expression": "If(job.VIP = true, \"VIPQueue\", \"MainQueue\")" } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterActiveWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterActiveWorker.json index 3fd02de5ae99..f5147634e20d 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterActiveWorker.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterActiveWorker.json @@ -5,7 +5,7 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "workerId": "WorkerId", - "patch": { + "resource": { "availableForOffers": false, "totalCapacity": 10 } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterInactiveWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterInactiveWorker.json index a961bc1b9927..934647c11074 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterInactiveWorker.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterInactiveWorker.json @@ -5,7 +5,7 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "workerId": "WorkerId", - "patch": { + "resource": { "availableForOffers": false, "totalCapacity": 10 } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_RegisterWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_RegisterWorker.json index 1ae781cd0c56..aec14fcfa51b 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_RegisterWorker.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_RegisterWorker.json @@ -5,7 +5,7 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "workerId": "WorkerId", - "patch": { + "resource": { "availableForOffers": true, "totalCapacity": 10 } From 2eef370574bbff92d90841d873e08e40e2b5a10a Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Wed, 27 Sep 2023 19:08:02 -0700 Subject: [PATCH 037/113] make ScheduleAndSuspendMode.ScheduleAt a required field --- .../Communication.JobRouter/models.tsp | 4 +- .../communicationservicejobrouter.json | 38 ++++++++++++++++++- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index b826dade4e4e..6862764fda3e 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -588,9 +588,9 @@ At the specified time, matching worker to a job will not start automatically. """) model ScheduleAndSuspendMode { - @doc("Scheduled time.") - scheduleAt?: utcDateTime; + @doc("Scheduled time.") + scheduleAt: utcDateTime; } @doc("Describes a matching mode where matching worker to a job is automatically started after job is queued successfully.") diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index 758b9c7d033c..18e5dfb0342d 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -2658,6 +2658,28 @@ } } }, + "JobMatchingModeCreateOrUpdate": { + "type": "object", + "description": "The matching mode to be applied to this job.\n \nSupported types:\n \n \nQueueAndMatchMode: Used when matching worker to a job is required to be\ndone right after job is queued.\nScheduleAndSuspendMode: Used for scheduling\njobs to be queued at a future time. At specified time, matching of a worker to\nthe job will not start automatically.\nSuspendMode: Used when matching workers\nto a job needs to be suspended.", + "properties": { + "modeType": { + "$ref": "#/definitions/JobMatchModeType", + "description": "Discriminator value used to differentiate between supported matching mode types." + }, + "queueAndMatchMode": { + "$ref": "#/definitions/QueueAndMatchMode", + "description": "Describes a matching mode where matching worker to a job is automatically\nstarted after job is queued successfully." + }, + "scheduleAndSuspendMode": { + "$ref": "#/definitions/ScheduleAndSuspendModeCreateOrUpdate", + "description": "Describes a matching mode used for scheduling jobs to be queued at a future\ntime.\nAt the specified time, matching worker to a job will not start\nautomatically." + }, + "suspendMode": { + "$ref": "#/definitions/SuspendMode", + "description": "Describes a matching mode where matching worker to a job is suspended." + } + } + }, "LabelOperator": { "type": "string", "description": "Describes supported operations on label values.", @@ -3227,7 +3249,7 @@ } }, "matchingMode": { - "$ref": "#/definitions/JobMatchingMode", + "$ref": "#/definitions/JobMatchingModeCreateOrUpdate", "description": "The matching mode to be applied to this job.\n \nSupported types:\n \n \nQueueAndMatchMode: Used when matching worker to a job is required to be\ndone right after job is queued.\nScheduleAndSuspendMode: Used for scheduling\njobs to be queued at a future time. At specified time, matching of a worker to\nthe job will not start automatically.\nSuspendMode: Used when matching workers\nto a job needs to be suspended." } } @@ -3844,6 +3866,20 @@ "x-ms-discriminator-value": "rule-engine" }, "ScheduleAndSuspendMode": { + "type": "object", + "description": "Describes a matching mode used for scheduling jobs to be queued at a future\ntime.\nAt the specified time, matching worker to a job will not start\nautomatically.", + "properties": { + "scheduleAt": { + "type": "string", + "format": "date-time", + "description": "Scheduled time." + } + }, + "required": [ + "scheduleAt" + ] + }, + "ScheduleAndSuspendModeCreateOrUpdate": { "type": "object", "description": "Describes a matching mode used for scheduling jobs to be queued at a future\ntime.\nAt the specified time, matching worker to a job will not start\nautomatically.", "properties": { From f30dbebed81d6b80ec2b3536586955d21c56901f Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Wed, 27 Sep 2023 19:22:53 -0700 Subject: [PATCH 038/113] uri scalar add --- .../communication/Communication.JobRouter/models.tsp | 6 +++--- .../stable/2023-11-01/communicationservicejobrouter.json | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 6862764fda3e..785959df4c25 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -1108,7 +1108,7 @@ statement with calculated values. @doc("A rule providing a binding to an HTTP Triggered Azure Function.") model FunctionRouterRule extends RouterRule { @doc("URL for Azure Function") - functionUri: string; + functionUri: url; @doc("Credentials used to access Azure function rule") credential?: FunctionRouterRuleCredential; @@ -1352,7 +1352,7 @@ model WaitTimeExceptionTrigger extends ExceptionTrigger { @doc("A rule providing a binding to an external web server.") model WebhookRouterRule extends RouterRule { @doc("Uri for Authorization Server.") - authorizationServerUri?: string; + authorizationServerUri?: url; @doc(""" OAuth2.0 Credentials used to Contoso's Authorization server. @@ -1362,7 +1362,7 @@ https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/ clientCredential?: Oauth2ClientCredential; @doc("Uri for Contoso's Web Server.") - webhookUri?: string; + webhookUri?: url; @doc("The type discriminator describing a sub-type of Rule") kind: "webhook-rule"; diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index 18e5dfb0342d..ec7e5db0bf5c 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -2571,6 +2571,7 @@ "properties": { "functionUri": { "type": "string", + "format": "uri", "description": "URL for Azure Function" }, "credential": { @@ -4052,6 +4053,7 @@ "properties": { "authorizationServerUri": { "type": "string", + "format": "uri", "description": "Uri for Authorization Server." }, "clientCredential": { @@ -4060,6 +4062,7 @@ }, "webhookUri": { "type": "string", + "format": "uri", "description": "Uri for Contoso's Web Server." } }, From 0073872a0b46c1eab54a09c38e7cba71e37c0c4c Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Thu, 28 Sep 2023 00:05:47 -0700 Subject: [PATCH 039/113] clean up --- specification/communication/Communication.JobRouter/client.tsp | 3 +-- .../communication/Communication.JobRouter/tspconfig.yaml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/specification/communication/Communication.JobRouter/client.tsp b/specification/communication/Communication.JobRouter/client.tsp index f960dee18584..cdcc440ffd86 100644 --- a/specification/communication/Communication.JobRouter/client.tsp +++ b/specification/communication/Communication.JobRouter/client.tsp @@ -1,9 +1,8 @@ // client.tsp -import "./main.tsp"; import "@azure-tools/typespec-client-generator-core"; import "@typespec/versioning"; -import "./models.tsp"; +import "./main.tsp"; using Azure.ClientGenerator.Core; using TypeSpec.Versioning; diff --git a/specification/communication/Communication.JobRouter/tspconfig.yaml b/specification/communication/Communication.JobRouter/tspconfig.yaml index a2257825ca62..b862b3ea0e50 100644 --- a/specification/communication/Communication.JobRouter/tspconfig.yaml +++ b/specification/communication/Communication.JobRouter/tspconfig.yaml @@ -34,7 +34,7 @@ options: "@azure-tools/typespec-python": package-pprint-name: "\"Azure Communication Job Router Service\"" package-mode: "azure-dataplane" - emitter-output-dir: "{python-sdk-folder}/sdk/{service-directory-name}/{package-name}/{python-output-dir}" + emitter-output-dir: "{python-sdk-folder}/sdk/{service-directory-name}/{package-name}" package-dir: "azure-communication-jobrouter" package-name: "{package-dir}" "@azure-tools/typespec-java": From 80f10c8d78c171898c74bfba7dc2ab7c5e972ddc Mon Sep 17 00:00:00 2001 From: Marc Ma Date: Tue, 3 Oct 2023 21:40:32 -0700 Subject: [PATCH 040/113] Update JS sdk config to azure-rest --- .../communication/Communication.JobRouter/tspconfig.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/communication/Communication.JobRouter/tspconfig.yaml b/specification/communication/Communication.JobRouter/tspconfig.yaml index b862b3ea0e50..a8a19935faef 100644 --- a/specification/communication/Communication.JobRouter/tspconfig.yaml +++ b/specification/communication/Communication.JobRouter/tspconfig.yaml @@ -41,10 +41,10 @@ options: emitter-output-dir: "{java-sdk-folder}/sdk/{service-directory-name}/azure-communication-jobrouter" namespace: com.azure.communication.jobrouter "@azure-tools/typespec-ts": - emitter-output-dir: "{js-sdk-folder}/sdk/{service-directory-name}/communication-job-router" + emitter-output-dir: "{js-sdk-folder}/sdk/{service-directory-name}/communication-job-router-rest" generateMetadata: true generateTest: true package-dir: "communication-job-router" packageDetails: - name: "@azure/communication-job-router" + name: "@azure-rest/communication-job-router" description: "Azure client library for Azure Communication Job Router services" \ No newline at end of file From 9f89032095d42a4dec77274787a33eaa6cf22c00 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Wed, 4 Oct 2023 11:52:18 -0700 Subject: [PATCH 041/113] change JobMatchingMode polymorphic type --- .../Communication.JobRouter/models.tsp | 52 +++----- .../communicationservicejobrouter.json | 111 +++++------------- 2 files changed, 45 insertions(+), 118 deletions(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 785959df4c25..3e79ebdfa2e3 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -135,18 +135,6 @@ enum RouterWorkerSelectorStatus { expired, } -@doc("Discriminator values for supported matching mode types.") -enum JobMatchModeType { - @doc("Discriminator used when matching worker to a job is required to be done right after job is queued.") - queueAndMatchMode, - - @doc("Discriminator used for scheduling jobs to be queued at a future time.") - scheduleAndSuspendMode, - - @doc("Discriminator used when matching workers to a job needs to be suspended.") - suspendMode, -} - @doc("Enums used to filters jobs by state") enum RouterJobStatusSelector { @doc("Default") @@ -559,27 +547,8 @@ the job will not start automatically. SuspendMode: Used when matching workers to a job needs to be suspended. """) -model JobMatchingMode { - @doc("Discriminator value used to differentiate between supported matching mode types.") - modeType?: JobMatchModeType; - - @doc(""" -Describes a matching mode where matching worker to a job is automatically -started after job is queued successfully. -""") - queueAndMatchMode?: QueueAndMatchMode; - - @doc(""" -Describes a matching mode used for scheduling jobs to be queued at a future -time. -At the specified time, matching worker to a job will not start -automatically. -""") - scheduleAndSuspendMode?: ScheduleAndSuspendMode; - - @doc("Describes a matching mode where matching worker to a job is suspended.") - suspendMode?: SuspendMode; -} +@discriminator("kind") +model JobMatchingMode { } @doc(""" Describes a matching mode used for scheduling jobs to be queued at a future @@ -587,17 +556,28 @@ time. At the specified time, matching worker to a job will not start automatically. """) -model ScheduleAndSuspendMode { +model ScheduleAndSuspendMode extends JobMatchingMode { @doc("Scheduled time.") scheduleAt: utcDateTime; + + @doc("The type discriminator describing ScheduleAndSuspendMode") + kind: "schedule-and-suspend"; } @doc("Describes a matching mode where matching worker to a job is automatically started after job is queued successfully.") -model QueueAndMatchMode {} +model QueueAndMatchMode extends JobMatchingMode { + + @doc("The type discriminator describing QueueAndMatchMode") + kind: "queue-and-match"; +} @doc("Describes a matching mode where matching worker to a job is suspended.") -model SuspendMode {} +model SuspendMode extends JobMatchingMode { + + @doc("The type discriminator describing SuspendMode") + kind: "suspend"; +} @doc("Request payload for deleting a job") model CancelJobRequest { diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index ec7e5db0bf5c..ddc905b9988d 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -2607,79 +2607,19 @@ } } }, - "JobMatchModeType": { - "type": "string", - "description": "Discriminator values for supported matching mode types.", - "enum": [ - "queueAndMatchMode", - "scheduleAndSuspendMode", - "suspendMode" - ], - "x-ms-enum": { - "name": "JobMatchModeType", - "modelAsString": true, - "values": [ - { - "name": "queueAndMatchMode", - "value": "queueAndMatchMode", - "description": "Discriminator used when matching worker to a job is required to be done right after job is queued." - }, - { - "name": "scheduleAndSuspendMode", - "value": "scheduleAndSuspendMode", - "description": "Discriminator used for scheduling jobs to be queued at a future time." - }, - { - "name": "suspendMode", - "value": "suspendMode", - "description": "Discriminator used when matching workers to a job needs to be suspended." - } - ] - } - }, "JobMatchingMode": { "type": "object", "description": "The matching mode to be applied to this job.\n \nSupported types:\n \n \nQueueAndMatchMode: Used when matching worker to a job is required to be\ndone right after job is queued.\nScheduleAndSuspendMode: Used for scheduling\njobs to be queued at a future time. At specified time, matching of a worker to\nthe job will not start automatically.\nSuspendMode: Used when matching workers\nto a job needs to be suspended.", "properties": { - "modeType": { - "$ref": "#/definitions/JobMatchModeType", - "description": "Discriminator value used to differentiate between supported matching mode types." - }, - "queueAndMatchMode": { - "$ref": "#/definitions/QueueAndMatchMode", - "description": "Describes a matching mode where matching worker to a job is automatically\nstarted after job is queued successfully." - }, - "scheduleAndSuspendMode": { - "$ref": "#/definitions/ScheduleAndSuspendMode", - "description": "Describes a matching mode used for scheduling jobs to be queued at a future\ntime.\nAt the specified time, matching worker to a job will not start\nautomatically." - }, - "suspendMode": { - "$ref": "#/definitions/SuspendMode", - "description": "Describes a matching mode where matching worker to a job is suspended." - } - } - }, - "JobMatchingModeCreateOrUpdate": { - "type": "object", - "description": "The matching mode to be applied to this job.\n \nSupported types:\n \n \nQueueAndMatchMode: Used when matching worker to a job is required to be\ndone right after job is queued.\nScheduleAndSuspendMode: Used for scheduling\njobs to be queued at a future time. At specified time, matching of a worker to\nthe job will not start automatically.\nSuspendMode: Used when matching workers\nto a job needs to be suspended.", - "properties": { - "modeType": { - "$ref": "#/definitions/JobMatchModeType", - "description": "Discriminator value used to differentiate between supported matching mode types." - }, - "queueAndMatchMode": { - "$ref": "#/definitions/QueueAndMatchMode", - "description": "Describes a matching mode where matching worker to a job is automatically\nstarted after job is queued successfully." - }, - "scheduleAndSuspendMode": { - "$ref": "#/definitions/ScheduleAndSuspendModeCreateOrUpdate", - "description": "Describes a matching mode used for scheduling jobs to be queued at a future\ntime.\nAt the specified time, matching worker to a job will not start\nautomatically." - }, - "suspendMode": { - "$ref": "#/definitions/SuspendMode", - "description": "Describes a matching mode where matching worker to a job is suspended." + "kind": { + "type": "string", + "description": "Discriminator property for JobMatchingMode." } - } + }, + "discriminator": "kind", + "required": [ + "kind" + ] }, "LabelOperator": { "type": "string", @@ -2963,7 +2903,13 @@ }, "QueueAndMatchMode": { "type": "object", - "description": "Describes a matching mode where matching worker to a job is automatically started after job is queued successfully." + "description": "Describes a matching mode where matching worker to a job is automatically started after job is queued successfully.", + "allOf": [ + { + "$ref": "#/definitions/JobMatchingMode" + } + ], + "x-ms-discriminator-value": "queue-and-match" }, "QueueLengthExceptionTrigger": { "type": "object", @@ -3250,7 +3196,7 @@ } }, "matchingMode": { - "$ref": "#/definitions/JobMatchingModeCreateOrUpdate", + "$ref": "#/definitions/JobMatchingMode", "description": "The matching mode to be applied to this job.\n \nSupported types:\n \n \nQueueAndMatchMode: Used when matching worker to a job is required to be\ndone right after job is queued.\nScheduleAndSuspendMode: Used for scheduling\njobs to be queued at a future time. At specified time, matching of a worker to\nthe job will not start automatically.\nSuspendMode: Used when matching workers\nto a job needs to be suspended." } } @@ -3878,18 +3824,13 @@ }, "required": [ "scheduleAt" - ] - }, - "ScheduleAndSuspendModeCreateOrUpdate": { - "type": "object", - "description": "Describes a matching mode used for scheduling jobs to be queued at a future\ntime.\nAt the specified time, matching worker to a job will not start\nautomatically.", - "properties": { - "scheduleAt": { - "type": "string", - "format": "date-time", - "description": "Scheduled time." + ], + "allOf": [ + { + "$ref": "#/definitions/JobMatchingMode" } - } + ], + "x-ms-discriminator-value": "schedule-and-suspend" }, "ScoringRuleOptions": { "type": "object", @@ -3996,7 +3937,13 @@ }, "SuspendMode": { "type": "object", - "description": "Describes a matching mode where matching worker to a job is suspended." + "description": "Describes a matching mode where matching worker to a job is suspended.", + "allOf": [ + { + "$ref": "#/definitions/JobMatchingMode" + } + ], + "x-ms-discriminator-value": "suspend" }, "UnassignJobRequest": { "type": "object", From 0ba3dad7135145752760c4322d18dca020821e57 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Thu, 12 Oct 2023 14:33:19 -0700 Subject: [PATCH 042/113] rename client remove Rest --- .../communication/Communication.JobRouter/client.tsp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/communication/Communication.JobRouter/client.tsp b/specification/communication/Communication.JobRouter/client.tsp index cdcc440ffd86..cad047adad50 100644 --- a/specification/communication/Communication.JobRouter/client.tsp +++ b/specification/communication/Communication.JobRouter/client.tsp @@ -12,7 +12,7 @@ namespace ClientForAcsJobRouter; // Your customizations here @client({ - name: "JobRouterAdministrationRestClient", + name: "JobRouterAdministrationClient", service: AzureCommunicationRoutingService }) interface JobRouterAdministrationRestClient { @@ -66,7 +66,7 @@ interface JobRouterAdministrationRestClient { } @client({ - name: "JobRouterRestClient", + name: "JobRouterClient", service: AzureCommunicationRoutingService }) interface JobRouterRestClient { From 1c603c19e4d4ae275b8e33543a6ba40363763ca7 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Fri, 13 Oct 2023 14:23:26 -0700 Subject: [PATCH 043/113] rename acceptJob, declineJob to acceptJobOffer, declineJobOffer --- .../communication/Communication.JobRouter/client.tsp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/communication/Communication.JobRouter/client.tsp b/specification/communication/Communication.JobRouter/client.tsp index cad047adad50..5998776b2569 100644 --- a/specification/communication/Communication.JobRouter/client.tsp +++ b/specification/communication/Communication.JobRouter/client.tsp @@ -101,10 +101,10 @@ interface JobRouterRestClient { unassignJob is AzureCommunicationRoutingService.JobRouterOperations.unassignJobAction; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - acceptJob is AzureCommunicationRoutingService.JobRouterOperations.acceptJobAction; + acceptJobOffer is AzureCommunicationRoutingService.JobRouterOperations.acceptJobAction; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - declineJob is AzureCommunicationRoutingService.JobRouterOperations.declineJobAction; + declineJobOffer is AzureCommunicationRoutingService.JobRouterOperations.declineJobAction; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" getQueueStatistics is AzureCommunicationRoutingService.JobRouterOperations.getQueueStatistics; From d7d5d8b4b8b2244ddb491a791a49f7ee5cc7e48d Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Sun, 15 Oct 2023 13:19:35 -0700 Subject: [PATCH 044/113] test internal decorator --- specification/communication/Communication.JobRouter/client.tsp | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/communication/Communication.JobRouter/client.tsp b/specification/communication/Communication.JobRouter/client.tsp index 5998776b2569..f032d2d86e7e 100644 --- a/specification/communication/Communication.JobRouter/client.tsp +++ b/specification/communication/Communication.JobRouter/client.tsp @@ -80,6 +80,7 @@ interface JobRouterRestClient { deleteJob is AzureCommunicationRoutingService.JobRouterOperations.deleteJob; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @internal("csharp") reclassifyJob is AzureCommunicationRoutingService.JobRouterOperations.reclassifyJobAction; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" From 0fefa244e2dadbd37830be8ab5d63d3c55ef24da Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Sun, 15 Oct 2023 13:34:26 -0700 Subject: [PATCH 045/113] make all upsert methods internal --- .../communication/Communication.JobRouter/client.tsp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/specification/communication/Communication.JobRouter/client.tsp b/specification/communication/Communication.JobRouter/client.tsp index f032d2d86e7e..f4d381db2aea 100644 --- a/specification/communication/Communication.JobRouter/client.tsp +++ b/specification/communication/Communication.JobRouter/client.tsp @@ -17,6 +17,7 @@ namespace ClientForAcsJobRouter; }) interface JobRouterAdministrationRestClient { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @internal("csharp") upsertDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertDistributionPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -29,6 +30,7 @@ interface JobRouterAdministrationRestClient { deleteDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteDistributionPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @internal("csharp") upsertClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertClassificationPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -41,6 +43,7 @@ interface JobRouterAdministrationRestClient { deleteClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteClassificationPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @internal("csharp") upsertExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertExceptionPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -53,6 +56,7 @@ interface JobRouterAdministrationRestClient { deleteExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteExceptionPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @internal("csharp") upsertQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertQueue; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -71,6 +75,7 @@ interface JobRouterAdministrationRestClient { }) interface JobRouterRestClient { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @internal("csharp") upsertJob is AzureCommunicationRoutingService.JobRouterOperations.upsertJob; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -111,6 +116,7 @@ interface JobRouterRestClient { getQueueStatistics is AzureCommunicationRoutingService.JobRouterOperations.getQueueStatistics; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @internal("csharp") upsertWorker is AzureCommunicationRoutingService.JobRouterOperations.upsertWorker; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" From 6cafdbd70053332512e31945196e47e0af37de30 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Mon, 16 Oct 2023 17:36:27 -0700 Subject: [PATCH 046/113] specify python package version --- .../communication/Communication.JobRouter/tspconfig.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/communication/Communication.JobRouter/tspconfig.yaml b/specification/communication/Communication.JobRouter/tspconfig.yaml index a8a19935faef..f256e7a944c1 100644 --- a/specification/communication/Communication.JobRouter/tspconfig.yaml +++ b/specification/communication/Communication.JobRouter/tspconfig.yaml @@ -33,10 +33,10 @@ options: save-inputs: true "@azure-tools/typespec-python": package-pprint-name: "\"Azure Communication Job Router Service\"" - package-mode: "azure-dataplane" emitter-output-dir: "{python-sdk-folder}/sdk/{service-directory-name}/{package-name}" package-dir: "azure-communication-jobrouter" package-name: "{package-dir}" + package-version: 1.0.0 "@azure-tools/typespec-java": emitter-output-dir: "{java-sdk-folder}/sdk/{service-directory-name}/azure-communication-jobrouter" namespace: com.azure.communication.jobrouter From 2397f651d1dc0647da1552b0b2657d6acdb1895a Mon Sep 17 00:00:00 2001 From: Charandeep Parisineti Date: Tue, 17 Oct 2023 10:26:46 -0700 Subject: [PATCH 047/113] Make upsert methods internal --- .../Communication.JobRouter/client.tsp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/specification/communication/Communication.JobRouter/client.tsp b/specification/communication/Communication.JobRouter/client.tsp index f4d381db2aea..5d89dea39a2e 100644 --- a/specification/communication/Communication.JobRouter/client.tsp +++ b/specification/communication/Communication.JobRouter/client.tsp @@ -17,7 +17,7 @@ namespace ClientForAcsJobRouter; }) interface JobRouterAdministrationRestClient { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @internal("csharp") + @internal upsertDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertDistributionPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -30,7 +30,7 @@ interface JobRouterAdministrationRestClient { deleteDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteDistributionPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @internal("csharp") + @internal upsertClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertClassificationPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -43,7 +43,7 @@ interface JobRouterAdministrationRestClient { deleteClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteClassificationPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @internal("csharp") + @internal upsertExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertExceptionPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -56,7 +56,7 @@ interface JobRouterAdministrationRestClient { deleteExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteExceptionPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @internal("csharp") + @internal upsertQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertQueue; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -75,7 +75,7 @@ interface JobRouterAdministrationRestClient { }) interface JobRouterRestClient { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @internal("csharp") + @internal upsertJob is AzureCommunicationRoutingService.JobRouterOperations.upsertJob; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -85,7 +85,7 @@ interface JobRouterRestClient { deleteJob is AzureCommunicationRoutingService.JobRouterOperations.deleteJob; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @internal("csharp") + @internal reclassifyJob is AzureCommunicationRoutingService.JobRouterOperations.reclassifyJobAction; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -116,7 +116,7 @@ interface JobRouterRestClient { getQueueStatistics is AzureCommunicationRoutingService.JobRouterOperations.getQueueStatistics; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @internal("csharp") + @internal upsertWorker is AzureCommunicationRoutingService.JobRouterOperations.upsertWorker; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" From eb57b2bef7d6a290fa40654d8bfa1409fca3386a Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Wed, 18 Oct 2023 13:34:19 -0700 Subject: [PATCH 048/113] make status selectors internal for python --- .../communication/Communication.JobRouter/models.tsp | 4 ++++ .../communication/Communication.JobRouter/tspconfig.yaml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 3e79ebdfa2e3..492ce9252f28 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -2,6 +2,7 @@ import "@typespec/http"; import "@typespec/rest"; import "@typespec/versioning"; import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-client-generator-core"; using TypeSpec.Http; using TypeSpec.Rest; @@ -10,6 +11,7 @@ using TypeSpec.Reflection; using Azure.Core; using Azure.Core.Traits; using Azure.Core.Foundations; +using Azure.ClientGenerator.Core; @versioned(AzureCommunicationRoutingService.Versions) namespace AzureCommunicationRoutingService; @@ -135,6 +137,7 @@ enum RouterWorkerSelectorStatus { expired, } +@access(Access.internal, "python") @doc("Enums used to filters jobs by state") enum RouterJobStatusSelector { @doc("Default") @@ -192,6 +195,7 @@ enum RouterWorkerState { inactive, } +@access(Access.internal, "python") @doc("Enums used to filters workers by state") enum RouterWorkerStateSelector { @doc("Worker is active and available to take offers.") diff --git a/specification/communication/Communication.JobRouter/tspconfig.yaml b/specification/communication/Communication.JobRouter/tspconfig.yaml index f256e7a944c1..aeb9a3e5da01 100644 --- a/specification/communication/Communication.JobRouter/tspconfig.yaml +++ b/specification/communication/Communication.JobRouter/tspconfig.yaml @@ -32,7 +32,7 @@ options: package-dir: "Azure.Communication.JobRouter" save-inputs: true "@azure-tools/typespec-python": - package-pprint-name: "\"Azure Communication Job Router Service\"" + package-pprint-name: "\"Communication JobRouter\"" emitter-output-dir: "{python-sdk-folder}/sdk/{service-directory-name}/{package-name}" package-dir: "azure-communication-jobrouter" package-name: "{package-dir}" From 42c8741a245822c31a5f1fd777015907fb1d6bd8 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Mon, 23 Oct 2023 15:47:09 -0700 Subject: [PATCH 049/113] sdk feedback review items --- ...onPolicies_CreateClassificationPolicy.json | 14 +- ...onPolicies_DeleteClassificationPolicy.json | 2 +- ...ationPolicies_GetClassificationPolicy.json | 9 +- ...istClassificationPoliciesWithPageSize.json | 68 +- ...onPolicies_UpdateClassificationPolicy.json | 12 +- ...tionPolicies_CreateDistributionPolicy.json | 8 +- ...tionPolicies_DeleteDistributionPolicy.json | 2 +- ...ibutionPolicies_GetDistributionPolicy.json | 5 +- ..._ListDistributionPoliciesWithPageSize.json | 36 +- ...tionPolicies_UpdateDistributionPolicy.json | 8 +- ...ceptionPolicies_CreateExceptionPolicy.json | 46 +- ...ceptionPolicies_DeleteExceptionPolicy.json | 2 +- .../ExceptionPolicies_GetExceptionPolicy.json | 17 +- ...ies_ListExceptionPoliciesWithPageSize.json | 72 +- ...ceptionPolicies_UpdateExceptionPolicy.json | 46 +- .../examples/2023-11-01/Jobs_CloseJob.json | 4 +- .../examples/2023-11-01/Jobs_CompleteJob.json | 4 +- .../examples/2023-11-01/Jobs_CreateJob.json | 12 +- .../2023-11-01/Jobs_CreateScheduledJob.json | 6 +- .../examples/2023-11-01/Jobs_GetJob.json | 3 +- .../2023-11-01/Jobs_ReclassifyJob.json | 4 +- .../2023-11-01/Jobs_RequestJobCancel.json | 4 +- .../examples/2023-11-01/Jobs_UnassignJob.json | 4 +- .../examples/2023-11-01/Jobs_UpdateJob.json | 8 +- .../Communication.JobRouter/models.tsp | 189 ++--- .../Communication.JobRouter/routes.tsp | 12 +- .../communicationservicejobrouter.json | 716 +++++++++++------- ...onPolicies_CreateClassificationPolicy.json | 14 +- ...onPolicies_DeleteClassificationPolicy.json | 2 +- ...ationPolicies_GetClassificationPolicy.json | 9 +- ...istClassificationPoliciesWithPageSize.json | 68 +- ...onPolicies_UpdateClassificationPolicy.json | 12 +- ...tionPolicies_CreateDistributionPolicy.json | 8 +- ...tionPolicies_DeleteDistributionPolicy.json | 2 +- ...ibutionPolicies_GetDistributionPolicy.json | 5 +- ..._ListDistributionPoliciesWithPageSize.json | 36 +- ...tionPolicies_UpdateDistributionPolicy.json | 8 +- ...ceptionPolicies_CreateExceptionPolicy.json | 46 +- ...ceptionPolicies_DeleteExceptionPolicy.json | 2 +- .../ExceptionPolicies_GetExceptionPolicy.json | 17 +- ...ies_ListExceptionPoliciesWithPageSize.json | 72 +- ...ceptionPolicies_UpdateExceptionPolicy.json | 46 +- .../2023-11-01/examples/Jobs_CloseJob.json | 4 +- .../2023-11-01/examples/Jobs_CompleteJob.json | 4 +- .../2023-11-01/examples/Jobs_CreateJob.json | 12 +- .../examples/Jobs_CreateScheduledJob.json | 6 +- .../2023-11-01/examples/Jobs_GetJob.json | 3 +- .../examples/Jobs_ReclassifyJob.json | 4 +- .../examples/Jobs_RequestJobCancel.json | 4 +- .../2023-11-01/examples/Jobs_UnassignJob.json | 4 +- .../2023-11-01/examples/Jobs_UpdateJob.json | 8 +- 51 files changed, 956 insertions(+), 753 deletions(-) diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_CreateClassificationPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_CreateClassificationPolicy.json index cbc04cab0fbe..3e055c07523f 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_CreateClassificationPolicy.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_CreateClassificationPolicy.json @@ -4,11 +4,11 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "90eb00c4-234e-4df7-a231-ef7895518384", + "classificationPolicyId": "90eb00c4-234e-4df7-a231-ef7895518384", "resource": { "name": "Main", "fallbackQueueId": "MainQueue", - "queueSelectors": [ + "queueSelectorAttachments": [ { "kind": "conditional", "condition": { @@ -37,7 +37,7 @@ "id": "90eb00c4-234e-4df7-a231-ef7895518384", "name": "Main", "fallbackQueueId": "MainQueue", - "queueSelectors": [ + "queueSelectorAttachments": [ { "kind": "conditional", "condition": { @@ -58,7 +58,8 @@ "kind": "static-rule", "value": "2" }, - "workerSelectors": [] + "workerSelectorAttachments": [], + "etag": "etag" } }, "201": { @@ -66,7 +67,7 @@ "id": "90eb00c4-234e-4df7-a231-ef7895518384", "name": "Main", "fallbackQueueId": "MainQueue", - "queueSelectors": [ + "queueSelectorAttachments": [ { "kind": "conditional", "condition": { @@ -87,7 +88,8 @@ "kind": "static-rule", "value": "2" }, - "workerSelectors": [] + "workerSelectorAttachments": [], + "etag": "etag" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_DeleteClassificationPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_DeleteClassificationPolicy.json index b332dd1dfd94..700e0721c14c 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_DeleteClassificationPolicy.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_DeleteClassificationPolicy.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "MainClassificationPolicy" + "classificationPolicyId": "MainClassificationPolicy" }, "responses": { "204": {} diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_GetClassificationPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_GetClassificationPolicy.json index b0db0bfc86af..2be617609a40 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_GetClassificationPolicy.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_GetClassificationPolicy.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "MainClassificationPolicy" + "classificationPolicyId": "MainClassificationPolicy" }, "responses": { "200": { @@ -12,7 +12,7 @@ "id": "MainClassificationPolicy", "name": "Main", "fallbackQueueId": "MainQueue", - "queueSelectors": [ + "queueSelectorAttachments": [ { "kind": "conditional", "condition": { @@ -33,13 +33,14 @@ "kind": "static-rule", "value": "2" }, - "workerSelectors": [ + "workerSelectorAttachments": [ { "kind": "pass-through", "key": "language", "labelOperator": "equal" } - ] + ], + "etag": "etag" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json index dfc005a35353..e0e1c85873a7 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json @@ -11,49 +11,45 @@ "body": { "value": [ { - "classificationPolicy": { - "id": "MainClassificationPolicy", - "name": "Main", - "fallbackQueueId": "MainQueue", - "queueSelectors": [ - { - "kind": "rule-engine", - "rule": { - "kind": "expression-rule", - "language": "powerFx", - "expression": "If(job.Escalated = true, \"SecondaryQueue\", \"MainQueue\")" - } + "id": "MainClassificationPolicy", + "name": "Main", + "fallbackQueueId": "MainQueue", + "queueSelectorAttachments": [ + { + "kind": "rule-engine", + "rule": { + "kind": "expression-rule", + "language": "powerFx", + "expression": "If(job.Escalated = true, \"SecondaryQueue\", \"MainQueue\")" } - ], - "prioritizationRule": { - "kind": "static-rule", - "value": "2" - }, - "workerSelectors": [] + } + ], + "prioritizationRule": { + "kind": "static-rule", + "value": "2" }, + "workerSelectorAttachments": [], "etag": "etag" }, { - "classificationPolicy": { - "id": "SecondaryClassificationPolicy", - "name": "Secondary", - "fallbackQueueId": "MainQueue", - "queueSelectors": [ - { - "kind": "rule-engine", - "rule": { - "kind": "expression-rule", - "language": "powerFx", - "expression": "If(job.VIP = true, \"VIPQueue\", \"MainQueue\")" - } + "id": "SecondaryClassificationPolicy", + "name": "Secondary", + "fallbackQueueId": "MainQueue", + "queueSelectorAttachments": [ + { + "kind": "rule-engine", + "rule": { + "kind": "expression-rule", + "language": "powerFx", + "expression": "If(job.VIP = true, \"VIPQueue\", \"MainQueue\")" } - ], - "prioritizationRule": { - "kind": "static-rule", - "value": "1" - }, - "workerSelectors": [] + } + ], + "prioritizationRule": { + "kind": "static-rule", + "value": "1" }, + "workerSelectorAttachments": [], "etag": "etag" } ] diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_UpdateClassificationPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_UpdateClassificationPolicy.json index a10e1c597471..d4262ff4b312 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_UpdateClassificationPolicy.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_UpdateClassificationPolicy.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "90eb00c4-234e-4df7-a231-ef7895518384", + "classificationPolicyId": "90eb00c4-234e-4df7-a231-ef7895518384", "resource": { "name": "MainUpdate" } @@ -15,7 +15,7 @@ "id": "90eb00c4-234e-4df7-a231-ef7895518384", "name": "MainUpdate", "fallbackQueueId": "MainQueue", - "queueSelectors": [ + "queueSelectorAttachments": [ { "kind": "conditional", "condition": { @@ -36,7 +36,8 @@ "kind": "static-rule", "value": "2" }, - "workerSelectors": [] + "workerSelectorAttachments": [], + "etag": "etag" } }, "201": { @@ -44,7 +45,7 @@ "id": "90eb00c4-234e-4df7-a231-ef7895518384", "name": "MainUpdate", "fallbackQueueId": "MainQueue", - "queueSelectors": [ + "queueSelectorAttachments": [ { "kind": "conditional", "condition": { @@ -65,7 +66,8 @@ "kind": "static-rule", "value": "2" }, - "workerSelectors": [] + "workerSelectorAttachments": [], + "etag": "etag" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_CreateDistributionPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_CreateDistributionPolicy.json index 251becb83c1c..58b6cfeccece 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_CreateDistributionPolicy.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_CreateDistributionPolicy.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "d9033d56-659c-437a-b5b7-4f3b14301dd4", + "distributionPolicyId": "d9033d56-659c-437a-b5b7-4f3b14301dd4", "resource": { "mode": { "kind": "longest-idle", @@ -27,7 +27,8 @@ "minConcurrentOffers": 1, "maxConcurrentOffers": 5, "bypassSelectors": false - } + }, + "etag": "etag" } }, "201": { @@ -40,7 +41,8 @@ "minConcurrentOffers": 1, "maxConcurrentOffers": 5, "bypassSelectors": false - } + }, + "etag": "etag" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_DeleteDistributionPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_DeleteDistributionPolicy.json index ed4fd7a76ca7..42a35dd35a75 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_DeleteDistributionPolicy.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_DeleteDistributionPolicy.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "MainDistributionPolicy" + "distributionPolicyId": "MainDistributionPolicy" }, "responses": { "204": {} diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_GetDistributionPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_GetDistributionPolicy.json index 9a9dd0aedd8a..89feafb65308 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_GetDistributionPolicy.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_GetDistributionPolicy.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "MainDistributionPolicy" + "distributionPolicyId": "MainDistributionPolicy" }, "responses": { "200": { @@ -17,7 +17,8 @@ "minConcurrentOffers": 1, "maxConcurrentOffers": 5, "bypassSelectors": false - } + }, + "etag": "etag" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_ListDistributionPoliciesWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_ListDistributionPoliciesWithPageSize.json index 750faba99a1d..5b04dc2db344 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_ListDistributionPoliciesWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_ListDistributionPoliciesWithPageSize.json @@ -11,30 +11,26 @@ "body": { "value": [ { - "distributionPolicy": { - "id": "SecondaryDistributionPolicy", - "name": "Secondary", - "offerExpiresAfterSeconds": 300, - "mode": { - "kind": "round-robin", - "minConcurrentOffers": 1, - "maxConcurrentOffers": 2, - "bypassSelectors": false - } + "id": "SecondaryDistributionPolicy", + "name": "Secondary", + "offerExpiresAfterSeconds": 300, + "mode": { + "kind": "round-robin", + "minConcurrentOffers": 1, + "maxConcurrentOffers": 2, + "bypassSelectors": false }, "etag": "etag" }, { - "distributionPolicy": { - "id": "MainDistributionPolicy", - "name": "Main", - "offerExpiresAfterSeconds": 300, - "mode": { - "kind": "longest-idle", - "minConcurrentOffers": 1, - "maxConcurrentOffers": 5, - "bypassSelectors": false - } + "id": "MainDistributionPolicy", + "name": "Main", + "offerExpiresAfterSeconds": 300, + "mode": { + "kind": "longest-idle", + "minConcurrentOffers": 1, + "maxConcurrentOffers": 5, + "bypassSelectors": false }, "etag": "etag" } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_UpdateDistributionPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_UpdateDistributionPolicy.json index 8cd91486e71a..d76872724267 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_UpdateDistributionPolicy.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_UpdateDistributionPolicy.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "d9033d56-659c-437a-b5b7-4f3b14301dd4", + "distributionPolicyId": "d9033d56-659c-437a-b5b7-4f3b14301dd4", "resource": { "mode": { "kind": "longest-idle", @@ -27,7 +27,8 @@ "minConcurrentOffers": 1, "maxConcurrentOffers": 5, "bypassSelectors": false - } + }, + "etag": "etag" } }, "201": { @@ -40,7 +41,8 @@ "minConcurrentOffers": 1, "maxConcurrentOffers": 5, "bypassSelectors": false - } + }, + "etag": "etag" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_CreateExceptionPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_CreateExceptionPolicy.json index 0c7a01b854ad..9828085bd849 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_CreateExceptionPolicy.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_CreateExceptionPolicy.json @@ -4,26 +4,28 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "cf1cda69-6f41-45ac-b252-213293f1b1cb", + "exceptionPolicyId": "cf1cda69-6f41-45ac-b252-213293f1b1cb", "resource": { "name": "Main", - "exceptionRules": { - "MaxWaitTimeExceeded": { - "actions": { - "MoveJobToEscalatedQueue": { + "exceptionRules": [ + { + "id": "MaxWaitTimeExceeded", + "actions": [ + { + "id": "MoveJobToEscalatedQueue", "kind": "reclassify", "classificationPolicyId": "Main", "labelsToUpsert": { "escalated": true } } - }, + ], "trigger": { "kind": "wait-time", "thresholdSeconds": 20 } } - } + ] } }, "responses": { @@ -31,46 +33,52 @@ "body": { "id": "cf1cda69-6f41-45ac-b252-213293f1b1cb", "name": "Main", - "exceptionRules": { - "MaxWaitTimeExceeded": { + "exceptionRules": [ + { + "id": "MaxWaitTimeExceeded", "trigger": { "kind": "wait-time", "thresholdSeconds": 20 }, - "actions": { - "MoveJobToEscalatedQueue": { + "actions": [ + { + "id": "MoveJobToEscalatedQueue", "kind": "reclassify", "classificationPolicyId": "Main", "labelsToUpsert": { "escalated": true } } - } + ] } - } + ], + "etag": "etag" } }, "201": { "body": { "id": "cf1cda69-6f41-45ac-b252-213293f1b1cb", "name": "Main", - "exceptionRules": { - "MaxWaitTimeExceeded": { + "exceptionRules": [ + { + "id": "MaxWaitTimeExceeded", "trigger": { "kind": "wait-time", "thresholdSeconds": 20 }, - "actions": { - "MoveJobToEscalatedQueue": { + "actions": [ + { + "id": "MoveJobToEscalatedQueue", "kind": "reclassify", "classificationPolicyId": "Main", "labelsToUpsert": { "escalated": true } } - } + ] } - } + ], + "etag": "etag" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_DeleteExceptionPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_DeleteExceptionPolicy.json index 83a2f3ceadbe..c928071cb18b 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_DeleteExceptionPolicy.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_DeleteExceptionPolicy.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "MainExceptionPolicy" + "exceptionPolicyId": "MainExceptionPolicy" }, "responses": { "204": {} diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_GetExceptionPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_GetExceptionPolicy.json index 97031421924b..5f9b26cb0406 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_GetExceptionPolicy.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_GetExceptionPolicy.json @@ -4,30 +4,33 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "MainExceptionPolicy" + "exceptionPolicyId": "MainExceptionPolicy" }, "responses": { "200": { "body": { "id": "MainExceptionPolicy", "name": "Main", - "exceptionRules": { - "MaxWaitTimeExceeded": { + "exceptionRules": [ + { + "id": "MaxWaitTimeExceeded", "trigger": { "kind": "wait-time", "thresholdSeconds": 20 }, - "actions": { - "MoveJobToEscalatedQueue": { + "actions": [ + { + "id": "MoveJobToEscalatedQueue", "kind": "reclassify", "classificationPolicyId": "Main", "labelsToUpsert": { "escalated": true } } - } + ] } - } + ], + "etag": "etag" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json index a549f8154445..0d85556326d5 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json @@ -11,51 +11,51 @@ "body": { "value": [ { - "exceptionPolicy": { - "id": "MainExceptionPolicy", - "name": "Main", - "exceptionRules": { - "MaxWaitTimeExceeded": { - "trigger": { - "kind": "wait-time", - "thresholdSeconds": 20 - }, - "actions": { - "MoveJobToEscalatedQueue": { - "kind": "reclassify", - "classificationPolicyId": "Main", - "labelsToUpsert": { - "escalated": true - } + "id": "MainExceptionPolicy", + "name": "Main", + "exceptionRules": [ + { + "id": "MaxWaitTimeExceeded", + "trigger": { + "kind": "wait-time", + "thresholdSeconds": 20 + }, + "actions": [ + { + "id": "MoveJobToEscalatedQueue", + "kind": "reclassify", + "classificationPolicyId": "Main", + "labelsToUpsert": { + "escalated": true } } - } + ] } - }, + ], "etag": "etag" }, { - "exceptionPolicy": { - "id": "SecondaryExceptionPolicy", - "name": "Secondary", - "exceptionRules": { - "MaxWaitTimeExceeded": { - "trigger": { - "kind": "wait-time", - "thresholdSeconds": 50 - }, - "actions": { - "MoveJobToVIPQueue": { - "kind": "reclassify", - "classificationPolicyId": "Main", - "labelsToUpsert": { - "VIP": true - } + "id": "SecondaryExceptionPolicy", + "name": "Secondary", + "exceptionRules": [ + { + "id": "MaxWaitTimeExceeded", + "trigger": { + "kind": "wait-time", + "thresholdSeconds": 50 + }, + "actions": [ + { + "id": "MoveJobToVIPQueue", + "kind": "reclassify", + "classificationPolicyId": "Main", + "labelsToUpsert": { + "VIP": true } } - } + ] } - }, + ], "etag": "etag" } ] diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_UpdateExceptionPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_UpdateExceptionPolicy.json index fc874e46783f..858efc302511 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_UpdateExceptionPolicy.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_UpdateExceptionPolicy.json @@ -4,26 +4,28 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "cf1cda69-6f41-45ac-b252-213293f1b1cb", + "exceptionPolicyId": "cf1cda69-6f41-45ac-b252-213293f1b1cb", "resource": { "name": "Main test", - "exceptionRules": { - "MaxWaitTimeExceeded": { - "actions": { - "MoveJobToEscalatedQueue": { + "exceptionRules": [ + { + "id": "MaxWaitTimeExceeded", + "actions": [ + { + "id": "MoveJobToEscalatedQueue", "kind": "reclassify", "classificationPolicyId": "Main", "labelsToUpsert": { "escalated": true } } - }, + ], "trigger": { "kind": "wait-time", "thresholdSeconds": 20 } } - } + ] } }, "responses": { @@ -31,46 +33,52 @@ "body": { "id": "cf1cda69-6f41-45ac-b252-213293f1b1cb", "name": "Main test", - "exceptionRules": { - "MaxWaitTimeExceeded": { + "exceptionRules": [ + { + "id": "MaxWaitTimeExceeded", "trigger": { "kind": "wait-time", "thresholdSeconds": 20 }, - "actions": { - "MoveJobToEscalatedQueue": { + "actions": [ + { + "id": "MoveJobToEscalatedQueue", "kind": "reclassify", "classificationPolicyId": "Main", "labelsToUpsert": { "escalated": true } } - } + ] } - } + ], + "etag": "etag" } }, "201": { "body": { "id": "cf1cda69-6f41-45ac-b252-213293f1b1cb", "name": "Main test", - "exceptionRules": { - "MaxWaitTimeExceeded": { + "exceptionRules": [ + { + "id": "MaxWaitTimeExceeded", "trigger": { "kind": "wait-time", "thresholdSeconds": 20 }, - "actions": { - "MoveJobToEscalatedQueue": { + "actions": [ + { + "id": "MoveJobToEscalatedQueue", "kind": "reclassify", "classificationPolicyId": "Main", "labelsToUpsert": { "escalated": true } } - } + ] } - } + ], + "etag": "etag" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CloseJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CloseJob.json index f54efb2382db..616d59972955 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CloseJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CloseJob.json @@ -4,8 +4,8 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "8780b28c-7079-4de1-9143-4d369289e958", - "closeJobRequest": { + "jobId": "8780b28c-7079-4de1-9143-4d369289e958", + "closeJobOptions": { "assignmentId": "1d5896f3-8b54-40be-82d3-910323f5e2af", "dispositionCode": "JobCompleted.", "note": "Closing job" diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CompleteJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CompleteJob.json index a07b88617993..534c4056a3bb 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CompleteJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CompleteJob.json @@ -4,8 +4,8 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "8780b28c-7079-4de1-9143-4d369289e958", - "completeJobRequest": { + "jobId": "8780b28c-7079-4de1-9143-4d369289e958", + "completeJobOptions": { "assignmentId": "1d5896f3-8b54-40be-82d3-910323f5e2af", "note": "Completing job" } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateJob.json index 000f33eda73c..6b842747e1ca 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateJob.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "JobId", + "jobId": "JobId", "resource": { "channelId": "CustomChatChannel", "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", @@ -49,13 +49,14 @@ "attachedWorkerSelectors": [], "labels": {}, "assignments": {}, - "notes": {}, + "notes": [], "matchingMode": { "modeType": "queueAndMatchMode", "queueAndMatchMode": {}, "scheduleAndSuspendMode": null, "suspendMode": null - } + }, + "etag": "etag" } }, "201": { @@ -80,13 +81,14 @@ "attachedWorkerSelectors": [], "labels": {}, "assignments": {}, - "notes": {}, + "notes": [], "matchingMode": { "modeType": "queueAndMatchMode", "queueAndMatchMode": {}, "scheduleAndSuspendMode": null, "suspendMode": null - } + }, + "etag": "etag" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateScheduledJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateScheduledJob.json index 95212a18d5a9..4cf970e7b023 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateScheduledJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateScheduledJob.json @@ -60,7 +60,8 @@ }, "suspendMode": null }, - "scheduledAt": null + "scheduledAt": null, + "etag": "etag" } }, "201": { @@ -94,7 +95,8 @@ }, "suspendMode": null }, - "scheduledAt": null + "scheduledAt": null, + "etag": "etag" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJob.json index ddc0328f620d..253c7ad5d4b4 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJob.json @@ -35,7 +35,8 @@ "queueAndMatchMode": {}, "scheduleAndSuspendMode": null, "suspendMode": null - } + }, + "etag": "etag" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_ReclassifyJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_ReclassifyJob.json index 6bb9cdc04a5a..706b69b44f1d 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_ReclassifyJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_ReclassifyJob.json @@ -4,8 +4,8 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "8780b28c-7079-4de1-9143-4d369289e958", - "reclassifyJobRequest": {} + "jobId": "8780b28c-7079-4de1-9143-4d369289e958", + "reclassifyJobOptions": {} }, "responses": { "200": { diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_RequestJobCancel.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_RequestJobCancel.json index d0ddfd51c0dd..3660808d52b3 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_RequestJobCancel.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_RequestJobCancel.json @@ -4,8 +4,8 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "8780b28c-7079-4de1-9143-4d369289e958", - "cancelJobRequest": { + "jobId": "8780b28c-7079-4de1-9143-4d369289e958", + "cancelJobOptions": { "note": "User hung up while waiting in queue.", "dispositionCode": "Disconnected" } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UnassignJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UnassignJob.json index a3a4e4904d78..21a2d4200bc2 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UnassignJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UnassignJob.json @@ -4,9 +4,9 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "8780b28c-7079-4de1-9143-4d369289e958", + "jobId": "8780b28c-7079-4de1-9143-4d369289e958", "assignmentId": "1d5896f3-8b54-40be-82d3-910323f5e2af", - "unassignJobRequest": { + "unassignJobOptions": { "suspendMatching": false } }, diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UpdateJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UpdateJob.json index 684269f7901c..f212a545b84e 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UpdateJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UpdateJob.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "8780b28c-7079-4de1-9143-4d369289e958", + "jobId": "8780b28c-7079-4de1-9143-4d369289e958", "resource": { "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af" } @@ -38,7 +38,8 @@ "queueAndMatchMode": {}, "scheduleAndSuspendMode": null, "suspendMode": null - } + }, + "etag": "etag" } }, "201": { @@ -69,7 +70,8 @@ "queueAndMatchMode": {}, "scheduleAndSuspendMode": null, "suspendMode": null - } + }, + "etag": "etag" } } } diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 492ce9252f28..e60d051ed58f 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -229,7 +229,9 @@ enum ExpressionRouterRuleLanguage { @resource("classificationPolicies") @doc("A container for the rules that govern how jobs are classified.") model ClassificationPolicy { - @key("id") + ...RouterPageableEntity, + + @key("classificationPolicyId") @doc("Unique identifier of this policy.") @visibility("read") id: string; @@ -240,8 +242,8 @@ model ClassificationPolicy { @doc("The fallback queue to select if the queue selector doesn't find a match.") fallbackQueueId?: string; - @doc("The queue selectors to resolve a queue for a given job.") - queueSelectors?: QueueSelectorAttachment[]; + @doc("The queue selector attachments used to resolve a queue for a given job.") + queueSelectorAttachments?: QueueSelectorAttachment[]; @doc(""" A rule of one of the following types: @@ -260,8 +262,8 @@ OAuth2.0 authentication protocol. """) prioritizationRule?: RouterRule; - @doc("The worker label selectors to attach to a given job.") - workerSelectors?: WorkerSelectorAttachment[]; + @doc("The worker selector attachments used to attach worker selectors to a given job.") + workerSelectorAttachments?: WorkerSelectorAttachment[]; } @doc(""" @@ -280,25 +282,21 @@ WebhookRule: A rule providing a binding to a webserver following OAuth2.0 authentication protocol. """) @discriminator("kind") -model RouterRule {} +model RouterRule { + @doc("The type discriminator describing a sub-type of RouterRule") + kind: string; +} @doc("A paged collection of classification policies.") model ClassificationPolicyCollection - is RouterPagedCollection; - -@doc("Paged instance of ClassificationPolicy") -model ClassificationPolicyItem { - @doc("A container for the rules that govern how jobs are classified.") - classificationPolicy: ClassificationPolicy; - - @doc("(Optional) The Concurrency Token.") - etag: string; -} + is RouterPagedCollection; @resource("distributionPolicies") @doc("Policy governing how jobs are distributed to workers") model DistributionPolicy { - @key("id") + ...RouterPageableEntity, + + @key("distributionPolicyId") @doc("The unique identifier of the policy.") @visibility("read") id: string; @@ -336,24 +334,20 @@ This flag is intended more for temporary usage. By default, set to false. """) bypassSelectors?: boolean; + + @doc("The type discriminator describing a sub-type of DistributionMode") + kind: string; } @doc("A paged collection of distribution policies.") -model DistributionPolicyCollection is RouterPagedCollection; - -@doc("Paged instance of DistributionPolicy") -model DistributionPolicyItem { - @doc("Policy governing how jobs are distributed to workers") - distributionPolicy: DistributionPolicy; - - @doc("(Optional) The Concurrency Token.") - etag: string; -} +model DistributionPolicyCollection is RouterPagedCollection; @resource("exceptionPolicies") @doc("A policy that defines actions to execute when exception are triggered.") model ExceptionPolicy { - @key("id") + ...RouterPageableEntity, + + @key("exceptionPolicyId") @doc("The Id of the exception policy") @visibility("read") id: string; @@ -365,41 +359,47 @@ model ExceptionPolicy { (Optional) A dictionary collection of exception rules on the exception policy. Key is the Id of each exception rule. """) - exceptionRules?: Record; + exceptionRules?: ExceptionRule[]; } @doc("A rule that defines actions to execute upon a specific trigger.") model ExceptionRule { + + @doc("Id of the exception rule.") + id: string; + @doc("The trigger for this exception rule") trigger: ExceptionTrigger; - @doc(""" -A dictionary collection of actions to perform once the exception is triggered. -Key is the Id of each exception action. -""") - actions: Record; + @doc("A collection of actions to perform once the exception is triggered.") + actions: ExceptionAction[]; } @doc("The trigger for this exception rule") @discriminator("kind") -model ExceptionTrigger {} +model ExceptionTrigger { + @doc("The type discriminator describing a sub-type of ExceptionTrigger") + kind: string; +} @doc("A paged collection of exception policies.") -model ExceptionPolicyCollection is RouterPagedCollection; +model ExceptionPolicyCollection is RouterPagedCollection; -@doc("Paged instance of ExceptionPolicy") -model ExceptionPolicyItem { - @doc("A policy that defines actions to execute when exception are triggered.") - exceptionPolicy: ExceptionPolicy; - - @doc("(Optional) The Concurrency Token.") - etag: string; +@doc("A note attached to a job.") +model RouterJobNote { + @doc("The message contained in the note.") + message: string; + + @doc("The time at which the note was added in UTC. If not provided, will default to the current time.") + addedAt?: utcDateTime; } @resource("jobs") @doc("A unit of work to be routed") model RouterJob { - @key("id") + ...RouterPageableEntity, + + @key("jobId") @doc("The id of the job.") @visibility("read") id: string; @@ -460,7 +460,7 @@ Key is AssignmentId. tags?: Record; @doc("Notes attached to a job, sorted by timestamp") - notes?: Record; + notes?: RouterJobNote[]; @doc("If set, job will be scheduled to be enqueued at a given time") @visibility("read") @@ -552,7 +552,10 @@ SuspendMode: Used when matching workers to a job needs to be suspended. """) @discriminator("kind") -model JobMatchingMode { } +model JobMatchingMode { + @doc("The type discriminator describing a sub-type of JobMatchingMode") + kind: string; +} @doc(""" Describes a matching mode used for scheduling jobs to be queued at a future @@ -584,7 +587,7 @@ model SuspendMode extends JobMatchingMode { } @doc("Request payload for deleting a job") -model CancelJobRequest { +model CancelJobOptions { @doc(""" (Optional) A note that will be appended to the jobs' Notes collection with the current timestamp. @@ -600,7 +603,7 @@ If not provided, default value of \"Cancelled\" is set. } @doc("Request payload for completing jobs") -model CompleteJobRequest { +model CompleteJobOptions { @doc("The assignment within the job to complete.") assignmentId: string; @@ -612,7 +615,7 @@ current timestamp. } @doc("Request payload for closing jobs") -model CloseJobRequest { +model CloseJobOptions { @doc("The assignment within which the job is to be closed.") assignmentId: string; @@ -639,16 +642,7 @@ current timestamp. } @doc("A paged collection of jobs.") -model RouterJobCollection is RouterPagedCollection; - -@doc("Paged instance of RouterJob") -model RouterJobItem { - @doc("A unit of work to be routed") - job: RouterJob; - - @doc("(Optional) The Concurrency Token.") - etag: string; -} +model RouterJobCollection is RouterPagedCollection; @doc("Position and estimated wait time for a job.") model RouterJobPositionDetails { @@ -669,7 +663,7 @@ model RouterJobPositionDetails { } @doc("Request payload for unassigning a job.") -model UnassignJobRequest { +model UnassignJobOptions { @doc(""" If SuspendMatching is true, then the job is not queued for re-matching with a worker. @@ -702,7 +696,7 @@ model AcceptJobOfferResult { } @doc("Request payload for declining offers") -model DeclineJobOfferRequest { +model DeclineJobOfferOptions { @doc(""" If the RetryOfferAt is not provided, then this job will not be offered again to the worker who declined this job unless @@ -719,7 +713,9 @@ declined the job will also be eligible for the job at that time. @resource("queues") @doc("A queue that can contain jobs to be routed.") model RouterQueue { - @key("id") + ...RouterPageableEntity, + + @key("queueId") @doc("The Id of this queue") @visibility("read") id: string; @@ -747,16 +743,7 @@ escalation rules. } @doc("A paged collection of queues.") -model RouterQueueCollection is RouterPagedCollection; - -@doc("Paged instance of RouterQueue") -model RouterQueueItem { - @doc("A queue that can contain jobs to be routed.") - queue: RouterQueue; - - @doc("(Optional) The Concurrency Token.") - etag: string; -} +model RouterQueueCollection is RouterPagedCollection; @doc("Statistics for the queue") model RouterQueueStatistics { @@ -776,12 +763,12 @@ by job priority longestJobWaitTimeMinutes?: float64; } -@doc("An assignment of a worker to a queue") -model RouterQueueAssignment {} @resource("workers") @doc("An entity for jobs to be routed to") model RouterWorker { + ...RouterPageableEntity, + @key("workerId") @doc("Id of the worker.") @visibility("read") @@ -792,10 +779,10 @@ model RouterWorker { state?: RouterWorkerState; @doc("The queue(s) that this worker can receive work from.") - queueAssignments?: Record; + queues?: string[]; @doc("The total capacity score this worker has to manage multiple concurrent jobs.") - totalCapacity?: int32; + capacity?: int32; @doc(""" A set of key/value pairs that are identifying attributes used by the rules @@ -807,7 +794,7 @@ engines to make decisions. tags?: Record; @doc("The channel(s) this worker can handle and their impact on the workers capacity.") - channelConfigurations?: Record; + channels?: RouterChannel[]; @doc("A list of active offers issued to this worker.") @visibility("read") @@ -829,7 +816,11 @@ consumed. A value of '0' means no capacity is currently consumed. } @doc("Represents the capacity a job in this channel will consume from a worker") -model ChannelConfiguration { +model RouterChannel { + + @doc("Id of the channel.") + channelId: string; + @doc(""" The amount of capacity that an instance of a job of this channel will consume of the total worker capacity. @@ -877,16 +868,7 @@ model RouterWorkerAssignment { } @doc("A paged collection of workers.") -model RouterWorkerCollection is RouterPagedCollection; - -@doc("Paged instance of RouterWorker") -model RouterWorkerItem { - @doc("An entity for jobs to be routed to") - worker: RouterWorker; - - @doc("(Optional) The Concurrency Token.") - etag: string; -} +model RouterWorkerCollection is RouterPagedCollection; @doc("Jobs are distributed to the worker with the strongest abilities available.") model BestWorkerMode extends DistributionMode { @@ -979,7 +961,14 @@ custom values. @doc("The action to take when the exception is triggered") @discriminator("kind") -model ExceptionAction {} +model ExceptionAction { + @doc("Unique Id of the exception action") + @visibility("read") + id: string; + + @doc("The type discriminator describing a sub-type of ExceptionAction") + kind: string; +} @doc(""" Describes a set of queue selectors that will be attached if the given condition @@ -1033,7 +1022,10 @@ An attachment of queue selectors to resolve a queue to a job from a classification policy """) @discriminator("kind") -model QueueSelectorAttachment {} +model QueueSelectorAttachment { + @doc("The type discriminator describing a sub-type of QueueSelectorAttachment") + kind: string; +} @doc(""" Describes a set of worker selectors that will be attached if the given @@ -1066,7 +1058,10 @@ OAuth2.0 authentication protocol. @doc("An attachment which attaches worker selectors to a job") @discriminator("kind") -model WorkerSelectorAttachment {} +model WorkerSelectorAttachment { + @doc("The type discriminator describing a sub-type of WorkerSelectorAttachment") + kind: string; +} @doc("A rule that return the same labels as the input labels.") model DirectMapRouterRule extends RouterRule { @@ -1393,8 +1388,9 @@ selected. workerSelectors: RouterWorkerSelector[]; } +@access(Access.internal) @doc("Request payload for reclassifying jobs") -model ReclassifyJobRequest is Record; +model ReclassifyJobOptions is Record; @doc("Response payload from reclassifying a job") model ReclassifyJobResult {} @@ -1506,10 +1502,17 @@ jobs. Defaults to false. hasCapacity?: boolean; } +@doc("Base class for all pageable entities") +model RouterPageableEntity { + @doc("Concurrency Token.") + @visibility("read") + etag: eTag; +} + @pagedResult @friendlyName("Paged{name}", TResource) @doc("Paged collection of {name} items", TResource) -model RouterPagedCollection { +model RouterPagedCollection { @doc("The {name} items on this page", TResource) @items value: TResource[]; diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index 95b545c9fdaa..1f626b676db0 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -165,7 +165,7 @@ interface JobRouterOperations { @doc("Request object for reclassifying a job.") @body - reclassifyJobRequest?: ReclassifyJobRequest; + reclassifyJobOptions?: ReclassifyJobOptions; }, ReclassfiyJobOkReponse >; @@ -189,7 +189,7 @@ cancellation reason. @doc("Request model for cancelling job.") @body - cancelJobRequest?: CancelJobRequest; + cancelJobOptions?: CancelJobOptions; }, CancelJobResultWithOkResponse >; @@ -207,7 +207,7 @@ cancellation reason. @doc("Request model for completing job.") @body - completeJobRequest: CompleteJobRequest; + completeJobOptions: CompleteJobOptions; }, CompleteJobResultWithOkResponse >; @@ -225,7 +225,7 @@ cancellation reason. @doc("Request model for closing job.") @body - closeJobRequest: CloseJobRequest; + closeJobOptions: CloseJobOptions; }, CloseJobResultResponse >; @@ -271,7 +271,7 @@ cancellation reason. @doc("Request body for unassign route.") @body - unassignJobRequest?: UnassignJobRequest; + unassignJobOptions?: UnassignJobOptions; }, UnassignJobResult >; @@ -317,7 +317,7 @@ accepted the job already. @doc("Request model for declining offer.") @body - declineJobOfferRequest?: DeclineJobOfferRequest; + declineJobOfferOptions?: DeclineJobOfferOptions; }, DeclineJobOfferResultWithOkResponse >; diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index ddc905b9988d..b54c9e085904 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -55,7 +55,7 @@ "200": { "description": "The request has succeeded.", "schema": { - "$ref": "#/definitions/PagedClassificationPolicyItem" + "$ref": "#/definitions/PagedClassificationPolicy" } }, "default": { @@ -81,7 +81,7 @@ } } }, - "/routing/classificationPolicies/{id}": { + "/routing/classificationPolicies/{classificationPolicyId}": { "get": { "operationId": "JobRouterAdministrationOperations_GetClassificationPolicy", "summary": "Retrieves an existing classification policy by Id.", @@ -91,7 +91,7 @@ "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "id", + "name": "classificationPolicyId", "in": "path", "description": "Unique identifier of this policy.", "required": true, @@ -146,7 +146,7 @@ "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "id", + "name": "classificationPolicyId", "in": "path", "description": "Unique identifier of this policy.", "required": true, @@ -232,7 +232,7 @@ "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "id", + "name": "classificationPolicyId", "in": "path", "description": "Unique identifier of this policy.", "required": true, @@ -285,7 +285,7 @@ "200": { "description": "The request has succeeded.", "schema": { - "$ref": "#/definitions/PagedDistributionPolicyItem" + "$ref": "#/definitions/PagedDistributionPolicy" } }, "default": { @@ -311,7 +311,7 @@ } } }, - "/routing/distributionPolicies/{id}": { + "/routing/distributionPolicies/{distributionPolicyId}": { "get": { "operationId": "JobRouterAdministrationOperations_GetDistributionPolicy", "summary": "Retrieves an existing distribution policy by Id.", @@ -321,7 +321,7 @@ "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "id", + "name": "distributionPolicyId", "in": "path", "description": "The unique identifier of the policy.", "required": true, @@ -376,7 +376,7 @@ "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "id", + "name": "distributionPolicyId", "in": "path", "description": "The unique identifier of the policy.", "required": true, @@ -462,7 +462,7 @@ "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "id", + "name": "distributionPolicyId", "in": "path", "description": "The unique identifier of the policy.", "required": true, @@ -515,7 +515,7 @@ "200": { "description": "The request has succeeded.", "schema": { - "$ref": "#/definitions/PagedExceptionPolicyItem" + "$ref": "#/definitions/PagedExceptionPolicy" } }, "default": { @@ -541,7 +541,7 @@ } } }, - "/routing/exceptionPolicies/{id}": { + "/routing/exceptionPolicies/{exceptionPolicyId}": { "get": { "operationId": "JobRouterAdministrationOperations_GetExceptionPolicy", "summary": "Retrieves an existing exception policy by Id.", @@ -551,7 +551,7 @@ "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "id", + "name": "exceptionPolicyId", "in": "path", "description": "The Id of the exception policy", "required": true, @@ -606,7 +606,7 @@ "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "id", + "name": "exceptionPolicyId", "in": "path", "description": "The Id of the exception policy", "required": true, @@ -692,7 +692,7 @@ "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "id", + "name": "exceptionPolicyId", "in": "path", "description": "The Id of the exception policy", "required": true, @@ -763,7 +763,7 @@ "200": { "description": "The request has succeeded.", "schema": { - "$ref": "#/definitions/PagedRouterJobItem" + "$ref": "#/definitions/PagedRouterJob" } }, "default": { @@ -789,7 +789,7 @@ } } }, - "/routing/jobs/{id}": { + "/routing/jobs/{jobId}": { "get": { "operationId": "JobRouterOperations_GetJob", "summary": "Retrieves an existing job by Id.", @@ -799,7 +799,7 @@ "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "id", + "name": "jobId", "in": "path", "description": "The id of the job.", "required": true, @@ -854,7 +854,7 @@ "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "id", + "name": "jobId", "in": "path", "description": "The id of the job.", "required": true, @@ -943,7 +943,7 @@ "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "id", + "name": "jobId", "in": "path", "description": "The id of the job.", "required": true, @@ -991,12 +991,12 @@ "type": "string" }, { - "name": "reclassifyJobRequest", + "name": "reclassifyJobOptions", "in": "body", "description": "Request object for reclassifying a job.", "required": false, "schema": { - "$ref": "#/definitions/ReclassifyJobRequest" + "$ref": "#/definitions/ReclassifyJobOptions" } } ], @@ -1041,12 +1041,12 @@ "type": "string" }, { - "name": "cancelJobRequest", + "name": "cancelJobOptions", "in": "body", "description": "Request model for cancelling job.", "required": false, "schema": { - "$ref": "#/definitions/CancelJobRequest" + "$ref": "#/definitions/CancelJobOptions" } } ], @@ -1091,12 +1091,12 @@ "type": "string" }, { - "name": "completeJobRequest", + "name": "completeJobOptions", "in": "body", "description": "Request model for completing job.", "required": true, "schema": { - "$ref": "#/definitions/CompleteJobRequest" + "$ref": "#/definitions/CompleteJobOptions" } } ], @@ -1141,12 +1141,12 @@ "type": "string" }, { - "name": "closeJobRequest", + "name": "closeJobOptions", "in": "body", "description": "Request model for closing job.", "required": true, "schema": { - "$ref": "#/definitions/CloseJobRequest" + "$ref": "#/definitions/CloseJobOptions" } } ], @@ -1201,12 +1201,12 @@ "type": "string" }, { - "name": "unassignJobRequest", + "name": "unassignJobOptions", "in": "body", "description": "Request body for unassign route.", "required": false, "schema": { - "$ref": "#/definitions/UnassignJobRequest" + "$ref": "#/definitions/UnassignJobOptions" } } ], @@ -1303,7 +1303,7 @@ "200": { "description": "The request has succeeded.", "schema": { - "$ref": "#/definitions/PagedRouterQueueItem" + "$ref": "#/definitions/PagedRouterQueue" } }, "default": { @@ -1329,7 +1329,7 @@ } } }, - "/routing/queues/{id}": { + "/routing/queues/{queueId}": { "get": { "operationId": "JobRouterAdministrationOperations_GetQueue", "summary": "Retrieves an existing queue by Id.", @@ -1339,7 +1339,7 @@ "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "id", + "name": "queueId", "in": "path", "description": "The Id of this queue", "required": true, @@ -1394,7 +1394,7 @@ "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "id", + "name": "queueId", "in": "path", "description": "The Id of this queue", "required": true, @@ -1480,7 +1480,7 @@ "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "id", + "name": "queueId", "in": "path", "description": "The Id of this queue", "required": true, @@ -1589,7 +1589,7 @@ "200": { "description": "The request has succeeded.", "schema": { - "$ref": "#/definitions/PagedRouterWorkerItem" + "$ref": "#/definitions/PagedRouterWorker" } }, "default": { @@ -1884,12 +1884,12 @@ "type": "string" }, { - "name": "declineJobOfferRequest", + "name": "declineJobOfferOptions", "in": "body", "description": "Request model for declining offer.", "required": false, "schema": { - "$ref": "#/definitions/DeclineJobOfferRequest" + "$ref": "#/definitions/DeclineJobOfferOptions" } } ], @@ -2003,6 +2003,11 @@ } } }, + "Azure.Core.eTag": { + "type": "string", + "format": "eTag", + "description": "The ETag (or entity tag) HTTP response header is an identifier for a specific version of a resource.\nIt lets caches be more efficient and save bandwidth, as a web server does not need to resend a full response if the content was not changed.\n\nIt is a string of ASCII characters placed between double quotes, like \"675af34563dc-tr34\"." + }, "BestWorkerMode": { "type": "object", "description": "Jobs are distributed to the worker with the strongest abilities available.", @@ -2023,6 +2028,26 @@ ], "x-ms-discriminator-value": "best-worker" }, + "BestWorkerModeCreateOrUpdate": { + "type": "object", + "description": "Jobs are distributed to the worker with the strongest abilities available.", + "properties": { + "scoringRule": { + "$ref": "#/definitions/RouterRuleCreateOrUpdate", + "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol." + }, + "scoringRuleOptions": { + "$ref": "#/definitions/ScoringRuleOptions", + "description": "Encapsulates all options that can be passed as parameters for scoring rule with\nBestWorkerMode" + } + }, + "allOf": [ + { + "$ref": "#/definitions/DistributionModeCreateOrUpdate" + } + ], + "x-ms-discriminator-value": "best-worker" + }, "CancelExceptionAction": { "type": "object", "description": "An action that marks a job as cancelled", @@ -2043,7 +2068,7 @@ ], "x-ms-discriminator-value": "cancel" }, - "CancelJobRequest": { + "CancelJobOptions": { "type": "object", "description": "Request payload for deleting a job", "properties": { @@ -2057,45 +2082,15 @@ } } }, - "ChannelConfiguration": { - "type": "object", - "description": "Represents the capacity a job in this channel will consume from a worker", - "properties": { - "capacityCostPerJob": { - "type": "integer", - "format": "int32", - "description": "The amount of capacity that an instance of a job of this channel will consume\nof the total worker capacity." - }, - "maxNumberOfJobs": { - "type": "integer", - "format": "int32", - "description": "The maximum number of jobs that can be supported concurrently for this channel." - } - }, - "required": [ - "capacityCostPerJob" - ] - }, - "ChannelConfigurationCreateOrUpdate": { - "type": "object", - "description": "Represents the capacity a job in this channel will consume from a worker", - "properties": { - "capacityCostPerJob": { - "type": "integer", - "format": "int32", - "description": "The amount of capacity that an instance of a job of this channel will consume\nof the total worker capacity." - }, - "maxNumberOfJobs": { - "type": "integer", - "format": "int32", - "description": "The maximum number of jobs that can be supported concurrently for this channel." - } - } - }, "ClassificationPolicy": { "type": "object", "description": "A container for the rules that govern how jobs are classified.", "properties": { + "etag": { + "$ref": "#/definitions/Azure.Core.eTag", + "description": "Concurrency Token.", + "readOnly": true + }, "id": { "type": "string", "description": "Unique identifier of this policy.", @@ -2109,9 +2104,9 @@ "type": "string", "description": "The fallback queue to select if the queue selector doesn't find a match." }, - "queueSelectors": { + "queueSelectorAttachments": { "type": "array", - "description": "The queue selectors to resolve a queue for a given job.", + "description": "The queue selector attachments used to resolve a queue for a given job.", "items": { "$ref": "#/definitions/QueueSelectorAttachment" }, @@ -2121,9 +2116,9 @@ "$ref": "#/definitions/RouterRule", "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol." }, - "workerSelectors": { + "workerSelectorAttachments": { "type": "array", - "description": "The worker label selectors to attach to a given job.", + "description": "The worker selector attachments used to attach worker selectors to a given job.", "items": { "$ref": "#/definitions/WorkerSelectorAttachment" }, @@ -2131,6 +2126,7 @@ } }, "required": [ + "etag", "id" ] }, @@ -2146,21 +2142,21 @@ "type": "string", "description": "The fallback queue to select if the queue selector doesn't find a match." }, - "queueSelectors": { + "queueSelectorAttachments": { "type": "array", - "description": "The queue selectors to resolve a queue for a given job.", + "description": "The queue selector attachments used to resolve a queue for a given job.", "items": { "$ref": "#/definitions/QueueSelectorAttachment" }, "x-ms-identifiers": [] }, "prioritizationRule": { - "$ref": "#/definitions/RouterRule", + "$ref": "#/definitions/RouterRuleCreateOrUpdate", "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol." }, - "workerSelectors": { + "workerSelectorAttachments": { "type": "array", - "description": "The worker label selectors to attach to a given job.", + "description": "The worker selector attachments used to attach worker selectors to a given job.", "items": { "$ref": "#/definitions/WorkerSelectorAttachment" }, @@ -2168,25 +2164,7 @@ } } }, - "ClassificationPolicyItem": { - "type": "object", - "description": "Paged instance of ClassificationPolicy", - "properties": { - "classificationPolicy": { - "$ref": "#/definitions/ClassificationPolicy", - "description": "A container for the rules that govern how jobs are classified." - }, - "etag": { - "type": "string", - "description": "(Optional) The Concurrency Token." - } - }, - "required": [ - "classificationPolicy", - "etag" - ] - }, - "CloseJobRequest": { + "CloseJobOptions": { "type": "object", "description": "Request payload for closing jobs", "properties": { @@ -2212,7 +2190,7 @@ "assignmentId" ] }, - "CompleteJobRequest": { + "CompleteJobOptions": { "type": "object", "description": "Request payload for completing jobs", "properties": { @@ -2285,7 +2263,7 @@ ], "x-ms-discriminator-value": "conditional" }, - "DeclineJobOfferRequest": { + "DeclineJobOfferOptions": { "type": "object", "description": "Request payload for declining offers", "properties": { @@ -2306,14 +2284,20 @@ ], "x-ms-discriminator-value": "direct-map-rule" }, + "DirectMapRouterRuleCreateOrUpdate": { + "type": "object", + "description": "A rule that return the same labels as the input labels.", + "allOf": [ + { + "$ref": "#/definitions/RouterRuleCreateOrUpdate" + } + ], + "x-ms-discriminator-value": "direct-map-rule" + }, "DistributionMode": { "type": "object", "description": "Abstract base class for defining a distribution mode", "properties": { - "kind": { - "type": "string", - "description": "Discriminator property for DistributionMode." - }, "minConcurrentOffers": { "type": "integer", "format": "int32", @@ -2327,6 +2311,10 @@ "bypassSelectors": { "type": "boolean", "description": "(Optional)\nIf set to true, then router will match workers to jobs even if they\ndon't match label selectors.\nWarning: You may get workers that are not\nqualified for the job they are matched with if you set this\nvariable to true.\nThis flag is intended more for temporary usage.\nBy default, set to false." + }, + "kind": { + "type": "string", + "description": "The type discriminator describing a sub-type of DistributionMode" } }, "discriminator": "kind", @@ -2334,10 +2322,40 @@ "kind" ] }, + "DistributionModeCreateOrUpdate": { + "type": "object", + "description": "Abstract base class for defining a distribution mode", + "properties": { + "minConcurrentOffers": { + "type": "integer", + "format": "int32", + "description": "Governs the minimum desired number of active concurrent offers a job can have." + }, + "maxConcurrentOffers": { + "type": "integer", + "format": "int32", + "description": "Governs the maximum number of active concurrent offers a job can have." + }, + "bypassSelectors": { + "type": "boolean", + "description": "(Optional)\nIf set to true, then router will match workers to jobs even if they\ndon't match label selectors.\nWarning: You may get workers that are not\nqualified for the job they are matched with if you set this\nvariable to true.\nThis flag is intended more for temporary usage.\nBy default, set to false." + }, + "kind": { + "type": "string", + "description": "The type discriminator describing a sub-type of DistributionMode" + } + }, + "discriminator": "kind" + }, "DistributionPolicy": { "type": "object", "description": "Policy governing how jobs are distributed to workers", "properties": { + "etag": { + "$ref": "#/definitions/Azure.Core.eTag", + "description": "Concurrency Token.", + "readOnly": true + }, "id": { "type": "string", "description": "The unique identifier of the policy.", @@ -2358,6 +2376,7 @@ } }, "required": [ + "etag", "id" ] }, @@ -2375,40 +2394,28 @@ "description": "The number of seconds after which any offers created under this policy will be\nexpired." }, "mode": { - "$ref": "#/definitions/DistributionMode", + "$ref": "#/definitions/DistributionModeCreateOrUpdate", "description": "Abstract base class for defining a distribution mode" } } }, - "DistributionPolicyItem": { - "type": "object", - "description": "Paged instance of DistributionPolicy", - "properties": { - "distributionPolicy": { - "$ref": "#/definitions/DistributionPolicy", - "description": "Policy governing how jobs are distributed to workers" - }, - "etag": { - "type": "string", - "description": "(Optional) The Concurrency Token." - } - }, - "required": [ - "distributionPolicy", - "etag" - ] - }, "ExceptionAction": { "type": "object", "description": "The action to take when the exception is triggered", "properties": { + "id": { + "type": "string", + "description": "Unique Id of the exception action", + "readOnly": true + }, "kind": { "type": "string", - "description": "Discriminator property for ExceptionAction." + "description": "The type discriminator describing a sub-type of ExceptionAction" } }, "discriminator": "kind", "required": [ + "id", "kind" ] }, @@ -2416,6 +2423,11 @@ "type": "object", "description": "A policy that defines actions to execute when exception are triggered.", "properties": { + "etag": { + "$ref": "#/definitions/Azure.Core.eTag", + "description": "Concurrency Token.", + "readOnly": true + }, "id": { "type": "string", "description": "The Id of the exception policy", @@ -2426,14 +2438,15 @@ "description": "(Optional) The name of the exception policy." }, "exceptionRules": { - "type": "object", + "type": "array", "description": "(Optional) A dictionary collection of exception rules on the exception policy.\nKey is the Id of each exception rule.", - "additionalProperties": { + "items": { "$ref": "#/definitions/ExceptionRule" } } }, "required": [ + "etag", "id" ] }, @@ -2446,77 +2459,47 @@ "description": "(Optional) The name of the exception policy." }, "exceptionRules": { - "type": "object", + "type": "array", "description": "(Optional) A dictionary collection of exception rules on the exception policy.\nKey is the Id of each exception rule.", - "additionalProperties": { - "$ref": "#/definitions/ExceptionRuleCreateOrUpdate" + "items": { + "$ref": "#/definitions/ExceptionRule" } } } }, - "ExceptionPolicyItem": { - "type": "object", - "description": "Paged instance of ExceptionPolicy", - "properties": { - "exceptionPolicy": { - "$ref": "#/definitions/ExceptionPolicy", - "description": "A policy that defines actions to execute when exception are triggered." - }, - "etag": { - "type": "string", - "description": "(Optional) The Concurrency Token." - } - }, - "required": [ - "exceptionPolicy", - "etag" - ] - }, "ExceptionRule": { "type": "object", "description": "A rule that defines actions to execute upon a specific trigger.", "properties": { + "id": { + "type": "string", + "description": "Id of the exception rule." + }, "trigger": { "$ref": "#/definitions/ExceptionTrigger", "description": "The trigger for this exception rule" }, "actions": { - "type": "object", - "description": "A dictionary collection of actions to perform once the exception is triggered.\nKey is the Id of each exception action.", - "additionalProperties": { + "type": "array", + "description": "A collection of actions to perform once the exception is triggered.", + "items": { "$ref": "#/definitions/ExceptionAction" } } }, "required": [ + "id", "trigger", "actions" ] }, - "ExceptionRuleCreateOrUpdate": { - "type": "object", - "description": "A rule that defines actions to execute upon a specific trigger.", - "properties": { - "trigger": { - "$ref": "#/definitions/ExceptionTrigger", - "description": "The trigger for this exception rule" - }, - "actions": { - "type": "object", - "description": "A dictionary collection of actions to perform once the exception is triggered.\nKey is the Id of each exception action.", - "additionalProperties": { - "$ref": "#/definitions/ExceptionAction" - } - } - } - }, "ExceptionTrigger": { "type": "object", "description": "The trigger for this exception rule", "properties": { "kind": { "type": "string", - "description": "Discriminator property for ExceptionTrigger." + "description": "The type discriminator describing a sub-type of ExceptionTrigger" } }, "discriminator": "kind", @@ -2547,6 +2530,26 @@ ], "x-ms-discriminator-value": "expression-rule" }, + "ExpressionRouterRuleCreateOrUpdate": { + "type": "object", + "description": "A rule providing inline expression rules.", + "properties": { + "language": { + "$ref": "#/definitions/ExpressionRouterRuleLanguage", + "description": "The expression language to compile to and execute" + }, + "expression": { + "type": "string", + "description": "The string containing the expression to evaluate. Should contain return\nstatement with calculated values." + } + }, + "allOf": [ + { + "$ref": "#/definitions/RouterRuleCreateOrUpdate" + } + ], + "x-ms-discriminator-value": "expression-rule" + }, "ExpressionRouterRuleLanguage": { "type": "string", "description": "The available expression languages that can be configured", @@ -2589,6 +2592,27 @@ ], "x-ms-discriminator-value": "azure-function-rule" }, + "FunctionRouterRuleCreateOrUpdate": { + "type": "object", + "description": "A rule providing a binding to an HTTP Triggered Azure Function.", + "properties": { + "functionUri": { + "type": "string", + "format": "uri", + "description": "URL for Azure Function" + }, + "credential": { + "$ref": "#/definitions/FunctionRouterRuleCredential", + "description": "Credentials used to access Azure function rule" + } + }, + "allOf": [ + { + "$ref": "#/definitions/RouterRuleCreateOrUpdate" + } + ], + "x-ms-discriminator-value": "azure-function-rule" + }, "FunctionRouterRuleCredential": { "type": "object", "description": "Credentials used to access Azure function rule", @@ -2613,7 +2637,7 @@ "properties": { "kind": { "type": "string", - "description": "Discriminator property for JobMatchingMode." + "description": "The type discriminator describing a sub-type of JobMatchingMode" } }, "discriminator": "kind", @@ -2621,6 +2645,17 @@ "kind" ] }, + "JobMatchingModeCreateOrUpdate": { + "type": "object", + "description": "The matching mode to be applied to this job.\n \nSupported types:\n \n \nQueueAndMatchMode: Used when matching worker to a job is required to be\ndone right after job is queued.\nScheduleAndSuspendMode: Used for scheduling\njobs to be queued at a future time. At specified time, matching of a worker to\nthe job will not start automatically.\nSuspendMode: Used when matching workers\nto a job needs to be suspended.", + "properties": { + "kind": { + "type": "string", + "description": "The type discriminator describing a sub-type of JobMatchingMode" + } + }, + "discriminator": "kind" + }, "LabelOperator": { "type": "string", "description": "Describes supported operations on label values.", @@ -2679,6 +2714,16 @@ ], "x-ms-discriminator-value": "longest-idle" }, + "LongestIdleModeCreateOrUpdate": { + "type": "object", + "description": "Jobs are directed to the worker who has been idle longest.", + "allOf": [ + { + "$ref": "#/definitions/DistributionModeCreateOrUpdate" + } + ], + "x-ms-discriminator-value": "longest-idle" + }, "ManualReclassifyExceptionAction": { "type": "object", "description": "An action that manually reclassifies a job by providing the queue, priority and\nworker selectors.", @@ -2722,17 +2767,16 @@ } } }, - "PagedClassificationPolicyItem": { + "PagedClassificationPolicy": { "type": "object", "description": "A paged collection of classification policies.", "properties": { "value": { "type": "array", - "description": "The ClassificationPolicyItem items on this page", + "description": "The ClassificationPolicy items on this page", "items": { - "$ref": "#/definitions/ClassificationPolicyItem" - }, - "x-ms-identifiers": [] + "$ref": "#/definitions/ClassificationPolicy" + } }, "nextLink": { "type": "string", @@ -2743,17 +2787,16 @@ "value" ] }, - "PagedDistributionPolicyItem": { + "PagedDistributionPolicy": { "type": "object", "description": "A paged collection of distribution policies.", "properties": { "value": { "type": "array", - "description": "The DistributionPolicyItem items on this page", + "description": "The DistributionPolicy items on this page", "items": { - "$ref": "#/definitions/DistributionPolicyItem" - }, - "x-ms-identifiers": [] + "$ref": "#/definitions/DistributionPolicy" + } }, "nextLink": { "type": "string", @@ -2764,17 +2807,16 @@ "value" ] }, - "PagedExceptionPolicyItem": { + "PagedExceptionPolicy": { "type": "object", "description": "A paged collection of exception policies.", "properties": { "value": { "type": "array", - "description": "The ExceptionPolicyItem items on this page", + "description": "The ExceptionPolicy items on this page", "items": { - "$ref": "#/definitions/ExceptionPolicyItem" - }, - "x-ms-identifiers": [] + "$ref": "#/definitions/ExceptionPolicy" + } }, "nextLink": { "type": "string", @@ -2785,17 +2827,16 @@ "value" ] }, - "PagedRouterJobItem": { + "PagedRouterJob": { "type": "object", "description": "A paged collection of jobs.", "properties": { "value": { "type": "array", - "description": "The RouterJobItem items on this page", + "description": "The RouterJob items on this page", "items": { - "$ref": "#/definitions/RouterJobItem" - }, - "x-ms-identifiers": [] + "$ref": "#/definitions/RouterJob" + } }, "nextLink": { "type": "string", @@ -2806,17 +2847,16 @@ "value" ] }, - "PagedRouterQueueItem": { + "PagedRouterQueue": { "type": "object", "description": "A paged collection of queues.", "properties": { "value": { "type": "array", - "description": "The RouterQueueItem items on this page", + "description": "The RouterQueue items on this page", "items": { - "$ref": "#/definitions/RouterQueueItem" - }, - "x-ms-identifiers": [] + "$ref": "#/definitions/RouterQueue" + } }, "nextLink": { "type": "string", @@ -2827,17 +2867,16 @@ "value" ] }, - "PagedRouterWorkerItem": { + "PagedRouterWorker": { "type": "object", "description": "A paged collection of workers.", "properties": { "value": { "type": "array", - "description": "The RouterWorkerItem items on this page", + "description": "The RouterWorker items on this page", "items": { - "$ref": "#/definitions/RouterWorkerItem" - }, - "x-ms-identifiers": [] + "$ref": "#/definitions/RouterWorker" + } }, "nextLink": { "type": "string", @@ -2911,6 +2950,16 @@ ], "x-ms-discriminator-value": "queue-and-match" }, + "QueueAndMatchModeCreateOrUpdate": { + "type": "object", + "description": "Describes a matching mode where matching worker to a job is automatically started after job is queued successfully.", + "allOf": [ + { + "$ref": "#/definitions/JobMatchingModeCreateOrUpdate" + } + ], + "x-ms-discriminator-value": "queue-and-match" + }, "QueueLengthExceptionTrigger": { "type": "object", "description": "Trigger for an exception action on exceeding queue length", @@ -2937,7 +2986,7 @@ "properties": { "kind": { "type": "string", - "description": "Discriminator property for QueueSelectorAttachment." + "description": "The type discriminator describing a sub-type of QueueSelectorAttachment" } }, "discriminator": "kind", @@ -2989,7 +3038,7 @@ ], "x-ms-discriminator-value": "reclassify" }, - "ReclassifyJobRequest": { + "ReclassifyJobOptions": { "type": "object", "description": "Request payload for reclassifying jobs", "additionalProperties": { @@ -3006,10 +3055,49 @@ ], "x-ms-discriminator-value": "round-robin" }, + "RoundRobinModeCreateOrUpdate": { + "type": "object", + "description": "Jobs are distributed in order to workers, starting with the worker that is\nafter the last worker to receive a job.", + "allOf": [ + { + "$ref": "#/definitions/DistributionModeCreateOrUpdate" + } + ], + "x-ms-discriminator-value": "round-robin" + }, + "RouterChannel": { + "type": "object", + "description": "Represents the capacity a job in this channel will consume from a worker", + "properties": { + "channelId": { + "type": "string", + "description": "Id of the channel." + }, + "capacityCostPerJob": { + "type": "integer", + "format": "int32", + "description": "The amount of capacity that an instance of a job of this channel will consume\nof the total worker capacity." + }, + "maxNumberOfJobs": { + "type": "integer", + "format": "int32", + "description": "The maximum number of jobs that can be supported concurrently for this channel." + } + }, + "required": [ + "channelId", + "capacityCostPerJob" + ] + }, "RouterJob": { "type": "object", "description": "A unit of work to be routed", "properties": { + "etag": { + "$ref": "#/definitions/Azure.Core.eTag", + "description": "Concurrency Token.", + "readOnly": true + }, "id": { "type": "string", "description": "The id of the job.", @@ -3087,11 +3175,12 @@ "additionalProperties": {} }, "notes": { - "type": "object", + "type": "array", "description": "Notes attached to a job, sorted by timestamp", - "additionalProperties": { - "type": "string" - } + "items": { + "$ref": "#/definitions/RouterJobNote" + }, + "x-ms-identifiers": [] }, "scheduledAt": { "type": "string", @@ -3105,6 +3194,7 @@ } }, "required": [ + "etag", "id" ] }, @@ -3189,34 +3279,35 @@ "additionalProperties": {} }, "notes": { - "type": "object", + "type": "array", "description": "Notes attached to a job, sorted by timestamp", - "additionalProperties": { - "type": "string" - } + "items": { + "$ref": "#/definitions/RouterJobNote" + }, + "x-ms-identifiers": [] }, "matchingMode": { - "$ref": "#/definitions/JobMatchingMode", + "$ref": "#/definitions/JobMatchingModeCreateOrUpdate", "description": "The matching mode to be applied to this job.\n \nSupported types:\n \n \nQueueAndMatchMode: Used when matching worker to a job is required to be\ndone right after job is queued.\nScheduleAndSuspendMode: Used for scheduling\njobs to be queued at a future time. At specified time, matching of a worker to\nthe job will not start automatically.\nSuspendMode: Used when matching workers\nto a job needs to be suspended." } } }, - "RouterJobItem": { + "RouterJobNote": { "type": "object", - "description": "Paged instance of RouterJob", + "description": "A note attached to a job.", "properties": { - "job": { - "$ref": "#/definitions/RouterJob", - "description": "A unit of work to be routed" + "message": { + "type": "string", + "description": "The message contained in the note." }, - "etag": { + "addedAt": { "type": "string", - "description": "(Optional) The Concurrency Token." + "format": "date-time", + "description": "The time at which the note was added in UTC. If not provided, will default to the current time." } }, "required": [ - "job", - "etag" + "message" ] }, "RouterJobOffer": { @@ -3377,6 +3468,11 @@ "type": "object", "description": "A queue that can contain jobs to be routed.", "properties": { + "etag": { + "$ref": "#/definitions/Azure.Core.eTag", + "description": "Concurrency Token.", + "readOnly": true + }, "id": { "type": "string", "description": "The Id of this queue", @@ -3401,13 +3497,10 @@ } }, "required": [ + "etag", "id" ] }, - "RouterQueueAssignment": { - "type": "object", - "description": "An assignment of a worker to a queue" - }, "RouterQueueCreateOrUpdate": { "type": "object", "description": "A queue that can contain jobs to be routed.", @@ -3431,24 +3524,6 @@ } } }, - "RouterQueueItem": { - "type": "object", - "description": "Paged instance of RouterQueue", - "properties": { - "queue": { - "$ref": "#/definitions/RouterQueue", - "description": "A queue that can contain jobs to be routed." - }, - "etag": { - "type": "string", - "description": "(Optional) The Concurrency Token." - } - }, - "required": [ - "queue", - "etag" - ] - }, "RouterQueueSelector": { "type": "object", "description": "Describes a condition that must be met against a set of labels for queue\nselection", @@ -3508,7 +3583,7 @@ "properties": { "kind": { "type": "string", - "description": "Discriminator property for RouterRule." + "description": "The type discriminator describing a sub-type of RouterRule" } }, "discriminator": "kind", @@ -3516,10 +3591,26 @@ "kind" ] }, + "RouterRuleCreateOrUpdate": { + "type": "object", + "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol.", + "properties": { + "kind": { + "type": "string", + "description": "The type discriminator describing a sub-type of RouterRule" + } + }, + "discriminator": "kind" + }, "RouterWorker": { "type": "object", "description": "An entity for jobs to be routed to", "properties": { + "etag": { + "$ref": "#/definitions/Azure.Core.eTag", + "description": "Concurrency Token.", + "readOnly": true + }, "id": { "type": "string", "description": "Id of the worker.", @@ -3530,14 +3621,14 @@ "description": "The current state of the worker.", "readOnly": true }, - "queueAssignments": { - "type": "object", + "queues": { + "type": "array", "description": "The queue(s) that this worker can receive work from.", - "additionalProperties": { - "$ref": "#/definitions/RouterQueueAssignment" + "items": { + "type": "string" } }, - "totalCapacity": { + "capacity": { "type": "integer", "format": "int32", "description": "The total capacity score this worker has to manage multiple concurrent jobs." @@ -3552,12 +3643,13 @@ "description": "A set of non-identifying attributes attached to this worker.", "additionalProperties": {} }, - "channelConfigurations": { - "type": "object", + "channels": { + "type": "array", "description": "The channel(s) this worker can handle and their impact on the workers capacity.", - "additionalProperties": { - "$ref": "#/definitions/ChannelConfiguration" - } + "items": { + "$ref": "#/definitions/RouterChannel" + }, + "x-ms-identifiers": [] }, "offers": { "type": "array", @@ -3589,6 +3681,7 @@ } }, "required": [ + "etag", "id" ] }, @@ -3626,14 +3719,14 @@ "type": "object", "description": "An entity for jobs to be routed to", "properties": { - "queueAssignments": { - "type": "object", + "queues": { + "type": "array", "description": "The queue(s) that this worker can receive work from.", - "additionalProperties": { - "$ref": "#/definitions/RouterQueueAssignment" + "items": { + "type": "string" } }, - "totalCapacity": { + "capacity": { "type": "integer", "format": "int32", "description": "The total capacity score this worker has to manage multiple concurrent jobs." @@ -3648,12 +3741,13 @@ "description": "A set of non-identifying attributes attached to this worker.", "additionalProperties": {} }, - "channelConfigurations": { - "type": "object", + "channels": { + "type": "array", "description": "The channel(s) this worker can handle and their impact on the workers capacity.", - "additionalProperties": { - "$ref": "#/definitions/ChannelConfigurationCreateOrUpdate" - } + "items": { + "$ref": "#/definitions/RouterChannel" + }, + "x-ms-identifiers": [] }, "availableForOffers": { "type": "boolean", @@ -3661,24 +3755,6 @@ } } }, - "RouterWorkerItem": { - "type": "object", - "description": "Paged instance of RouterWorker", - "properties": { - "worker": { - "$ref": "#/definitions/RouterWorker", - "description": "An entity for jobs to be routed to" - }, - "etag": { - "type": "string", - "description": "(Optional) The Concurrency Token." - } - }, - "required": [ - "worker", - "etag" - ] - }, "RouterWorkerSelector": { "type": "object", "description": "Describes a condition that must be met against a set of labels for worker\nselection", @@ -3832,6 +3908,23 @@ ], "x-ms-discriminator-value": "schedule-and-suspend" }, + "ScheduleAndSuspendModeCreateOrUpdate": { + "type": "object", + "description": "Describes a matching mode used for scheduling jobs to be queued at a future\ntime.\nAt the specified time, matching worker to a job will not start\nautomatically.", + "properties": { + "scheduleAt": { + "type": "string", + "format": "date-time", + "description": "Scheduled time." + } + }, + "allOf": [ + { + "$ref": "#/definitions/JobMatchingModeCreateOrUpdate" + } + ], + "x-ms-discriminator-value": "schedule-and-suspend" + }, "ScoringRuleOptions": { "type": "object", "description": "Encapsulates all options that can be passed as parameters for scoring rule with\nBestWorkerMode", @@ -3916,6 +4009,21 @@ ], "x-ms-discriminator-value": "static-rule" }, + "StaticRouterRuleCreateOrUpdate": { + "type": "object", + "description": "A rule providing static rules that always return the same result, regardless of\ninput.", + "properties": { + "value": { + "description": "The static value this rule always returns." + } + }, + "allOf": [ + { + "$ref": "#/definitions/RouterRuleCreateOrUpdate" + } + ], + "x-ms-discriminator-value": "static-rule" + }, "StaticWorkerSelectorAttachment": { "type": "object", "description": "Describes a worker selector that will be attached to the job", @@ -3945,7 +4053,17 @@ ], "x-ms-discriminator-value": "suspend" }, - "UnassignJobRequest": { + "SuspendModeCreateOrUpdate": { + "type": "object", + "description": "Describes a matching mode where matching worker to a job is suspended.", + "allOf": [ + { + "$ref": "#/definitions/JobMatchingModeCreateOrUpdate" + } + ], + "x-ms-discriminator-value": "suspend" + }, + "UnassignJobOptions": { "type": "object", "description": "Request payload for unassigning a job.", "properties": { @@ -4020,6 +4138,32 @@ ], "x-ms-discriminator-value": "webhook-rule" }, + "WebhookRouterRuleCreateOrUpdate": { + "type": "object", + "description": "A rule providing a binding to an external web server.", + "properties": { + "authorizationServerUri": { + "type": "string", + "format": "uri", + "description": "Uri for Authorization Server." + }, + "clientCredential": { + "$ref": "#/definitions/Oauth2ClientCredential", + "description": "OAuth2.0 Credentials used to Contoso's Authorization server.\nReference:\nhttps://www.oauth.com/oauth2-servers/access-tokens/client-credentials/" + }, + "webhookUri": { + "type": "string", + "format": "uri", + "description": "Uri for Contoso's Web Server." + } + }, + "allOf": [ + { + "$ref": "#/definitions/RouterRuleCreateOrUpdate" + } + ], + "x-ms-discriminator-value": "webhook-rule" + }, "WeightedAllocationQueueSelectorAttachment": { "type": "object", "description": "Describes multiple sets of queue selectors, of which one will be selected and\nattached according to a weighting", @@ -4072,7 +4216,7 @@ "properties": { "kind": { "type": "string", - "description": "Discriminator property for WorkerSelectorAttachment." + "description": "The type discriminator describing a sub-type of WorkerSelectorAttachment" } }, "discriminator": "kind", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_CreateClassificationPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_CreateClassificationPolicy.json index cbc04cab0fbe..3e055c07523f 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_CreateClassificationPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_CreateClassificationPolicy.json @@ -4,11 +4,11 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "90eb00c4-234e-4df7-a231-ef7895518384", + "classificationPolicyId": "90eb00c4-234e-4df7-a231-ef7895518384", "resource": { "name": "Main", "fallbackQueueId": "MainQueue", - "queueSelectors": [ + "queueSelectorAttachments": [ { "kind": "conditional", "condition": { @@ -37,7 +37,7 @@ "id": "90eb00c4-234e-4df7-a231-ef7895518384", "name": "Main", "fallbackQueueId": "MainQueue", - "queueSelectors": [ + "queueSelectorAttachments": [ { "kind": "conditional", "condition": { @@ -58,7 +58,8 @@ "kind": "static-rule", "value": "2" }, - "workerSelectors": [] + "workerSelectorAttachments": [], + "etag": "etag" } }, "201": { @@ -66,7 +67,7 @@ "id": "90eb00c4-234e-4df7-a231-ef7895518384", "name": "Main", "fallbackQueueId": "MainQueue", - "queueSelectors": [ + "queueSelectorAttachments": [ { "kind": "conditional", "condition": { @@ -87,7 +88,8 @@ "kind": "static-rule", "value": "2" }, - "workerSelectors": [] + "workerSelectorAttachments": [], + "etag": "etag" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_DeleteClassificationPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_DeleteClassificationPolicy.json index b332dd1dfd94..700e0721c14c 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_DeleteClassificationPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_DeleteClassificationPolicy.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "MainClassificationPolicy" + "classificationPolicyId": "MainClassificationPolicy" }, "responses": { "204": {} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_GetClassificationPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_GetClassificationPolicy.json index b0db0bfc86af..2be617609a40 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_GetClassificationPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_GetClassificationPolicy.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "MainClassificationPolicy" + "classificationPolicyId": "MainClassificationPolicy" }, "responses": { "200": { @@ -12,7 +12,7 @@ "id": "MainClassificationPolicy", "name": "Main", "fallbackQueueId": "MainQueue", - "queueSelectors": [ + "queueSelectorAttachments": [ { "kind": "conditional", "condition": { @@ -33,13 +33,14 @@ "kind": "static-rule", "value": "2" }, - "workerSelectors": [ + "workerSelectorAttachments": [ { "kind": "pass-through", "key": "language", "labelOperator": "equal" } - ] + ], + "etag": "etag" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json index dfc005a35353..e0e1c85873a7 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json @@ -11,49 +11,45 @@ "body": { "value": [ { - "classificationPolicy": { - "id": "MainClassificationPolicy", - "name": "Main", - "fallbackQueueId": "MainQueue", - "queueSelectors": [ - { - "kind": "rule-engine", - "rule": { - "kind": "expression-rule", - "language": "powerFx", - "expression": "If(job.Escalated = true, \"SecondaryQueue\", \"MainQueue\")" - } + "id": "MainClassificationPolicy", + "name": "Main", + "fallbackQueueId": "MainQueue", + "queueSelectorAttachments": [ + { + "kind": "rule-engine", + "rule": { + "kind": "expression-rule", + "language": "powerFx", + "expression": "If(job.Escalated = true, \"SecondaryQueue\", \"MainQueue\")" } - ], - "prioritizationRule": { - "kind": "static-rule", - "value": "2" - }, - "workerSelectors": [] + } + ], + "prioritizationRule": { + "kind": "static-rule", + "value": "2" }, + "workerSelectorAttachments": [], "etag": "etag" }, { - "classificationPolicy": { - "id": "SecondaryClassificationPolicy", - "name": "Secondary", - "fallbackQueueId": "MainQueue", - "queueSelectors": [ - { - "kind": "rule-engine", - "rule": { - "kind": "expression-rule", - "language": "powerFx", - "expression": "If(job.VIP = true, \"VIPQueue\", \"MainQueue\")" - } + "id": "SecondaryClassificationPolicy", + "name": "Secondary", + "fallbackQueueId": "MainQueue", + "queueSelectorAttachments": [ + { + "kind": "rule-engine", + "rule": { + "kind": "expression-rule", + "language": "powerFx", + "expression": "If(job.VIP = true, \"VIPQueue\", \"MainQueue\")" } - ], - "prioritizationRule": { - "kind": "static-rule", - "value": "1" - }, - "workerSelectors": [] + } + ], + "prioritizationRule": { + "kind": "static-rule", + "value": "1" }, + "workerSelectorAttachments": [], "etag": "etag" } ] diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_UpdateClassificationPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_UpdateClassificationPolicy.json index a10e1c597471..d4262ff4b312 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_UpdateClassificationPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_UpdateClassificationPolicy.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "90eb00c4-234e-4df7-a231-ef7895518384", + "classificationPolicyId": "90eb00c4-234e-4df7-a231-ef7895518384", "resource": { "name": "MainUpdate" } @@ -15,7 +15,7 @@ "id": "90eb00c4-234e-4df7-a231-ef7895518384", "name": "MainUpdate", "fallbackQueueId": "MainQueue", - "queueSelectors": [ + "queueSelectorAttachments": [ { "kind": "conditional", "condition": { @@ -36,7 +36,8 @@ "kind": "static-rule", "value": "2" }, - "workerSelectors": [] + "workerSelectorAttachments": [], + "etag": "etag" } }, "201": { @@ -44,7 +45,7 @@ "id": "90eb00c4-234e-4df7-a231-ef7895518384", "name": "MainUpdate", "fallbackQueueId": "MainQueue", - "queueSelectors": [ + "queueSelectorAttachments": [ { "kind": "conditional", "condition": { @@ -65,7 +66,8 @@ "kind": "static-rule", "value": "2" }, - "workerSelectors": [] + "workerSelectorAttachments": [], + "etag": "etag" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_CreateDistributionPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_CreateDistributionPolicy.json index 251becb83c1c..58b6cfeccece 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_CreateDistributionPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_CreateDistributionPolicy.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "d9033d56-659c-437a-b5b7-4f3b14301dd4", + "distributionPolicyId": "d9033d56-659c-437a-b5b7-4f3b14301dd4", "resource": { "mode": { "kind": "longest-idle", @@ -27,7 +27,8 @@ "minConcurrentOffers": 1, "maxConcurrentOffers": 5, "bypassSelectors": false - } + }, + "etag": "etag" } }, "201": { @@ -40,7 +41,8 @@ "minConcurrentOffers": 1, "maxConcurrentOffers": 5, "bypassSelectors": false - } + }, + "etag": "etag" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_DeleteDistributionPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_DeleteDistributionPolicy.json index ed4fd7a76ca7..42a35dd35a75 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_DeleteDistributionPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_DeleteDistributionPolicy.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "MainDistributionPolicy" + "distributionPolicyId": "MainDistributionPolicy" }, "responses": { "204": {} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_GetDistributionPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_GetDistributionPolicy.json index 9a9dd0aedd8a..89feafb65308 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_GetDistributionPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_GetDistributionPolicy.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "MainDistributionPolicy" + "distributionPolicyId": "MainDistributionPolicy" }, "responses": { "200": { @@ -17,7 +17,8 @@ "minConcurrentOffers": 1, "maxConcurrentOffers": 5, "bypassSelectors": false - } + }, + "etag": "etag" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json index 750faba99a1d..5b04dc2db344 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json @@ -11,30 +11,26 @@ "body": { "value": [ { - "distributionPolicy": { - "id": "SecondaryDistributionPolicy", - "name": "Secondary", - "offerExpiresAfterSeconds": 300, - "mode": { - "kind": "round-robin", - "minConcurrentOffers": 1, - "maxConcurrentOffers": 2, - "bypassSelectors": false - } + "id": "SecondaryDistributionPolicy", + "name": "Secondary", + "offerExpiresAfterSeconds": 300, + "mode": { + "kind": "round-robin", + "minConcurrentOffers": 1, + "maxConcurrentOffers": 2, + "bypassSelectors": false }, "etag": "etag" }, { - "distributionPolicy": { - "id": "MainDistributionPolicy", - "name": "Main", - "offerExpiresAfterSeconds": 300, - "mode": { - "kind": "longest-idle", - "minConcurrentOffers": 1, - "maxConcurrentOffers": 5, - "bypassSelectors": false - } + "id": "MainDistributionPolicy", + "name": "Main", + "offerExpiresAfterSeconds": 300, + "mode": { + "kind": "longest-idle", + "minConcurrentOffers": 1, + "maxConcurrentOffers": 5, + "bypassSelectors": false }, "etag": "etag" } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_UpdateDistributionPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_UpdateDistributionPolicy.json index 8cd91486e71a..d76872724267 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_UpdateDistributionPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_UpdateDistributionPolicy.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "d9033d56-659c-437a-b5b7-4f3b14301dd4", + "distributionPolicyId": "d9033d56-659c-437a-b5b7-4f3b14301dd4", "resource": { "mode": { "kind": "longest-idle", @@ -27,7 +27,8 @@ "minConcurrentOffers": 1, "maxConcurrentOffers": 5, "bypassSelectors": false - } + }, + "etag": "etag" } }, "201": { @@ -40,7 +41,8 @@ "minConcurrentOffers": 1, "maxConcurrentOffers": 5, "bypassSelectors": false - } + }, + "etag": "etag" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_CreateExceptionPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_CreateExceptionPolicy.json index 0c7a01b854ad..9828085bd849 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_CreateExceptionPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_CreateExceptionPolicy.json @@ -4,26 +4,28 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "cf1cda69-6f41-45ac-b252-213293f1b1cb", + "exceptionPolicyId": "cf1cda69-6f41-45ac-b252-213293f1b1cb", "resource": { "name": "Main", - "exceptionRules": { - "MaxWaitTimeExceeded": { - "actions": { - "MoveJobToEscalatedQueue": { + "exceptionRules": [ + { + "id": "MaxWaitTimeExceeded", + "actions": [ + { + "id": "MoveJobToEscalatedQueue", "kind": "reclassify", "classificationPolicyId": "Main", "labelsToUpsert": { "escalated": true } } - }, + ], "trigger": { "kind": "wait-time", "thresholdSeconds": 20 } } - } + ] } }, "responses": { @@ -31,46 +33,52 @@ "body": { "id": "cf1cda69-6f41-45ac-b252-213293f1b1cb", "name": "Main", - "exceptionRules": { - "MaxWaitTimeExceeded": { + "exceptionRules": [ + { + "id": "MaxWaitTimeExceeded", "trigger": { "kind": "wait-time", "thresholdSeconds": 20 }, - "actions": { - "MoveJobToEscalatedQueue": { + "actions": [ + { + "id": "MoveJobToEscalatedQueue", "kind": "reclassify", "classificationPolicyId": "Main", "labelsToUpsert": { "escalated": true } } - } + ] } - } + ], + "etag": "etag" } }, "201": { "body": { "id": "cf1cda69-6f41-45ac-b252-213293f1b1cb", "name": "Main", - "exceptionRules": { - "MaxWaitTimeExceeded": { + "exceptionRules": [ + { + "id": "MaxWaitTimeExceeded", "trigger": { "kind": "wait-time", "thresholdSeconds": 20 }, - "actions": { - "MoveJobToEscalatedQueue": { + "actions": [ + { + "id": "MoveJobToEscalatedQueue", "kind": "reclassify", "classificationPolicyId": "Main", "labelsToUpsert": { "escalated": true } } - } + ] } - } + ], + "etag": "etag" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_DeleteExceptionPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_DeleteExceptionPolicy.json index 83a2f3ceadbe..c928071cb18b 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_DeleteExceptionPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_DeleteExceptionPolicy.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "MainExceptionPolicy" + "exceptionPolicyId": "MainExceptionPolicy" }, "responses": { "204": {} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_GetExceptionPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_GetExceptionPolicy.json index 97031421924b..5f9b26cb0406 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_GetExceptionPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_GetExceptionPolicy.json @@ -4,30 +4,33 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "MainExceptionPolicy" + "exceptionPolicyId": "MainExceptionPolicy" }, "responses": { "200": { "body": { "id": "MainExceptionPolicy", "name": "Main", - "exceptionRules": { - "MaxWaitTimeExceeded": { + "exceptionRules": [ + { + "id": "MaxWaitTimeExceeded", "trigger": { "kind": "wait-time", "thresholdSeconds": 20 }, - "actions": { - "MoveJobToEscalatedQueue": { + "actions": [ + { + "id": "MoveJobToEscalatedQueue", "kind": "reclassify", "classificationPolicyId": "Main", "labelsToUpsert": { "escalated": true } } - } + ] } - } + ], + "etag": "etag" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json index a549f8154445..0d85556326d5 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json @@ -11,51 +11,51 @@ "body": { "value": [ { - "exceptionPolicy": { - "id": "MainExceptionPolicy", - "name": "Main", - "exceptionRules": { - "MaxWaitTimeExceeded": { - "trigger": { - "kind": "wait-time", - "thresholdSeconds": 20 - }, - "actions": { - "MoveJobToEscalatedQueue": { - "kind": "reclassify", - "classificationPolicyId": "Main", - "labelsToUpsert": { - "escalated": true - } + "id": "MainExceptionPolicy", + "name": "Main", + "exceptionRules": [ + { + "id": "MaxWaitTimeExceeded", + "trigger": { + "kind": "wait-time", + "thresholdSeconds": 20 + }, + "actions": [ + { + "id": "MoveJobToEscalatedQueue", + "kind": "reclassify", + "classificationPolicyId": "Main", + "labelsToUpsert": { + "escalated": true } } - } + ] } - }, + ], "etag": "etag" }, { - "exceptionPolicy": { - "id": "SecondaryExceptionPolicy", - "name": "Secondary", - "exceptionRules": { - "MaxWaitTimeExceeded": { - "trigger": { - "kind": "wait-time", - "thresholdSeconds": 50 - }, - "actions": { - "MoveJobToVIPQueue": { - "kind": "reclassify", - "classificationPolicyId": "Main", - "labelsToUpsert": { - "VIP": true - } + "id": "SecondaryExceptionPolicy", + "name": "Secondary", + "exceptionRules": [ + { + "id": "MaxWaitTimeExceeded", + "trigger": { + "kind": "wait-time", + "thresholdSeconds": 50 + }, + "actions": [ + { + "id": "MoveJobToVIPQueue", + "kind": "reclassify", + "classificationPolicyId": "Main", + "labelsToUpsert": { + "VIP": true } } - } + ] } - }, + ], "etag": "etag" } ] diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_UpdateExceptionPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_UpdateExceptionPolicy.json index fc874e46783f..858efc302511 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_UpdateExceptionPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_UpdateExceptionPolicy.json @@ -4,26 +4,28 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "cf1cda69-6f41-45ac-b252-213293f1b1cb", + "exceptionPolicyId": "cf1cda69-6f41-45ac-b252-213293f1b1cb", "resource": { "name": "Main test", - "exceptionRules": { - "MaxWaitTimeExceeded": { - "actions": { - "MoveJobToEscalatedQueue": { + "exceptionRules": [ + { + "id": "MaxWaitTimeExceeded", + "actions": [ + { + "id": "MoveJobToEscalatedQueue", "kind": "reclassify", "classificationPolicyId": "Main", "labelsToUpsert": { "escalated": true } } - }, + ], "trigger": { "kind": "wait-time", "thresholdSeconds": 20 } } - } + ] } }, "responses": { @@ -31,46 +33,52 @@ "body": { "id": "cf1cda69-6f41-45ac-b252-213293f1b1cb", "name": "Main test", - "exceptionRules": { - "MaxWaitTimeExceeded": { + "exceptionRules": [ + { + "id": "MaxWaitTimeExceeded", "trigger": { "kind": "wait-time", "thresholdSeconds": 20 }, - "actions": { - "MoveJobToEscalatedQueue": { + "actions": [ + { + "id": "MoveJobToEscalatedQueue", "kind": "reclassify", "classificationPolicyId": "Main", "labelsToUpsert": { "escalated": true } } - } + ] } - } + ], + "etag": "etag" } }, "201": { "body": { "id": "cf1cda69-6f41-45ac-b252-213293f1b1cb", "name": "Main test", - "exceptionRules": { - "MaxWaitTimeExceeded": { + "exceptionRules": [ + { + "id": "MaxWaitTimeExceeded", "trigger": { "kind": "wait-time", "thresholdSeconds": 20 }, - "actions": { - "MoveJobToEscalatedQueue": { + "actions": [ + { + "id": "MoveJobToEscalatedQueue", "kind": "reclassify", "classificationPolicyId": "Main", "labelsToUpsert": { "escalated": true } } - } + ] } - } + ], + "etag": "etag" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json index f54efb2382db..616d59972955 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json @@ -4,8 +4,8 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "8780b28c-7079-4de1-9143-4d369289e958", - "closeJobRequest": { + "jobId": "8780b28c-7079-4de1-9143-4d369289e958", + "closeJobOptions": { "assignmentId": "1d5896f3-8b54-40be-82d3-910323f5e2af", "dispositionCode": "JobCompleted.", "note": "Closing job" diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CompleteJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CompleteJob.json index a07b88617993..534c4056a3bb 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CompleteJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CompleteJob.json @@ -4,8 +4,8 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "8780b28c-7079-4de1-9143-4d369289e958", - "completeJobRequest": { + "jobId": "8780b28c-7079-4de1-9143-4d369289e958", + "completeJobOptions": { "assignmentId": "1d5896f3-8b54-40be-82d3-910323f5e2af", "note": "Completing job" } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateJob.json index 000f33eda73c..6b842747e1ca 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateJob.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "JobId", + "jobId": "JobId", "resource": { "channelId": "CustomChatChannel", "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", @@ -49,13 +49,14 @@ "attachedWorkerSelectors": [], "labels": {}, "assignments": {}, - "notes": {}, + "notes": [], "matchingMode": { "modeType": "queueAndMatchMode", "queueAndMatchMode": {}, "scheduleAndSuspendMode": null, "suspendMode": null - } + }, + "etag": "etag" } }, "201": { @@ -80,13 +81,14 @@ "attachedWorkerSelectors": [], "labels": {}, "assignments": {}, - "notes": {}, + "notes": [], "matchingMode": { "modeType": "queueAndMatchMode", "queueAndMatchMode": {}, "scheduleAndSuspendMode": null, "suspendMode": null - } + }, + "etag": "etag" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateScheduledJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateScheduledJob.json index 95212a18d5a9..4cf970e7b023 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateScheduledJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateScheduledJob.json @@ -60,7 +60,8 @@ }, "suspendMode": null }, - "scheduledAt": null + "scheduledAt": null, + "etag": "etag" } }, "201": { @@ -94,7 +95,8 @@ }, "suspendMode": null }, - "scheduledAt": null + "scheduledAt": null, + "etag": "etag" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJob.json index ddc0328f620d..253c7ad5d4b4 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJob.json @@ -35,7 +35,8 @@ "queueAndMatchMode": {}, "scheduleAndSuspendMode": null, "suspendMode": null - } + }, + "etag": "etag" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_ReclassifyJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_ReclassifyJob.json index 6bb9cdc04a5a..706b69b44f1d 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_ReclassifyJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_ReclassifyJob.json @@ -4,8 +4,8 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "8780b28c-7079-4de1-9143-4d369289e958", - "reclassifyJobRequest": {} + "jobId": "8780b28c-7079-4de1-9143-4d369289e958", + "reclassifyJobOptions": {} }, "responses": { "200": { diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_RequestJobCancel.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_RequestJobCancel.json index d0ddfd51c0dd..3660808d52b3 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_RequestJobCancel.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_RequestJobCancel.json @@ -4,8 +4,8 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "8780b28c-7079-4de1-9143-4d369289e958", - "cancelJobRequest": { + "jobId": "8780b28c-7079-4de1-9143-4d369289e958", + "cancelJobOptions": { "note": "User hung up while waiting in queue.", "dispositionCode": "Disconnected" } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UnassignJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UnassignJob.json index a3a4e4904d78..21a2d4200bc2 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UnassignJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UnassignJob.json @@ -4,9 +4,9 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "8780b28c-7079-4de1-9143-4d369289e958", + "jobId": "8780b28c-7079-4de1-9143-4d369289e958", "assignmentId": "1d5896f3-8b54-40be-82d3-910323f5e2af", - "unassignJobRequest": { + "unassignJobOptions": { "suspendMatching": false } }, diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UpdateJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UpdateJob.json index 684269f7901c..f212a545b84e 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UpdateJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UpdateJob.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "8780b28c-7079-4de1-9143-4d369289e958", + "jobId": "8780b28c-7079-4de1-9143-4d369289e958", "resource": { "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af" } @@ -38,7 +38,8 @@ "queueAndMatchMode": {}, "scheduleAndSuspendMode": null, "suspendMode": null - } + }, + "etag": "etag" } }, "201": { @@ -69,7 +70,8 @@ "queueAndMatchMode": {}, "scheduleAndSuspendMode": null, "suspendMode": null - } + }, + "etag": "etag" } } } From f0a92ff032cc854a6368356e28e14fe736b6c9b4 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Mon, 23 Oct 2023 16:15:24 -0700 Subject: [PATCH 050/113] more review feedback items --- .../communication/Communication.JobRouter/models.tsp | 6 +++--- .../stable/2023-11-01/communicationservicejobrouter.json | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index e60d051ed58f..4ff796359e9d 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -931,7 +931,7 @@ and the parameter name for the worker labels will be sent as `worker`. Note: If enabled, use BatchSize to set batch size. """) - allowScoringBatchOfWorkers?: boolean; + isBatchScoringEnabled?: boolean; @doc(""" (Optional) @@ -1145,7 +1145,7 @@ OAuth2.0 Credentials used to Contoso's Authorization server. Reference: https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/ """) -model Oauth2ClientCredential { +model OAuth2WebhookClientCredential { @doc("ClientId for Contoso Authorization server.") clientId?: string; @@ -1338,7 +1338,7 @@ OAuth2.0 Credentials used to Contoso's Authorization server. Reference: https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/ """) - clientCredential?: Oauth2ClientCredential; + clientCredential?: OAuth2WebhookClientCredential; @doc("Uri for Contoso's Web Server.") webhookUri?: url; diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index b54c9e085904..11e0c6cc7850 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -2753,7 +2753,7 @@ ], "x-ms-discriminator-value": "manual-reclassify" }, - "Oauth2ClientCredential": { + "OAuth2WebhookClientCredential": { "type": "object", "description": "OAuth2.0 Credentials used to Contoso's Authorization server.\nReference:\nhttps://www.oauth.com/oauth2-servers/access-tokens/client-credentials/", "properties": { @@ -3941,7 +3941,7 @@ "$ref": "#/definitions/ScoringRuleParameterSelector" } }, - "allowScoringBatchOfWorkers": { + "isBatchScoringEnabled": { "type": "boolean", "description": "(Optional)\nIf set to true, will score workers in batches, and the parameter\nname of the worker labels will be sent as `workers`.\nBy default, set to false\nand the parameter name for the worker labels will be sent as `worker`.\nNote: If\nenabled, use BatchSize to set batch size." }, @@ -4122,7 +4122,7 @@ "description": "Uri for Authorization Server." }, "clientCredential": { - "$ref": "#/definitions/Oauth2ClientCredential", + "$ref": "#/definitions/OAuth2WebhookClientCredential", "description": "OAuth2.0 Credentials used to Contoso's Authorization server.\nReference:\nhttps://www.oauth.com/oauth2-servers/access-tokens/client-credentials/" }, "webhookUri": { @@ -4148,7 +4148,7 @@ "description": "Uri for Authorization Server." }, "clientCredential": { - "$ref": "#/definitions/Oauth2ClientCredential", + "$ref": "#/definitions/OAuth2WebhookClientCredential", "description": "OAuth2.0 Credentials used to Contoso's Authorization server.\nReference:\nhttps://www.oauth.com/oauth2-servers/access-tokens/client-credentials/" }, "webhookUri": { From 52e20b536e60e20da5e45e9985fbe6f86d36ad01 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 24 Oct 2023 13:41:03 -0700 Subject: [PATCH 051/113] update examples --- ...ceptionPolicies_CreateExceptionPolicy.json | 5 +- .../ExceptionPolicies_GetExceptionPolicy.json | 2 +- ...ceptionPolicies_UpdateExceptionPolicy.json | 5 +- .../examples/2023-11-01/Jobs_CreateJob.json | 15 +--- .../2023-11-01/Jobs_CreateScheduledJob.json | 30 ++----- .../examples/2023-11-01/Jobs_DeleteJob.json | 2 +- .../2023-11-01/Jobs_GetInQueuePosition.json | 2 +- .../examples/2023-11-01/Jobs_GetJob.json | 9 +- .../2023-11-01/Jobs_GetJobsWithPageSize.json | 66 ++++++-------- .../examples/2023-11-01/Jobs_UpdateJob.json | 14 +-- .../2023-11-01/Queues_CreateQueue.json | 8 +- .../2023-11-01/Queues_DeleteQueue.json | 2 +- .../examples/2023-11-01/Queues_GetQueue.json | 5 +- .../2023-11-01/Queues_GetQueueStatistics.json | 2 +- .../2023-11-01/Queues_UpdateQueue.json | 8 +- .../2023-11-01/Workers_CreateWorker.json | 55 ++++++------ .../Workers_DeregisterActiveWorker.json | 40 +++++---- .../Workers_DeregisterInactiveWorker.json | 40 +++++---- .../Workers_GetAvailableWorkersByChannel.json | 90 +++++++++---------- .../2023-11-01/Workers_GetWorker.json | 20 ++--- .../Workers_GetWorkersWithPageSize.json | 90 +++++++++---------- .../2023-11-01/Workers_RegisterWorker.json | 40 +++++---- .../2023-11-01/Workers_UpdateWorker.json | 55 ++++++------ .../Communication.JobRouter/routes.tsp | 28 +++--- .../communicationservicejobrouter.json | 28 +++--- ...ceptionPolicies_CreateExceptionPolicy.json | 5 +- .../ExceptionPolicies_GetExceptionPolicy.json | 2 +- ...ceptionPolicies_UpdateExceptionPolicy.json | 5 +- .../2023-11-01/examples/Jobs_CreateJob.json | 15 +--- .../examples/Jobs_CreateScheduledJob.json | 30 ++----- .../2023-11-01/examples/Jobs_DeleteJob.json | 2 +- .../examples/Jobs_GetInQueuePosition.json | 2 +- .../2023-11-01/examples/Jobs_GetJob.json | 9 +- .../examples/Jobs_GetJobsWithPageSize.json | 66 ++++++-------- .../2023-11-01/examples/Jobs_UpdateJob.json | 14 +-- .../examples/Queues_CreateQueue.json | 8 +- .../examples/Queues_DeleteQueue.json | 2 +- .../2023-11-01/examples/Queues_GetQueue.json | 5 +- .../examples/Queues_GetQueueStatistics.json | 2 +- .../examples/Queues_UpdateQueue.json | 8 +- .../examples/Workers_CreateWorker.json | 55 ++++++------ .../Workers_DeregisterActiveWorker.json | 40 +++++---- .../Workers_DeregisterInactiveWorker.json | 40 +++++---- .../Workers_GetAvailableWorkersByChannel.json | 90 +++++++++---------- .../examples/Workers_GetWorker.json | 20 ++--- .../Workers_GetWorkersWithPageSize.json | 90 +++++++++---------- .../examples/Workers_RegisterWorker.json | 40 +++++---- .../examples/Workers_UpdateWorker.json | 55 ++++++------ 48 files changed, 592 insertions(+), 674 deletions(-) diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_CreateExceptionPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_CreateExceptionPolicy.json index 9828085bd849..7997e360b8fb 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_CreateExceptionPolicy.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_CreateExceptionPolicy.json @@ -12,7 +12,6 @@ "id": "MaxWaitTimeExceeded", "actions": [ { - "id": "MoveJobToEscalatedQueue", "kind": "reclassify", "classificationPolicyId": "Main", "labelsToUpsert": { @@ -42,7 +41,7 @@ }, "actions": [ { - "id": "MoveJobToEscalatedQueue", + "id": "babd4f6f-916e-4e91-9c89-e0bb05a2c425", "kind": "reclassify", "classificationPolicyId": "Main", "labelsToUpsert": { @@ -68,7 +67,7 @@ }, "actions": [ { - "id": "MoveJobToEscalatedQueue", + "id": "babd4f6f-916e-4e91-9c89-e0bb05a2c425", "kind": "reclassify", "classificationPolicyId": "Main", "labelsToUpsert": { diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_GetExceptionPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_GetExceptionPolicy.json index 5f9b26cb0406..ccded0284a33 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_GetExceptionPolicy.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_GetExceptionPolicy.json @@ -20,7 +20,7 @@ }, "actions": [ { - "id": "MoveJobToEscalatedQueue", + "id": "babd4f6f-916e-4e91-9c89-e0bb05a2c425", "kind": "reclassify", "classificationPolicyId": "Main", "labelsToUpsert": { diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_UpdateExceptionPolicy.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_UpdateExceptionPolicy.json index 858efc302511..fb0d6dad5f04 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_UpdateExceptionPolicy.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_UpdateExceptionPolicy.json @@ -12,7 +12,6 @@ "id": "MaxWaitTimeExceeded", "actions": [ { - "id": "MoveJobToEscalatedQueue", "kind": "reclassify", "classificationPolicyId": "Main", "labelsToUpsert": { @@ -42,7 +41,7 @@ }, "actions": [ { - "id": "MoveJobToEscalatedQueue", + "id": "babd4f6f-916e-4e91-9c89-e0bb05a2c425", "kind": "reclassify", "classificationPolicyId": "Main", "labelsToUpsert": { @@ -68,7 +67,7 @@ }, "actions": [ { - "id": "MoveJobToEscalatedQueue", + "id": "babd4f6f-916e-4e91-9c89-e0bb05a2c425", "kind": "reclassify", "classificationPolicyId": "Main", "labelsToUpsert": { diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateJob.json index 6b842747e1ca..5310ef73e711 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateJob.json @@ -19,10 +19,7 @@ ], "labels": {}, "matchingMode": { - "modeType": "queueAndMatchMode", - "queueAndMatchMode": {}, - "scheduleAndSuspendMode": null, - "suspendMode": null + "kind": "queue-and-match" } } }, @@ -51,10 +48,7 @@ "assignments": {}, "notes": [], "matchingMode": { - "modeType": "queueAndMatchMode", - "queueAndMatchMode": {}, - "scheduleAndSuspendMode": null, - "suspendMode": null + "kind": "queue-and-match" }, "etag": "etag" } @@ -83,10 +77,7 @@ "assignments": {}, "notes": [], "matchingMode": { - "modeType": "queueAndMatchMode", - "queueAndMatchMode": {}, - "scheduleAndSuspendMode": null, - "suspendMode": null + "kind": "queue-and-match" }, "etag": "etag" } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateScheduledJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateScheduledJob.json index 4cf970e7b023..6ddbfe01e07a 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateScheduledJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CreateScheduledJob.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "JobId", + "jobId": "JobId", "resource": { "channelId": "CustomChatChannel", "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", @@ -19,12 +19,8 @@ ], "labels": {}, "matchingMode": { - "modeType": "scheduleAndSuspendMode", - "queueAndMatchMode": null, - "scheduleAndSuspendMode": { - "scheduleAt": "2023-05-26T23:22:12.0774222+00:00" - }, - "suspendMode": null + "kind": "schedule-and-suspend", + "scheduleAt": "2023-05-26T23:22:12.0774222+00:00" } } }, @@ -51,14 +47,10 @@ "attachedWorkerSelectors": [], "labels": {}, "assignments": {}, - "notes": {}, + "notes": [], "matchingMode": { - "modeType": "scheduleAndSuspendMode", - "queueAndMatchMode": null, - "scheduleAndSuspendMode": { - "scheduleAt": "2023-05-26T23:22:12.0774222+00:00" - }, - "suspendMode": null + "kind": "schedule-and-suspend", + "scheduleAt": "2023-05-26T23:22:12.0774222+00:00" }, "scheduledAt": null, "etag": "etag" @@ -86,14 +78,10 @@ "attachedWorkerSelectors": [], "labels": {}, "assignments": {}, - "notes": {}, + "notes": [], "matchingMode": { - "modeType": "scheduleAndSuspendMode", - "queueAndMatchMode": null, - "scheduleAndSuspendMode": { - "scheduleAt": "2023-05-26T23:22:12.0774222+00:00" - }, - "suspendMode": null + "kind": "schedule-and-suspend", + "scheduleAt": "2023-05-26T23:22:12.0774222+00:00" }, "scheduledAt": null, "etag": "etag" diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_DeleteJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_DeleteJob.json index 0a51428e1b83..829b06994866 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_DeleteJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_DeleteJob.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "8780b28c-7079-4de1-9143-4d369289e958" + "jobId": "8780b28c-7079-4de1-9143-4d369289e958" }, "responses": { "204": {} diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetInQueuePosition.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetInQueuePosition.json index 8756de32109b..103c42f5fb51 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetInQueuePosition.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetInQueuePosition.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "8780b28c-7079-4de1-9143-4d369289e958" + "jobId": "8780b28c-7079-4de1-9143-4d369289e958" }, "responses": { "200": { diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJob.json index 253c7ad5d4b4..4ad6f5a6b214 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJob.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "8780b28c-7079-4de1-9143-4d369289e958" + "jobId": "8780b28c-7079-4de1-9143-4d369289e958" }, "responses": { "200": { @@ -29,12 +29,9 @@ "attachedWorkerSelectors": [], "labels": {}, "assignments": {}, - "notes": {}, + "notes": [], "matchingMode": { - "modeType": "queueAndMatchMode", - "queueAndMatchMode": {}, - "scheduleAndSuspendMode": null, - "suspendMode": null + "kind": "queue-and-match" }, "etag": "etag" } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJobsWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJobsWithPageSize.json index 0a99fa84001a..06127640cb76 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJobsWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJobsWithPageSize.json @@ -14,48 +14,38 @@ "body": { "value": [ { - "job": { - "id": "383541b3-5637-4af6-8aac-3391da8a578a", - "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", - "status": "queued", - "enqueuedAt": "2021-09-30T23:56:21.883322+00:00", - "channelId": "CustomChatChannel", - "classificationPolicyId": null, - "queueId": "MainQueue", - "priority": 5, - "dispositionCode": null, - "labels": {}, - "assignments": {}, - "notes": {}, - "matchingMode": { - "modeType": "queueAndMatchMode", - "queueAndMatchMode": {}, - "scheduleAndSuspendMode": null, - "suspendMode": null - } + "id": "383541b3-5637-4af6-8aac-3391da8a578a", + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "status": "queued", + "enqueuedAt": "2021-09-30T23:56:21.883322+00:00", + "channelId": "CustomChatChannel", + "classificationPolicyId": null, + "queueId": "MainQueue", + "priority": 5, + "dispositionCode": null, + "labels": {}, + "assignments": {}, + "notes": [], + "matchingMode": { + "kind": "queue-and-match" }, "etag": "etag" }, { - "job": { - "id": "c571dd84-1ca7-4606-a77a-f38d9e4ae513", - "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", - "status": "queued", - "enqueuedAt": "2021-09-30T23:57:54.041179+00:00", - "channelId": "CustomChatChannel2", - "classificationPolicyId": null, - "queueId": "MainQueue", - "priority": 5, - "dispositionCode": null, - "labels": {}, - "assignments": {}, - "notes": {}, - "matchingMode": { - "modeType": "queueAndMatchMode", - "queueAndMatchMode": {}, - "scheduleAndSuspendMode": null, - "suspendMode": null - } + "id": "c571dd84-1ca7-4606-a77a-f38d9e4ae513", + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "status": "queued", + "enqueuedAt": "2021-09-30T23:57:54.041179+00:00", + "channelId": "CustomChatChannel2", + "classificationPolicyId": null, + "queueId": "MainQueue", + "priority": 5, + "dispositionCode": null, + "labels": {}, + "assignments": {}, + "notes": [], + "matchingMode": { + "kind": "queue-and-match" }, "etag": "etag" } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UpdateJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UpdateJob.json index f212a545b84e..4bd9051afd46 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UpdateJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UpdateJob.json @@ -32,12 +32,9 @@ "attachedWorkerSelectors": [], "labels": {}, "assignments": {}, - "notes": {}, + "notes": [], "matchingMode": { - "modeType": "queueAndMatchMode", - "queueAndMatchMode": {}, - "scheduleAndSuspendMode": null, - "suspendMode": null + "kind": "queue-and-match" }, "etag": "etag" } @@ -64,12 +61,9 @@ "attachedWorkerSelectors": [], "labels": {}, "assignments": {}, - "notes": {}, + "notes": [], "matchingMode": { - "modeType": "queueAndMatchMode", - "queueAndMatchMode": {}, - "scheduleAndSuspendMode": null, - "suspendMode": null + "kind": "queue-and-match" }, "etag": "etag" } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_CreateQueue.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_CreateQueue.json index c5330d1a1e3a..9aa2ec3b2d2c 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_CreateQueue.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_CreateQueue.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "QueueId", + "queueId": "QueueId", "resource": { "distributionPolicyId": "MainDistributionPolicy", "name": "Main", @@ -19,7 +19,8 @@ "name": "Main", "distributionPolicyId": "MainDistributionPolicy", "labels": {}, - "exceptionPolicyId": "MainExceptionPolicy" + "exceptionPolicyId": "MainExceptionPolicy", + "etag": "etag" } }, "201": { @@ -28,7 +29,8 @@ "name": "Main", "distributionPolicyId": "MainDistributionPolicy", "labels": {}, - "exceptionPolicyId": "MainExceptionPolicy" + "exceptionPolicyId": "MainExceptionPolicy", + "etag": "etag" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_DeleteQueue.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_DeleteQueue.json index 527bfc15af8f..d61c03d194bc 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_DeleteQueue.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_DeleteQueue.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "MainQueue" + "queueId": "MainQueue" }, "responses": { "204": {} diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_GetQueue.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_GetQueue.json index 4ffb4670596a..224c791a70cb 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_GetQueue.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_GetQueue.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "MainQueue" + "queueId": "MainQueue" }, "responses": { "200": { @@ -13,7 +13,8 @@ "name": "Main", "distributionPolicyId": "MainDistributionPolicy", "labels": {}, - "exceptionPolicyId": "MainExceptionPolicy" + "exceptionPolicyId": "MainExceptionPolicy", + "etag": "etag" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_GetQueueStatistics.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_GetQueueStatistics.json index 1c5a914ac62f..72e23ae6ccfc 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_GetQueueStatistics.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_GetQueueStatistics.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "MainQueue" + "queueId": "MainQueue" }, "responses": { "200": { diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_UpdateQueue.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_UpdateQueue.json index b3162f4be126..99ebf8a3d5c9 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_UpdateQueue.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_UpdateQueue.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "MainQueue", + "queueId": "MainQueue", "resource": { "distributionPolicyId": "MainDistributionPolicy", "name": "Main" @@ -17,7 +17,8 @@ "name": "Main", "distributionPolicyId": "MainDistributionPolicy", "labels": {}, - "exceptionPolicyId": "MainExceptionPolicy" + "exceptionPolicyId": "MainExceptionPolicy", + "etag": "etag" } }, "201": { @@ -26,7 +27,8 @@ "name": "Main", "distributionPolicyId": "MainDistributionPolicy", "labels": {}, - "exceptionPolicyId": "MainExceptionPolicy" + "exceptionPolicyId": "MainExceptionPolicy", + "etag": "etag" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_CreateWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_CreateWorker.json index 5309f9796ea0..005ee8aae10d 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_CreateWorker.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_CreateWorker.json @@ -6,23 +6,22 @@ "api-version": "2023-11-01", "workerId": "WorkerId", "resource": { - "totalCapacity": 10, - "queueAssignments": { - "MainQueue": {}, - "SecondaryQueue": null - }, + "capacity": 10, + "queues": ["MainQueue"], "labels": {}, "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { + "channels": [ + { + "channelId": "CustomChatChannel", "capacityCostPerJob": 11, "maxNumberOfJobs": 4 }, - "CustomVoiceChannel": { + { + "channelId": "CustomVoiceChannel", "capacityCostPerJob": 10, "maxNumberOfJobs": 1 } - }, + ], "availableForOffers": false } }, @@ -31,52 +30,54 @@ "body": { "id": "WorkerId", "state": "inactive", - "queueAssignments": { - "MainQueue": {} - }, - "totalCapacity": 10, + "queues": ["MainQueue"], + "capacity": 10, "labels": {}, "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { + "channels": [ + { + "channelId": "CustomChatChannel", "capacityCostPerJob": 11, "maxNumberOfJobs": 4 }, - "CustomVoiceChannel": { + { + "channelId": "CustomVoiceChannel", "capacityCostPerJob": 10, "maxNumberOfJobs": 1 } - }, + ], "offers": [], "assignedJobs": [], "loadRatio": 0, - "availableForOffers": false + "availableForOffers": false, + "etag": "etag" } }, "201": { "body": { "id": "WorkerId", "state": "inactive", - "queueAssignments": { - "MainQueue": {} - }, - "totalCapacity": 10, + "queues": ["MainQueue"], + "capacity": 10, "labels": {}, "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { + "channels": [ + { + "channelId": "CustomChatChannel", "capacityCostPerJob": 11, "maxNumberOfJobs": 4 }, - "CustomVoiceChannel": { + { + "channelId": "CustomVoiceChannel", "capacityCostPerJob": 10, "maxNumberOfJobs": 1 } - }, + ], "offers": [], "assignedJobs": [], "loadRatio": 0, - "availableForOffers": false + "availableForOffers": false, + "etag": "etag" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterActiveWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterActiveWorker.json index f5147634e20d..0651e3fb0ddf 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterActiveWorker.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterActiveWorker.json @@ -7,7 +7,7 @@ "workerId": "WorkerId", "resource": { "availableForOffers": false, - "totalCapacity": 10 + "capacity": 10 } }, "responses": { @@ -15,52 +15,54 @@ "body": { "id": "WorkerId", "state": "draining", - "queueAssignments": { - "MainQueue": {} - }, - "totalCapacity": 10, + "queues": ["MainQueue"], + "capacity": 10, "labels": {}, "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { + "channels": [ + { + "channelId": "CustomChatChannel", "capacityCostPerJob": 11, "maxNumberOfJobs": 4 }, - "CustomVoiceChannel": { + { + "channelId": "CustomVoiceChannel", "capacityCostPerJob": 10, "maxNumberOfJobs": 1 } - }, + ], "offers": [], "assignedJobs": [], "loadRatio": 0, - "availableForOffers": false + "availableForOffers": false, + "etag": "etag" } }, "201": { "body": { "id": "WorkerId", "state": "draining", - "queueAssignments": { - "MainQueue": {} - }, - "totalCapacity": 10, + "queues": ["MainQueue"], + "capacity": 10, "labels": {}, "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { + "channels": [ + { + "channelId": "CustomChatChannel", "capacityCostPerJob": 11, "maxNumberOfJobs": 4 }, - "CustomVoiceChannel": { + { + "channelId": "CustomVoiceChannel", "capacityCostPerJob": 10, "maxNumberOfJobs": 1 } - }, + ], "offers": [], "assignedJobs": [], "loadRatio": 0, - "availableForOffers": false + "availableForOffers": false, + "etag": "etag" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterInactiveWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterInactiveWorker.json index 934647c11074..e24d352dc48f 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterInactiveWorker.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterInactiveWorker.json @@ -7,7 +7,7 @@ "workerId": "WorkerId", "resource": { "availableForOffers": false, - "totalCapacity": 10 + "capacity": 10 } }, "responses": { @@ -15,52 +15,54 @@ "body": { "id": "WorkerId", "state": "inactive", - "queueAssignments": { - "MainQueue": {} - }, - "totalCapacity": 10, + "queues": ["MainQueue"], + "capacity": 10, "labels": {}, "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { + "channels": [ + { + "channelId": "CustomChatChannel", "capacityCostPerJob": 11, "maxNumberOfJobs": 4 }, - "CustomVoiceChannel": { + { + "channelId": "CustomVoiceChannel", "capacityCostPerJob": 10, "maxNumberOfJobs": 1 } - }, + ], "offers": [], "assignedJobs": [], "loadRatio": 0, - "availableForOffers": false + "availableForOffers": false, + "etag": "etag" } }, "201": { "body": { "id": "WorkerId", "state": "inactive", - "queueAssignments": { - "MainQueue": {} - }, - "totalCapacity": 10, + "queues": ["MainQueue"], + "capacity": 10, "labels": {}, "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { + "channels": [ + { + "channelId": "CustomChatChannel", "capacityCostPerJob": 11, "maxNumberOfJobs": 4 }, - "CustomVoiceChannel": { + { + "channelId": "CustomVoiceChannel", "capacityCostPerJob": 10, "maxNumberOfJobs": 1 } - }, + ], "offers": [], "assignedJobs": [], "loadRatio": 0, - "availableForOffers": false + "availableForOffers": false, + "etag": "etag" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json index cfd66c766787..920dd65bf3a1 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json @@ -13,59 +13,53 @@ "body": { "value": [ { - "worker": { - "id": "DefaultWorker", - "state": "active", - "queueAssignments": { - "MainQueue": {}, - "SecondaryQueue": {} + "id": "DefaultWorker", + "state": "active", + "queues": ["MainQueue", "SecondaryQueue"], + "capacity": 100, + "labels": {}, + "tags": {}, + "channels": [ + { + "channelId": "CustomChatChannel", + "capacityCostPerJob": 10, + "maxNumberOfJobs": 4 }, - "totalCapacity": 100, - "labels": {}, - "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { - "capacityCostPerJob": 10, - "maxNumberOfJobs": 4 - }, - "CustomVoiceChannel": { - "capacityCostPerJob": 100, - "maxNumberOfJobs": 1 - } - }, - "offers": [], - "assignedJobs": [], - "loadRatio": 0, - "availableForOffers": true - }, + { + "channelId": "CustomVoiceChannel", + "capacityCostPerJob": 100, + "maxNumberOfJobs": 1 + } + ], + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": true, "etag": "etag" }, { - "worker": { - "id": "SecondWorker", - "state": "active", - "queueAssignments": { - "MainQueue": {}, - "SecondaryQueue": {} - }, - "totalCapacity": 100, - "labels": {}, - "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { - "capacityCostPerJob": 10, - "maxNumberOfJobs": 4 - }, - "CustomVoiceChannel": { - "capacityCostPerJob": 100, - "maxNumberOfJobs": 1 - } + "id": "SecondWorker", + "state": "active", + "queues": ["MainQueue", "SecondaryQueue"], + "capacity": 100, + "labels": {}, + "tags": {}, + "channels": [ + { + "channelId": "CustomChatChannel", + "capacityCostPerJob": 10, + "maxNumberOfJobs": 4 }, - "offers": [], - "assignedJobs": [], - "loadRatio": 0, - "availableForOffers": true - }, + { + "channelId": "CustomVoiceChannel", + "capacityCostPerJob": 100, + "maxNumberOfJobs": 1 + } + ], + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": true, "etag": "etag" } ], diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorker.json index 807e63483e9d..684d0b07499d 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorker.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorker.json @@ -11,27 +11,27 @@ "body": { "id": "DefaultWorker", "state": "active", - "queueAssignments": { - "MainQueue": {}, - "SecondaryQueue": {} - }, - "totalCapacity": 100, + "queues": ["MainQueue", "SecondaryQueue"], + "capacity": 100, "labels": {}, "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { + "channels": [ + { + "channelId": "CustomChatChannel", "capacityCostPerJob": 10, "maxNumberOfJobs": 4 }, - "CustomVoiceChannel": { + { + "channelId": "CustomVoiceChannel", "capacityCostPerJob": 100, "maxNumberOfJobs": 1 } - }, + ], "offers": [], "assignedJobs": [], "loadRatio": 0, - "availableForOffers": true + "availableForOffers": true, + "etag": "etag" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json index b70a11228ef0..1e92a100b14b 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json @@ -11,59 +11,53 @@ "body": { "value": [ { - "worker": { - "id": "DefaultWorker", - "state": "active", - "queueAssignments": { - "MainQueue": {}, - "SecondaryQueue": {} + "id": "DefaultWorker", + "state": "active", + "queues": ["MainQueue", "SecondaryQueue"], + "capacity": 100, + "labels": {}, + "tags": {}, + "channels": [ + { + "channelId": "CustomChatChannel", + "capacityCostPerJob": 10, + "maxNumberOfJobs": 4 }, - "totalCapacity": 100, - "labels": {}, - "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { - "capacityCostPerJob": 10, - "maxNumberOfJobs": 4 - }, - "CustomVoiceChannel": { - "capacityCostPerJob": 100, - "maxNumberOfJobs": 1 - } - }, - "offers": [], - "assignedJobs": [], - "loadRatio": 0, - "availableForOffers": true - }, + { + "channelId": "CustomVoiceChannel", + "capacityCostPerJob": 100, + "maxNumberOfJobs": 1 + } + ], + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": true, "etag": "etag" }, { - "worker": { - "id": "SecondWorker", - "state": "active", - "queueAssignments": { - "MainQueue": {}, - "SecondaryQueue": {} - }, - "totalCapacity": 100, - "labels": {}, - "tags": {}, - "channelConfigurations": { - "CustomEmailChannel": { - "capacityCostPerJob": 10, - "maxNumberOfJobs": 4 - }, - "CustomSMSChannel": { - "capacityCostPerJob": 100, - "maxNumberOfJobs": 1 - } + "id": "SecondWorker", + "state": "active", + "queues": ["MainQueue", "SecondaryQueue"], + "capacity": 100, + "labels": {}, + "tags": {}, + "channels": [ + { + "channelId": "CustomEmailChannel", + "capacityCostPerJob": 10, + "maxNumberOfJobs": 4 }, - "offers": [], - "assignedJobs": [], - "loadRatio": 0, - "availableForOffers": true - }, + { + "channelId": "CustomSMSChannel", + "capacityCostPerJob": 100, + "maxNumberOfJobs": 1 + } + ], + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": true, "etag": "etag" } ], diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_RegisterWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_RegisterWorker.json index aec14fcfa51b..80b46064cc7e 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_RegisterWorker.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_RegisterWorker.json @@ -7,7 +7,7 @@ "workerId": "WorkerId", "resource": { "availableForOffers": true, - "totalCapacity": 10 + "capacity": 10 } }, "responses": { @@ -15,52 +15,54 @@ "body": { "id": "WorkerId", "state": "active", - "queueAssignments": { - "MainQueue": {} - }, - "totalCapacity": 10, + "queues": ["MainQueue"], + "capacity": 10, "labels": {}, "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { + "channels": [ + { + "channelId": "CustomChatChannel", "capacityCostPerJob": 11, "maxNumberOfJobs": 4 }, - "CustomVoiceChannel": { + { + "channelId": "CustomVoiceChannel", "capacityCostPerJob": 10, "maxNumberOfJobs": 1 } - }, + ], "offers": [], "assignedJobs": [], "loadRatio": 0, - "availableForOffers": true + "availableForOffers": true, + "etag": "etag" } }, "201": { "body": { "id": "WorkerId", "state": "active", - "queueAssignments": { - "MainQueue": {} - }, - "totalCapacity": 10, + "queues": ["MainQueue"], + "capacity": 10, "labels": {}, "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { + "channels": [ + { + "channelId": "CustomChatChannel", "capacityCostPerJob": 11, "maxNumberOfJobs": 4 }, - "CustomVoiceChannel": { + { + "channelId": "CustomVoiceChannel", "capacityCostPerJob": 10, "maxNumberOfJobs": 1 } - }, + ], "offers": [], "assignedJobs": [], "loadRatio": 0, - "availableForOffers": true + "availableForOffers": true, + "etag": "etag" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_UpdateWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_UpdateWorker.json index 1b0c1cd96c83..8a21fa1c8678 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_UpdateWorker.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_UpdateWorker.json @@ -6,23 +6,22 @@ "api-version": "2023-11-01", "workerId": "WorkerId", "resource": { - "totalCapacity": 10, - "queueAssignments": { - "MainQueue": {}, - "SecondaryQueue": null - }, + "capacity": 10, + "queues": ["MainQueue", "SecondaryQueue"], "labels": {}, "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { + "channels": [ + { + "channelId": "CustomChatChannel", "capacityCostPerJob": 11, "maxNumberOfJobs": 4 }, - "CustomVoiceChannel": { + { + "channelId": "CustomVoiceChannel", "capacityCostPerJob": 10, "maxNumberOfJobs": 1 } - }, + ], "availableForOffers": false } }, @@ -31,52 +30,54 @@ "body": { "id": "WorkerId", "state": "inactive", - "queueAssignments": { - "MainQueue": {} - }, - "totalCapacity": 10, + "queues": ["MainQueue"], + "capacity": 10, "labels": {}, "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { + "channels": [ + { + "channelId": "CustomChatChannel", "capacityCostPerJob": 11, "maxNumberOfJobs": 4 }, - "CustomVoiceChannel": { + { + "channelId": "CustomVoiceChannel", "capacityCostPerJob": 10, "maxNumberOfJobs": 1 } - }, + ], "offers": [], "assignedJobs": [], "loadRatio": 0, - "availableForOffers": false + "availableForOffers": false, + "etag": "etag" } }, "201": { "body": { "id": "WorkerId", "state": "inactive", - "queueAssignments": { - "MainQueue": {} - }, - "totalCapacity": 10, + "queues": ["MainQueue"], + "capacity": 10, "labels": {}, "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { + "channels": [ + { + "channelId": "CustomChatChannel", "capacityCostPerJob": 11, "maxNumberOfJobs": 4 }, - "CustomVoiceChannel": { + { + "channelId": "CustomVoiceChannel", "capacityCostPerJob": 10, "maxNumberOfJobs": 1 } - }, + ], "offers": [], "assignedJobs": [], "loadRatio": 0, - "availableForOffers": false + "availableForOffers": false, + "etag": "etag" } } } diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index 1f626b676db0..7b5530247c5f 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -155,13 +155,13 @@ interface JobRouterOperations { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Reclassify a job.") @doc("Reclassify a job.") - @route("/routing/jobs/{id}:reclassify") + @route("/routing/jobs/{jobId}:reclassify") @post reclassifyJobAction is Azure.Core.Foundations.Operation< { @doc("Id of the job.") @path - id: string; + jobId: string; @doc("Request object for reclassifying a job.") @body @@ -179,13 +179,13 @@ cancellation reason. Submits request to cancel an existing job by Id while supplying free-form cancellation reason. """) - @route("/routing/jobs/{id}:cancel") + @route("/routing/jobs/{jobId}:cancel") @post cancelJobAction is Azure.Core.Foundations.Operation< { @doc("Id of the job.") @path - id: string; + jobId: string; @doc("Request model for cancelling job.") @body @@ -197,13 +197,13 @@ cancellation reason. #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Completes an assigned job.") @doc("Completes an assigned job.") - @route("/routing/jobs/{id}:complete") + @route("/routing/jobs/{jobId}:complete") @post completeJobAction is Azure.Core.Foundations.Operation< { @doc("Id of the job.") @path - id: string; + jobId: string; @doc("Request model for completing job.") @body @@ -215,13 +215,13 @@ cancellation reason. #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Closes a completed job.") @doc("Closes a completed job.") - @route("/routing/jobs/{id}:close") + @route("/routing/jobs/{jobId}:close") @post closeJobAction is Azure.Core.Foundations.Operation< { @doc("Id of the job.") @path - id: string; + jobId: string; @doc("Request model for closing job.") @body @@ -243,13 +243,13 @@ cancellation reason. #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Gets a job's position details.") @doc("Gets a job's position details.") - @route("/routing/jobs/{id}/position") + @route("/routing/jobs/{jobId}/position") @get getInQueuePosition is Azure.Core.Foundations.Operation< { @doc("Id of the job.") @path - id: string; + jobId: string; }, RouterJobPositionDetails >; @@ -257,13 +257,13 @@ cancellation reason. #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Un-assign a job.") @doc("Un-assign a job.") - @route("/routing/jobs/{id}/assignments/{assignmentId}:unassign") + @route("/routing/jobs/{jobId}/assignments/{assignmentId}:unassign") @post unassignJobAction is Azure.Core.Foundations.Operation< { @doc("Id of the job to un-assign.") @path - id: string; + jobId: string; @doc("Id of the assignment to un-assign.") @path @@ -325,13 +325,13 @@ accepted the job already. #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves a queue's statistics.") @doc("Retrieves a queue's statistics.") - @route("/routing/queues/{id}/statistics") + @route("/routing/queues/{queueId}/statistics") @get getQueueStatistics is Azure.Core.Foundations.Operation< { @doc("Id of the queue to retrieve statistics.") @path - id: string; + queueId: string; }, RouterQueueStatistics >; diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index 11e0c6cc7850..9e09e95e6926 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -974,7 +974,7 @@ } } }, - "/routing/jobs/{id}:reclassify": { + "/routing/jobs/{jobId}:reclassify": { "post": { "operationId": "JobRouterOperations_ReclassifyJobAction", "summary": "Reclassify a job.", @@ -984,7 +984,7 @@ "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "id", + "name": "jobId", "in": "path", "description": "Id of the job.", "required": true, @@ -1024,7 +1024,7 @@ } } }, - "/routing/jobs/{id}:cancel": { + "/routing/jobs/{jobId}:cancel": { "post": { "operationId": "JobRouterOperations_CancelJobAction", "summary": "Submits request to cancel an existing job by Id while supplying free-form\ncancellation reason.", @@ -1034,7 +1034,7 @@ "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "id", + "name": "jobId", "in": "path", "description": "Id of the job.", "required": true, @@ -1074,7 +1074,7 @@ } } }, - "/routing/jobs/{id}:complete": { + "/routing/jobs/{jobId}:complete": { "post": { "operationId": "JobRouterOperations_CompleteJobAction", "summary": "Completes an assigned job.", @@ -1084,7 +1084,7 @@ "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "id", + "name": "jobId", "in": "path", "description": "Id of the job.", "required": true, @@ -1124,7 +1124,7 @@ } } }, - "/routing/jobs/{id}:close": { + "/routing/jobs/{jobId}:close": { "post": { "operationId": "JobRouterOperations_CloseJobAction", "summary": "Closes a completed job.", @@ -1134,7 +1134,7 @@ "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "id", + "name": "jobId", "in": "path", "description": "Id of the job.", "required": true, @@ -1177,7 +1177,7 @@ } } }, - "/routing/jobs/{id}/assignments/{assignmentId}:unassign": { + "/routing/jobs/{jobId}/assignments/{assignmentId}:unassign": { "post": { "operationId": "JobRouterOperations_UnassignJobAction", "summary": "Un-assign a job.", @@ -1187,7 +1187,7 @@ "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "id", + "name": "jobId", "in": "path", "description": "Id of the job to un-assign.", "required": true, @@ -1237,7 +1237,7 @@ } } }, - "/routing/jobs/{id}/position": { + "/routing/jobs/{jobId}/position": { "get": { "operationId": "JobRouterOperations_GetInQueuePosition", "summary": "Gets a job's position details.", @@ -1247,7 +1247,7 @@ "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "id", + "name": "jobId", "in": "path", "description": "Id of the job.", "required": true, @@ -1511,7 +1511,7 @@ } } }, - "/routing/queues/{id}/statistics": { + "/routing/queues/{queueId}/statistics": { "get": { "operationId": "JobRouterOperations_GetQueueStatistics", "summary": "Retrieves a queue's statistics.", @@ -1521,7 +1521,7 @@ "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "id", + "name": "queueId", "in": "path", "description": "Id of the queue to retrieve statistics.", "required": true, diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_CreateExceptionPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_CreateExceptionPolicy.json index 9828085bd849..7997e360b8fb 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_CreateExceptionPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_CreateExceptionPolicy.json @@ -12,7 +12,6 @@ "id": "MaxWaitTimeExceeded", "actions": [ { - "id": "MoveJobToEscalatedQueue", "kind": "reclassify", "classificationPolicyId": "Main", "labelsToUpsert": { @@ -42,7 +41,7 @@ }, "actions": [ { - "id": "MoveJobToEscalatedQueue", + "id": "babd4f6f-916e-4e91-9c89-e0bb05a2c425", "kind": "reclassify", "classificationPolicyId": "Main", "labelsToUpsert": { @@ -68,7 +67,7 @@ }, "actions": [ { - "id": "MoveJobToEscalatedQueue", + "id": "babd4f6f-916e-4e91-9c89-e0bb05a2c425", "kind": "reclassify", "classificationPolicyId": "Main", "labelsToUpsert": { diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_GetExceptionPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_GetExceptionPolicy.json index 5f9b26cb0406..ccded0284a33 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_GetExceptionPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_GetExceptionPolicy.json @@ -20,7 +20,7 @@ }, "actions": [ { - "id": "MoveJobToEscalatedQueue", + "id": "babd4f6f-916e-4e91-9c89-e0bb05a2c425", "kind": "reclassify", "classificationPolicyId": "Main", "labelsToUpsert": { diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_UpdateExceptionPolicy.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_UpdateExceptionPolicy.json index 858efc302511..fb0d6dad5f04 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_UpdateExceptionPolicy.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_UpdateExceptionPolicy.json @@ -12,7 +12,6 @@ "id": "MaxWaitTimeExceeded", "actions": [ { - "id": "MoveJobToEscalatedQueue", "kind": "reclassify", "classificationPolicyId": "Main", "labelsToUpsert": { @@ -42,7 +41,7 @@ }, "actions": [ { - "id": "MoveJobToEscalatedQueue", + "id": "babd4f6f-916e-4e91-9c89-e0bb05a2c425", "kind": "reclassify", "classificationPolicyId": "Main", "labelsToUpsert": { @@ -68,7 +67,7 @@ }, "actions": [ { - "id": "MoveJobToEscalatedQueue", + "id": "babd4f6f-916e-4e91-9c89-e0bb05a2c425", "kind": "reclassify", "classificationPolicyId": "Main", "labelsToUpsert": { diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateJob.json index 6b842747e1ca..5310ef73e711 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateJob.json @@ -19,10 +19,7 @@ ], "labels": {}, "matchingMode": { - "modeType": "queueAndMatchMode", - "queueAndMatchMode": {}, - "scheduleAndSuspendMode": null, - "suspendMode": null + "kind": "queue-and-match" } } }, @@ -51,10 +48,7 @@ "assignments": {}, "notes": [], "matchingMode": { - "modeType": "queueAndMatchMode", - "queueAndMatchMode": {}, - "scheduleAndSuspendMode": null, - "suspendMode": null + "kind": "queue-and-match" }, "etag": "etag" } @@ -83,10 +77,7 @@ "assignments": {}, "notes": [], "matchingMode": { - "modeType": "queueAndMatchMode", - "queueAndMatchMode": {}, - "scheduleAndSuspendMode": null, - "suspendMode": null + "kind": "queue-and-match" }, "etag": "etag" } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateScheduledJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateScheduledJob.json index 4cf970e7b023..6ddbfe01e07a 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateScheduledJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CreateScheduledJob.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "JobId", + "jobId": "JobId", "resource": { "channelId": "CustomChatChannel", "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", @@ -19,12 +19,8 @@ ], "labels": {}, "matchingMode": { - "modeType": "scheduleAndSuspendMode", - "queueAndMatchMode": null, - "scheduleAndSuspendMode": { - "scheduleAt": "2023-05-26T23:22:12.0774222+00:00" - }, - "suspendMode": null + "kind": "schedule-and-suspend", + "scheduleAt": "2023-05-26T23:22:12.0774222+00:00" } } }, @@ -51,14 +47,10 @@ "attachedWorkerSelectors": [], "labels": {}, "assignments": {}, - "notes": {}, + "notes": [], "matchingMode": { - "modeType": "scheduleAndSuspendMode", - "queueAndMatchMode": null, - "scheduleAndSuspendMode": { - "scheduleAt": "2023-05-26T23:22:12.0774222+00:00" - }, - "suspendMode": null + "kind": "schedule-and-suspend", + "scheduleAt": "2023-05-26T23:22:12.0774222+00:00" }, "scheduledAt": null, "etag": "etag" @@ -86,14 +78,10 @@ "attachedWorkerSelectors": [], "labels": {}, "assignments": {}, - "notes": {}, + "notes": [], "matchingMode": { - "modeType": "scheduleAndSuspendMode", - "queueAndMatchMode": null, - "scheduleAndSuspendMode": { - "scheduleAt": "2023-05-26T23:22:12.0774222+00:00" - }, - "suspendMode": null + "kind": "schedule-and-suspend", + "scheduleAt": "2023-05-26T23:22:12.0774222+00:00" }, "scheduledAt": null, "etag": "etag" diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_DeleteJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_DeleteJob.json index 0a51428e1b83..829b06994866 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_DeleteJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_DeleteJob.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "8780b28c-7079-4de1-9143-4d369289e958" + "jobId": "8780b28c-7079-4de1-9143-4d369289e958" }, "responses": { "204": {} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetInQueuePosition.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetInQueuePosition.json index 8756de32109b..103c42f5fb51 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetInQueuePosition.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetInQueuePosition.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "8780b28c-7079-4de1-9143-4d369289e958" + "jobId": "8780b28c-7079-4de1-9143-4d369289e958" }, "responses": { "200": { diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJob.json index 253c7ad5d4b4..4ad6f5a6b214 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJob.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "8780b28c-7079-4de1-9143-4d369289e958" + "jobId": "8780b28c-7079-4de1-9143-4d369289e958" }, "responses": { "200": { @@ -29,12 +29,9 @@ "attachedWorkerSelectors": [], "labels": {}, "assignments": {}, - "notes": {}, + "notes": [], "matchingMode": { - "modeType": "queueAndMatchMode", - "queueAndMatchMode": {}, - "scheduleAndSuspendMode": null, - "suspendMode": null + "kind": "queue-and-match" }, "etag": "etag" } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJobsWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJobsWithPageSize.json index 0a99fa84001a..06127640cb76 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJobsWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJobsWithPageSize.json @@ -14,48 +14,38 @@ "body": { "value": [ { - "job": { - "id": "383541b3-5637-4af6-8aac-3391da8a578a", - "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", - "status": "queued", - "enqueuedAt": "2021-09-30T23:56:21.883322+00:00", - "channelId": "CustomChatChannel", - "classificationPolicyId": null, - "queueId": "MainQueue", - "priority": 5, - "dispositionCode": null, - "labels": {}, - "assignments": {}, - "notes": {}, - "matchingMode": { - "modeType": "queueAndMatchMode", - "queueAndMatchMode": {}, - "scheduleAndSuspendMode": null, - "suspendMode": null - } + "id": "383541b3-5637-4af6-8aac-3391da8a578a", + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "status": "queued", + "enqueuedAt": "2021-09-30T23:56:21.883322+00:00", + "channelId": "CustomChatChannel", + "classificationPolicyId": null, + "queueId": "MainQueue", + "priority": 5, + "dispositionCode": null, + "labels": {}, + "assignments": {}, + "notes": [], + "matchingMode": { + "kind": "queue-and-match" }, "etag": "etag" }, { - "job": { - "id": "c571dd84-1ca7-4606-a77a-f38d9e4ae513", - "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", - "status": "queued", - "enqueuedAt": "2021-09-30T23:57:54.041179+00:00", - "channelId": "CustomChatChannel2", - "classificationPolicyId": null, - "queueId": "MainQueue", - "priority": 5, - "dispositionCode": null, - "labels": {}, - "assignments": {}, - "notes": {}, - "matchingMode": { - "modeType": "queueAndMatchMode", - "queueAndMatchMode": {}, - "scheduleAndSuspendMode": null, - "suspendMode": null - } + "id": "c571dd84-1ca7-4606-a77a-f38d9e4ae513", + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "status": "queued", + "enqueuedAt": "2021-09-30T23:57:54.041179+00:00", + "channelId": "CustomChatChannel2", + "classificationPolicyId": null, + "queueId": "MainQueue", + "priority": 5, + "dispositionCode": null, + "labels": {}, + "assignments": {}, + "notes": [], + "matchingMode": { + "kind": "queue-and-match" }, "etag": "etag" } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UpdateJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UpdateJob.json index f212a545b84e..4bd9051afd46 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UpdateJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UpdateJob.json @@ -32,12 +32,9 @@ "attachedWorkerSelectors": [], "labels": {}, "assignments": {}, - "notes": {}, + "notes": [], "matchingMode": { - "modeType": "queueAndMatchMode", - "queueAndMatchMode": {}, - "scheduleAndSuspendMode": null, - "suspendMode": null + "kind": "queue-and-match" }, "etag": "etag" } @@ -64,12 +61,9 @@ "attachedWorkerSelectors": [], "labels": {}, "assignments": {}, - "notes": {}, + "notes": [], "matchingMode": { - "modeType": "queueAndMatchMode", - "queueAndMatchMode": {}, - "scheduleAndSuspendMode": null, - "suspendMode": null + "kind": "queue-and-match" }, "etag": "etag" } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_CreateQueue.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_CreateQueue.json index c5330d1a1e3a..9aa2ec3b2d2c 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_CreateQueue.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_CreateQueue.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "QueueId", + "queueId": "QueueId", "resource": { "distributionPolicyId": "MainDistributionPolicy", "name": "Main", @@ -19,7 +19,8 @@ "name": "Main", "distributionPolicyId": "MainDistributionPolicy", "labels": {}, - "exceptionPolicyId": "MainExceptionPolicy" + "exceptionPolicyId": "MainExceptionPolicy", + "etag": "etag" } }, "201": { @@ -28,7 +29,8 @@ "name": "Main", "distributionPolicyId": "MainDistributionPolicy", "labels": {}, - "exceptionPolicyId": "MainExceptionPolicy" + "exceptionPolicyId": "MainExceptionPolicy", + "etag": "etag" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_DeleteQueue.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_DeleteQueue.json index 527bfc15af8f..d61c03d194bc 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_DeleteQueue.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_DeleteQueue.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "MainQueue" + "queueId": "MainQueue" }, "responses": { "204": {} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_GetQueue.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_GetQueue.json index 4ffb4670596a..224c791a70cb 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_GetQueue.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_GetQueue.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "MainQueue" + "queueId": "MainQueue" }, "responses": { "200": { @@ -13,7 +13,8 @@ "name": "Main", "distributionPolicyId": "MainDistributionPolicy", "labels": {}, - "exceptionPolicyId": "MainExceptionPolicy" + "exceptionPolicyId": "MainExceptionPolicy", + "etag": "etag" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_GetQueueStatistics.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_GetQueueStatistics.json index 1c5a914ac62f..72e23ae6ccfc 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_GetQueueStatistics.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_GetQueueStatistics.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "MainQueue" + "queueId": "MainQueue" }, "responses": { "200": { diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_UpdateQueue.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_UpdateQueue.json index b3162f4be126..99ebf8a3d5c9 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_UpdateQueue.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_UpdateQueue.json @@ -4,7 +4,7 @@ "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", - "id": "MainQueue", + "queueId": "MainQueue", "resource": { "distributionPolicyId": "MainDistributionPolicy", "name": "Main" @@ -17,7 +17,8 @@ "name": "Main", "distributionPolicyId": "MainDistributionPolicy", "labels": {}, - "exceptionPolicyId": "MainExceptionPolicy" + "exceptionPolicyId": "MainExceptionPolicy", + "etag": "etag" } }, "201": { @@ -26,7 +27,8 @@ "name": "Main", "distributionPolicyId": "MainDistributionPolicy", "labels": {}, - "exceptionPolicyId": "MainExceptionPolicy" + "exceptionPolicyId": "MainExceptionPolicy", + "etag": "etag" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_CreateWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_CreateWorker.json index 5309f9796ea0..005ee8aae10d 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_CreateWorker.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_CreateWorker.json @@ -6,23 +6,22 @@ "api-version": "2023-11-01", "workerId": "WorkerId", "resource": { - "totalCapacity": 10, - "queueAssignments": { - "MainQueue": {}, - "SecondaryQueue": null - }, + "capacity": 10, + "queues": ["MainQueue"], "labels": {}, "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { + "channels": [ + { + "channelId": "CustomChatChannel", "capacityCostPerJob": 11, "maxNumberOfJobs": 4 }, - "CustomVoiceChannel": { + { + "channelId": "CustomVoiceChannel", "capacityCostPerJob": 10, "maxNumberOfJobs": 1 } - }, + ], "availableForOffers": false } }, @@ -31,52 +30,54 @@ "body": { "id": "WorkerId", "state": "inactive", - "queueAssignments": { - "MainQueue": {} - }, - "totalCapacity": 10, + "queues": ["MainQueue"], + "capacity": 10, "labels": {}, "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { + "channels": [ + { + "channelId": "CustomChatChannel", "capacityCostPerJob": 11, "maxNumberOfJobs": 4 }, - "CustomVoiceChannel": { + { + "channelId": "CustomVoiceChannel", "capacityCostPerJob": 10, "maxNumberOfJobs": 1 } - }, + ], "offers": [], "assignedJobs": [], "loadRatio": 0, - "availableForOffers": false + "availableForOffers": false, + "etag": "etag" } }, "201": { "body": { "id": "WorkerId", "state": "inactive", - "queueAssignments": { - "MainQueue": {} - }, - "totalCapacity": 10, + "queues": ["MainQueue"], + "capacity": 10, "labels": {}, "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { + "channels": [ + { + "channelId": "CustomChatChannel", "capacityCostPerJob": 11, "maxNumberOfJobs": 4 }, - "CustomVoiceChannel": { + { + "channelId": "CustomVoiceChannel", "capacityCostPerJob": 10, "maxNumberOfJobs": 1 } - }, + ], "offers": [], "assignedJobs": [], "loadRatio": 0, - "availableForOffers": false + "availableForOffers": false, + "etag": "etag" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterActiveWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterActiveWorker.json index f5147634e20d..0651e3fb0ddf 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterActiveWorker.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterActiveWorker.json @@ -7,7 +7,7 @@ "workerId": "WorkerId", "resource": { "availableForOffers": false, - "totalCapacity": 10 + "capacity": 10 } }, "responses": { @@ -15,52 +15,54 @@ "body": { "id": "WorkerId", "state": "draining", - "queueAssignments": { - "MainQueue": {} - }, - "totalCapacity": 10, + "queues": ["MainQueue"], + "capacity": 10, "labels": {}, "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { + "channels": [ + { + "channelId": "CustomChatChannel", "capacityCostPerJob": 11, "maxNumberOfJobs": 4 }, - "CustomVoiceChannel": { + { + "channelId": "CustomVoiceChannel", "capacityCostPerJob": 10, "maxNumberOfJobs": 1 } - }, + ], "offers": [], "assignedJobs": [], "loadRatio": 0, - "availableForOffers": false + "availableForOffers": false, + "etag": "etag" } }, "201": { "body": { "id": "WorkerId", "state": "draining", - "queueAssignments": { - "MainQueue": {} - }, - "totalCapacity": 10, + "queues": ["MainQueue"], + "capacity": 10, "labels": {}, "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { + "channels": [ + { + "channelId": "CustomChatChannel", "capacityCostPerJob": 11, "maxNumberOfJobs": 4 }, - "CustomVoiceChannel": { + { + "channelId": "CustomVoiceChannel", "capacityCostPerJob": 10, "maxNumberOfJobs": 1 } - }, + ], "offers": [], "assignedJobs": [], "loadRatio": 0, - "availableForOffers": false + "availableForOffers": false, + "etag": "etag" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterInactiveWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterInactiveWorker.json index 934647c11074..e24d352dc48f 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterInactiveWorker.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterInactiveWorker.json @@ -7,7 +7,7 @@ "workerId": "WorkerId", "resource": { "availableForOffers": false, - "totalCapacity": 10 + "capacity": 10 } }, "responses": { @@ -15,52 +15,54 @@ "body": { "id": "WorkerId", "state": "inactive", - "queueAssignments": { - "MainQueue": {} - }, - "totalCapacity": 10, + "queues": ["MainQueue"], + "capacity": 10, "labels": {}, "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { + "channels": [ + { + "channelId": "CustomChatChannel", "capacityCostPerJob": 11, "maxNumberOfJobs": 4 }, - "CustomVoiceChannel": { + { + "channelId": "CustomVoiceChannel", "capacityCostPerJob": 10, "maxNumberOfJobs": 1 } - }, + ], "offers": [], "assignedJobs": [], "loadRatio": 0, - "availableForOffers": false + "availableForOffers": false, + "etag": "etag" } }, "201": { "body": { "id": "WorkerId", "state": "inactive", - "queueAssignments": { - "MainQueue": {} - }, - "totalCapacity": 10, + "queues": ["MainQueue"], + "capacity": 10, "labels": {}, "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { + "channels": [ + { + "channelId": "CustomChatChannel", "capacityCostPerJob": 11, "maxNumberOfJobs": 4 }, - "CustomVoiceChannel": { + { + "channelId": "CustomVoiceChannel", "capacityCostPerJob": 10, "maxNumberOfJobs": 1 } - }, + ], "offers": [], "assignedJobs": [], "loadRatio": 0, - "availableForOffers": false + "availableForOffers": false, + "etag": "etag" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json index cfd66c766787..920dd65bf3a1 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json @@ -13,59 +13,53 @@ "body": { "value": [ { - "worker": { - "id": "DefaultWorker", - "state": "active", - "queueAssignments": { - "MainQueue": {}, - "SecondaryQueue": {} + "id": "DefaultWorker", + "state": "active", + "queues": ["MainQueue", "SecondaryQueue"], + "capacity": 100, + "labels": {}, + "tags": {}, + "channels": [ + { + "channelId": "CustomChatChannel", + "capacityCostPerJob": 10, + "maxNumberOfJobs": 4 }, - "totalCapacity": 100, - "labels": {}, - "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { - "capacityCostPerJob": 10, - "maxNumberOfJobs": 4 - }, - "CustomVoiceChannel": { - "capacityCostPerJob": 100, - "maxNumberOfJobs": 1 - } - }, - "offers": [], - "assignedJobs": [], - "loadRatio": 0, - "availableForOffers": true - }, + { + "channelId": "CustomVoiceChannel", + "capacityCostPerJob": 100, + "maxNumberOfJobs": 1 + } + ], + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": true, "etag": "etag" }, { - "worker": { - "id": "SecondWorker", - "state": "active", - "queueAssignments": { - "MainQueue": {}, - "SecondaryQueue": {} - }, - "totalCapacity": 100, - "labels": {}, - "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { - "capacityCostPerJob": 10, - "maxNumberOfJobs": 4 - }, - "CustomVoiceChannel": { - "capacityCostPerJob": 100, - "maxNumberOfJobs": 1 - } + "id": "SecondWorker", + "state": "active", + "queues": ["MainQueue", "SecondaryQueue"], + "capacity": 100, + "labels": {}, + "tags": {}, + "channels": [ + { + "channelId": "CustomChatChannel", + "capacityCostPerJob": 10, + "maxNumberOfJobs": 4 }, - "offers": [], - "assignedJobs": [], - "loadRatio": 0, - "availableForOffers": true - }, + { + "channelId": "CustomVoiceChannel", + "capacityCostPerJob": 100, + "maxNumberOfJobs": 1 + } + ], + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": true, "etag": "etag" } ], diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorker.json index 807e63483e9d..684d0b07499d 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorker.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorker.json @@ -11,27 +11,27 @@ "body": { "id": "DefaultWorker", "state": "active", - "queueAssignments": { - "MainQueue": {}, - "SecondaryQueue": {} - }, - "totalCapacity": 100, + "queues": ["MainQueue", "SecondaryQueue"], + "capacity": 100, "labels": {}, "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { + "channels": [ + { + "channelId": "CustomChatChannel", "capacityCostPerJob": 10, "maxNumberOfJobs": 4 }, - "CustomVoiceChannel": { + { + "channelId": "CustomVoiceChannel", "capacityCostPerJob": 100, "maxNumberOfJobs": 1 } - }, + ], "offers": [], "assignedJobs": [], "loadRatio": 0, - "availableForOffers": true + "availableForOffers": true, + "etag": "etag" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json index b70a11228ef0..1e92a100b14b 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json @@ -11,59 +11,53 @@ "body": { "value": [ { - "worker": { - "id": "DefaultWorker", - "state": "active", - "queueAssignments": { - "MainQueue": {}, - "SecondaryQueue": {} + "id": "DefaultWorker", + "state": "active", + "queues": ["MainQueue", "SecondaryQueue"], + "capacity": 100, + "labels": {}, + "tags": {}, + "channels": [ + { + "channelId": "CustomChatChannel", + "capacityCostPerJob": 10, + "maxNumberOfJobs": 4 }, - "totalCapacity": 100, - "labels": {}, - "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { - "capacityCostPerJob": 10, - "maxNumberOfJobs": 4 - }, - "CustomVoiceChannel": { - "capacityCostPerJob": 100, - "maxNumberOfJobs": 1 - } - }, - "offers": [], - "assignedJobs": [], - "loadRatio": 0, - "availableForOffers": true - }, + { + "channelId": "CustomVoiceChannel", + "capacityCostPerJob": 100, + "maxNumberOfJobs": 1 + } + ], + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": true, "etag": "etag" }, { - "worker": { - "id": "SecondWorker", - "state": "active", - "queueAssignments": { - "MainQueue": {}, - "SecondaryQueue": {} - }, - "totalCapacity": 100, - "labels": {}, - "tags": {}, - "channelConfigurations": { - "CustomEmailChannel": { - "capacityCostPerJob": 10, - "maxNumberOfJobs": 4 - }, - "CustomSMSChannel": { - "capacityCostPerJob": 100, - "maxNumberOfJobs": 1 - } + "id": "SecondWorker", + "state": "active", + "queues": ["MainQueue", "SecondaryQueue"], + "capacity": 100, + "labels": {}, + "tags": {}, + "channels": [ + { + "channelId": "CustomEmailChannel", + "capacityCostPerJob": 10, + "maxNumberOfJobs": 4 }, - "offers": [], - "assignedJobs": [], - "loadRatio": 0, - "availableForOffers": true - }, + { + "channelId": "CustomSMSChannel", + "capacityCostPerJob": 100, + "maxNumberOfJobs": 1 + } + ], + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": true, "etag": "etag" } ], diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_RegisterWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_RegisterWorker.json index aec14fcfa51b..80b46064cc7e 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_RegisterWorker.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_RegisterWorker.json @@ -7,7 +7,7 @@ "workerId": "WorkerId", "resource": { "availableForOffers": true, - "totalCapacity": 10 + "capacity": 10 } }, "responses": { @@ -15,52 +15,54 @@ "body": { "id": "WorkerId", "state": "active", - "queueAssignments": { - "MainQueue": {} - }, - "totalCapacity": 10, + "queues": ["MainQueue"], + "capacity": 10, "labels": {}, "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { + "channels": [ + { + "channelId": "CustomChatChannel", "capacityCostPerJob": 11, "maxNumberOfJobs": 4 }, - "CustomVoiceChannel": { + { + "channelId": "CustomVoiceChannel", "capacityCostPerJob": 10, "maxNumberOfJobs": 1 } - }, + ], "offers": [], "assignedJobs": [], "loadRatio": 0, - "availableForOffers": true + "availableForOffers": true, + "etag": "etag" } }, "201": { "body": { "id": "WorkerId", "state": "active", - "queueAssignments": { - "MainQueue": {} - }, - "totalCapacity": 10, + "queues": ["MainQueue"], + "capacity": 10, "labels": {}, "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { + "channels": [ + { + "channelId": "CustomChatChannel", "capacityCostPerJob": 11, "maxNumberOfJobs": 4 }, - "CustomVoiceChannel": { + { + "channelId": "CustomVoiceChannel", "capacityCostPerJob": 10, "maxNumberOfJobs": 1 } - }, + ], "offers": [], "assignedJobs": [], "loadRatio": 0, - "availableForOffers": true + "availableForOffers": true, + "etag": "etag" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_UpdateWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_UpdateWorker.json index 1b0c1cd96c83..8a21fa1c8678 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_UpdateWorker.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_UpdateWorker.json @@ -6,23 +6,22 @@ "api-version": "2023-11-01", "workerId": "WorkerId", "resource": { - "totalCapacity": 10, - "queueAssignments": { - "MainQueue": {}, - "SecondaryQueue": null - }, + "capacity": 10, + "queues": ["MainQueue", "SecondaryQueue"], "labels": {}, "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { + "channels": [ + { + "channelId": "CustomChatChannel", "capacityCostPerJob": 11, "maxNumberOfJobs": 4 }, - "CustomVoiceChannel": { + { + "channelId": "CustomVoiceChannel", "capacityCostPerJob": 10, "maxNumberOfJobs": 1 } - }, + ], "availableForOffers": false } }, @@ -31,52 +30,54 @@ "body": { "id": "WorkerId", "state": "inactive", - "queueAssignments": { - "MainQueue": {} - }, - "totalCapacity": 10, + "queues": ["MainQueue"], + "capacity": 10, "labels": {}, "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { + "channels": [ + { + "channelId": "CustomChatChannel", "capacityCostPerJob": 11, "maxNumberOfJobs": 4 }, - "CustomVoiceChannel": { + { + "channelId": "CustomVoiceChannel", "capacityCostPerJob": 10, "maxNumberOfJobs": 1 } - }, + ], "offers": [], "assignedJobs": [], "loadRatio": 0, - "availableForOffers": false + "availableForOffers": false, + "etag": "etag" } }, "201": { "body": { "id": "WorkerId", "state": "inactive", - "queueAssignments": { - "MainQueue": {} - }, - "totalCapacity": 10, + "queues": ["MainQueue"], + "capacity": 10, "labels": {}, "tags": {}, - "channelConfigurations": { - "CustomChatChannel": { + "channels": [ + { + "channelId": "CustomChatChannel", "capacityCostPerJob": 11, "maxNumberOfJobs": 4 }, - "CustomVoiceChannel": { + { + "channelId": "CustomVoiceChannel", "capacityCostPerJob": 10, "maxNumberOfJobs": 1 } - }, + ], "offers": [], "assignedJobs": [], "loadRatio": 0, - "availableForOffers": false + "availableForOffers": false, + "etag": "etag" } } } From ed375e5283d9f95224849c5118b34120bffae463 Mon Sep 17 00:00:00 2001 From: Charandeep Parisineti Date: Tue, 24 Oct 2023 10:45:58 -0700 Subject: [PATCH 052/113] Add partial-update for java --- .../communication/Communication.JobRouter/tspconfig.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/communication/Communication.JobRouter/tspconfig.yaml b/specification/communication/Communication.JobRouter/tspconfig.yaml index aeb9a3e5da01..6183662db134 100644 --- a/specification/communication/Communication.JobRouter/tspconfig.yaml +++ b/specification/communication/Communication.JobRouter/tspconfig.yaml @@ -40,6 +40,7 @@ options: "@azure-tools/typespec-java": emitter-output-dir: "{java-sdk-folder}/sdk/{service-directory-name}/azure-communication-jobrouter" namespace: com.azure.communication.jobrouter + partial-update: true "@azure-tools/typespec-ts": emitter-output-dir: "{js-sdk-folder}/sdk/{service-directory-name}/communication-job-router-rest" generateMetadata: true From 217b3cce47ff9a1452479c66f895584480242665 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 24 Oct 2023 14:18:23 -0700 Subject: [PATCH 053/113] try updating client.tsp to rename method for .NET --- .../communication/Communication.JobRouter/client.tsp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/specification/communication/Communication.JobRouter/client.tsp b/specification/communication/Communication.JobRouter/client.tsp index 5d89dea39a2e..d0522669b4da 100644 --- a/specification/communication/Communication.JobRouter/client.tsp +++ b/specification/communication/Communication.JobRouter/client.tsp @@ -18,6 +18,7 @@ namespace ClientForAcsJobRouter; interface JobRouterAdministrationRestClient { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal + @projectedName("csharp", "updateDistributionPolicy") upsertDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertDistributionPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -31,6 +32,7 @@ interface JobRouterAdministrationRestClient { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal + @projectedName("csharp", "updateClassificationPolicy") upsertClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertClassificationPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -44,6 +46,7 @@ interface JobRouterAdministrationRestClient { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal + @projectedName("csharp", "updateExceptionPolicy") upsertExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertExceptionPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -57,6 +60,7 @@ interface JobRouterAdministrationRestClient { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal + @projectedName("csharp", "updateQueue") upsertQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertQueue; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -76,6 +80,7 @@ interface JobRouterAdministrationRestClient { interface JobRouterRestClient { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal + @projectedName("csharp", "updateJob") upsertJob is AzureCommunicationRoutingService.JobRouterOperations.upsertJob; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -117,6 +122,7 @@ interface JobRouterRestClient { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal + @projectedName("csharp", "updateWorker") upsertWorker is AzureCommunicationRoutingService.JobRouterOperations.upsertWorker; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" From 2a57b721e004f84c358f42356e79902d31ac84b9 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 24 Oct 2023 14:30:18 -0700 Subject: [PATCH 054/113] make ExceptionAction.Id optional --- specification/communication/Communication.JobRouter/models.tsp | 2 +- .../stable/2023-11-01/communicationservicejobrouter.json | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 4ff796359e9d..3b583542d68b 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -964,7 +964,7 @@ custom values. model ExceptionAction { @doc("Unique Id of the exception action") @visibility("read") - id: string; + id?: string; @doc("The type discriminator describing a sub-type of ExceptionAction") kind: string; diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index 9e09e95e6926..ff3513b7ccf7 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -2415,7 +2415,6 @@ }, "discriminator": "kind", "required": [ - "id", "kind" ] }, From 653469e9bdc6b0e36f7003c2021717be01eabfa6 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 24 Oct 2023 15:19:04 -0700 Subject: [PATCH 055/113] run prettier --- .../examples/2023-11-01/Workers_CreateWorker.json | 12 +++++++++--- .../2023-11-01/Workers_DeregisterActiveWorker.json | 8 ++++++-- .../Workers_DeregisterInactiveWorker.json | 8 ++++++-- .../Workers_GetAvailableWorkersByChannel.json | 10 ++++++++-- .../examples/2023-11-01/Workers_GetWorker.json | 5 ++++- .../2023-11-01/Workers_GetWorkersWithPageSize.json | 10 ++++++++-- .../examples/2023-11-01/Workers_RegisterWorker.json | 8 ++++++-- .../examples/2023-11-01/Workers_UpdateWorker.json | 13 ++++++++++--- .../2023-11-01/examples/Workers_CreateWorker.json | 12 +++++++++--- .../examples/Workers_DeregisterActiveWorker.json | 8 ++++++-- .../examples/Workers_DeregisterInactiveWorker.json | 8 ++++++-- .../Workers_GetAvailableWorkersByChannel.json | 10 ++++++++-- .../2023-11-01/examples/Workers_GetWorker.json | 5 ++++- .../examples/Workers_GetWorkersWithPageSize.json | 10 ++++++++-- .../2023-11-01/examples/Workers_RegisterWorker.json | 8 ++++++-- .../2023-11-01/examples/Workers_UpdateWorker.json | 13 ++++++++++--- 16 files changed, 114 insertions(+), 34 deletions(-) diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_CreateWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_CreateWorker.json index 005ee8aae10d..39b2a9652dca 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_CreateWorker.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_CreateWorker.json @@ -7,7 +7,9 @@ "workerId": "WorkerId", "resource": { "capacity": 10, - "queues": ["MainQueue"], + "queues": [ + "MainQueue" + ], "labels": {}, "tags": {}, "channels": [ @@ -30,7 +32,9 @@ "body": { "id": "WorkerId", "state": "inactive", - "queues": ["MainQueue"], + "queues": [ + "MainQueue" + ], "capacity": 10, "labels": {}, "tags": {}, @@ -57,7 +61,9 @@ "body": { "id": "WorkerId", "state": "inactive", - "queues": ["MainQueue"], + "queues": [ + "MainQueue" + ], "capacity": 10, "labels": {}, "tags": {}, diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterActiveWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterActiveWorker.json index 0651e3fb0ddf..17dbeebc27f6 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterActiveWorker.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterActiveWorker.json @@ -15,7 +15,9 @@ "body": { "id": "WorkerId", "state": "draining", - "queues": ["MainQueue"], + "queues": [ + "MainQueue" + ], "capacity": 10, "labels": {}, "tags": {}, @@ -42,7 +44,9 @@ "body": { "id": "WorkerId", "state": "draining", - "queues": ["MainQueue"], + "queues": [ + "MainQueue" + ], "capacity": 10, "labels": {}, "tags": {}, diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterInactiveWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterInactiveWorker.json index e24d352dc48f..a7e952b85e20 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterInactiveWorker.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_DeregisterInactiveWorker.json @@ -15,7 +15,9 @@ "body": { "id": "WorkerId", "state": "inactive", - "queues": ["MainQueue"], + "queues": [ + "MainQueue" + ], "capacity": 10, "labels": {}, "tags": {}, @@ -42,7 +44,9 @@ "body": { "id": "WorkerId", "state": "inactive", - "queues": ["MainQueue"], + "queues": [ + "MainQueue" + ], "capacity": 10, "labels": {}, "tags": {}, diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json index 920dd65bf3a1..2083096edeca 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json @@ -15,7 +15,10 @@ { "id": "DefaultWorker", "state": "active", - "queues": ["MainQueue", "SecondaryQueue"], + "queues": [ + "MainQueue", + "SecondaryQueue" + ], "capacity": 100, "labels": {}, "tags": {}, @@ -40,7 +43,10 @@ { "id": "SecondWorker", "state": "active", - "queues": ["MainQueue", "SecondaryQueue"], + "queues": [ + "MainQueue", + "SecondaryQueue" + ], "capacity": 100, "labels": {}, "tags": {}, diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorker.json index 684d0b07499d..6af2d8b55c62 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorker.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorker.json @@ -11,7 +11,10 @@ "body": { "id": "DefaultWorker", "state": "active", - "queues": ["MainQueue", "SecondaryQueue"], + "queues": [ + "MainQueue", + "SecondaryQueue" + ], "capacity": 100, "labels": {}, "tags": {}, diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json index 1e92a100b14b..70ad490a9a54 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json @@ -13,7 +13,10 @@ { "id": "DefaultWorker", "state": "active", - "queues": ["MainQueue", "SecondaryQueue"], + "queues": [ + "MainQueue", + "SecondaryQueue" + ], "capacity": 100, "labels": {}, "tags": {}, @@ -38,7 +41,10 @@ { "id": "SecondWorker", "state": "active", - "queues": ["MainQueue", "SecondaryQueue"], + "queues": [ + "MainQueue", + "SecondaryQueue" + ], "capacity": 100, "labels": {}, "tags": {}, diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_RegisterWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_RegisterWorker.json index 80b46064cc7e..646350dc46d6 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_RegisterWorker.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_RegisterWorker.json @@ -15,7 +15,9 @@ "body": { "id": "WorkerId", "state": "active", - "queues": ["MainQueue"], + "queues": [ + "MainQueue" + ], "capacity": 10, "labels": {}, "tags": {}, @@ -42,7 +44,9 @@ "body": { "id": "WorkerId", "state": "active", - "queues": ["MainQueue"], + "queues": [ + "MainQueue" + ], "capacity": 10, "labels": {}, "tags": {}, diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_UpdateWorker.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_UpdateWorker.json index 8a21fa1c8678..0161b1456766 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_UpdateWorker.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_UpdateWorker.json @@ -7,7 +7,10 @@ "workerId": "WorkerId", "resource": { "capacity": 10, - "queues": ["MainQueue", "SecondaryQueue"], + "queues": [ + "MainQueue", + "SecondaryQueue" + ], "labels": {}, "tags": {}, "channels": [ @@ -30,7 +33,9 @@ "body": { "id": "WorkerId", "state": "inactive", - "queues": ["MainQueue"], + "queues": [ + "MainQueue" + ], "capacity": 10, "labels": {}, "tags": {}, @@ -57,7 +62,9 @@ "body": { "id": "WorkerId", "state": "inactive", - "queues": ["MainQueue"], + "queues": [ + "MainQueue" + ], "capacity": 10, "labels": {}, "tags": {}, diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_CreateWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_CreateWorker.json index 005ee8aae10d..39b2a9652dca 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_CreateWorker.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_CreateWorker.json @@ -7,7 +7,9 @@ "workerId": "WorkerId", "resource": { "capacity": 10, - "queues": ["MainQueue"], + "queues": [ + "MainQueue" + ], "labels": {}, "tags": {}, "channels": [ @@ -30,7 +32,9 @@ "body": { "id": "WorkerId", "state": "inactive", - "queues": ["MainQueue"], + "queues": [ + "MainQueue" + ], "capacity": 10, "labels": {}, "tags": {}, @@ -57,7 +61,9 @@ "body": { "id": "WorkerId", "state": "inactive", - "queues": ["MainQueue"], + "queues": [ + "MainQueue" + ], "capacity": 10, "labels": {}, "tags": {}, diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterActiveWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterActiveWorker.json index 0651e3fb0ddf..17dbeebc27f6 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterActiveWorker.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterActiveWorker.json @@ -15,7 +15,9 @@ "body": { "id": "WorkerId", "state": "draining", - "queues": ["MainQueue"], + "queues": [ + "MainQueue" + ], "capacity": 10, "labels": {}, "tags": {}, @@ -42,7 +44,9 @@ "body": { "id": "WorkerId", "state": "draining", - "queues": ["MainQueue"], + "queues": [ + "MainQueue" + ], "capacity": 10, "labels": {}, "tags": {}, diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterInactiveWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterInactiveWorker.json index e24d352dc48f..a7e952b85e20 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterInactiveWorker.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_DeregisterInactiveWorker.json @@ -15,7 +15,9 @@ "body": { "id": "WorkerId", "state": "inactive", - "queues": ["MainQueue"], + "queues": [ + "MainQueue" + ], "capacity": 10, "labels": {}, "tags": {}, @@ -42,7 +44,9 @@ "body": { "id": "WorkerId", "state": "inactive", - "queues": ["MainQueue"], + "queues": [ + "MainQueue" + ], "capacity": 10, "labels": {}, "tags": {}, diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json index 920dd65bf3a1..2083096edeca 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json @@ -15,7 +15,10 @@ { "id": "DefaultWorker", "state": "active", - "queues": ["MainQueue", "SecondaryQueue"], + "queues": [ + "MainQueue", + "SecondaryQueue" + ], "capacity": 100, "labels": {}, "tags": {}, @@ -40,7 +43,10 @@ { "id": "SecondWorker", "state": "active", - "queues": ["MainQueue", "SecondaryQueue"], + "queues": [ + "MainQueue", + "SecondaryQueue" + ], "capacity": 100, "labels": {}, "tags": {}, diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorker.json index 684d0b07499d..6af2d8b55c62 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorker.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorker.json @@ -11,7 +11,10 @@ "body": { "id": "DefaultWorker", "state": "active", - "queues": ["MainQueue", "SecondaryQueue"], + "queues": [ + "MainQueue", + "SecondaryQueue" + ], "capacity": 100, "labels": {}, "tags": {}, diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json index 1e92a100b14b..70ad490a9a54 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json @@ -13,7 +13,10 @@ { "id": "DefaultWorker", "state": "active", - "queues": ["MainQueue", "SecondaryQueue"], + "queues": [ + "MainQueue", + "SecondaryQueue" + ], "capacity": 100, "labels": {}, "tags": {}, @@ -38,7 +41,10 @@ { "id": "SecondWorker", "state": "active", - "queues": ["MainQueue", "SecondaryQueue"], + "queues": [ + "MainQueue", + "SecondaryQueue" + ], "capacity": 100, "labels": {}, "tags": {}, diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_RegisterWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_RegisterWorker.json index 80b46064cc7e..646350dc46d6 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_RegisterWorker.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_RegisterWorker.json @@ -15,7 +15,9 @@ "body": { "id": "WorkerId", "state": "active", - "queues": ["MainQueue"], + "queues": [ + "MainQueue" + ], "capacity": 10, "labels": {}, "tags": {}, @@ -42,7 +44,9 @@ "body": { "id": "WorkerId", "state": "active", - "queues": ["MainQueue"], + "queues": [ + "MainQueue" + ], "capacity": 10, "labels": {}, "tags": {}, diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_UpdateWorker.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_UpdateWorker.json index 8a21fa1c8678..0161b1456766 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_UpdateWorker.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_UpdateWorker.json @@ -7,7 +7,10 @@ "workerId": "WorkerId", "resource": { "capacity": 10, - "queues": ["MainQueue", "SecondaryQueue"], + "queues": [ + "MainQueue", + "SecondaryQueue" + ], "labels": {}, "tags": {}, "channels": [ @@ -30,7 +33,9 @@ "body": { "id": "WorkerId", "state": "inactive", - "queues": ["MainQueue"], + "queues": [ + "MainQueue" + ], "capacity": 10, "labels": {}, "tags": {}, @@ -57,7 +62,9 @@ "body": { "id": "WorkerId", "state": "inactive", - "queues": ["MainQueue"], + "queues": [ + "MainQueue" + ], "capacity": 10, "labels": {}, "tags": {}, From 09f8419478360aeb3a328aa9163f71734f07896d Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 24 Oct 2023 15:21:56 -0700 Subject: [PATCH 056/113] fix more examples --- .../Queues_ListQueuesWithPageSize.json | 24 ++++++++----------- .../Queues_ListQueuesWithPageSize.json | 24 ++++++++----------- 2 files changed, 20 insertions(+), 28 deletions(-) diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_ListQueuesWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_ListQueuesWithPageSize.json index c3ff96fa37cb..59783ed05aba 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_ListQueuesWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_ListQueuesWithPageSize.json @@ -11,23 +11,19 @@ "body": { "value": [ { - "queue": { - "id": "MainQueue", - "name": "Main", - "distributionPolicyId": "MainDistributionPolicy", - "labels": {}, - "exceptionPolicyId": "MainExceptionPolicy" - }, + "id": "MainQueue", + "name": "Main", + "distributionPolicyId": "MainDistributionPolicy", + "labels": {}, + "exceptionPolicyId": "MainExceptionPolicy", "etag": "etag" }, { - "queue": { - "id": "SecondaryQueue", - "name": "Secondary", - "distributionPolicyId": "SecondaryDistributionPolicy", - "labels": {}, - "exceptionPolicyId": "SecondaryExceptionPolicy" - }, + "id": "SecondaryQueue", + "name": "Secondary", + "distributionPolicyId": "SecondaryDistributionPolicy", + "labels": {}, + "exceptionPolicyId": "SecondaryExceptionPolicy", "etag": "etag" } ], diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_ListQueuesWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_ListQueuesWithPageSize.json index c3ff96fa37cb..59783ed05aba 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_ListQueuesWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_ListQueuesWithPageSize.json @@ -11,23 +11,19 @@ "body": { "value": [ { - "queue": { - "id": "MainQueue", - "name": "Main", - "distributionPolicyId": "MainDistributionPolicy", - "labels": {}, - "exceptionPolicyId": "MainExceptionPolicy" - }, + "id": "MainQueue", + "name": "Main", + "distributionPolicyId": "MainDistributionPolicy", + "labels": {}, + "exceptionPolicyId": "MainExceptionPolicy", "etag": "etag" }, { - "queue": { - "id": "SecondaryQueue", - "name": "Secondary", - "distributionPolicyId": "SecondaryDistributionPolicy", - "labels": {}, - "exceptionPolicyId": "SecondaryExceptionPolicy" - }, + "id": "SecondaryQueue", + "name": "Secondary", + "distributionPolicyId": "SecondaryDistributionPolicy", + "labels": {}, + "exceptionPolicyId": "SecondaryExceptionPolicy", "etag": "etag" } ], From 1017ea8ce070072fc09b2c72d4dbc59a24a3b0f8 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 24 Oct 2023 19:42:58 -0700 Subject: [PATCH 057/113] minor doc update --- .../communication/Communication.JobRouter/models.tsp | 3 +-- .../stable/2023-11-01/communicationservicejobrouter.json | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 3b583542d68b..02b79b19606d 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -356,8 +356,7 @@ model ExceptionPolicy { name?: string; @doc(""" -(Optional) A dictionary collection of exception rules on the exception policy. -Key is the Id of each exception rule. +(Optional) A collection of exception rules on the exception policy. """) exceptionRules?: ExceptionRule[]; } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index ff3513b7ccf7..d448406a16e1 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -2438,7 +2438,7 @@ }, "exceptionRules": { "type": "array", - "description": "(Optional) A dictionary collection of exception rules on the exception policy.\nKey is the Id of each exception rule.", + "description": "(Optional) A collection of exception rules on the exception policy.", "items": { "$ref": "#/definitions/ExceptionRule" } @@ -2459,7 +2459,7 @@ }, "exceptionRules": { "type": "array", - "description": "(Optional) A dictionary collection of exception rules on the exception policy.\nKey is the Id of each exception rule.", + "description": "(Optional) A collection of exception rules on the exception policy.", "items": { "$ref": "#/definitions/ExceptionRule" } From ca538d31ae9b58e21bedb7e008aaa13132aa28a9 Mon Sep 17 00:00:00 2001 From: williamzhao87 Date: Wed, 25 Oct 2023 11:41:14 -0400 Subject: [PATCH 058/113] Update projected names and internal modifier --- .../Communication.JobRouter/client.tsp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/specification/communication/Communication.JobRouter/client.tsp b/specification/communication/Communication.JobRouter/client.tsp index d0522669b4da..9fe77aaefd0a 100644 --- a/specification/communication/Communication.JobRouter/client.tsp +++ b/specification/communication/Communication.JobRouter/client.tsp @@ -17,8 +17,9 @@ namespace ClientForAcsJobRouter; }) interface JobRouterAdministrationRestClient { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @internal @projectedName("csharp", "updateDistributionPolicy") + @projectedName("java", "updateDistributionPolicy") + @internal("python") upsertDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertDistributionPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -31,8 +32,9 @@ interface JobRouterAdministrationRestClient { deleteDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteDistributionPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @internal @projectedName("csharp", "updateClassificationPolicy") + @projectedName("java", "updateClassificationPolicy") + @internal("python") upsertClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertClassificationPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -45,8 +47,9 @@ interface JobRouterAdministrationRestClient { deleteClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteClassificationPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @internal @projectedName("csharp", "updateExceptionPolicy") + @projectedName("java", "updateExceptionPolicy") + @internal("python") upsertExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertExceptionPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -59,8 +62,9 @@ interface JobRouterAdministrationRestClient { deleteExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteExceptionPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @internal @projectedName("csharp", "updateQueue") + @projectedName("java", "updateQueue") + @internal("python") upsertQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertQueue; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -79,8 +83,9 @@ interface JobRouterAdministrationRestClient { }) interface JobRouterRestClient { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @internal @projectedName("csharp", "updateJob") + @projectedName("java", "updateJob") + @internal("python") upsertJob is AzureCommunicationRoutingService.JobRouterOperations.upsertJob; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -121,8 +126,9 @@ interface JobRouterRestClient { getQueueStatistics is AzureCommunicationRoutingService.JobRouterOperations.getQueueStatistics; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @internal @projectedName("csharp", "updateWorker") + @projectedName("java", "updateWorker") + @internal("python") upsertWorker is AzureCommunicationRoutingService.JobRouterOperations.upsertWorker; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" From e17a14f8ce8c81305c2d2ef3f2e618730b4c2019 Mon Sep 17 00:00:00 2001 From: williamzhao87 Date: Wed, 25 Oct 2023 12:17:23 -0400 Subject: [PATCH 059/113] Modify internal to only apply for java, csharp, python --- .../Communication.JobRouter/client.tsp | 26 +++++-------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/specification/communication/Communication.JobRouter/client.tsp b/specification/communication/Communication.JobRouter/client.tsp index 9fe77aaefd0a..77402cd0412e 100644 --- a/specification/communication/Communication.JobRouter/client.tsp +++ b/specification/communication/Communication.JobRouter/client.tsp @@ -17,9 +17,7 @@ namespace ClientForAcsJobRouter; }) interface JobRouterAdministrationRestClient { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @projectedName("csharp", "updateDistributionPolicy") - @projectedName("java", "updateDistributionPolicy") - @internal("python") + @internal("csharp", "java", "python") upsertDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertDistributionPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -32,9 +30,7 @@ interface JobRouterAdministrationRestClient { deleteDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteDistributionPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @projectedName("csharp", "updateClassificationPolicy") - @projectedName("java", "updateClassificationPolicy") - @internal("python") + @internal("csharp", "java", "python") upsertClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertClassificationPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -47,9 +43,7 @@ interface JobRouterAdministrationRestClient { deleteClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteClassificationPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @projectedName("csharp", "updateExceptionPolicy") - @projectedName("java", "updateExceptionPolicy") - @internal("python") + @internal("csharp", "java", "python") upsertExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertExceptionPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -62,9 +56,7 @@ interface JobRouterAdministrationRestClient { deleteExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteExceptionPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @projectedName("csharp", "updateQueue") - @projectedName("java", "updateQueue") - @internal("python") + @internal("csharp", "java", "python") upsertQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertQueue; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -83,9 +75,7 @@ interface JobRouterAdministrationRestClient { }) interface JobRouterRestClient { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @projectedName("csharp", "updateJob") - @projectedName("java", "updateJob") - @internal("python") + @internal("csharp", "java", "python") upsertJob is AzureCommunicationRoutingService.JobRouterOperations.upsertJob; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -95,7 +85,7 @@ interface JobRouterRestClient { deleteJob is AzureCommunicationRoutingService.JobRouterOperations.deleteJob; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @internal + @internal("csharp", "java", "python") reclassifyJob is AzureCommunicationRoutingService.JobRouterOperations.reclassifyJobAction; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -126,9 +116,7 @@ interface JobRouterRestClient { getQueueStatistics is AzureCommunicationRoutingService.JobRouterOperations.getQueueStatistics; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @projectedName("csharp", "updateWorker") - @projectedName("java", "updateWorker") - @internal("python") + @internal("csharp", "java", "python") upsertWorker is AzureCommunicationRoutingService.JobRouterOperations.upsertWorker; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" From 2b3645e1adb347217cb859794779636c5f0ab869 Mon Sep 17 00:00:00 2001 From: williamzhao87 Date: Wed, 25 Oct 2023 12:29:09 -0400 Subject: [PATCH 060/113] Update internal --- .../Communication.JobRouter/client.tsp | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/specification/communication/Communication.JobRouter/client.tsp b/specification/communication/Communication.JobRouter/client.tsp index 77402cd0412e..478ef6e1d67f 100644 --- a/specification/communication/Communication.JobRouter/client.tsp +++ b/specification/communication/Communication.JobRouter/client.tsp @@ -17,7 +17,9 @@ namespace ClientForAcsJobRouter; }) interface JobRouterAdministrationRestClient { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @internal("csharp", "java", "python") + @internal("csharp") + @internal("python") + @internal("java") upsertDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertDistributionPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -30,7 +32,9 @@ interface JobRouterAdministrationRestClient { deleteDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteDistributionPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @internal("csharp", "java", "python") + @internal("csharp") + @internal("python") + @internal("java") upsertClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertClassificationPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -43,7 +47,9 @@ interface JobRouterAdministrationRestClient { deleteClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteClassificationPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @internal("csharp", "java", "python") + @internal("csharp") + @internal("python") + @internal("java") upsertExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertExceptionPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -56,7 +62,9 @@ interface JobRouterAdministrationRestClient { deleteExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteExceptionPolicy; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @internal("csharp", "java", "python") + @internal("csharp") + @internal("python") + @internal("java") upsertQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertQueue; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -75,7 +83,9 @@ interface JobRouterAdministrationRestClient { }) interface JobRouterRestClient { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @internal("csharp", "java", "python") + @internal("csharp") + @internal("python") + @internal("java") upsertJob is AzureCommunicationRoutingService.JobRouterOperations.upsertJob; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -85,7 +95,9 @@ interface JobRouterRestClient { deleteJob is AzureCommunicationRoutingService.JobRouterOperations.deleteJob; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @internal("csharp", "java", "python") + @internal("csharp") + @internal("python") + @internal("java") reclassifyJob is AzureCommunicationRoutingService.JobRouterOperations.reclassifyJobAction; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -116,7 +128,9 @@ interface JobRouterRestClient { getQueueStatistics is AzureCommunicationRoutingService.JobRouterOperations.getQueueStatistics; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @internal("csharp", "java", "python") + @internal("csharp") + @internal("python") + @internal("java") upsertWorker is AzureCommunicationRoutingService.JobRouterOperations.upsertWorker; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" From 92ee9fd5087622651975c8f6779289c5bdee5ad9 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Wed, 25 Oct 2023 15:33:48 -0700 Subject: [PATCH 061/113] make upsert method visible for python --- .../communication/Communication.JobRouter/client.tsp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/specification/communication/Communication.JobRouter/client.tsp b/specification/communication/Communication.JobRouter/client.tsp index 478ef6e1d67f..a82f96753a51 100644 --- a/specification/communication/Communication.JobRouter/client.tsp +++ b/specification/communication/Communication.JobRouter/client.tsp @@ -18,7 +18,6 @@ namespace ClientForAcsJobRouter; interface JobRouterAdministrationRestClient { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal("csharp") - @internal("python") @internal("java") upsertDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertDistributionPolicy; @@ -33,7 +32,6 @@ interface JobRouterAdministrationRestClient { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal("csharp") - @internal("python") @internal("java") upsertClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertClassificationPolicy; @@ -48,7 +46,6 @@ interface JobRouterAdministrationRestClient { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal("csharp") - @internal("python") @internal("java") upsertExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertExceptionPolicy; @@ -63,7 +60,6 @@ interface JobRouterAdministrationRestClient { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal("csharp") - @internal("python") @internal("java") upsertQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertQueue; @@ -84,7 +80,6 @@ interface JobRouterAdministrationRestClient { interface JobRouterRestClient { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal("csharp") - @internal("python") @internal("java") upsertJob is AzureCommunicationRoutingService.JobRouterOperations.upsertJob; @@ -129,7 +124,6 @@ interface JobRouterRestClient { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal("csharp") - @internal("python") @internal("java") upsertWorker is AzureCommunicationRoutingService.JobRouterOperations.upsertWorker; From 2cd0ceb218ff7f8ad92ccce30b0f2d610db48d1e Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Wed, 25 Oct 2023 16:12:34 -0700 Subject: [PATCH 062/113] modify enums for python --- .../communication/Communication.JobRouter/models.tsp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 02b79b19606d..d3dd764a598d 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -137,7 +137,7 @@ enum RouterWorkerSelectorStatus { expired, } -@access(Access.internal, "python") +@projectedName("python", "_RouterJobStatusSelector") @doc("Enums used to filters jobs by state") enum RouterJobStatusSelector { @doc("Default") @@ -195,7 +195,7 @@ enum RouterWorkerState { inactive, } -@access(Access.internal, "python") +@projectedName("python", "_RouterWorkerStateSelector") @doc("Enums used to filters workers by state") enum RouterWorkerStateSelector { @doc("Worker is active and available to take offers.") From 4c65f641b5af28cc6a816f1d77295d035ad844fd Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Wed, 25 Oct 2023 16:22:50 -0700 Subject: [PATCH 063/113] revert --- specification/communication/Communication.JobRouter/models.tsp | 2 -- 1 file changed, 2 deletions(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index d3dd764a598d..6e27e3204b13 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -137,7 +137,6 @@ enum RouterWorkerSelectorStatus { expired, } -@projectedName("python", "_RouterJobStatusSelector") @doc("Enums used to filters jobs by state") enum RouterJobStatusSelector { @doc("Default") @@ -195,7 +194,6 @@ enum RouterWorkerState { inactive, } -@projectedName("python", "_RouterWorkerStateSelector") @doc("Enums used to filters workers by state") enum RouterWorkerStateSelector { @doc("Worker is active and available to take offers.") From 930697d1e0a1b46f5b4684277d4a420b296e065b Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 31 Oct 2023 09:01:28 -0700 Subject: [PATCH 064/113] sdk review comment 3 --- .../examples/2023-11-01/Jobs_CancelJob.json | 15 +++++++++++ .../examples/2023-11-01/Jobs_CloseJob.json | 2 +- .../examples/2023-11-01/Jobs_CompleteJob.json | 2 +- .../2023-11-01/Jobs_ReclassifyJob.json | 2 +- .../examples/2023-11-01/Jobs_UnassignJob.json | 2 +- .../2023-11-01/Offers_DeclineJobOffer.json | 2 +- .../Communication.JobRouter/models.tsp | 4 +-- .../Communication.JobRouter/routes.tsp | 12 ++++----- .../communicationservicejobrouter.json | 27 ++++++++++--------- .../2023-11-01/examples/Jobs_CancelJob.json | 15 +++++++++++ .../2023-11-01/examples/Jobs_CloseJob.json | 2 +- .../2023-11-01/examples/Jobs_CompleteJob.json | 2 +- .../examples/Jobs_ReclassifyJob.json | 2 +- .../2023-11-01/examples/Jobs_UnassignJob.json | 2 +- .../examples/Offers_DeclineJobOffer.json | 2 +- 15 files changed, 63 insertions(+), 30 deletions(-) create mode 100644 specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CancelJob.json create mode 100644 specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CancelJob.json diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CancelJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CancelJob.json new file mode 100644 index 000000000000..a5000d4c7fe9 --- /dev/null +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CancelJob.json @@ -0,0 +1,15 @@ +{ + "title": "Cancels a job", + "operationId": "JobRouterOperations_CancelJobAction", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "jobId": "8780b28c-7079-4de1-9143-4d369289e958", + "options": {} + }, + "responses": { + "200": { + "body": {} + } + } +} diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CloseJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CloseJob.json index 616d59972955..0a735cefdd8d 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CloseJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CloseJob.json @@ -5,7 +5,7 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "jobId": "8780b28c-7079-4de1-9143-4d369289e958", - "closeJobOptions": { + "options": { "assignmentId": "1d5896f3-8b54-40be-82d3-910323f5e2af", "dispositionCode": "JobCompleted.", "note": "Closing job" diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CompleteJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CompleteJob.json index 534c4056a3bb..fc1c61bb99e3 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CompleteJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CompleteJob.json @@ -5,7 +5,7 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "jobId": "8780b28c-7079-4de1-9143-4d369289e958", - "completeJobOptions": { + "options": { "assignmentId": "1d5896f3-8b54-40be-82d3-910323f5e2af", "note": "Completing job" } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_ReclassifyJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_ReclassifyJob.json index 706b69b44f1d..71e2d121c4fe 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_ReclassifyJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_ReclassifyJob.json @@ -5,7 +5,7 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "jobId": "8780b28c-7079-4de1-9143-4d369289e958", - "reclassifyJobOptions": {} + "options": {} }, "responses": { "200": { diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UnassignJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UnassignJob.json index 21a2d4200bc2..9eede13acd99 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UnassignJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UnassignJob.json @@ -6,7 +6,7 @@ "api-version": "2023-11-01", "jobId": "8780b28c-7079-4de1-9143-4d369289e958", "assignmentId": "1d5896f3-8b54-40be-82d3-910323f5e2af", - "unassignJobOptions": { + "options": { "suspendMatching": false } }, diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_DeclineJobOffer.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_DeclineJobOffer.json index 78f699cf386d..5f361cdb807e 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_DeclineJobOffer.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_DeclineJobOffer.json @@ -6,7 +6,7 @@ "api-version": "2023-11-01", "workerId": "DefaultWorker", "offerId": "1d5896f3-8b54-40be-82d3-910323f5e2af", - "declineJobOfferRequest": { + "options": { "retryOfferAt": "2023-05-26T00:00:00.0000000Z" } }, diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 6e27e3204b13..536ccecc4b3d 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -119,13 +119,13 @@ enum LabelOperator { lessThan, @doc("Less than or equal") - lessThanEqual, + lessThanOrEqual, @doc("Greater than") greaterThan, @doc("Greater than or equal") - greaterThanEqual, + greaterThanOrEqual, } @doc("The status of the worker selector.") diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index 7b5530247c5f..b38a7e54e402 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -165,7 +165,7 @@ interface JobRouterOperations { @doc("Request object for reclassifying a job.") @body - reclassifyJobOptions?: ReclassifyJobOptions; + options?: ReclassifyJobOptions; }, ReclassfiyJobOkReponse >; @@ -189,7 +189,7 @@ cancellation reason. @doc("Request model for cancelling job.") @body - cancelJobOptions?: CancelJobOptions; + options?: CancelJobOptions; }, CancelJobResultWithOkResponse >; @@ -207,7 +207,7 @@ cancellation reason. @doc("Request model for completing job.") @body - completeJobOptions: CompleteJobOptions; + options: CompleteJobOptions; }, CompleteJobResultWithOkResponse >; @@ -225,7 +225,7 @@ cancellation reason. @doc("Request model for closing job.") @body - closeJobOptions: CloseJobOptions; + options: CloseJobOptions; }, CloseJobResultResponse >; @@ -271,7 +271,7 @@ cancellation reason. @doc("Request body for unassign route.") @body - unassignJobOptions?: UnassignJobOptions; + options?: UnassignJobOptions; }, UnassignJobResult >; @@ -317,7 +317,7 @@ accepted the job already. @doc("Request model for declining offer.") @body - declineJobOfferOptions?: DeclineJobOfferOptions; + options?: DeclineJobOfferOptions; }, DeclineJobOfferResultWithOkResponse >; diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index d448406a16e1..256469becb76 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -991,7 +991,7 @@ "type": "string" }, { - "name": "reclassifyJobOptions", + "name": "options", "in": "body", "description": "Request object for reclassifying a job.", "required": false, @@ -1041,7 +1041,7 @@ "type": "string" }, { - "name": "cancelJobOptions", + "name": "options", "in": "body", "description": "Request model for cancelling job.", "required": false, @@ -1068,6 +1068,9 @@ } }, "x-ms-examples": { + "Cancels a job": { + "$ref": "./examples/Jobs_CancelJob.json" + }, "Submits request to cancel an existing job": { "$ref": "./examples/Jobs_RequestJobCancel.json" } @@ -1091,7 +1094,7 @@ "type": "string" }, { - "name": "completeJobOptions", + "name": "options", "in": "body", "description": "Request model for completing job.", "required": true, @@ -1141,7 +1144,7 @@ "type": "string" }, { - "name": "closeJobOptions", + "name": "options", "in": "body", "description": "Request model for closing job.", "required": true, @@ -1201,7 +1204,7 @@ "type": "string" }, { - "name": "unassignJobOptions", + "name": "options", "in": "body", "description": "Request body for unassign route.", "required": false, @@ -1884,7 +1887,7 @@ "type": "string" }, { - "name": "declineJobOfferOptions", + "name": "options", "in": "body", "description": "Request model for declining offer.", "required": false, @@ -2662,9 +2665,9 @@ "equal", "notEqual", "lessThan", - "lessThanEqual", + "lessThanOrEqual", "greaterThan", - "greaterThanEqual" + "greaterThanOrEqual" ], "x-ms-enum": { "name": "LabelOperator", @@ -2686,8 +2689,8 @@ "description": "Less than" }, { - "name": "lessThanEqual", - "value": "lessThanEqual", + "name": "lessThanOrEqual", + "value": "lessThanOrEqual", "description": "Less than or equal" }, { @@ -2696,8 +2699,8 @@ "description": "Greater than" }, { - "name": "greaterThanEqual", - "value": "greaterThanEqual", + "name": "greaterThanOrEqual", + "value": "greaterThanOrEqual", "description": "Greater than or equal" } ] diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CancelJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CancelJob.json new file mode 100644 index 000000000000..a5000d4c7fe9 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CancelJob.json @@ -0,0 +1,15 @@ +{ + "title": "Cancels a job", + "operationId": "JobRouterOperations_CancelJobAction", + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2023-11-01", + "jobId": "8780b28c-7079-4de1-9143-4d369289e958", + "options": {} + }, + "responses": { + "200": { + "body": {} + } + } +} diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json index 616d59972955..0a735cefdd8d 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json @@ -5,7 +5,7 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "jobId": "8780b28c-7079-4de1-9143-4d369289e958", - "closeJobOptions": { + "options": { "assignmentId": "1d5896f3-8b54-40be-82d3-910323f5e2af", "dispositionCode": "JobCompleted.", "note": "Closing job" diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CompleteJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CompleteJob.json index 534c4056a3bb..fc1c61bb99e3 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CompleteJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CompleteJob.json @@ -5,7 +5,7 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "jobId": "8780b28c-7079-4de1-9143-4d369289e958", - "completeJobOptions": { + "options": { "assignmentId": "1d5896f3-8b54-40be-82d3-910323f5e2af", "note": "Completing job" } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_ReclassifyJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_ReclassifyJob.json index 706b69b44f1d..71e2d121c4fe 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_ReclassifyJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_ReclassifyJob.json @@ -5,7 +5,7 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "jobId": "8780b28c-7079-4de1-9143-4d369289e958", - "reclassifyJobOptions": {} + "options": {} }, "responses": { "200": { diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UnassignJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UnassignJob.json index 21a2d4200bc2..9eede13acd99 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UnassignJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UnassignJob.json @@ -6,7 +6,7 @@ "api-version": "2023-11-01", "jobId": "8780b28c-7079-4de1-9143-4d369289e958", "assignmentId": "1d5896f3-8b54-40be-82d3-910323f5e2af", - "unassignJobOptions": { + "options": { "suspendMatching": false } }, diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_DeclineJobOffer.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_DeclineJobOffer.json index 78f699cf386d..5f361cdb807e 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_DeclineJobOffer.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_DeclineJobOffer.json @@ -6,7 +6,7 @@ "api-version": "2023-11-01", "workerId": "DefaultWorker", "offerId": "1d5896f3-8b54-40be-82d3-910323f5e2af", - "declineJobOfferRequest": { + "options": { "retryOfferAt": "2023-05-26T00:00:00.0000000Z" } }, From 1904f7513f20cca9cabf9b4810289af2491e4e5f Mon Sep 17 00:00:00 2001 From: williamzhao87 Date: Tue, 31 Oct 2023 14:17:23 -0400 Subject: [PATCH 065/113] Test generator without endpoint --- specification/communication/Communication.JobRouter/.gitignore | 3 ++- specification/communication/Communication.JobRouter/main.tsp | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/specification/communication/Communication.JobRouter/.gitignore b/specification/communication/Communication.JobRouter/.gitignore index 93d3320a42a9..eb8fd25336b8 100644 --- a/specification/communication/Communication.JobRouter/.gitignore +++ b/specification/communication/Communication.JobRouter/.gitignore @@ -1,2 +1,3 @@ **/package.json -**/package-lock.json \ No newline at end of file +**/package-lock.json +**/.npmrc \ No newline at end of file diff --git a/specification/communication/Communication.JobRouter/main.tsp b/specification/communication/Communication.JobRouter/main.tsp index 4899dcbaae78..bb2d70526d2c 100644 --- a/specification/communication/Communication.JobRouter/main.tsp +++ b/specification/communication/Communication.JobRouter/main.tsp @@ -14,10 +14,9 @@ using TypeSpec.Versioning; title: "Azure Communication Routing Service", }) @server( - "{endpoint}", + "", "Azure Communication Routing Service", { - endpoint: string, } ) @versioned(Versions) From 5ce22f24343accbeed3342f1c73084963fe2c5ff Mon Sep 17 00:00:00 2001 From: williamzhao87 Date: Tue, 31 Oct 2023 14:49:26 -0400 Subject: [PATCH 066/113] Revert change --- specification/communication/Communication.JobRouter/main.tsp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/specification/communication/Communication.JobRouter/main.tsp b/specification/communication/Communication.JobRouter/main.tsp index bb2d70526d2c..4899dcbaae78 100644 --- a/specification/communication/Communication.JobRouter/main.tsp +++ b/specification/communication/Communication.JobRouter/main.tsp @@ -14,9 +14,10 @@ using TypeSpec.Versioning; title: "Azure Communication Routing Service", }) @server( - "", + "{endpoint}", "Azure Communication Routing Service", { + endpoint: string, } ) @versioned(Versions) From 68c1fc5e48fafa13fec12ee0b10a32b50667f299 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 31 Oct 2023 17:08:24 -0700 Subject: [PATCH 067/113] manually add empty response schemas in swagger because of https://github.com/Azure/azure-rest-api-specs/issues/25605#issuecomment-1736265997 --- .../communicationservicejobrouter.json | 36 +++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index 256469becb76..c9b7a7598349 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -1002,7 +1002,11 @@ ], "responses": { "200": { - "description": "The request has succeeded." + "description": "The request has succeeded.", + "schema": { + "type": "object", + "additionalProperties": {} + } }, "default": { "description": "An unexpected error response.", @@ -1052,7 +1056,11 @@ ], "responses": { "200": { - "description": "The request has succeeded." + "description": "The request has succeeded.", + "schema": { + "type": "object", + "additionalProperties": {} + } }, "default": { "description": "An unexpected error response.", @@ -1105,7 +1113,11 @@ ], "responses": { "200": { - "description": "The request has succeeded." + "description": "The request has succeeded.", + "schema": { + "type": "object", + "additionalProperties": {} + } }, "default": { "description": "An unexpected error response.", @@ -1155,10 +1167,18 @@ ], "responses": { "200": { - "description": "The request has succeeded." + "description": "The request has succeeded.", + "schema": { + "type": "object", + "additionalProperties": {} + } }, "202": { - "description": "The request has been accepted for processing, but processing has not yet completed." + "description": "The request has been accepted for processing, but processing has not yet completed.", + "schema": { + "type": "object", + "additionalProperties": {} + } }, "default": { "description": "An unexpected error response.", @@ -1898,7 +1918,11 @@ ], "responses": { "200": { - "description": "The request has succeeded." + "description": "The request has succeeded.", + "schema": { + "type": "object", + "additionalProperties": {} + } }, "default": { "description": "An unexpected error response.", From eaab91bc4982ddfa84cdfc18f315e0d0f6737065 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 31 Oct 2023 18:49:55 -0700 Subject: [PATCH 068/113] add linter in tspconfig.yaml --- .../Communication.JobRouter/models.tsp | 20 +++++++++++++++++++ .../Communication.JobRouter/tspconfig.yaml | 4 ++++ 2 files changed, 24 insertions(+) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 536ccecc4b3d..79dc7dfd9d3f 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -440,6 +440,7 @@ worker must satisfy in order to process this job. @visibility("read") attachedWorkerSelectors?: RouterWorkerSelector[]; + #suppress "@azure-tools/typespec-azure-core/bad-record-type" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." @doc(""" A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. @@ -453,6 +454,7 @@ Key is AssignmentId. @visibility("read") assignments?: Record; + #suppress "@azure-tools/typespec-azure-core/bad-record-type" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." @doc("A set of non-identifying attributes attached to this job") tags?: Record; @@ -494,6 +496,8 @@ label selector """) labelOperator: LabelOperator; + #suppress "@azure-tools/typespec-azure-core/bad-record-type" + #suppress "@azure-tools/typespec-azure-core/no-unknown" @doc("The value to compare against the actual label value with the given operator") value?: unknown; @@ -726,6 +730,7 @@ to workers. """) distributionPolicyId?: string; + #suppress "@azure-tools/typespec-azure-core/bad-record-type" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." @doc(""" A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. @@ -781,12 +786,14 @@ model RouterWorker { @doc("The total capacity score this worker has to manage multiple concurrent jobs.") capacity?: int32; + #suppress "@azure-tools/typespec-azure-core/bad-record-type" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." @doc(""" A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. """) labels?: Record; + #suppress "@azure-tools/typespec-azure-core/bad-record-type" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." @doc("A set of non-identifying attributes attached to this worker.") tags?: Record; @@ -1010,6 +1017,8 @@ label selector """) labelOperator: LabelOperator; + #suppress "@azure-tools/typespec-azure-core/no-unknown" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." + #suppress "@azure-tools/typespec-azure-core/bad-record-type" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." @doc("The value to compare against the actual label value with the given operator") value?: unknown; } @@ -1137,6 +1146,7 @@ model ManualReclassifyExceptionAction extends ExceptionAction { kind: "manual-reclassify"; } +#suppress "@azure-tools/typespec-azure-core/casing-style" "This is standard naming convention for OAuth." @doc(""" OAuth2.0 Credentials used to Contoso's Authorization server. Reference: @@ -1215,6 +1225,8 @@ and worker selectors. """) classificationPolicyId?: string; + + #suppress "@azure-tools/typespec-azure-core/bad-record-type" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." @doc(""" (optional) Dictionary containing the labels to update (or add if not existing) in key-value pairs @@ -1297,6 +1309,8 @@ A rule providing static rules that always return the same result, regardless of input. """) model StaticRouterRule extends RouterRule { + #suppress "@azure-tools/typespec-azure-core/bad-record-type" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." + #suppress "@azure-tools/typespec-azure-core/no-unknown" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." @doc("The static value this rule always returns.") value?: unknown; @@ -1424,6 +1438,7 @@ alias CommonListParams = { maxpagesize?: int32; }; +@doc("List jobs query parameters") model ListJobQueryParams { ...CommonListParams; @@ -1458,22 +1473,27 @@ If specified, filter on jobs that was scheduled at or after given value. Range: scheduledAfter?: utcDateTime; } +@doc("List classification policies query parameters") model ListClassificationPoliciesQueryParams { ...CommonListParams; } +@doc("List distribution policies query parameters") model ListDistributionPoliciesQueryParams { ...CommonListParams; } +@doc("List exception policies query parameters") model ListExceptionPoliciesQueryParams { ...CommonListParams; } +@doc("List queues query parameters") model ListQueuesQueryParams { ...CommonListParams; } +@doc("List workers query parameters") model ListWorkerQueryParams { ...CommonListParams; diff --git a/specification/communication/Communication.JobRouter/tspconfig.yaml b/specification/communication/Communication.JobRouter/tspconfig.yaml index 6183662db134..01757c205a02 100644 --- a/specification/communication/Communication.JobRouter/tspconfig.yaml +++ b/specification/communication/Communication.JobRouter/tspconfig.yaml @@ -17,6 +17,10 @@ emit: [ "@azure-tools/typespec-autorest" ] +linter: + extends: + - "@azure-tools/typespec-azure-core/all" + options: "@azure-tools/typespec-autorest": azure-resource-provider-folder: "data-plane" From 61f2db842eab2fbaf5dae047eb68f85e9b72fbc3 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 31 Oct 2023 19:01:59 -0700 Subject: [PATCH 069/113] add to custom words --- custom-words.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/custom-words.txt b/custom-words.txt index 9155b87056f2..64087c4c0915 100644 --- a/custom-words.txt +++ b/custom-words.txt @@ -562,6 +562,7 @@ continuationtoken continuousdataexports continuouswebjobs contoso +Contoso's contosodataset contosomedia contributer From 1c3077bcc2e95f67ee0730bbf80c8d8a0a15de77 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Thu, 2 Nov 2023 14:07:39 -0700 Subject: [PATCH 070/113] doc updates --- .../Communication.JobRouter/client.tsp | 24 - .../Communication.JobRouter/models.tsp | 568 +++------------- .../Communication.JobRouter/routes.tsp | 80 +-- .../communicationservicejobrouter.json | 616 +++++++++--------- 4 files changed, 411 insertions(+), 877 deletions(-) diff --git a/specification/communication/Communication.JobRouter/client.tsp b/specification/communication/Communication.JobRouter/client.tsp index a82f96753a51..8628e8a202cc 100644 --- a/specification/communication/Communication.JobRouter/client.tsp +++ b/specification/communication/Communication.JobRouter/client.tsp @@ -16,60 +16,44 @@ namespace ClientForAcsJobRouter; service: AzureCommunicationRoutingService }) interface JobRouterAdministrationRestClient { - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal("csharp") @internal("java") upsertDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertDistributionPolicy; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" getDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getDistributionPolicy; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" listDistributionPolicies is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listDistributionPolicies; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" deleteDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteDistributionPolicy; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal("csharp") @internal("java") upsertClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertClassificationPolicy; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" getClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getClassificationPolicy; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" listClassificationPolicies is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listClassificationPolicies; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" deleteClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteClassificationPolicy; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal("csharp") @internal("java") upsertExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertExceptionPolicy; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" getExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getExceptionPolicy; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" listExceptionPolicies is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listExceptionPolicies; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" deleteExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteExceptionPolicy; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal("csharp") @internal("java") upsertQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertQueue; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" getQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getQueue; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" listQueues is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listQueues; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" deleteQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteQueue; } @@ -78,15 +62,12 @@ interface JobRouterAdministrationRestClient { service: AzureCommunicationRoutingService }) interface JobRouterRestClient { - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal("csharp") @internal("java") upsertJob is AzureCommunicationRoutingService.JobRouterOperations.upsertJob; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" getJob is AzureCommunicationRoutingService.JobRouterOperations.getJob; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" deleteJob is AzureCommunicationRoutingService.JobRouterOperations.deleteJob; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -104,7 +85,6 @@ interface JobRouterRestClient { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" closeJob is AzureCommunicationRoutingService.JobRouterOperations.closeJobAction; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" listJobs is AzureCommunicationRoutingService.JobRouterOperations.listJobs; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -122,17 +102,13 @@ interface JobRouterRestClient { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" getQueueStatistics is AzureCommunicationRoutingService.JobRouterOperations.getQueueStatistics; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal("csharp") @internal("java") upsertWorker is AzureCommunicationRoutingService.JobRouterOperations.upsertWorker; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" getWorker is AzureCommunicationRoutingService.JobRouterOperations.getWorker; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" deleteWorker is AzureCommunicationRoutingService.JobRouterOperations.deleteWorker; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" listWorkers is AzureCommunicationRoutingService.JobRouterOperations.listWorkers; } \ No newline at end of file diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 79dc7dfd9d3f..7f0eb1e937fe 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -227,7 +227,7 @@ enum ExpressionRouterRuleLanguage { @resource("classificationPolicies") @doc("A container for the rules that govern how jobs are classified.") model ClassificationPolicy { - ...RouterPageableEntity, + ...EtagProperty; @key("classificationPolicyId") @doc("Unique identifier of this policy.") @@ -243,21 +243,7 @@ model ClassificationPolicy { @doc("The queue selector attachments used to resolve a queue for a given job.") queueSelectorAttachments?: QueueSelectorAttachment[]; - @doc(""" -A rule of one of the following types: - -StaticRule: A rule -providing static rules that always return the same result, regardless of -input. -DirectMapRule: A rule that return the same labels as the input -labels. -ExpressionRule: A rule providing inline expression -rules. -FunctionRule: A rule providing a binding to an HTTP Triggered Azure -Function. -WebhookRule: A rule providing a binding to a webserver following -OAuth2.0 authentication protocol. -""") + @doc("The rule to determine a priority score for a given job.") prioritizationRule?: RouterRule; @doc("The worker selector attachments used to attach worker selectors to a given job.") @@ -266,18 +252,11 @@ OAuth2.0 authentication protocol. @doc(""" A rule of one of the following types: - -StaticRule: A rule -providing static rules that always return the same result, regardless of -input. -DirectMapRule: A rule that return the same labels as the input -labels. -ExpressionRule: A rule providing inline expression -rules. -FunctionRule: A rule providing a binding to an HTTP Triggered Azure -Function. -WebhookRule: A rule providing a binding to a webserver following -OAuth2.0 authentication protocol. +StaticRule: A rule providing static rules that always return the same result, regardless of input. +DirectMapRule: A rule that return the same labels as the input labels. +ExpressionRule: A rule providing inline expression rules. +FunctionRule: A rule providing a binding to an HTTP Triggered Azure Function. +WebhookRule: A rule providing a binding to a webserver following OAuth2.0 authentication protocol. """) @discriminator("kind") model RouterRule { @@ -285,14 +264,11 @@ model RouterRule { kind: string; } -@doc("A paged collection of classification policies.") -model ClassificationPolicyCollection - is RouterPagedCollection; @resource("distributionPolicies") @doc("Policy governing how jobs are distributed to workers") model DistributionPolicy { - ...RouterPageableEntity, + ...EtagProperty; @key("distributionPolicyId") @doc("The unique identifier of the policy.") @@ -302,10 +278,7 @@ model DistributionPolicy { @doc("The human readable name of the policy.") name?: string; - @doc(""" -The number of seconds after which any offers created under this policy will be -expired. -""") + @doc("The number of seconds after which any offers created under this policy will be expired.") offerExpiresAfterSeconds?: float64; @doc("Abstract base class for defining a distribution mode") @@ -321,41 +294,28 @@ model DistributionMode { @doc("Governs the maximum number of active concurrent offers a job can have.") maxConcurrentOffers?: int32; - @doc(""" -(Optional) -If set to true, then router will match workers to jobs even if they -don't match label selectors. -Warning: You may get workers that are not -qualified for the job they are matched with if you set this -variable to true. -This flag is intended more for temporary usage. -By default, set to false. -""") + @doc("If set to true, then router will match workers to jobs even if they don't match label selectors. Warning: You may get workers that are not qualified for the job they are matched with if you set this variable to true. This flag is intended more for temporary usage. By default, set to false.") bypassSelectors?: boolean; @doc("The type discriminator describing a sub-type of DistributionMode") kind: string; } -@doc("A paged collection of distribution policies.") -model DistributionPolicyCollection is RouterPagedCollection; @resource("exceptionPolicies") @doc("A policy that defines actions to execute when exception are triggered.") model ExceptionPolicy { - ...RouterPageableEntity, + ...EtagProperty; @key("exceptionPolicyId") @doc("The Id of the exception policy") @visibility("read") id: string; - @doc("(Optional) The name of the exception policy.") + @doc("The name of the exception policy.") name?: string; - @doc(""" -(Optional) A collection of exception rules on the exception policy. -""") + @doc("A collection of exception rules on the exception policy.") exceptionRules?: ExceptionRule[]; } @@ -379,8 +339,6 @@ model ExceptionTrigger { kind: string; } -@doc("A paged collection of exception policies.") -model ExceptionPolicyCollection is RouterPagedCollection; @doc("A note attached to a job.") model RouterJobNote { @@ -394,7 +352,7 @@ model RouterJobNote { @resource("jobs") @doc("A unit of work to be routed") model RouterJob { - ...RouterPageableEntity, + ...EtagProperty; @key("jobId") @doc("The id of the job.") @@ -427,30 +385,18 @@ model RouterJob { @doc("Reason code for cancelled or closed jobs.") dispositionCode?: string; - @doc(""" -A collection of manually specified label selectors, which a worker must satisfy -in order to process this job. -""") + @doc("A collection of manually specified label selectors, which a worker must satisfy in order to process this job.") requestedWorkerSelectors?: RouterWorkerSelector[]; - @doc(""" -A collection of label selectors attached by a classification policy, which a -worker must satisfy in order to process this job. -""") + @doc("A collection of label selectors attached by a classification policy, which a worker must satisfy in order to process this job.") @visibility("read") attachedWorkerSelectors?: RouterWorkerSelector[]; #suppress "@azure-tools/typespec-azure-core/bad-record-type" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." - @doc(""" -A set of key/value pairs that are identifying attributes used by the rules -engines to make decisions. -""") + @doc("A set of key/value pairs that are identifying attributes used by the rules engines to make decisions.") labels?: Record; - @doc(""" -A collection of the assignments of the job. -Key is AssignmentId. -""") + @doc("A collection of the assignments of the job. Key is AssignmentId.") @visibility("read") assignments?: Record; @@ -465,35 +411,16 @@ Key is AssignmentId. @visibility("read") scheduledAt?: utcDateTime; - @doc(""" -The matching mode to be applied to this job. - -Supported types: - - -QueueAndMatchMode: Used when matching worker to a job is required to be -done right after job is queued. -ScheduleAndSuspendMode: Used for scheduling -jobs to be queued at a future time. At specified time, matching of a worker to -the job will not start automatically. -SuspendMode: Used when matching workers -to a job needs to be suspended. -""") + @doc("If provided, will determine how job matching will be carried out. Default mode: QueueAndMatchMode.") matchingMode?: JobMatchingMode; } -@doc(""" -Describes a condition that must be met against a set of labels for worker -selection -""") +@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") key: string; - @doc(""" -Describes how the value of the label is compared to the value defined on the -label selector -""") + @doc("Describes how the value of the label is compared to the value defined on the label selector") labelOperator: LabelOperator; #suppress "@azure-tools/typespec-azure-core/bad-record-type" @@ -539,18 +466,10 @@ model RouterJobAssignment { } @doc(""" -The matching mode to be applied to this job. - -Supported types: - - -QueueAndMatchMode: Used when matching worker to a job is required to be -done right after job is queued. -ScheduleAndSuspendMode: Used for scheduling -jobs to be queued at a future time. At specified time, matching of a worker to -the job will not start automatically. -SuspendMode: Used when matching workers -to a job needs to be suspended. +A matching mode of one of the following types: +QueueAndMatchMode: Used when matching worker to a job is required to be done right after job is queued. +ScheduleAndSuspendMode: Used for scheduling jobs to be queued at a future time. At specified time, matching of a worker to the job will not start automatically. +SuspendMode: Used when matching workers to a job needs to be suspended. """) @discriminator("kind") model JobMatchingMode { @@ -558,12 +477,7 @@ model JobMatchingMode { kind: string; } -@doc(""" -Describes a matching mode used for scheduling jobs to be queued at a future -time. -At the specified time, matching worker to a job will not start -automatically. -""") +@doc("Describes a matching mode used for scheduling jobs to be queued at a future time. At the specified time, matching worker to a job will not start automatically.") model ScheduleAndSuspendMode extends JobMatchingMode { @doc("Scheduled time.") @@ -589,17 +503,10 @@ model SuspendMode extends JobMatchingMode { @doc("Request payload for deleting a job") model CancelJobOptions { - @doc(""" -(Optional) A note that will be appended to the jobs' Notes collection with the -current timestamp. -""") + @doc("A note that will be appended to the jobs' Notes collection with the current timestamp.") note?: string; - @doc(""" -Indicates the outcome of the job, populate this field with your own custom -values. -If not provided, default value of \"Cancelled\" is set. -""") + @doc("Indicates the outcome of the job, populate this field with your own custom values. If not provided, default value of \"Cancelled\" is set.") dispositionCode?: string; } @@ -608,10 +515,7 @@ model CompleteJobOptions { @doc("The assignment within the job to complete.") assignmentId: string; - @doc(""" -(Optional) A note that will be appended to the jobs' Notes collection with the -current timestamp. -""") + @doc("A note that will be appended to the jobs' Notes collection with the current timestamp.") note?: string; } @@ -620,31 +524,17 @@ model CloseJobOptions { @doc("The assignment within which the job is to be closed.") assignmentId: string; - @doc(""" -Indicates the outcome of the job, populate this field with your own custom -values. -""") + @doc("Indicates the outcome of the job, populate this field with your own custom values.") dispositionCode?: string; - @doc(""" -If not provided, worker capacity is released immediately along with a -JobClosedEvent notification. -If provided, worker capacity is released along -with a JobClosedEvent notification at a future time in UTC. -""") + @doc("If not provided, worker capacity is released immediately along with a JobClosedEvent notification. If provided, worker capacity is released along with a JobClosedEvent notification at a future time in UTC.") closeAt?: utcDateTime; - @doc(""" -(Optional) A note that will be appended to the jobs' Notes collection with the -current timestamp. -""") + @doc("A note that will be appended to the jobs' Notes collection with the current timestamp.") note?: string; } -@doc("A paged collection of jobs.") -model RouterJobCollection is RouterPagedCollection; - @doc("Position and estimated wait time for a job.") model RouterJobPositionDetails { @doc("Id of the job these details are about.") @@ -665,10 +555,7 @@ model RouterJobPositionDetails { @doc("Request payload for unassigning a job.") model UnassignJobOptions { - @doc(""" -If SuspendMatching is true, then the job is not queued for re-matching with a -worker. -""") + @doc("If SuspendMatching is true, then the job is not queued for re-matching with a worker.") suspendMatching?: boolean; } @@ -681,10 +568,7 @@ model UnassignJobResult { unassignmentCount: int32; } -@doc(""" -Response containing Id's for the worker, job, and assignment from an accepted -offer -""") +@doc("Response containing Id's for the worker, job, and assignment from an accepted offer") model AcceptJobOfferResult { @doc("The assignment Id that assigns a worker that has accepted an offer to a job.") assignmentId: string; @@ -698,15 +582,7 @@ model AcceptJobOfferResult { @doc("Request payload for declining offers") model DeclineJobOfferOptions { - @doc(""" -If the RetryOfferAt is not provided, then this job will not be offered again to -the worker who declined this job unless -the worker is de-registered and -re-registered. If a RetryOfferAt time 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. -""") + @doc("If the RetryOfferAt is not provided, then this job will not be offered again to the worker who declined this job unless the worker is de-registered and re-registered. If a RetryOfferAt time 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.") retryOfferAt?: utcDateTime; } @@ -714,7 +590,7 @@ declined the job will also be eligible for the job at that time. @resource("queues") @doc("A queue that can contain jobs to be routed.") model RouterQueue { - ...RouterPageableEntity, + ...EtagProperty; @key("queueId") @doc("The Id of this queue") @@ -724,29 +600,17 @@ model RouterQueue { @doc("The name of this queue.") name?: string; - @doc(""" -The ID of the distribution policy that will determine how a job is distributed -to workers. -""") + @doc("The ID of the distribution policy that will determine how a job is distributed to workers.") distributionPolicyId?: string; #suppress "@azure-tools/typespec-azure-core/bad-record-type" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." - @doc(""" -A set of key/value pairs that are identifying attributes used by the rules -engines to make decisions. -""") + @doc("A set of key/value pairs that are identifying attributes used by the rules engines to make decisions.") labels?: Record; - @doc(""" -(Optional) The ID of the exception policy that determines various job -escalation rules. -""") + @doc("The ID of the exception policy that determines various job escalation rules.") exceptionPolicyId?: string; } -@doc("A paged collection of queues.") -model RouterQueueCollection is RouterPagedCollection; - @doc("Statistics for the queue") model RouterQueueStatistics { @doc("Id of the queue these details are about.") @@ -755,10 +619,7 @@ model RouterQueueStatistics { @doc("Length of the queue: total number of enqueued jobs.") length: int32; - @doc(""" -The estimated wait time of this queue rounded up to the nearest minute, grouped -by job priority -""") + @doc("The estimated wait time of this queue rounded up to the nearest minute, grouped by job priority") estimatedWaitTimeMinutes?: Record; @doc("The wait time of the job that has been enqueued in this queue for the longest.") @@ -769,7 +630,7 @@ by job priority @resource("workers") @doc("An entity for jobs to be routed to") model RouterWorker { - ...RouterPageableEntity, + ...EtagProperty; @key("workerId") @doc("Id of the worker.") @@ -787,10 +648,7 @@ model RouterWorker { capacity?: int32; #suppress "@azure-tools/typespec-azure-core/bad-record-type" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." - @doc(""" -A set of key/value pairs that are identifying attributes used by the rules -engines to make decisions. -""") + @doc("A set of key/value pairs that are identifying attributes used by the rules engines to make decisions.") labels?: Record; #suppress "@azure-tools/typespec-azure-core/bad-record-type" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." @@ -808,10 +666,7 @@ engines to make decisions. @visibility("read") assignedJobs?: RouterWorkerAssignment[]; - @doc(""" -A value indicating the workers capacity. A value of '1' means all capacity is -consumed. A value of '0' means no capacity is currently consumed. -""") + @doc("A value indicating the workers capacity. A value of '1' means all capacity is consumed. A value of '0' means no capacity is currently consumed.") @visibility("read") loadRatio?: float64; @@ -825,10 +680,7 @@ model RouterChannel { @doc("Id of the channel.") channelId: string; - @doc(""" -The amount of capacity that an instance of a job of this channel will consume -of the total worker capacity. -""") + @doc("The amount of capacity that an instance of a job of this channel will consume of the total worker capacity.") capacityCostPerJob: int32; @doc("The maximum number of jobs that can be supported concurrently for this channel.") @@ -871,92 +723,39 @@ model RouterWorkerAssignment { assignedAt: utcDateTime; } -@doc("A paged collection of workers.") -model RouterWorkerCollection is RouterPagedCollection; - @doc("Jobs are distributed to the worker with the strongest abilities available.") model BestWorkerMode extends DistributionMode { - @doc(""" -A rule of one of the following types: - -StaticRule: A rule -providing static rules that always return the same result, regardless of -input. -DirectMapRule: A rule that return the same labels as the input -labels. -ExpressionRule: A rule providing inline expression -rules. -FunctionRule: A rule providing a binding to an HTTP Triggered Azure -Function. -WebhookRule: A rule providing a binding to a webserver following -OAuth2.0 authentication protocol. -""") + @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).") scoringRule?: RouterRule; - @doc(""" -Encapsulates all options that can be passed as parameters for scoring rule with -BestWorkerMode -""") + @doc("Options to configure 'scoringRule'. If not set, default values are used.") scoringRuleOptions?: ScoringRuleOptions; @doc("The type discriminator describing a sub-type of Mode") kind: "best-worker"; } -@doc(""" -Encapsulates all options that can be passed as parameters for scoring rule with -BestWorkerMode -""") +@doc("Encapsulates all options that can be passed as parameters for scoring rule with BestWorkerMode") model ScoringRuleOptions { - @doc(""" -(Optional) Set batch size when AllowScoringBatchOfWorkers is set to true. -Defaults to 20 if not configured. -""") + @doc("Set batch size when 'isBatchScoringEnabled' is set to true. Defaults to 20 if not configured.") batchSize?: int32; - @doc(""" -(Optional) List of extra parameters from the job that will be sent as part of -the payload to scoring rule. -If not set, the job's labels (sent in the payload -as `job`) and the job's worker selectors (sent in the payload as -`selectors`) -are added to the payload of the scoring rule by default. -Note: -Worker labels are always sent with scoring payload. -""") + @doc("List of extra parameters from the job that will be sent as part of the payload to scoring rule. If not set, the job's labels (sent in the payload as `job`) and the job's worker selectors (sent in the payload as `selectors`) are added to the payload of the scoring rule by default. Note: Worker labels are always sent with scoring payload.") scoringParameters?: ScoringRuleParameterSelector[]; - @doc(""" -(Optional) -If set to true, will score workers in batches, and the parameter -name of the worker labels will be sent as `workers`. -By default, set to false -and the parameter name for the worker labels will be sent as `worker`. -Note: If -enabled, use BatchSize to set batch size. -""") + @doc("If set to true, will score workers in batches, and the parameter name of the worker labels will be sent as `workers`. By default, set to false and the parameter name for the worker labels will be sent as `worker`. Note: If enabled, use 'batchSize' to set batch size.") isBatchScoringEnabled?: boolean; - @doc(""" -(Optional) -If false, will sort scores by ascending order. By default, set to -true. -""") + @doc("If false, will sort scores by ascending order. By default, set to true.") descendingOrder?: boolean; } @doc("An action that marks a job as cancelled") model CancelExceptionAction extends ExceptionAction { - @doc(""" -(Optional) A note that will be appended to the jobs' Notes collection with the -current timestamp. -""") + @doc("A note that will be appended to the jobs' Notes collection with the current timestamp.") note?: string; - @doc(""" -(Optional) Indicates the outcome of the job, populate this field with your own -custom values. -""") + @doc("Indicates the outcome of the job, populate this field with your own custom values.") dispositionCode?: string; @doc("The type discriminator describing a sub-type of ExceptionAction") @@ -974,26 +773,9 @@ model ExceptionAction { kind: string; } -@doc(""" -Describes a set of queue selectors that will be attached if the given condition -resolves to true -""") +@doc("Describes a set of queue selectors that will be attached if the given condition resolves to true") model ConditionalQueueSelectorAttachment extends QueueSelectorAttachment { - @doc(""" -A rule of one of the following types: - -StaticRule: A rule -providing static rules that always return the same result, regardless of -input. -DirectMapRule: A rule that return the same labels as the input -labels. -ExpressionRule: A rule providing inline expression -rules. -FunctionRule: A rule providing a binding to an HTTP Triggered Azure -Function. -WebhookRule: A rule providing a binding to a webserver following -OAuth2.0 authentication protocol. -""") + @doc("The condition that must be true for the queue selectors to be attached") condition: RouterRule; @doc("The queue selectors to attach") @@ -1003,18 +785,12 @@ OAuth2.0 authentication protocol. kind: "conditional"; } -@doc(""" -Describes a condition that must be met against a set of labels for queue -selection -""") +@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") key: string; - @doc(""" -Describes how the value of the label is compared to the value defined on the -label selector -""") + @doc("Describes how the value of the label is compared to the value defined on the label selector") labelOperator: LabelOperator; #suppress "@azure-tools/typespec-azure-core/no-unknown" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." @@ -1023,36 +799,16 @@ label selector value?: unknown; } -@doc(""" -An attachment of queue selectors to resolve a queue to a job from a -classification policy -""") +@doc("An attachment of queue selectors to resolve a queue to a job from a classification policy") @discriminator("kind") model QueueSelectorAttachment { @doc("The type discriminator describing a sub-type of QueueSelectorAttachment") kind: string; } -@doc(""" -Describes a set of worker selectors that will be attached if the given -condition resolves to true -""") +@doc("Describes a set of worker selectors that will be attached if the given condition resolves to true") model ConditionalWorkerSelectorAttachment extends WorkerSelectorAttachment { - @doc(""" -A rule of one of the following types: - -StaticRule: A rule -providing static rules that always return the same result, regardless of -input. -DirectMapRule: A rule that return the same labels as the input -labels. -ExpressionRule: A rule providing inline expression -rules. -FunctionRule: A rule providing a binding to an HTTP Triggered Azure -Function. -WebhookRule: A rule providing a binding to a webserver following -OAuth2.0 authentication protocol. -""") + @doc("The condition that must be true for the worker selectors to be attached") condition: RouterRule; @doc("The worker selectors to attach") @@ -1080,10 +836,7 @@ model ExpressionRouterRule extends RouterRule { @doc("The expression language to compile to and execute") language?: ExpressionRouterRuleLanguage; - @doc(""" -The string containing the expression to evaluate. Should contain return -statement with calculated values. -""") + @doc("The string containing the expression to evaluate. Should contain return statement with calculated values.") expression: string; @doc("The type discriminator describing a sub-type of Rule") @@ -1104,21 +857,13 @@ model FunctionRouterRule extends RouterRule { @doc("Credentials used to access Azure function rule") model FunctionRouterRuleCredential { - @doc("(Optional) Access key scoped to a particular function") + @doc("Access key scoped to a particular function") functionKey?: string; - @doc(""" -(Optional) Access key scoped to a Azure Function app. -This key grants access to -all functions under the app. -""") + @doc("Access key scoped to a Azure Function app. This key grants access to all functions under the app.") appKey?: string; - @doc(""" -(Optional) Client id, when AppKey is provided -In context of Azure function, -this is usually the name of the key -""") + @doc("Client id, when AppKey is provided In context of Azure function, this is usually the name of the key") clientId?: string; } @@ -1128,10 +873,7 @@ model LongestIdleMode extends DistributionMode { kind: "longest-idle"; } -@doc(""" -An action that manually reclassifies a job by providing the queue, priority and -worker selectors. -""") +@doc("An action that manually reclassifies a job by providing the queue, priority and worker selectors.") model ManualReclassifyExceptionAction extends ExceptionAction { @doc("Updated QueueId.") queueId?: string; @@ -1147,11 +889,7 @@ model ManualReclassifyExceptionAction extends ExceptionAction { } #suppress "@azure-tools/typespec-azure-core/casing-style" "This is standard naming convention for OAuth." -@doc(""" -OAuth2.0 Credentials used to Contoso's Authorization server. -Reference: -https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/ -""") +@doc("OAuth2.0 Credentials used to Contoso's Authorization server. Reference: https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/") model OAuth2WebhookClientCredential { @doc("ClientId for Contoso Authorization server.") clientId?: string; @@ -1160,10 +898,7 @@ model OAuth2WebhookClientCredential { clientSecret?: string; } -@doc(""" -Attaches a queue selector where the value is passed through from the job label -with the same key -""") +@doc("Attaches a queue selector where the value is passed through from the job label with the same key") model PassThroughQueueSelectorAttachment extends QueueSelectorAttachment { @doc("The label key to query against") key: string; @@ -1175,10 +910,7 @@ model PassThroughQueueSelectorAttachment extends QueueSelectorAttachment { kind: "pass-through"; } -@doc(""" -Attaches a worker selector where the value is passed through from the job label -with the same key -""") +@doc("Attaches a worker selector where the value is passed through from the job label with the same key") model PassThroughWorkerSelectorAttachment extends WorkerSelectorAttachment { @doc("The label key to query against") key: string; @@ -1202,45 +934,30 @@ model QueueLengthExceptionTrigger extends ExceptionTrigger { kind: "queue-length"; } -@doc(""" -Contains the weight percentage and queue selectors to be applied if selected -for weighted distributions. -""") +@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.") weight: float64; - @doc(""" -A collection of queue selectors that will be applied if this allocation is -selected. -""") + @doc("A collection of queue selectors that will be applied if this allocation is selected.") queueSelectors: RouterQueueSelector[]; } @doc("An action that modifies labels on a job and then reclassifies it") model ReclassifyExceptionAction extends ExceptionAction { - @doc(""" -(optional) The new classification policy that will determine queue, priority -and worker selectors. -""") + @doc("The new classification policy that will determine queue, priority and worker selectors.") classificationPolicyId?: string; #suppress "@azure-tools/typespec-azure-core/bad-record-type" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." - @doc(""" -(optional) Dictionary containing the labels to update (or add if not existing) -in key-value pairs -""") + @doc("Dictionary containing the labels to update (or add if not existing) in key-value pairs") labelsToUpsert?: Record; @doc("The type discriminator describing a sub-type of ExceptionAction") kind: "reclassify"; } -@doc(""" -Jobs are distributed in order to workers, starting with the worker that is -after the last worker to receive a job. -""") +@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: "round-robin"; @@ -1248,21 +965,7 @@ model RoundRobinMode extends DistributionMode { @doc("Attaches queue selectors to a job when the RouterRule is resolved") model RuleEngineQueueSelectorAttachment extends QueueSelectorAttachment { - @doc(""" -A rule of one of the following types: - -StaticRule: A rule -providing static rules that always return the same result, regardless of -input. -DirectMapRule: A rule that return the same labels as the input -labels. -ExpressionRule: A rule providing inline expression -rules. -FunctionRule: A rule providing a binding to an HTTP Triggered Azure -Function. -WebhookRule: A rule providing a binding to a webserver following -OAuth2.0 authentication protocol. -""") + @doc("A RouterRule that resolves a collection of queue selectors to attach") rule: RouterRule; @doc("The type discriminator describing the type of queue selector attachment") @@ -1271,21 +974,7 @@ OAuth2.0 authentication protocol. @doc("Attaches worker selectors to a job when a RouterRule is resolved") model RuleEngineWorkerSelectorAttachment extends WorkerSelectorAttachment { - @doc(""" -A rule of one of the following types: - -StaticRule: A rule -providing static rules that always return the same result, regardless of -input. -DirectMapRule: A rule that return the same labels as the input -labels. -ExpressionRule: A rule providing inline expression -rules. -FunctionRule: A rule providing a binding to an HTTP Triggered Azure -Function. -WebhookRule: A rule providing a binding to a webserver following -OAuth2.0 authentication protocol. -""") + @doc("A RouterRule that resolves a collection of worker selectors to attach") rule: RouterRule; @doc("The type discriminator describing the type of worker selector attachment") @@ -1294,20 +983,14 @@ OAuth2.0 authentication protocol. @doc("Describes a queue selector that will be attached to the job") model StaticQueueSelectorAttachment extends QueueSelectorAttachment { - @doc(""" -Describes a condition that must be met against a set of labels for queue -selection -""") + @doc("The queue selector to attach.") queueSelector: RouterQueueSelector; @doc("The type discriminator describing the type of queue selector attachment") kind: "static"; } -@doc(""" -A rule providing static rules that always return the same result, regardless of -input. -""") +@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/bad-record-type" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." #suppress "@azure-tools/typespec-azure-core/no-unknown" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." @@ -1320,10 +1003,7 @@ model StaticRouterRule extends RouterRule { @doc("Describes a worker selector that will be attached to the job") model StaticWorkerSelectorAttachment extends WorkerSelectorAttachment { - @doc(""" -Describes a condition that must be met against a set of labels for worker -selection -""") + @doc("The worker selector to attach.") workerSelector: RouterWorkerSelector; @doc("The type discriminator describing the type of worker selector attachment") @@ -1344,11 +1024,7 @@ model WebhookRouterRule extends RouterRule { @doc("Uri for Authorization Server.") authorizationServerUri?: url; - @doc(""" -OAuth2.0 Credentials used to Contoso's Authorization server. -Reference: -https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/ -""") + @doc("OAuth2.0 Credentials used to Contoso's Authorization server. Reference: https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/") clientCredential?: OAuth2WebhookClientCredential; @doc("Uri for Contoso's Web Server.") @@ -1358,10 +1034,7 @@ https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/ kind: "webhook-rule"; } -@doc(""" -Describes multiple sets of queue selectors, of which one will be selected and -attached according to a weighting -""") +@doc("Describes multiple sets of queue selectors, of which one will be selected and attached according to a weighting") model WeightedAllocationQueueSelectorAttachment extends QueueSelectorAttachment { @doc("A collection of percentage based weighted allocations.") @@ -1371,10 +1044,7 @@ model WeightedAllocationQueueSelectorAttachment kind: "weighted-allocation-queue-selector"; } -@doc(""" -Describes multiple sets of worker selectors, of which one will be selected and -attached according to a weighting -""") +@doc("Describes multiple sets of worker selectors, of which one will be selected and attached according to a weighting") model WeightedAllocationWorkerSelectorAttachment extends WorkerSelectorAttachment { @doc("A collection of percentage based weighted allocations.") @@ -1384,18 +1054,12 @@ model WeightedAllocationWorkerSelectorAttachment kind: "weighted-allocation-worker-selector"; } -@doc(""" -Contains the weight percentage and worker selectors to be applied if selected -for weighted distributions. -""") +@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.") weight: float64; - @doc(""" -A collection of worker selectors that will be applied if this allocation is -selected. -""") + @doc("A collection of worker selectors that will be applied if this allocation is selected.") workerSelectors: RouterWorkerSelector[]; } @@ -1438,8 +1102,7 @@ alias CommonListParams = { maxpagesize?: int32; }; -@doc("List jobs query parameters") -model ListJobQueryParams { +alias ListJobQueryParams = ListQueryParametersTrait<{ ...CommonListParams; @doc("If specified, filter jobs by status.") @@ -1458,43 +1121,32 @@ model ListJobQueryParams { @query classificationPolicyId?: string; - @doc(""" -If specified, filter on jobs that was scheduled before or at given timestamp. -Range: (-Inf, scheduledBefore]. -""") + @doc("If specified, filter on jobs that was scheduled before or at given timestamp. Range: (-Inf, scheduledBefore].") @query scheduledBefore?: utcDateTime; - @doc(""" -If specified, filter on jobs that was scheduled at or after given value. Range: -[scheduledAfter, +Inf). -""") + @doc("If specified, filter on jobs that was scheduled at or after given value. Range: [scheduledAfter, +Inf).") @query scheduledAfter?: utcDateTime; -} +}>; -@doc("List classification policies query parameters") -model ListClassificationPoliciesQueryParams { +alias ListClassificationPoliciesQueryParams = ListQueryParametersTrait<{ ...CommonListParams; -} +}>; -@doc("List distribution policies query parameters") -model ListDistributionPoliciesQueryParams { +alias ListDistributionPoliciesQueryParams = ListQueryParametersTrait<{ ...CommonListParams; -} +}>; -@doc("List exception policies query parameters") -model ListExceptionPoliciesQueryParams { +alias ListExceptionPoliciesQueryParams = ListQueryParametersTrait<{ ...CommonListParams; -} +}>; -@doc("List queues query parameters") -model ListQueuesQueryParams { +alias ListQueuesQueryParams = ListQueryParametersTrait<{ ...CommonListParams; -} +}>; -@doc("List workers query parameters") -model ListWorkerQueryParams { +alias ListWorkerQueryParams = ListQueryParametersTrait<{ ...CommonListParams; @doc("If specified, select workers by worker state.") @@ -1509,35 +1161,11 @@ model ListWorkerQueryParams { @query queueId?: string; - @doc(""" -If set to true, select only workers who have capacity for the channel specified -by `channelId` or for any channel if `channelId` not specified. If set to -false, then will return all workers including workers without any capacity for -jobs. Defaults to false. -""") + @doc("If set to true, select only workers who have capacity for the channel specified by `channelId` or for any channel if `channelId` not specified. If set to false, then will return all workers including workers without any capacity for jobs. Defaults to false.") @query hasCapacity?: boolean; -} - -@doc("Base class for all pageable entities") -model RouterPageableEntity { - @doc("Concurrency Token.") - @visibility("read") - etag: eTag; -} - -@pagedResult -@friendlyName("Paged{name}", TResource) -@doc("Paged collection of {name} items", TResource) -model RouterPagedCollection { - @doc("The {name} items on this page", TResource) - @items - value: TResource[]; +}>; - @doc("The link to the next page of items") - @nextLink - nextLink?: string; -} @doc("JobRouter Versions") enum Versions { diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index b38a7e54e402..2e36696c4944 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -37,15 +37,11 @@ interface JobRouterAdministrationOperations { @route("/routing") deleteClassificationPolicy is Operations.ResourceDelete; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves existing classification policies.") @doc("Retrieves existing classification policies.") - @route("/routing/classificationPolicies") - @list - listClassificationPolicies is Azure.Core.Foundations.Operation< - ListClassificationPoliciesQueryParams, - ClassificationPolicyCollection - >; + @route("/routing") + listClassificationPolicies is Operations.ResourceList; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a distribution policy.") @@ -65,15 +61,11 @@ interface JobRouterAdministrationOperations { @route("/routing") deleteDistributionPolicy is Operations.ResourceDelete; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves existing distribution policies.") @doc("Retrieves existing distribution policies.") - @route("/routing/distributionPolicies") - @list - listDistributionPolicies is Azure.Core.Foundations.Operation< - ListDistributionPoliciesQueryParams, - DistributionPolicyCollection - >; + @route("/routing") + listDistributionPolicies is Operations.ResourceList; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a exception policy.") @@ -93,15 +85,11 @@ interface JobRouterAdministrationOperations { @route("/routing") deleteExceptionPolicy is Operations.ResourceDelete; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves existing exception policies.") @doc("Retrieves existing exception policies.") - @route("/routing/exceptionPolicies") - @list - listExceptionPolicies is Azure.Core.Foundations.Operation< - ListExceptionPoliciesQueryParams, - ExceptionPolicyCollection - >; + @route("/routing") + listExceptionPolicies is Operations.ResourceList; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a queue.") @@ -121,15 +109,11 @@ interface JobRouterAdministrationOperations { @route("/routing") deleteQueue is Operations.ResourceDelete; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves existing queues.") @doc("Retrieves existing queues.") - @route("/routing/queues") - @list - listQueues is Azure.Core.Foundations.Operation< - ListQueuesQueryParams, - RouterQueueCollection - >; + @route("/routing") + listQueues is Operations.ResourceList; } interface JobRouterOperations { @@ -171,14 +155,8 @@ interface JobRouterOperations { >; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @summary(""" -Submits request to cancel an existing job by Id while supplying free-form -cancellation reason. -""") - @doc(""" -Submits request to cancel an existing job by Id while supplying free-form -cancellation reason. -""") + @summary("Submits request to cancel an existing job by Id while supplying free-form cancellation reason.") + @doc("Submits request to cancel an existing job by Id while supplying free-form cancellation reason.") @route("/routing/jobs/{jobId}:cancel") @post cancelJobAction is Azure.Core.Foundations.Operation< @@ -230,15 +208,11 @@ cancellation reason. CloseJobResultResponse >; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves list of jobs based on filter parameters.") @doc("Retrieves list of jobs based on filter parameters.") - @route("/routing/jobs") - @list - listJobs is Azure.Core.Foundations.Operation< - ListJobQueryParams, - RouterJobCollection - >; + @route("/routing") + listJobs is Operations.ResourceList; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Gets a job's position details.") @@ -277,14 +251,8 @@ cancellation reason. >; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @summary(""" -Accepts an offer to work on a job and returns a 409/Conflict if another agent -accepted the job already. -""") - @doc(""" -Accepts an offer to work on a job and returns a 409/Conflict if another agent -accepted the job already. -""") + @summary("Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already.") + @doc("Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already.") @route("/routing/workers/{workerId}/offers/{offerId}:accept") @post acceptJobAction is Azure.Core.Foundations.Operation< @@ -354,13 +322,9 @@ accepted the job already. @route("/routing") deleteWorker is Operations.ResourceDelete; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves existing workers.") @doc("Retrieves existing workers.") - @route("/routing/workers") - @list - listWorkers is Azure.Core.Foundations.Operation< - ListWorkerQueryParams, - RouterWorkerCollection - >; + @route("/routing") + listWorkers is Operations.ResourceList; } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index c9b7a7598349..9bc873f0eb9f 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -741,22 +741,141 @@ "format": "int32" }, { - "$ref": "#/parameters/ListJobQueryParams.status" + "name": "status", + "in": "query", + "description": "If specified, filter jobs by status.", + "required": false, + "type": "string", + "default": "all", + "enum": [ + "all", + "pendingClassification", + "queued", + "assigned", + "completed", + "closed", + "cancelled", + "classificationFailed", + "created", + "pendingSchedule", + "scheduled", + "scheduleFailed", + "waitingForActivation", + "active" + ], + "x-ms-enum": { + "name": "RouterJobStatusSelector", + "modelAsString": true, + "values": [ + { + "name": "all", + "value": "all", + "description": "Default" + }, + { + "name": "pendingClassification", + "value": "pendingClassification", + "description": "Job is waiting to be classified." + }, + { + "name": "queued", + "value": "queued", + "description": "Job has been queued." + }, + { + "name": "assigned", + "value": "assigned", + "description": "Job has been assigned to a worker." + }, + { + "name": "completed", + "value": "completed", + "description": "Job has been completed by a worker." + }, + { + "name": "closed", + "value": "closed", + "description": "Job has been closed by a worker." + }, + { + "name": "cancelled", + "value": "cancelled", + "description": "Job has been cancelled." + }, + { + "name": "classificationFailed", + "value": "classificationFailed", + "description": "Classification process failed for the job." + }, + { + "name": "created", + "value": "created", + "description": "Job has been created." + }, + { + "name": "pendingSchedule", + "value": "pendingSchedule", + "description": "Job has been created but not been scheduled yet." + }, + { + "name": "scheduled", + "value": "scheduled", + "description": "Job has been scheduled successfully." + }, + { + "name": "scheduleFailed", + "value": "scheduleFailed", + "description": "Job scheduling failed." + }, + { + "name": "waitingForActivation", + "value": "waitingForActivation", + "description": "Job is in a suspended state and waiting for an update." + }, + { + "name": "active", + "value": "active", + "description": "Job is in a state of PendingClassification or Queued or Assigned or ClassificationFailed or Completed or PendingSchedule or Scheduled or ScheduleFailed or WaitingForActivation." + } + ] + } }, { - "$ref": "#/parameters/ListJobQueryParams.queueId" + "name": "queueId", + "in": "query", + "description": "If specified, filter jobs by queue.", + "required": false, + "type": "string" }, { - "$ref": "#/parameters/ListJobQueryParams.channelId" + "name": "channelId", + "in": "query", + "description": "If specified, filter jobs by channel.", + "required": false, + "type": "string" }, { - "$ref": "#/parameters/ListJobQueryParams.classificationPolicyId" + "name": "classificationPolicyId", + "in": "query", + "description": "If specified, filter jobs by classificationPolicy.", + "required": false, + "type": "string" }, { - "$ref": "#/parameters/ListJobQueryParams.scheduledBefore" + "name": "scheduledBefore", + "in": "query", + "description": "If specified, filter on jobs that was scheduled before or at given timestamp. Range: (-Inf, scheduledBefore].", + "required": false, + "type": "string", + "format": "date-time" }, { - "$ref": "#/parameters/ListJobQueryParams.scheduledAfter" + "name": "scheduledAfter", + "in": "query", + "description": "If specified, filter on jobs that was scheduled at or after given value. Range: [scheduledAfter, +Inf).", + "required": false, + "type": "string", + "format": "date-time" } ], "responses": { @@ -1031,8 +1150,8 @@ "/routing/jobs/{jobId}:cancel": { "post": { "operationId": "JobRouterOperations_CancelJobAction", - "summary": "Submits request to cancel an existing job by Id while supplying free-form\ncancellation reason.", - "description": "Submits request to cancel an existing job by Id while supplying free-form\ncancellation reason.", + "summary": "Submits request to cancel an existing job by Id while supplying free-form cancellation reason.", + "description": "Submits request to cancel an existing job by Id while supplying free-form cancellation reason.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -1596,16 +1715,65 @@ "format": "int32" }, { - "$ref": "#/parameters/ListWorkerQueryParams.state" + "name": "state", + "in": "query", + "description": "If specified, select workers by worker state.", + "required": false, + "type": "string", + "default": "all", + "enum": [ + "active", + "draining", + "inactive", + "all" + ], + "x-ms-enum": { + "name": "RouterWorkerStateSelector", + "modelAsString": true, + "values": [ + { + "name": "active", + "value": "active", + "description": "Worker is active and available to take offers." + }, + { + "name": "draining", + "value": "draining", + "description": "Worker is not active, if there are existing offers they are being revoked. No new offers are sent." + }, + { + "name": "inactive", + "value": "inactive", + "description": "Worker is not active. No new offers are sent." + }, + { + "name": "all", + "value": "all", + "description": "Worker is active or draining or inactive." + } + ] + } }, { - "$ref": "#/parameters/ListWorkerQueryParams.channelId" + "name": "channelId", + "in": "query", + "description": "If specified, select workers who have a channel configuration with this channel.", + "required": false, + "type": "string" }, { - "$ref": "#/parameters/ListWorkerQueryParams.queueId" + "name": "queueId", + "in": "query", + "description": "If specified, select workers who are assigned to this queue.", + "required": false, + "type": "string" }, { - "$ref": "#/parameters/ListWorkerQueryParams.hasCapacity" + "name": "hasCapacity", + "in": "query", + "description": "If set to true, select only workers who have capacity for the channel specified by `channelId` or for any channel if `channelId` not specified. If set to false, then will return all workers including workers without any capacity for jobs. Defaults to false.", + "required": false, + "type": "boolean" } ], "responses": { @@ -1835,8 +2003,8 @@ "/routing/workers/{workerId}/offers/{offerId}:accept": { "post": { "operationId": "JobRouterOperations_AcceptJobAction", - "summary": "Accepts an offer to work on a job and returns a 409/Conflict if another agent\naccepted the job already.", - "description": "Accepts an offer to work on a job and returns a 409/Conflict if another agent\naccepted the job already.", + "summary": "Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already.", + "description": "Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -1948,7 +2116,7 @@ "definitions": { "AcceptJobOfferResult": { "type": "object", - "description": "Response containing Id's for the worker, job, and assignment from an accepted\noffer", + "description": "Response containing Id's for the worker, job, and assignment from an accepted offer", "properties": { "assignmentId": { "type": "string", @@ -2041,11 +2209,11 @@ "properties": { "scoringRule": { "$ref": "#/definitions/RouterRule", - "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol." + "description": "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)." }, "scoringRuleOptions": { "$ref": "#/definitions/ScoringRuleOptions", - "description": "Encapsulates all options that can be passed as parameters for scoring rule with\nBestWorkerMode" + "description": "Options to configure 'scoringRule'. If not set, default values are used." } }, "allOf": [ @@ -2061,11 +2229,11 @@ "properties": { "scoringRule": { "$ref": "#/definitions/RouterRuleCreateOrUpdate", - "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol." + "description": "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)." }, "scoringRuleOptions": { "$ref": "#/definitions/ScoringRuleOptions", - "description": "Encapsulates all options that can be passed as parameters for scoring rule with\nBestWorkerMode" + "description": "Options to configure 'scoringRule'. If not set, default values are used." } }, "allOf": [ @@ -2081,11 +2249,11 @@ "properties": { "note": { "type": "string", - "description": "(Optional) A note that will be appended to the jobs' Notes collection with the\ncurrent timestamp." + "description": "A note that will be appended to the jobs' Notes collection with the current timestamp." }, "dispositionCode": { "type": "string", - "description": "(Optional) Indicates the outcome of the job, populate this field with your own\ncustom values." + "description": "Indicates the outcome of the job, populate this field with your own custom values." } }, "allOf": [ @@ -2101,11 +2269,11 @@ "properties": { "note": { "type": "string", - "description": "(Optional) A note that will be appended to the jobs' Notes collection with the\ncurrent timestamp." + "description": "A note that will be appended to the jobs' Notes collection with the current timestamp." }, "dispositionCode": { "type": "string", - "description": "Indicates the outcome of the job, populate this field with your own custom\nvalues.\nIf not provided, default value of \"Cancelled\" is set." + "description": "Indicates the outcome of the job, populate this field with your own custom values. If not provided, default value of \"Cancelled\" is set." } } }, @@ -2115,7 +2283,7 @@ "properties": { "etag": { "$ref": "#/definitions/Azure.Core.eTag", - "description": "Concurrency Token.", + "description": "The entity tag for this resource.", "readOnly": true }, "id": { @@ -2141,7 +2309,7 @@ }, "prioritizationRule": { "$ref": "#/definitions/RouterRule", - "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol." + "description": "The rule to determine a priority score for a given job." }, "workerSelectorAttachments": { "type": "array", @@ -2179,7 +2347,7 @@ }, "prioritizationRule": { "$ref": "#/definitions/RouterRuleCreateOrUpdate", - "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol." + "description": "The rule to determine a priority score for a given job." }, "workerSelectorAttachments": { "type": "array", @@ -2201,16 +2369,16 @@ }, "dispositionCode": { "type": "string", - "description": "Indicates the outcome of the job, populate this field with your own custom\nvalues." + "description": "Indicates the outcome of the job, populate this field with your own custom values." }, "closeAt": { "type": "string", "format": "date-time", - "description": "If not provided, worker capacity is released immediately along with a\nJobClosedEvent notification.\nIf provided, worker capacity is released along\nwith a JobClosedEvent notification at a future time in UTC." + "description": "If not provided, worker capacity is released immediately along with a JobClosedEvent notification. If provided, worker capacity is released along with a JobClosedEvent notification at a future time in UTC." }, "note": { "type": "string", - "description": "(Optional) A note that will be appended to the jobs' Notes collection with the\ncurrent timestamp." + "description": "A note that will be appended to the jobs' Notes collection with the current timestamp." } }, "required": [ @@ -2227,7 +2395,7 @@ }, "note": { "type": "string", - "description": "(Optional) A note that will be appended to the jobs' Notes collection with the\ncurrent timestamp." + "description": "A note that will be appended to the jobs' Notes collection with the current timestamp." } }, "required": [ @@ -2236,11 +2404,11 @@ }, "ConditionalQueueSelectorAttachment": { "type": "object", - "description": "Describes a set of queue selectors that will be attached if the given condition\nresolves to true", + "description": "Describes a set of queue selectors that will be attached if the given condition resolves to true", "properties": { "condition": { "$ref": "#/definitions/RouterRule", - "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol." + "description": "The condition that must be true for the queue selectors to be attached" }, "queueSelectors": { "type": "array", @@ -2264,11 +2432,11 @@ }, "ConditionalWorkerSelectorAttachment": { "type": "object", - "description": "Describes a set of worker selectors that will be attached if the given\ncondition resolves to true", + "description": "Describes a set of worker selectors that will be attached if the given condition resolves to true", "properties": { "condition": { "$ref": "#/definitions/RouterRule", - "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol." + "description": "The condition that must be true for the worker selectors to be attached" }, "workerSelectors": { "type": "array", @@ -2297,7 +2465,7 @@ "retryOfferAt": { "type": "string", "format": "date-time", - "description": "If the RetryOfferAt is not provided, then this job will not be offered again to\nthe worker who declined this job unless\nthe worker is de-registered and\nre-registered. If a RetryOfferAt time is provided, then the job will be\nre-matched to\neligible workers at the retry time in UTC. The worker that\ndeclined the job will also be eligible for the job at that time." + "description": "If the RetryOfferAt is not provided, then this job will not be offered again to the worker who declined this job unless the worker is de-registered and re-registered. If a RetryOfferAt time 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." } } }, @@ -2337,7 +2505,7 @@ }, "bypassSelectors": { "type": "boolean", - "description": "(Optional)\nIf set to true, then router will match workers to jobs even if they\ndon't match label selectors.\nWarning: You may get workers that are not\nqualified for the job they are matched with if you set this\nvariable to true.\nThis flag is intended more for temporary usage.\nBy default, set to false." + "description": "If set to true, then router will match workers to jobs even if they don't match label selectors. Warning: You may get workers that are not qualified for the job they are matched with if you set this variable to true. This flag is intended more for temporary usage. By default, set to false." }, "kind": { "type": "string", @@ -2365,7 +2533,7 @@ }, "bypassSelectors": { "type": "boolean", - "description": "(Optional)\nIf set to true, then router will match workers to jobs even if they\ndon't match label selectors.\nWarning: You may get workers that are not\nqualified for the job they are matched with if you set this\nvariable to true.\nThis flag is intended more for temporary usage.\nBy default, set to false." + "description": "If set to true, then router will match workers to jobs even if they don't match label selectors. Warning: You may get workers that are not qualified for the job they are matched with if you set this variable to true. This flag is intended more for temporary usage. By default, set to false." }, "kind": { "type": "string", @@ -2380,7 +2548,7 @@ "properties": { "etag": { "$ref": "#/definitions/Azure.Core.eTag", - "description": "Concurrency Token.", + "description": "The entity tag for this resource.", "readOnly": true }, "id": { @@ -2395,7 +2563,7 @@ "offerExpiresAfterSeconds": { "type": "number", "format": "double", - "description": "The number of seconds after which any offers created under this policy will be\nexpired." + "description": "The number of seconds after which any offers created under this policy will be expired." }, "mode": { "$ref": "#/definitions/DistributionMode", @@ -2418,7 +2586,7 @@ "offerExpiresAfterSeconds": { "type": "number", "format": "double", - "description": "The number of seconds after which any offers created under this policy will be\nexpired." + "description": "The number of seconds after which any offers created under this policy will be expired." }, "mode": { "$ref": "#/definitions/DistributionModeCreateOrUpdate", @@ -2451,7 +2619,7 @@ "properties": { "etag": { "$ref": "#/definitions/Azure.Core.eTag", - "description": "Concurrency Token.", + "description": "The entity tag for this resource.", "readOnly": true }, "id": { @@ -2461,11 +2629,11 @@ }, "name": { "type": "string", - "description": "(Optional) The name of the exception policy." + "description": "The name of the exception policy." }, "exceptionRules": { "type": "array", - "description": "(Optional) A collection of exception rules on the exception policy.", + "description": "A collection of exception rules on the exception policy.", "items": { "$ref": "#/definitions/ExceptionRule" } @@ -2482,11 +2650,11 @@ "properties": { "name": { "type": "string", - "description": "(Optional) The name of the exception policy." + "description": "The name of the exception policy." }, "exceptionRules": { "type": "array", - "description": "(Optional) A collection of exception rules on the exception policy.", + "description": "A collection of exception rules on the exception policy.", "items": { "$ref": "#/definitions/ExceptionRule" } @@ -2543,7 +2711,7 @@ }, "expression": { "type": "string", - "description": "The string containing the expression to evaluate. Should contain return\nstatement with calculated values." + "description": "The string containing the expression to evaluate. Should contain return statement with calculated values." } }, "required": [ @@ -2566,7 +2734,7 @@ }, "expression": { "type": "string", - "description": "The string containing the expression to evaluate. Should contain return\nstatement with calculated values." + "description": "The string containing the expression to evaluate. Should contain return statement with calculated values." } }, "allOf": [ @@ -2645,21 +2813,21 @@ "properties": { "functionKey": { "type": "string", - "description": "(Optional) Access key scoped to a particular function" + "description": "Access key scoped to a particular function" }, "appKey": { "type": "string", - "description": "(Optional) Access key scoped to a Azure Function app.\nThis key grants access to\nall functions under the app." + "description": "Access key scoped to a Azure Function app. This key grants access to all functions under the app." }, "clientId": { "type": "string", - "description": "(Optional) Client id, when AppKey is provided\nIn context of Azure function,\nthis is usually the name of the key" + "description": "Client id, when AppKey is provided In context of Azure function, this is usually the name of the key" } } }, "JobMatchingMode": { "type": "object", - "description": "The matching mode to be applied to this job.\n \nSupported types:\n \n \nQueueAndMatchMode: Used when matching worker to a job is required to be\ndone right after job is queued.\nScheduleAndSuspendMode: Used for scheduling\njobs to be queued at a future time. At specified time, matching of a worker to\nthe job will not start automatically.\nSuspendMode: Used when matching workers\nto a job needs to be suspended.", + "description": "A matching mode of one of the following types:\nQueueAndMatchMode: Used when matching worker to a job is required to be done right after job is queued.\nScheduleAndSuspendMode: Used for scheduling jobs to be queued at a future time. At specified time, matching of a worker to the job will not start automatically.\nSuspendMode: Used when matching workers to a job needs to be suspended.", "properties": { "kind": { "type": "string", @@ -2673,7 +2841,7 @@ }, "JobMatchingModeCreateOrUpdate": { "type": "object", - "description": "The matching mode to be applied to this job.\n \nSupported types:\n \n \nQueueAndMatchMode: Used when matching worker to a job is required to be\ndone right after job is queued.\nScheduleAndSuspendMode: Used for scheduling\njobs to be queued at a future time. At specified time, matching of a worker to\nthe job will not start automatically.\nSuspendMode: Used when matching workers\nto a job needs to be suspended.", + "description": "A matching mode of one of the following types:\nQueueAndMatchMode: Used when matching worker to a job is required to be done right after job is queued.\nScheduleAndSuspendMode: Used for scheduling jobs to be queued at a future time. At specified time, matching of a worker to the job will not start automatically.\nSuspendMode: Used when matching workers to a job needs to be suspended.", "properties": { "kind": { "type": "string", @@ -2752,7 +2920,7 @@ }, "ManualReclassifyExceptionAction": { "type": "object", - "description": "An action that manually reclassifies a job by providing the queue, priority and\nworker selectors.", + "description": "An action that manually reclassifies a job by providing the queue, priority and worker selectors.", "properties": { "queueId": { "type": "string", @@ -2781,7 +2949,7 @@ }, "OAuth2WebhookClientCredential": { "type": "object", - "description": "OAuth2.0 Credentials used to Contoso's Authorization server.\nReference:\nhttps://www.oauth.com/oauth2-servers/access-tokens/client-credentials/", + "description": "OAuth2.0 Credentials used to Contoso's Authorization server. Reference: https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/", "properties": { "clientId": { "type": "string", @@ -2795,7 +2963,7 @@ }, "PagedClassificationPolicy": { "type": "object", - "description": "A paged collection of classification policies.", + "description": "Paged collection of ClassificationPolicy items", "properties": { "value": { "type": "array", @@ -2806,6 +2974,7 @@ }, "nextLink": { "type": "string", + "format": "uri", "description": "The link to the next page of items" } }, @@ -2815,7 +2984,7 @@ }, "PagedDistributionPolicy": { "type": "object", - "description": "A paged collection of distribution policies.", + "description": "Paged collection of DistributionPolicy items", "properties": { "value": { "type": "array", @@ -2826,6 +2995,7 @@ }, "nextLink": { "type": "string", + "format": "uri", "description": "The link to the next page of items" } }, @@ -2835,7 +3005,7 @@ }, "PagedExceptionPolicy": { "type": "object", - "description": "A paged collection of exception policies.", + "description": "Paged collection of ExceptionPolicy items", "properties": { "value": { "type": "array", @@ -2846,6 +3016,7 @@ }, "nextLink": { "type": "string", + "format": "uri", "description": "The link to the next page of items" } }, @@ -2855,7 +3026,7 @@ }, "PagedRouterJob": { "type": "object", - "description": "A paged collection of jobs.", + "description": "Paged collection of RouterJob items", "properties": { "value": { "type": "array", @@ -2866,6 +3037,7 @@ }, "nextLink": { "type": "string", + "format": "uri", "description": "The link to the next page of items" } }, @@ -2875,7 +3047,7 @@ }, "PagedRouterQueue": { "type": "object", - "description": "A paged collection of queues.", + "description": "Paged collection of RouterQueue items", "properties": { "value": { "type": "array", @@ -2886,6 +3058,7 @@ }, "nextLink": { "type": "string", + "format": "uri", "description": "The link to the next page of items" } }, @@ -2895,7 +3068,7 @@ }, "PagedRouterWorker": { "type": "object", - "description": "A paged collection of workers.", + "description": "Paged collection of RouterWorker items", "properties": { "value": { "type": "array", @@ -2906,6 +3079,7 @@ }, "nextLink": { "type": "string", + "format": "uri", "description": "The link to the next page of items" } }, @@ -2915,7 +3089,7 @@ }, "PassThroughQueueSelectorAttachment": { "type": "object", - "description": "Attaches a queue selector where the value is passed through from the job label\nwith the same key", + "description": "Attaches a queue selector where the value is passed through from the job label with the same key", "properties": { "key": { "type": "string", @@ -2939,7 +3113,7 @@ }, "PassThroughWorkerSelectorAttachment": { "type": "object", - "description": "Attaches a worker selector where the value is passed through from the job label\nwith the same key", + "description": "Attaches a worker selector where the value is passed through from the job label with the same key", "properties": { "key": { "type": "string", @@ -3008,7 +3182,7 @@ }, "QueueSelectorAttachment": { "type": "object", - "description": "An attachment of queue selectors to resolve a queue to a job from a\nclassification policy", + "description": "An attachment of queue selectors to resolve a queue to a job from a classification policy", "properties": { "kind": { "type": "string", @@ -3022,7 +3196,7 @@ }, "QueueWeightedAllocation": { "type": "object", - "description": "Contains the weight percentage and queue selectors to be applied if selected\nfor weighted distributions.", + "description": "Contains the weight percentage and queue selectors to be applied if selected for weighted distributions.", "properties": { "weight": { "type": "number", @@ -3031,7 +3205,7 @@ }, "queueSelectors": { "type": "array", - "description": "A collection of queue selectors that will be applied if this allocation is\nselected.", + "description": "A collection of queue selectors that will be applied if this allocation is selected.", "items": { "$ref": "#/definitions/RouterQueueSelector" }, @@ -3049,11 +3223,11 @@ "properties": { "classificationPolicyId": { "type": "string", - "description": "(optional) The new classification policy that will determine queue, priority\nand worker selectors." + "description": "The new classification policy that will determine queue, priority and worker selectors." }, "labelsToUpsert": { "type": "object", - "description": "(optional) Dictionary containing the labels to update (or add if not existing)\nin key-value pairs", + "description": "Dictionary containing the labels to update (or add if not existing) in key-value pairs", "additionalProperties": {} } }, @@ -3073,7 +3247,7 @@ }, "RoundRobinMode": { "type": "object", - "description": "Jobs are distributed in order to workers, starting with the worker that is\nafter the last worker to receive a job.", + "description": "Jobs are distributed in order to workers, starting with the worker that is after the last worker to receive a job.", "allOf": [ { "$ref": "#/definitions/DistributionMode" @@ -3083,7 +3257,7 @@ }, "RoundRobinModeCreateOrUpdate": { "type": "object", - "description": "Jobs are distributed in order to workers, starting with the worker that is\nafter the last worker to receive a job.", + "description": "Jobs are distributed in order to workers, starting with the worker that is after the last worker to receive a job.", "allOf": [ { "$ref": "#/definitions/DistributionModeCreateOrUpdate" @@ -3102,7 +3276,7 @@ "capacityCostPerJob": { "type": "integer", "format": "int32", - "description": "The amount of capacity that an instance of a job of this channel will consume\nof the total worker capacity." + "description": "The amount of capacity that an instance of a job of this channel will consume of the total worker capacity." }, "maxNumberOfJobs": { "type": "integer", @@ -3121,7 +3295,7 @@ "properties": { "etag": { "$ref": "#/definitions/Azure.Core.eTag", - "description": "Concurrency Token.", + "description": "The entity tag for this resource.", "readOnly": true }, "id": { @@ -3167,7 +3341,7 @@ }, "requestedWorkerSelectors": { "type": "array", - "description": "A collection of manually specified label selectors, which a worker must satisfy\nin order to process this job.", + "description": "A collection of manually specified label selectors, which a worker must satisfy in order to process this job.", "items": { "$ref": "#/definitions/RouterWorkerSelector" }, @@ -3175,7 +3349,7 @@ }, "attachedWorkerSelectors": { "type": "array", - "description": "A collection of label selectors attached by a classification policy, which a\nworker must satisfy in order to process this job.", + "description": "A collection of label selectors attached by a classification policy, which a worker must satisfy in order to process this job.", "items": { "$ref": "#/definitions/RouterWorkerSelector" }, @@ -3184,12 +3358,12 @@ }, "labels": { "type": "object", - "description": "A set of key/value pairs that are identifying attributes used by the rules\nengines to make decisions.", + "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions.", "additionalProperties": {} }, "assignments": { "type": "object", - "description": "A collection of the assignments of the job.\nKey is AssignmentId.", + "description": "A collection of the assignments of the job. Key is AssignmentId.", "additionalProperties": { "$ref": "#/definitions/RouterJobAssignment" }, @@ -3216,7 +3390,7 @@ }, "matchingMode": { "$ref": "#/definitions/JobMatchingMode", - "description": "The matching mode to be applied to this job.\n \nSupported types:\n \n \nQueueAndMatchMode: Used when matching worker to a job is required to be\ndone right after job is queued.\nScheduleAndSuspendMode: Used for scheduling\njobs to be queued at a future time. At specified time, matching of a worker to\nthe job will not start automatically.\nSuspendMode: Used when matching workers\nto a job needs to be suspended." + "description": "If provided, will determine how job matching will be carried out. Default mode: QueueAndMatchMode." } }, "required": [ @@ -3288,7 +3462,7 @@ }, "requestedWorkerSelectors": { "type": "array", - "description": "A collection of manually specified label selectors, which a worker must satisfy\nin order to process this job.", + "description": "A collection of manually specified label selectors, which a worker must satisfy in order to process this job.", "items": { "$ref": "#/definitions/RouterWorkerSelector" }, @@ -3296,7 +3470,7 @@ }, "labels": { "type": "object", - "description": "A set of key/value pairs that are identifying attributes used by the rules\nengines to make decisions.", + "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions.", "additionalProperties": {} }, "tags": { @@ -3314,7 +3488,7 @@ }, "matchingMode": { "$ref": "#/definitions/JobMatchingModeCreateOrUpdate", - "description": "The matching mode to be applied to this job.\n \nSupported types:\n \n \nQueueAndMatchMode: Used when matching worker to a job is required to be\ndone right after job is queued.\nScheduleAndSuspendMode: Used for scheduling\njobs to be queued at a future time. At specified time, matching of a worker to\nthe job will not start automatically.\nSuspendMode: Used when matching workers\nto a job needs to be suspended." + "description": "If provided, will determine how job matching will be carried out. Default mode: QueueAndMatchMode." } } }, @@ -3496,7 +3670,7 @@ "properties": { "etag": { "$ref": "#/definitions/Azure.Core.eTag", - "description": "Concurrency Token.", + "description": "The entity tag for this resource.", "readOnly": true }, "id": { @@ -3510,16 +3684,16 @@ }, "distributionPolicyId": { "type": "string", - "description": "The ID of the distribution policy that will determine how a job is distributed\nto workers." + "description": "The ID of the distribution policy that will determine how a job is distributed to workers." }, "labels": { "type": "object", - "description": "A set of key/value pairs that are identifying attributes used by the rules\nengines to make decisions.", + "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions.", "additionalProperties": {} }, "exceptionPolicyId": { "type": "string", - "description": "(Optional) The ID of the exception policy that determines various job\nescalation rules." + "description": "The ID of the exception policy that determines various job escalation rules." } }, "required": [ @@ -3537,22 +3711,22 @@ }, "distributionPolicyId": { "type": "string", - "description": "The ID of the distribution policy that will determine how a job is distributed\nto workers." + "description": "The ID of the distribution policy that will determine how a job is distributed to workers." }, "labels": { "type": "object", - "description": "A set of key/value pairs that are identifying attributes used by the rules\nengines to make decisions.", + "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions.", "additionalProperties": {} }, "exceptionPolicyId": { "type": "string", - "description": "(Optional) The ID of the exception policy that determines various job\nescalation rules." + "description": "The ID of the exception policy that determines various job escalation rules." } } }, "RouterQueueSelector": { "type": "object", - "description": "Describes a condition that must be met against a set of labels for queue\nselection", + "description": "Describes a condition that must be met against a set of labels for queue selection", "properties": { "key": { "type": "string", @@ -3560,7 +3734,7 @@ }, "labelOperator": { "$ref": "#/definitions/LabelOperator", - "description": "Describes how the value of the label is compared to the value defined on the\nlabel selector" + "description": "Describes how the value of the label is compared to the value defined on the label selector" }, "value": { "description": "The value to compare against the actual label value with the given operator" @@ -3586,7 +3760,7 @@ }, "estimatedWaitTimeMinutes": { "type": "object", - "description": "The estimated wait time of this queue rounded up to the nearest minute, grouped\nby job priority", + "description": "The estimated wait time of this queue rounded up to the nearest minute, grouped by job priority", "additionalProperties": { "format": "double", "type": "number" @@ -3605,7 +3779,7 @@ }, "RouterRule": { "type": "object", - "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol.", + "description": "A rule of one of the following types:\nStaticRule: A rule providing static rules that always return the same result, regardless of input.\nDirectMapRule: A rule that return the same labels as the input labels.\nExpressionRule: A rule providing inline expression rules.\nFunctionRule: A rule providing a binding to an HTTP Triggered Azure Function.\nWebhookRule: A rule providing a binding to a webserver following OAuth2.0 authentication protocol.", "properties": { "kind": { "type": "string", @@ -3619,7 +3793,7 @@ }, "RouterRuleCreateOrUpdate": { "type": "object", - "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol.", + "description": "A rule of one of the following types:\nStaticRule: A rule providing static rules that always return the same result, regardless of input.\nDirectMapRule: A rule that return the same labels as the input labels.\nExpressionRule: A rule providing inline expression rules.\nFunctionRule: A rule providing a binding to an HTTP Triggered Azure Function.\nWebhookRule: A rule providing a binding to a webserver following OAuth2.0 authentication protocol.", "properties": { "kind": { "type": "string", @@ -3634,7 +3808,7 @@ "properties": { "etag": { "$ref": "#/definitions/Azure.Core.eTag", - "description": "Concurrency Token.", + "description": "The entity tag for this resource.", "readOnly": true }, "id": { @@ -3661,7 +3835,7 @@ }, "labels": { "type": "object", - "description": "A set of key/value pairs that are identifying attributes used by the rules\nengines to make decisions.", + "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions.", "additionalProperties": {} }, "tags": { @@ -3698,7 +3872,7 @@ "loadRatio": { "type": "number", "format": "double", - "description": "A value indicating the workers capacity. A value of '1' means all capacity is\nconsumed. A value of '0' means no capacity is currently consumed.", + "description": "A value indicating the workers capacity. A value of '1' means all capacity is consumed. A value of '0' means no capacity is currently consumed.", "readOnly": true }, "availableForOffers": { @@ -3759,7 +3933,7 @@ }, "labels": { "type": "object", - "description": "A set of key/value pairs that are identifying attributes used by the rules\nengines to make decisions.", + "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions.", "additionalProperties": {} }, "tags": { @@ -3783,7 +3957,7 @@ }, "RouterWorkerSelector": { "type": "object", - "description": "Describes a condition that must be met against a set of labels for worker\nselection", + "description": "Describes a condition that must be met against a set of labels for worker selection", "properties": { "key": { "type": "string", @@ -3791,7 +3965,7 @@ }, "labelOperator": { "$ref": "#/definitions/LabelOperator", - "description": "Describes how the value of the label is compared to the value defined on the\nlabel selector" + "description": "Describes how the value of the label is compared to the value defined on the label selector" }, "value": { "description": "The value to compare against the actual label value with the given operator" @@ -3882,7 +4056,7 @@ "properties": { "rule": { "$ref": "#/definitions/RouterRule", - "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol." + "description": "A RouterRule that resolves a collection of queue selectors to attach" } }, "required": [ @@ -3901,7 +4075,7 @@ "properties": { "rule": { "$ref": "#/definitions/RouterRule", - "description": "A rule of one of the following types:\n \nStaticRule: A rule\nproviding static rules that always return the same result, regardless of\ninput.\nDirectMapRule: A rule that return the same labels as the input\nlabels.\nExpressionRule: A rule providing inline expression\nrules.\nFunctionRule: A rule providing a binding to an HTTP Triggered Azure\nFunction.\nWebhookRule: A rule providing a binding to a webserver following\nOAuth2.0 authentication protocol." + "description": "A RouterRule that resolves a collection of worker selectors to attach" } }, "required": [ @@ -3916,7 +4090,7 @@ }, "ScheduleAndSuspendMode": { "type": "object", - "description": "Describes a matching mode used for scheduling jobs to be queued at a future\ntime.\nAt the specified time, matching worker to a job will not start\nautomatically.", + "description": "Describes a matching mode used for scheduling jobs to be queued at a future time. At the specified time, matching worker to a job will not start automatically.", "properties": { "scheduleAt": { "type": "string", @@ -3936,7 +4110,7 @@ }, "ScheduleAndSuspendModeCreateOrUpdate": { "type": "object", - "description": "Describes a matching mode used for scheduling jobs to be queued at a future\ntime.\nAt the specified time, matching worker to a job will not start\nautomatically.", + "description": "Describes a matching mode used for scheduling jobs to be queued at a future time. At the specified time, matching worker to a job will not start automatically.", "properties": { "scheduleAt": { "type": "string", @@ -3953,27 +4127,27 @@ }, "ScoringRuleOptions": { "type": "object", - "description": "Encapsulates all options that can be passed as parameters for scoring rule with\nBestWorkerMode", + "description": "Encapsulates all options that can be passed as parameters for scoring rule with BestWorkerMode", "properties": { "batchSize": { "type": "integer", "format": "int32", - "description": "(Optional) Set batch size when AllowScoringBatchOfWorkers is set to true.\nDefaults to 20 if not configured." + "description": "Set batch size when 'isBatchScoringEnabled' is set to true. Defaults to 20 if not configured." }, "scoringParameters": { "type": "array", - "description": "(Optional) List of extra parameters from the job that will be sent as part of\nthe payload to scoring rule.\nIf not set, the job's labels (sent in the payload\nas `job`) and the job's worker selectors (sent in the payload as\n`selectors`)\nare added to the payload of the scoring rule by default.\nNote:\nWorker labels are always sent with scoring payload.", + "description": "List of extra parameters from the job that will be sent as part of the payload to scoring rule. If not set, the job's labels (sent in the payload as `job`) and the job's worker selectors (sent in the payload as `selectors`) are added to the payload of the scoring rule by default. Note: Worker labels are always sent with scoring payload.", "items": { "$ref": "#/definitions/ScoringRuleParameterSelector" } }, "isBatchScoringEnabled": { "type": "boolean", - "description": "(Optional)\nIf set to true, will score workers in batches, and the parameter\nname of the worker labels will be sent as `workers`.\nBy default, set to false\nand the parameter name for the worker labels will be sent as `worker`.\nNote: If\nenabled, use BatchSize to set batch size." + "description": "If set to true, will score workers in batches, and the parameter name of the worker labels will be sent as `workers`. By default, set to false and the parameter name for the worker labels will be sent as `worker`. Note: If enabled, use 'batchSize' to set batch size." }, "descendingOrder": { "type": "boolean", - "description": "(Optional)\nIf false, will sort scores by ascending order. By default, set to\ntrue." + "description": "If false, will sort scores by ascending order. By default, set to true." } } }, @@ -4007,7 +4181,7 @@ "properties": { "queueSelector": { "$ref": "#/definitions/RouterQueueSelector", - "description": "Describes a condition that must be met against a set of labels for queue\nselection" + "description": "The queue selector to attach." } }, "required": [ @@ -4022,7 +4196,7 @@ }, "StaticRouterRule": { "type": "object", - "description": "A rule providing static rules that always return the same result, regardless of\ninput.", + "description": "A rule providing static rules that always return the same result, regardless of input.", "properties": { "value": { "description": "The static value this rule always returns." @@ -4037,7 +4211,7 @@ }, "StaticRouterRuleCreateOrUpdate": { "type": "object", - "description": "A rule providing static rules that always return the same result, regardless of\ninput.", + "description": "A rule providing static rules that always return the same result, regardless of input.", "properties": { "value": { "description": "The static value this rule always returns." @@ -4056,7 +4230,7 @@ "properties": { "workerSelector": { "$ref": "#/definitions/RouterWorkerSelector", - "description": "Describes a condition that must be met against a set of labels for worker\nselection" + "description": "The worker selector to attach." } }, "required": [ @@ -4095,7 +4269,7 @@ "properties": { "suspendMatching": { "type": "boolean", - "description": "If SuspendMatching is true, then the job is not queued for re-matching with a\nworker." + "description": "If SuspendMatching is true, then the job is not queued for re-matching with a worker." } } }, @@ -4149,7 +4323,7 @@ }, "clientCredential": { "$ref": "#/definitions/OAuth2WebhookClientCredential", - "description": "OAuth2.0 Credentials used to Contoso's Authorization server.\nReference:\nhttps://www.oauth.com/oauth2-servers/access-tokens/client-credentials/" + "description": "OAuth2.0 Credentials used to Contoso's Authorization server. Reference: https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/" }, "webhookUri": { "type": "string", @@ -4175,7 +4349,7 @@ }, "clientCredential": { "$ref": "#/definitions/OAuth2WebhookClientCredential", - "description": "OAuth2.0 Credentials used to Contoso's Authorization server.\nReference:\nhttps://www.oauth.com/oauth2-servers/access-tokens/client-credentials/" + "description": "OAuth2.0 Credentials used to Contoso's Authorization server. Reference: https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/" }, "webhookUri": { "type": "string", @@ -4192,7 +4366,7 @@ }, "WeightedAllocationQueueSelectorAttachment": { "type": "object", - "description": "Describes multiple sets of queue selectors, of which one will be selected and\nattached according to a weighting", + "description": "Describes multiple sets of queue selectors, of which one will be selected and attached according to a weighting", "properties": { "allocations": { "type": "array", @@ -4215,7 +4389,7 @@ }, "WeightedAllocationWorkerSelectorAttachment": { "type": "object", - "description": "Describes multiple sets of worker selectors, of which one will be selected and\nattached according to a weighting", + "description": "Describes multiple sets of worker selectors, of which one will be selected and attached according to a weighting", "properties": { "allocations": { "type": "array", @@ -4252,7 +4426,7 @@ }, "WorkerWeightedAllocation": { "type": "object", - "description": "Contains the weight percentage and worker selectors to be applied if selected\nfor weighted distributions.", + "description": "Contains the weight percentage and worker selectors to be applied if selected for weighted distributions.", "properties": { "weight": { "type": "number", @@ -4261,7 +4435,7 @@ }, "workerSelectors": { "type": "array", - "description": "A collection of worker selectors that will be applied if this allocation is\nselected.", + "description": "A collection of worker selectors that will be applied if this allocation is selected.", "items": { "$ref": "#/definitions/RouterWorkerSelector" }, @@ -4285,214 +4459,6 @@ "x-ms-parameter-location": "method", "x-ms-client-name": "apiVersion" }, - "ListJobQueryParams.channelId": { - "name": "channelId", - "in": "query", - "description": "If specified, filter jobs by channel.", - "required": false, - "type": "string", - "x-ms-parameter-location": "method" - }, - "ListJobQueryParams.classificationPolicyId": { - "name": "classificationPolicyId", - "in": "query", - "description": "If specified, filter jobs by classificationPolicy.", - "required": false, - "type": "string", - "x-ms-parameter-location": "method" - }, - "ListJobQueryParams.queueId": { - "name": "queueId", - "in": "query", - "description": "If specified, filter jobs by queue.", - "required": false, - "type": "string", - "x-ms-parameter-location": "method" - }, - "ListJobQueryParams.scheduledAfter": { - "name": "scheduledAfter", - "in": "query", - "description": "If specified, filter on jobs that was scheduled at or after given value. Range:\n[scheduledAfter, +Inf).", - "required": false, - "type": "string", - "format": "date-time", - "x-ms-parameter-location": "method" - }, - "ListJobQueryParams.scheduledBefore": { - "name": "scheduledBefore", - "in": "query", - "description": "If specified, filter on jobs that was scheduled before or at given timestamp.\nRange: (-Inf, scheduledBefore].", - "required": false, - "type": "string", - "format": "date-time", - "x-ms-parameter-location": "method" - }, - "ListJobQueryParams.status": { - "name": "status", - "in": "query", - "description": "If specified, filter jobs by status.", - "required": false, - "type": "string", - "default": "all", - "enum": [ - "all", - "pendingClassification", - "queued", - "assigned", - "completed", - "closed", - "cancelled", - "classificationFailed", - "created", - "pendingSchedule", - "scheduled", - "scheduleFailed", - "waitingForActivation", - "active" - ], - "x-ms-enum": { - "name": "RouterJobStatusSelector", - "modelAsString": true, - "values": [ - { - "name": "all", - "value": "all", - "description": "Default" - }, - { - "name": "pendingClassification", - "value": "pendingClassification", - "description": "Job is waiting to be classified." - }, - { - "name": "queued", - "value": "queued", - "description": "Job has been queued." - }, - { - "name": "assigned", - "value": "assigned", - "description": "Job has been assigned to a worker." - }, - { - "name": "completed", - "value": "completed", - "description": "Job has been completed by a worker." - }, - { - "name": "closed", - "value": "closed", - "description": "Job has been closed by a worker." - }, - { - "name": "cancelled", - "value": "cancelled", - "description": "Job has been cancelled." - }, - { - "name": "classificationFailed", - "value": "classificationFailed", - "description": "Classification process failed for the job." - }, - { - "name": "created", - "value": "created", - "description": "Job has been created." - }, - { - "name": "pendingSchedule", - "value": "pendingSchedule", - "description": "Job has been created but not been scheduled yet." - }, - { - "name": "scheduled", - "value": "scheduled", - "description": "Job has been scheduled successfully." - }, - { - "name": "scheduleFailed", - "value": "scheduleFailed", - "description": "Job scheduling failed." - }, - { - "name": "waitingForActivation", - "value": "waitingForActivation", - "description": "Job is in a suspended state and waiting for an update." - }, - { - "name": "active", - "value": "active", - "description": "Job is in a state of PendingClassification or Queued or Assigned or ClassificationFailed or Completed or PendingSchedule or Scheduled or ScheduleFailed or WaitingForActivation." - } - ] - }, - "x-ms-parameter-location": "method" - }, - "ListWorkerQueryParams.channelId": { - "name": "channelId", - "in": "query", - "description": "If specified, select workers who have a channel configuration with this channel.", - "required": false, - "type": "string", - "x-ms-parameter-location": "method" - }, - "ListWorkerQueryParams.hasCapacity": { - "name": "hasCapacity", - "in": "query", - "description": "If set to true, select only workers who have capacity for the channel specified\nby `channelId` or for any channel if `channelId` not specified. If set to\nfalse, then will return all workers including workers without any capacity for\njobs. Defaults to false.", - "required": false, - "type": "boolean", - "x-ms-parameter-location": "method" - }, - "ListWorkerQueryParams.queueId": { - "name": "queueId", - "in": "query", - "description": "If specified, select workers who are assigned to this queue.", - "required": false, - "type": "string", - "x-ms-parameter-location": "method" - }, - "ListWorkerQueryParams.state": { - "name": "state", - "in": "query", - "description": "If specified, select workers by worker state.", - "required": false, - "type": "string", - "default": "all", - "enum": [ - "active", - "draining", - "inactive", - "all" - ], - "x-ms-enum": { - "name": "RouterWorkerStateSelector", - "modelAsString": true, - "values": [ - { - "name": "active", - "value": "active", - "description": "Worker is active and available to take offers." - }, - { - "name": "draining", - "value": "draining", - "description": "Worker is not active, if there are existing offers they are being revoked. No new offers are sent." - }, - { - "name": "inactive", - "value": "inactive", - "description": "Worker is not active. No new offers are sent." - }, - { - "name": "all", - "value": "all", - "description": "Worker is active or draining or inactive." - } - ] - }, - "x-ms-parameter-location": "method" - }, "RouterConditionalRequestHeaders.ifMatch": { "name": "If-Match", "in": "header", From d41841bd05b8f38153beca2cf10b38312bf0bf50 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Thu, 2 Nov 2023 14:52:25 -0700 Subject: [PATCH 071/113] fix nextlink lint error --- custom-words.txt | 1 + ...istClassificationPoliciesWithPageSize.json | 3 +- ..._ListDistributionPoliciesWithPageSize.json | 3 +- ...ies_ListExceptionPoliciesWithPageSize.json | 3 +- .../2023-11-01/Jobs_GetJobsWithPageSize.json | 2 +- .../Queues_ListQueuesWithPageSize.json | 2 +- .../Workers_GetAvailableWorkersByChannel.json | 2 +- .../Workers_GetWorkersWithPageSize.json | 2 +- .../communicationservicejobrouter.json | 36 ++++--------------- ...istClassificationPoliciesWithPageSize.json | 3 +- ..._ListDistributionPoliciesWithPageSize.json | 3 +- ...ies_ListExceptionPoliciesWithPageSize.json | 3 +- .../examples/Jobs_GetJobsWithPageSize.json | 2 +- .../Queues_ListQueuesWithPageSize.json | 2 +- .../Workers_GetAvailableWorkersByChannel.json | 2 +- .../Workers_GetWorkersWithPageSize.json | 2 +- 16 files changed, 27 insertions(+), 44 deletions(-) diff --git a/custom-words.txt b/custom-words.txt index 64087c4c0915..dee99b0e460b 100644 --- a/custom-words.txt +++ b/custom-words.txt @@ -2943,6 +2943,7 @@ ulaanbaatar unallocated unarchive unassign +unassigning unassignment unassigns unattend diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json index e0e1c85873a7..731af458f510 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json @@ -52,7 +52,8 @@ "workerSelectorAttachments": [], "etag": "etag" } - ] + ], + "nextLink": "/routing/classificationPolicies?continuationToken=Kg==" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_ListDistributionPoliciesWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_ListDistributionPoliciesWithPageSize.json index 5b04dc2db344..6faeed87ffee 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_ListDistributionPoliciesWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_ListDistributionPoliciesWithPageSize.json @@ -34,7 +34,8 @@ }, "etag": "etag" } - ] + ], + "nextLink": "/routing/distributionPolicies?continuationToken=Kg==" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json index 0d85556326d5..cd2dd22bf657 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json @@ -58,7 +58,8 @@ ], "etag": "etag" } - ] + ], + "nextLink": "/routing/exceptionPolicies?continuationToken=Kg==" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJobsWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJobsWithPageSize.json index 06127640cb76..2639dd06403b 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJobsWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJobsWithPageSize.json @@ -50,7 +50,7 @@ "etag": "etag" } ], - "nextLink": "null" + "nextLink": "/routing/jobs?continuationToken=Kg==" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_ListQueuesWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_ListQueuesWithPageSize.json index 59783ed05aba..048c88004b8c 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_ListQueuesWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_ListQueuesWithPageSize.json @@ -27,7 +27,7 @@ "etag": "etag" } ], - "nextLink": "null" + "nextLink": "/routing/queues?continuationToken=Kg==" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json index 2083096edeca..c7f4380614ec 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json @@ -69,7 +69,7 @@ "etag": "etag" } ], - "nextLink": "null" + "nextLink": "/routing/workers?continuationToken=Kg==" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json index 70ad490a9a54..28589e1cc2ac 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json @@ -67,7 +67,7 @@ "etag": "etag" } ], - "nextLink": "null" + "nextLink": "/routing/workers?continuationToken=Kg==" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index 9bc873f0eb9f..46e671e37b80 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -1121,11 +1121,7 @@ ], "responses": { "200": { - "description": "The request has succeeded.", - "schema": { - "type": "object", - "additionalProperties": {} - } + "description": "The request has succeeded." }, "default": { "description": "An unexpected error response.", @@ -1175,11 +1171,7 @@ ], "responses": { "200": { - "description": "The request has succeeded.", - "schema": { - "type": "object", - "additionalProperties": {} - } + "description": "The request has succeeded." }, "default": { "description": "An unexpected error response.", @@ -1232,11 +1224,7 @@ ], "responses": { "200": { - "description": "The request has succeeded.", - "schema": { - "type": "object", - "additionalProperties": {} - } + "description": "The request has succeeded." }, "default": { "description": "An unexpected error response.", @@ -1286,18 +1274,10 @@ ], "responses": { "200": { - "description": "The request has succeeded.", - "schema": { - "type": "object", - "additionalProperties": {} - } + "description": "The request has succeeded." }, "202": { - "description": "The request has been accepted for processing, but processing has not yet completed.", - "schema": { - "type": "object", - "additionalProperties": {} - } + "description": "The request has been accepted for processing, but processing has not yet completed." }, "default": { "description": "An unexpected error response.", @@ -2086,11 +2066,7 @@ ], "responses": { "200": { - "description": "The request has succeeded.", - "schema": { - "type": "object", - "additionalProperties": {} - } + "description": "The request has succeeded." }, "default": { "description": "An unexpected error response.", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json index e0e1c85873a7..731af458f510 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json @@ -52,7 +52,8 @@ "workerSelectorAttachments": [], "etag": "etag" } - ] + ], + "nextLink": "/routing/classificationPolicies?continuationToken=Kg==" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json index 5b04dc2db344..6faeed87ffee 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json @@ -34,7 +34,8 @@ }, "etag": "etag" } - ] + ], + "nextLink": "/routing/distributionPolicies?continuationToken=Kg==" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json index 0d85556326d5..cd2dd22bf657 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json @@ -58,7 +58,8 @@ ], "etag": "etag" } - ] + ], + "nextLink": "/routing/exceptionPolicies?continuationToken=Kg==" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJobsWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJobsWithPageSize.json index 06127640cb76..2639dd06403b 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJobsWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJobsWithPageSize.json @@ -50,7 +50,7 @@ "etag": "etag" } ], - "nextLink": "null" + "nextLink": "/routing/jobs?continuationToken=Kg==" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_ListQueuesWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_ListQueuesWithPageSize.json index 59783ed05aba..048c88004b8c 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_ListQueuesWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_ListQueuesWithPageSize.json @@ -27,7 +27,7 @@ "etag": "etag" } ], - "nextLink": "null" + "nextLink": "/routing/queues?continuationToken=Kg==" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json index 2083096edeca..c7f4380614ec 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json @@ -69,7 +69,7 @@ "etag": "etag" } ], - "nextLink": "null" + "nextLink": "/routing/workers?continuationToken=Kg==" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json index 70ad490a9a54..28589e1cc2ac 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json @@ -67,7 +67,7 @@ "etag": "etag" } ], - "nextLink": "null" + "nextLink": "/routing/workers?continuationToken=Kg==" } } } From 8b8470684ce6cf3444c35218969a1e7bf8d70d44 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Thu, 2 Nov 2023 15:20:51 -0700 Subject: [PATCH 072/113] test changes in client.tsp for validation failures --- .../Communication.JobRouter/client.tsp | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/specification/communication/Communication.JobRouter/client.tsp b/specification/communication/Communication.JobRouter/client.tsp index 8628e8a202cc..8cf5eb0c800c 100644 --- a/specification/communication/Communication.JobRouter/client.tsp +++ b/specification/communication/Communication.JobRouter/client.tsp @@ -16,44 +16,60 @@ namespace ClientForAcsJobRouter; service: AzureCommunicationRoutingService }) interface JobRouterAdministrationRestClient { + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @internal("csharp") @internal("java") upsertDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertDistributionPolicy; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" getDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getDistributionPolicy; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" listDistributionPolicies is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listDistributionPolicies; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" deleteDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteDistributionPolicy; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @internal("csharp") @internal("java") upsertClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertClassificationPolicy; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" getClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getClassificationPolicy; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" listClassificationPolicies is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listClassificationPolicies; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" deleteClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteClassificationPolicy; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @internal("csharp") @internal("java") upsertExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertExceptionPolicy; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" getExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getExceptionPolicy; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" listExceptionPolicies is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listExceptionPolicies; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" deleteExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteExceptionPolicy; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @internal("csharp") @internal("java") upsertQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertQueue; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" getQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getQueue; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" listQueues is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listQueues; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" deleteQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteQueue; } @@ -62,53 +78,70 @@ interface JobRouterAdministrationRestClient { service: AzureCommunicationRoutingService }) interface JobRouterRestClient { + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @internal("csharp") @internal("java") upsertJob is AzureCommunicationRoutingService.JobRouterOperations.upsertJob; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" getJob is AzureCommunicationRoutingService.JobRouterOperations.getJob; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" deleteJob is AzureCommunicationRoutingService.JobRouterOperations.deleteJob; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal("csharp") @internal("python") @internal("java") reclassifyJob is AzureCommunicationRoutingService.JobRouterOperations.reclassifyJobAction; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" cancelJob is AzureCommunicationRoutingService.JobRouterOperations.cancelJobAction; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" completeJob is AzureCommunicationRoutingService.JobRouterOperations.completeJobAction; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" closeJob is AzureCommunicationRoutingService.JobRouterOperations.closeJobAction; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" listJobs is AzureCommunicationRoutingService.JobRouterOperations.listJobs; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" getQueuePosition is AzureCommunicationRoutingService.JobRouterOperations.getInQueuePosition; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" unassignJob is AzureCommunicationRoutingService.JobRouterOperations.unassignJobAction; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" acceptJobOffer is AzureCommunicationRoutingService.JobRouterOperations.acceptJobAction; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" declineJobOffer is AzureCommunicationRoutingService.JobRouterOperations.declineJobAction; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" getQueueStatistics is AzureCommunicationRoutingService.JobRouterOperations.getQueueStatistics; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @internal("csharp") @internal("java") upsertWorker is AzureCommunicationRoutingService.JobRouterOperations.upsertWorker; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" getWorker is AzureCommunicationRoutingService.JobRouterOperations.getWorker; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" deleteWorker is AzureCommunicationRoutingService.JobRouterOperations.deleteWorker; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" listWorkers is AzureCommunicationRoutingService.JobRouterOperations.listWorkers; } \ No newline at end of file From 2d9a193adc8b06e75be1be3e776031c95e5fa926 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Thu, 2 Nov 2023 15:32:41 -0700 Subject: [PATCH 073/113] run cleanup --- .../Communication.JobRouter/client.tsp | 252 +++++++++--------- .../Communication.JobRouter/models.tsp | 114 ++++---- .../Communication.JobRouter/routes.tsp | 93 ++++--- 3 files changed, 225 insertions(+), 234 deletions(-) diff --git a/specification/communication/Communication.JobRouter/client.tsp b/specification/communication/Communication.JobRouter/client.tsp index 8cf5eb0c800c..3819b2dbfb9b 100644 --- a/specification/communication/Communication.JobRouter/client.tsp +++ b/specification/communication/Communication.JobRouter/client.tsp @@ -12,136 +12,136 @@ namespace ClientForAcsJobRouter; // Your customizations here @client({ - name: "JobRouterAdministrationClient", - service: AzureCommunicationRoutingService + name: "JobRouterAdministrationClient", + service: AzureCommunicationRoutingService, }) interface JobRouterAdministrationRestClient { - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - @internal("csharp") - @internal("java") - upsertDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertDistributionPolicy; - - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - getDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getDistributionPolicy; - - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - listDistributionPolicies is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listDistributionPolicies; - - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - deleteDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteDistributionPolicy; - - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - @internal("csharp") - @internal("java") - upsertClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertClassificationPolicy; - - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - getClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getClassificationPolicy; - - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - listClassificationPolicies is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listClassificationPolicies; - - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - deleteClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteClassificationPolicy; - - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - @internal("csharp") - @internal("java") - upsertExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertExceptionPolicy; - - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - getExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getExceptionPolicy; - - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - listExceptionPolicies is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listExceptionPolicies; - - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - deleteExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteExceptionPolicy; - - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - @internal("csharp") - @internal("java") - upsertQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertQueue; - - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - getQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getQueue; - - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - listQueues is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listQueues; - - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - deleteQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteQueue; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + @internal("csharp") + @internal("java") + upsertDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertDistributionPolicy; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + getDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getDistributionPolicy; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + listDistributionPolicies is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listDistributionPolicies; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + deleteDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteDistributionPolicy; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + @internal("csharp") + @internal("java") + upsertClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertClassificationPolicy; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + getClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getClassificationPolicy; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + listClassificationPolicies is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listClassificationPolicies; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + deleteClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteClassificationPolicy; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + @internal("csharp") + @internal("java") + upsertExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertExceptionPolicy; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + getExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getExceptionPolicy; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + listExceptionPolicies is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listExceptionPolicies; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + deleteExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteExceptionPolicy; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + @internal("csharp") + @internal("java") + upsertQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertQueue; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + getQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getQueue; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + listQueues is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listQueues; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + deleteQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteQueue; } @client({ - name: "JobRouterClient", - service: AzureCommunicationRoutingService + name: "JobRouterClient", + service: AzureCommunicationRoutingService, }) interface JobRouterRestClient { - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - @internal("csharp") - @internal("java") - upsertJob is AzureCommunicationRoutingService.JobRouterOperations.upsertJob; - - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - getJob is AzureCommunicationRoutingService.JobRouterOperations.getJob; - - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - deleteJob is AzureCommunicationRoutingService.JobRouterOperations.deleteJob; - - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @internal("csharp") - @internal("python") - @internal("java") - reclassifyJob is AzureCommunicationRoutingService.JobRouterOperations.reclassifyJobAction; - - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - cancelJob is AzureCommunicationRoutingService.JobRouterOperations.cancelJobAction; - - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - completeJob is AzureCommunicationRoutingService.JobRouterOperations.completeJobAction; - - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - closeJob is AzureCommunicationRoutingService.JobRouterOperations.closeJobAction; - - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - listJobs is AzureCommunicationRoutingService.JobRouterOperations.listJobs; - - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - getQueuePosition is AzureCommunicationRoutingService.JobRouterOperations.getInQueuePosition; - - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - unassignJob is AzureCommunicationRoutingService.JobRouterOperations.unassignJobAction; - - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - acceptJobOffer is AzureCommunicationRoutingService.JobRouterOperations.acceptJobAction; - - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - declineJobOffer is AzureCommunicationRoutingService.JobRouterOperations.declineJobAction; - - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - getQueueStatistics is AzureCommunicationRoutingService.JobRouterOperations.getQueueStatistics; - - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - @internal("csharp") - @internal("java") - upsertWorker is AzureCommunicationRoutingService.JobRouterOperations.upsertWorker; - - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - getWorker is AzureCommunicationRoutingService.JobRouterOperations.getWorker; - - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - deleteWorker is AzureCommunicationRoutingService.JobRouterOperations.deleteWorker; - - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - listWorkers is AzureCommunicationRoutingService.JobRouterOperations.listWorkers; -} \ No newline at end of file + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + @internal("csharp") + @internal("java") + upsertJob is AzureCommunicationRoutingService.JobRouterOperations.upsertJob; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + getJob is AzureCommunicationRoutingService.JobRouterOperations.getJob; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + deleteJob is AzureCommunicationRoutingService.JobRouterOperations.deleteJob; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @internal("csharp") + @internal("python") + @internal("java") + reclassifyJob is AzureCommunicationRoutingService.JobRouterOperations.reclassifyJobAction; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + cancelJob is AzureCommunicationRoutingService.JobRouterOperations.cancelJobAction; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + completeJob is AzureCommunicationRoutingService.JobRouterOperations.completeJobAction; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + closeJob is AzureCommunicationRoutingService.JobRouterOperations.closeJobAction; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + listJobs is AzureCommunicationRoutingService.JobRouterOperations.listJobs; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + getQueuePosition is AzureCommunicationRoutingService.JobRouterOperations.getInQueuePosition; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + unassignJob is AzureCommunicationRoutingService.JobRouterOperations.unassignJobAction; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + acceptJobOffer is AzureCommunicationRoutingService.JobRouterOperations.acceptJobAction; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + declineJobOffer is AzureCommunicationRoutingService.JobRouterOperations.declineJobAction; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + getQueueStatistics is AzureCommunicationRoutingService.JobRouterOperations.getQueueStatistics; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + @internal("csharp") + @internal("java") + upsertWorker is AzureCommunicationRoutingService.JobRouterOperations.upsertWorker; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + getWorker is AzureCommunicationRoutingService.JobRouterOperations.getWorker; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + deleteWorker is AzureCommunicationRoutingService.JobRouterOperations.deleteWorker; + + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" + listWorkers is AzureCommunicationRoutingService.JobRouterOperations.listWorkers; +} diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 7f0eb1e937fe..6faf32b1f036 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -16,7 +16,6 @@ using Azure.ClientGenerator.Core; @versioned(AzureCommunicationRoutingService.Versions) namespace AzureCommunicationRoutingService; - @doc("Provides the 'Last-Modified' header to enable conditional (cached) requests") model LastModifiedResponseEnvelope { @header("Last-Modified") @@ -67,42 +66,41 @@ model RouterReturnConditionalResponseHeaders; @@ -1073,7 +1052,7 @@ model ReclassifyJobResult {} alias ReclassfiyJobOkReponse = ResourceOkResponse; @doc("Response payload from closing a job") -model CloseJobResult {}; +model CloseJobResult {} alias CloseJobResultWithOkResponse = ResourceOkResponse; @@ -1087,12 +1066,12 @@ model CancelJobResult {} alias CancelJobResultWithOkResponse = ResourceOkResponse; @doc("Response payload from completing a job") -model CompleteJobResult {}; +model CompleteJobResult {} alias CompleteJobResultWithOkResponse = ResourceOkResponse; @doc("Response payload from declining a job") -model DeclineJobOfferResult {}; +model DeclineJobOfferResult {} alias DeclineJobOfferResultWithOkResponse = ResourceOkResponse; @@ -1166,10 +1145,9 @@ alias ListWorkerQueryParams = ListQueryParametersTrait<{ hasCapacity?: boolean; }>; - @doc("JobRouter Versions") enum Versions { - @doc("JobRouter 2023-11-01 api version") - @useDependency(Azure.Core.Versions.v1_0_Preview_2) - c2023_11_01: "2023-11-01", + @doc("JobRouter 2023-11-01 api version") + @useDependency(Azure.Core.Versions.v1_0_Preview_2) + c2023_11_01: "2023-11-01", } diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index 2e36696c4944..2534d7659aca 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -10,9 +10,14 @@ using Azure.Core.Traits; namespace AzureCommunicationRoutingService; alias ServiceTraits = NoRepeatableRequests & - NoConditionalRequests & NoClientRequestId; -alias PatchOperationTraits = NoRepeatableRequests & NoClientRequestId & SupportsRouterConditionalPatchUpdateRequests & RouterReturnConditionalResponseHeaders; -alias GetOperationTraits = ServiceTraits & RouterReturnConditionalResponseHeaders; + NoConditionalRequests & + NoClientRequestId; +alias PatchOperationTraits = NoRepeatableRequests & + NoClientRequestId & + SupportsRouterConditionalPatchUpdateRequests & + RouterReturnConditionalResponseHeaders; +alias GetOperationTraits = ServiceTraits & + RouterReturnConditionalResponseHeaders; alias Operations = Azure.Core.ResourceOperations; alias GetOperations = Azure.Core.ResourceOperations; @@ -24,96 +29,105 @@ interface JobRouterAdministrationOperations { @doc("Creates or updates a classification policy.") @route("/routing") upsertClassificationPolicy is PatchOperations.ResourceCreateOrUpdate; - + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing classification policy by Id.") @doc("Retrieves an existing classification policy by Id.") @route("/routing") getClassificationPolicy is GetOperations.ResourceRead; - + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Delete a classification policy by Id.") @doc("Delete a classification policy by Id.") @route("/routing") deleteClassificationPolicy is Operations.ResourceDelete; - + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves existing classification policies.") @doc("Retrieves existing classification policies.") @route("/routing") - listClassificationPolicies is Operations.ResourceList; - + listClassificationPolicies is Operations.ResourceList< + ClassificationPolicy, + ListClassificationPoliciesQueryParams + >; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a distribution policy.") @doc("Creates or updates a distribution policy.") @route("/routing") upsertDistributionPolicy is PatchOperations.ResourceCreateOrUpdate; - + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing distribution policy by Id.") @doc("Retrieves an existing distribution policy by Id.") @route("/routing") getDistributionPolicy is GetOperations.ResourceRead; - + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Delete a distribution policy by Id.") @doc("Delete a distribution policy by Id.") @route("/routing") deleteDistributionPolicy is Operations.ResourceDelete; - + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves existing distribution policies.") @doc("Retrieves existing distribution policies.") @route("/routing") - listDistributionPolicies is Operations.ResourceList; - + listDistributionPolicies is Operations.ResourceList< + DistributionPolicy, + ListDistributionPoliciesQueryParams + >; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a exception policy.") @doc("Creates or updates a exception policy.") @route("/routing") upsertExceptionPolicy is PatchOperations.ResourceCreateOrUpdate; - + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing exception policy by Id.") @doc("Retrieves an existing exception policy by Id.") @route("/routing") getExceptionPolicy is GetOperations.ResourceRead; - + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Deletes a exception policy by Id.") @doc("Deletes a exception policy by Id.") @route("/routing") deleteExceptionPolicy is Operations.ResourceDelete; - + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves existing exception policies.") @doc("Retrieves existing exception policies.") @route("/routing") - listExceptionPolicies is Operations.ResourceList; - + listExceptionPolicies is Operations.ResourceList< + ExceptionPolicy, + ListExceptionPoliciesQueryParams + >; + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a queue.") @doc("Creates or updates a queue.") @route("/routing") upsertQueue is PatchOperations.ResourceCreateOrUpdate; - + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing queue by Id.") @doc("Retrieves an existing queue by Id.") @route("/routing") getQueue is GetOperations.ResourceRead; - + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Deletes a queue by Id.") @doc("Deletes a queue by Id.") @route("/routing") deleteQueue is Operations.ResourceDelete; - + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves existing queues.") @doc("Retrieves existing queues.") @route("/routing") - listQueues is Operations.ResourceList; + listQueues is Operations.ResourceList; } interface JobRouterOperations { @@ -122,20 +136,19 @@ interface JobRouterOperations { @doc("Creates or updates a router job.") @route("/routing") upsertJob is PatchOperations.ResourceCreateOrUpdate; - + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing job by Id.") @doc("Retrieves an existing job by Id.") @route("/routing") getJob is GetOperations.ResourceRead; - + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Deletes a job and all of its traces.") @doc("Deletes a job and all of its traces.") @route("/routing") deleteJob is Operations.ResourceDelete; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Reclassify a job.") @doc("Reclassify a job.") @@ -153,7 +166,7 @@ interface JobRouterOperations { }, ReclassfiyJobOkReponse >; - + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Submits request to cancel an existing job by Id while supplying free-form cancellation reason.") @doc("Submits request to cancel an existing job by Id while supplying free-form cancellation reason.") @@ -171,7 +184,7 @@ interface JobRouterOperations { }, CancelJobResultWithOkResponse >; - + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Completes an assigned job.") @doc("Completes an assigned job.") @@ -189,7 +202,7 @@ interface JobRouterOperations { }, CompleteJobResultWithOkResponse >; - + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Closes a completed job.") @doc("Closes a completed job.") @@ -207,13 +220,13 @@ interface JobRouterOperations { }, CloseJobResultResponse >; - + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves list of jobs based on filter parameters.") @doc("Retrieves list of jobs based on filter parameters.") @route("/routing") - listJobs is Operations.ResourceList; - + listJobs is Operations.ResourceList; + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Gets a job's position details.") @doc("Gets a job's position details.") @@ -227,7 +240,7 @@ interface JobRouterOperations { }, RouterJobPositionDetails >; - + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Un-assign a job.") @doc("Un-assign a job.") @@ -249,7 +262,7 @@ interface JobRouterOperations { }, UnassignJobResult >; - + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already.") @doc("Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already.") @@ -267,7 +280,7 @@ interface JobRouterOperations { }, AcceptJobOfferResult >; - + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Declines an offer to work on a job.") @doc("Declines an offer to work on a job.") @@ -289,7 +302,7 @@ interface JobRouterOperations { }, DeclineJobOfferResultWithOkResponse >; - + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Retrieves a queue's statistics.") @doc("Retrieves a queue's statistics.") @@ -303,28 +316,28 @@ interface JobRouterOperations { }, RouterQueueStatistics >; - + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a worker.") @doc("Creates or updates a worker.") @route("/routing") upsertWorker is PatchOperations.ResourceCreateOrUpdate; - + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing worker by Id.") @doc("Retrieves an existing worker by Id.") @route("/routing") getWorker is GetOperations.ResourceRead; - + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Deletes a worker and all of its traces.") @doc("Deletes a worker and all of its traces.") @route("/routing") deleteWorker is Operations.ResourceDelete; - + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves existing workers.") @doc("Retrieves existing workers.") @route("/routing") - listWorkers is Operations.ResourceList; + listWorkers is Operations.ResourceList; } From 5106ed702279f73f92657f61e6d9de09ef8e4530 Mon Sep 17 00:00:00 2001 From: Charandeep Parisineti Date: Thu, 2 Nov 2023 16:32:09 -0700 Subject: [PATCH 074/113] Update java internal models --- .../Communication.JobRouter/models.tsp | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 6faf32b1f036..ea0143f75562 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -224,6 +224,7 @@ enum ExpressionRouterRuleLanguage { @resource("classificationPolicies") @doc("A container for the rules that govern how jobs are classified.") +@projectedName("java", "ClassificationPolicyInternal") model ClassificationPolicy { ...EtagProperty; @@ -264,6 +265,7 @@ model RouterRule { @resource("distributionPolicies") @doc("Policy governing how jobs are distributed to workers") +@projectedName("java", "DistributionPolicyInternal") model DistributionPolicy { ...EtagProperty; @@ -300,6 +302,7 @@ model DistributionMode { @resource("exceptionPolicies") @doc("A policy that defines actions to execute when exception are triggered.") +@projectedName("java", "ExceptionPolicyInternal") model ExceptionPolicy { ...EtagProperty; @@ -316,6 +319,7 @@ model ExceptionPolicy { } @doc("A rule that defines actions to execute upon a specific trigger.") +@projectedName("java", "ExceptionRuleInternal") model ExceptionRule { @doc("Id of the exception rule.") id: string; @@ -345,6 +349,7 @@ model RouterJobNote { @resource("jobs") @doc("A unit of work to be routed") +@projectedName("java", "RouterJobInternal") model RouterJob { ...EtagProperty; @@ -410,6 +415,7 @@ model RouterJob { } @doc("Describes a condition that must be met against a set of labels for worker selection") +@projectedName("java", "RouterWorkerSelectorInternal") model RouterWorkerSelector { @doc("The label key to query against") key: string; @@ -574,6 +580,7 @@ model DeclineJobOfferOptions { @resource("queues") @doc("A queue that can contain jobs to be routed.") +@projectedName("java", "RouterQueueInternal") model RouterQueue { ...EtagProperty; @@ -597,6 +604,7 @@ model RouterQueue { } @doc("Statistics for the queue") +@projectedName("java", "RouterQueueStatisticsInternal") model RouterQueueStatistics { @doc("Id of the queue these details are about.") queueId: string; @@ -613,6 +621,7 @@ model RouterQueueStatistics { @resource("workers") @doc("An entity for jobs to be routed to") +@projectedName("java", "RouterWorkerInternal") model RouterWorker { ...EtagProperty; @@ -731,6 +740,7 @@ model ScoringRuleOptions { } @doc("An action that marks a job as cancelled") +@projectedName("java", "CancelExceptionActionInternal") model CancelExceptionAction extends ExceptionAction { @doc("A note that will be appended to the jobs' Notes collection with the current timestamp.") note?: string; @@ -744,6 +754,7 @@ model CancelExceptionAction extends ExceptionAction { @doc("The action to take when the exception is triggered") @discriminator("kind") +@projectedName("java", "ExceptionActionInternal") model ExceptionAction { @doc("Unique Id of the exception action") @visibility("read") @@ -754,6 +765,7 @@ model ExceptionAction { } @doc("Describes a set of queue selectors that will be attached if the given condition resolves to true") +@projectedName("java", "ConditionalQueueSelectorAttachmentInternal") model ConditionalQueueSelectorAttachment extends QueueSelectorAttachment { @doc("The condition that must be true for the queue selectors to be attached") condition: RouterRule; @@ -766,6 +778,7 @@ model ConditionalQueueSelectorAttachment extends QueueSelectorAttachment { } @doc("Describes a condition that must be met against a set of labels for queue selection") +@projectedName("java", "RouterQueueSelectorInternal") model RouterQueueSelector { @doc("The label key to query against") key: string; @@ -781,12 +794,14 @@ model RouterQueueSelector { @doc("An attachment of queue selectors to resolve a queue to a job from a classification policy") @discriminator("kind") +@projectedName("java", "QueueSelectorAttachmentInternal") model QueueSelectorAttachment { @doc("The type discriminator describing a sub-type of QueueSelectorAttachment") kind: string; } @doc("Describes a set of worker selectors that will be attached if the given condition resolves to true") +@projectedName("java", "ConditionalWorkerSelectorAttachmentInternal") model ConditionalWorkerSelectorAttachment extends WorkerSelectorAttachment { @doc("The condition that must be true for the worker selectors to be attached") condition: RouterRule; @@ -800,6 +815,7 @@ model ConditionalWorkerSelectorAttachment extends WorkerSelectorAttachment { @doc("An attachment which attaches worker selectors to a job") @discriminator("kind") +@projectedName("java", "WorkerSelectorAttachmentInternal") model WorkerSelectorAttachment { @doc("The type discriminator describing a sub-type of WorkerSelectorAttachment") kind: string; @@ -854,6 +870,7 @@ model LongestIdleMode extends DistributionMode { } @doc("An action that manually reclassifies a job by providing the queue, priority and worker selectors.") +@projectedName("java", "ManualReclassifyExceptionActionInternal") model ManualReclassifyExceptionAction extends ExceptionAction { @doc("Updated QueueId.") queueId?: string; @@ -879,6 +896,7 @@ model OAuth2WebhookClientCredential { } @doc("Attaches a queue selector where the value is passed through from the job label with the same key") +@projectedName("java", "PassThroughQueueSelectorAttachmentInternal") model PassThroughQueueSelectorAttachment extends QueueSelectorAttachment { @doc("The label key to query against") key: string; @@ -891,6 +909,7 @@ model PassThroughQueueSelectorAttachment extends QueueSelectorAttachment { } @doc("Attaches a worker selector where the value is passed through from the job label with the same key") +@projectedName("java", "PassThroughWorkerSelectorAttachmentInternal") model PassThroughWorkerSelectorAttachment extends WorkerSelectorAttachment { @doc("The label key to query against") key: string; @@ -915,6 +934,7 @@ model QueueLengthExceptionTrigger extends ExceptionTrigger { } @doc("Contains the weight percentage and queue selectors to be applied if selected for weighted distributions.") +@projectedName("java", "QueueWeightedAllocationInternal") model QueueWeightedAllocation { @doc("The percentage of this weight, expressed as a fraction of 1.") weight: float64; @@ -924,6 +944,7 @@ model QueueWeightedAllocation { } @doc("An action that modifies labels on a job and then reclassifies it") +@projectedName("java", "ReclassifyExceptionActionInternal") model ReclassifyExceptionAction extends ExceptionAction { @doc("The new classification policy that will determine queue, priority and worker selectors.") classificationPolicyId?: string; @@ -943,6 +964,7 @@ model RoundRobinMode extends DistributionMode { } @doc("Attaches queue selectors to a job when the RouterRule is resolved") +@projectedName("java", "RuleEngineQueueSelectorAttachmentInternal") model RuleEngineQueueSelectorAttachment extends QueueSelectorAttachment { @doc("A RouterRule that resolves a collection of queue selectors to attach") rule: RouterRule; @@ -952,6 +974,7 @@ model RuleEngineQueueSelectorAttachment extends QueueSelectorAttachment { } @doc("Attaches worker selectors to a job when a RouterRule is resolved") +@projectedName("java", "RuleEngineWorkerSelectorAttachmentInternal") model RuleEngineWorkerSelectorAttachment extends WorkerSelectorAttachment { @doc("A RouterRule that resolves a collection of worker selectors to attach") rule: RouterRule; @@ -961,6 +984,7 @@ model RuleEngineWorkerSelectorAttachment extends WorkerSelectorAttachment { } @doc("Describes a queue selector that will be attached to the job") +@projectedName("java", "StaticQueueSelectorAttachmentInternal") model StaticQueueSelectorAttachment extends QueueSelectorAttachment { @doc("The queue selector to attach.") queueSelector: RouterQueueSelector; @@ -981,6 +1005,7 @@ model StaticRouterRule extends RouterRule { } @doc("Describes a worker selector that will be attached to the job") +@projectedName("java", "StaticWorkerSelectorAttachmentInternal") model StaticWorkerSelectorAttachment extends WorkerSelectorAttachment { @doc("The worker selector to attach.") workerSelector: RouterWorkerSelector; @@ -1014,6 +1039,7 @@ model WebhookRouterRule extends RouterRule { } @doc("Describes multiple sets of queue selectors, of which one will be selected and attached according to a weighting") +@projectedName("java", "WeightedAllocationQueueSelectorAttachmentInternal") model WeightedAllocationQueueSelectorAttachment extends QueueSelectorAttachment { @doc("A collection of percentage based weighted allocations.") @@ -1024,6 +1050,7 @@ model WeightedAllocationQueueSelectorAttachment } @doc("Describes multiple sets of worker selectors, of which one will be selected and attached according to a weighting") +@projectedName("java", "WeightedAllocationWorkerSelectorAttachmentInternal") model WeightedAllocationWorkerSelectorAttachment extends WorkerSelectorAttachment { @doc("A collection of percentage based weighted allocations.") @@ -1034,6 +1061,7 @@ model WeightedAllocationWorkerSelectorAttachment } @doc("Contains the weight percentage and worker selectors to be applied if selected for weighted distributions.") +@projectedName("java", "WorkerWeightedAllocationInternal") model WorkerWeightedAllocation { @doc("The percentage of this weight, expressed as a fraction of 1.") weight: float64; From 4e04519442aae421f962f60b2d37e457eb037fb8 Mon Sep 17 00:00:00 2001 From: Charandeep Parisineti Date: Sun, 5 Nov 2023 10:00:17 -0800 Subject: [PATCH 075/113] Remove projectedName annotations --- .../Communication.JobRouter/models.tsp | 28 ------------------- 1 file changed, 28 deletions(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index ea0143f75562..6faf32b1f036 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -224,7 +224,6 @@ enum ExpressionRouterRuleLanguage { @resource("classificationPolicies") @doc("A container for the rules that govern how jobs are classified.") -@projectedName("java", "ClassificationPolicyInternal") model ClassificationPolicy { ...EtagProperty; @@ -265,7 +264,6 @@ model RouterRule { @resource("distributionPolicies") @doc("Policy governing how jobs are distributed to workers") -@projectedName("java", "DistributionPolicyInternal") model DistributionPolicy { ...EtagProperty; @@ -302,7 +300,6 @@ model DistributionMode { @resource("exceptionPolicies") @doc("A policy that defines actions to execute when exception are triggered.") -@projectedName("java", "ExceptionPolicyInternal") model ExceptionPolicy { ...EtagProperty; @@ -319,7 +316,6 @@ model ExceptionPolicy { } @doc("A rule that defines actions to execute upon a specific trigger.") -@projectedName("java", "ExceptionRuleInternal") model ExceptionRule { @doc("Id of the exception rule.") id: string; @@ -349,7 +345,6 @@ model RouterJobNote { @resource("jobs") @doc("A unit of work to be routed") -@projectedName("java", "RouterJobInternal") model RouterJob { ...EtagProperty; @@ -415,7 +410,6 @@ model RouterJob { } @doc("Describes a condition that must be met against a set of labels for worker selection") -@projectedName("java", "RouterWorkerSelectorInternal") model RouterWorkerSelector { @doc("The label key to query against") key: string; @@ -580,7 +574,6 @@ model DeclineJobOfferOptions { @resource("queues") @doc("A queue that can contain jobs to be routed.") -@projectedName("java", "RouterQueueInternal") model RouterQueue { ...EtagProperty; @@ -604,7 +597,6 @@ model RouterQueue { } @doc("Statistics for the queue") -@projectedName("java", "RouterQueueStatisticsInternal") model RouterQueueStatistics { @doc("Id of the queue these details are about.") queueId: string; @@ -621,7 +613,6 @@ model RouterQueueStatistics { @resource("workers") @doc("An entity for jobs to be routed to") -@projectedName("java", "RouterWorkerInternal") model RouterWorker { ...EtagProperty; @@ -740,7 +731,6 @@ model ScoringRuleOptions { } @doc("An action that marks a job as cancelled") -@projectedName("java", "CancelExceptionActionInternal") model CancelExceptionAction extends ExceptionAction { @doc("A note that will be appended to the jobs' Notes collection with the current timestamp.") note?: string; @@ -754,7 +744,6 @@ model CancelExceptionAction extends ExceptionAction { @doc("The action to take when the exception is triggered") @discriminator("kind") -@projectedName("java", "ExceptionActionInternal") model ExceptionAction { @doc("Unique Id of the exception action") @visibility("read") @@ -765,7 +754,6 @@ model ExceptionAction { } @doc("Describes a set of queue selectors that will be attached if the given condition resolves to true") -@projectedName("java", "ConditionalQueueSelectorAttachmentInternal") model ConditionalQueueSelectorAttachment extends QueueSelectorAttachment { @doc("The condition that must be true for the queue selectors to be attached") condition: RouterRule; @@ -778,7 +766,6 @@ model ConditionalQueueSelectorAttachment extends QueueSelectorAttachment { } @doc("Describes a condition that must be met against a set of labels for queue selection") -@projectedName("java", "RouterQueueSelectorInternal") model RouterQueueSelector { @doc("The label key to query against") key: string; @@ -794,14 +781,12 @@ model RouterQueueSelector { @doc("An attachment of queue selectors to resolve a queue to a job from a classification policy") @discriminator("kind") -@projectedName("java", "QueueSelectorAttachmentInternal") model QueueSelectorAttachment { @doc("The type discriminator describing a sub-type of QueueSelectorAttachment") kind: string; } @doc("Describes a set of worker selectors that will be attached if the given condition resolves to true") -@projectedName("java", "ConditionalWorkerSelectorAttachmentInternal") model ConditionalWorkerSelectorAttachment extends WorkerSelectorAttachment { @doc("The condition that must be true for the worker selectors to be attached") condition: RouterRule; @@ -815,7 +800,6 @@ model ConditionalWorkerSelectorAttachment extends WorkerSelectorAttachment { @doc("An attachment which attaches worker selectors to a job") @discriminator("kind") -@projectedName("java", "WorkerSelectorAttachmentInternal") model WorkerSelectorAttachment { @doc("The type discriminator describing a sub-type of WorkerSelectorAttachment") kind: string; @@ -870,7 +854,6 @@ model LongestIdleMode extends DistributionMode { } @doc("An action that manually reclassifies a job by providing the queue, priority and worker selectors.") -@projectedName("java", "ManualReclassifyExceptionActionInternal") model ManualReclassifyExceptionAction extends ExceptionAction { @doc("Updated QueueId.") queueId?: string; @@ -896,7 +879,6 @@ model OAuth2WebhookClientCredential { } @doc("Attaches a queue selector where the value is passed through from the job label with the same key") -@projectedName("java", "PassThroughQueueSelectorAttachmentInternal") model PassThroughQueueSelectorAttachment extends QueueSelectorAttachment { @doc("The label key to query against") key: string; @@ -909,7 +891,6 @@ model PassThroughQueueSelectorAttachment extends QueueSelectorAttachment { } @doc("Attaches a worker selector where the value is passed through from the job label with the same key") -@projectedName("java", "PassThroughWorkerSelectorAttachmentInternal") model PassThroughWorkerSelectorAttachment extends WorkerSelectorAttachment { @doc("The label key to query against") key: string; @@ -934,7 +915,6 @@ model QueueLengthExceptionTrigger extends ExceptionTrigger { } @doc("Contains the weight percentage and queue selectors to be applied if selected for weighted distributions.") -@projectedName("java", "QueueWeightedAllocationInternal") model QueueWeightedAllocation { @doc("The percentage of this weight, expressed as a fraction of 1.") weight: float64; @@ -944,7 +924,6 @@ model QueueWeightedAllocation { } @doc("An action that modifies labels on a job and then reclassifies it") -@projectedName("java", "ReclassifyExceptionActionInternal") model ReclassifyExceptionAction extends ExceptionAction { @doc("The new classification policy that will determine queue, priority and worker selectors.") classificationPolicyId?: string; @@ -964,7 +943,6 @@ model RoundRobinMode extends DistributionMode { } @doc("Attaches queue selectors to a job when the RouterRule is resolved") -@projectedName("java", "RuleEngineQueueSelectorAttachmentInternal") model RuleEngineQueueSelectorAttachment extends QueueSelectorAttachment { @doc("A RouterRule that resolves a collection of queue selectors to attach") rule: RouterRule; @@ -974,7 +952,6 @@ model RuleEngineQueueSelectorAttachment extends QueueSelectorAttachment { } @doc("Attaches worker selectors to a job when a RouterRule is resolved") -@projectedName("java", "RuleEngineWorkerSelectorAttachmentInternal") model RuleEngineWorkerSelectorAttachment extends WorkerSelectorAttachment { @doc("A RouterRule that resolves a collection of worker selectors to attach") rule: RouterRule; @@ -984,7 +961,6 @@ model RuleEngineWorkerSelectorAttachment extends WorkerSelectorAttachment { } @doc("Describes a queue selector that will be attached to the job") -@projectedName("java", "StaticQueueSelectorAttachmentInternal") model StaticQueueSelectorAttachment extends QueueSelectorAttachment { @doc("The queue selector to attach.") queueSelector: RouterQueueSelector; @@ -1005,7 +981,6 @@ model StaticRouterRule extends RouterRule { } @doc("Describes a worker selector that will be attached to the job") -@projectedName("java", "StaticWorkerSelectorAttachmentInternal") model StaticWorkerSelectorAttachment extends WorkerSelectorAttachment { @doc("The worker selector to attach.") workerSelector: RouterWorkerSelector; @@ -1039,7 +1014,6 @@ model WebhookRouterRule extends RouterRule { } @doc("Describes multiple sets of queue selectors, of which one will be selected and attached according to a weighting") -@projectedName("java", "WeightedAllocationQueueSelectorAttachmentInternal") model WeightedAllocationQueueSelectorAttachment extends QueueSelectorAttachment { @doc("A collection of percentage based weighted allocations.") @@ -1050,7 +1024,6 @@ model WeightedAllocationQueueSelectorAttachment } @doc("Describes multiple sets of worker selectors, of which one will be selected and attached according to a weighting") -@projectedName("java", "WeightedAllocationWorkerSelectorAttachmentInternal") model WeightedAllocationWorkerSelectorAttachment extends WorkerSelectorAttachment { @doc("A collection of percentage based weighted allocations.") @@ -1061,7 +1034,6 @@ model WeightedAllocationWorkerSelectorAttachment } @doc("Contains the weight percentage and worker selectors to be applied if selected for weighted distributions.") -@projectedName("java", "WorkerWeightedAllocationInternal") model WorkerWeightedAllocation { @doc("The percentage of this weight, expressed as a fraction of 1.") weight: float64; From 456001f6aea545bb56c3ff1ff975a00b6022373a Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Fri, 3 Nov 2023 11:17:25 -0700 Subject: [PATCH 076/113] more linter fixes --- .../Communication.JobRouter/models.tsp | 82 ++++++++++++++++--- .../Communication.JobRouter/routes.tsp | 10 ++- .../communicationservicejobrouter.json | 55 +++++++++++-- 3 files changed, 128 insertions(+), 19 deletions(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 6faf32b1f036..0be65e4e209d 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -1046,34 +1046,92 @@ model WorkerWeightedAllocation { @doc("Request payload for reclassifying jobs") model ReclassifyJobOptions is Record; +#suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" +@access(Access.internal) @doc("Response payload from reclassifying a job") -model ReclassifyJobResult {} - -alias ReclassfiyJobOkReponse = ResourceOkResponse; +model ReclassifyJobResult is Record; +#suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" +@access(Access.internal) @doc("Response payload from closing a job") -model CloseJobResult {} +model CloseJobResult is Record; + +@doc("Response payload from closing a job synchronously.") +model CloseJobResultWithOkResponse { + #suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" + @doc("Response after closing a job.") + @body + body: CloseJobResult; -alias CloseJobResultWithOkResponse = ResourceOkResponse; + @doc("Status code.") + @statusCode + _: 200; +} + +@doc("Response payload from closing a job at a future time.") +model CloseJobResultWithAcceptedResponse { + #suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" + @doc("Response after closing a job.") + @body + body: CloseJobResult; -alias CloseJobResultWithAcceptedResponse = Azure.Core.Foundations.AcceptedResponse; + @doc("Status code.") + @statusCode + _: 202; +} alias CloseJobResultResponse = CloseJobResultWithOkResponse | CloseJobResultWithAcceptedResponse; +#suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" +@access(Access.internal) @doc("Response payload from cancelling a job") -model CancelJobResult {} +model CancelJobResult is Record; -alias CancelJobResultWithOkResponse = ResourceOkResponse; +@doc("OK Response payload from cancelling a job") +model CancelJobResultWithOkResponse { + #suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" + @doc("Response after cancelling a job.") + @body + body: CancelJobResult; + @doc("Status code.") + @statusCode + _: 200; +} + +#suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" +@access(Access.internal) @doc("Response payload from completing a job") -model CompleteJobResult {} +model CompleteJobResult is Record; + +@doc("OK Response payload from completing a job") +model CompleteJobResultWithOkResponse { + #suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" + @doc("Response after completing a job.") + @body + body: CompleteJobResult; -alias CompleteJobResultWithOkResponse = ResourceOkResponse; + @doc("Status code.") + @statusCode + _: 200; +} +#suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" +@access(Access.internal) @doc("Response payload from declining a job") -model DeclineJobOfferResult {} +model DeclineJobOfferResult is Record; -alias DeclineJobOfferResultWithOkResponse = ResourceOkResponse; +@doc("OK Response payload from declining a job.") +model DeclineJobOfferResultWithOkResponse { + #suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" + @doc("Response payload from declining a job.") + @body + body: DeclineJobOfferResult; + + @doc("Status code.") + @statusCode + _: 200; +} alias CommonListParams = { @doc("Number of objects to return per page.") diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index 2534d7659aca..f7dc8675c0c9 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -164,7 +164,15 @@ interface JobRouterOperations { @body options?: ReclassifyJobOptions; }, - ReclassfiyJobOkReponse + { + #suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" + @doc("Response after reclassifying a job.") + @body + body: ReclassifyJobResult; + + @statusCode + _: 200; + } >; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index 46e671e37b80..bea17e09e316 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -1121,7 +1121,10 @@ ], "responses": { "200": { - "description": "The request has succeeded." + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/ReclassifyJobResult" + } }, "default": { "description": "An unexpected error response.", @@ -1171,7 +1174,10 @@ ], "responses": { "200": { - "description": "The request has succeeded." + "description": "OK Response payload from cancelling a job", + "schema": { + "$ref": "#/definitions/CancelJobResult" + } }, "default": { "description": "An unexpected error response.", @@ -1224,7 +1230,10 @@ ], "responses": { "200": { - "description": "The request has succeeded." + "description": "OK Response payload from completing a job", + "schema": { + "$ref": "#/definitions/CompleteJobResult" + } }, "default": { "description": "An unexpected error response.", @@ -1274,10 +1283,16 @@ ], "responses": { "200": { - "description": "The request has succeeded." + "description": "Response payload from closing a job synchronously.", + "schema": { + "$ref": "#/definitions/CloseJobResult" + } }, "202": { - "description": "The request has been accepted for processing, but processing has not yet completed." + "description": "Response payload from closing a job at a future time.", + "schema": { + "$ref": "#/definitions/CloseJobResult" + } }, "default": { "description": "An unexpected error response.", @@ -2066,7 +2081,10 @@ ], "responses": { "200": { - "description": "The request has succeeded." + "description": "OK Response payload from declining a job.", + "schema": { + "$ref": "#/definitions/DeclineJobOfferResult" + } }, "default": { "description": "An unexpected error response.", @@ -2253,6 +2271,11 @@ } } }, + "CancelJobResult": { + "type": "object", + "description": "Response payload from cancelling a job", + "additionalProperties": {} + }, "ClassificationPolicy": { "type": "object", "description": "A container for the rules that govern how jobs are classified.", @@ -2361,6 +2384,11 @@ "assignmentId" ] }, + "CloseJobResult": { + "type": "object", + "description": "Response payload from closing a job", + "additionalProperties": {} + }, "CompleteJobOptions": { "type": "object", "description": "Request payload for completing jobs", @@ -2378,6 +2406,11 @@ "assignmentId" ] }, + "CompleteJobResult": { + "type": "object", + "description": "Response payload from completing a job", + "additionalProperties": {} + }, "ConditionalQueueSelectorAttachment": { "type": "object", "description": "Describes a set of queue selectors that will be attached if the given condition resolves to true", @@ -2445,6 +2478,11 @@ } } }, + "DeclineJobOfferResult": { + "type": "object", + "description": "Response payload from declining a job", + "additionalProperties": {} + }, "DirectMapRouterRule": { "type": "object", "description": "A rule that return the same labels as the input labels.", @@ -3221,6 +3259,11 @@ "type": "string" } }, + "ReclassifyJobResult": { + "type": "object", + "description": "Response payload from reclassifying a job", + "additionalProperties": {} + }, "RoundRobinMode": { "type": "object", "description": "Jobs are distributed in order to workers, starting with the worker that is after the last worker to receive a job.", From 58b841d2805a66d03b5e3273d6819d17c173a652 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Fri, 3 Nov 2023 11:46:29 -0700 Subject: [PATCH 077/113] exception action make id not readonly since needs to be serialized --- specification/communication/Communication.JobRouter/models.tsp | 1 - .../stable/2023-11-01/communicationservicejobrouter.json | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 0be65e4e209d..1333681c5d04 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -746,7 +746,6 @@ model CancelExceptionAction extends ExceptionAction { @discriminator("kind") model ExceptionAction { @doc("Unique Id of the exception action") - @visibility("read") id?: string; @doc("The type discriminator describing a sub-type of ExceptionAction") diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index bea17e09e316..be756e81d9be 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -2614,8 +2614,7 @@ "properties": { "id": { "type": "string", - "description": "Unique Id of the exception action", - "readOnly": true + "description": "Unique Id of the exception action" }, "kind": { "type": "string", From ecf88390ad915eb803641fc1d3d9e61567a5b4e4 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Fri, 3 Nov 2023 13:48:56 -0700 Subject: [PATCH 078/113] make methods for canceljon, complete job, close job and decline offer internal so as to not expose empty response objects --- .../communication/Communication.JobRouter/client.tsp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/specification/communication/Communication.JobRouter/client.tsp b/specification/communication/Communication.JobRouter/client.tsp index 3819b2dbfb9b..ed65e8952042 100644 --- a/specification/communication/Communication.JobRouter/client.tsp +++ b/specification/communication/Communication.JobRouter/client.tsp @@ -98,14 +98,23 @@ interface JobRouterRestClient { #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @internal("csharp") + @internal("python") + @internal("java") cancelJob is AzureCommunicationRoutingService.JobRouterOperations.cancelJobAction; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @internal("csharp") + @internal("python") + @internal("java") completeJob is AzureCommunicationRoutingService.JobRouterOperations.completeJobAction; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @internal("csharp") + @internal("python") + @internal("java") closeJob is AzureCommunicationRoutingService.JobRouterOperations.closeJobAction; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @@ -125,6 +134,9 @@ interface JobRouterRestClient { #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @internal("csharp") + @internal("python") + @internal("java") declineJobOffer is AzureCommunicationRoutingService.JobRouterOperations.declineJobAction; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" From fffa15868ab5d0a1a70c53fdb0bd9785c93d4eb5 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Fri, 3 Nov 2023 17:03:41 -0700 Subject: [PATCH 079/113] update azure-tools/typespec-ts emitter options --- .../communication/Communication.JobRouter/tspconfig.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/specification/communication/Communication.JobRouter/tspconfig.yaml b/specification/communication/Communication.JobRouter/tspconfig.yaml index 01757c205a02..371d58eb543f 100644 --- a/specification/communication/Communication.JobRouter/tspconfig.yaml +++ b/specification/communication/Communication.JobRouter/tspconfig.yaml @@ -47,8 +47,6 @@ options: partial-update: true "@azure-tools/typespec-ts": emitter-output-dir: "{js-sdk-folder}/sdk/{service-directory-name}/communication-job-router-rest" - generateMetadata: true - generateTest: true package-dir: "communication-job-router" packageDetails: name: "@azure-rest/communication-job-router" From 637d3048916a81a76c6c471af2dba2604fdd81a9 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Fri, 3 Nov 2023 18:02:36 -0700 Subject: [PATCH 080/113] try update example for LintDiff errors --- ...ficationPolicies_ListClassificationPoliciesWithPageSize.json | 2 +- ...stributionPolicies_ListDistributionPoliciesWithPageSize.json | 2 +- .../ExceptionPolicies_ListExceptionPoliciesWithPageSize.json | 2 +- .../examples/2023-11-01/Jobs_GetJobsWithPageSize.json | 2 +- .../examples/2023-11-01/Queues_ListQueuesWithPageSize.json | 2 +- .../2023-11-01/Workers_GetAvailableWorkersByChannel.json | 2 +- .../examples/2023-11-01/Workers_GetWorkersWithPageSize.json | 2 +- ...ficationPolicies_ListClassificationPoliciesWithPageSize.json | 2 +- ...stributionPolicies_ListDistributionPoliciesWithPageSize.json | 2 +- .../ExceptionPolicies_ListExceptionPoliciesWithPageSize.json | 2 +- .../stable/2023-11-01/examples/Jobs_GetJobsWithPageSize.json | 2 +- .../2023-11-01/examples/Queues_ListQueuesWithPageSize.json | 2 +- .../examples/Workers_GetAvailableWorkersByChannel.json | 2 +- .../2023-11-01/examples/Workers_GetWorkersWithPageSize.json | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json index 731af458f510..8b7d003bcf8b 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json @@ -53,7 +53,7 @@ "etag": "etag" } ], - "nextLink": "/routing/classificationPolicies?continuationToken=Kg==" + "nextLink": "/routing/classificationPolicies?continuationToken=Kg%3D%3D" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_ListDistributionPoliciesWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_ListDistributionPoliciesWithPageSize.json index 6faeed87ffee..ae525887aac9 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_ListDistributionPoliciesWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_ListDistributionPoliciesWithPageSize.json @@ -35,7 +35,7 @@ "etag": "etag" } ], - "nextLink": "/routing/distributionPolicies?continuationToken=Kg==" + "nextLink": "/routing/distributionPolicies?continuationToken=Kg%3D%3D" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json index cd2dd22bf657..70bf85408f48 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json @@ -59,7 +59,7 @@ "etag": "etag" } ], - "nextLink": "/routing/exceptionPolicies?continuationToken=Kg==" + "nextLink": "/routing/exceptionPolicies?continuationToken=Kg%3D%3D" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJobsWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJobsWithPageSize.json index 2639dd06403b..f818ef689aa0 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJobsWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJobsWithPageSize.json @@ -50,7 +50,7 @@ "etag": "etag" } ], - "nextLink": "/routing/jobs?continuationToken=Kg==" + "nextLink": "/routing/jobs?continuationToken=Kg%3D%3D" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_ListQueuesWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_ListQueuesWithPageSize.json index 048c88004b8c..b92d2fce7a49 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_ListQueuesWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_ListQueuesWithPageSize.json @@ -27,7 +27,7 @@ "etag": "etag" } ], - "nextLink": "/routing/queues?continuationToken=Kg==" + "nextLink": "/routing/queues?continuationToken=Kg%3D%3D" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json index c7f4380614ec..c9b3bcb22deb 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json @@ -69,7 +69,7 @@ "etag": "etag" } ], - "nextLink": "/routing/workers?continuationToken=Kg==" + "nextLink": "/routing/workers?continuationToken=Kg%3D%3D" } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json index 28589e1cc2ac..989021d6050f 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json @@ -67,7 +67,7 @@ "etag": "etag" } ], - "nextLink": "/routing/workers?continuationToken=Kg==" + "nextLink": "/routing/workers?continuationToken=Kg%3D%3D" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json index 731af458f510..8b7d003bcf8b 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json @@ -53,7 +53,7 @@ "etag": "etag" } ], - "nextLink": "/routing/classificationPolicies?continuationToken=Kg==" + "nextLink": "/routing/classificationPolicies?continuationToken=Kg%3D%3D" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json index 6faeed87ffee..ae525887aac9 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json @@ -35,7 +35,7 @@ "etag": "etag" } ], - "nextLink": "/routing/distributionPolicies?continuationToken=Kg==" + "nextLink": "/routing/distributionPolicies?continuationToken=Kg%3D%3D" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json index cd2dd22bf657..70bf85408f48 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json @@ -59,7 +59,7 @@ "etag": "etag" } ], - "nextLink": "/routing/exceptionPolicies?continuationToken=Kg==" + "nextLink": "/routing/exceptionPolicies?continuationToken=Kg%3D%3D" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJobsWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJobsWithPageSize.json index 2639dd06403b..f818ef689aa0 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJobsWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJobsWithPageSize.json @@ -50,7 +50,7 @@ "etag": "etag" } ], - "nextLink": "/routing/jobs?continuationToken=Kg==" + "nextLink": "/routing/jobs?continuationToken=Kg%3D%3D" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_ListQueuesWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_ListQueuesWithPageSize.json index 048c88004b8c..b92d2fce7a49 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_ListQueuesWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_ListQueuesWithPageSize.json @@ -27,7 +27,7 @@ "etag": "etag" } ], - "nextLink": "/routing/queues?continuationToken=Kg==" + "nextLink": "/routing/queues?continuationToken=Kg%3D%3D" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json index c7f4380614ec..c9b3bcb22deb 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json @@ -69,7 +69,7 @@ "etag": "etag" } ], - "nextLink": "/routing/workers?continuationToken=Kg==" + "nextLink": "/routing/workers?continuationToken=Kg%3D%3D" } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json index 28589e1cc2ac..989021d6050f 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json @@ -67,7 +67,7 @@ "etag": "etag" } ], - "nextLink": "/routing/workers?continuationToken=Kg==" + "nextLink": "/routing/workers?continuationToken=Kg%3D%3D" } } } From 1d9229e34889a94aa423325013080e9953154123 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Fri, 3 Nov 2023 19:00:32 -0700 Subject: [PATCH 081/113] set nextLink value to null --- ...ficationPolicies_ListClassificationPoliciesWithPageSize.json | 2 +- ...stributionPolicies_ListDistributionPoliciesWithPageSize.json | 2 +- .../ExceptionPolicies_ListExceptionPoliciesWithPageSize.json | 2 +- .../examples/2023-11-01/Jobs_GetJobsWithPageSize.json | 2 +- .../examples/2023-11-01/Queues_ListQueuesWithPageSize.json | 2 +- .../2023-11-01/Workers_GetAvailableWorkersByChannel.json | 2 +- .../examples/2023-11-01/Workers_GetWorkersWithPageSize.json | 2 +- ...ficationPolicies_ListClassificationPoliciesWithPageSize.json | 2 +- ...stributionPolicies_ListDistributionPoliciesWithPageSize.json | 2 +- .../ExceptionPolicies_ListExceptionPoliciesWithPageSize.json | 2 +- .../stable/2023-11-01/examples/Jobs_GetJobsWithPageSize.json | 2 +- .../2023-11-01/examples/Queues_ListQueuesWithPageSize.json | 2 +- .../examples/Workers_GetAvailableWorkersByChannel.json | 2 +- .../2023-11-01/examples/Workers_GetWorkersWithPageSize.json | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json index 8b7d003bcf8b..b866aaf7ceda 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json @@ -53,7 +53,7 @@ "etag": "etag" } ], - "nextLink": "/routing/classificationPolicies?continuationToken=Kg%3D%3D" + "nextLink": null } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_ListDistributionPoliciesWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_ListDistributionPoliciesWithPageSize.json index ae525887aac9..345b72bc559e 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_ListDistributionPoliciesWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/DistributionPolicies_ListDistributionPoliciesWithPageSize.json @@ -35,7 +35,7 @@ "etag": "etag" } ], - "nextLink": "/routing/distributionPolicies?continuationToken=Kg%3D%3D" + "nextLink": null } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json index 70bf85408f48..280f8f2943f6 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json @@ -59,7 +59,7 @@ "etag": "etag" } ], - "nextLink": "/routing/exceptionPolicies?continuationToken=Kg%3D%3D" + "nextLink": null } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJobsWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJobsWithPageSize.json index f818ef689aa0..de2a11fdc6c2 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJobsWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_GetJobsWithPageSize.json @@ -50,7 +50,7 @@ "etag": "etag" } ], - "nextLink": "/routing/jobs?continuationToken=Kg%3D%3D" + "nextLink": null } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_ListQueuesWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_ListQueuesWithPageSize.json index b92d2fce7a49..abfce258a1bc 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_ListQueuesWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Queues_ListQueuesWithPageSize.json @@ -27,7 +27,7 @@ "etag": "etag" } ], - "nextLink": "/routing/queues?continuationToken=Kg%3D%3D" + "nextLink": null } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json index c9b3bcb22deb..6b04cdbf866f 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetAvailableWorkersByChannel.json @@ -69,7 +69,7 @@ "etag": "etag" } ], - "nextLink": "/routing/workers?continuationToken=Kg%3D%3D" + "nextLink": null } } } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json index 989021d6050f..6f2b68c6b40f 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Workers_GetWorkersWithPageSize.json @@ -67,7 +67,7 @@ "etag": "etag" } ], - "nextLink": "/routing/workers?continuationToken=Kg%3D%3D" + "nextLink": null } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json index 8b7d003bcf8b..b866aaf7ceda 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json @@ -53,7 +53,7 @@ "etag": "etag" } ], - "nextLink": "/routing/classificationPolicies?continuationToken=Kg%3D%3D" + "nextLink": null } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json index ae525887aac9..345b72bc559e 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json @@ -35,7 +35,7 @@ "etag": "etag" } ], - "nextLink": "/routing/distributionPolicies?continuationToken=Kg%3D%3D" + "nextLink": null } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json index 70bf85408f48..280f8f2943f6 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json @@ -59,7 +59,7 @@ "etag": "etag" } ], - "nextLink": "/routing/exceptionPolicies?continuationToken=Kg%3D%3D" + "nextLink": null } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJobsWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJobsWithPageSize.json index f818ef689aa0..de2a11fdc6c2 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJobsWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_GetJobsWithPageSize.json @@ -50,7 +50,7 @@ "etag": "etag" } ], - "nextLink": "/routing/jobs?continuationToken=Kg%3D%3D" + "nextLink": null } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_ListQueuesWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_ListQueuesWithPageSize.json index b92d2fce7a49..abfce258a1bc 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_ListQueuesWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Queues_ListQueuesWithPageSize.json @@ -27,7 +27,7 @@ "etag": "etag" } ], - "nextLink": "/routing/queues?continuationToken=Kg%3D%3D" + "nextLink": null } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json index c9b3bcb22deb..6b04cdbf866f 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetAvailableWorkersByChannel.json @@ -69,7 +69,7 @@ "etag": "etag" } ], - "nextLink": "/routing/workers?continuationToken=Kg%3D%3D" + "nextLink": null } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json index 989021d6050f..6f2b68c6b40f 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Workers_GetWorkersWithPageSize.json @@ -67,7 +67,7 @@ "etag": "etag" } ], - "nextLink": "/routing/workers?continuationToken=Kg%3D%3D" + "nextLink": null } } } From 6e2bf075f1c6ec057fbee6f811a4614b5789c788 Mon Sep 17 00:00:00 2001 From: williamzhao87 Date: Mon, 6 Nov 2023 12:02:39 -0500 Subject: [PATCH 082/113] Update unassignJob internal csharp --- specification/communication/Communication.JobRouter/client.tsp | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/communication/Communication.JobRouter/client.tsp b/specification/communication/Communication.JobRouter/client.tsp index ed65e8952042..10f5ff5cf3a2 100644 --- a/specification/communication/Communication.JobRouter/client.tsp +++ b/specification/communication/Communication.JobRouter/client.tsp @@ -126,6 +126,7 @@ interface JobRouterRestClient { #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @internal("csharp") unassignJob is AzureCommunicationRoutingService.JobRouterOperations.unassignJobAction; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" From ab24add48c071a0c0b3627fb0fd59c701e278cc2 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Mon, 6 Nov 2023 10:37:17 -0800 Subject: [PATCH 083/113] move out assignmentId to path --- .../examples/2023-11-01/Jobs_CloseJob.json | 2 +- .../examples/2023-11-01/Jobs_CompleteJob.json | 2 +- .../Communication.JobRouter/models.tsp | 8 +--- .../Communication.JobRouter/routes.tsp | 16 ++++++-- .../communicationservicejobrouter.json | 40 +++++++++---------- .../2023-11-01/examples/Jobs_CloseJob.json | 2 +- .../2023-11-01/examples/Jobs_CompleteJob.json | 2 +- 7 files changed, 37 insertions(+), 35 deletions(-) diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CloseJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CloseJob.json index 0a735cefdd8d..e7e594f1e77c 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CloseJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CloseJob.json @@ -5,8 +5,8 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "jobId": "8780b28c-7079-4de1-9143-4d369289e958", + "assignmentId": "1d5896f3-8b54-40be-82d3-910323f5e2af", "options": { - "assignmentId": "1d5896f3-8b54-40be-82d3-910323f5e2af", "dispositionCode": "JobCompleted.", "note": "Closing job" } diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CompleteJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CompleteJob.json index fc1c61bb99e3..5eb97563cb3c 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CompleteJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CompleteJob.json @@ -5,8 +5,8 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "jobId": "8780b28c-7079-4de1-9143-4d369289e958", + "assignmentId": "1d5896f3-8b54-40be-82d3-910323f5e2af", "options": { - "assignmentId": "1d5896f3-8b54-40be-82d3-910323f5e2af", "note": "Completing job" } }, diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 1333681c5d04..114299b1fdc7 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -499,18 +499,12 @@ model CancelJobOptions { @doc("Request payload for completing jobs") model CompleteJobOptions { - @doc("The assignment within the job to complete.") - assignmentId: string; - @doc("A note that will be appended to the jobs' Notes collection with the current timestamp.") note?: string; } @doc("Request payload for closing jobs") -model CloseJobOptions { - @doc("The assignment within which the job is to be closed.") - assignmentId: string; - +model CloseJobOptions { @doc("Indicates the outcome of the job, populate this field with your own custom values.") dispositionCode?: string; diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index f7dc8675c0c9..f2a688d612b7 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -196,7 +196,7 @@ interface JobRouterOperations { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Completes an assigned job.") @doc("Completes an assigned job.") - @route("/routing/jobs/{jobId}:complete") + @route("/routing/jobs/{jobId}/assignments/{assignmentId}:complete") @post completeJobAction is Azure.Core.Foundations.Operation< { @@ -204,9 +204,13 @@ interface JobRouterOperations { @path jobId: string; + @doc("The assignment within the job to complete.") + @path + assignmentId: string; + @doc("Request model for completing job.") @body - options: CompleteJobOptions; + options?: CompleteJobOptions; }, CompleteJobResultWithOkResponse >; @@ -214,7 +218,7 @@ interface JobRouterOperations { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @summary("Closes a completed job.") @doc("Closes a completed job.") - @route("/routing/jobs/{jobId}:close") + @route("/routing/jobs/{jobId}/assignments/{assignmentId}:close") @post closeJobAction is Azure.Core.Foundations.Operation< { @@ -222,9 +226,13 @@ interface JobRouterOperations { @path jobId: string; + @doc("The assignment within which the job is to be closed.") + @path + assignmentId: string; + @doc("Request model for closing job.") @body - options: CloseJobOptions; + options?: CloseJobOptions; }, CloseJobResultResponse >; diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index be756e81d9be..1d6fa11e83ed 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -1202,7 +1202,7 @@ } } }, - "/routing/jobs/{jobId}:complete": { + "/routing/jobs/{jobId}/assignments/{assignmentId}:complete": { "post": { "operationId": "JobRouterOperations_CompleteJobAction", "summary": "Completes an assigned job.", @@ -1218,11 +1218,18 @@ "required": true, "type": "string" }, + { + "name": "assignmentId", + "in": "path", + "description": "The assignment within the job to complete.", + "required": true, + "type": "string" + }, { "name": "options", "in": "body", "description": "Request model for completing job.", - "required": true, + "required": false, "schema": { "$ref": "#/definitions/CompleteJobOptions" } @@ -1255,7 +1262,7 @@ } } }, - "/routing/jobs/{jobId}:close": { + "/routing/jobs/{jobId}/assignments/{assignmentId}:close": { "post": { "operationId": "JobRouterOperations_CloseJobAction", "summary": "Closes a completed job.", @@ -1271,11 +1278,18 @@ "required": true, "type": "string" }, + { + "name": "assignmentId", + "in": "path", + "description": "The assignment within which the job is to be closed.", + "required": true, + "type": "string" + }, { "name": "options", "in": "body", "description": "Request model for closing job.", - "required": true, + "required": false, "schema": { "$ref": "#/definitions/CloseJobOptions" } @@ -2362,10 +2376,6 @@ "type": "object", "description": "Request payload for closing jobs", "properties": { - "assignmentId": { - "type": "string", - "description": "The assignment within which the job is to be closed." - }, "dispositionCode": { "type": "string", "description": "Indicates the outcome of the job, populate this field with your own custom values." @@ -2379,10 +2389,7 @@ "type": "string", "description": "A note that will be appended to the jobs' Notes collection with the current timestamp." } - }, - "required": [ - "assignmentId" - ] + } }, "CloseJobResult": { "type": "object", @@ -2393,18 +2400,11 @@ "type": "object", "description": "Request payload for completing jobs", "properties": { - "assignmentId": { - "type": "string", - "description": "The assignment within the job to complete." - }, "note": { "type": "string", "description": "A note that will be appended to the jobs' Notes collection with the current timestamp." } - }, - "required": [ - "assignmentId" - ] + } }, "CompleteJobResult": { "type": "object", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json index 0a735cefdd8d..e7e594f1e77c 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json @@ -5,8 +5,8 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "jobId": "8780b28c-7079-4de1-9143-4d369289e958", + "assignmentId": "1d5896f3-8b54-40be-82d3-910323f5e2af", "options": { - "assignmentId": "1d5896f3-8b54-40be-82d3-910323f5e2af", "dispositionCode": "JobCompleted.", "note": "Closing job" } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CompleteJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CompleteJob.json index fc1c61bb99e3..5eb97563cb3c 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CompleteJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CompleteJob.json @@ -5,8 +5,8 @@ "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", "jobId": "8780b28c-7079-4de1-9143-4d369289e958", + "assignmentId": "1d5896f3-8b54-40be-82d3-910323f5e2af", "options": { - "assignmentId": "1d5896f3-8b54-40be-82d3-910323f5e2af", "note": "Completing job" } }, From 983b11b6eeab02dd9e6874cce8c24dd8a21b2491 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Mon, 6 Nov 2023 10:42:41 -0800 Subject: [PATCH 084/113] linter fixes --- specification/communication/Communication.JobRouter/models.tsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 114299b1fdc7..aad87f3db36e 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -504,7 +504,7 @@ model CompleteJobOptions { } @doc("Request payload for closing jobs") -model CloseJobOptions { +model CloseJobOptions { @doc("Indicates the outcome of the job, populate this field with your own custom values.") dispositionCode?: string; From 3ccef751fb2aefafef3731d2e7934a252d960dfc Mon Sep 17 00:00:00 2001 From: williamzhao87 Date: Mon, 6 Nov 2023 14:13:45 -0500 Subject: [PATCH 085/113] Revert unassign job changes --- specification/communication/Communication.JobRouter/client.tsp | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/communication/Communication.JobRouter/client.tsp b/specification/communication/Communication.JobRouter/client.tsp index 10f5ff5cf3a2..ed65e8952042 100644 --- a/specification/communication/Communication.JobRouter/client.tsp +++ b/specification/communication/Communication.JobRouter/client.tsp @@ -126,7 +126,6 @@ interface JobRouterRestClient { #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @internal("csharp") unassignJob is AzureCommunicationRoutingService.JobRouterOperations.unassignJobAction; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" From cdc0ec1b012bf595e75382dd9d0f897204f6b2ab Mon Sep 17 00:00:00 2001 From: williamzhao87 Date: Mon, 6 Nov 2023 17:15:08 -0500 Subject: [PATCH 086/113] Add internal for unassign csharp --- specification/communication/Communication.JobRouter/client.tsp | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/communication/Communication.JobRouter/client.tsp b/specification/communication/Communication.JobRouter/client.tsp index ed65e8952042..10f5ff5cf3a2 100644 --- a/specification/communication/Communication.JobRouter/client.tsp +++ b/specification/communication/Communication.JobRouter/client.tsp @@ -126,6 +126,7 @@ interface JobRouterRestClient { #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @internal("csharp") unassignJob is AzureCommunicationRoutingService.JobRouterOperations.unassignJobAction; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" From 6fa2d2bc4f07c65733cc620434e9144809602e47 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Mon, 6 Nov 2023 15:39:02 -0800 Subject: [PATCH 087/113] use standard ResourceAction for all action except closeJob --- .../Communication.JobRouter/client.tsp | 14 +-- .../examples/2023-11-01/Jobs_CancelJob.json | 2 +- .../examples/2023-11-01/Jobs_CloseJob.json | 2 +- .../examples/2023-11-01/Jobs_CompleteJob.json | 2 +- .../2023-11-01/Jobs_ReclassifyJob.json | 2 +- .../2023-11-01/Jobs_RequestJobCancel.json | 2 +- .../examples/2023-11-01/Jobs_UnassignJob.json | 2 +- .../2023-11-01/Offers_AcceptJobOffer.json | 2 +- .../2023-11-01/Offers_DeclineJobOffer.json | 2 +- .../Communication.JobRouter/models.tsp | 8 ++ .../Communication.JobRouter/routes.tsp | 87 +++++-------------- .../communicationservicejobrouter.json | 42 ++++----- .../2023-11-01/examples/Jobs_CancelJob.json | 2 +- .../2023-11-01/examples/Jobs_CloseJob.json | 2 +- .../2023-11-01/examples/Jobs_CompleteJob.json | 2 +- .../examples/Jobs_ReclassifyJob.json | 2 +- .../examples/Jobs_RequestJobCancel.json | 2 +- .../2023-11-01/examples/Jobs_UnassignJob.json | 2 +- .../examples/Offers_AcceptJobOffer.json | 2 +- .../examples/Offers_DeclineJobOffer.json | 2 +- 20 files changed, 75 insertions(+), 108 deletions(-) diff --git a/specification/communication/Communication.JobRouter/client.tsp b/specification/communication/Communication.JobRouter/client.tsp index 10f5ff5cf3a2..f069a7ea99d5 100644 --- a/specification/communication/Communication.JobRouter/client.tsp +++ b/specification/communication/Communication.JobRouter/client.tsp @@ -94,28 +94,28 @@ interface JobRouterRestClient { @internal("csharp") @internal("python") @internal("java") - reclassifyJob is AzureCommunicationRoutingService.JobRouterOperations.reclassifyJobAction; + reclassifyJob is AzureCommunicationRoutingService.JobRouterOperations.reclassify; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal("csharp") @internal("python") @internal("java") - cancelJob is AzureCommunicationRoutingService.JobRouterOperations.cancelJobAction; + cancelJob is AzureCommunicationRoutingService.JobRouterOperations.cancel; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal("csharp") @internal("python") @internal("java") - completeJob is AzureCommunicationRoutingService.JobRouterOperations.completeJobAction; + completeJob is AzureCommunicationRoutingService.JobRouterOperations.complete; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal("csharp") @internal("python") @internal("java") - closeJob is AzureCommunicationRoutingService.JobRouterOperations.closeJobAction; + closeJob is AzureCommunicationRoutingService.JobRouterOperations.close; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" listJobs is AzureCommunicationRoutingService.JobRouterOperations.listJobs; @@ -127,18 +127,18 @@ interface JobRouterRestClient { #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal("csharp") - unassignJob is AzureCommunicationRoutingService.JobRouterOperations.unassignJobAction; + unassignJob is AzureCommunicationRoutingService.JobRouterOperations.unassign; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - acceptJobOffer is AzureCommunicationRoutingService.JobRouterOperations.acceptJobAction; + acceptJobOffer is AzureCommunicationRoutingService.JobRouterOperations.accept; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal("csharp") @internal("python") @internal("java") - declineJobOffer is AzureCommunicationRoutingService.JobRouterOperations.declineJobAction; + declineJobOffer is AzureCommunicationRoutingService.JobRouterOperations.decline; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CancelJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CancelJob.json index a5000d4c7fe9..f4652ad57f1e 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CancelJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CancelJob.json @@ -1,6 +1,6 @@ { "title": "Cancels a job", - "operationId": "JobRouterOperations_CancelJobAction", + "operationId": "JobRouterOperations_Cancel", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CloseJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CloseJob.json index e7e594f1e77c..3242141bd97c 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CloseJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CloseJob.json @@ -1,6 +1,6 @@ { "title": "Closes a completed job", - "operationId": "JobRouterOperations_CloseJobAction", + "operationId": "JobRouterOperations_Close", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CompleteJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CompleteJob.json index 5eb97563cb3c..0e73f58634e5 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CompleteJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CompleteJob.json @@ -1,6 +1,6 @@ { "title": "Completes an assigned job", - "operationId": "JobRouterOperations_CompleteJobAction", + "operationId": "JobRouterOperations_Complete", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_ReclassifyJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_ReclassifyJob.json index 71e2d121c4fe..28fcf1d68b93 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_ReclassifyJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_ReclassifyJob.json @@ -1,6 +1,6 @@ { "title": "Reclassify a job", - "operationId": "JobRouterOperations_ReclassifyJobAction", + "operationId": "JobRouterOperations_Reclassify", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_RequestJobCancel.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_RequestJobCancel.json index 3660808d52b3..9e90a00881a7 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_RequestJobCancel.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_RequestJobCancel.json @@ -1,6 +1,6 @@ { "title": "Submits request to cancel an existing job", - "operationId": "JobRouterOperations_CancelJobAction", + "operationId": "JobRouterOperations_Cancel", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UnassignJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UnassignJob.json index 9eede13acd99..c89b8d464aac 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UnassignJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UnassignJob.json @@ -1,6 +1,6 @@ { "title": "Un-assign a job", - "operationId": "JobRouterOperations_UnassignJobAction", + "operationId": "JobRouterOperations_Unassign", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_AcceptJobOffer.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_AcceptJobOffer.json index b1a60204783d..7230948ebdb3 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_AcceptJobOffer.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_AcceptJobOffer.json @@ -1,6 +1,6 @@ { "title": "Accepts an offer to work on a job", - "operationId": "JobRouterOperations_AcceptJobAction", + "operationId": "JobRouterOperations_Accept", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_DeclineJobOffer.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_DeclineJobOffer.json index 5f361cdb807e..571f3d4b4696 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_DeclineJobOffer.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_DeclineJobOffer.json @@ -1,6 +1,6 @@ { "title": "Declines an offer to work on a job", - "operationId": "JobRouterOperations_DeclineJobAction", + "operationId": "JobRouterOperations_Decline", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index aad87f3db36e..140caa4cbcbf 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -438,8 +438,12 @@ model RouterWorkerSelector { } @doc("Assignment details of a job to a worker") +@resource("assignments") +@parentResource(RouterJob) model RouterJobAssignment { + @key @doc("The Id of the job assignment.") + @visibility("read") assignmentId: string; @doc("The Id of the Worker assigned to the job.") @@ -665,8 +669,12 @@ model RouterChannel { } @doc("An offer of a job to a worker") +@resource("offers") +@parentResource(RouterWorker) model RouterJobOffer { + @key @doc("The Id of the offer.") + @visibility("read") offerId: string; @doc("The Id of the job.") diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index f2a688d612b7..2c855b79d68c 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -149,17 +149,12 @@ interface JobRouterOperations { @route("/routing") deleteJob is Operations.ResourceDelete; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Reclassify a job.") @doc("Reclassify a job.") - @route("/routing/jobs/{jobId}:reclassify") - @post - reclassifyJobAction is Azure.Core.Foundations.Operation< + @route("/routing") + reclassify is Operations.ResourceAction; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Submits request to cancel an existing job by Id while supplying free-form cancellation reason.") @doc("Submits request to cancel an existing job by Id while supplying free-form cancellation reason.") - @route("/routing/jobs/{jobId}:cancel") - @post - cancelJobAction is Azure.Core.Foundations.Operation< + @route("/routing") + cancel is Operations.ResourceAction; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Completes an assigned job.") @doc("Completes an assigned job.") - @route("/routing/jobs/{jobId}/assignments/{assignmentId}:complete") - @post - completeJobAction is Azure.Core.Foundations.Operation< + @route("/routing") + complete is Operations.ResourceAction; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Need to revist how to correctly define singletons https://github.com/Azure/azure-rest-api-specs/issues/25605#issuecomment-1736265997" @summary("Gets a job's position details.") @doc("Gets a job's position details.") @route("/routing/jobs/{jobId}/position") @@ -257,20 +240,12 @@ interface JobRouterOperations { RouterJobPositionDetails >; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Un-assign a job.") @doc("Un-assign a job.") - @route("/routing/jobs/{jobId}/assignments/{assignmentId}:unassign") - @post - unassignJobAction is Azure.Core.Foundations.Operation< + @route("/routing") + unassign is Operations.ResourceAction; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already.") @doc("Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already.") - @route("/routing/workers/{workerId}/offers/{offerId}:accept") - @post - acceptJobAction is Azure.Core.Foundations.Operation< - { - @doc("Id of the worker.") - @path - workerId: string; - - @doc("Id of the offer.") - @path - offerId: string; - }, + @route("/routing") + accept is Operations.ResourceAction; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Declines an offer to work on a job.") @doc("Declines an offer to work on a job.") - @route("/routing/workers/{workerId}/offers/{offerId}:decline") - @post - declineJobAction is Azure.Core.Foundations.Operation< + @route("/routing") + decline is Operations.ResourceAction; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Need to revist how to correctly define singletons https://github.com/Azure/azure-rest-api-specs/issues/25605#issuecomment-1736265997" @summary("Retrieves a queue's statistics.") @doc("Retrieves a queue's statistics.") @route("/routing/queues/{queueId}/statistics") diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index 1d6fa11e83ed..cb0b67a057fa 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -1095,7 +1095,7 @@ }, "/routing/jobs/{jobId}:reclassify": { "post": { - "operationId": "JobRouterOperations_ReclassifyJobAction", + "operationId": "JobRouterOperations_Reclassify", "summary": "Reclassify a job.", "description": "Reclassify a job.", "parameters": [ @@ -1105,7 +1105,7 @@ { "name": "jobId", "in": "path", - "description": "Id of the job.", + "description": "The id of the job.", "required": true, "type": "string" }, @@ -1148,7 +1148,7 @@ }, "/routing/jobs/{jobId}:cancel": { "post": { - "operationId": "JobRouterOperations_CancelJobAction", + "operationId": "JobRouterOperations_Cancel", "summary": "Submits request to cancel an existing job by Id while supplying free-form cancellation reason.", "description": "Submits request to cancel an existing job by Id while supplying free-form cancellation reason.", "parameters": [ @@ -1158,7 +1158,7 @@ { "name": "jobId", "in": "path", - "description": "Id of the job.", + "description": "The id of the job.", "required": true, "type": "string" }, @@ -1174,7 +1174,7 @@ ], "responses": { "200": { - "description": "OK Response payload from cancelling a job", + "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/CancelJobResult" } @@ -1204,7 +1204,7 @@ }, "/routing/jobs/{jobId}/assignments/{assignmentId}:complete": { "post": { - "operationId": "JobRouterOperations_CompleteJobAction", + "operationId": "JobRouterOperations_Complete", "summary": "Completes an assigned job.", "description": "Completes an assigned job.", "parameters": [ @@ -1214,14 +1214,14 @@ { "name": "jobId", "in": "path", - "description": "Id of the job.", + "description": "The id of the job.", "required": true, "type": "string" }, { "name": "assignmentId", "in": "path", - "description": "The assignment within the job to complete.", + "description": "The Id of the job assignment.", "required": true, "type": "string" }, @@ -1237,7 +1237,7 @@ ], "responses": { "200": { - "description": "OK Response payload from completing a job", + "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/CompleteJobResult" } @@ -1264,7 +1264,7 @@ }, "/routing/jobs/{jobId}/assignments/{assignmentId}:close": { "post": { - "operationId": "JobRouterOperations_CloseJobAction", + "operationId": "JobRouterOperations_Close", "summary": "Closes a completed job.", "description": "Closes a completed job.", "parameters": [ @@ -1330,7 +1330,7 @@ }, "/routing/jobs/{jobId}/assignments/{assignmentId}:unassign": { "post": { - "operationId": "JobRouterOperations_UnassignJobAction", + "operationId": "JobRouterOperations_Unassign", "summary": "Un-assign a job.", "description": "Un-assign a job.", "parameters": [ @@ -1340,14 +1340,14 @@ { "name": "jobId", "in": "path", - "description": "Id of the job to un-assign.", + "description": "The id of the job.", "required": true, "type": "string" }, { "name": "assignmentId", "in": "path", - "description": "Id of the assignment to un-assign.", + "description": "The Id of the job assignment.", "required": true, "type": "string" }, @@ -2011,7 +2011,7 @@ }, "/routing/workers/{workerId}/offers/{offerId}:accept": { "post": { - "operationId": "JobRouterOperations_AcceptJobAction", + "operationId": "JobRouterOperations_Accept", "summary": "Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already.", "description": "Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already.", "parameters": [ @@ -2028,7 +2028,7 @@ { "name": "offerId", "in": "path", - "description": "Id of the offer.", + "description": "The Id of the offer.", "required": true, "type": "string" } @@ -2062,7 +2062,7 @@ }, "/routing/workers/{workerId}/offers/{offerId}:decline": { "post": { - "operationId": "JobRouterOperations_DeclineJobAction", + "operationId": "JobRouterOperations_Decline", "summary": "Declines an offer to work on a job.", "description": "Declines an offer to work on a job.", "parameters": [ @@ -2079,7 +2079,7 @@ { "name": "offerId", "in": "path", - "description": "Id of the offer.", + "description": "The Id of the offer.", "required": true, "type": "string" }, @@ -2095,7 +2095,7 @@ ], "responses": { "200": { - "description": "OK Response payload from declining a job.", + "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/DeclineJobOfferResult" } @@ -3422,7 +3422,8 @@ "properties": { "assignmentId": { "type": "string", - "description": "The Id of the job assignment." + "description": "The Id of the job assignment.", + "readOnly": true }, "workerId": { "type": "string", @@ -3534,7 +3535,8 @@ "properties": { "offerId": { "type": "string", - "description": "The Id of the offer." + "description": "The Id of the offer.", + "readOnly": true }, "jobId": { "type": "string", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CancelJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CancelJob.json index a5000d4c7fe9..f4652ad57f1e 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CancelJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CancelJob.json @@ -1,6 +1,6 @@ { "title": "Cancels a job", - "operationId": "JobRouterOperations_CancelJobAction", + "operationId": "JobRouterOperations_Cancel", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json index e7e594f1e77c..3242141bd97c 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json @@ -1,6 +1,6 @@ { "title": "Closes a completed job", - "operationId": "JobRouterOperations_CloseJobAction", + "operationId": "JobRouterOperations_Close", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CompleteJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CompleteJob.json index 5eb97563cb3c..0e73f58634e5 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CompleteJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CompleteJob.json @@ -1,6 +1,6 @@ { "title": "Completes an assigned job", - "operationId": "JobRouterOperations_CompleteJobAction", + "operationId": "JobRouterOperations_Complete", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_ReclassifyJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_ReclassifyJob.json index 71e2d121c4fe..28fcf1d68b93 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_ReclassifyJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_ReclassifyJob.json @@ -1,6 +1,6 @@ { "title": "Reclassify a job", - "operationId": "JobRouterOperations_ReclassifyJobAction", + "operationId": "JobRouterOperations_Reclassify", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_RequestJobCancel.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_RequestJobCancel.json index 3660808d52b3..9e90a00881a7 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_RequestJobCancel.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_RequestJobCancel.json @@ -1,6 +1,6 @@ { "title": "Submits request to cancel an existing job", - "operationId": "JobRouterOperations_CancelJobAction", + "operationId": "JobRouterOperations_Cancel", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UnassignJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UnassignJob.json index 9eede13acd99..c89b8d464aac 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UnassignJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UnassignJob.json @@ -1,6 +1,6 @@ { "title": "Un-assign a job", - "operationId": "JobRouterOperations_UnassignJobAction", + "operationId": "JobRouterOperations_Unassign", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_AcceptJobOffer.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_AcceptJobOffer.json index b1a60204783d..7230948ebdb3 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_AcceptJobOffer.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_AcceptJobOffer.json @@ -1,6 +1,6 @@ { "title": "Accepts an offer to work on a job", - "operationId": "JobRouterOperations_AcceptJobAction", + "operationId": "JobRouterOperations_Accept", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_DeclineJobOffer.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_DeclineJobOffer.json index 5f361cdb807e..571f3d4b4696 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_DeclineJobOffer.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_DeclineJobOffer.json @@ -1,6 +1,6 @@ { "title": "Declines an offer to work on a job", - "operationId": "JobRouterOperations_DeclineJobAction", + "operationId": "JobRouterOperations_Decline", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", From 0813064ce86188e36650ad7490cc898ca684a575 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Mon, 6 Nov 2023 15:45:40 -0800 Subject: [PATCH 088/113] fix linters --- .../Communication.JobRouter/routes.tsp | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index 2c855b79d68c..4fa59c9f7bde 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -153,7 +153,8 @@ interface JobRouterOperations { @summary("Reclassify a job.") @doc("Reclassify a job.") @route("/routing") - reclassify is Operations.ResourceAction; + accept is Operations.ResourceAction; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Declines an offer to work on a job.") @doc("Declines an offer to work on a job.") @route("/routing") - decline is Operations.ResourceAction Date: Mon, 6 Nov 2023 16:57:07 -0800 Subject: [PATCH 089/113] close job should always return 200 --- .../examples/2023-11-01/Jobs_CloseJob.json | 3 --- .../Communication.JobRouter/models.tsp | 14 -------------- .../Communication.JobRouter/routes.tsp | 17 ++++------------- .../communicationservicejobrouter.json | 12 +++--------- .../2023-11-01/examples/Jobs_CloseJob.json | 3 --- 5 files changed, 7 insertions(+), 42 deletions(-) diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CloseJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CloseJob.json index 3242141bd97c..e2ca89ecda48 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CloseJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CloseJob.json @@ -14,9 +14,6 @@ "responses": { "200": { "body": {} - }, - "202": { - "body": {} } } } diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 140caa4cbcbf..12900a7d80b1 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -1069,20 +1069,6 @@ model CloseJobResultWithOkResponse { _: 200; } -@doc("Response payload from closing a job at a future time.") -model CloseJobResultWithAcceptedResponse { - #suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" - @doc("Response after closing a job.") - @body - body: CloseJobResult; - - @doc("Status code.") - @statusCode - _: 202; -} - -alias CloseJobResultResponse = CloseJobResultWithOkResponse | CloseJobResultWithAcceptedResponse; - #suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" @access(Access.internal) @doc("Response payload from cancelling a job") diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index 4fa59c9f7bde..ce4320e960f1 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -199,26 +199,17 @@ interface JobRouterOperations { CompleteJobResultWithOkResponse >; - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Closes a completed job.") @doc("Closes a completed job.") - @route("/routing/jobs/{jobId}/assignments/{assignmentId}:close") - @post - close is Azure.Core.Foundations.Operation< + @route("/routing") + close is Operations.ResourceAction; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index cb0b67a057fa..d4fb378bf7d7 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -1274,14 +1274,14 @@ { "name": "jobId", "in": "path", - "description": "Id of the job.", + "description": "The id of the job.", "required": true, "type": "string" }, { "name": "assignmentId", "in": "path", - "description": "The assignment within which the job is to be closed.", + "description": "The Id of the job assignment.", "required": true, "type": "string" }, @@ -1297,13 +1297,7 @@ ], "responses": { "200": { - "description": "Response payload from closing a job synchronously.", - "schema": { - "$ref": "#/definitions/CloseJobResult" - } - }, - "202": { - "description": "Response payload from closing a job at a future time.", + "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/CloseJobResult" } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json index 3242141bd97c..e2ca89ecda48 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json @@ -14,9 +14,6 @@ "responses": { "200": { "body": {} - }, - "202": { - "body": {} } } } From de3c3a8904232ff500638ca63ff4350e4a2f5f5d Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Mon, 6 Nov 2023 17:01:17 -0800 Subject: [PATCH 090/113] fix linter errors --- specification/communication/Communication.JobRouter/routes.tsp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index ce4320e960f1..023f154f2eb2 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -203,7 +203,8 @@ interface JobRouterOperations { @summary("Closes a completed job.") @doc("Closes a completed job.") @route("/routing") - close is Operations.ResourceAction Date: Tue, 7 Nov 2023 02:20:21 +0000 Subject: [PATCH 091/113] Suppress violation ValidFormats in LintDiff --- .../communication/data-plane/JobRouter/readme.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/specification/communication/data-plane/JobRouter/readme.md b/specification/communication/data-plane/JobRouter/readme.md index 07a7d5517817..2099682592e7 100644 --- a/specification/communication/data-plane/JobRouter/readme.md +++ b/specification/communication/data-plane/JobRouter/readme.md @@ -29,6 +29,14 @@ openapi-type: data-plane tag: package-jobrouter-2023-11-01 ``` +### Suppression +``` yaml +suppressions: + - code: ValidFormats + # where: $.definitions.Azure.Core.eTag.format + reason: eTag should be an allowed format +``` + ### Tag: package-jobrouter-2023-11-01 These settings apply only when `--tag=package-jobrouter-2023-11-01` is specified on the command line. From 1bcc86debdfe5ccd224b24a02fad1d79638f5934 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 7 Nov 2023 08:08:46 -0800 Subject: [PATCH 092/113] test method rename --- specification/communication/Communication.JobRouter/client.tsp | 2 +- specification/communication/Communication.JobRouter/routes.tsp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/specification/communication/Communication.JobRouter/client.tsp b/specification/communication/Communication.JobRouter/client.tsp index f069a7ea99d5..d328dad82e00 100644 --- a/specification/communication/Communication.JobRouter/client.tsp +++ b/specification/communication/Communication.JobRouter/client.tsp @@ -101,7 +101,7 @@ interface JobRouterRestClient { @internal("csharp") @internal("python") @internal("java") - cancelJob is AzureCommunicationRoutingService.JobRouterOperations.cancel; + cancel is AzureCommunicationRoutingService.JobRouterOperations.cancel; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index 023f154f2eb2..49eef07df7f0 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -175,6 +175,7 @@ interface JobRouterOperations { @summary("Submits request to cancel an existing job by Id while supplying free-form cancellation reason.") @doc("Submits request to cancel an existing job by Id while supplying free-form cancellation reason.") @route("/routing") + @projectedName("cancelJob", "python") cancel is Operations.ResourceAction< RouterJob, { From a8d4f971ac2b5dd700dbf988f331ef0ff40423b2 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 7 Nov 2023 08:17:21 -0800 Subject: [PATCH 093/113] try rename again --- specification/communication/Communication.JobRouter/routes.tsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index 49eef07df7f0..5de180953054 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -175,7 +175,7 @@ interface JobRouterOperations { @summary("Submits request to cancel an existing job by Id while supplying free-form cancellation reason.") @doc("Submits request to cancel an existing job by Id while supplying free-form cancellation reason.") @route("/routing") - @projectedName("cancelJob", "python") + @projectedName("python", "cancelJob") cancel is Operations.ResourceAction< RouterJob, { From 8d8ef8f6df6f2b1a33f265093c0d6927db648577 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 7 Nov 2023 08:19:26 -0800 Subject: [PATCH 094/113] try again --- specification/communication/Communication.JobRouter/routes.tsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index 5de180953054..5ff043a55c42 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -175,7 +175,7 @@ interface JobRouterOperations { @summary("Submits request to cancel an existing job by Id while supplying free-form cancellation reason.") @doc("Submits request to cancel an existing job by Id while supplying free-form cancellation reason.") @route("/routing") - @projectedName("python", "cancelJob") + @projectedName("clients", "cancelJob") cancel is Operations.ResourceAction< RouterJob, { From c9d0d10cd24b78e540b840dc2d1c4bc3711b1569 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 7 Nov 2023 08:30:50 -0800 Subject: [PATCH 095/113] try again --- .../Communication.JobRouter/client.tsp | 12 ++++----- .../Communication.JobRouter/routes.tsp | 26 ++++++++++++++++++- .../communicationservicejobrouter.json | 7 +---- .../examples/Offers_DeclineJobOffer.json | 2 +- 4 files changed, 33 insertions(+), 14 deletions(-) diff --git a/specification/communication/Communication.JobRouter/client.tsp b/specification/communication/Communication.JobRouter/client.tsp index d328dad82e00..b8cc441e4eb8 100644 --- a/specification/communication/Communication.JobRouter/client.tsp +++ b/specification/communication/Communication.JobRouter/client.tsp @@ -94,7 +94,7 @@ interface JobRouterRestClient { @internal("csharp") @internal("python") @internal("java") - reclassifyJob is AzureCommunicationRoutingService.JobRouterOperations.reclassify; + reclassify is AzureCommunicationRoutingService.JobRouterOperations.reclassify; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @@ -108,14 +108,14 @@ interface JobRouterRestClient { @internal("csharp") @internal("python") @internal("java") - completeJob is AzureCommunicationRoutingService.JobRouterOperations.complete; + complete is AzureCommunicationRoutingService.JobRouterOperations.complete; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal("csharp") @internal("python") @internal("java") - closeJob is AzureCommunicationRoutingService.JobRouterOperations.close; + close is AzureCommunicationRoutingService.JobRouterOperations.close; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" listJobs is AzureCommunicationRoutingService.JobRouterOperations.listJobs; @@ -127,18 +127,18 @@ interface JobRouterRestClient { #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal("csharp") - unassignJob is AzureCommunicationRoutingService.JobRouterOperations.unassign; + unassign is AzureCommunicationRoutingService.JobRouterOperations.unassign; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - acceptJobOffer is AzureCommunicationRoutingService.JobRouterOperations.accept; + accept is AzureCommunicationRoutingService.JobRouterOperations.accept; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal("csharp") @internal("python") @internal("java") - declineJobOffer is AzureCommunicationRoutingService.JobRouterOperations.decline; + decline is AzureCommunicationRoutingService.JobRouterOperations.decline; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" #suppress "@azure-tools/typespec-azure-core/use-standard-operations" diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index 5ff043a55c42..0da2df4b260e 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -153,6 +153,10 @@ interface JobRouterOperations { @summary("Reclassify a job.") @doc("Reclassify a job.") @route("/routing") + @projectedName("python", "reclassifyJob") + @projectedName("csharp", "reclassifyJob") + @projectedName("javascript", "reclassifyJob") + @projectedName("java", "reclassifyJob") reclassify is Operations.ResourceAction< RouterJob, { @@ -175,7 +179,10 @@ interface JobRouterOperations { @summary("Submits request to cancel an existing job by Id while supplying free-form cancellation reason.") @doc("Submits request to cancel an existing job by Id while supplying free-form cancellation reason.") @route("/routing") - @projectedName("clients", "cancelJob") + @projectedName("python", "cancelJob") + @projectedName("csharp", "cancelJob") + @projectedName("javascript", "cancelJob") + @projectedName("java", "cancelJob") cancel is Operations.ResourceAction< RouterJob, { @@ -190,6 +197,10 @@ interface JobRouterOperations { @summary("Completes an assigned job.") @doc("Completes an assigned job.") @route("/routing") + @projectedName("python", "completeJob") + @projectedName("csharp", "completeJob") + @projectedName("javascript", "completeJob") + @projectedName("java", "completeJob") complete is Operations.ResourceAction< RouterJobAssignment, { @@ -204,6 +215,10 @@ interface JobRouterOperations { @summary("Closes a completed job.") @doc("Closes a completed job.") @route("/routing") + @projectedName("python", "closeJob") + @projectedName("csharp", "closeJob") + @projectedName("javascript", "closeJob") + @projectedName("java", "closeJob") close is Operations.ResourceAction< RouterJobAssignment, { @@ -238,6 +253,10 @@ interface JobRouterOperations { @summary("Un-assign a job.") @doc("Un-assign a job.") @route("/routing") + @projectedName("python", "unassignJob") + @projectedName("csharp", "unassignJob") + @projectedName("javascript", "unassignJob") + @projectedName("java", "unassignJob") unassign is Operations.ResourceAction< RouterJobAssignment, { @@ -252,12 +271,17 @@ interface JobRouterOperations { @summary("Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already.") @doc("Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already.") @route("/routing") + @projectedName("python", "acceptJobOffer") + @projectedName("csharp", "acceptJobOffer") + @projectedName("javascript", "acceptJobOffer") + @projectedName("java", "acceptJobOffer") accept is Operations.ResourceAction; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Declines an offer to work on a job.") @doc("Declines an offer to work on a job.") @route("/routing") + @projectedName("client", "declineJobOffer") decline is Operations.ResourceAction< RouterJobOffer, { diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index d4fb378bf7d7..04f76df29348 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -2056,7 +2056,7 @@ }, "/routing/workers/{workerId}/offers/{offerId}:decline": { "post": { - "operationId": "JobRouterOperations_Decline", + "operationId": "JobRouterOperations_DeclineJobOffer", "summary": "Declines an offer to work on a job.", "description": "Declines an offer to work on a job.", "parameters": [ @@ -2106,11 +2106,6 @@ } } } - }, - "x-ms-examples": { - "Declines an offer to work on a job": { - "$ref": "./examples/Offers_DeclineJobOffer.json" - } } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_DeclineJobOffer.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_DeclineJobOffer.json index 571f3d4b4696..b978b06a37d0 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_DeclineJobOffer.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_DeclineJobOffer.json @@ -1,6 +1,6 @@ { "title": "Declines an offer to work on a job", - "operationId": "JobRouterOperations_Decline", + "operationId": "JobRouterOperations_DeclineJobOffer", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", From 2987392e9289b9b886414e297b21f689ef5869da Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 7 Nov 2023 08:38:07 -0800 Subject: [PATCH 096/113] try again --- .../examples/2023-11-01/Jobs_CancelJob.json | 2 +- .../examples/2023-11-01/Jobs_CloseJob.json | 2 +- .../examples/2023-11-01/Jobs_CompleteJob.json | 2 +- .../2023-11-01/Jobs_ReclassifyJob.json | 2 +- .../2023-11-01/Jobs_RequestJobCancel.json | 2 +- .../examples/2023-11-01/Jobs_UnassignJob.json | 2 +- .../2023-11-01/Offers_AcceptJobOffer.json | 2 +- .../2023-11-01/Offers_DeclineJobOffer.json | 2 +- .../Communication.JobRouter/routes.tsp | 30 ++++--------------- .../communicationservicejobrouter.json | 17 +++++++---- .../2023-11-01/examples/Jobs_CancelJob.json | 2 +- .../2023-11-01/examples/Jobs_CloseJob.json | 2 +- .../2023-11-01/examples/Jobs_CompleteJob.json | 2 +- .../examples/Jobs_ReclassifyJob.json | 2 +- .../examples/Jobs_RequestJobCancel.json | 2 +- .../2023-11-01/examples/Jobs_UnassignJob.json | 2 +- .../examples/Offers_AcceptJobOffer.json | 2 +- 17 files changed, 32 insertions(+), 45 deletions(-) diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CancelJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CancelJob.json index f4652ad57f1e..616ef8a57aa8 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CancelJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CancelJob.json @@ -1,6 +1,6 @@ { "title": "Cancels a job", - "operationId": "JobRouterOperations_Cancel", + "operationId": "JobRouterOperations_CancelJob", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CloseJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CloseJob.json index e2ca89ecda48..cdc24e5e393d 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CloseJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CloseJob.json @@ -1,6 +1,6 @@ { "title": "Closes a completed job", - "operationId": "JobRouterOperations_Close", + "operationId": "JobRouterOperations_CloseJob", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CompleteJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CompleteJob.json index 0e73f58634e5..752bbbeb6567 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CompleteJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_CompleteJob.json @@ -1,6 +1,6 @@ { "title": "Completes an assigned job", - "operationId": "JobRouterOperations_Complete", + "operationId": "JobRouterOperations_CompleteJob", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_ReclassifyJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_ReclassifyJob.json index 28fcf1d68b93..d725e2295d0f 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_ReclassifyJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_ReclassifyJob.json @@ -1,6 +1,6 @@ { "title": "Reclassify a job", - "operationId": "JobRouterOperations_Reclassify", + "operationId": "JobRouterOperations_ReclassifyJob", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_RequestJobCancel.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_RequestJobCancel.json index 9e90a00881a7..f4c21c153f1b 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_RequestJobCancel.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_RequestJobCancel.json @@ -1,6 +1,6 @@ { "title": "Submits request to cancel an existing job", - "operationId": "JobRouterOperations_Cancel", + "operationId": "JobRouterOperations_CancelJob", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UnassignJob.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UnassignJob.json index c89b8d464aac..4632c32a035e 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UnassignJob.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Jobs_UnassignJob.json @@ -1,6 +1,6 @@ { "title": "Un-assign a job", - "operationId": "JobRouterOperations_Unassign", + "operationId": "JobRouterOperations_UnassignJob", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_AcceptJobOffer.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_AcceptJobOffer.json index 7230948ebdb3..730fc84c1195 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_AcceptJobOffer.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_AcceptJobOffer.json @@ -1,6 +1,6 @@ { "title": "Accepts an offer to work on a job", - "operationId": "JobRouterOperations_Accept", + "operationId": "JobRouterOperations_AcceptJobOffer", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_DeclineJobOffer.json b/specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_DeclineJobOffer.json index 571f3d4b4696..b978b06a37d0 100644 --- a/specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_DeclineJobOffer.json +++ b/specification/communication/Communication.JobRouter/examples/2023-11-01/Offers_DeclineJobOffer.json @@ -1,6 +1,6 @@ { "title": "Declines an offer to work on a job", - "operationId": "JobRouterOperations_Decline", + "operationId": "JobRouterOperations_DeclineJobOffer", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index 0da2df4b260e..7c9dd635c311 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -153,10 +153,7 @@ interface JobRouterOperations { @summary("Reclassify a job.") @doc("Reclassify a job.") @route("/routing") - @projectedName("python", "reclassifyJob") - @projectedName("csharp", "reclassifyJob") - @projectedName("javascript", "reclassifyJob") - @projectedName("java", "reclassifyJob") + @projectedName("client", "reclassifyJob") reclassify is Operations.ResourceAction< RouterJob, { @@ -179,10 +176,7 @@ interface JobRouterOperations { @summary("Submits request to cancel an existing job by Id while supplying free-form cancellation reason.") @doc("Submits request to cancel an existing job by Id while supplying free-form cancellation reason.") @route("/routing") - @projectedName("python", "cancelJob") - @projectedName("csharp", "cancelJob") - @projectedName("javascript", "cancelJob") - @projectedName("java", "cancelJob") + @projectedName("client", "cancelJob") cancel is Operations.ResourceAction< RouterJob, { @@ -197,10 +191,7 @@ interface JobRouterOperations { @summary("Completes an assigned job.") @doc("Completes an assigned job.") @route("/routing") - @projectedName("python", "completeJob") - @projectedName("csharp", "completeJob") - @projectedName("javascript", "completeJob") - @projectedName("java", "completeJob") + @projectedName("client", "completeJob") complete is Operations.ResourceAction< RouterJobAssignment, { @@ -215,10 +206,7 @@ interface JobRouterOperations { @summary("Closes a completed job.") @doc("Closes a completed job.") @route("/routing") - @projectedName("python", "closeJob") - @projectedName("csharp", "closeJob") - @projectedName("javascript", "closeJob") - @projectedName("java", "closeJob") + @projectedName("client", "closeJob") close is Operations.ResourceAction< RouterJobAssignment, { @@ -253,10 +241,7 @@ interface JobRouterOperations { @summary("Un-assign a job.") @doc("Un-assign a job.") @route("/routing") - @projectedName("python", "unassignJob") - @projectedName("csharp", "unassignJob") - @projectedName("javascript", "unassignJob") - @projectedName("java", "unassignJob") + @projectedName("client", "unassignJob") unassign is Operations.ResourceAction< RouterJobAssignment, { @@ -271,10 +256,7 @@ interface JobRouterOperations { @summary("Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already.") @doc("Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already.") @route("/routing") - @projectedName("python", "acceptJobOffer") - @projectedName("csharp", "acceptJobOffer") - @projectedName("javascript", "acceptJobOffer") - @projectedName("java", "acceptJobOffer") + @projectedName("client", "acceptJobOffer") accept is Operations.ResourceAction; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index 04f76df29348..f1b4530eb79f 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -1095,7 +1095,7 @@ }, "/routing/jobs/{jobId}:reclassify": { "post": { - "operationId": "JobRouterOperations_Reclassify", + "operationId": "JobRouterOperations_ReclassifyJob", "summary": "Reclassify a job.", "description": "Reclassify a job.", "parameters": [ @@ -1148,7 +1148,7 @@ }, "/routing/jobs/{jobId}:cancel": { "post": { - "operationId": "JobRouterOperations_Cancel", + "operationId": "JobRouterOperations_CancelJob", "summary": "Submits request to cancel an existing job by Id while supplying free-form cancellation reason.", "description": "Submits request to cancel an existing job by Id while supplying free-form cancellation reason.", "parameters": [ @@ -1204,7 +1204,7 @@ }, "/routing/jobs/{jobId}/assignments/{assignmentId}:complete": { "post": { - "operationId": "JobRouterOperations_Complete", + "operationId": "JobRouterOperations_CompleteJob", "summary": "Completes an assigned job.", "description": "Completes an assigned job.", "parameters": [ @@ -1264,7 +1264,7 @@ }, "/routing/jobs/{jobId}/assignments/{assignmentId}:close": { "post": { - "operationId": "JobRouterOperations_Close", + "operationId": "JobRouterOperations_CloseJob", "summary": "Closes a completed job.", "description": "Closes a completed job.", "parameters": [ @@ -1324,7 +1324,7 @@ }, "/routing/jobs/{jobId}/assignments/{assignmentId}:unassign": { "post": { - "operationId": "JobRouterOperations_Unassign", + "operationId": "JobRouterOperations_UnassignJob", "summary": "Un-assign a job.", "description": "Un-assign a job.", "parameters": [ @@ -2005,7 +2005,7 @@ }, "/routing/workers/{workerId}/offers/{offerId}:accept": { "post": { - "operationId": "JobRouterOperations_Accept", + "operationId": "JobRouterOperations_AcceptJobOffer", "summary": "Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already.", "description": "Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already.", "parameters": [ @@ -2106,6 +2106,11 @@ } } } + }, + "x-ms-examples": { + "Declines an offer to work on a job": { + "$ref": "./examples/Offers_DeclineJobOffer.json" + } } } } diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CancelJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CancelJob.json index f4652ad57f1e..616ef8a57aa8 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CancelJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CancelJob.json @@ -1,6 +1,6 @@ { "title": "Cancels a job", - "operationId": "JobRouterOperations_Cancel", + "operationId": "JobRouterOperations_CancelJob", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json index e2ca89ecda48..cdc24e5e393d 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CloseJob.json @@ -1,6 +1,6 @@ { "title": "Closes a completed job", - "operationId": "JobRouterOperations_Close", + "operationId": "JobRouterOperations_CloseJob", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CompleteJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CompleteJob.json index 0e73f58634e5..752bbbeb6567 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CompleteJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_CompleteJob.json @@ -1,6 +1,6 @@ { "title": "Completes an assigned job", - "operationId": "JobRouterOperations_Complete", + "operationId": "JobRouterOperations_CompleteJob", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_ReclassifyJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_ReclassifyJob.json index 28fcf1d68b93..d725e2295d0f 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_ReclassifyJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_ReclassifyJob.json @@ -1,6 +1,6 @@ { "title": "Reclassify a job", - "operationId": "JobRouterOperations_Reclassify", + "operationId": "JobRouterOperations_ReclassifyJob", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_RequestJobCancel.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_RequestJobCancel.json index 9e90a00881a7..f4c21c153f1b 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_RequestJobCancel.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_RequestJobCancel.json @@ -1,6 +1,6 @@ { "title": "Submits request to cancel an existing job", - "operationId": "JobRouterOperations_Cancel", + "operationId": "JobRouterOperations_CancelJob", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UnassignJob.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UnassignJob.json index c89b8d464aac..4632c32a035e 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UnassignJob.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Jobs_UnassignJob.json @@ -1,6 +1,6 @@ { "title": "Un-assign a job", - "operationId": "JobRouterOperations_Unassign", + "operationId": "JobRouterOperations_UnassignJob", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_AcceptJobOffer.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_AcceptJobOffer.json index 7230948ebdb3..730fc84c1195 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_AcceptJobOffer.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/examples/Offers_AcceptJobOffer.json @@ -1,6 +1,6 @@ { "title": "Accepts an offer to work on a job", - "operationId": "JobRouterOperations_Accept", + "operationId": "JobRouterOperations_AcceptJobOffer", "parameters": { "endpoint": "https://contoso.westus.communications.azure.com", "api-version": "2023-11-01", From 4e9b1c118cfff37608025f283a33e358e3d499ec Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 7 Nov 2023 09:43:13 -0800 Subject: [PATCH 097/113] set default values for min and maz concurrent offer --- .../communication/Communication.JobRouter/models.tsp | 4 ++-- .../2023-11-01/communicationservicejobrouter.json | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 12900a7d80b1..f9df84a93f69 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -286,10 +286,10 @@ model DistributionPolicy { @discriminator("kind") model DistributionMode { @doc("Governs the minimum desired number of active concurrent offers a job can have.") - minConcurrentOffers?: int32; + minConcurrentOffers?: int32 = 1; @doc("Governs the maximum number of active concurrent offers a job can have.") - maxConcurrentOffers?: int32; + maxConcurrentOffers?: int32 = 1; @doc("If set to true, then router will match workers to jobs even if they don't match label selectors. Warning: You may get workers that are not qualified for the job they are matched with if you set this variable to true. This flag is intended more for temporary usage. By default, set to false.") bypassSelectors?: boolean; diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index f1b4530eb79f..1687ebee6f47 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -2504,12 +2504,14 @@ "minConcurrentOffers": { "type": "integer", "format": "int32", - "description": "Governs the minimum desired number of active concurrent offers a job can have." + "description": "Governs the minimum desired number of active concurrent offers a job can have.", + "default": 1 }, "maxConcurrentOffers": { "type": "integer", "format": "int32", - "description": "Governs the maximum number of active concurrent offers a job can have." + "description": "Governs the maximum number of active concurrent offers a job can have.", + "default": 1 }, "bypassSelectors": { "type": "boolean", @@ -2532,12 +2534,14 @@ "minConcurrentOffers": { "type": "integer", "format": "int32", - "description": "Governs the minimum desired number of active concurrent offers a job can have." + "description": "Governs the minimum desired number of active concurrent offers a job can have.", + "default": 1 }, "maxConcurrentOffers": { "type": "integer", "format": "int32", - "description": "Governs the maximum number of active concurrent offers a job can have." + "description": "Governs the maximum number of active concurrent offers a job can have.", + "default": 1 }, "bypassSelectors": { "type": "boolean", From cb8419a09d28d9e87f0b49de6d3e959d1c95e89c Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 7 Nov 2023 11:23:51 -0800 Subject: [PATCH 098/113] set default value of bypass selectors --- .../communication/Communication.JobRouter/models.tsp | 2 +- .../stable/2023-11-01/communicationservicejobrouter.json | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index f9df84a93f69..1282c8f7d420 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -292,7 +292,7 @@ model DistributionMode { maxConcurrentOffers?: int32 = 1; @doc("If set to true, then router will match workers to jobs even if they don't match label selectors. Warning: You may get workers that are not qualified for the job they are matched with if you set this variable to true. This flag is intended more for temporary usage. By default, set to false.") - bypassSelectors?: boolean; + bypassSelectors?: boolean = false; @doc("The type discriminator describing a sub-type of DistributionMode") kind: string; diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index 1687ebee6f47..ff993d4be4be 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -2515,7 +2515,8 @@ }, "bypassSelectors": { "type": "boolean", - "description": "If set to true, then router will match workers to jobs even if they don't match label selectors. Warning: You may get workers that are not qualified for the job they are matched with if you set this variable to true. This flag is intended more for temporary usage. By default, set to false." + "description": "If set to true, then router will match workers to jobs even if they don't match label selectors. Warning: You may get workers that are not qualified for the job they are matched with if you set this variable to true. This flag is intended more for temporary usage. By default, set to false.", + "default": false }, "kind": { "type": "string", @@ -2545,7 +2546,8 @@ }, "bypassSelectors": { "type": "boolean", - "description": "If set to true, then router will match workers to jobs even if they don't match label selectors. Warning: You may get workers that are not qualified for the job they are matched with if you set this variable to true. This flag is intended more for temporary usage. By default, set to false." + "description": "If set to true, then router will match workers to jobs even if they don't match label selectors. Warning: You may get workers that are not qualified for the job they are matched with if you set this variable to true. This flag is intended more for temporary usage. By default, set to false.", + "default": false }, "kind": { "type": "string", From af9a910aa3cc0036f2f598e1179a32e22f5c1e01 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 7 Nov 2023 11:44:34 -0800 Subject: [PATCH 099/113] try codegen removing @route decorator --- .../Communication.JobRouter/models.tsp | 12 +++---- .../Communication.JobRouter/routes.tsp | 31 ------------------- 2 files changed, 6 insertions(+), 37 deletions(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 1282c8f7d420..143fe4881390 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -222,7 +222,7 @@ enum ExpressionRouterRuleLanguage { powerFx, } -@resource("classificationPolicies") +@resource("routing/classificationPolicies") @doc("A container for the rules that govern how jobs are classified.") model ClassificationPolicy { ...EtagProperty; @@ -262,7 +262,7 @@ model RouterRule { kind: string; } -@resource("distributionPolicies") +@resource("routing/distributionPolicies") @doc("Policy governing how jobs are distributed to workers") model DistributionPolicy { ...EtagProperty; @@ -298,7 +298,7 @@ model DistributionMode { kind: string; } -@resource("exceptionPolicies") +@resource("routing/exceptionPolicies") @doc("A policy that defines actions to execute when exception are triggered.") model ExceptionPolicy { ...EtagProperty; @@ -343,7 +343,7 @@ model RouterJobNote { addedAt?: utcDateTime; } -@resource("jobs") +@resource("routing/jobs") @doc("A unit of work to be routed") model RouterJob { ...EtagProperty; @@ -570,7 +570,7 @@ model DeclineJobOfferOptions { retryOfferAt?: utcDateTime; } -@resource("queues") +@resource("routing/queues") @doc("A queue that can contain jobs to be routed.") model RouterQueue { ...EtagProperty; @@ -609,7 +609,7 @@ model RouterQueueStatistics { longestJobWaitTimeMinutes?: float64; } -@resource("workers") +@resource("routing/workers") @doc("An entity for jobs to be routed to") model RouterWorker { ...EtagProperty; diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index 7c9dd635c311..4d98c37da72f 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -27,25 +27,21 @@ interface JobRouterAdministrationOperations { #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a classification policy.") @doc("Creates or updates a classification policy.") - @route("/routing") upsertClassificationPolicy is PatchOperations.ResourceCreateOrUpdate; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing classification policy by Id.") @doc("Retrieves an existing classification policy by Id.") - @route("/routing") getClassificationPolicy is GetOperations.ResourceRead; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Delete a classification policy by Id.") @doc("Delete a classification policy by Id.") - @route("/routing") deleteClassificationPolicy is Operations.ResourceDelete; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves existing classification policies.") @doc("Retrieves existing classification policies.") - @route("/routing") listClassificationPolicies is Operations.ResourceList< ClassificationPolicy, ListClassificationPoliciesQueryParams @@ -54,25 +50,21 @@ interface JobRouterAdministrationOperations { #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a distribution policy.") @doc("Creates or updates a distribution policy.") - @route("/routing") upsertDistributionPolicy is PatchOperations.ResourceCreateOrUpdate; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing distribution policy by Id.") @doc("Retrieves an existing distribution policy by Id.") - @route("/routing") getDistributionPolicy is GetOperations.ResourceRead; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Delete a distribution policy by Id.") @doc("Delete a distribution policy by Id.") - @route("/routing") deleteDistributionPolicy is Operations.ResourceDelete; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves existing distribution policies.") @doc("Retrieves existing distribution policies.") - @route("/routing") listDistributionPolicies is Operations.ResourceList< DistributionPolicy, ListDistributionPoliciesQueryParams @@ -81,25 +73,21 @@ interface JobRouterAdministrationOperations { #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a exception policy.") @doc("Creates or updates a exception policy.") - @route("/routing") upsertExceptionPolicy is PatchOperations.ResourceCreateOrUpdate; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing exception policy by Id.") @doc("Retrieves an existing exception policy by Id.") - @route("/routing") getExceptionPolicy is GetOperations.ResourceRead; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Deletes a exception policy by Id.") @doc("Deletes a exception policy by Id.") - @route("/routing") deleteExceptionPolicy is Operations.ResourceDelete; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves existing exception policies.") @doc("Retrieves existing exception policies.") - @route("/routing") listExceptionPolicies is Operations.ResourceList< ExceptionPolicy, ListExceptionPoliciesQueryParams @@ -108,25 +96,21 @@ interface JobRouterAdministrationOperations { #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a queue.") @doc("Creates or updates a queue.") - @route("/routing") upsertQueue is PatchOperations.ResourceCreateOrUpdate; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing queue by Id.") @doc("Retrieves an existing queue by Id.") - @route("/routing") getQueue is GetOperations.ResourceRead; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Deletes a queue by Id.") @doc("Deletes a queue by Id.") - @route("/routing") deleteQueue is Operations.ResourceDelete; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves existing queues.") @doc("Retrieves existing queues.") - @route("/routing") listQueues is Operations.ResourceList; } @@ -134,25 +118,21 @@ interface JobRouterOperations { #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a router job.") @doc("Creates or updates a router job.") - @route("/routing") upsertJob is PatchOperations.ResourceCreateOrUpdate; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing job by Id.") @doc("Retrieves an existing job by Id.") - @route("/routing") getJob is GetOperations.ResourceRead; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Deletes a job and all of its traces.") @doc("Deletes a job and all of its traces.") - @route("/routing") deleteJob is Operations.ResourceDelete; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Reclassify a job.") @doc("Reclassify a job.") - @route("/routing") @projectedName("client", "reclassifyJob") reclassify is Operations.ResourceAction< RouterJob, @@ -175,7 +155,6 @@ interface JobRouterOperations { #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Submits request to cancel an existing job by Id while supplying free-form cancellation reason.") @doc("Submits request to cancel an existing job by Id while supplying free-form cancellation reason.") - @route("/routing") @projectedName("client", "cancelJob") cancel is Operations.ResourceAction< RouterJob, @@ -190,7 +169,6 @@ interface JobRouterOperations { #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Completes an assigned job.") @doc("Completes an assigned job.") - @route("/routing") @projectedName("client", "completeJob") complete is Operations.ResourceAction< RouterJobAssignment, @@ -205,7 +183,6 @@ interface JobRouterOperations { #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Closes a completed job.") @doc("Closes a completed job.") - @route("/routing") @projectedName("client", "closeJob") close is Operations.ResourceAction< RouterJobAssignment, @@ -220,7 +197,6 @@ interface JobRouterOperations { #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves list of jobs based on filter parameters.") @doc("Retrieves list of jobs based on filter parameters.") - @route("/routing") listJobs is Operations.ResourceList; #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Need to revist how to correctly define singletons https://github.com/Azure/azure-rest-api-specs/issues/25605#issuecomment-1736265997" @@ -240,7 +216,6 @@ interface JobRouterOperations { #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Un-assign a job.") @doc("Un-assign a job.") - @route("/routing") @projectedName("client", "unassignJob") unassign is Operations.ResourceAction< RouterJobAssignment, @@ -255,14 +230,12 @@ interface JobRouterOperations { #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already.") @doc("Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already.") - @route("/routing") @projectedName("client", "acceptJobOffer") accept is Operations.ResourceAction; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Declines an offer to work on a job.") @doc("Declines an offer to work on a job.") - @route("/routing") @projectedName("client", "declineJobOffer") decline is Operations.ResourceAction< RouterJobOffer, @@ -291,24 +264,20 @@ interface JobRouterOperations { #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a worker.") @doc("Creates or updates a worker.") - @route("/routing") upsertWorker is PatchOperations.ResourceCreateOrUpdate; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing worker by Id.") @doc("Retrieves an existing worker by Id.") - @route("/routing") getWorker is GetOperations.ResourceRead; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Deletes a worker and all of its traces.") @doc("Deletes a worker and all of its traces.") - @route("/routing") deleteWorker is Operations.ResourceDelete; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves existing workers.") @doc("Retrieves existing workers.") - @route("/routing") listWorkers is Operations.ResourceList; } From 059b0ded2063a47ed7101bbac24a0489269d5d4b Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 7 Nov 2023 11:56:33 -0800 Subject: [PATCH 100/113] clean up @route decorator --- .../Communication.JobRouter/client.tsp | 46 ++----------------- .../Communication.JobRouter/routes.tsp | 31 ------------- 2 files changed, 4 insertions(+), 73 deletions(-) diff --git a/specification/communication/Communication.JobRouter/client.tsp b/specification/communication/Communication.JobRouter/client.tsp index b8cc441e4eb8..44cd6d66f373 100644 --- a/specification/communication/Communication.JobRouter/client.tsp +++ b/specification/communication/Communication.JobRouter/client.tsp @@ -16,60 +16,44 @@ namespace ClientForAcsJobRouter; service: AzureCommunicationRoutingService, }) interface JobRouterAdministrationRestClient { - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @internal("csharp") @internal("java") upsertDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertDistributionPolicy; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" getDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getDistributionPolicy; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" listDistributionPolicies is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listDistributionPolicies; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" deleteDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteDistributionPolicy; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @internal("csharp") @internal("java") upsertClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertClassificationPolicy; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" getClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getClassificationPolicy; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" listClassificationPolicies is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listClassificationPolicies; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" deleteClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteClassificationPolicy; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @internal("csharp") @internal("java") upsertExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertExceptionPolicy; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" getExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getExceptionPolicy; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" listExceptionPolicies is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listExceptionPolicies; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" deleteExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteExceptionPolicy; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @internal("csharp") @internal("java") upsertQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertQueue; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" getQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getQueue; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" listQueues is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listQueues; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" deleteQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteQueue; } @@ -78,83 +62,61 @@ interface JobRouterAdministrationRestClient { service: AzureCommunicationRoutingService, }) interface JobRouterRestClient { - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @internal("csharp") @internal("java") upsertJob is AzureCommunicationRoutingService.JobRouterOperations.upsertJob; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" getJob is AzureCommunicationRoutingService.JobRouterOperations.getJob; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" deleteJob is AzureCommunicationRoutingService.JobRouterOperations.deleteJob; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal("csharp") @internal("python") @internal("java") reclassify is AzureCommunicationRoutingService.JobRouterOperations.reclassify; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal("csharp") @internal("python") @internal("java") cancel is AzureCommunicationRoutingService.JobRouterOperations.cancel; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal("csharp") @internal("python") @internal("java") complete is AzureCommunicationRoutingService.JobRouterOperations.complete; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal("csharp") @internal("python") @internal("java") close is AzureCommunicationRoutingService.JobRouterOperations.close; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" listJobs is AzureCommunicationRoutingService.JobRouterOperations.listJobs; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Need to revist how to correctly define singletons https://github.com/Azure/azure-rest-api-specs/issues/25605#issuecomment-1736265997" + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Need to revist how to correctly define singletons https://github.com/Azure/azure-rest-api-specs/issues/25605#issuecomment-1736265997" getQueuePosition is AzureCommunicationRoutingService.JobRouterOperations.getInQueuePosition; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal("csharp") unassign is AzureCommunicationRoutingService.JobRouterOperations.unassign; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" accept is AzureCommunicationRoutingService.JobRouterOperations.accept; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" @internal("csharp") @internal("python") @internal("java") decline is AzureCommunicationRoutingService.JobRouterOperations.decline; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Need to revist how to correctly define singletons https://github.com/Azure/azure-rest-api-specs/issues/25605#issuecomment-1736265997" + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Need to revist how to correctly define singletons https://github.com/Azure/azure-rest-api-specs/issues/25605#issuecomment-1736265997" getQueueStatistics is AzureCommunicationRoutingService.JobRouterOperations.getQueueStatistics; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @internal("csharp") @internal("java") upsertWorker is AzureCommunicationRoutingService.JobRouterOperations.upsertWorker; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" getWorker is AzureCommunicationRoutingService.JobRouterOperations.getWorker; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" deleteWorker is AzureCommunicationRoutingService.JobRouterOperations.deleteWorker; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" listWorkers is AzureCommunicationRoutingService.JobRouterOperations.listWorkers; } diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index 4d98c37da72f..2782d7a5a47c 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -24,22 +24,18 @@ alias GetOperations = Azure.Core.ResourceOperations; alias PatchOperations = Azure.Core.ResourceOperations; interface JobRouterAdministrationOperations { - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a classification policy.") @doc("Creates or updates a classification policy.") upsertClassificationPolicy is PatchOperations.ResourceCreateOrUpdate; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing classification policy by Id.") @doc("Retrieves an existing classification policy by Id.") getClassificationPolicy is GetOperations.ResourceRead; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Delete a classification policy by Id.") @doc("Delete a classification policy by Id.") deleteClassificationPolicy is Operations.ResourceDelete; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves existing classification policies.") @doc("Retrieves existing classification policies.") listClassificationPolicies is Operations.ResourceList< @@ -47,22 +43,18 @@ interface JobRouterAdministrationOperations { ListClassificationPoliciesQueryParams >; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a distribution policy.") @doc("Creates or updates a distribution policy.") upsertDistributionPolicy is PatchOperations.ResourceCreateOrUpdate; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing distribution policy by Id.") @doc("Retrieves an existing distribution policy by Id.") getDistributionPolicy is GetOperations.ResourceRead; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Delete a distribution policy by Id.") @doc("Delete a distribution policy by Id.") deleteDistributionPolicy is Operations.ResourceDelete; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves existing distribution policies.") @doc("Retrieves existing distribution policies.") listDistributionPolicies is Operations.ResourceList< @@ -70,22 +62,18 @@ interface JobRouterAdministrationOperations { ListDistributionPoliciesQueryParams >; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a exception policy.") @doc("Creates or updates a exception policy.") upsertExceptionPolicy is PatchOperations.ResourceCreateOrUpdate; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing exception policy by Id.") @doc("Retrieves an existing exception policy by Id.") getExceptionPolicy is GetOperations.ResourceRead; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Deletes a exception policy by Id.") @doc("Deletes a exception policy by Id.") deleteExceptionPolicy is Operations.ResourceDelete; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves existing exception policies.") @doc("Retrieves existing exception policies.") listExceptionPolicies is Operations.ResourceList< @@ -93,44 +81,36 @@ interface JobRouterAdministrationOperations { ListExceptionPoliciesQueryParams >; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a queue.") @doc("Creates or updates a queue.") upsertQueue is PatchOperations.ResourceCreateOrUpdate; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing queue by Id.") @doc("Retrieves an existing queue by Id.") getQueue is GetOperations.ResourceRead; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Deletes a queue by Id.") @doc("Deletes a queue by Id.") deleteQueue is Operations.ResourceDelete; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves existing queues.") @doc("Retrieves existing queues.") listQueues is Operations.ResourceList; } interface JobRouterOperations { - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a router job.") @doc("Creates or updates a router job.") upsertJob is PatchOperations.ResourceCreateOrUpdate; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing job by Id.") @doc("Retrieves an existing job by Id.") getJob is GetOperations.ResourceRead; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Deletes a job and all of its traces.") @doc("Deletes a job and all of its traces.") deleteJob is Operations.ResourceDelete; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Reclassify a job.") @doc("Reclassify a job.") @projectedName("client", "reclassifyJob") @@ -152,7 +132,6 @@ interface JobRouterOperations { } >; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Submits request to cancel an existing job by Id while supplying free-form cancellation reason.") @doc("Submits request to cancel an existing job by Id while supplying free-form cancellation reason.") @projectedName("client", "cancelJob") @@ -166,7 +145,6 @@ interface JobRouterOperations { CancelJobResultWithOkResponse >; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Completes an assigned job.") @doc("Completes an assigned job.") @projectedName("client", "completeJob") @@ -180,7 +158,6 @@ interface JobRouterOperations { CompleteJobResultWithOkResponse >; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Closes a completed job.") @doc("Closes a completed job.") @projectedName("client", "closeJob") @@ -194,7 +171,6 @@ interface JobRouterOperations { CloseJobResultWithOkResponse >; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves list of jobs based on filter parameters.") @doc("Retrieves list of jobs based on filter parameters.") listJobs is Operations.ResourceList; @@ -213,7 +189,6 @@ interface JobRouterOperations { RouterJobPositionDetails >; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Un-assign a job.") @doc("Un-assign a job.") @projectedName("client", "unassignJob") @@ -227,13 +202,11 @@ interface JobRouterOperations { UnassignJobResult >; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already.") @doc("Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already.") @projectedName("client", "acceptJobOffer") accept is Operations.ResourceAction; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Declines an offer to work on a job.") @doc("Declines an offer to work on a job.") @projectedName("client", "declineJobOffer") @@ -261,22 +234,18 @@ interface JobRouterOperations { RouterQueueStatistics >; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Creates or updates a worker.") @doc("Creates or updates a worker.") upsertWorker is PatchOperations.ResourceCreateOrUpdate; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves an existing worker by Id.") @doc("Retrieves an existing worker by Id.") getWorker is GetOperations.ResourceRead; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Deletes a worker and all of its traces.") @doc("Deletes a worker and all of its traces.") deleteWorker is Operations.ResourceDelete; - #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Codegen cannot import prefixes from namespace" @summary("Retrieves existing workers.") @doc("Retrieves existing workers.") listWorkers is Operations.ResourceList; From 986b1a44091c101c9bba67e28942d591abb4b6be Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 7 Nov 2023 12:59:03 -0800 Subject: [PATCH 101/113] revert making unassign internal for csharp --- specification/communication/Communication.JobRouter/client.tsp | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/communication/Communication.JobRouter/client.tsp b/specification/communication/Communication.JobRouter/client.tsp index 44cd6d66f373..a3d83fa71925 100644 --- a/specification/communication/Communication.JobRouter/client.tsp +++ b/specification/communication/Communication.JobRouter/client.tsp @@ -96,7 +96,6 @@ interface JobRouterRestClient { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Need to revist how to correctly define singletons https://github.com/Azure/azure-rest-api-specs/issues/25605#issuecomment-1736265997" getQueuePosition is AzureCommunicationRoutingService.JobRouterOperations.getInQueuePosition; - @internal("csharp") unassign is AzureCommunicationRoutingService.JobRouterOperations.unassign; accept is AzureCommunicationRoutingService.JobRouterOperations.accept; From a019b11fab54dc63ac83c41a794d847a269836e1 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 7 Nov 2023 13:15:57 -0800 Subject: [PATCH 102/113] try renaming completeJob to completeJobInternal for csharp --- specification/communication/Communication.JobRouter/client.tsp | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/communication/Communication.JobRouter/client.tsp b/specification/communication/Communication.JobRouter/client.tsp index a3d83fa71925..8a48e3f12b77 100644 --- a/specification/communication/Communication.JobRouter/client.tsp +++ b/specification/communication/Communication.JobRouter/client.tsp @@ -83,6 +83,7 @@ interface JobRouterRestClient { @internal("csharp") @internal("python") @internal("java") + @projectedName("csharp", "completeJobInternal") complete is AzureCommunicationRoutingService.JobRouterOperations.complete; @internal("csharp") From c1651f95c37ec3559b93a9705b72fffa27597b70 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 7 Nov 2023 14:15:29 -0800 Subject: [PATCH 103/113] rename op cancel, close, complete, decline for csharp --- specification/communication/Communication.JobRouter/client.tsp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/specification/communication/Communication.JobRouter/client.tsp b/specification/communication/Communication.JobRouter/client.tsp index 8a48e3f12b77..fbeeb45ef49a 100644 --- a/specification/communication/Communication.JobRouter/client.tsp +++ b/specification/communication/Communication.JobRouter/client.tsp @@ -78,6 +78,7 @@ interface JobRouterRestClient { @internal("csharp") @internal("python") @internal("java") + @projectedName("csharp", "cancelJobInternal") cancel is AzureCommunicationRoutingService.JobRouterOperations.cancel; @internal("csharp") @@ -89,6 +90,7 @@ interface JobRouterRestClient { @internal("csharp") @internal("python") @internal("java") + @projectedName("csharp", "closeJobInternal") close is AzureCommunicationRoutingService.JobRouterOperations.close; listJobs is AzureCommunicationRoutingService.JobRouterOperations.listJobs; @@ -104,6 +106,7 @@ interface JobRouterRestClient { @internal("csharp") @internal("python") @internal("java") + @projectedName("csharp", "declineJobOfferInternal") decline is AzureCommunicationRoutingService.JobRouterOperations.decline; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Need to revist how to correctly define singletons https://github.com/Azure/azure-rest-api-specs/issues/25605#issuecomment-1736265997" From 8611260f472deb1cd9408dd1e3db8cc241ea9cde Mon Sep 17 00:00:00 2001 From: Mike Harder Date: Wed, 8 Nov 2023 00:23:59 +0000 Subject: [PATCH 104/113] Add "where" clause to ValidFormats suppression --- specification/communication/data-plane/JobRouter/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/communication/data-plane/JobRouter/readme.md b/specification/communication/data-plane/JobRouter/readme.md index 2099682592e7..a6dbabf8cb7f 100644 --- a/specification/communication/data-plane/JobRouter/readme.md +++ b/specification/communication/data-plane/JobRouter/readme.md @@ -33,7 +33,7 @@ tag: package-jobrouter-2023-11-01 ``` yaml suppressions: - code: ValidFormats - # where: $.definitions.Azure.Core.eTag.format + where: $.definitions["Azure.Core.eTag"].format reason: eTag should be an allowed format ``` From ac7b2c7549ed00db33931d9420d34613aff8ced2 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 7 Nov 2023 20:03:32 -0800 Subject: [PATCH 105/113] redefine empty model differently --- .../Communication.JobRouter/client.tsp | 4 -- .../Communication.JobRouter/models.tsp | 69 +++++++++---------- .../Communication.JobRouter/routes.tsp | 10 +-- .../communicationservicejobrouter.json | 45 ++++++------ 4 files changed, 55 insertions(+), 73 deletions(-) diff --git a/specification/communication/Communication.JobRouter/client.tsp b/specification/communication/Communication.JobRouter/client.tsp index fbeeb45ef49a..a3d83fa71925 100644 --- a/specification/communication/Communication.JobRouter/client.tsp +++ b/specification/communication/Communication.JobRouter/client.tsp @@ -78,19 +78,16 @@ interface JobRouterRestClient { @internal("csharp") @internal("python") @internal("java") - @projectedName("csharp", "cancelJobInternal") cancel is AzureCommunicationRoutingService.JobRouterOperations.cancel; @internal("csharp") @internal("python") @internal("java") - @projectedName("csharp", "completeJobInternal") complete is AzureCommunicationRoutingService.JobRouterOperations.complete; @internal("csharp") @internal("python") @internal("java") - @projectedName("csharp", "closeJobInternal") close is AzureCommunicationRoutingService.JobRouterOperations.close; listJobs is AzureCommunicationRoutingService.JobRouterOperations.listJobs; @@ -106,7 +103,6 @@ interface JobRouterRestClient { @internal("csharp") @internal("python") @internal("java") - @projectedName("csharp", "declineJobOfferInternal") decline is AzureCommunicationRoutingService.JobRouterOperations.decline; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Need to revist how to correctly define singletons https://github.com/Azure/azure-rest-api-specs/issues/25605#issuecomment-1736265997" diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 143fe4881390..b85f2f90cb67 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -386,16 +386,16 @@ model RouterJob { @visibility("read") attachedWorkerSelectors?: RouterWorkerSelector[]; - #suppress "@azure-tools/typespec-azure-core/bad-record-type" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." - @doc("A set of key/value pairs that are identifying attributes used by the rules engines to make decisions.") + #suppress "@azure-tools/typespec-azure-core/bad-record-type" "Unions are currently not allowed in spec." + @doc("A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primivite values - number, string, boolean.") labels?: Record; @doc("A collection of the assignments of the job. Key is AssignmentId.") @visibility("read") assignments?: Record; - #suppress "@azure-tools/typespec-azure-core/bad-record-type" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." - @doc("A set of non-identifying attributes attached to this job") + #suppress "@azure-tools/typespec-azure-core/bad-record-type" "Unions are currently not allowed in spec." + @doc("A set of non-identifying attributes attached to this job. Values must be primivite values - number, string, boolean.") tags?: Record; @doc("Notes attached to a job, sorted by timestamp") @@ -417,9 +417,8 @@ model RouterWorkerSelector { @doc("Describes how the value of the label is compared to the value defined on the label selector") labelOperator: LabelOperator; - #suppress "@azure-tools/typespec-azure-core/bad-record-type" - #suppress "@azure-tools/typespec-azure-core/no-unknown" - @doc("The value to compare against the actual label value with the given operator") + #suppress "@azure-tools/typespec-azure-core/no-unknown" "Unions are currently not allowed in spec." + @doc("The value to compare against the actual label value with the given operator. Values must be primivite values - number, string, boolean.") value?: unknown; @doc("Describes how long this label selector is valid in seconds.") @@ -586,8 +585,8 @@ model RouterQueue { @doc("The ID of the distribution policy that will determine how a job is distributed to workers.") distributionPolicyId?: string; - #suppress "@azure-tools/typespec-azure-core/bad-record-type" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." - @doc("A set of key/value pairs that are identifying attributes used by the rules engines to make decisions.") + #suppress "@azure-tools/typespec-azure-core/bad-record-type" "Unions are currently not allowed in spec." + @doc("A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primivite values - number, string, boolean.") labels?: Record; @doc("The ID of the exception policy that determines various job escalation rules.") @@ -629,12 +628,12 @@ model RouterWorker { @doc("The total capacity score this worker has to manage multiple concurrent jobs.") capacity?: int32; - #suppress "@azure-tools/typespec-azure-core/bad-record-type" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." - @doc("A set of key/value pairs that are identifying attributes used by the rules engines to make decisions.") + #suppress "@azure-tools/typespec-azure-core/bad-record-type" "Unions are currently not allowed in spec." + @doc("A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primivite values - number, string, boolean.") labels?: Record; - #suppress "@azure-tools/typespec-azure-core/bad-record-type" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." - @doc("A set of non-identifying attributes attached to this worker.") + #suppress "@azure-tools/typespec-azure-core/bad-record-type" "Unions are currently not allowed in spec." + @doc("A set of non-identifying attributes attached to this worker. Values must be primivite values - number, string, boolean.") tags?: Record; @doc("The channel(s) this worker can handle and their impact on the workers capacity.") @@ -774,9 +773,8 @@ model RouterQueueSelector { @doc("Describes how the value of the label is compared to the value defined on the label selector") labelOperator: LabelOperator; - #suppress "@azure-tools/typespec-azure-core/no-unknown" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." - #suppress "@azure-tools/typespec-azure-core/bad-record-type" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." - @doc("The value to compare against the actual label value with the given operator") + #suppress "@azure-tools/typespec-azure-core/no-unknown" "Unions are currently not allowed in spec." + @doc("The value to compare against the actual label value with the given operator. Values must be primivite values - number, string, boolean.") value?: unknown; } @@ -929,8 +927,8 @@ model ReclassifyExceptionAction extends ExceptionAction { @doc("The new classification policy that will determine queue, priority and worker selectors.") classificationPolicyId?: string; - #suppress "@azure-tools/typespec-azure-core/bad-record-type" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." - @doc("Dictionary containing the labels to update (or add if not existing) in key-value pairs") + #suppress "@azure-tools/typespec-azure-core/bad-record-type" "Unions are currently not allowed in spec." + @doc("Dictionary containing the labels to update (or add if not existing) in key-value pairs. Values must be primivite values - number, string, boolean.") labelsToUpsert?: Record; @doc("The type discriminator describing a sub-type of ExceptionAction") @@ -972,9 +970,8 @@ model StaticQueueSelectorAttachment extends QueueSelectorAttachment { @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/bad-record-type" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." - #suppress "@azure-tools/typespec-azure-core/no-unknown" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." - @doc("The static value this rule always returns.") + #suppress "@azure-tools/typespec-azure-core/no-unknown" "Unions are currently not allowed in spec." + @doc("The static value this rule always returns. Values must be primivite values - number, string, boolean.") value?: unknown; @doc("The type discriminator describing a sub-type of Rule") @@ -1047,19 +1044,27 @@ model WorkerWeightedAllocation { @doc("Request payload for reclassifying jobs") model ReclassifyJobOptions is Record; -#suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" @access(Access.internal) @doc("Response payload from reclassifying a job") -model ReclassifyJobResult is Record; +model ReclassifyJobResult {} + +@doc("OK Response payload from reclassifying a job.") +model ReclassifyJobResultWithOkResponse { + @doc("Response payload from reclassifying a job.") + @body + body: ReclassifyJobResult; + + @doc("Status code.") + @statusCode + _: 200; +} -#suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" @access(Access.internal) @doc("Response payload from closing a job") -model CloseJobResult is Record; +model CloseJobResult {} @doc("Response payload from closing a job synchronously.") model CloseJobResultWithOkResponse { - #suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" @doc("Response after closing a job.") @body body: CloseJobResult; @@ -1069,14 +1074,12 @@ model CloseJobResultWithOkResponse { _: 200; } -#suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" @access(Access.internal) @doc("Response payload from cancelling a job") -model CancelJobResult is Record; +model CancelJobResult {} @doc("OK Response payload from cancelling a job") model CancelJobResultWithOkResponse { - #suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" @doc("Response after cancelling a job.") @body body: CancelJobResult; @@ -1086,14 +1089,12 @@ model CancelJobResultWithOkResponse { _: 200; } -#suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" @access(Access.internal) @doc("Response payload from completing a job") -model CompleteJobResult is Record; +model CompleteJobResult {} @doc("OK Response payload from completing a job") model CompleteJobResultWithOkResponse { - #suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" @doc("Response after completing a job.") @body body: CompleteJobResult; @@ -1103,14 +1104,12 @@ model CompleteJobResultWithOkResponse { _: 200; } -#suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" @access(Access.internal) @doc("Response payload from declining a job") -model DeclineJobOfferResult is Record; +model DeclineJobOfferResult {} @doc("OK Response payload from declining a job.") model DeclineJobOfferResultWithOkResponse { - #suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" @doc("Response payload from declining a job.") @body body: DeclineJobOfferResult; diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index 2782d7a5a47c..bc3ed7a0a137 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -121,15 +121,7 @@ interface JobRouterOperations { @body options?: ReclassifyJobOptions; }, - { - #suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" - @doc("Response after reclassifying a job.") - @body - body: ReclassifyJobResult; - - @statusCode - _: 200; - } + ReclassifyJobResultWithOkResponse >; @summary("Submits request to cancel an existing job by Id while supplying free-form cancellation reason.") diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index ff993d4be4be..3d9cb68342bc 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -2281,8 +2281,7 @@ }, "CancelJobResult": { "type": "object", - "description": "Response payload from cancelling a job", - "additionalProperties": {} + "description": "Response payload from cancelling a job" }, "ClassificationPolicy": { "type": "object", @@ -2387,8 +2386,7 @@ }, "CloseJobResult": { "type": "object", - "description": "Response payload from closing a job", - "additionalProperties": {} + "description": "Response payload from closing a job" }, "CompleteJobOptions": { "type": "object", @@ -2402,8 +2400,7 @@ }, "CompleteJobResult": { "type": "object", - "description": "Response payload from completing a job", - "additionalProperties": {} + "description": "Response payload from completing a job" }, "ConditionalQueueSelectorAttachment": { "type": "object", @@ -2474,8 +2471,7 @@ }, "DeclineJobOfferResult": { "type": "object", - "description": "Response payload from declining a job", - "additionalProperties": {} + "description": "Response payload from declining a job" }, "DirectMapRouterRule": { "type": "object", @@ -3240,7 +3236,7 @@ }, "labelsToUpsert": { "type": "object", - "description": "Dictionary containing the labels to update (or add if not existing) in key-value pairs", + "description": "Dictionary containing the labels to update (or add if not existing) in key-value pairs. Values must be primivite values - number, string, boolean.", "additionalProperties": {} } }, @@ -3260,8 +3256,7 @@ }, "ReclassifyJobResult": { "type": "object", - "description": "Response payload from reclassifying a job", - "additionalProperties": {} + "description": "Response payload from reclassifying a job" }, "RoundRobinMode": { "type": "object", @@ -3376,7 +3371,7 @@ }, "labels": { "type": "object", - "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions.", + "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primivite values - number, string, boolean.", "additionalProperties": {} }, "assignments": { @@ -3389,7 +3384,7 @@ }, "tags": { "type": "object", - "description": "A set of non-identifying attributes attached to this job", + "description": "A set of non-identifying attributes attached to this job. Values must be primivite values - number, string, boolean.", "additionalProperties": {} }, "notes": { @@ -3489,12 +3484,12 @@ }, "labels": { "type": "object", - "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions.", + "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primivite values - number, string, boolean.", "additionalProperties": {} }, "tags": { "type": "object", - "description": "A set of non-identifying attributes attached to this job", + "description": "A set of non-identifying attributes attached to this job. Values must be primivite values - number, string, boolean.", "additionalProperties": {} }, "notes": { @@ -3708,7 +3703,7 @@ }, "labels": { "type": "object", - "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions.", + "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primivite values - number, string, boolean.", "additionalProperties": {} }, "exceptionPolicyId": { @@ -3735,7 +3730,7 @@ }, "labels": { "type": "object", - "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions.", + "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primivite values - number, string, boolean.", "additionalProperties": {} }, "exceptionPolicyId": { @@ -3757,7 +3752,7 @@ "description": "Describes how the value of the label is compared to the value defined on the label selector" }, "value": { - "description": "The value to compare against the actual label value with the given operator" + "description": "The value to compare against the actual label value with the given operator. Values must be primivite values - number, string, boolean." } }, "required": [ @@ -3855,12 +3850,12 @@ }, "labels": { "type": "object", - "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions.", + "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primivite values - number, string, boolean.", "additionalProperties": {} }, "tags": { "type": "object", - "description": "A set of non-identifying attributes attached to this worker.", + "description": "A set of non-identifying attributes attached to this worker. Values must be primivite values - number, string, boolean.", "additionalProperties": {} }, "channels": { @@ -3953,12 +3948,12 @@ }, "labels": { "type": "object", - "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions.", + "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primivite values - number, string, boolean.", "additionalProperties": {} }, "tags": { "type": "object", - "description": "A set of non-identifying attributes attached to this worker.", + "description": "A set of non-identifying attributes attached to this worker. Values must be primivite values - number, string, boolean.", "additionalProperties": {} }, "channels": { @@ -3988,7 +3983,7 @@ "description": "Describes how the value of the label is compared to the value defined on the label selector" }, "value": { - "description": "The value to compare against the actual label value with the given operator" + "description": "The value to compare against the actual label value with the given operator. Values must be primivite values - number, string, boolean." }, "expiresAfterSeconds": { "type": "number", @@ -4219,7 +4214,7 @@ "description": "A rule providing static rules that always return the same result, regardless of input.", "properties": { "value": { - "description": "The static value this rule always returns." + "description": "The static value this rule always returns. Values must be primivite values - number, string, boolean." } }, "allOf": [ @@ -4234,7 +4229,7 @@ "description": "A rule providing static rules that always return the same result, regardless of input.", "properties": { "value": { - "description": "The static value this rule always returns." + "description": "The static value this rule always returns. Values must be primivite values - number, string, boolean." } }, "allOf": [ From fa487ac36952523f998fa7627675e55741a97a56 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Tue, 7 Nov 2023 20:42:33 -0800 Subject: [PATCH 106/113] fix spelling of primitive --- .../Communication.JobRouter/models.tsp | 18 +++++------ .../communicationservicejobrouter.json | 30 +++++++++---------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index b85f2f90cb67..ee79c73e6294 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -387,7 +387,7 @@ model RouterJob { attachedWorkerSelectors?: RouterWorkerSelector[]; #suppress "@azure-tools/typespec-azure-core/bad-record-type" "Unions are currently not allowed in spec." - @doc("A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primivite values - number, string, boolean.") + @doc("A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primitive values - number, string, boolean.") labels?: Record; @doc("A collection of the assignments of the job. Key is AssignmentId.") @@ -395,7 +395,7 @@ model RouterJob { assignments?: Record; #suppress "@azure-tools/typespec-azure-core/bad-record-type" "Unions are currently not allowed in spec." - @doc("A set of non-identifying attributes attached to this job. Values must be primivite values - number, string, boolean.") + @doc("A set of non-identifying attributes attached to this job. Values must be primitive values - number, string, boolean.") tags?: Record; @doc("Notes attached to a job, sorted by timestamp") @@ -418,7 +418,7 @@ model RouterWorkerSelector { labelOperator: LabelOperator; #suppress "@azure-tools/typespec-azure-core/no-unknown" "Unions are currently not allowed in spec." - @doc("The value to compare against the actual label value with the given operator. Values must be primivite values - number, string, boolean.") + @doc("The value to compare against the actual label value with the given operator. Values must be primitive values - number, string, boolean.") value?: unknown; @doc("Describes how long this label selector is valid in seconds.") @@ -586,7 +586,7 @@ model RouterQueue { distributionPolicyId?: string; #suppress "@azure-tools/typespec-azure-core/bad-record-type" "Unions are currently not allowed in spec." - @doc("A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primivite values - number, string, boolean.") + @doc("A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primitive values - number, string, boolean.") labels?: Record; @doc("The ID of the exception policy that determines various job escalation rules.") @@ -629,11 +629,11 @@ model RouterWorker { capacity?: int32; #suppress "@azure-tools/typespec-azure-core/bad-record-type" "Unions are currently not allowed in spec." - @doc("A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primivite values - number, string, boolean.") + @doc("A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primitive values - number, string, boolean.") labels?: Record; #suppress "@azure-tools/typespec-azure-core/bad-record-type" "Unions are currently not allowed in spec." - @doc("A set of non-identifying attributes attached to this worker. Values must be primivite values - number, string, boolean.") + @doc("A set of non-identifying attributes attached to this worker. Values must be primitive values - number, string, boolean.") tags?: Record; @doc("The channel(s) this worker can handle and their impact on the workers capacity.") @@ -774,7 +774,7 @@ model RouterQueueSelector { labelOperator: LabelOperator; #suppress "@azure-tools/typespec-azure-core/no-unknown" "Unions are currently not allowed in spec." - @doc("The value to compare against the actual label value with the given operator. Values must be primivite values - number, string, boolean.") + @doc("The value to compare against the actual label value with the given operator. Values must be primitive values - number, string, boolean.") value?: unknown; } @@ -928,7 +928,7 @@ model ReclassifyExceptionAction extends ExceptionAction { classificationPolicyId?: string; #suppress "@azure-tools/typespec-azure-core/bad-record-type" "Unions are currently not allowed in spec." - @doc("Dictionary containing the labels to update (or add if not existing) in key-value pairs. Values must be primivite values - number, string, boolean.") + @doc("Dictionary containing the labels to update (or add if not existing) in key-value pairs. Values must be primitive values - number, string, boolean.") labelsToUpsert?: Record; @doc("The type discriminator describing a sub-type of ExceptionAction") @@ -971,7 +971,7 @@ model StaticQueueSelectorAttachment extends QueueSelectorAttachment { @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." - @doc("The static value this rule always returns. Values must be primivite values - number, string, boolean.") + @doc("The static value this rule always returns. Values must be primitive values - number, string, boolean.") value?: unknown; @doc("The type discriminator describing a sub-type of Rule") diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index 3d9cb68342bc..dcd1a4fb22b6 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -3236,7 +3236,7 @@ }, "labelsToUpsert": { "type": "object", - "description": "Dictionary containing the labels to update (or add if not existing) in key-value pairs. Values must be primivite values - number, string, boolean.", + "description": "Dictionary containing the labels to update (or add if not existing) in key-value pairs. Values must be primitive values - number, string, boolean.", "additionalProperties": {} } }, @@ -3371,7 +3371,7 @@ }, "labels": { "type": "object", - "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primivite values - number, string, boolean.", + "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primitive values - number, string, boolean.", "additionalProperties": {} }, "assignments": { @@ -3384,7 +3384,7 @@ }, "tags": { "type": "object", - "description": "A set of non-identifying attributes attached to this job. Values must be primivite values - number, string, boolean.", + "description": "A set of non-identifying attributes attached to this job. Values must be primitive values - number, string, boolean.", "additionalProperties": {} }, "notes": { @@ -3484,12 +3484,12 @@ }, "labels": { "type": "object", - "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primivite values - number, string, boolean.", + "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primitive values - number, string, boolean.", "additionalProperties": {} }, "tags": { "type": "object", - "description": "A set of non-identifying attributes attached to this job. Values must be primivite values - number, string, boolean.", + "description": "A set of non-identifying attributes attached to this job. Values must be primitive values - number, string, boolean.", "additionalProperties": {} }, "notes": { @@ -3703,7 +3703,7 @@ }, "labels": { "type": "object", - "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primivite values - number, string, boolean.", + "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primitive values - number, string, boolean.", "additionalProperties": {} }, "exceptionPolicyId": { @@ -3730,7 +3730,7 @@ }, "labels": { "type": "object", - "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primivite values - number, string, boolean.", + "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primitive values - number, string, boolean.", "additionalProperties": {} }, "exceptionPolicyId": { @@ -3752,7 +3752,7 @@ "description": "Describes how the value of the label is compared to the value defined on the label selector" }, "value": { - "description": "The value to compare against the actual label value with the given operator. Values must be primivite values - number, string, boolean." + "description": "The value to compare against the actual label value with the given operator. Values must be primitive values - number, string, boolean." } }, "required": [ @@ -3850,12 +3850,12 @@ }, "labels": { "type": "object", - "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primivite values - number, string, boolean.", + "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primitive values - number, string, boolean.", "additionalProperties": {} }, "tags": { "type": "object", - "description": "A set of non-identifying attributes attached to this worker. Values must be primivite values - number, string, boolean.", + "description": "A set of non-identifying attributes attached to this worker. Values must be primitive values - number, string, boolean.", "additionalProperties": {} }, "channels": { @@ -3948,12 +3948,12 @@ }, "labels": { "type": "object", - "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primivite values - number, string, boolean.", + "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primitive values - number, string, boolean.", "additionalProperties": {} }, "tags": { "type": "object", - "description": "A set of non-identifying attributes attached to this worker. Values must be primivite values - number, string, boolean.", + "description": "A set of non-identifying attributes attached to this worker. Values must be primitive values - number, string, boolean.", "additionalProperties": {} }, "channels": { @@ -3983,7 +3983,7 @@ "description": "Describes how the value of the label is compared to the value defined on the label selector" }, "value": { - "description": "The value to compare against the actual label value with the given operator. Values must be primivite values - number, string, boolean." + "description": "The value to compare against the actual label value with the given operator. Values must be primitive values - number, string, boolean." }, "expiresAfterSeconds": { "type": "number", @@ -4214,7 +4214,7 @@ "description": "A rule providing static rules that always return the same result, regardless of input.", "properties": { "value": { - "description": "The static value this rule always returns. Values must be primivite values - number, string, boolean." + "description": "The static value this rule always returns. Values must be primitive values - number, string, boolean." } }, "allOf": [ @@ -4229,7 +4229,7 @@ "description": "A rule providing static rules that always return the same result, regardless of input.", "properties": { "value": { - "description": "The static value this rule always returns. Values must be primivite values - number, string, boolean." + "description": "The static value this rule always returns. Values must be primitive values - number, string, boolean." } }, "allOf": [ From a2a2664697563dcea24467a2d3967fe60fecbc55 Mon Sep 17 00:00:00 2001 From: Mike Harder Date: Wed, 8 Nov 2023 06:12:19 +0000 Subject: [PATCH 107/113] Suppress INVALID_TYPE caused by bug in ModelValidation - https://github.com/Azure/azure-rest-api-specs/issues/25381 --- specification/communication/data-plane/JobRouter/readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/specification/communication/data-plane/JobRouter/readme.md b/specification/communication/data-plane/JobRouter/readme.md index a6dbabf8cb7f..66513a9c74ee 100644 --- a/specification/communication/data-plane/JobRouter/readme.md +++ b/specification/communication/data-plane/JobRouter/readme.md @@ -35,6 +35,8 @@ suppressions: - code: ValidFormats where: $.definitions["Azure.Core.eTag"].format reason: eTag should be an allowed format +directive: + - suppress: INVALID_TYPE ``` ### Tag: package-jobrouter-2023-11-01 From fa49999df35542cf48351fc3db099c4a2e722be1 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Wed, 8 Nov 2023 07:47:53 -0800 Subject: [PATCH 108/113] add default and change empty model representation --- .../Communication.JobRouter/models.tsp | 10 +++++----- .../communicationservicejobrouter.json | 18 +++++++++++------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index ee79c73e6294..2583b90a370c 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -719,16 +719,16 @@ model BestWorkerMode extends DistributionMode { @doc("Encapsulates all options that can be passed as parameters for scoring rule with BestWorkerMode") model ScoringRuleOptions { @doc("Set batch size when 'isBatchScoringEnabled' is set to true. Defaults to 20 if not configured.") - batchSize?: int32; + batchSize?: int32 = 20; @doc("List of extra parameters from the job that will be sent as part of the payload to scoring rule. If not set, the job's labels (sent in the payload as `job`) and the job's worker selectors (sent in the payload as `selectors`) are added to the payload of the scoring rule by default. Note: Worker labels are always sent with scoring payload.") - scoringParameters?: ScoringRuleParameterSelector[]; + scoringParameters?: ScoringRuleParameterSelector[] = [ScoringRuleParameterSelector.jobLabels, ScoringRuleParameterSelector.workerSelectors]; @doc("If set to true, will score workers in batches, and the parameter name of the worker labels will be sent as `workers`. By default, set to false and the parameter name for the worker labels will be sent as `worker`. Note: If enabled, use 'batchSize' to set batch size.") - isBatchScoringEnabled?: boolean; + isBatchScoringEnabled?: boolean = false; @doc("If false, will sort scores by ascending order. By default, set to true.") - descendingOrder?: boolean; + descendingOrder?: boolean = true; } @doc("An action that marks a job as cancelled") @@ -1042,7 +1042,7 @@ model WorkerWeightedAllocation { @access(Access.internal) @doc("Request payload for reclassifying jobs") -model ReclassifyJobOptions is Record; +model ReclassifyJobOptions {} @access(Access.internal) @doc("Response payload from reclassifying a job") diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index dcd1a4fb22b6..8b92f7920619 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -3249,10 +3249,7 @@ }, "ReclassifyJobOptions": { "type": "object", - "description": "Request payload for reclassifying jobs", - "additionalProperties": { - "type": "string" - } + "description": "Request payload for reclassifying jobs" }, "ReclassifyJobResult": { "type": "object", @@ -4147,22 +4144,29 @@ "batchSize": { "type": "integer", "format": "int32", - "description": "Set batch size when 'isBatchScoringEnabled' is set to true. Defaults to 20 if not configured." + "description": "Set batch size when 'isBatchScoringEnabled' is set to true. Defaults to 20 if not configured.", + "default": 20 }, "scoringParameters": { "type": "array", "description": "List of extra parameters from the job that will be sent as part of the payload to scoring rule. If not set, the job's labels (sent in the payload as `job`) and the job's worker selectors (sent in the payload as `selectors`) are added to the payload of the scoring rule by default. Note: Worker labels are always sent with scoring payload.", + "default": [ + "jobLabels", + "workerSelectors" + ], "items": { "$ref": "#/definitions/ScoringRuleParameterSelector" } }, "isBatchScoringEnabled": { "type": "boolean", - "description": "If set to true, will score workers in batches, and the parameter name of the worker labels will be sent as `workers`. By default, set to false and the parameter name for the worker labels will be sent as `worker`. Note: If enabled, use 'batchSize' to set batch size." + "description": "If set to true, will score workers in batches, and the parameter name of the worker labels will be sent as `workers`. By default, set to false and the parameter name for the worker labels will be sent as `worker`. Note: If enabled, use 'batchSize' to set batch size.", + "default": false }, "descendingOrder": { "type": "boolean", - "description": "If false, will sort scores by ascending order. By default, set to true." + "description": "If false, will sort scores by ascending order. By default, set to true.", + "default": true } } }, From 2ffb9c71ccabe7b6738eae9daf175507687bbd92 Mon Sep 17 00:00:00 2001 From: williamzhao87 Date: Wed, 8 Nov 2023 10:55:17 -0500 Subject: [PATCH 109/113] Make unassign job internal --- specification/communication/Communication.JobRouter/client.tsp | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/communication/Communication.JobRouter/client.tsp b/specification/communication/Communication.JobRouter/client.tsp index a3d83fa71925..44cd6d66f373 100644 --- a/specification/communication/Communication.JobRouter/client.tsp +++ b/specification/communication/Communication.JobRouter/client.tsp @@ -96,6 +96,7 @@ interface JobRouterRestClient { #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Need to revist how to correctly define singletons https://github.com/Azure/azure-rest-api-specs/issues/25605#issuecomment-1736265997" getQueuePosition is AzureCommunicationRoutingService.JobRouterOperations.getInQueuePosition; + @internal("csharp") unassign is AzureCommunicationRoutingService.JobRouterOperations.unassign; accept is AzureCommunicationRoutingService.JobRouterOperations.accept; From cf93cd80d5c344e84f11d2de706c9f16e8d5f6bf Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Wed, 8 Nov 2023 08:03:51 -0800 Subject: [PATCH 110/113] linter fixes --- .../communication/Communication.JobRouter/models.tsp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 2583b90a370c..f64204e6e10a 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -722,7 +722,10 @@ model ScoringRuleOptions { batchSize?: int32 = 20; @doc("List of extra parameters from the job that will be sent as part of the payload to scoring rule. If not set, the job's labels (sent in the payload as `job`) and the job's worker selectors (sent in the payload as `selectors`) are added to the payload of the scoring rule by default. Note: Worker labels are always sent with scoring payload.") - scoringParameters?: ScoringRuleParameterSelector[] = [ScoringRuleParameterSelector.jobLabels, ScoringRuleParameterSelector.workerSelectors]; + scoringParameters?: ScoringRuleParameterSelector[] = [ + ScoringRuleParameterSelector.jobLabels, + ScoringRuleParameterSelector.workerSelectors + ]; @doc("If set to true, will score workers in batches, and the parameter name of the worker labels will be sent as `workers`. By default, set to false and the parameter name for the worker labels will be sent as `worker`. Note: If enabled, use 'batchSize' to set batch size.") isBatchScoringEnabled?: boolean = false; From c4d75d21a3869508b0b447a257123d873c9b55bb Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar <73562869+sarkar-rajarshi@users.noreply.github.com> Date: Wed, 8 Nov 2023 11:01:40 -0800 Subject: [PATCH 111/113] Update specification/communication/Communication.JobRouter/models.tsp Co-authored-by: Mike Kistler --- specification/communication/Communication.JobRouter/models.tsp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index f64204e6e10a..20a1d3544496 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -21,7 +21,8 @@ model LastModifiedResponseEnvelope { @header("Last-Modified") @visibility("read") @doc("The last modified timestamp.") - lastModifiedTimestamp?: string; + @encode("rfc7231") + lastModifiedTimestamp?: utcDateTime; } // https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#conditional-requests From c16149244ddd940e2305dc958e45989d9b2f8e67 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar <73562869+sarkar-rajarshi@users.noreply.github.com> Date: Wed, 8 Nov 2023 11:01:57 -0800 Subject: [PATCH 112/113] Update specification/communication/Communication.JobRouter/models.tsp Co-authored-by: Mike Kistler --- specification/communication/Communication.JobRouter/models.tsp | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 20a1d3544496..737e439444ac 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -37,6 +37,7 @@ model RouterConditionalRequestHeaders { @visibility("read", "query", "create", "update", "delete") @header("If-Unmodified-Since") @doc("The request should only proceed if the entity was not modified after this time.") + @encode("rfc7231") ifUnmodifiedSince?: utcDateTime; } From a3969184c10e69f81536f809d3fbc551f7f1de29 Mon Sep 17 00:00:00 2001 From: Rajarshi Sarkar Date: Wed, 8 Nov 2023 11:22:40 -0800 Subject: [PATCH 113/113] linter fixes --- .../communicationservicejobrouter.json | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index 8b92f7920619..80c0f41cf334 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -111,6 +111,7 @@ }, "Last-Modified": { "type": "string", + "format": "date-time-rfc7231", "description": "The last modified timestamp." } } @@ -181,6 +182,7 @@ }, "Last-Modified": { "type": "string", + "format": "date-time-rfc7231", "description": "The last modified timestamp." } } @@ -197,6 +199,7 @@ }, "Last-Modified": { "type": "string", + "format": "date-time-rfc7231", "description": "The last modified timestamp." } } @@ -341,6 +344,7 @@ }, "Last-Modified": { "type": "string", + "format": "date-time-rfc7231", "description": "The last modified timestamp." } } @@ -411,6 +415,7 @@ }, "Last-Modified": { "type": "string", + "format": "date-time-rfc7231", "description": "The last modified timestamp." } } @@ -427,6 +432,7 @@ }, "Last-Modified": { "type": "string", + "format": "date-time-rfc7231", "description": "The last modified timestamp." } } @@ -571,6 +577,7 @@ }, "Last-Modified": { "type": "string", + "format": "date-time-rfc7231", "description": "The last modified timestamp." } } @@ -641,6 +648,7 @@ }, "Last-Modified": { "type": "string", + "format": "date-time-rfc7231", "description": "The last modified timestamp." } } @@ -657,6 +665,7 @@ }, "Last-Modified": { "type": "string", + "format": "date-time-rfc7231", "description": "The last modified timestamp." } } @@ -938,6 +947,7 @@ }, "Last-Modified": { "type": "string", + "format": "date-time-rfc7231", "description": "The last modified timestamp." } } @@ -1008,6 +1018,7 @@ }, "Last-Modified": { "type": "string", + "format": "date-time-rfc7231", "description": "The last modified timestamp." } } @@ -1024,6 +1035,7 @@ }, "Last-Modified": { "type": "string", + "format": "date-time-rfc7231", "description": "The last modified timestamp." } } @@ -1504,6 +1516,7 @@ }, "Last-Modified": { "type": "string", + "format": "date-time-rfc7231", "description": "The last modified timestamp." } } @@ -1574,6 +1587,7 @@ }, "Last-Modified": { "type": "string", + "format": "date-time-rfc7231", "description": "The last modified timestamp." } } @@ -1590,6 +1604,7 @@ }, "Last-Modified": { "type": "string", + "format": "date-time-rfc7231", "description": "The last modified timestamp." } } @@ -1842,6 +1857,7 @@ }, "Last-Modified": { "type": "string", + "format": "date-time-rfc7231", "description": "The last modified timestamp." } } @@ -1912,6 +1928,7 @@ }, "Last-Modified": { "type": "string", + "format": "date-time-rfc7231", "description": "The last modified timestamp." } } @@ -1928,6 +1945,7 @@ }, "Last-Modified": { "type": "string", + "format": "date-time-rfc7231", "description": "The last modified timestamp." } } @@ -4493,7 +4511,7 @@ "description": "The request should only proceed if the entity was not modified after this time.", "required": false, "type": "string", - "format": "date-time", + "format": "date-time-rfc7231", "x-ms-parameter-location": "method", "x-ms-client-name": "ifUnmodifiedSince" }