Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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"
Expand Down
69 changes: 34 additions & 35 deletions specification/communication/Communication.JobRouter/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -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<unknown>;

@doc("A collection of the assignments of the job. Key is AssignmentId.")
@visibility("read")
assignments?: Record<RouterJobAssignment>;

#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<unknown>;

@doc("Notes attached to a job, sorted by timestamp")
Expand All @@ -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.")
Expand Down Expand Up @@ -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<unknown>;

@doc("The ID of the exception policy that determines various job escalation rules.")
Expand Down Expand Up @@ -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<unknown>;

#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<unknown>;

@doc("The channel(s) this worker can handle and their impact on the workers capacity.")
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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<unknown>;

@doc("The type discriminator describing a sub-type of ExceptionAction")
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -1047,19 +1044,27 @@ model WorkerWeightedAllocation {
@doc("Request payload for reclassifying jobs")
model ReclassifyJobOptions is Record<string>;

#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<unknown>;
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<unknown>;
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;
Expand All @@ -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<unknown>;
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;
Expand All @@ -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<unknown>;
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;
Expand All @@ -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<unknown>;
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;
Expand Down
10 changes: 1 addition & 9 deletions specification/communication/Communication.JobRouter/routes.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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": {}
}
},
Expand All @@ -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",
Expand Down Expand Up @@ -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": {
Expand All @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand All @@ -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": {
Expand All @@ -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": [
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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": [
Expand All @@ -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": [
Expand Down