Skip to content
Merged
Show file tree
Hide file tree
Changes from 115 commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
089319a
jobrouter ga typespec initial commit
sarkar-rajarshi Sep 12, 2023
2775145
add x-ms-example
sarkar-rajarshi Sep 12, 2023
d079580
change unknown to object
sarkar-rajarshi Sep 12, 2023
3b132ed
fix consumes for upsert routes
sarkar-rajarshi Sep 12, 2023
2025a7b
fix naming validation error
sarkar-rajarshi Sep 12, 2023
36281c6
remove x-ms-examples
sarkar-rajarshi Sep 12, 2023
2ea312a
unreferenced json file validation fix
sarkar-rajarshi Sep 13, 2023
f06c16b
change to using unknown
sarkar-rajarshi Sep 13, 2023
a71bfce
rename generated client to XXXXXRestClient
sarkar-rajarshi Sep 13, 2023
fe44514
test generating convenience methods
sarkar-rajarshi Sep 15, 2023
e0b925f
add line
adamtuck-msft Sep 13, 2023
d3ac5de
rebased
sarkar-rajarshi Sep 15, 2023
de5ce6e
correctly represent uri
sarkar-rajarshi Sep 15, 2023
d922de4
try out standard operations for classification policy
sarkar-rajarshi Sep 18, 2023
7a16dec
use standard ops wherever possible
sarkar-rajarshi Sep 18, 2023
a2ea7e7
try placing route decorator at namespace level
sarkar-rajarshi Sep 18, 2023
2fc8373
remove router decorator from namespace
sarkar-rajarshi Sep 18, 2023
8fb85c5
update tspconfig
sarkar-rajarshi Sep 19, 2023
49d0ac2
add conditional headers
sarkar-rajarshi Sep 19, 2023
0fb329b
use azure core etag
sarkar-rajarshi Sep 20, 2023
8b1e2c3
fix floats to doubles
sarkar-rajarshi Sep 20, 2023
ba48021
update typespec-python options + regenerate rest specs
sarkar-rajarshi Sep 21, 2023
9f78614
fix lint errors
sarkar-rajarshi Sep 25, 2023
c020c43
add examples
sarkar-rajarshi Sep 25, 2023
dc0bf12
ci fixes 2
sarkar-rajarshi Sep 26, 2023
980a1dd
ci fixes 3
sarkar-rajarshi Sep 26, 2023
378b1ab
remove reference to Azure.Core.Etag (throws lint error)
sarkar-rajarshi Sep 26, 2023
9c6e52e
review feedback
sarkar-rajarshi Sep 26, 2023
45b578e
added list query params
sarkar-rajarshi Sep 26, 2023
c2b7262
try codegen without url scalar
sarkar-rajarshi Sep 27, 2023
801fa10
retry python emitter with url fix
sarkar-rajarshi Sep 27, 2023
de430d8
try specifying python output directory
sarkar-rajarshi Sep 27, 2023
5eb48b4
python emitter - change package-mode to azure-dataplane
sarkar-rajarshi Sep 27, 2023
9d957d6
remove @example decorator
sarkar-rajarshi Sep 27, 2023
79bdc82
remove redundant imports
sarkar-rajarshi Sep 27, 2023
5848746
fix examples
sarkar-rajarshi Sep 27, 2023
2eef370
make ScheduleAndSuspendMode.ScheduleAt a required field
sarkar-rajarshi Sep 28, 2023
f30dbeb
uri scalar add
sarkar-rajarshi Sep 28, 2023
0073872
clean up
sarkar-rajarshi Sep 28, 2023
80f10c8
Update JS sdk config to azure-rest
marcma123 Oct 4, 2023
9f89032
change JobMatchingMode polymorphic type
sarkar-rajarshi Oct 4, 2023
0ba3dad
rename client remove Rest
sarkar-rajarshi Oct 12, 2023
1c603c1
rename acceptJob, declineJob to acceptJobOffer, declineJobOffer
sarkar-rajarshi Oct 13, 2023
d7d5d8b
test internal decorator
sarkar-rajarshi Oct 15, 2023
0fefa24
make all upsert methods internal
sarkar-rajarshi Oct 15, 2023
6cafdbd
specify python package version
sarkar-rajarshi Oct 17, 2023
2397f65
Make upsert methods internal
cparisineti Oct 17, 2023
eb57b2b
make status selectors internal for python
sarkar-rajarshi Oct 18, 2023
42c8741
sdk feedback review items
sarkar-rajarshi Oct 23, 2023
f0a92ff
more review feedback items
sarkar-rajarshi Oct 23, 2023
52e20b5
update examples
sarkar-rajarshi Oct 24, 2023
ed375e5
Add partial-update for java
cparisineti Oct 24, 2023
217b3cc
try updating client.tsp to rename method for .NET
sarkar-rajarshi Oct 24, 2023
2a57b72
make ExceptionAction.Id optional
sarkar-rajarshi Oct 24, 2023
653469e
run prettier
sarkar-rajarshi Oct 24, 2023
09f8419
fix more examples
sarkar-rajarshi Oct 24, 2023
1017ea8
minor doc update
sarkar-rajarshi Oct 25, 2023
ca538d3
Update projected names and internal modifier
williamzhao87 Oct 25, 2023
e17a14f
Modify internal to only apply for java, csharp, python
williamzhao87 Oct 25, 2023
2b3645e
Update internal
williamzhao87 Oct 25, 2023
92ee9fd
make upsert method visible for python
sarkar-rajarshi Oct 25, 2023
2cd0ceb
modify enums for python
sarkar-rajarshi Oct 25, 2023
4c65f64
revert
sarkar-rajarshi Oct 25, 2023
930697d
sdk review comment 3
sarkar-rajarshi Oct 31, 2023
1904f75
Test generator without endpoint
williamzhao87 Oct 31, 2023
5ce22f2
Revert change
williamzhao87 Oct 31, 2023
68c1fc5
manually add empty response schemas in swagger because of https://git…
sarkar-rajarshi Nov 1, 2023
eaab91b
add linter in tspconfig.yaml
sarkar-rajarshi Nov 1, 2023
61f2db8
add to custom words
sarkar-rajarshi Nov 1, 2023
1c3077b
doc updates
sarkar-rajarshi Nov 2, 2023
d41841b
fix nextlink lint error
sarkar-rajarshi Nov 2, 2023
8b84706
test changes in client.tsp for validation failures
sarkar-rajarshi Nov 2, 2023
2d9a193
run cleanup
sarkar-rajarshi Nov 2, 2023
5106ed7
Update java internal models
cparisineti Nov 2, 2023
4e04519
Remove projectedName annotations
cparisineti Nov 5, 2023
456001f
more linter fixes
sarkar-rajarshi Nov 3, 2023
58b841d
exception action make id not readonly since needs to be serialized
sarkar-rajarshi Nov 3, 2023
ecf8839
make methods for canceljon, complete job, close job and decline offer…
sarkar-rajarshi Nov 3, 2023
fffa158
update azure-tools/typespec-ts emitter options
sarkar-rajarshi Nov 4, 2023
637d304
try update example for LintDiff errors
sarkar-rajarshi Nov 4, 2023
1d9229e
set nextLink value to null
sarkar-rajarshi Nov 4, 2023
6e2bf07
Update unassignJob internal csharp
williamzhao87 Nov 6, 2023
ab24add
move out assignmentId to path
sarkar-rajarshi Nov 6, 2023
983b11b
linter fixes
sarkar-rajarshi Nov 6, 2023
3ccef75
Revert unassign job changes
williamzhao87 Nov 6, 2023
cdc0ec1
Add internal for unassign csharp
williamzhao87 Nov 6, 2023
6fa2d2b
use standard ResourceAction for all action except closeJob
sarkar-rajarshi Nov 6, 2023
0813064
fix linters
sarkar-rajarshi Nov 6, 2023
0675062
close job should always return 200
sarkar-rajarshi Nov 7, 2023
de3c3a8
fix linter errors
sarkar-rajarshi Nov 7, 2023
59cbad9
Suppress violation ValidFormats in LintDiff
mikeharder Nov 7, 2023
1bcc86d
test method rename
sarkar-rajarshi Nov 7, 2023
a8d4f97
try rename again
sarkar-rajarshi Nov 7, 2023
8d8ef8f
try again
sarkar-rajarshi Nov 7, 2023
c9d0d10
try again
sarkar-rajarshi Nov 7, 2023
2987392
try again
sarkar-rajarshi Nov 7, 2023
bb7094e
Merge pull request #5 from sarkar-rajarshi/rsarkar/jobrouter/ga/test-…
sarkar-rajarshi Nov 7, 2023
4e9b1c1
set default values for min and maz concurrent offer
sarkar-rajarshi Nov 7, 2023
cb8419a
set default value of bypass selectors
sarkar-rajarshi Nov 7, 2023
af9a910
try codegen removing @route decorator
sarkar-rajarshi Nov 7, 2023
059b0de
clean up @route decorator
sarkar-rajarshi Nov 7, 2023
db1df94
Merge pull request #6 from sarkar-rajarshi/rsarkar/jobrouter/ga/try-c…
sarkar-rajarshi Nov 7, 2023
986b1a4
revert making unassign internal for csharp
sarkar-rajarshi Nov 7, 2023
a019b11
try renaming completeJob to completeJobInternal for csharp
sarkar-rajarshi Nov 7, 2023
c1651f9
rename op cancel, close, complete, decline for csharp
sarkar-rajarshi Nov 7, 2023
fb0430b
Merge pull request #7 from sarkar-rajarshi/rsarkar/jobrouter/ga/cshar…
sarkar-rajarshi Nov 7, 2023
8611260
Add "where" clause to ValidFormats suppression
mikeharder Nov 8, 2023
ac7b2c7
redefine empty model differently
sarkar-rajarshi Nov 8, 2023
633a113
Merge pull request #8 from sarkar-rajarshi/rsarkar/jobrouter/ga/try-e…
sarkar-rajarshi Nov 8, 2023
fa487ac
fix spelling of primitive
sarkar-rajarshi Nov 8, 2023
a2a2664
Suppress INVALID_TYPE caused by bug in ModelValidation
mikeharder Nov 8, 2023
fa49999
add default and change empty model representation
sarkar-rajarshi Nov 8, 2023
14bbd5a
Merge pull request #9 from sarkar-rajarshi/rsarkar/jobrouter/ga-addre…
sarkar-rajarshi Nov 8, 2023
2ffb9c7
Make unassign job internal
williamzhao87 Nov 8, 2023
cf93cd8
linter fixes
sarkar-rajarshi Nov 8, 2023
c4d75d2
Update specification/communication/Communication.JobRouter/models.tsp
sarkar-rajarshi Nov 8, 2023
c161492
Update specification/communication/Communication.JobRouter/models.tsp
sarkar-rajarshi Nov 8, 2023
a396918
linter fixes
sarkar-rajarshi Nov 8, 2023
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
2 changes: 2 additions & 0 deletions custom-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@ continuationtoken
continuousdataexports
continuouswebjobs
contoso
Contoso's
contosodataset
contosomedia
contributer
Expand Down Expand Up @@ -2942,6 +2943,7 @@ ulaanbaatar
unallocated
unarchive
unassign
unassigning
unassignment
unassigns
unattend
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/package.json
**/package-lock.json
**/.npmrc
68 changes: 68 additions & 0 deletions specification/communication/Communication.JobRouter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Azure Communication Job Router TypeSpec Specification

