diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/communicationservicejobrouter.json new file mode 100644 index 000000000000..52dc6d82e376 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/communicationservicejobrouter.json @@ -0,0 +1,3452 @@ +{ + "swagger": "2.0", + "info": { + "title": "Azure Communication Routing Service", + "description": "Azure Communication Routing Service", + "version": "2022-07-18-preview" + }, + "paths": { + "/routing/classificationPolicies/{id}": { + "patch": { + "tags": [ + "ClassificationPolicies" + ], + "summary": "Creates or updates a classification policy.", + "operationId": "JobRouterAdministration_UpsertClassificationPolicy", + "consumes": [ + "application/merge-patch+json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "Id of the classification policy", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "patch", + "description": "Model of classification policy properties to be patched. See also: https://datatracker.ietf.org/doc/html/rfc7386", + "required": true, + "schema": { + "$ref": "#/definitions/ClassificationPolicy" + } + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ClassificationPolicy" + } + } + }, + "x-ms-examples": { + "Creates a Classification policy": { + "$ref": "./examples/ClassificationPolicies_CreateClassificationPolicy.json" + }, + "Update a Classification policy": { + "$ref": "./examples/ClassificationPolicies_UpdateClassificationPolicy.json" + } + } + }, + "get": { + "tags": [ + "ClassificationPolicies" + ], + "summary": "Retrieves an existing classification policy by Id", + "operationId": "JobRouterAdministration_GetClassificationPolicy", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "Id of the classification policy", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ClassificationPolicy" + } + } + }, + "x-ms-examples": { + "Get a single Classification policy": { + "$ref": "./examples/ClassificationPolicies_GetClassificationPolicy.json" + } + } + }, + "delete": { + "tags": [ + "ClassificationPolicies" + ], + "summary": "Delete a classification policy by Id", + "operationId": "JobRouterAdministration_DeleteClassificationPolicy", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "Id of the classification policy", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "204": { + "description": "Success" + } + }, + "x-ms-examples": { + "Delete a Classification policy": { + "$ref": "./examples/ClassificationPolicies_DeleteClassificationPolicy.json" + } + } + } + }, + "/routing/classificationPolicies": { + "get": { + "tags": [ + "ClassificationPolicies" + ], + "summary": "Retrieves existing classification policies", + "operationId": "JobRouterAdministration_ListClassificationPolicies", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "query", + "name": "maxpagesize", + "description": "Maximum page size", + "type": "integer", + "format": "int32", + "default": 20 + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ClassificationPolicyCollection" + } + } + }, + "x-ms-examples": { + "Get Classification policies with pagination (max page size)": { + "$ref": "./examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink", + "itemName": "value" + } + } + }, + "/routing/distributionPolicies/{id}": { + "patch": { + "tags": [ + "DistributionPolicies" + ], + "summary": "Creates or updates a distribution policy.", + "operationId": "JobRouterAdministration_UpsertDistributionPolicy", + "consumes": [ + "application/merge-patch+json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "Id of the distribution policy", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "patch", + "description": "Model of distribution policy properties to be patched. See also: https://datatracker.ietf.org/doc/html/rfc7386", + "required": true, + "schema": { + "$ref": "#/definitions/DistributionPolicy" + } + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/DistributionPolicy" + } + } + }, + "x-ms-examples": { + "Creates a Distribution policy": { + "$ref": "./examples/DistributionPolicies_CreateDistributionPolicy.json" + }, + "Update a Distribution policy": { + "$ref": "./examples/DistributionPolicies_UpdateDistributionPolicy.json" + } + } + }, + "get": { + "tags": [ + "DistributionPolicies" + ], + "summary": "Retrieves an existing distribution policy by Id", + "operationId": "JobRouterAdministration_GetDistributionPolicy", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "Id of the distribution policy", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/DistributionPolicy" + } + } + }, + "x-ms-examples": { + "Get a single Distribution policy": { + "$ref": "./examples/DistributionPolicies_GetDistributionPolicy.json" + } + } + }, + "delete": { + "tags": [ + "DistributionPolicies" + ], + "summary": "Delete a distribution policy by Id", + "operationId": "JobRouterAdministration_DeleteDistributionPolicy", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "Id of the distribution policy", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "204": { + "description": "Success" + } + }, + "x-ms-examples": { + "Delete a Distribution policy": { + "$ref": "./examples/DistributionPolicies_DeleteDistributionPolicy.json" + } + } + } + }, + "/routing/distributionPolicies": { + "get": { + "tags": [ + "DistributionPolicies" + ], + "summary": "Retrieves existing distribution policies", + "operationId": "JobRouterAdministration_ListDistributionPolicies", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "query", + "name": "maxpagesize", + "description": "Maximum page size", + "type": "integer", + "format": "int32", + "default": 20 + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/DistributionPolicyCollection" + } + } + }, + "x-ms-examples": { + "Get Distribution policies with pagination (max page size)": { + "$ref": "./examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink", + "itemName": "value" + } + } + }, + "/routing/exceptionPolicies/{id}": { + "patch": { + "tags": [ + "ExceptionPolicies" + ], + "summary": "Creates or updates a exception policy.", + "operationId": "JobRouterAdministration_UpsertExceptionPolicy", + "consumes": [ + "application/merge-patch+json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "Id of the exception policy", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "patch", + "description": "Model of exception policy properties to be patched. See also: https://datatracker.ietf.org/doc/html/rfc7386", + "required": true, + "schema": { + "$ref": "#/definitions/ExceptionPolicy" + } + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ExceptionPolicy" + } + } + }, + "x-ms-examples": { + "Creates a Exception policy": { + "$ref": "./examples/ExceptionPolicies_CreateExceptionPolicy.json" + }, + "Update a Exception policy": { + "$ref": "./examples/ExceptionPolicies_UpdateExceptionPolicy.json" + } + } + }, + "get": { + "tags": [ + "ExceptionPolicies" + ], + "summary": "Retrieves an existing exception policy by Id", + "operationId": "JobRouterAdministration_GetExceptionPolicy", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "Id of the exception policy to retrieve", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ExceptionPolicy" + } + } + }, + "x-ms-examples": { + "Get a single Exception policy": { + "$ref": "./examples/ExceptionPolicies_GetExceptionPolicy.json" + } + } + }, + "delete": { + "tags": [ + "ExceptionPolicies" + ], + "summary": "Deletes a exception policy by Id", + "operationId": "JobRouterAdministration_DeleteExceptionPolicy", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "Id of the exception policy to delete", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "204": { + "description": "Success" + } + }, + "x-ms-examples": { + "Delete a Exception policy": { + "$ref": "./examples/ExceptionPolicies_DeleteExceptionPolicy.json" + } + } + } + }, + "/routing/exceptionPolicies": { + "get": { + "tags": [ + "ExceptionPolicies" + ], + "summary": "Retrieves existing exception policies", + "operationId": "JobRouterAdministration_ListExceptionPolicies", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "query", + "name": "maxpagesize", + "description": "Number of objects to return per page", + "type": "integer", + "format": "int32", + "default": 20 + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ExceptionPolicyCollection" + } + } + }, + "x-ms-examples": { + "Get Exception policies with pagination (max page size)": { + "$ref": "./examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink", + "itemName": "value" + } + } + }, + "/routing/jobs/{id}": { + "patch": { + "tags": [ + "Jobs" + ], + "summary": "Creates or updates a router job.", + "operationId": "JobRouter_UpsertJob", + "consumes": [ + "application/merge-patch+json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "Id of the job.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "patch", + "description": "Model of job properties to be created or patched. See also: https://datatracker.ietf.org/doc/html/rfc7386.", + "required": true, + "schema": { + "$ref": "#/definitions/RouterJob" + } + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/RouterJob" + } + } + }, + "x-ms-examples": { + "Creates a new Job": { + "$ref": "./examples/Jobs_CreateJob.json" + }, + "Update a job": { + "$ref": "./examples/Jobs_UpdateJob.json" + } + } + }, + "get": { + "tags": [ + "Jobs" + ], + "summary": "Retrieves an existing job by Id", + "operationId": "JobRouter_GetJob", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "Id of the job to retrieve", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/RouterJob" + } + } + }, + "x-ms-examples": { + "Get a single Job": { + "$ref": "./examples/Jobs_GetJob.json" + } + } + }, + "delete": { + "tags": [ + "Jobs" + ], + "summary": "Deletes a job and all of its traces.", + "operationId": "JobRouter_DeleteJob", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "Id of the job.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "204": { + "description": "Success" + } + }, + "x-ms-examples": { + "Deletes a job and all of its traces": { + "$ref": "./examples/Jobs_DeleteJob.json" + } + } + } + }, + "/routing/jobs/{id}:reclassify": { + "post": { + "tags": [ + "Jobs" + ], + "summary": "Reclassify a job.", + "operationId": "JobRouter_ReclassifyJobAction", + "consumes": [ + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "Id of the job", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "reclassifyJobRequest", + "description": "Request object for reclassifying a job.", + "schema": { + "$ref": "#/definitions/ReclassifyJobRequest" + } + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ReclassifyJobResult" + } + } + }, + "x-ms-examples": { + "Reclassify a job": { + "$ref": "./examples/Jobs_ReclassifyJob.json" + } + } + } + }, + "/routing/jobs/{id}:cancel": { + "post": { + "tags": [ + "Jobs" + ], + "summary": "Submits request to cancel an existing job by Id while supplying free-form cancellation reason.", + "operationId": "JobRouter_CancelJobAction", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "Id of the job", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "cancelJobRequest", + "description": "Request model for cancelling job", + "schema": { + "$ref": "#/definitions/CancelJobRequest" + }, + "x-ms-client-flatten": true + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/CancelJobResult" + } + } + }, + "x-ms-examples": { + "Cancels a job": { + "$ref": "./examples/Jobs_RequestJobCancel.json" + } + } + } + }, + "/routing/jobs/{id}:complete": { + "post": { + "tags": [ + "Jobs" + ], + "summary": "Completes an assigned job.", + "operationId": "JobRouter_CompleteJobAction", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "Id of the job", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "completeJobRequest", + "description": "Request model for completing job", + "required": true, + "schema": { + "$ref": "#/definitions/CompleteJobRequest" + }, + "x-ms-client-flatten": true + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/CompleteJobResult" + } + } + }, + "x-ms-examples": { + "Completes a job": { + "$ref": "./examples/Jobs_CompleteJob.json" + } + } + } + }, + "/routing/jobs/{id}:close": { + "post": { + "tags": [ + "Jobs" + ], + "summary": "Closes a completed job.", + "operationId": "JobRouter_CloseJobAction", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "Id of the job", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "closeJobRequest", + "description": "Request model for closing job", + "required": true, + "schema": { + "$ref": "#/definitions/CloseJobRequest" + }, + "x-ms-client-flatten": true + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/CloseJobResult" + } + }, + "202": { + "description": "Success", + "schema": { + "$ref": "#/definitions/CloseJobResult" + } + } + }, + "x-ms-examples": { + "Closes a job": { + "$ref": "./examples/Jobs_CloseJob.json" + } + } + } + }, + "/routing/jobs": { + "get": { + "tags": [ + "Jobs" + ], + "summary": "Retrieves list of jobs based on filter parameters", + "operationId": "JobRouter_ListJobs", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "query", + "name": "status", + "description": "(Optional) If specified, filter jobs by status.", + "type": "string", + "default": "all", + "enum": [ + "all", + "pendingClassification", + "queued", + "assigned", + "completed", + "closed", + "cancelled", + "classificationFailed", + "active" + ], + "x-ms-enum": { + "name": "JobStateSelector", + "modelAsString": false + } + }, + { + "in": "query", + "name": "queueId", + "description": "(Optional) If specified, filter jobs by queue.", + "type": "string" + }, + { + "in": "query", + "name": "channelId", + "description": "(Optional) If specified, filter jobs by channel.", + "type": "string" + }, + { + "in": "query", + "name": "classificationPolicyId", + "description": "(Optional) If specified, filter jobs by classificationPolicy.", + "type": "string" + }, + { + "in": "query", + "name": "maxpagesize", + "description": "Number of objects to return per page", + "type": "integer", + "format": "int32", + "default": 20 + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/JobCollection" + } + } + }, + "x-ms-examples": { + "Gets a list of jobs with pagination (max page size)": { + "$ref": "./examples/Jobs_GetJobsWithPageSize.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink", + "itemName": "value" + } + } + }, + "/routing/jobs/{id}/position": { + "get": { + "tags": [ + "Jobs" + ], + "summary": "Gets a job's position details.", + "operationId": "JobRouter_GetInQueuePosition", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "Id of the job", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/JobPositionDetails" + } + } + }, + "x-ms-examples": { + "Gets a job position in a queue": { + "$ref": "./examples/Jobs_GetInQueuePosition.json" + } + } + } + }, + "/routing/jobs/{id}/assignments/{assignmentId}:unassign": { + "post": { + "tags": [ + "Jobs" + ], + "summary": "Un-assign a job.", + "operationId": "JobRouter_UnassignJobAction", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "Id of the job to un-assign", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "assignmentId", + "description": "Id of the assignment to un-assign", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/UnassignJobResult" + } + } + }, + "x-ms-examples": { + "Unassigns a job": { + "$ref": "./examples/Jobs_UnassignJob.json" + } + } + } + }, + "/routing/workers/{workerId}/offers/{offerId}:accept": { + "post": { + "tags": [ + "Offers" + ], + "summary": "Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already.", + "operationId": "JobRouter_AcceptJobAction", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "workerId", + "description": "Id of the worker", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "offerId", + "description": "Id of the offer", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/AcceptJobOfferResult" + } + } + }, + "x-ms-examples": { + "Accept a Job Offer": { + "$ref": "./examples/Offers_AcceptJobOffer.json" + } + } + } + }, + "/routing/workers/{workerId}/offers/{offerId}:decline": { + "post": { + "tags": [ + "Offers" + ], + "summary": "Declines an offer to work on a job.", + "operationId": "JobRouter_DeclineJobAction", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "workerId", + "description": "Id of the worker", + "required": true, + "type": "string" + }, + { + "in": "path", + "name": "offerId", + "description": "Id of the offer", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/DeclineJobOfferResult" + } + } + }, + "x-ms-examples": { + "Decline a Job Offer": { + "$ref": "./examples/Offers_DeclineJobOffer.json" + } + } + } + }, + "/routing/queues/{id}": { + "patch": { + "tags": [ + "Queues" + ], + "summary": "Creates or updates a queue.", + "operationId": "JobRouterAdministration_UpsertQueue", + "consumes": [ + "application/merge-patch+json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "Id of the queue", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "patch", + "description": "Model of queue properties to be patched. See also: https://datatracker.ietf.org/doc/html/rfc7386", + "required": true, + "schema": { + "$ref": "#/definitions/JobQueue" + } + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/JobQueue" + } + } + }, + "x-ms-examples": { + "Update a Queue": { + "$ref": "./examples/Queues_UpdateQueue.json" + }, + "Create a Queue": { + "$ref": "./examples/Queues_CreateQueue.json" + } + } + }, + "get": { + "tags": [ + "Queues" + ], + "summary": "Retrieves an existing queue by Id", + "operationId": "JobRouterAdministration_GetQueue", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "Id of the queue to retrieve", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/JobQueue" + } + } + }, + "x-ms-examples": { + "Get a single Queue": { + "$ref": "./examples/Queues_GetQueue.json" + } + } + }, + "delete": { + "tags": [ + "Queues" + ], + "summary": "Deletes a queue by Id", + "operationId": "JobRouterAdministration_DeleteQueue", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "Id of the queue to delete", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "204": { + "description": "Success" + } + }, + "x-ms-examples": { + "Delete a Queue": { + "$ref": "./examples/Queues_DeleteQueue.json" + } + } + } + }, + "/routing/queues": { + "get": { + "tags": [ + "Queues" + ], + "summary": "Retrieves existing queues", + "operationId": "JobRouterAdministration_ListQueues", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "query", + "name": "maxpagesize", + "description": "Number of objects to return per page", + "type": "integer", + "format": "int32", + "default": 20 + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/QueueCollection" + } + } + }, + "x-ms-examples": { + "Get Queues with pagination (max page size)": { + "$ref": "./examples/Queues_ListQueuesWithPageSize.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink", + "itemName": "value" + } + } + }, + "/routing/queues/{id}/statistics": { + "get": { + "tags": [ + "Queues" + ], + "summary": "Retrieves a queue's statistics", + "operationId": "JobRouter_GetQueueStatistics", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "id", + "description": "Id of the queue to retrieve statistics", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/QueueStatistics" + } + } + }, + "x-ms-examples": { + "Get a single Queue": { + "$ref": "./examples/Queues_GetQueueStatistics.json" + } + } + } + }, + "/routing/workers/{workerId}": { + "patch": { + "tags": [ + "Workers" + ], + "summary": "Creates or updates a worker.", + "operationId": "JobRouter_UpsertWorker", + "consumes": [ + "application/merge-patch+json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "workerId", + "description": "Id of the worker", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "patch", + "description": "Model of worker properties to be patched. See also: https://datatracker.ietf.org/doc/html/rfc7386", + "required": true, + "schema": { + "$ref": "#/definitions/RouterWorker" + } + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/RouterWorker" + } + } + }, + "x-ms-examples": { + "Create a Worker": { + "$ref": "./examples/Workers_CreateWorker.json" + }, + "Update a Worker properties": { + "$ref": "./examples/Workers_UpdateWorker.json" + }, + "Register a Worker": { + "$ref": "./examples/Workers_RegisterWorker.json" + }, + "Deregister an active Worker": { + "$ref": "./examples/Workers_DeregisterActiveWorker.json" + }, + "Deregister a inactive Worker": { + "$ref": "./examples/Workers_DeregisterInactiveWorker.json" + } + } + }, + "get": { + "tags": [ + "Workers" + ], + "summary": "Retrieves an existing worker by Id", + "operationId": "JobRouter_GetWorker", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "workerId", + "description": "Id of the worker to retrieve", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/RouterWorker" + } + } + }, + "x-ms-examples": { + "Get a single Worker": { + "$ref": "./examples/Workers_GetWorker.json" + } + } + }, + "delete": { + "tags": [ + "Workers" + ], + "summary": "Deletes a worker and all of its traces.", + "operationId": "JobRouter_DeleteWorker", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "path", + "name": "workerId", + "description": "Id of the worker to delete", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "204": { + "description": "Success" + } + }, + "x-ms-examples": { + "Delete a Worker and all of its traces": { + "$ref": "./examples/Workers_DeleteWorker.json" + } + } + } + }, + "/routing/workers": { + "get": { + "tags": [ + "Workers" + ], + "summary": "Retrieves existing workers.", + "operationId": "JobRouter_ListWorkers", + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "query", + "name": "status", + "description": "(Optional) If specified, select workers by worker status.", + "type": "string", + "default": "all", + "enum": [ + "active", + "draining", + "inactive", + "all" + ], + "x-ms-enum": { + "name": "WorkerStateSelector", + "modelAsString": false + } + }, + { + "in": "query", + "name": "channelId", + "description": "(Optional) If specified, select workers who have a channel configuration with this channel", + "type": "string" + }, + { + "in": "query", + "name": "queueId", + "description": "(Optional) If specified, select workers who are assigned to this queue", + "type": "string" + }, + { + "in": "query", + "name": "hasCapacity", + "description": "(Optional) If set to true, select only workers who have capacity for the channel specified by `channelId` or for any channel\r\n if `channelId` not specified. If set to false, then will return all workers including workers without any capacity for jobs. Defaults to false.", + "type": "boolean" + }, + { + "in": "query", + "name": "maxpagesize", + "description": "Number of objects to return per page", + "type": "integer", + "format": "int32", + "default": 20 + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error", + "schema": { + "$ref": "#/definitions/CommunicationErrorResponse" + } + }, + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/WorkerCollection" + } + } + }, + "x-ms-examples": { + "List workers with pagination (max page size)": { + "$ref": "./examples/Workers_GetWorkersWithPageSize.json" + }, + "List available Workers by channel": { + "$ref": "./examples/Workers_GetAvailableWorkersByChannel.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink", + "itemName": "value" + } + } + } + }, + "definitions": { + "AcceptJobOfferResult": { + "description": "Response containing Id's for the worker, job, and assignment from an accepted offer", + "required": [ + "assignmentId", + "jobId", + "workerId" + ], + "type": "object", + "properties": { + "assignmentId": { + "description": "The assignment Id that assigns a worker that has accepted an offer to a job.", + "type": "string" + }, + "jobId": { + "description": "The Id of the job assigned.", + "type": "string" + }, + "workerId": { + "description": "The Id of the worker that has been assigned this job.", + "type": "string" + } + } + }, + "BestWorkerMode": { + "description": "Jobs are distributed to the worker with the strongest abilities available.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/DistributionMode" + } + ], + "properties": { + "kind": { + "type": "string" + }, + "scoringRule": { + "$ref": "#/definitions/RouterRule" + }, + "scoringRuleOptions": { + "$ref": "#/definitions/ScoringRuleOptions" + } + }, + "x-ms-discriminator-value": "best-worker" + }, + "CancelExceptionAction": { + "description": "An action that marks a job as cancelled", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ExceptionAction" + } + ], + "properties": { + "kind": { + "type": "string", + "readOnly": true + }, + "note": { + "description": "(Optional) A note that will be appended to the jobs' Notes collection with th current timestamp.", + "maxLength": 2000, + "minLength": 0, + "type": "string" + }, + "dispositionCode": { + "description": "(Optional) Indicates the outcome of the job, populate this field with your own custom values.", + "maxLength": 500, + "minLength": 0, + "type": "string" + } + }, + "x-ms-discriminator-value": "cancel" + }, + "CancelJobRequest": { + "description": "Request payload for deleting a job", + "type": "object", + "properties": { + "note": { + "description": "(Optional) A note that will be appended to the jobs' Notes collection with th current timestamp.", + "maxLength": 2000, + "minLength": 0, + "type": "string" + }, + "dispositionCode": { + "description": "Indicates the outcome of the job, populate this field with your own custom values.\r\nIf not provided, default value of \"Cancelled\" is set.", + "maxLength": 500, + "minLength": 0, + "type": "string" + } + } + }, + "CancelJobResult": { + "description": "Response payload from cancelling a job", + "type": "object", + "properties": {} + }, + "ChannelConfiguration": { + "description": "Represents the capacity a job in this channel will consume from a worker", + "required": [ + "capacityCostPerJob" + ], + "type": "object", + "properties": { + "capacityCostPerJob": { + "format": "int32", + "description": "The amount of capacity that an instance of a job of this channel will consume of the total worker capacity.", + "type": "integer" + } + } + }, + "ClassificationPolicy": { + "description": "A container for the rules that govern how jobs are classified.", + "type": "object", + "properties": { + "id": { + "description": "Unique identifier of this policy.", + "type": "string", + "readOnly": true + }, + "name": { + "description": "Friendly name of this policy.", + "type": "string" + }, + "fallbackQueueId": { + "description": "The fallback queue to select if the queue selector doesn't find a match.", + "type": "string" + }, + "queueSelectors": { + "description": "The queue selectors to resolve a queue for a given job.", + "type": "array", + "items": { + "description": "An attachment of label selectors to resolve a queue to a job from a classification policy" + } + }, + "prioritizationRule": { + "$ref": "#/definitions/RouterRule" + }, + "workerSelectors": { + "description": "The worker label selectors to attach to a given job.", + "type": "array", + "items": { + "description": "An attachment which attaches WorkerSelectors to workers" + } + } + } + }, + "ClassificationPolicyCollection": { + "description": "A paged collection of classification policies.", + "required": [ + "value" + ], + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/ClassificationPolicyItem" + } + }, + "nextLink": { + "type": "string", + "readOnly": true + } + } + }, + "ClassificationPolicyItem": { + "description": "Paged instance of ClassificationPolicy", + "type": "object", + "properties": { + "classificationPolicy": { + "$ref": "#/definitions/ClassificationPolicy" + }, + "etag": { + "description": "(Optional) The Concurrency Token.", + "type": "string" + } + } + }, + "CloseJobRequest": { + "description": "Request payload for closing jobs", + "required": [ + "assignmentId" + ], + "type": "object", + "properties": { + "assignmentId": { + "description": "The assignment within which the job is to be closed.", + "maxLength": 50, + "minLength": 0, + "type": "string" + }, + "dispositionCode": { + "description": "Indicates the outcome of the job, populate this field with your own custom values.", + "maxLength": 500, + "minLength": 0, + "type": "string" + }, + "closeTime": { + "format": "date-time", + "description": "If not provided, worker capacity is released immediately along with a JobClosedEvent notification.\r\nIf provided, worker capacity is released along with a JobClosedEvent notification at a future time.", + "type": "string" + }, + "note": { + "description": "(Optional) A note that will be appended to the jobs' Notes collection with th current timestamp.", + "maxLength": 2000, + "minLength": 0, + "type": "string" + } + } + }, + "CloseJobResult": { + "description": "Response payload from closing a job", + "type": "object", + "properties": {} + }, + "CommunicationError": { + "description": "The Communication Services error.", + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string", + "description": "The error code." + }, + "message": { + "type": "string", + "description": "The error message." + }, + "target": { + "type": "string", + "readOnly": true, + "description": "The error target." + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/CommunicationError" + }, + "readOnly": true, + "description": "Further details about specific errors that led to this error." + }, + "innererror": { + "x-ms-client-name": "innerError", + "readOnly": true, + "$ref": "#/definitions/CommunicationError", + "description": "The inner error if any." + } + } + }, + "CommunicationErrorResponse": { + "description": "The Communication Services error.", + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "description": "The Communication Services error.", + "$ref": "#/definitions/CommunicationError" + } + } + }, + "CompleteJobRequest": { + "description": "Request payload for completing jobs", + "required": [ + "assignmentId" + ], + "type": "object", + "properties": { + "assignmentId": { + "description": "The assignment within the job to complete.", + "maxLength": 50, + "minLength": 0, + "type": "string" + }, + "note": { + "description": "(Optional) A note that will be appended to the jobs' Notes collection with th current timestamp.", + "maxLength": 2000, + "minLength": 0, + "type": "string" + } + } + }, + "CompleteJobResult": { + "description": "Response payload from completing a job", + "type": "object", + "properties": {} + }, + "ConditionalQueueSelectorAttachment": { + "description": "Describes a set of label selectors that will be attached if the given condition resolves to true", + "required": [ + "condition", + "labelSelectors" + ], + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/QueueSelectorAttachment" + } + ], + "properties": { + "kind": { + "type": "string", + "readOnly": true + }, + "condition": { + "$ref": "#/definitions/RouterRule" + }, + "labelSelectors": { + "description": "The label selectors to attach", + "type": "array", + "items": { + "$ref": "#/definitions/QueueSelector" + } + } + }, + "x-ms-discriminator-value": "conditional" + }, + "ConditionalWorkerSelectorAttachment": { + "description": "Describes a set of label selectors that will be attached if the given condition resolves to true", + "required": [ + "condition", + "labelSelectors" + ], + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/WorkerSelectorAttachment" + } + ], + "properties": { + "kind": { + "type": "string", + "readOnly": true + }, + "condition": { + "$ref": "#/definitions/RouterRule" + }, + "labelSelectors": { + "description": "The label selectors to attach", + "type": "array", + "items": { + "$ref": "#/definitions/WorkerSelector" + } + } + }, + "x-ms-discriminator-value": "conditional" + }, + "DeclineJobOfferResult": { + "description": "Response payload from declining a job", + "type": "object", + "properties": {} + }, + "DirectMapRule": { + "description": "A rule that return the same labels as the input labels.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/RouterRule" + } + ], + "properties": { + "kind": { + "type": "string" + } + }, + "x-ms-discriminator-value": "direct-map-rule" + }, + "DistributionMode": { + "description": "Abstract base class for defining a distribution mode", + "required": [ + "kind", + "maxConcurrentOffers", + "minConcurrentOffers" + ], + "type": "object", + "properties": { + "kind": { + "description": "The type discriminator describing a sub-type of Mode", + "type": "string" + }, + "minConcurrentOffers": { + "format": "int32", + "description": "Governs the minimum desired number of active concurrent offers a job can have.", + "type": "integer" + }, + "maxConcurrentOffers": { + "format": "int32", + "description": "Governs the maximum number of active concurrent offers a job can have.", + "type": "integer" + }, + "bypassSelectors": { + "description": "(Optional)\r\nIf set to true, then router will match workers to jobs even if they don't match label selectors.\r\nWarning: You may get workers that are not qualified for the job they are matched with if you set this\r\nvariable to true. This flag is intended more for temporary usage.\r\nBy default, set to false.", + "type": "boolean" + } + }, + "discriminator": "kind" + }, + "DistributionPolicy": { + "description": "Policy governing how jobs are distributed to workers", + "type": "object", + "properties": { + "id": { + "description": "The unique identifier of the policy.", + "type": "string", + "readOnly": true + }, + "name": { + "description": "The human readable name of the policy.", + "type": "string" + }, + "offerTtlSeconds": { + "format": "double", + "description": "The expiry time of any offers created under this policy will be governed by the offer time to live.", + "type": "number" + }, + "mode": { + "$ref": "#/definitions/DistributionMode" + } + } + }, + "DistributionPolicyCollection": { + "description": "A paged collection of distribution policies.", + "required": [ + "value" + ], + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/DistributionPolicyItem" + } + }, + "nextLink": { + "type": "string", + "readOnly": true + } + } + }, + "DistributionPolicyItem": { + "description": "Paged instance of DistributionPolicy", + "type": "object", + "properties": { + "distributionPolicy": { + "$ref": "#/definitions/DistributionPolicy" + }, + "etag": { + "description": "(Optional) The Concurrency Token.", + "type": "string" + } + } + }, + "ExceptionAction": { + "description": "The action to take when the exception is triggered", + "required": [ + "kind" + ], + "type": "object", + "properties": { + "kind": { + "description": "The type discriminator describing a sub-type of ExceptionAction", + "type": "string" + } + }, + "discriminator": "kind" + }, + "ExceptionPolicy": { + "description": "A policy that defines actions to execute when exception are triggered.", + "type": "object", + "properties": { + "id": { + "description": "The Id of the exception policy", + "type": "string", + "readOnly": true + }, + "name": { + "description": "(Optional) The name of the exception policy.", + "type": "string" + }, + "exceptionRules": { + "description": "(Optional) A dictionary collection of exception rules on the exception policy. Key is the Id of each exception rule.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ExceptionRule" + } + } + } + }, + "ExceptionPolicyCollection": { + "description": "A paged collection of exception policies.", + "required": [ + "value" + ], + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/ExceptionPolicyItem" + } + }, + "nextLink": { + "type": "string", + "readOnly": true + } + } + }, + "ExceptionPolicyItem": { + "description": "Paged instance of ExceptionPolicy", + "type": "object", + "properties": { + "exceptionPolicy": { + "$ref": "#/definitions/ExceptionPolicy" + }, + "etag": { + "description": "(Optional) The Concurrency Token.", + "type": "string" + } + } + }, + "ExceptionRule": { + "description": "A rule that defines actions to execute upon a specific trigger.", + "required": [ + "actions", + "trigger" + ], + "type": "object", + "properties": { + "trigger": { + "$ref": "#/definitions/JobExceptionTrigger" + }, + "actions": { + "description": "A dictionary collection of actions to perform once the exception is triggered. Key is the Id of each exception action.", + "type": "object", + "additionalProperties": { + "description": "The action to take when the exception is triggered" + } + } + } + }, + "ExpressionRule": { + "description": "A rule providing inline expression rules.", + "required": [ + "expression", + "language" + ], + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/RouterRule" + } + ], + "properties": { + "kind": { + "type": "string" + }, + "language": { + "description": "The expression language to compile to and execute", + "enum": [ + "powerFx" + ], + "type": "string", + "x-ms-enum": { + "name": "ExpressionLanguage", + "modelAsString": false + } + }, + "expression": { + "description": "The string containing the expression to evaluate. Should contain return statement with calculated values.", + "maxLength": 500, + "minLength": 0, + "type": "string" + } + }, + "x-ms-discriminator-value": "expression-rule" + }, + "FunctionRule": { + "description": "A rule providing a binding to an HTTP Triggered Azure Function.", + "required": [ + "functionUri" + ], + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/RouterRule" + } + ], + "properties": { + "kind": { + "type": "string" + }, + "functionUri": { + "format": "uri", + "description": "URL for Azure Function", + "type": "string" + }, + "credential": { + "$ref": "#/definitions/FunctionRuleCredential" + } + }, + "x-ms-discriminator-value": "azure-function-rule" + }, + "FunctionRuleCredential": { + "description": "Credentials used to access Azure function rule", + "type": "object", + "properties": { + "functionKey": { + "description": "(Optional) Access key scoped to a particular function", + "maxLength": 500, + "minLength": 0, + "type": "string" + }, + "appKey": { + "description": "(Optional) Access key scoped to a Azure Function app.\r\nThis key grants access to all functions under the app.", + "maxLength": 500, + "minLength": 0, + "type": "string" + }, + "clientId": { + "description": "(Optional) Client id, when AppKey is provided\r\nIn context of Azure function, this is usually the name of the key", + "maxLength": 500, + "minLength": 0, + "type": "string" + } + } + }, + "JobAssignment": { + "description": "Assignment details of a job to a worker", + "required": [ + "assignTime", + "id" + ], + "type": "object", + "properties": { + "id": { + "description": "The Id of the job assignment.", + "type": "string" + }, + "workerId": { + "description": "The Id of the Worker assigned to the job.", + "type": "string" + }, + "assignTime": { + "format": "date-time", + "description": "The assignment time of the job.", + "type": "string" + }, + "completeTime": { + "format": "date-time", + "description": "The time the job was marked as completed after being assigned.", + "type": "string" + }, + "closeTime": { + "format": "date-time", + "description": "The time the job was marked as closed after being completed.", + "type": "string" + } + } + }, + "JobCollection": { + "description": "A paged collection of jobs.", + "required": [ + "value" + ], + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/RouterJobItem" + } + }, + "nextLink": { + "type": "string", + "readOnly": true + } + } + }, + "JobExceptionTrigger": { + "description": "The trigger for this exception rule", + "required": [ + "kind" + ], + "type": "object", + "properties": { + "kind": { + "description": "The type discriminator describing a sub-type of ExceptionTrigger", + "type": "string" + } + }, + "discriminator": "kind" + }, + "JobOffer": { + "description": "An offer of a job to a worker", + "required": [ + "capacityCost", + "id", + "jobId" + ], + "type": "object", + "properties": { + "id": { + "description": "The Id of the offer.", + "type": "string" + }, + "jobId": { + "description": "The Id of the job.", + "type": "string" + }, + "capacityCost": { + "format": "int32", + "description": "The capacity cost consumed by the job offer.", + "type": "integer" + }, + "offerTimeUtc": { + "format": "date-time", + "description": "The time the offer was created.", + "type": "string" + }, + "expiryTimeUtc": { + "format": "date-time", + "description": "The time that the offer will expire.", + "type": "string" + } + } + }, + "JobPositionDetails": { + "description": "Dto for JobPositionDetails.", + "required": [ + "estimatedWaitTimeMinutes", + "jobId", + "position", + "queueId", + "queueLength" + ], + "type": "object", + "properties": { + "jobId": { + "description": "Id of the job these details are about.", + "type": "string" + }, + "position": { + "format": "int32", + "description": "Position of the job in question within that queue.", + "type": "integer" + }, + "queueId": { + "description": "Id of the queue this job is enqueued in.", + "type": "string" + }, + "queueLength": { + "format": "int32", + "description": "Length of the queue: total number of enqueued jobs.", + "type": "integer" + }, + "estimatedWaitTimeMinutes": { + "format": "double", + "description": "Estimated wait time of the job rounded up to the nearest minute", + "type": "number" + } + } + }, + "JobQueue": { + "description": "A queue that can contain jobs to be routed.", + "type": "object", + "properties": { + "id": { + "description": "The Id of this queue", + "type": "string", + "readOnly": true + }, + "name": { + "description": "The name of this queue.", + "type": "string" + }, + "distributionPolicyId": { + "description": "The ID of the distribution policy that will determine how a job is distributed to workers.", + "type": "string" + }, + "labels": { + "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions.", + "type": "object", + "additionalProperties": {} + }, + "exceptionPolicyId": { + "description": "(Optional) The ID of the exception policy that determines various job escalation rules.", + "type": "string" + } + } + }, + "JobQueueItem": { + "description": "Paged instance of JobQueue", + "type": "object", + "properties": { + "jobQueue": { + "$ref": "#/definitions/JobQueue" + }, + "etag": { + "description": "(Optional) The Concurrency Token.", + "type": "string" + } + } + }, + "LongestIdleMode": { + "description": "Jobs are directed to the worker who has been idle longest.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/DistributionMode" + } + ], + "properties": { + "kind": { + "type": "string" + } + }, + "x-ms-discriminator-value": "longest-idle" + }, + "ManualReclassifyExceptionAction": { + "description": "An action that manually reclassifies a job by providing the queue, priority and worker selectors.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ExceptionAction" + } + ], + "properties": { + "kind": { + "type": "string", + "readOnly": true + }, + "queueId": { + "description": "Updated QueueId.", + "maxLength": 50, + "minLength": 0, + "type": "string" + }, + "priority": { + "format": "int32", + "description": "Updated Priority.", + "type": "integer" + }, + "workerSelectors": { + "description": "Updated WorkerSelectors.", + "type": "array", + "items": { + "$ref": "#/definitions/WorkerSelector" + } + } + }, + "x-ms-discriminator-value": "manual-reclassify" + }, + "PassThroughQueueSelectorAttachment": { + "description": "Attaches a label selector where the value is pass through from the job label with the same key", + "required": [ + "key", + "labelOperator" + ], + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/QueueSelectorAttachment" + } + ], + "properties": { + "kind": { + "type": "string", + "readOnly": true + }, + "key": { + "description": "The label key to query against", + "maxLength": 500, + "minLength": 0, + "type": "string" + }, + "labelOperator": { + "description": "Describes how the value of the label is compared to the value pass through", + "enum": [ + "equal", + "notEqual", + "lessThan", + "lessThanEqual", + "greaterThan", + "greaterThanEqual" + ], + "type": "string", + "x-ms-enum": { + "name": "LabelOperator", + "modelAsString": false + } + } + }, + "x-ms-discriminator-value": "pass-through" + }, + "PassThroughWorkerSelectorAttachment": { + "description": "Attaches a label selector where the value is pass through from the job label with the same key", + "required": [ + "key", + "labelOperator" + ], + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/WorkerSelectorAttachment" + } + ], + "properties": { + "kind": { + "type": "string", + "readOnly": true + }, + "key": { + "description": "The label key to query against", + "maxLength": 500, + "minLength": 0, + "type": "string" + }, + "labelOperator": { + "description": "Describes how the value of the label is compared to the value pass through", + "enum": [ + "equal", + "notEqual", + "lessThan", + "lessThanEqual", + "greaterThan", + "greaterThanEqual" + ], + "type": "string", + "x-ms-enum": { + "name": "LabelOperator", + "modelAsString": false + } + }, + "ttlSeconds": { + "format": "double", + "description": "Describes how long the attached label selector is valid in seconds.", + "type": "number" + } + }, + "x-ms-discriminator-value": "pass-through" + }, + "QueueAssignment": { + "description": "An assignment of a worker to a queue", + "type": "object", + "properties": {} + }, + "QueueCollection": { + "description": "A paged collection of queues.", + "required": [ + "value" + ], + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/JobQueueItem" + } + }, + "nextLink": { + "type": "string", + "readOnly": true + } + } + }, + "QueueLengthExceptionTrigger": { + "description": "Trigger for an exception action on exceeding queue length", + "required": [ + "threshold" + ], + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/JobExceptionTrigger" + } + ], + "properties": { + "kind": { + "type": "string" + }, + "threshold": { + "format": "int32", + "description": "Threshold of number of jobs ahead in the queue to for this trigger to fire.", + "type": "integer" + } + }, + "x-ms-discriminator-value": "queue-length" + }, + "QueueSelector": { + "description": "Describes a condition that must be met against a set of labels for queue selection", + "required": [ + "key", + "labelOperator" + ], + "type": "object", + "properties": { + "key": { + "description": "The label key to query against", + "maxLength": 500, + "minLength": 0, + "type": "string" + }, + "labelOperator": { + "description": "Describes how the value of the label is compared to the value defined on the label selector", + "enum": [ + "equal", + "notEqual", + "lessThan", + "lessThanEqual", + "greaterThan", + "greaterThanEqual" + ], + "type": "string", + "x-ms-enum": { + "name": "LabelOperator", + "modelAsString": false + } + }, + "value": { + "description": "The value to compare against the actual label value with the given operator", + "type": "object" + } + } + }, + "QueueSelectorAttachment": { + "description": "An attachment of label selectors to resolve a queue to a job from a classification policy", + "required": [ + "kind" + ], + "type": "object", + "properties": { + "kind": { + "description": "The type discriminator describing the type of label selector attachment", + "type": "string" + } + }, + "discriminator": "kind" + }, + "QueueStatistics": { + "description": "Statistics for the queue", + "required": [ + "length", + "queueId" + ], + "type": "object", + "properties": { + "queueId": { + "description": "Id of the queue these details are about.", + "type": "string" + }, + "length": { + "format": "int32", + "description": "Length of the queue: total number of enqueued jobs.", + "type": "integer" + }, + "estimatedWaitTimeMinutes": { + "description": "The estimated wait time of this queue rounded up to the nearest minute, grouped by job priority", + "type": "object", + "additionalProperties": { + "format": "double", + "type": "number" + } + }, + "longestJobWaitTimeMinutes": { + "format": "double", + "description": "The wait time of the job that has been enqueued in this queue for the longest.", + "type": "number" + } + } + }, + "QueueWeightedAllocation": { + "description": "Contains the weight percentage and label selectors to be applied if selected for weighted distributions.", + "required": [ + "labelSelectors", + "weight" + ], + "type": "object", + "properties": { + "weight": { + "format": "double", + "description": "The percentage of this weight, expressed as a fraction of 1.", + "type": "number" + }, + "labelSelectors": { + "description": "A collection of label selectors that will be applied if this allocation is selected.", + "type": "array", + "items": { + "$ref": "#/definitions/QueueSelector" + } + } + } + }, + "ReclassifyExceptionAction": { + "description": "An action that modifies labels on a job and then reclassifies it", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ExceptionAction" + } + ], + "properties": { + "kind": { + "type": "string", + "readOnly": true + }, + "classificationPolicyId": { + "description": "(optional) The new classification policy that will determine queue, priority and worker selectors.", + "maxLength": 50, + "minLength": 0, + "type": "string" + }, + "labelsToUpsert": { + "description": "(optional) Dictionary containing the labels to update (or add if not existing) in key-value pairs", + "type": "object", + "additionalProperties": {} + } + }, + "x-ms-discriminator-value": "reclassify" + }, + "ReclassifyJobRequest": { + "description": "Request payload for reclassifying jobs", + "type": "object", + "properties": {} + }, + "ReclassifyJobResult": { + "description": "Response payload from reclassifying a job", + "type": "object", + "properties": {} + }, + "RoundRobinMode": { + "description": "Jobs are distributed in order to workers, starting with the worker that is after the last worker to receive a job.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/DistributionMode" + } + ], + "properties": { + "kind": { + "type": "string" + } + }, + "x-ms-discriminator-value": "round-robin" + }, + "RouterJob": { + "description": "A unit of work to be routed", + "type": "object", + "properties": { + "id": { + "description": "The id of the job.", + "type": "string", + "readOnly": true + }, + "channelReference": { + "description": "Reference to an external parent context, eg. call ID.", + "type": "string" + }, + "jobStatus": { + "description": "The state of the Job.", + "enum": [ + "pendingClassification", + "queued", + "assigned", + "completed", + "closed", + "cancelled", + "classificationFailed", + "created" + ], + "type": "string", + "readOnly": true, + "x-ms-enum": { + "name": "RouterJobStatus", + "modelAsString": false + } + }, + "enqueueTimeUtc": { + "format": "date-time", + "description": "The time a job was queued.", + "type": "string", + "readOnly": true + }, + "channelId": { + "description": "The channel identifier. eg. voice, chat, etc.", + "type": "string" + }, + "classificationPolicyId": { + "description": "The Id of the Classification policy used for classifying a job.", + "type": "string" + }, + "queueId": { + "description": "The Id of the Queue that this job is queued to.", + "type": "string" + }, + "priority": { + "format": "int32", + "description": "The priority of this job.", + "type": "integer" + }, + "dispositionCode": { + "description": "Reason code for cancelled or closed jobs.", + "type": "string" + }, + "requestedWorkerSelectors": { + "description": "A collection of manually specified label selectors, which a worker must satisfy in order to process this job.", + "type": "array", + "items": { + "$ref": "#/definitions/WorkerSelector" + } + }, + "attachedWorkerSelectors": { + "description": "A collection of label selectors attached by a classification policy, which a worker must satisfy in order to process this job.", + "type": "array", + "items": { + "$ref": "#/definitions/WorkerSelector" + }, + "readOnly": true + }, + "labels": { + "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions.", + "type": "object", + "additionalProperties": {} + }, + "assignments": { + "description": "A collection of the assignments of the job.\r\nKey is AssignmentId.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/JobAssignment" + }, + "readOnly": true + }, + "tags": { + "description": "A set of non-identifying attributes attached to this job", + "type": "object", + "additionalProperties": {} + }, + "notes": { + "description": "Notes attached to a job, sorted by timestamp", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "RouterJobItem": { + "description": "Paged instance of RouterJob", + "type": "object", + "properties": { + "routerJob": { + "$ref": "#/definitions/RouterJob" + }, + "etag": { + "description": "(Optional) The Concurrency Token.", + "type": "string" + } + } + }, + "RouterRule": { + "description": "A rule of one of the following types:\r\n \r\nStaticRule: A rule providing static rules that always return the same result, regardless of input.\r\nDirectMapRule: A rule that return the same labels as the input labels.\r\nExpressionRule: A rule providing inline expression rules.\r\nAzureFunctionRule: A rule providing a binding to an HTTP Triggered Azure Function.", + "required": [ + "kind" + ], + "type": "object", + "properties": { + "kind": { + "description": "The type discriminator describing a sub-type of Rule", + "type": "string" + } + }, + "discriminator": "kind" + }, + "RouterWorker": { + "description": "An entity for jobs to be routed to", + "type": "object", + "properties": { + "id": { + "type": "string", + "readOnly": true + }, + "state": { + "description": "The current state of the worker.", + "enum": [ + "active", + "draining", + "inactive" + ], + "type": "string", + "readOnly": true + }, + "queueAssignments": { + "description": "The queue(s) that this worker can receive work from.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/QueueAssignment" + } + }, + "totalCapacity": { + "format": "int32", + "description": "The total capacity score this worker has to manage multiple concurrent jobs.", + "type": "integer" + }, + "labels": { + "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions.", + "type": "object", + "additionalProperties": {} + }, + "tags": { + "description": "A set of non-identifying attributes attached to this worker.", + "type": "object", + "additionalProperties": {} + }, + "channelConfigurations": { + "description": "The channel(s) this worker can handle and their impact on the workers capacity.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ChannelConfiguration" + } + }, + "offers": { + "description": "A list of active offers issued to this worker.", + "type": "array", + "items": { + "$ref": "#/definitions/JobOffer" + }, + "readOnly": true + }, + "assignedJobs": { + "description": "A list of assigned jobs attached to this worker.", + "type": "array", + "items": { + "$ref": "#/definitions/WorkerAssignment" + }, + "readOnly": true + }, + "loadRatio": { + "format": "double", + "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.", + "type": "number", + "readOnly": true + }, + "availableForOffers": { + "description": "A flag indicating this worker is open to receive offers or not.", + "type": "boolean" + } + } + }, + "RouterWorkerItem": { + "description": "Paged instance of RouterWorker", + "type": "object", + "properties": { + "routerWorker": { + "$ref": "#/definitions/RouterWorker" + }, + "etag": { + "description": "(Optional) The Concurrency Token.", + "type": "string" + } + } + }, + "RuleEngineQueueSelectorAttachment": { + "description": "Attaches labels to a worker when a RouterRule is resolved", + "required": [ + "rule" + ], + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/QueueSelectorAttachment" + } + ], + "properties": { + "kind": { + "type": "string", + "readOnly": true + }, + "rule": { + "$ref": "#/definitions/RouterRule" + } + }, + "x-ms-discriminator-value": "rule-engine" + }, + "RuleEngineWorkerSelectorAttachment": { + "description": "Attaches labels to a worker when a RouterRule is resolved", + "required": [ + "rule" + ], + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/WorkerSelectorAttachment" + } + ], + "properties": { + "kind": { + "type": "string", + "readOnly": true + }, + "rule": { + "$ref": "#/definitions/RouterRule" + } + }, + "x-ms-discriminator-value": "rule-engine" + }, + "ScoringRuleOptions": { + "description": "Encapsulates all options that can be passed as parameters for scoring rule with BestWorkerMode", + "type": "object", + "properties": { + "batchSize": { + "format": "int32", + "description": "(Optional) Set batch size when AllowScoringBatchOfWorkers is set to true", + "type": "integer" + }, + "scoringParameters": { + "description": "(Optional) List of extra parameters from the job that will be sent as part of the payload to scoring rule.\r\nIf not set, the job's labels (sent in the payload as `job`) and the job's worker selectors (sent in the payload as `selectors`)\r\nare added to the payload of the scoring rule by default.\r\nNote: Worker labels are always sent with scoring payload.", + "type": "array", + "items": { + "description": "Supported parameters for scoring workers", + "enum": [ + "jobLabels", + "workerSelectors" + ], + "type": "string", + "x-ms-enum": { + "name": "ScoringRuleParameterSelector", + "modelAsString": false + } + } + }, + "allowScoringBatchOfWorkers": { + "description": "(Optional)\r\nIf set to true, will score workers in batches, and the parameter name of the worker labels will be sent as `workers`.\r\nBy default, set to false and the parameter name for the worker labels will be sent as `worker`.\r\nNote: If enabled, use BatchSize to set batch size.", + "type": "boolean" + }, + "descendingOrder": { + "description": "(Optional)\r\nIf false, will sort scores by ascending order. By default, set to true.", + "type": "boolean" + } + } + }, + "StaticQueueSelectorAttachment": { + "description": "Describes a label selector that will always be attached", + "required": [ + "labelSelector" + ], + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/QueueSelectorAttachment" + } + ], + "properties": { + "kind": { + "type": "string", + "readOnly": true + }, + "labelSelector": { + "$ref": "#/definitions/QueueSelector" + } + }, + "x-ms-discriminator-value": "static" + }, + "StaticRule": { + "description": "A rule providing static rules that always return the same result, regardless of input.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/RouterRule" + } + ], + "properties": { + "kind": { + "type": "string" + }, + "value": { + "description": "The static value this rule always returns.", + "maxLength": 500, + "minLength": 0, + "type": "object" + } + }, + "x-ms-discriminator-value": "static-rule" + }, + "StaticWorkerSelectorAttachment": { + "description": "Describes a label selector that will always be attached", + "required": [ + "labelSelector" + ], + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/WorkerSelectorAttachment" + } + ], + "properties": { + "kind": { + "type": "string", + "readOnly": true + }, + "labelSelector": { + "$ref": "#/definitions/WorkerSelector" + } + }, + "x-ms-discriminator-value": "static" + }, + "UnassignJobResult": { + "description": "Response payload after a job has been successfully unassigned.", + "required": [ + "jobId", + "unassignmentCount" + ], + "type": "object", + "properties": { + "jobId": { + "description": "The Id of the job unassigned.", + "type": "string" + }, + "unassignmentCount": { + "format": "int32", + "description": "The number of times a job is unassigned. At a maximum 3.", + "type": "integer" + } + } + }, + "WaitTimeExceptionTrigger": { + "description": "Trigger for an exception action on exceeding wait time", + "required": [ + "thresholdSeconds" + ], + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/JobExceptionTrigger" + } + ], + "properties": { + "kind": { + "type": "string" + }, + "thresholdSeconds": { + "format": "double", + "description": "Threshold for wait time for this trigger.", + "type": "number" + } + }, + "x-ms-discriminator-value": "wait-time" + }, + "WeightedAllocationQueueSelectorAttachment": { + "description": "Describes multiple sets of label selectors, of which one will be selected and attached according to a weighting", + "required": [ + "allocations" + ], + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/QueueSelectorAttachment" + } + ], + "properties": { + "kind": { + "type": "string", + "readOnly": true + }, + "allocations": { + "description": "A collection of percentage based weighted allocations.", + "type": "array", + "items": { + "$ref": "#/definitions/QueueWeightedAllocation" + } + } + }, + "x-ms-discriminator-value": "weighted-allocation-queue-selector" + }, + "WeightedAllocationWorkerSelectorAttachment": { + "description": "Describes multiple sets of label selectors, of which one will be selected and attached according to a weighting", + "required": [ + "allocations" + ], + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/WorkerSelectorAttachment" + } + ], + "properties": { + "kind": { + "type": "string", + "readOnly": true + }, + "allocations": { + "description": "A collection of percentage based weighted allocations.", + "type": "array", + "items": { + "$ref": "#/definitions/WorkerWeightedAllocation" + } + } + }, + "x-ms-discriminator-value": "weighted-allocation-worker-selector" + }, + "WorkerAssignment": { + "description": "The assignment for a worker to a job", + "required": [ + "assignTime", + "capacityCost", + "id", + "jobId" + ], + "type": "object", + "properties": { + "id": { + "description": "The Id of the assignment.", + "type": "string" + }, + "jobId": { + "description": "The Id of the Job assigned.", + "type": "string" + }, + "capacityCost": { + "format": "int32", + "description": "The amount of capacity this assignment has consumed on the worker.", + "type": "integer" + }, + "assignTime": { + "format": "date-time", + "description": "The assignment time of the job.", + "type": "string" + } + } + }, + "WorkerCollection": { + "description": "A paged collection of workers.", + "required": [ + "value" + ], + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/RouterWorkerItem" + } + }, + "nextLink": { + "type": "string", + "readOnly": true + } + } + }, + "WorkerSelector": { + "description": "Describes a condition that must be met against a set of labels for worker selection", + "required": [ + "key", + "labelOperator" + ], + "type": "object", + "properties": { + "key": { + "description": "The label key to query against", + "maxLength": 500, + "minLength": 0, + "type": "string" + }, + "labelOperator": { + "description": "Describes how the value of the label is compared to the value defined on the label selector", + "enum": [ + "equal", + "notEqual", + "lessThan", + "lessThanEqual", + "greaterThan", + "greaterThanEqual" + ], + "type": "string", + "x-ms-enum": { + "name": "LabelOperator", + "modelAsString": false + } + }, + "value": { + "description": "The value to compare against the actual label value with the given operator", + "type": "object" + }, + "ttlSeconds": { + "format": "double", + "description": "Describes how long this label selector is valid in seconds.", + "type": "number" + }, + "expedite": { + "description": "Pushes the job to the front of the queue as long as this selector is active.", + "type": "boolean" + }, + "state": { + "description": "The state of the worker selector.", + "enum": [ + "active", + "expired" + ], + "type": "string", + "readOnly": true, + "x-ms-enum": { + "name": "WorkerSelectorState", + "modelAsString": false + } + }, + "expireTime": { + "format": "date-time", + "description": "The time at which this worker selector expires in UTC", + "type": "string", + "readOnly": true + } + } + }, + "WorkerSelectorAttachment": { + "description": "An attachment which attaches WorkerSelectors to workers", + "required": [ + "kind" + ], + "type": "object", + "properties": { + "kind": { + "description": "The type discriminator describing the type of label selector attachment", + "type": "string" + } + }, + "discriminator": "kind" + }, + "WorkerWeightedAllocation": { + "description": "Contains the weight percentage and label selectors to be applied if selected for weighted distributions.", + "required": [ + "labelSelectors", + "weight" + ], + "type": "object", + "properties": { + "weight": { + "format": "double", + "description": "The percentage of this weight, expressed as a fraction of 1.", + "type": "number" + }, + "labelSelectors": { + "description": "A collection of label selectors that will be applied if this allocation is selected.", + "type": "array", + "items": { + "$ref": "#/definitions/WorkerSelector" + } + } + } + } + }, + "parameters": { + "ApiVersionParameter": { + "in": "query", + "name": "api-version", + "description": "Version of API to invoke.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "Endpoint": { + "in": "path", + "name": "endpoint", + "description": "The endpoint of the Azure Communication resource.", + "required": true, + "type": "string", + "x-ms-skip-url-encoding": true, + "x-ms-parameter-location": "client" + } + }, + "x-ms-parameterized-host": { + "hostTemplate": "{endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "$ref": "#/parameters/Endpoint" + } + ] + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/ClassificationPolicies_CreateClassificationPolicy.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/ClassificationPolicies_CreateClassificationPolicy.json new file mode 100644 index 000000000000..8ff5b248bcac --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/ClassificationPolicies_CreateClassificationPolicy.json @@ -0,0 +1,63 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "id": "90eb00c4-234e-4df7-a231-ef7895518384", + "patch": { + "name": "Main", + "fallbackQueueId": "MainQueue", + "queueSelectors": [ + { + "kind": "conditional", + "condition": { + "kind": "expression-rule", + "language": "PowerFx", + "expression": "1 = 1" + }, + "labelSelectors": [ + { + "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" + }, + "labelSelectors": [ + { + "key": "foo", + "labelOperator": "equal", + "value": "bar" + } + ] + } + ], + "prioritizationRule": { + "kind": "static-rule", + "value": "2" + }, + "workerSelectors": [] + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/ClassificationPolicies_DeleteClassificationPolicy.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/ClassificationPolicies_DeleteClassificationPolicy.json new file mode 100644 index 000000000000..c60ab0ca7408 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/ClassificationPolicies_DeleteClassificationPolicy.json @@ -0,0 +1,10 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "id": "MainClassificationPolicy" + }, + "responses": { + "204": {} + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/ClassificationPolicies_GetClassificationPolicy.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/ClassificationPolicies_GetClassificationPolicy.json new file mode 100644 index 000000000000..856b2693e158 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/ClassificationPolicies_GetClassificationPolicy.json @@ -0,0 +1,44 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "id": "MainClassificationPolicy" + }, + "responses": { + "200": { + "body": { + "id": "MainClassificationPolicy", + "name": "Main", + "fallbackQueueId": "MainQueue", + "queueSelectors": [ + { + "kind": "conditional", + "condition": { + "kind": "expression-rule", + "language": "PowerFx", + "expression": "1 = 1" + }, + "labelSelectors": [ + { + "key": "foo", + "labelOperator": "equal", + "value": "bar" + } + ] + } + ], + "prioritizationRule": { + "kind": "static-rule", + "value": "2" + }, + "workerSelectors": [ + { + "kind": "pass-through", + "key": "language", + "operator": "equal" + } + ] + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json new file mode 100644 index 000000000000..421d7b1e6e35 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/ClassificationPolicies_ListClassificationPoliciesWithPageSize.json @@ -0,0 +1,62 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "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/preview/2022-07-18-preview/examples/ClassificationPolicies_UpdateClassificationPolicy.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/ClassificationPolicies_UpdateClassificationPolicy.json new file mode 100644 index 000000000000..11248d69cb78 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/ClassificationPolicies_UpdateClassificationPolicy.json @@ -0,0 +1,41 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "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" + }, + "labelSelectors": [ + { + "key": "foo", + "operator": "equal", + "value": "bar" + } + ] + } + ], + "prioritizationRule": { + "kind": "static-rule", + "value": "2" + }, + "workerSelectors": [] + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/DistributionPolicies_CreateDistributionPolicy.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/DistributionPolicies_CreateDistributionPolicy.json new file mode 100644 index 000000000000..423edaf76c58 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/DistributionPolicies_CreateDistributionPolicy.json @@ -0,0 +1,32 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "id": "d9033d56-659c-437a-b5b7-4f3b14301dd4", + "patch": { + "mode": { + "kind": "longest-idle", + "minConcurrentOffers": 1, + "maxConcurrentOffers": 5, + "bypassSelectors": false + }, + "offerTtlSeconds": 300, + "name": "Main" + } + }, + "responses": { + "200": { + "body": { + "id": "d9033d56-659c-437a-b5b7-4f3b14301dd4", + "name": "Main", + "offerTtlSeconds": 300, + "mode": { + "kind": "longest-idle", + "minConcurrentOffers": 1, + "maxConcurrentOffers": 5, + "bypassSelectors": false + } + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/DistributionPolicies_DeleteDistributionPolicy.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/DistributionPolicies_DeleteDistributionPolicy.json new file mode 100644 index 000000000000..07f5520f53f9 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/DistributionPolicies_DeleteDistributionPolicy.json @@ -0,0 +1,10 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "id": "MainDistributionPolicy" + }, + "responses": { + "204": {} + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/DistributionPolicies_GetDistributionPolicy.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/DistributionPolicies_GetDistributionPolicy.json new file mode 100644 index 000000000000..a626db14e183 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/DistributionPolicies_GetDistributionPolicy.json @@ -0,0 +1,22 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "id": "MainDistributionPolicy" + }, + "responses": { + "200": { + "body": { + "id": "MainDistributionPolicy", + "name": "Main", + "offerTtlSeconds": 300, + "mode": { + "kind": "longest-idle", + "minConcurrentOffers": 1, + "maxConcurrentOffers": 5, + "bypassSelectors": false + } + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json new file mode 100644 index 000000000000..92f63e7c748f --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/DistributionPolicies_ListDistributionPoliciesWithPageSize.json @@ -0,0 +1,44 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "maxpagesize": 2 + }, + "responses": { + "200": { + "body": { + "value": [ + { + "distributionPolicy": { + "id": "SecondaryDistributionPolicy", + "name": "Secondary", + "offerTtlSeconds": 300, + "mode": { + "kind": "round-robin", + "minConcurrentOffers": 1, + "maxConcurrentOffers": 2, + "bypassSelectors": false + } + }, + "etag": "etag" + }, + { + "distributionPolicy": { + "id": "MainDistributionPolicy", + "name": "Main", + "offerTtlSeconds": 300, + "mode": { + "kind": "longest-idle", + "minConcurrentOffers": 1, + "maxConcurrentOffers": 5, + "bypassSelectors": false + } + }, + "etag": "etag" + } + ], + "nextLink": "null" + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/DistributionPolicies_UpdateDistributionPolicy.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/DistributionPolicies_UpdateDistributionPolicy.json new file mode 100644 index 000000000000..423edaf76c58 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/DistributionPolicies_UpdateDistributionPolicy.json @@ -0,0 +1,32 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "id": "d9033d56-659c-437a-b5b7-4f3b14301dd4", + "patch": { + "mode": { + "kind": "longest-idle", + "minConcurrentOffers": 1, + "maxConcurrentOffers": 5, + "bypassSelectors": false + }, + "offerTtlSeconds": 300, + "name": "Main" + } + }, + "responses": { + "200": { + "body": { + "id": "d9033d56-659c-437a-b5b7-4f3b14301dd4", + "name": "Main", + "offerTtlSeconds": 300, + "mode": { + "kind": "longest-idle", + "minConcurrentOffers": 1, + "maxConcurrentOffers": 5, + "bypassSelectors": false + } + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/ExceptionPolicies_CreateExceptionPolicy.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/ExceptionPolicies_CreateExceptionPolicy.json new file mode 100644 index 000000000000..bd1324978c74 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/ExceptionPolicies_CreateExceptionPolicy.json @@ -0,0 +1,52 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "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 + } + } + } + } + } + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/ExceptionPolicies_DeleteExceptionPolicy.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/ExceptionPolicies_DeleteExceptionPolicy.json new file mode 100644 index 000000000000..14ede5775dca --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/ExceptionPolicies_DeleteExceptionPolicy.json @@ -0,0 +1,10 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "id": "MainExceptionPolicy" + }, + "responses": { + "204": {} + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/ExceptionPolicies_GetExceptionPolicy.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/ExceptionPolicies_GetExceptionPolicy.json new file mode 100644 index 000000000000..b9bbcc45d141 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/ExceptionPolicies_GetExceptionPolicy.json @@ -0,0 +1,32 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "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/preview/2022-07-18-preview/examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json new file mode 100644 index 000000000000..5b5d7575f48d --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/ExceptionPolicies_ListExceptionPoliciesWithPageSize.json @@ -0,0 +1,64 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "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/preview/2022-07-18-preview/examples/ExceptionPolicies_UpdateExceptionPolicy.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/ExceptionPolicies_UpdateExceptionPolicy.json new file mode 100644 index 000000000000..dd5e5f365943 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/ExceptionPolicies_UpdateExceptionPolicy.json @@ -0,0 +1,52 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "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 + } + } + } + } + } + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Jobs_CloseJob.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Jobs_CloseJob.json new file mode 100644 index 000000000000..116e379e6d5a --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Jobs_CloseJob.json @@ -0,0 +1,19 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "id": "8780b28c-7079-4de1-9143-4d369289e958", + "closeJobRequest": { + "assignmentId": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "dispositionCode": "JobCompleted." + } + }, + "responses": { + "200": { + "body": {} + }, + "202": { + "body": {} + } + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Jobs_CompleteJob.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Jobs_CompleteJob.json new file mode 100644 index 000000000000..2317cc2084e5 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Jobs_CompleteJob.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "id": "8780b28c-7079-4de1-9143-4d369289e958", + "completeJobRequest": { + "assignmentId": "1d5896f3-8b54-40be-82d3-910323f5e2af" + } + }, + "responses": { + "200": { + "body": {} + } + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Jobs_CreateJob.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Jobs_CreateJob.json new file mode 100644 index 000000000000..c23e72f4faf8 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Jobs_CreateJob.json @@ -0,0 +1,48 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "id": "JobId", + "patch": { + "channelId": "CustomChatChannel", + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "queueId": "MainQueue", + "priority": 5, + "requestedWorkerSelectors": [ + { + "key": "Sales", + "labelOperator": "equal", + "value": true + } + ], + "labels": {} + } + }, + "responses": { + "200": { + "body": { + "id": "JobId", + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "jobStatus": "queued", + "enqueueTimeUtc": "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, + "ttlSeconds": null + } + ], + "attachedWorkerSelectors": [], + "labels": {}, + "assignments": {}, + "notes": {} + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Jobs_DeleteJob.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Jobs_DeleteJob.json new file mode 100644 index 000000000000..4de8f8900b85 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Jobs_DeleteJob.json @@ -0,0 +1,10 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "id": "8780b28c-7079-4de1-9143-4d369289e958" + }, + "responses": { + "204": {} + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Jobs_GetInQueuePosition.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Jobs_GetInQueuePosition.json new file mode 100644 index 000000000000..4ac9ef637989 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Jobs_GetInQueuePosition.json @@ -0,0 +1,18 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "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/preview/2022-07-18-preview/examples/Jobs_GetJob.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Jobs_GetJob.json new file mode 100644 index 000000000000..59ea8f552e52 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Jobs_GetJob.json @@ -0,0 +1,34 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "id": "8780b28c-7079-4de1-9143-4d369289e958" + }, + "responses": { + "200": { + "body": { + "id": "8780b28c-7079-4de1-9143-4d369289e958", + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "jobStatus": "queued", + "enqueueTimeUtc": "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, + "ttlSeconds": null + } + ], + "attachedWorkerSelectors": [], + "labels": {}, + "assignments": {}, + "notes": {} + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Jobs_GetJobsWithPageSize.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Jobs_GetJobsWithPageSize.json new file mode 100644 index 000000000000..c50b00b3580e --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Jobs_GetJobsWithPageSize.json @@ -0,0 +1,53 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "status": "active", + "queueId": null, + "channelId": null, + "maxpagesize": 2 + }, + "responses": { + "200": { + "body": { + "value": [ + { + "routerJob": { + "id": "383541b3-5637-4af6-8aac-3391da8a578a", + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "jobStatus": "queued", + "enqueueTimeUtc": "2021-09-30T23:56:21.883322+00:00", + "channelId": "CustomChatChannel", + "classificationPolicyId": null, + "queueId": "MainQueue", + "priority": 5, + "dispositionCode": null, + "labels": {}, + "assignments": {}, + "notes": {} + }, + "etag": "etag" + }, + { + "routerJob": { + "id": "c571dd84-1ca7-4606-a77a-f38d9e4ae513", + "channelReference": "1d5896f3-8b54-40be-82d3-910323f5e2af", + "jobStatus": "queued", + "enqueueTimeUtc": "2021-09-30T23:57:54.041179+00:00", + "channelId": "CustomChatChannel2", + "classificationPolicyId": null, + "queueId": "MainQueue", + "priority": 5, + "dispositionCode": null, + "labels": {}, + "assignments": {}, + "notes": {} + }, + "etag": "etag" + } + ], + "nextLink": "null" + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Jobs_ReclassifyJob.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Jobs_ReclassifyJob.json new file mode 100644 index 000000000000..886171b12658 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Jobs_ReclassifyJob.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "id": "8780b28c-7079-4de1-9143-4d369289e958", + "reclassifyJobRequest": {} + }, + "responses": { + "200": { + "body": {} + } + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Jobs_RequestJobCancel.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Jobs_RequestJobCancel.json new file mode 100644 index 000000000000..1286ac0f3c57 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Jobs_RequestJobCancel.json @@ -0,0 +1,16 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "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/preview/2022-07-18-preview/examples/Jobs_UnassignJob.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Jobs_UnassignJob.json new file mode 100644 index 000000000000..4ea1116b082b --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Jobs_UnassignJob.json @@ -0,0 +1,16 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "id": "8780b28c-7079-4de1-9143-4d369289e958", + "assignmentId": "1d5896f3-8b54-40be-82d3-910323f5e2af" + }, + "responses": { + "200": { + "body": { + "jobId": "8780b28c-7079-4de1-9143-4d369289e958", + "unassignmentCount": 1 + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Jobs_UpdateJob.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Jobs_UpdateJob.json new file mode 100644 index 000000000000..d9acf28bab39 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Jobs_UpdateJob.json @@ -0,0 +1,37 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "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", + "jobStatus": "queued", + "enqueueTimeUtc": "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, + "ttlSeconds": null + } + ], + "attachedWorkerSelectors": [], + "labels": {}, + "assignments": {}, + "notes": {} + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Offers_AcceptJobOffer.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Offers_AcceptJobOffer.json new file mode 100644 index 000000000000..eb6491891dca --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Offers_AcceptJobOffer.json @@ -0,0 +1,17 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "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/preview/2022-07-18-preview/examples/Offers_DeclineJobOffer.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Offers_DeclineJobOffer.json new file mode 100644 index 000000000000..b95b2306fdd3 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Offers_DeclineJobOffer.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "workerId": "DefaultWorker", + "offerId": "1d5896f3-8b54-40be-82d3-910323f5e2af" + }, + "responses": { + "200": { + "body": {} + } + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Queues_CreateQueue.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Queues_CreateQueue.json new file mode 100644 index 000000000000..516ddc8ee317 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Queues_CreateQueue.json @@ -0,0 +1,26 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "id": "QueueId", + "patch": { + "distributionPolicyId": "MainDistributionPolicy", + "name": "Main", + "labels": {}, + "exceptionPolicyId": "MainExceptionPolicy" + }, + "repeatabilityRequestId": "5aac88f9-d24a-4c53-9d90-86a801667cbe", + "repeatabilityFirstSent": "Tue, 23 Nov 2021 08:49:37 GMT" + }, + "responses": { + "200": { + "body": { + "id": "246d5a06-c04a-4b6b-8a34-02bbd9fdad68", + "name": "Main", + "distributionPolicyId": "MainDistributionPolicy", + "labels": {}, + "exceptionPolicyId": "MainExceptionPolicy" + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Queues_DeleteQueue.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Queues_DeleteQueue.json new file mode 100644 index 000000000000..e7913af230ea --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Queues_DeleteQueue.json @@ -0,0 +1,10 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "id": "MainQueue" + }, + "responses": { + "204": {} + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Queues_GetQueue.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Queues_GetQueue.json new file mode 100644 index 000000000000..36fbd3bb3027 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Queues_GetQueue.json @@ -0,0 +1,18 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "id": "MainQueue" + }, + "responses": { + "200": { + "body": { + "id": "MainQueue", + "name": "Main", + "distributionPolicyId": "MainDistributionPolicy", + "labels": {}, + "exceptionPolicyId": "MainExceptionPolicy" + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Queues_GetQueueStatistics.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Queues_GetQueueStatistics.json new file mode 100644 index 000000000000..7eafcc4e5f69 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Queues_GetQueueStatistics.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "id": "MainQueue" + }, + "responses": { + "200": { + "body": { + "queueId": "MainQueue", + "length": 5 + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Queues_ListQueuesWithPageSize.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Queues_ListQueuesWithPageSize.json new file mode 100644 index 000000000000..83c42f9feac1 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Queues_ListQueuesWithPageSize.json @@ -0,0 +1,36 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "maxpagesize": 2 + }, + "responses": { + "200": { + "body": { + "value": [ + { + "jobQueue": { + "id": "MainQueue", + "name": "Main", + "distributionPolicyId": "MainDistributionPolicy", + "labels": {}, + "exceptionPolicyId": "MainExceptionPolicy" + }, + "etag": "etag" + }, + { + "jobQueue": { + "id": "SecondaryQueue", + "name": "Secondary", + "distributionPolicyId": "SecondaryDistributionPolicy", + "labels": {}, + "exceptionPolicyId": "SecondaryExceptionPolicy" + }, + "etag": "etag" + } + ], + "nextLink": "null" + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Queues_UpdateQueue.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Queues_UpdateQueue.json new file mode 100644 index 000000000000..b2546df698d0 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Queues_UpdateQueue.json @@ -0,0 +1,22 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "id": "MainQueue", + "patch": { + "distributionPolicyId": "MainDistributionPolicy", + "name": "Main" + } + }, + "responses": { + "200": { + "body": { + "id": "MainQueue", + "name": "Main", + "distributionPolicyId": "MainDistributionPolicy", + "labels": {}, + "exceptionPolicyId": "MainExceptionPolicy" + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Workers_CreateWorker.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Workers_CreateWorker.json new file mode 100644 index 000000000000..6cee0f131a8d --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Workers_CreateWorker.json @@ -0,0 +1,51 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "workerId": "WorkerId", + "patch": { + "totalCapacity": 10, + "queueAssignments": { + "MainQueue": {}, + "SecondaryQueue": null + }, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 11 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 10 + } + }, + "availableForOffers": false + } + }, + "responses": { + "200": { + "body": { + "id": "WorkerId", + "state": "inactive", + "queueAssignments": { + "MainQueue": {} + }, + "totalCapacity": 10, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 11 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 10 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": false + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Workers_DeleteWorker.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Workers_DeleteWorker.json new file mode 100644 index 000000000000..5f85771e7d60 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Workers_DeleteWorker.json @@ -0,0 +1,10 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "workerId": "DefaultWorker" + }, + "responses": { + "204": {} + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Workers_DeregisterActiveWorker.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Workers_DeregisterActiveWorker.json new file mode 100644 index 000000000000..d4c7d38068f6 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Workers_DeregisterActiveWorker.json @@ -0,0 +1,37 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "workerId": "WorkerId", + "patch": { + "availableForOffers": false, + "totalCapacity": 10 + } + }, + "responses": { + "200": { + "body": { + "id": "WorkerId", + "state": "draining", + "queueAssignments": { + "MainQueue": {} + }, + "totalCapacity": 10, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 11 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 10 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": false + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Workers_DeregisterInactiveWorker.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Workers_DeregisterInactiveWorker.json new file mode 100644 index 000000000000..4dc70bac9356 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Workers_DeregisterInactiveWorker.json @@ -0,0 +1,37 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "workerId": "WorkerId", + "patch": { + "availableForOffers": false, + "totalCapacity": 10 + } + }, + "responses": { + "200": { + "body": { + "id": "WorkerId", + "state": "inactive", + "queueAssignments": { + "MainQueue": {} + }, + "totalCapacity": 10, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 11 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 10 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": false + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Workers_GetAvailableWorkersByChannel.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Workers_GetAvailableWorkersByChannel.json new file mode 100644 index 000000000000..d3ae0d142b7c --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Workers_GetAvailableWorkersByChannel.json @@ -0,0 +1,70 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "status": "active", + "channelId": "CustomChatChannel", + "hasCapacity": true + }, + "responses": { + "200": { + "body": { + "value": [ + { + "routerWorker": { + "id": "DefaultWorker", + "state": "active", + "queueAssignments": { + "MainQueue": {}, + "SecondaryQueue": {} + }, + "totalCapacity": 100, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 10 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 100 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": true + }, + "etag": "etag" + }, + { + "routerWorker": { + "id": "SecondWorker", + "state": "active", + "queueAssignments": { + "MainQueue": {}, + "SecondaryQueue": {} + }, + "totalCapacity": 100, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 10 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 100 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": true + }, + "etag": "etag" + } + ], + "nextLink": "null" + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Workers_GetWorker.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Workers_GetWorker.json new file mode 100644 index 000000000000..b3b438322525 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Workers_GetWorker.json @@ -0,0 +1,34 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "workerId": "DefaultWorker" + }, + "responses": { + "200": { + "body": { + "id": "DefaultWorker", + "state": "active", + "queueAssignments": { + "MainQueue": {}, + "SecondaryQueue": {} + }, + "totalCapacity": 100, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 10 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 100 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": true + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Workers_GetWorkersWithPageSize.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Workers_GetWorkersWithPageSize.json new file mode 100644 index 000000000000..3748c4bb48d9 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Workers_GetWorkersWithPageSize.json @@ -0,0 +1,68 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "maxpagesize": 2 + }, + "responses": { + "200": { + "body": { + "value": [ + { + "routerWorker": { + "id": "DefaultWorker", + "state": "active", + "queueAssignments": { + "MainQueue": {}, + "SecondaryQueue": {} + }, + "totalCapacity": 100, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 10 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 100 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": true + }, + "etag": "etag" + }, + { + "routerWorker": { + "id": "SecondWorker", + "state": "active", + "queueAssignments": { + "MainQueue": {}, + "SecondaryQueue": {} + }, + "totalCapacity": 100, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomEmailChannel": { + "capacityCostPerJob": 10 + }, + "CustomSMSChannel": { + "capacityCostPerJob": 100 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": true + }, + "etag": "etag" + } + ], + "nextLink": "null" + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Workers_RegisterWorker.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Workers_RegisterWorker.json new file mode 100644 index 000000000000..bcd1f5a365b3 --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Workers_RegisterWorker.json @@ -0,0 +1,37 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "workerId": "WorkerId", + "patch": { + "availableForOffers": true, + "totalCapacity": 10 + } + }, + "responses": { + "200": { + "body": { + "id": "WorkerId", + "state": "active", + "queueAssignments": { + "MainQueue": {} + }, + "totalCapacity": 10, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 11 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 10 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": true + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Workers_UpdateWorker.json b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Workers_UpdateWorker.json new file mode 100644 index 000000000000..6cee0f131a8d --- /dev/null +++ b/specification/communication/data-plane/JobRouter/preview/2022-07-18-preview/examples/Workers_UpdateWorker.json @@ -0,0 +1,51 @@ +{ + "parameters": { + "endpoint": "https://contoso.westus.communications.azure.com", + "api-version": "2022-07-18-preview", + "workerId": "WorkerId", + "patch": { + "totalCapacity": 10, + "queueAssignments": { + "MainQueue": {}, + "SecondaryQueue": null + }, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 11 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 10 + } + }, + "availableForOffers": false + } + }, + "responses": { + "200": { + "body": { + "id": "WorkerId", + "state": "inactive", + "queueAssignments": { + "MainQueue": {} + }, + "totalCapacity": 10, + "labels": {}, + "tags": {}, + "channelConfigurations": { + "CustomChatChannel": { + "capacityCostPerJob": 11 + }, + "CustomVoiceChannel": { + "capacityCostPerJob": 10 + } + }, + "offers": [], + "assignedJobs": [], + "loadRatio": 0, + "availableForOffers": false + } + } + } +} diff --git a/specification/communication/data-plane/JobRouter/readme.md b/specification/communication/data-plane/JobRouter/readme.md index cc985745cd21..63e7979b2c1b 100644 --- a/specification/communication/data-plane/JobRouter/readme.md +++ b/specification/communication/data-plane/JobRouter/readme.md @@ -26,9 +26,44 @@ These are the global settings for the communicationservices. ```yaml openapi-type: data-plane -tag: package-jobrouter-2021-10-20-preview2 +tag: package-jobrouter-2022-07-18-preview ``` +### Tag: package-jobrouter-2022-07-18-preview + +These settings apply only when `--tag=package-jobrouter-2022-07-18-preview` is specified on the command line. + +```yaml $(tag) == 'package-jobrouter-2022-07-18-preview' +input-file: + - preview/2022-07-18-preview/communicationservicejobrouter.json +title: + Azure Communication Services +directive: +# Set reference to WorkerSelectorAttachment in ClassificationPolicy + - from: swagger-document + where: "$.definitions.ClassificationPolicy.properties.workerSelectors.items" + transform: > + $["$ref"] = "#/definitions/WorkerSelectorAttachment"; +# Set reference to QueueSelectorAttachment in ClassificationPolicy + - from: swagger-document + where: "$.definitions.ClassificationPolicy.properties.queueSelectors.items" + transform: > + $["$ref"] = "#/definitions/QueueSelectorAttachment"; +# Set reference to ExceptionAction in ExceptionRule + - from: swagger-document + where: "$.definitions.ExceptionRule.properties.actions" + transform: > + $.type = "object"; + $.additionalProperties["$ref"] = "#/definitions/ExceptionAction"; + +# Rename CommunicationError to JobRouterError + - from: swagger-document + where: '$.definitions.CommunicationError' + transform: > + $["x-ms-client-name"] = "JobRouterError"; +``` + + ### Tag: package-jobrouter-2021-10-20-preview2 These settings apply only when `--tag=package-jobrouter-2021-10-20-preview2` is specified on the command line.