diff --git a/specification/communication/Communication.JobRouter/client.tsp b/specification/communication/Communication.JobRouter/client.tsp index fbeeb45ef49a..a3d83fa71925 100644 --- a/specification/communication/Communication.JobRouter/client.tsp +++ b/specification/communication/Communication.JobRouter/client.tsp @@ -78,19 +78,16 @@ interface JobRouterRestClient { @internal("csharp") @internal("python") @internal("java") - @projectedName("csharp", "cancelJobInternal") cancel is AzureCommunicationRoutingService.JobRouterOperations.cancel; @internal("csharp") @internal("python") @internal("java") - @projectedName("csharp", "completeJobInternal") complete is AzureCommunicationRoutingService.JobRouterOperations.complete; @internal("csharp") @internal("python") @internal("java") - @projectedName("csharp", "closeJobInternal") close is AzureCommunicationRoutingService.JobRouterOperations.close; listJobs is AzureCommunicationRoutingService.JobRouterOperations.listJobs; @@ -106,7 +103,6 @@ interface JobRouterRestClient { @internal("csharp") @internal("python") @internal("java") - @projectedName("csharp", "declineJobOfferInternal") decline is AzureCommunicationRoutingService.JobRouterOperations.decline; #suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Need to revist how to correctly define singletons https://github.com/Azure/azure-rest-api-specs/issues/25605#issuecomment-1736265997" diff --git a/specification/communication/Communication.JobRouter/models.tsp b/specification/communication/Communication.JobRouter/models.tsp index 143fe4881390..b85f2f90cb67 100644 --- a/specification/communication/Communication.JobRouter/models.tsp +++ b/specification/communication/Communication.JobRouter/models.tsp @@ -386,16 +386,16 @@ model RouterJob { @visibility("read") attachedWorkerSelectors?: RouterWorkerSelector[]; - #suppress "@azure-tools/typespec-azure-core/bad-record-type" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." - @doc("A set of key/value pairs that are identifying attributes used by the rules engines to make decisions.") + #suppress "@azure-tools/typespec-azure-core/bad-record-type" "Unions are currently not allowed in spec." + @doc("A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primivite values - number, string, boolean.") labels?: Record; @doc("A collection of the assignments of the job. Key is AssignmentId.") @visibility("read") assignments?: Record; - #suppress "@azure-tools/typespec-azure-core/bad-record-type" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." - @doc("A set of non-identifying attributes attached to this job") + #suppress "@azure-tools/typespec-azure-core/bad-record-type" "Unions are currently not allowed in spec." + @doc("A set of non-identifying attributes attached to this job. Values must be primivite values - number, string, boolean.") tags?: Record; @doc("Notes attached to a job, sorted by timestamp") @@ -417,9 +417,8 @@ model RouterWorkerSelector { @doc("Describes how the value of the label is compared to the value defined on the label selector") labelOperator: LabelOperator; - #suppress "@azure-tools/typespec-azure-core/bad-record-type" - #suppress "@azure-tools/typespec-azure-core/no-unknown" - @doc("The value to compare against the actual label value with the given operator") + #suppress "@azure-tools/typespec-azure-core/no-unknown" "Unions are currently not allowed in spec." + @doc("The value to compare against the actual label value with the given operator. Values must be primivite values - number, string, boolean.") value?: unknown; @doc("Describes how long this label selector is valid in seconds.") @@ -586,8 +585,8 @@ model RouterQueue { @doc("The ID of the distribution policy that will determine how a job is distributed to workers.") distributionPolicyId?: string; - #suppress "@azure-tools/typespec-azure-core/bad-record-type" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." - @doc("A set of key/value pairs that are identifying attributes used by the rules engines to make decisions.") + #suppress "@azure-tools/typespec-azure-core/bad-record-type" "Unions are currently not allowed in spec." + @doc("A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primivite values - number, string, boolean.") labels?: Record; @doc("The ID of the exception policy that determines various job escalation rules.") @@ -629,12 +628,12 @@ model RouterWorker { @doc("The total capacity score this worker has to manage multiple concurrent jobs.") capacity?: int32; - #suppress "@azure-tools/typespec-azure-core/bad-record-type" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." - @doc("A set of key/value pairs that are identifying attributes used by the rules engines to make decisions.") + #suppress "@azure-tools/typespec-azure-core/bad-record-type" "Unions are currently not allowed in spec." + @doc("A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primivite values - number, string, boolean.") labels?: Record; - #suppress "@azure-tools/typespec-azure-core/bad-record-type" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." - @doc("A set of non-identifying attributes attached to this worker.") + #suppress "@azure-tools/typespec-azure-core/bad-record-type" "Unions are currently not allowed in spec." + @doc("A set of non-identifying attributes attached to this worker. Values must be primivite values - number, string, boolean.") tags?: Record; @doc("The channel(s) this worker can handle and their impact on the workers capacity.") @@ -774,9 +773,8 @@ model RouterQueueSelector { @doc("Describes how the value of the label is compared to the value defined on the label selector") labelOperator: LabelOperator; - #suppress "@azure-tools/typespec-azure-core/no-unknown" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." - #suppress "@azure-tools/typespec-azure-core/bad-record-type" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." - @doc("The value to compare against the actual label value with the given operator") + #suppress "@azure-tools/typespec-azure-core/no-unknown" "Unions are currently not allowed in spec." + @doc("The value to compare against the actual label value with the given operator. Values must be primivite values - number, string, boolean.") value?: unknown; } @@ -929,8 +927,8 @@ model ReclassifyExceptionAction extends ExceptionAction { @doc("The new classification policy that will determine queue, priority and worker selectors.") classificationPolicyId?: string; - #suppress "@azure-tools/typespec-azure-core/bad-record-type" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." - @doc("Dictionary containing the labels to update (or add if not existing) in key-value pairs") + #suppress "@azure-tools/typespec-azure-core/bad-record-type" "Unions are currently not allowed in spec." + @doc("Dictionary containing the labels to update (or add if not existing) in key-value pairs. Values must be primivite values - number, string, boolean.") labelsToUpsert?: Record; @doc("The type discriminator describing a sub-type of ExceptionAction") @@ -972,9 +970,8 @@ model StaticQueueSelectorAttachment extends QueueSelectorAttachment { @doc("A rule providing static rules that always return the same result, regardless of input.") model StaticRouterRule extends RouterRule { - #suppress "@azure-tools/typespec-azure-core/bad-record-type" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." - #suppress "@azure-tools/typespec-azure-core/no-unknown" "This accepts only primivite values - number, string, boolean. Unions are currently not allowed in spec." - @doc("The static value this rule always returns.") + #suppress "@azure-tools/typespec-azure-core/no-unknown" "Unions are currently not allowed in spec." + @doc("The static value this rule always returns. Values must be primivite values - number, string, boolean.") value?: unknown; @doc("The type discriminator describing a sub-type of Rule") @@ -1047,19 +1044,27 @@ model WorkerWeightedAllocation { @doc("Request payload for reclassifying jobs") model ReclassifyJobOptions is Record; -#suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" @access(Access.internal) @doc("Response payload from reclassifying a job") -model ReclassifyJobResult is Record; +model ReclassifyJobResult {} + +@doc("OK Response payload from reclassifying a job.") +model ReclassifyJobResultWithOkResponse { + @doc("Response payload from reclassifying a job.") + @body + body: ReclassifyJobResult; + + @doc("Status code.") + @statusCode + _: 200; +} -#suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" @access(Access.internal) @doc("Response payload from closing a job") -model CloseJobResult is Record; +model CloseJobResult {} @doc("Response payload from closing a job synchronously.") model CloseJobResultWithOkResponse { - #suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" @doc("Response after closing a job.") @body body: CloseJobResult; @@ -1069,14 +1074,12 @@ model CloseJobResultWithOkResponse { _: 200; } -#suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" @access(Access.internal) @doc("Response payload from cancelling a job") -model CancelJobResult is Record; +model CancelJobResult {} @doc("OK Response payload from cancelling a job") model CancelJobResultWithOkResponse { - #suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" @doc("Response after cancelling a job.") @body body: CancelJobResult; @@ -1086,14 +1089,12 @@ model CancelJobResultWithOkResponse { _: 200; } -#suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" @access(Access.internal) @doc("Response payload from completing a job") -model CompleteJobResult is Record; +model CompleteJobResult {} @doc("OK Response payload from completing a job") model CompleteJobResultWithOkResponse { - #suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" @doc("Response after completing a job.") @body body: CompleteJobResult; @@ -1103,14 +1104,12 @@ model CompleteJobResultWithOkResponse { _: 200; } -#suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" @access(Access.internal) @doc("Response payload from declining a job") -model DeclineJobOfferResult is Record; +model DeclineJobOfferResult {} @doc("OK Response payload from declining a job.") model DeclineJobOfferResultWithOkResponse { - #suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" @doc("Response payload from declining a job.") @body body: DeclineJobOfferResult; diff --git a/specification/communication/Communication.JobRouter/routes.tsp b/specification/communication/Communication.JobRouter/routes.tsp index 2782d7a5a47c..bc3ed7a0a137 100644 --- a/specification/communication/Communication.JobRouter/routes.tsp +++ b/specification/communication/Communication.JobRouter/routes.tsp @@ -121,15 +121,7 @@ interface JobRouterOperations { @body options?: ReclassifyJobOptions; }, - { - #suppress "@azure-tools/typespec-azure-core/bad-record-type" "https://github.com/microsoft/typespec/issues/2542" - @doc("Response after reclassifying a job.") - @body - body: ReclassifyJobResult; - - @statusCode - _: 200; - } + ReclassifyJobResultWithOkResponse >; @summary("Submits request to cancel an existing job by Id while supplying free-form cancellation reason.") diff --git a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json index ff993d4be4be..3d9cb68342bc 100644 --- a/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json +++ b/specification/communication/data-plane/JobRouter/stable/2023-11-01/communicationservicejobrouter.json @@ -2281,8 +2281,7 @@ }, "CancelJobResult": { "type": "object", - "description": "Response payload from cancelling a job", - "additionalProperties": {} + "description": "Response payload from cancelling a job" }, "ClassificationPolicy": { "type": "object", @@ -2387,8 +2386,7 @@ }, "CloseJobResult": { "type": "object", - "description": "Response payload from closing a job", - "additionalProperties": {} + "description": "Response payload from closing a job" }, "CompleteJobOptions": { "type": "object", @@ -2402,8 +2400,7 @@ }, "CompleteJobResult": { "type": "object", - "description": "Response payload from completing a job", - "additionalProperties": {} + "description": "Response payload from completing a job" }, "ConditionalQueueSelectorAttachment": { "type": "object", @@ -2474,8 +2471,7 @@ }, "DeclineJobOfferResult": { "type": "object", - "description": "Response payload from declining a job", - "additionalProperties": {} + "description": "Response payload from declining a job" }, "DirectMapRouterRule": { "type": "object", @@ -3240,7 +3236,7 @@ }, "labelsToUpsert": { "type": "object", - "description": "Dictionary containing the labels to update (or add if not existing) in key-value pairs", + "description": "Dictionary containing the labels to update (or add if not existing) in key-value pairs. Values must be primivite values - number, string, boolean.", "additionalProperties": {} } }, @@ -3260,8 +3256,7 @@ }, "ReclassifyJobResult": { "type": "object", - "description": "Response payload from reclassifying a job", - "additionalProperties": {} + "description": "Response payload from reclassifying a job" }, "RoundRobinMode": { "type": "object", @@ -3376,7 +3371,7 @@ }, "labels": { "type": "object", - "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions.", + "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primivite values - number, string, boolean.", "additionalProperties": {} }, "assignments": { @@ -3389,7 +3384,7 @@ }, "tags": { "type": "object", - "description": "A set of non-identifying attributes attached to this job", + "description": "A set of non-identifying attributes attached to this job. Values must be primivite values - number, string, boolean.", "additionalProperties": {} }, "notes": { @@ -3489,12 +3484,12 @@ }, "labels": { "type": "object", - "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions.", + "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primivite values - number, string, boolean.", "additionalProperties": {} }, "tags": { "type": "object", - "description": "A set of non-identifying attributes attached to this job", + "description": "A set of non-identifying attributes attached to this job. Values must be primivite values - number, string, boolean.", "additionalProperties": {} }, "notes": { @@ -3708,7 +3703,7 @@ }, "labels": { "type": "object", - "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions.", + "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primivite values - number, string, boolean.", "additionalProperties": {} }, "exceptionPolicyId": { @@ -3735,7 +3730,7 @@ }, "labels": { "type": "object", - "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions.", + "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primivite values - number, string, boolean.", "additionalProperties": {} }, "exceptionPolicyId": { @@ -3757,7 +3752,7 @@ "description": "Describes how the value of the label is compared to the value defined on the label selector" }, "value": { - "description": "The value to compare against the actual label value with the given operator" + "description": "The value to compare against the actual label value with the given operator. Values must be primivite values - number, string, boolean." } }, "required": [ @@ -3855,12 +3850,12 @@ }, "labels": { "type": "object", - "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions.", + "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primivite values - number, string, boolean.", "additionalProperties": {} }, "tags": { "type": "object", - "description": "A set of non-identifying attributes attached to this worker.", + "description": "A set of non-identifying attributes attached to this worker. Values must be primivite values - number, string, boolean.", "additionalProperties": {} }, "channels": { @@ -3953,12 +3948,12 @@ }, "labels": { "type": "object", - "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions.", + "description": "A set of key/value pairs that are identifying attributes used by the rules engines to make decisions. Values must be primivite values - number, string, boolean.", "additionalProperties": {} }, "tags": { "type": "object", - "description": "A set of non-identifying attributes attached to this worker.", + "description": "A set of non-identifying attributes attached to this worker. Values must be primivite values - number, string, boolean.", "additionalProperties": {} }, "channels": { @@ -3988,7 +3983,7 @@ "description": "Describes how the value of the label is compared to the value defined on the label selector" }, "value": { - "description": "The value to compare against the actual label value with the given operator" + "description": "The value to compare against the actual label value with the given operator. Values must be primivite values - number, string, boolean." }, "expiresAfterSeconds": { "type": "number", @@ -4219,7 +4214,7 @@ "description": "A rule providing static rules that always return the same result, regardless of input.", "properties": { "value": { - "description": "The static value this rule always returns." + "description": "The static value this rule always returns. Values must be primivite values - number, string, boolean." } }, "allOf": [ @@ -4234,7 +4229,7 @@ "description": "A rule providing static rules that always return the same result, regardless of input.", "properties": { "value": { - "description": "The static value this rule always returns." + "description": "The static value this rule always returns. Values must be primivite values - number, string, boolean." } }, "allOf": [