The TypeSpec and generated API specification for the Azure Communication Job Router.

## Development Environment

0. Change directory into the `specification\communication\Communication.JobRouter\` directory.

1. Install Node.js 16 LTS and ensure you are able to run the npm command in a command prompt:

```console
npm --version
```

2. Install Azure DevOps Auth helper for npm to pull the libraries from the secured feed

```console
npm install -g vsts-npm-auth
vsts-npm-auth -config .npmrc
```

3. Install TypeSpec compiler and libraries:

```console
npm install -g @typespec/compiler
```

4. (Optional) Install the TypeSpec extension for your editor of choice:

- Visual Studio Code

``` console
tsp code install
```

- Visual Studio

``` console
tsp vs install
```

5. Install node package dependencies:

```console
tsp install
```

6. Compile TypeSpec to Swagger. This will update the files in the directory `..\data-plane\JobRouter\<version-status>\<api-version>\communicationservicejobrouter.json`:

```console
npx tsp compile specification\communication\Communication.JobRouter
```

7. To re-generate examples, download and install the [OAV
tool](https://github.com/Azure/oav) and run it: note: This directory is taken
from [azure-rest-api-specs](https://github.com/Azure/azure-rest-api-specs),
and the following commands should be run from there.

```console
npm install -g oav@latest
oav generate-examples <path to communicationservicejobrouter.json>
```

## Testing and Viewing API as an Interface

1. Visit the official [Swagger Editor](https://editor.swagger.io/).

2. Copy the generated Swagger from `communicationservicejobrouter.json` and paste it into the editor.
122 changes: 122 additions & 0 deletions specification/communication/Communication.JobRouter/client.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
// client.tsp
import "@azure-tools/typespec-client-generator-core";
import "@typespec/versioning";

import "./main.tsp";

using Azure.ClientGenerator.Core;
using TypeSpec.Versioning;

@useDependency(AzureCommunicationRoutingService.Versions.c2023_11_01)
namespace ClientForAcsJobRouter;

// Your customizations here
@client({
name: "JobRouterAdministrationClient",
service: AzureCommunicationRoutingService,
})
interface JobRouterAdministrationRestClient {
@internal("csharp")
@internal("java")
upsertDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertDistributionPolicy;

getDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getDistributionPolicy;

listDistributionPolicies is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listDistributionPolicies;

deleteDistributionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteDistributionPolicy;

@internal("csharp")
@internal("java")
upsertClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertClassificationPolicy;

getClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getClassificationPolicy;

listClassificationPolicies is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listClassificationPolicies;

deleteClassificationPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteClassificationPolicy;

@internal("csharp")
@internal("java")
upsertExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertExceptionPolicy;

getExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getExceptionPolicy;

listExceptionPolicies is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listExceptionPolicies;

deleteExceptionPolicy is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteExceptionPolicy;

@internal("csharp")
@internal("java")
upsertQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.upsertQueue;

getQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.getQueue;

listQueues is AzureCommunicationRoutingService.JobRouterAdministrationOperations.listQueues;

deleteQueue is AzureCommunicationRoutingService.JobRouterAdministrationOperations.deleteQueue;
}

@client({
name: "JobRouterClient",
service: AzureCommunicationRoutingService,
})
interface JobRouterRestClient {
@internal("csharp")
@internal("java")
upsertJob is AzureCommunicationRoutingService.JobRouterOperations.upsertJob;

getJob is AzureCommunicationRoutingService.JobRouterOperations.getJob;

deleteJob is AzureCommunicationRoutingService.JobRouterOperations.deleteJob;

@internal("csharp")
@internal("python")
@internal("java")
reclassify is AzureCommunicationRoutingService.JobRouterOperations.reclassify;

@internal("csharp")
@internal("python")
@internal("java")
cancel is AzureCommunicationRoutingService.JobRouterOperations.cancel;

@internal("csharp")
@internal("python")
@internal("java")
complete is AzureCommunicationRoutingService.JobRouterOperations.complete;

@internal("csharp")
@internal("python")
@internal("java")
close is AzureCommunicationRoutingService.JobRouterOperations.close;

listJobs is AzureCommunicationRoutingService.JobRouterOperations.listJobs;

#suppress "@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops" "Need to revist how to correctly define singletons https://github.com/Azure/azure-rest-api-specs/issues/25605#issuecomment-1736265997"
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Need to revist how to correctly define singletons https://github.com/Azure/azure-rest-api-specs/issues/25605#issuecomment-1736265997"
getQueuePosition is AzureCommunicationRoutingService.JobRouterOperations.getInQueuePosition;

@internal("csharp")
unassign is AzureCommunicationRoutingService.JobRouterOperations.unassign;

accept is AzureCommunicationRoutingService.JobRouterOperations.accept;

@internal("csharp")
@internal("python")
@internal("java")
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"
#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Need to revist how to correctly define singletons https://github.com/Azure/azure-rest-api-specs/issues/25605#issuecomment-1736265997"
getQueueStatistics is AzureCommunicationRoutingService.JobRouterOperations.getQueueStatistics;

@internal("csharp")
@internal("java")
upsertWorker is AzureCommunicationRoutingService.JobRouterOperations.upsertWorker;

getWorker is AzureCommunicationRoutingService.JobRouterOperations.getWorker;

deleteWorker is AzureCommunicationRoutingService.JobRouterOperations.deleteWorker;

listWorkers is AzureCommunicationRoutingService.JobRouterOperations.listWorkers;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
"title": "Creates a Classification Policy",
"operationId": "JobRouterAdministrationOperations_UpsertClassificationPolicy",
"parameters": {
"endpoint": "https://contoso.westus.communications.azure.com",
"api-version": "2023-11-01",
"classificationPolicyId": "90eb00c4-234e-4df7-a231-ef7895518384",
"resource": {
"name": "Main",
"fallbackQueueId": "MainQueue",
"queueSelectorAttachments": [
{
"kind": "conditional",
"condition": {
"kind": "expression-rule",
"language": "powerFx",
"expression": "1 = 1"
},
"queueSelectors": [
{
"key": "foo",
"labelOperator": "equal",
"value": "bar"
}
]
}
],
"prioritizationRule": {
"kind": "static-rule",
"value": "2"
}
}
},
"responses": {
"200": {
"body": {
"id": "90eb00c4-234e-4df7-a231-ef7895518384",
"name": "Main",
"fallbackQueueId": "MainQueue",
"queueSelectorAttachments": [
{
"kind": "conditional",
"condition": {
"kind": "expression-rule",
"language": "powerFx",
"expression": "1 = 1"
},
"queueSelectors": [
{
"key": "foo",
"labelOperator": "equal",
"value": "bar"
}
]
}
],
"prioritizationRule": {
"kind": "static-rule",
"value": "2"
},
"workerSelectorAttachments": [],
"etag": "etag"
}
},
"201": {
"body": {
"id": "90eb00c4-234e-4df7-a231-ef7895518384",
"name": "Main",
"fallbackQueueId": "MainQueue",
"queueSelectorAttachments": [
{
"kind": "conditional",
"condition": {
"kind": "expression-rule",
"language": "powerFx",
"expression": "1 = 1"
},
"queueSelectors": [
{
"key": "foo",
"labelOperator": "equal",
"value": "bar"
}
]
}
],
"prioritizationRule": {
"kind": "static-rule",
"value": "2"
},
"workerSelectorAttachments": [],
"etag": "etag"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"title": "Delete a classification policy",
"operationId": "JobRouterAdministrationOperations_DeleteClassificationPolicy",
"parameters": {
"endpoint": "https://contoso.westus.communications.azure.com",
"api-version": "2023-11-01",
"classificationPolicyId": "MainClassificationPolicy"
},
"responses": {
"204": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"title": "Retrieves an existing classification policy by Id",
"operationId": "JobRouterAdministrationOperations_GetClassificationPolicy",
"parameters": {
"endpoint": "https://contoso.westus.communications.azure.com",
"api-version": "2023-11-01",
"classificationPolicyId": "MainClassificationPolicy"
},
"responses": {
"200": {
"body": {
"id": "MainClassificationPolicy",
"name": "Main",
"fallbackQueueId": "MainQueue",
"queueSelectorAttachments": [
{
"kind": "conditional",
"condition": {
"kind": "expression-rule",
"language": "powerFx",
"expression": "1 = 1"
},
"queueSelectors": [
{
"key": "foo",
"labelOperator": "equal",
"value": "bar"
}
]
}
],
"prioritizationRule": {
"kind": "static-rule",
"value": "2"
},
"workerSelectorAttachments": [
{
"kind": "pass-through",
"key": "language",
"labelOperator": "equal"
}
],
"etag": "etag"
}
}
}
}
Loading