diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index 3c01ef8299eb..dceaf4e4cba8 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -5,16 +5,16 @@ "packages": { "": { "dependencies": { - "@azure-tools/typespec-java": "0.13.11" + "@azure-tools/typespec-java": "0.14.1" }, "devDependencies": { - "@azure-tools/typespec-azure-core": "0.39.1", - "@azure-tools/typespec-client-generator-core": "0.39.1", - "@typespec/compiler": "0.53.1", - "@typespec/http": "0.53.0", - "@typespec/openapi": "0.53.0", - "@typespec/rest": "0.53.0", - "@typespec/versioning": "0.53.0" + "@azure-tools/typespec-azure-core": "0.40.0", + "@azure-tools/typespec-client-generator-core": "0.40.0", + "@typespec/compiler": "0.54.0", + "@typespec/http": "0.54.0", + "@typespec/openapi": "0.54.0", + "@typespec/rest": "0.54.0", + "@typespec/versioning": "0.54.0" } }, "node_modules/@autorest/codemodel": { @@ -63,42 +63,42 @@ } }, "node_modules/@azure-tools/typespec-azure-core": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.39.1.tgz", - "integrity": "sha512-b1cN1HXTcEiKIRpk2EatFK/C4NReDaW2h4N3V4C5dxGeeLAnTa1jsQ6lwobH6Zo39CdrjazNXiSbcEq1UZ7kPw==", + "version": "0.40.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.40.0.tgz", + "integrity": "sha512-l5U47zXKYQKFbipRQLpjG4EwvPJg0SogdFEe5a3rRr7mUy8sWPkciHpngLZVOd2cKZQD5m7nqwfWL798I9TJnQ==", "dev": true, "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.53.1", - "@typespec/http": "~0.53.0", - "@typespec/rest": "~0.53.0" + "@typespec/compiler": "~0.54.0", + "@typespec/http": "~0.54.0", + "@typespec/rest": "~0.54.0" } }, "node_modules/@azure-tools/typespec-client-generator-core": { - "version": "0.39.1", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.39.1.tgz", - "integrity": "sha512-EV3N6IN1i/hXGqYKNfXx6+2QAyZnG4IpC9RUk6fqwSQDWX7HtMcfdXqlOaK3Rz2H6BUAc9OnH+Trq/uJCl/RgA==", + "version": "0.40.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.40.0.tgz", + "integrity": "sha512-Nm/OfDtSWBr1lylISbXR37B9QKWlZHK1j4T8L439Y1v3VcvJsC/0F5PLemY0odHpOYZNwu2uevJjAeM5W56wlw==", "dev": true, "dependencies": { - "change-case": "~5.3.0", + "change-case": "~5.4.2", "pluralize": "^8.0.0" }, "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.53.1", - "@typespec/http": "~0.53.0", - "@typespec/rest": "~0.53.0", - "@typespec/versioning": "~0.53.0" + "@typespec/compiler": "~0.54.0", + "@typespec/http": "~0.54.0", + "@typespec/rest": "~0.54.0", + "@typespec/versioning": "~0.54.0" } }, "node_modules/@azure-tools/typespec-java": { - "version": "0.13.11", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-java/-/typespec-java-0.13.11.tgz", - "integrity": "sha512-/0X6hS4BZbFn3xa3vynYmaFjuAZEFE1HRgHFN7ptAhloZL7nAicmkdYBMtyfLaJV0kHBwKDPHooB7c16afliEw==", + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-java/-/typespec-java-0.14.1.tgz", + "integrity": "sha512-FGQV12Ck17mfzTgzrz0gpSYt8NAM9gxYLlWcS3vZpokCGB81VG1VKN6u80ui2HfVKZJldxa8MkwqUvv9zml4Yw==", "dependencies": { "@autorest/codemodel": "~4.20.0", "js-yaml": "~4.1.0", @@ -108,8 +108,8 @@ "node": ">=14.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": ">=0.39.1 <1.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.39.1 <1.0.0", + "@azure-tools/typespec-azure-core": ">=0.40.0 <1.0.0", + "@azure-tools/typespec-client-generator-core": ">=0.40.0 <1.0.0", "@typespec/compiler": ">=0.53.1 <1.0.0", "@typespec/http": ">=0.53.0 <1.0.0", "@typespec/openapi": ">=0.53.0 <1.0.0", @@ -201,22 +201,22 @@ } }, "node_modules/@typespec/compiler": { - "version": "0.53.1", - "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-0.53.1.tgz", - "integrity": "sha512-qneMDvZsLaL8+3PXzwXMAqgE4YtkUPPBg4oXrbreYa5NTccuvgVaO4cfya/SzG4WePUnmDTbbrP5aWd+VzYwYA==", + "version": "0.54.0", + "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-0.54.0.tgz", + "integrity": "sha512-lxMqlvUq5m1KZUjg+IoM/gEwY+yeSjjnpUsz6wmzjK4cO9cIY4wPJdrZwe8jUc2UFOoqKXN3AK8N1UWxA+w9Dg==", "dev": true, "dependencies": { "@babel/code-frame": "~7.23.5", "ajv": "~8.12.0", - "change-case": "~5.3.0", + "change-case": "~5.4.2", "globby": "~14.0.0", "mustache": "~4.2.0", "picocolors": "~1.0.0", - "prettier": "~3.1.1", + "prettier": "~3.2.5", "prompts": "~2.4.2", - "semver": "^7.5.4", - "vscode-languageserver": "~9.0.0", - "vscode-languageserver-textdocument": "~1.0.8", + "semver": "^7.6.0", + "vscode-languageserver": "~9.0.1", + "vscode-languageserver-textdocument": "~1.0.11", "yaml": "~2.3.4", "yargs": "~17.7.2" }, @@ -229,53 +229,53 @@ } }, "node_modules/@typespec/http": { - "version": "0.53.0", - "resolved": "https://registry.npmjs.org/@typespec/http/-/http-0.53.0.tgz", - "integrity": "sha512-Hdwbxr6KgzmJdULbbcwWaSSrWlduuMuEVUVdlytxyo9K+aoUCcPl0thR5Ez2VRh02/IJl3xG4n5wXgOwWb3amA==", + "version": "0.54.0", + "resolved": "https://registry.npmjs.org/@typespec/http/-/http-0.54.0.tgz", + "integrity": "sha512-/hZd9pkjJh3ogOekyKzZnpVV2kXzxtWDiTt3Gekc6iHTGk/CE1JpRFts8xwXoI5d3FqYotfb4w5ztVw62WjOcA==", "dev": true, "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.53.0" + "@typespec/compiler": "~0.54.0" } }, "node_modules/@typespec/openapi": { - "version": "0.53.0", - "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-0.53.0.tgz", - "integrity": "sha512-FRHb6Wi4Yf1HGm3EnhhXZ0Bw+EIPam6ptxRy7NDRxyMnzHsOphGcv8mDIZk6MPSy8xPasbFNwaRC1TXpxVhQBw==", + "version": "0.54.0", + "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-0.54.0.tgz", + "integrity": "sha512-QJkwq3whcqKb29ScMD5IQzqvDmPQyLAubRl82Zj6kVMCqabRwegOX9aN+K0083nci65zt9rflZbv9bKY5GRy/A==", "dev": true, "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.53.0", - "@typespec/http": "~0.53.0" + "@typespec/compiler": "~0.54.0", + "@typespec/http": "~0.54.0" } }, "node_modules/@typespec/rest": { - "version": "0.53.0", - "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.53.0.tgz", - "integrity": "sha512-aA75Ol2pRvUjtRqQvFHmFG52pkeif3m+tboLAT00AekTxOPZ3rqQmlE12ne4QF8KjgHA6denqH4f/XyDoRJOJQ==", + "version": "0.54.0", + "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.54.0.tgz", + "integrity": "sha512-F1hq/Per9epPJQ8Ey84mAtrgrZeLu6fDMIxNao1XlTfDEFZuYgFuCSyg0pyIi0Xg7KUBMvrvSv83WoF3mN2szw==", "dev": true, "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.53.0", - "@typespec/http": "~0.53.0" + "@typespec/compiler": "~0.54.0", + "@typespec/http": "~0.54.0" } }, "node_modules/@typespec/versioning": { - "version": "0.53.0", - "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.53.0.tgz", - "integrity": "sha512-nrrLXCWPDrrClAfpCMzQ3YPTbKQmjPC3LSeMjq+wPiMq+1PW95ulOGD4QiCBop+4wKhMCJHnqqSzVauT1LjdvQ==", + "version": "0.54.0", + "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.54.0.tgz", + "integrity": "sha512-IlGpveOJ0WBTbn3w8nfzgSNhJWNd0+H+bo1Ljrjpeb9SFQmS8bX2fDf0vqsHVl50XgvKIZxgOpEXN5TmuzNnRw==", "dev": true, "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.53.0" + "@typespec/compiler": "~0.54.0" } }, "node_modules/ajv": { @@ -347,9 +347,9 @@ } }, "node_modules/change-case": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/change-case/-/change-case-5.3.0.tgz", - "integrity": "sha512-Eykca0fGS/xYlx2fG5NqnGSnsWauhSGiSXYhB1kO6E909GUfo8S54u4UZNS7lMJmgZumZ2SUpWaoLgAcfQRICg==", + "version": "5.4.3", + "resolved": "https://registry.npmjs.org/change-case/-/change-case-5.4.3.tgz", + "integrity": "sha512-4cdyvorTy/lViZlVzw2O8/hHCLUuHqp4KpSSP3DlauhFCf3LdnfF+p5s0EAhjKsU7bqrMzu7iQArYfoPiHO2nw==", "dev": true }, "node_modules/cliui": { @@ -670,9 +670,9 @@ } }, "node_modules/prettier": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.1.tgz", - "integrity": "sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" diff --git a/eng/emitter-package.json b/eng/emitter-package.json index bee85c1878b7..925f81645b87 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -1,15 +1,15 @@ { "main": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-java": "0.13.11" + "@azure-tools/typespec-java": "0.14.1" }, "devDependencies": { - "@typespec/http": "0.53.0", - "@typespec/openapi": "0.53.0", - "@azure-tools/typespec-azure-core": "0.39.1", - "@azure-tools/typespec-client-generator-core": "0.39.1", - "@typespec/rest": "0.53.0", - "@typespec/versioning": "0.53.0", - "@typespec/compiler": "0.53.1" + "@azure-tools/typespec-client-generator-core": "0.40.0", + "@typespec/compiler": "0.54.0", + "@typespec/openapi": "0.54.0", + "@typespec/versioning": "0.54.0", + "@azure-tools/typespec-azure-core": "0.40.0", + "@typespec/http": "0.54.0", + "@typespec/rest": "0.54.0" } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationAsyncClient.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationAsyncClient.java index daffff60bbd2..8bc841f4056e 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationAsyncClient.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationAsyncClient.java @@ -4,26 +4,11 @@ package com.azure.communication.jobrouter; import com.azure.communication.jobrouter.implementation.JobRouterAdministrationClientImpl; -import com.azure.communication.jobrouter.implementation.accesshelpers.ClassificationPolicyConstructorProxy; -import com.azure.communication.jobrouter.implementation.accesshelpers.DistributionPolicyConstructorProxy; -import com.azure.communication.jobrouter.implementation.accesshelpers.ExceptionPolicyConstructorProxy; -import com.azure.communication.jobrouter.implementation.accesshelpers.RouterQueueConstructorProxy; -import com.azure.communication.jobrouter.implementation.converters.ClassificationPolicyAdapter; -import com.azure.communication.jobrouter.implementation.converters.DistributionPolicyAdapter; -import com.azure.communication.jobrouter.implementation.converters.ExceptionPolicyAdapter; -import com.azure.communication.jobrouter.implementation.converters.QueueAdapter; +import com.azure.communication.jobrouter.implementation.JsonMergePatchHelper; import com.azure.communication.jobrouter.implementation.models.ClassificationPolicyInternal; import com.azure.communication.jobrouter.implementation.models.DistributionPolicyInternal; import com.azure.communication.jobrouter.implementation.models.ExceptionPolicyInternal; import com.azure.communication.jobrouter.implementation.models.RouterQueueInternal; -import com.azure.communication.jobrouter.models.ClassificationPolicy; -import com.azure.communication.jobrouter.models.CreateClassificationPolicyOptions; -import com.azure.communication.jobrouter.models.CreateDistributionPolicyOptions; -import com.azure.communication.jobrouter.models.CreateExceptionPolicyOptions; -import com.azure.communication.jobrouter.models.CreateQueueOptions; -import com.azure.communication.jobrouter.models.DistributionPolicy; -import com.azure.communication.jobrouter.models.ExceptionPolicy; -import com.azure.communication.jobrouter.models.RouterQueue; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; @@ -32,6 +17,7 @@ import com.azure.core.exception.HttpResponseException; import com.azure.core.exception.ResourceModifiedException; import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpHeaderName; import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; @@ -39,10 +25,28 @@ import com.azure.core.http.rest.Response; import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.BinaryData; +import com.azure.core.util.DateTimeRfc1123; import com.azure.core.util.FluxUtil; +import java.time.OffsetDateTime; import java.util.stream.Collectors; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import com.azure.communication.jobrouter.implementation.accesshelpers.ClassificationPolicyConstructorProxy; +import com.azure.communication.jobrouter.implementation.accesshelpers.DistributionPolicyConstructorProxy; +import com.azure.communication.jobrouter.implementation.accesshelpers.ExceptionPolicyConstructorProxy; +import com.azure.communication.jobrouter.implementation.accesshelpers.RouterQueueConstructorProxy; +import com.azure.communication.jobrouter.implementation.converters.ClassificationPolicyAdapter; +import com.azure.communication.jobrouter.implementation.converters.DistributionPolicyAdapter; +import com.azure.communication.jobrouter.implementation.converters.ExceptionPolicyAdapter; +import com.azure.communication.jobrouter.implementation.converters.QueueAdapter; +import com.azure.communication.jobrouter.models.ClassificationPolicy; +import com.azure.communication.jobrouter.models.CreateClassificationPolicyOptions; +import com.azure.communication.jobrouter.models.CreateDistributionPolicyOptions; +import com.azure.communication.jobrouter.models.CreateExceptionPolicyOptions; +import com.azure.communication.jobrouter.models.CreateQueueOptions; +import com.azure.communication.jobrouter.models.DistributionPolicy; +import com.azure.communication.jobrouter.models.ExceptionPolicy; +import com.azure.communication.jobrouter.models.RouterQueue; /** * Initializes a new instance of the asynchronous JobRouterAdministrationClient type. @@ -65,34 +69,15 @@ public final class JobRouterAdministrationAsyncClient { /** * Creates or updates a distribution policy. - *
- * Header Parameters - *
+ *Header Parameters
*| Name | - *Type | - *Required | - *Description | - *
|---|---|---|---|
| If-Match | - *String | - *No | - *The request should only proceed if an entity matches this string. | - *
| If-Unmodified-Since | - *OffsetDateTime | - *No | - *The request should only proceed if the entity was not modified after this time. | - *
| Name | Type | Required | Description |
| If-Match | String | No | The request should only proceed if an entity matches this string. |
| If-Unmodified-Since | OffsetDateTime | No | The request should only proceed if the entity was not modified after this time. |
- * Request Body Schema - *
+ *Request Body Schema
*{@code
* {
* etag: String (Required)
@@ -100,15 +85,14 @@ public final class JobRouterAdministrationAsyncClient {
* name: String (Optional)
* offerExpiresAfterSeconds: Double (Optional)
* mode (Optional): {
+ * kind: String(bestWorker/longestIdle/roundRobin) (Optional)
* minConcurrentOffers: Integer (Optional)
* maxConcurrentOffers: Integer (Optional)
* bypassSelectors: Boolean (Optional)
* }
* }
* }
- * - * Response Body Schema - *
+ *Response Body Schema
*{@code
* {
* etag: String (Required)
@@ -116,6 +100,7 @@ public final class JobRouterAdministrationAsyncClient {
* name: String (Optional)
* offerExpiresAfterSeconds: Double (Optional)
* mode (Optional): {
+ * kind: String(bestWorker/longestIdle/roundRobin) (Optional)
* minConcurrentOffers: Integer (Optional)
* maxConcurrentOffers: Integer (Optional)
* bypassSelectors: Boolean (Optional)
@@ -130,15 +115,12 @@ public final class JobRouterAdministrationAsyncClient {
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return policy governing how jobs are distributed to workers along with {@link Response} on successful completion
- * of {@link Mono}.
+ * @return policy governing how jobs are distributed to workers along with {@link Response} on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
Mono> upsertDistributionPolicyWithResponse(String distributionPolicyId, BinaryData resource,
RequestOptions requestOptions) {
- // Convenience API is not generated, as operation 'upsertDistributionPolicy' is 'application/merge-patch+json'
- // and stream-style-serialization is not enabled
return this.serviceClient.upsertDistributionPolicyWithResponseAsync(distributionPolicyId, resource,
requestOptions);
}
@@ -334,9 +316,7 @@ public Mono updateDistributionPolicy(String distributionPolicyId, Bi
/**
* Retrieves an existing distribution policy by Id.
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -344,6 +324,7 @@ public Mono updateDistributionPolicy(String distributionPolicyId, Bi
* name: String (Optional)
* offerExpiresAfterSeconds: Double (Optional)
* mode (Optional): {
+ * kind: String(bestWorker/longestIdle/roundRobin) (Optional)
* minConcurrentOffers: Integer (Optional)
* maxConcurrentOffers: Integer (Optional)
* bypassSelectors: Boolean (Optional)
@@ -357,8 +338,7 @@ public Mono updateDistributionPolicy(String distributionPolicyId, Bi
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return policy governing how jobs are distributed to workers along with {@link Response} on successful completion
- * of {@link Mono}.
+ * @return policy governing how jobs are distributed to workers along with {@link Response} on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
@@ -369,28 +349,14 @@ public Mono> getDistributionPolicyWithResponse(String distr
/**
* Retrieves existing distribution policies.
- *
- * Query Parameters
- *
+ * Query Parameters
*
- * Query Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * maxpagesize
- * Integer
- * No
- * Number of objects to return per page.
- *
+ * Query Parameters
+ * Name Type Required Description
+ * maxpagesize Integer No Number of objects to return per page.
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -398,6 +364,7 @@ public Mono> getDistributionPolicyWithResponse(String distr
* name: String (Optional)
* offerExpiresAfterSeconds: Double (Optional)
* mode (Optional): {
+ * kind: String(bestWorker/longestIdle/roundRobin) (Optional)
* minConcurrentOffers: Integer (Optional)
* maxConcurrentOffers: Integer (Optional)
* bypassSelectors: Boolean (Optional)
@@ -438,34 +405,15 @@ public Mono> deleteDistributionPolicyWithResponse(String distribu
/**
* Creates or updates a classification policy.
- *
- * Header Parameters
- *
+ * Header Parameters
*
- * Header Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * If-Match
- * String
- * No
- * The request should only proceed if an entity matches this string.
- *
- *
- * If-Unmodified-Since
- * OffsetDateTime
- * No
- * The request should only proceed if the entity was not modified after this time.
- *
+ * Header Parameters
+ * Name Type Required Description
+ * If-Match String No The request should only proceed if an entity matches this string.
+ * If-Unmodified-Since OffsetDateTime No The request should only proceed if the entity was not modified after this time.
*
* You can add these to a request with {@link RequestOptions#addHeader}
- *
- * Request Body Schema
- *
+ * Request Body Schema
* {@code
* {
* etag: String (Required)
@@ -474,19 +422,20 @@ public Mono> deleteDistributionPolicyWithResponse(String distribu
* fallbackQueueId: String (Optional)
* queueSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* prioritizationRule (Optional): {
+ * kind: String(directMap/expression/function/static/webhook) (Optional)
* }
* workerSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* }
* }
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -495,12 +444,15 @@ public Mono> deleteDistributionPolicyWithResponse(String distribu
* fallbackQueueId: String (Optional)
* queueSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* prioritizationRule (Optional): {
+ * kind: String(directMap/expression/function/static/webhook) (Optional)
* }
* workerSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* }
@@ -513,15 +465,12 @@ public Mono> deleteDistributionPolicyWithResponse(String distribu
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return a container for the rules that govern how jobs are classified along with {@link Response} on successful
- * completion of {@link Mono}.
+ * @return a container for the rules that govern how jobs are classified along with {@link Response} on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
Mono> upsertClassificationPolicyWithResponse(String classificationPolicyId,
BinaryData resource, RequestOptions requestOptions) {
- // Convenience API is not generated, as operation 'upsertClassificationPolicy' is 'application/merge-patch+json'
- // and stream-style-serialization is not enabled
return this.serviceClient.upsertClassificationPolicyWithResponseAsync(classificationPolicyId, resource,
requestOptions);
}
@@ -740,9 +689,7 @@ public Mono updateClassificationPolicy(String classificationPolicyId
/**
* Retrieves an existing classification policy by Id.
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -751,12 +698,15 @@ public Mono updateClassificationPolicy(String classificationPolicyId
* fallbackQueueId: String (Optional)
* queueSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* prioritizationRule (Optional): {
+ * kind: String(directMap/expression/function/static/webhook) (Optional)
* }
* workerSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* }
@@ -768,8 +718,7 @@ public Mono updateClassificationPolicy(String classificationPolicyId
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return a container for the rules that govern how jobs are classified along with {@link Response} on successful
- * completion of {@link Mono}.
+ * @return a container for the rules that govern how jobs are classified along with {@link Response} on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
@@ -780,28 +729,14 @@ public Mono> getClassificationPolicyWithResponse(String cla
/**
* Retrieves existing classification policies.
- *
- * Query Parameters
- *
+ * Query Parameters
*
- * Query Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * maxpagesize
- * Integer
- * No
- * Number of objects to return per page.
- *
+ * Query Parameters
+ * Name Type Required Description
+ * maxpagesize Integer No Number of objects to return per page.
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -810,12 +745,15 @@ public Mono> getClassificationPolicyWithResponse(String cla
* fallbackQueueId: String (Optional)
* queueSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* prioritizationRule (Optional): {
+ * kind: String(directMap/expression/function/static/webhook) (Optional)
* }
* workerSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* }
@@ -854,34 +792,15 @@ public Mono> deleteClassificationPolicyWithResponse(String classi
/**
* Creates or updates a exception policy.
- *
- * Header Parameters
- *
+ * Header Parameters
*
- * Header Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * If-Match
- * String
- * No
- * The request should only proceed if an entity matches this string.
- *
- *
- * If-Unmodified-Since
- * OffsetDateTime
- * No
- * The request should only proceed if the entity was not modified after this time.
- *
+ * Header Parameters
+ * Name Type Required Description
+ * If-Match String No The request should only proceed if an entity matches this string.
+ * If-Unmodified-Since OffsetDateTime No The request should only proceed if the entity was not modified after this time.
*
* You can add these to a request with {@link RequestOptions#addHeader}
- *
- * Request Body Schema
- *
+ * Request Body Schema
* {@code
* {
* etag: String (Required)
@@ -889,11 +808,13 @@ public Mono> deleteClassificationPolicyWithResponse(String classi
* name: String (Optional)
* exceptionRules (Optional): [
* (Optional){
- * id: String (Required)
- * trigger (Required): {
+ * id: String (Optional, Required on create)
+ * trigger (Optional, Required on create): {
+ * kind: String(queueLength/waitTime) (Optional)
* }
- * actions (Required): [
- * (Required){
+ * actions (Optional, Required on create): [
+ * (Optional, Required on create){
+ * kind: String(cancel/manualReclassify/reclassify) (Optional)
* id: String (Optional)
* }
* ]
@@ -901,9 +822,7 @@ public Mono> deleteClassificationPolicyWithResponse(String classi
* ]
* }
* }
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -911,11 +830,13 @@ public Mono> deleteClassificationPolicyWithResponse(String classi
* name: String (Optional)
* exceptionRules (Optional): [
* (Optional){
- * id: String (Required)
- * trigger (Required): {
+ * id: String (Optional, Required on create)
+ * trigger (Optional, Required on create): {
+ * kind: String(queueLength/waitTime) (Optional)
* }
- * actions (Required): [
- * (Required){
+ * actions (Optional, Required on create): [
+ * (Optional, Required on create){
+ * kind: String(cancel/manualReclassify/reclassify) (Optional)
* id: String (Optional)
* }
* ]
@@ -931,15 +852,12 @@ public Mono> deleteClassificationPolicyWithResponse(String classi
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return a policy that defines actions to execute when exception are triggered along with {@link Response} on
- * successful completion of {@link Mono}.
+ * @return a policy that defines actions to execute when exception are triggered along with {@link Response} on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
Mono> upsertExceptionPolicyWithResponse(String exceptionPolicyId, BinaryData resource,
RequestOptions requestOptions) {
- // Convenience API is not generated, as operation 'upsertExceptionPolicy' is 'application/merge-patch+json' and
- // stream-style-serialization is not enabled
return this.serviceClient.upsertExceptionPolicyWithResponseAsync(exceptionPolicyId, resource, requestOptions);
}
@@ -1261,34 +1179,15 @@ public Mono> deleteExceptionPolicyWithResponse(String exceptionPo
/**
* Creates or updates a queue.
- *
- * Header Parameters
- *
+ * Header Parameters
*
- * Header Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * If-Match
- * String
- * No
- * The request should only proceed if an entity matches this string.
- *
- *
- * If-Unmodified-Since
- * OffsetDateTime
- * No
- * The request should only proceed if the entity was not modified after this time.
- *
+ * Header Parameters
+ * Name Type Required Description
+ * If-Match String No The request should only proceed if an entity matches this string.
+ * If-Unmodified-Since OffsetDateTime No The request should only proceed if the entity was not modified after this time.
*
* You can add these to a request with {@link RequestOptions#addHeader}
- *
- * Request Body Schema
- *
+ * Request Body Schema
* {@code
* {
* etag: String (Required)
@@ -1301,9 +1200,7 @@ public Mono> deleteExceptionPolicyWithResponse(String exceptionPo
* exceptionPolicyId: String (Optional)
* }
* }
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -1324,15 +1221,12 @@ public Mono> deleteExceptionPolicyWithResponse(String exceptionPo
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return a queue that can contain jobs to be routed along with {@link Response} on successful completion of
- * {@link Mono}.
+ * @return a queue that can contain jobs to be routed along with {@link Response} on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
Mono> upsertQueueWithResponse(String queueId, BinaryData resource,
RequestOptions requestOptions) {
- // Convenience API is not generated, as operation 'upsertQueue' is 'application/merge-patch+json' and
- // stream-style-serialization is not enabled
return this.serviceClient.upsertQueueWithResponseAsync(queueId, resource, requestOptions);
}
@@ -1522,9 +1416,7 @@ public Mono createQueue(CreateQueueOptions createQueueOptions) {
/**
* Retrieves an existing queue by Id.
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -1544,8 +1436,7 @@ public Mono createQueue(CreateQueueOptions createQueueOptions) {
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return a queue that can contain jobs to be routed along with {@link Response} on successful completion of
- * {@link Mono}.
+ * @return a queue that can contain jobs to be routed along with {@link Response} on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
@@ -1555,28 +1446,14 @@ public Mono> getQueueWithResponse(String queueId, RequestOp
/**
* Retrieves existing queues.
- *
- * Query Parameters
- *
+ * Query Parameters
*
- * Query Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * maxpagesize
- * Integer
- * No
- * Number of objects to return per page.
- *
+ * Query Parameters
+ * Name Type Required Description
+ * maxpagesize Integer No Number of objects to return per page.
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -1656,11 +1533,13 @@ public PagedFlux listDistributionPolicies() {
RequestOptions requestOptions = new RequestOptions();
PagedFlux pagedFluxResponse = listDistributionPolicies(requestOptions);
return PagedFlux.create(() -> (continuationToken, pageSize) -> {
- Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
+ Flux> flux = (continuationToken == null)
+ ? pagedFluxResponse.byPage().take(1)
: pagedFluxResponse.byPage(continuationToken).take(1);
return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
- pagedResponse.getValue().stream()
+ pagedResponse.getValue()
+ .stream()
.map(protocolMethodData -> protocolMethodData.toObject(DistributionPolicy.class))
.collect(Collectors.toList()),
pagedResponse.getContinuationToken(), null));
@@ -1723,12 +1602,14 @@ public PagedFlux listClassificationPolicies() {
RequestOptions requestOptions = new RequestOptions();
PagedFlux pagedFluxResponse = listClassificationPolicies(requestOptions);
return PagedFlux.create(() -> (continuationToken, pageSize) -> {
- Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
+ Flux> flux = (continuationToken == null)
+ ? pagedFluxResponse.byPage().take(1)
: pagedFluxResponse.byPage(continuationToken).take(1);
return flux
.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
- pagedResponse.getValue().stream()
+ pagedResponse.getValue()
+ .stream()
.map(protocolMethodData -> protocolMethodData.toObject(ClassificationPolicy.class))
.collect(Collectors.toList()),
pagedResponse.getContinuationToken(), null));
@@ -1792,11 +1673,13 @@ public PagedFlux listExceptionPolicies() {
RequestOptions requestOptions = new RequestOptions();
PagedFlux pagedFluxResponse = listExceptionPolicies(requestOptions);
return PagedFlux.create(() -> (continuationToken, pageSize) -> {
- Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
+ Flux> flux = (continuationToken == null)
+ ? pagedFluxResponse.byPage().take(1)
: pagedFluxResponse.byPage(continuationToken).take(1);
return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
- pagedResponse.getValue().stream()
+ pagedResponse.getValue()
+ .stream()
.map(protocolMethodData -> protocolMethodData.toObject(ExceptionPolicy.class))
.collect(Collectors.toList()),
pagedResponse.getContinuationToken(), null));
@@ -1859,11 +1742,13 @@ public PagedFlux listQueues() {
RequestOptions requestOptions = new RequestOptions();
PagedFlux pagedFluxResponse = listQueues(requestOptions);
return PagedFlux.create(() -> (continuationToken, pageSize) -> {
- Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
+ Flux> flux = (continuationToken == null)
+ ? pagedFluxResponse.byPage().take(1)
: pagedFluxResponse.byPage(continuationToken).take(1);
return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
- pagedResponse.getValue().stream()
+ pagedResponse.getValue()
+ .stream()
.map(protocolMethodData -> protocolMethodData.toObject(RouterQueue.class))
.collect(Collectors.toList()),
pagedResponse.getContinuationToken(), null));
@@ -1889,4 +1774,252 @@ public Mono deleteQueue(String queueId) {
RequestOptions requestOptions = new RequestOptions();
return deleteQueueWithResponse(queueId, requestOptions).flatMap(FluxUtil::toMono);
}
+
+ /**
+ * Creates or updates a distribution policy.
+ *
+ * @param distributionPolicyId Id of a distribution policy.
+ * @param resource The resource instance.
+ * @param ifMatch The request should only proceed if an entity matches this string.
+ * @param ifUnmodifiedSince The request should only proceed if the entity was not modified after this time.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return policy governing how jobs are distributed to workers on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Mono upsertDistributionPolicy(String distributionPolicyId,
+ DistributionPolicyInternal resource, String ifMatch, OffsetDateTime ifUnmodifiedSince) {
+ // Generated convenience method for upsertDistributionPolicyWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ if (ifMatch != null) {
+ requestOptions.setHeader(HttpHeaderName.IF_MATCH, ifMatch);
+ }
+ if (ifUnmodifiedSince != null) {
+ requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE,
+ String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince)));
+ }
+ JsonMergePatchHelper.getDistributionPolicyInternalAccessor().prepareModelForJsonMergePatch(resource, true);
+ BinaryData resourceInBinaryData = BinaryData.fromBytes(BinaryData.fromObject(resource).toBytes());
+ JsonMergePatchHelper.getDistributionPolicyInternalAccessor().prepareModelForJsonMergePatch(resource, false);
+ return upsertDistributionPolicyWithResponse(distributionPolicyId, resourceInBinaryData, requestOptions)
+ .flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(DistributionPolicyInternal.class));
+ }
+
+ /**
+ * Creates or updates a distribution policy.
+ *
+ * @param distributionPolicyId Id of a distribution policy.
+ * @param resource The resource instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return policy governing how jobs are distributed to workers on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Mono upsertDistributionPolicy(String distributionPolicyId,
+ DistributionPolicyInternal resource) {
+ // Generated convenience method for upsertDistributionPolicyWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ JsonMergePatchHelper.getDistributionPolicyInternalAccessor().prepareModelForJsonMergePatch(resource, true);
+ BinaryData resourceInBinaryData = BinaryData.fromBytes(BinaryData.fromObject(resource).toBytes());
+ JsonMergePatchHelper.getDistributionPolicyInternalAccessor().prepareModelForJsonMergePatch(resource, false);
+ return upsertDistributionPolicyWithResponse(distributionPolicyId, resourceInBinaryData, requestOptions)
+ .flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(DistributionPolicyInternal.class));
+ }
+
+ /**
+ * Creates or updates a classification policy.
+ *
+ * @param classificationPolicyId Id of a classification policy.
+ * @param resource The resource instance.
+ * @param ifMatch The request should only proceed if an entity matches this string.
+ * @param ifUnmodifiedSince The request should only proceed if the entity was not modified after this time.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a container for the rules that govern how jobs are classified on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Mono upsertClassificationPolicy(String classificationPolicyId,
+ ClassificationPolicyInternal resource, String ifMatch, OffsetDateTime ifUnmodifiedSince) {
+ // Generated convenience method for upsertClassificationPolicyWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ if (ifMatch != null) {
+ requestOptions.setHeader(HttpHeaderName.IF_MATCH, ifMatch);
+ }
+ if (ifUnmodifiedSince != null) {
+ requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE,
+ String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince)));
+ }
+ JsonMergePatchHelper.getClassificationPolicyInternalAccessor().prepareModelForJsonMergePatch(resource, true);
+ BinaryData resourceInBinaryData = BinaryData.fromBytes(BinaryData.fromObject(resource).toBytes());
+ JsonMergePatchHelper.getClassificationPolicyInternalAccessor().prepareModelForJsonMergePatch(resource, false);
+ return upsertClassificationPolicyWithResponse(classificationPolicyId, resourceInBinaryData, requestOptions)
+ .flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(ClassificationPolicyInternal.class));
+ }
+
+ /**
+ * Creates or updates a classification policy.
+ *
+ * @param classificationPolicyId Id of a classification policy.
+ * @param resource The resource instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a container for the rules that govern how jobs are classified on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Mono upsertClassificationPolicy(String classificationPolicyId,
+ ClassificationPolicyInternal resource) {
+ // Generated convenience method for upsertClassificationPolicyWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ JsonMergePatchHelper.getClassificationPolicyInternalAccessor().prepareModelForJsonMergePatch(resource, true);
+ BinaryData resourceInBinaryData = BinaryData.fromBytes(BinaryData.fromObject(resource).toBytes());
+ JsonMergePatchHelper.getClassificationPolicyInternalAccessor().prepareModelForJsonMergePatch(resource, false);
+ return upsertClassificationPolicyWithResponse(classificationPolicyId, resourceInBinaryData, requestOptions)
+ .flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(ClassificationPolicyInternal.class));
+ }
+
+ /**
+ * Creates or updates a exception policy.
+ *
+ * @param exceptionPolicyId Id of an exception policy.
+ * @param resource The resource instance.
+ * @param ifMatch The request should only proceed if an entity matches this string.
+ * @param ifUnmodifiedSince The request should only proceed if the entity was not modified after this time.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a policy that defines actions to execute when exception are triggered on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Mono upsertExceptionPolicy(String exceptionPolicyId, ExceptionPolicyInternal resource,
+ String ifMatch, OffsetDateTime ifUnmodifiedSince) {
+ // Generated convenience method for upsertExceptionPolicyWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ if (ifMatch != null) {
+ requestOptions.setHeader(HttpHeaderName.IF_MATCH, ifMatch);
+ }
+ if (ifUnmodifiedSince != null) {
+ requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE,
+ String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince)));
+ }
+ JsonMergePatchHelper.getExceptionPolicyInternalAccessor().prepareModelForJsonMergePatch(resource, true);
+ BinaryData resourceInBinaryData = BinaryData.fromBytes(BinaryData.fromObject(resource).toBytes());
+ JsonMergePatchHelper.getExceptionPolicyInternalAccessor().prepareModelForJsonMergePatch(resource, false);
+ return upsertExceptionPolicyWithResponse(exceptionPolicyId, resourceInBinaryData, requestOptions)
+ .flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(ExceptionPolicyInternal.class));
+ }
+
+ /**
+ * Creates or updates a exception policy.
+ *
+ * @param exceptionPolicyId Id of an exception policy.
+ * @param resource The resource instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a policy that defines actions to execute when exception are triggered on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Mono upsertExceptionPolicy(String exceptionPolicyId, ExceptionPolicyInternal resource) {
+ // Generated convenience method for upsertExceptionPolicyWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ JsonMergePatchHelper.getExceptionPolicyInternalAccessor().prepareModelForJsonMergePatch(resource, true);
+ BinaryData resourceInBinaryData = BinaryData.fromBytes(BinaryData.fromObject(resource).toBytes());
+ JsonMergePatchHelper.getExceptionPolicyInternalAccessor().prepareModelForJsonMergePatch(resource, false);
+ return upsertExceptionPolicyWithResponse(exceptionPolicyId, resourceInBinaryData, requestOptions)
+ .flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(ExceptionPolicyInternal.class));
+ }
+
+ /**
+ * Creates or updates a queue.
+ *
+ * @param queueId Id of a queue.
+ * @param resource The resource instance.
+ * @param ifMatch The request should only proceed if an entity matches this string.
+ * @param ifUnmodifiedSince The request should only proceed if the entity was not modified after this time.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a queue that can contain jobs to be routed on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Mono upsertQueue(String queueId, RouterQueueInternal resource, String ifMatch,
+ OffsetDateTime ifUnmodifiedSince) {
+ // Generated convenience method for upsertQueueWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ if (ifMatch != null) {
+ requestOptions.setHeader(HttpHeaderName.IF_MATCH, ifMatch);
+ }
+ if (ifUnmodifiedSince != null) {
+ requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE,
+ String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince)));
+ }
+ JsonMergePatchHelper.getRouterQueueInternalAccessor().prepareModelForJsonMergePatch(resource, true);
+ BinaryData resourceInBinaryData = BinaryData.fromBytes(BinaryData.fromObject(resource).toBytes());
+ JsonMergePatchHelper.getRouterQueueInternalAccessor().prepareModelForJsonMergePatch(resource, false);
+ return upsertQueueWithResponse(queueId, resourceInBinaryData, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(RouterQueueInternal.class));
+ }
+
+ /**
+ * Creates or updates a queue.
+ *
+ * @param queueId Id of a queue.
+ * @param resource The resource instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a queue that can contain jobs to be routed on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Mono upsertQueue(String queueId, RouterQueueInternal resource) {
+ // Generated convenience method for upsertQueueWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ JsonMergePatchHelper.getRouterQueueInternalAccessor().prepareModelForJsonMergePatch(resource, true);
+ BinaryData resourceInBinaryData = BinaryData.fromBytes(BinaryData.fromObject(resource).toBytes());
+ JsonMergePatchHelper.getRouterQueueInternalAccessor().prepareModelForJsonMergePatch(resource, false);
+ return upsertQueueWithResponse(queueId, resourceInBinaryData, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(RouterQueueInternal.class));
+ }
}
diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationClient.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationClient.java
index 441aed1278c5..cafc5de100ba 100644
--- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationClient.java
+++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationClient.java
@@ -4,26 +4,11 @@
package com.azure.communication.jobrouter;
import com.azure.communication.jobrouter.implementation.JobRouterAdministrationClientImpl;
-import com.azure.communication.jobrouter.implementation.accesshelpers.ClassificationPolicyConstructorProxy;
-import com.azure.communication.jobrouter.implementation.accesshelpers.DistributionPolicyConstructorProxy;
-import com.azure.communication.jobrouter.implementation.accesshelpers.ExceptionPolicyConstructorProxy;
-import com.azure.communication.jobrouter.implementation.accesshelpers.RouterQueueConstructorProxy;
-import com.azure.communication.jobrouter.implementation.converters.ClassificationPolicyAdapter;
-import com.azure.communication.jobrouter.implementation.converters.DistributionPolicyAdapter;
-import com.azure.communication.jobrouter.implementation.converters.ExceptionPolicyAdapter;
-import com.azure.communication.jobrouter.implementation.converters.QueueAdapter;
+import com.azure.communication.jobrouter.implementation.JsonMergePatchHelper;
import com.azure.communication.jobrouter.implementation.models.ClassificationPolicyInternal;
import com.azure.communication.jobrouter.implementation.models.DistributionPolicyInternal;
import com.azure.communication.jobrouter.implementation.models.ExceptionPolicyInternal;
import com.azure.communication.jobrouter.implementation.models.RouterQueueInternal;
-import com.azure.communication.jobrouter.models.ClassificationPolicy;
-import com.azure.communication.jobrouter.models.CreateClassificationPolicyOptions;
-import com.azure.communication.jobrouter.models.CreateDistributionPolicyOptions;
-import com.azure.communication.jobrouter.models.CreateExceptionPolicyOptions;
-import com.azure.communication.jobrouter.models.CreateQueueOptions;
-import com.azure.communication.jobrouter.models.DistributionPolicy;
-import com.azure.communication.jobrouter.models.ExceptionPolicy;
-import com.azure.communication.jobrouter.models.RouterQueue;
import com.azure.core.annotation.Generated;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceClient;
@@ -32,11 +17,30 @@
import com.azure.core.exception.HttpResponseException;
import com.azure.core.exception.ResourceModifiedException;
import com.azure.core.exception.ResourceNotFoundException;
+import com.azure.core.http.HttpHeaderName;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.RequestOptions;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.SimpleResponse;
import com.azure.core.util.BinaryData;
+import com.azure.core.util.DateTimeRfc1123;
+import java.time.OffsetDateTime;
+import com.azure.communication.jobrouter.implementation.accesshelpers.ClassificationPolicyConstructorProxy;
+import com.azure.communication.jobrouter.implementation.accesshelpers.DistributionPolicyConstructorProxy;
+import com.azure.communication.jobrouter.implementation.accesshelpers.ExceptionPolicyConstructorProxy;
+import com.azure.communication.jobrouter.implementation.accesshelpers.RouterQueueConstructorProxy;
+import com.azure.communication.jobrouter.implementation.converters.ClassificationPolicyAdapter;
+import com.azure.communication.jobrouter.implementation.converters.DistributionPolicyAdapter;
+import com.azure.communication.jobrouter.implementation.converters.ExceptionPolicyAdapter;
+import com.azure.communication.jobrouter.implementation.converters.QueueAdapter;
+import com.azure.communication.jobrouter.models.ClassificationPolicy;
+import com.azure.communication.jobrouter.models.CreateClassificationPolicyOptions;
+import com.azure.communication.jobrouter.models.CreateDistributionPolicyOptions;
+import com.azure.communication.jobrouter.models.CreateExceptionPolicyOptions;
+import com.azure.communication.jobrouter.models.CreateQueueOptions;
+import com.azure.communication.jobrouter.models.DistributionPolicy;
+import com.azure.communication.jobrouter.models.ExceptionPolicy;
+import com.azure.communication.jobrouter.models.RouterQueue;
/**
* Initializes a new instance of the synchronous JobRouterAdministrationClient type.
@@ -59,34 +63,15 @@ public final class JobRouterAdministrationClient {
/**
* Creates or updates a distribution policy.
- *
- * Header Parameters
- *
+ * Header Parameters
*
- * Header Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * If-Match
- * String
- * No
- * The request should only proceed if an entity matches this string.
- *
- *
- * If-Unmodified-Since
- * OffsetDateTime
- * No
- * The request should only proceed if the entity was not modified after this time.
- *
+ * Header Parameters
+ * Name Type Required Description
+ * If-Match String No The request should only proceed if an entity matches this string.
+ * If-Unmodified-Since OffsetDateTime No The request should only proceed if the entity was not modified after this time.
*
* You can add these to a request with {@link RequestOptions#addHeader}
- *
- * Request Body Schema
- *
+ * Request Body Schema
* {@code
* {
* etag: String (Required)
@@ -94,15 +79,14 @@ public final class JobRouterAdministrationClient {
* name: String (Optional)
* offerExpiresAfterSeconds: Double (Optional)
* mode (Optional): {
+ * kind: String(bestWorker/longestIdle/roundRobin) (Optional)
* minConcurrentOffers: Integer (Optional)
* maxConcurrentOffers: Integer (Optional)
* bypassSelectors: Boolean (Optional)
* }
* }
* }
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -110,6 +94,7 @@ public final class JobRouterAdministrationClient {
* name: String (Optional)
* offerExpiresAfterSeconds: Double (Optional)
* mode (Optional): {
+ * kind: String(bestWorker/longestIdle/roundRobin) (Optional)
* minConcurrentOffers: Integer (Optional)
* maxConcurrentOffers: Integer (Optional)
* bypassSelectors: Boolean (Optional)
@@ -130,8 +115,6 @@ public final class JobRouterAdministrationClient {
@ServiceMethod(returns = ReturnType.SINGLE)
Response upsertDistributionPolicyWithResponse(String distributionPolicyId, BinaryData resource,
RequestOptions requestOptions) {
- // Convenience API is not generated, as operation 'upsertDistributionPolicy' is 'application/merge-patch+json'
- // and stream-style-serialization is not enabled
return this.serviceClient.upsertDistributionPolicyWithResponse(distributionPolicyId, resource, requestOptions);
}
@@ -326,9 +309,7 @@ public Response createDistributionPolicyWithResponse(
/**
* Retrieves an existing distribution policy by Id.
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -336,6 +317,7 @@ public Response createDistributionPolicyWithResponse(
* name: String (Optional)
* offerExpiresAfterSeconds: Double (Optional)
* mode (Optional): {
+ * kind: String(bestWorker/longestIdle/roundRobin) (Optional)
* minConcurrentOffers: Integer (Optional)
* maxConcurrentOffers: Integer (Optional)
* bypassSelectors: Boolean (Optional)
@@ -360,28 +342,14 @@ public Response getDistributionPolicyWithResponse(String distributio
/**
* Retrieves existing distribution policies.
- *
- * Query Parameters
- *
+ * Query Parameters
*
- * Query Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * maxpagesize
- * Integer
- * No
- * Number of objects to return per page.
- *
+ * Query Parameters
+ * Name Type Required Description
+ * maxpagesize Integer No Number of objects to return per page.
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -389,6 +357,7 @@ public Response getDistributionPolicyWithResponse(String distributio
* name: String (Optional)
* offerExpiresAfterSeconds: Double (Optional)
* mode (Optional): {
+ * kind: String(bestWorker/longestIdle/roundRobin) (Optional)
* minConcurrentOffers: Integer (Optional)
* maxConcurrentOffers: Integer (Optional)
* bypassSelectors: Boolean (Optional)
@@ -429,34 +398,15 @@ public Response deleteDistributionPolicyWithResponse(String distributionPo
/**
* Creates or updates a classification policy.
- *
- * Header Parameters
- *
+ * Header Parameters
*
- * Header Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * If-Match
- * String
- * No
- * The request should only proceed if an entity matches this string.
- *
- *
- * If-Unmodified-Since
- * OffsetDateTime
- * No
- * The request should only proceed if the entity was not modified after this time.
- *
+ * Header Parameters
+ * Name Type Required Description
+ * If-Match String No The request should only proceed if an entity matches this string.
+ * If-Unmodified-Since OffsetDateTime No The request should only proceed if the entity was not modified after this time.
*
* You can add these to a request with {@link RequestOptions#addHeader}
- *
- * Request Body Schema
- *
+ * Request Body Schema
* {@code
* {
* etag: String (Required)
@@ -465,19 +415,20 @@ public Response deleteDistributionPolicyWithResponse(String distributionPo
* fallbackQueueId: String (Optional)
* queueSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* prioritizationRule (Optional): {
+ * kind: String(directMap/expression/function/static/webhook) (Optional)
* }
* workerSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* }
* }
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -486,12 +437,15 @@ public Response deleteDistributionPolicyWithResponse(String distributionPo
* fallbackQueueId: String (Optional)
* queueSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* prioritizationRule (Optional): {
+ * kind: String(directMap/expression/function/static/webhook) (Optional)
* }
* workerSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* }
@@ -510,8 +464,6 @@ public Response deleteDistributionPolicyWithResponse(String distributionPo
@ServiceMethod(returns = ReturnType.SINGLE)
Response upsertClassificationPolicyWithResponse(String classificationPolicyId, BinaryData resource,
RequestOptions requestOptions) {
- // Convenience API is not generated, as operation 'upsertClassificationPolicy' is 'application/merge-patch+json'
- // and stream-style-serialization is not enabled
return this.serviceClient.upsertClassificationPolicyWithResponse(classificationPolicyId, resource,
requestOptions);
}
@@ -729,9 +681,7 @@ public Response createClassificationPolicyWithResponse(
/**
* Retrieves an existing classification policy by Id.
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -740,12 +690,15 @@ public Response createClassificationPolicyWithResponse(
* fallbackQueueId: String (Optional)
* queueSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* prioritizationRule (Optional): {
+ * kind: String(directMap/expression/function/static/webhook) (Optional)
* }
* workerSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* }
@@ -768,28 +721,14 @@ public Response getClassificationPolicyWithResponse(String classific
/**
* Retrieves existing classification policies.
- *
- * Query Parameters
- *
+ * Query Parameters
*
- * Query Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * maxpagesize
- * Integer
- * No
- * Number of objects to return per page.
- *
+ * Query Parameters
+ * Name Type Required Description
+ * maxpagesize Integer No Number of objects to return per page.
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -798,12 +737,15 @@ public Response getClassificationPolicyWithResponse(String classific
* fallbackQueueId: String (Optional)
* queueSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* prioritizationRule (Optional): {
+ * kind: String(directMap/expression/function/static/webhook) (Optional)
* }
* workerSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* }
@@ -842,34 +784,15 @@ public Response deleteClassificationPolicyWithResponse(String classificati
/**
* Creates or updates a exception policy.
- *
- * Header Parameters
- *
+ * Header Parameters
*
- * Header Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * If-Match
- * String
- * No
- * The request should only proceed if an entity matches this string.
- *
- *
- * If-Unmodified-Since
- * OffsetDateTime
- * No
- * The request should only proceed if the entity was not modified after this time.
- *
+ * Header Parameters
+ * Name Type Required Description
+ * If-Match String No The request should only proceed if an entity matches this string.
+ * If-Unmodified-Since OffsetDateTime No The request should only proceed if the entity was not modified after this time.
*
* You can add these to a request with {@link RequestOptions#addHeader}
- *
- * Request Body Schema
- *
+ * Request Body Schema
* {@code
* {
* etag: String (Required)
@@ -877,11 +800,13 @@ public Response deleteClassificationPolicyWithResponse(String classificati
* name: String (Optional)
* exceptionRules (Optional): [
* (Optional){
- * id: String (Required)
- * trigger (Required): {
+ * id: String (Optional, Required on create)
+ * trigger (Optional, Required on create): {
+ * kind: String(queueLength/waitTime) (Optional)
* }
- * actions (Required): [
- * (Required){
+ * actions (Optional, Required on create): [
+ * (Optional, Required on create){
+ * kind: String(cancel/manualReclassify/reclassify) (Optional)
* id: String (Optional)
* }
* ]
@@ -889,9 +814,7 @@ public Response deleteClassificationPolicyWithResponse(String classificati
* ]
* }
* }
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -899,11 +822,13 @@ public Response deleteClassificationPolicyWithResponse(String classificati
* name: String (Optional)
* exceptionRules (Optional): [
* (Optional){
- * id: String (Required)
- * trigger (Required): {
+ * id: String (Optional, Required on create)
+ * trigger (Optional, Required on create): {
+ * kind: String(queueLength/waitTime) (Optional)
* }
- * actions (Required): [
- * (Required){
+ * actions (Optional, Required on create): [
+ * (Optional, Required on create){
+ * kind: String(cancel/manualReclassify/reclassify) (Optional)
* id: String (Optional)
* }
* ]
@@ -925,8 +850,6 @@ public Response deleteClassificationPolicyWithResponse(String classificati
@ServiceMethod(returns = ReturnType.SINGLE)
Response upsertExceptionPolicyWithResponse(String exceptionPolicyId, BinaryData resource,
RequestOptions requestOptions) {
- // Convenience API is not generated, as operation 'upsertExceptionPolicy' is 'application/merge-patch+json' and
- // stream-style-serialization is not enabled
return this.serviceClient.upsertExceptionPolicyWithResponse(exceptionPolicyId, resource, requestOptions);
}
@@ -1248,34 +1171,15 @@ public Response deleteExceptionPolicyWithResponse(String exceptionPolicyId
/**
* Creates or updates a queue.
- *
- * Header Parameters
- *
+ * Header Parameters
*
- * Header Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * If-Match
- * String
- * No
- * The request should only proceed if an entity matches this string.
- *
- *
- * If-Unmodified-Since
- * OffsetDateTime
- * No
- * The request should only proceed if the entity was not modified after this time.
- *
+ * Header Parameters
+ * Name Type Required Description
+ * If-Match String No The request should only proceed if an entity matches this string.
+ * If-Unmodified-Since OffsetDateTime No The request should only proceed if the entity was not modified after this time.
*
* You can add these to a request with {@link RequestOptions#addHeader}
- *
- * Request Body Schema
- *
+ * Request Body Schema
* {@code
* {
* etag: String (Required)
@@ -1288,9 +1192,7 @@ public Response deleteExceptionPolicyWithResponse(String exceptionPolicyId
* exceptionPolicyId: String (Optional)
* }
* }
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -1316,8 +1218,6 @@ public Response deleteExceptionPolicyWithResponse(String exceptionPolicyId
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
Response upsertQueueWithResponse(String queueId, BinaryData resource, RequestOptions requestOptions) {
- // Convenience API is not generated, as operation 'upsertQueue' is 'application/merge-patch+json' and
- // stream-style-serialization is not enabled
return this.serviceClient.upsertQueueWithResponse(queueId, resource, requestOptions);
}
@@ -1503,9 +1403,7 @@ public RouterQueue createQueue(CreateQueueOptions createQueueOptions) {
/**
* Retrieves an existing queue by Id.
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -1535,28 +1433,14 @@ public Response getQueueWithResponse(String queueId, RequestOptions
/**
* Retrieves existing queues.
- *
- * Query Parameters
- *
+ * Query Parameters
*
- * Query Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * maxpagesize
- * Integer
- * No
- * Number of objects to return per page.
- *
+ * Query Parameters
+ * Name Type Required Description
+ * maxpagesize Integer No Number of objects to return per page.
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -1826,4 +1710,250 @@ public void deleteQueue(String queueId) {
RequestOptions requestOptions = new RequestOptions();
deleteQueueWithResponse(queueId, requestOptions).getValue();
}
+
+ /**
+ * Creates or updates a distribution policy.
+ *
+ * @param distributionPolicyId Id of a distribution policy.
+ * @param resource The resource instance.
+ * @param ifMatch The request should only proceed if an entity matches this string.
+ * @param ifUnmodifiedSince The request should only proceed if the entity was not modified after this time.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return policy governing how jobs are distributed to workers.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DistributionPolicyInternal upsertDistributionPolicy(String distributionPolicyId,
+ DistributionPolicyInternal resource, String ifMatch, OffsetDateTime ifUnmodifiedSince) {
+ // Generated convenience method for upsertDistributionPolicyWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ if (ifMatch != null) {
+ requestOptions.setHeader(HttpHeaderName.IF_MATCH, ifMatch);
+ }
+ if (ifUnmodifiedSince != null) {
+ requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE,
+ String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince)));
+ }
+ JsonMergePatchHelper.getDistributionPolicyInternalAccessor().prepareModelForJsonMergePatch(resource, true);
+ BinaryData resourceInBinaryData = BinaryData.fromBytes(BinaryData.fromObject(resource).toBytes());
+ JsonMergePatchHelper.getDistributionPolicyInternalAccessor().prepareModelForJsonMergePatch(resource, false);
+ return upsertDistributionPolicyWithResponse(distributionPolicyId, resourceInBinaryData, requestOptions)
+ .getValue()
+ .toObject(DistributionPolicyInternal.class);
+ }
+
+ /**
+ * Creates or updates a distribution policy.
+ *
+ * @param distributionPolicyId Id of a distribution policy.
+ * @param resource The resource instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return policy governing how jobs are distributed to workers.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DistributionPolicyInternal upsertDistributionPolicy(String distributionPolicyId,
+ DistributionPolicyInternal resource) {
+ // Generated convenience method for upsertDistributionPolicyWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ JsonMergePatchHelper.getDistributionPolicyInternalAccessor().prepareModelForJsonMergePatch(resource, true);
+ BinaryData resourceInBinaryData = BinaryData.fromBytes(BinaryData.fromObject(resource).toBytes());
+ JsonMergePatchHelper.getDistributionPolicyInternalAccessor().prepareModelForJsonMergePatch(resource, false);
+ return upsertDistributionPolicyWithResponse(distributionPolicyId, resourceInBinaryData, requestOptions)
+ .getValue()
+ .toObject(DistributionPolicyInternal.class);
+ }
+
+ /**
+ * Creates or updates a classification policy.
+ *
+ * @param classificationPolicyId Id of a classification policy.
+ * @param resource The resource instance.
+ * @param ifMatch The request should only proceed if an entity matches this string.
+ * @param ifUnmodifiedSince The request should only proceed if the entity was not modified after this time.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a container for the rules that govern how jobs are classified.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ClassificationPolicyInternal upsertClassificationPolicy(String classificationPolicyId,
+ ClassificationPolicyInternal resource, String ifMatch, OffsetDateTime ifUnmodifiedSince) {
+ // Generated convenience method for upsertClassificationPolicyWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ if (ifMatch != null) {
+ requestOptions.setHeader(HttpHeaderName.IF_MATCH, ifMatch);
+ }
+ if (ifUnmodifiedSince != null) {
+ requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE,
+ String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince)));
+ }
+ JsonMergePatchHelper.getClassificationPolicyInternalAccessor().prepareModelForJsonMergePatch(resource, true);
+ BinaryData resourceInBinaryData = BinaryData.fromBytes(BinaryData.fromObject(resource).toBytes());
+ JsonMergePatchHelper.getClassificationPolicyInternalAccessor().prepareModelForJsonMergePatch(resource, false);
+ return upsertClassificationPolicyWithResponse(classificationPolicyId, resourceInBinaryData, requestOptions)
+ .getValue()
+ .toObject(ClassificationPolicyInternal.class);
+ }
+
+ /**
+ * Creates or updates a classification policy.
+ *
+ * @param classificationPolicyId Id of a classification policy.
+ * @param resource The resource instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a container for the rules that govern how jobs are classified.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ClassificationPolicyInternal upsertClassificationPolicy(String classificationPolicyId,
+ ClassificationPolicyInternal resource) {
+ // Generated convenience method for upsertClassificationPolicyWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ JsonMergePatchHelper.getClassificationPolicyInternalAccessor().prepareModelForJsonMergePatch(resource, true);
+ BinaryData resourceInBinaryData = BinaryData.fromBytes(BinaryData.fromObject(resource).toBytes());
+ JsonMergePatchHelper.getClassificationPolicyInternalAccessor().prepareModelForJsonMergePatch(resource, false);
+ return upsertClassificationPolicyWithResponse(classificationPolicyId, resourceInBinaryData, requestOptions)
+ .getValue()
+ .toObject(ClassificationPolicyInternal.class);
+ }
+
+ /**
+ * Creates or updates a exception policy.
+ *
+ * @param exceptionPolicyId Id of an exception policy.
+ * @param resource The resource instance.
+ * @param ifMatch The request should only proceed if an entity matches this string.
+ * @param ifUnmodifiedSince The request should only proceed if the entity was not modified after this time.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a policy that defines actions to execute when exception are triggered.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ExceptionPolicyInternal upsertExceptionPolicy(String exceptionPolicyId, ExceptionPolicyInternal resource,
+ String ifMatch, OffsetDateTime ifUnmodifiedSince) {
+ // Generated convenience method for upsertExceptionPolicyWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ if (ifMatch != null) {
+ requestOptions.setHeader(HttpHeaderName.IF_MATCH, ifMatch);
+ }
+ if (ifUnmodifiedSince != null) {
+ requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE,
+ String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince)));
+ }
+ JsonMergePatchHelper.getExceptionPolicyInternalAccessor().prepareModelForJsonMergePatch(resource, true);
+ BinaryData resourceInBinaryData = BinaryData.fromBytes(BinaryData.fromObject(resource).toBytes());
+ JsonMergePatchHelper.getExceptionPolicyInternalAccessor().prepareModelForJsonMergePatch(resource, false);
+ return upsertExceptionPolicyWithResponse(exceptionPolicyId, resourceInBinaryData, requestOptions).getValue()
+ .toObject(ExceptionPolicyInternal.class);
+ }
+
+ /**
+ * Creates or updates a exception policy.
+ *
+ * @param exceptionPolicyId Id of an exception policy.
+ * @param resource The resource instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a policy that defines actions to execute when exception are triggered.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ExceptionPolicyInternal upsertExceptionPolicy(String exceptionPolicyId, ExceptionPolicyInternal resource) {
+ // Generated convenience method for upsertExceptionPolicyWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ JsonMergePatchHelper.getExceptionPolicyInternalAccessor().prepareModelForJsonMergePatch(resource, true);
+ BinaryData resourceInBinaryData = BinaryData.fromBytes(BinaryData.fromObject(resource).toBytes());
+ JsonMergePatchHelper.getExceptionPolicyInternalAccessor().prepareModelForJsonMergePatch(resource, false);
+ return upsertExceptionPolicyWithResponse(exceptionPolicyId, resourceInBinaryData, requestOptions).getValue()
+ .toObject(ExceptionPolicyInternal.class);
+ }
+
+ /**
+ * Creates or updates a queue.
+ *
+ * @param queueId Id of a queue.
+ * @param resource The resource instance.
+ * @param ifMatch The request should only proceed if an entity matches this string.
+ * @param ifUnmodifiedSince The request should only proceed if the entity was not modified after this time.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a queue that can contain jobs to be routed.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ RouterQueueInternal upsertQueue(String queueId, RouterQueueInternal resource, String ifMatch,
+ OffsetDateTime ifUnmodifiedSince) {
+ // Generated convenience method for upsertQueueWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ if (ifMatch != null) {
+ requestOptions.setHeader(HttpHeaderName.IF_MATCH, ifMatch);
+ }
+ if (ifUnmodifiedSince != null) {
+ requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE,
+ String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince)));
+ }
+ JsonMergePatchHelper.getRouterQueueInternalAccessor().prepareModelForJsonMergePatch(resource, true);
+ BinaryData resourceInBinaryData = BinaryData.fromBytes(BinaryData.fromObject(resource).toBytes());
+ JsonMergePatchHelper.getRouterQueueInternalAccessor().prepareModelForJsonMergePatch(resource, false);
+ return upsertQueueWithResponse(queueId, resourceInBinaryData, requestOptions).getValue()
+ .toObject(RouterQueueInternal.class);
+ }
+
+ /**
+ * Creates or updates a queue.
+ *
+ * @param queueId Id of a queue.
+ * @param resource The resource instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a queue that can contain jobs to be routed.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ RouterQueueInternal upsertQueue(String queueId, RouterQueueInternal resource) {
+ // Generated convenience method for upsertQueueWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ JsonMergePatchHelper.getRouterQueueInternalAccessor().prepareModelForJsonMergePatch(resource, true);
+ BinaryData resourceInBinaryData = BinaryData.fromBytes(BinaryData.fromObject(resource).toBytes());
+ JsonMergePatchHelper.getRouterQueueInternalAccessor().prepareModelForJsonMergePatch(resource, false);
+ return upsertQueueWithResponse(queueId, resourceInBinaryData, requestOptions).getValue()
+ .toObject(RouterQueueInternal.class);
+ }
}
diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationClientBuilder.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationClientBuilder.java
index 55d42b11f47d..e3d36ca9ef21 100644
--- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationClientBuilder.java
+++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationClientBuilder.java
@@ -3,18 +3,15 @@
// Code generated by Microsoft (R) TypeSpec Code Generator.
package com.azure.communication.jobrouter;
-import com.azure.communication.common.implementation.CommunicationConnectionString;
+import com.azure.core.client.traits.TokenCredentialTrait;
+import com.azure.core.client.traits.KeyCredentialTrait;
+import com.azure.core.client.traits.ConnectionStringTrait;
import com.azure.communication.jobrouter.implementation.JobRouterAdministrationClientImpl;
import com.azure.core.annotation.Generated;
import com.azure.core.annotation.ServiceClientBuilder;
import com.azure.core.client.traits.ConfigurationTrait;
-import com.azure.core.client.traits.ConnectionStringTrait;
import com.azure.core.client.traits.EndpointTrait;
import com.azure.core.client.traits.HttpTrait;
-import com.azure.core.client.traits.KeyCredentialTrait;
-import com.azure.core.client.traits.TokenCredentialTrait;
-import com.azure.core.credential.KeyCredential;
-import com.azure.core.credential.TokenCredential;
import com.azure.core.http.HttpClient;
import com.azure.core.http.HttpHeaderName;
import com.azure.core.http.HttpHeaders;
@@ -24,8 +21,8 @@
import com.azure.core.http.policy.AddDatePolicy;
import com.azure.core.http.policy.AddHeadersFromContextPolicy;
import com.azure.core.http.policy.AddHeadersPolicy;
-import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
+import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpPipelinePolicy;
import com.azure.core.http.policy.HttpPolicyProviders;
import com.azure.core.http.policy.RequestIdPolicy;
@@ -42,6 +39,9 @@
import java.util.List;
import java.util.Map;
import java.util.Objects;
+import com.azure.communication.common.implementation.CommunicationConnectionString;
+import com.azure.core.credential.KeyCredential;
+import com.azure.core.credential.TokenCredential;
/**
* A builder for creating a new instance of the JobRouterAdministrationClient type.
@@ -265,17 +265,21 @@ private HttpPipeline createHttpPipeline() {
if (headers.getSize() > 0) {
policies.add(new AddHeadersPolicy(headers));
}
- this.pipelinePolicies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
+ this.pipelinePolicies.stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
.forEach(p -> policies.add(p));
HttpPolicyProviders.addBeforeRetryPolicies(policies);
policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy()));
policies.add(new AddDatePolicy());
- this.pipelinePolicies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
+ this.pipelinePolicies.stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
.forEach(p -> policies.add(p));
HttpPolicyProviders.addAfterRetryPolicies(policies);
policies.add(new HttpLoggingPolicy(localHttpLogOptions));
HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0]))
- .httpClient(httpClient).clientOptions(localClientOptions).build();
+ .httpClient(httpClient)
+ .clientOptions(localClientOptions)
+ .build();
return httpPipeline;
}
diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAsyncClient.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAsyncClient.java
index d5e799d9758e..9823fe64d2b2 100644
--- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAsyncClient.java
+++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAsyncClient.java
@@ -4,10 +4,7 @@
package com.azure.communication.jobrouter;
import com.azure.communication.jobrouter.implementation.JobRouterClientImpl;
-import com.azure.communication.jobrouter.implementation.accesshelpers.RouterJobConstructorProxy;
-import com.azure.communication.jobrouter.implementation.accesshelpers.RouterWorkerConstructorProxy;
-import com.azure.communication.jobrouter.implementation.converters.JobAdapter;
-import com.azure.communication.jobrouter.implementation.converters.WorkerAdapter;
+import com.azure.communication.jobrouter.implementation.JsonMergePatchHelper;
import com.azure.communication.jobrouter.implementation.models.CancelJobOptionsInternal;
import com.azure.communication.jobrouter.implementation.models.CancelJobResultInternal;
import com.azure.communication.jobrouter.implementation.models.CloseJobOptionsInternal;
@@ -21,13 +18,8 @@
import com.azure.communication.jobrouter.implementation.models.RouterJobInternal;
import com.azure.communication.jobrouter.implementation.models.RouterWorkerInternal;
import com.azure.communication.jobrouter.models.AcceptJobOfferResult;
-import com.azure.communication.jobrouter.models.CreateJobOptions;
-import com.azure.communication.jobrouter.models.CreateWorkerOptions;
-import com.azure.communication.jobrouter.models.RouterJob;
import com.azure.communication.jobrouter.models.RouterJobPositionDetails;
import com.azure.communication.jobrouter.models.RouterJobStatusSelector;
-import com.azure.communication.jobrouter.models.RouterQueueStatistics;
-import com.azure.communication.jobrouter.models.RouterWorker;
import com.azure.communication.jobrouter.models.RouterWorkerStateSelector;
import com.azure.communication.jobrouter.models.UnassignJobOptions;
import com.azure.communication.jobrouter.models.UnassignJobResult;
@@ -39,6 +31,7 @@
import com.azure.core.exception.HttpResponseException;
import com.azure.core.exception.ResourceModifiedException;
import com.azure.core.exception.ResourceNotFoundException;
+import com.azure.core.http.HttpHeaderName;
import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.PagedResponse;
import com.azure.core.http.rest.PagedResponseBase;
@@ -46,11 +39,21 @@
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.SimpleResponse;
import com.azure.core.util.BinaryData;
+import com.azure.core.util.DateTimeRfc1123;
import com.azure.core.util.FluxUtil;
import java.time.OffsetDateTime;
import java.util.stream.Collectors;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
+import com.azure.communication.jobrouter.implementation.accesshelpers.RouterJobConstructorProxy;
+import com.azure.communication.jobrouter.implementation.accesshelpers.RouterWorkerConstructorProxy;
+import com.azure.communication.jobrouter.implementation.converters.JobAdapter;
+import com.azure.communication.jobrouter.implementation.converters.WorkerAdapter;
+import com.azure.communication.jobrouter.models.CreateJobOptions;
+import com.azure.communication.jobrouter.models.CreateWorkerOptions;
+import com.azure.communication.jobrouter.models.RouterJob;
+import com.azure.communication.jobrouter.models.RouterQueueStatistics;
+import com.azure.communication.jobrouter.models.RouterWorker;
/**
* Initializes a new instance of the asynchronous JobRouterClient type.
@@ -73,34 +76,15 @@ public final class JobRouterAsyncClient {
/**
* Creates or updates a router job.
- *
- * Header Parameters
- *
+ * Header Parameters
*
- * Header Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * If-Match
- * String
- * No
- * The request should only proceed if an entity matches this string.
- *
- *
- * If-Unmodified-Since
- * OffsetDateTime
- * No
- * The request should only proceed if the entity was not modified after this time.
- *
+ * Header Parameters
+ * Name Type Required Description
+ * If-Match String No The request should only proceed if an entity matches this string.
+ * If-Unmodified-Since OffsetDateTime No The request should only proceed if the entity was not modified after this time.
*
* You can add these to a request with {@link RequestOptions#addHeader}
- *
- * Request Body Schema
- *
+ * Request Body Schema
* {@code
* {
* etag: String (Required)
@@ -115,8 +99,8 @@ public final class JobRouterAsyncClient {
* dispositionCode: String (Optional)
* requestedWorkerSelectors (Optional): [
* (Optional){
- * key: String (Required)
- * labelOperator: String(equal/notEqual/lessThan/lessThanOrEqual/greaterThan/greaterThanOrEqual) (Required)
+ * key: String (Optional, Required on create)
+ * labelOperator: String(equal/notEqual/lessThan/lessThanOrEqual/greaterThan/greaterThanOrEqual) (Optional, Required on create)
* value: Object (Optional)
* expiresAfterSeconds: Double (Optional)
* expedite: Boolean (Optional)
@@ -134,7 +118,7 @@ public final class JobRouterAsyncClient {
* String (Required): {
* assignmentId: String (Required)
* workerId: String (Optional)
- * assignedAt: OffsetDateTime (Required)
+ * assignedAt: OffsetDateTime (Optional, Required on create)
* completedAt: OffsetDateTime (Optional)
* closedAt: OffsetDateTime (Optional)
* }
@@ -144,18 +128,17 @@ public final class JobRouterAsyncClient {
* }
* notes (Optional): [
* (Optional){
- * message: String (Required)
+ * message: String (Optional, Required on create)
* addedAt: OffsetDateTime (Optional)
* }
* ]
* scheduledAt: OffsetDateTime (Optional)
* matchingMode (Optional): {
+ * kind: String(queueAndMatch/scheduleAndSuspend/suspend) (Optional)
* }
* }
* }
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -170,8 +153,8 @@ public final class JobRouterAsyncClient {
* dispositionCode: String (Optional)
* requestedWorkerSelectors (Optional): [
* (Optional){
- * key: String (Required)
- * labelOperator: String(equal/notEqual/lessThan/lessThanOrEqual/greaterThan/greaterThanOrEqual) (Required)
+ * key: String (Optional, Required on create)
+ * labelOperator: String(equal/notEqual/lessThan/lessThanOrEqual/greaterThan/greaterThanOrEqual) (Optional, Required on create)
* value: Object (Optional)
* expiresAfterSeconds: Double (Optional)
* expedite: Boolean (Optional)
@@ -189,7 +172,7 @@ public final class JobRouterAsyncClient {
* String (Required): {
* assignmentId: String (Required)
* workerId: String (Optional)
- * assignedAt: OffsetDateTime (Required)
+ * assignedAt: OffsetDateTime (Optional, Required on create)
* completedAt: OffsetDateTime (Optional)
* closedAt: OffsetDateTime (Optional)
* }
@@ -199,12 +182,13 @@ public final class JobRouterAsyncClient {
* }
* notes (Optional): [
* (Optional){
- * message: String (Required)
+ * message: String (Optional, Required on create)
* addedAt: OffsetDateTime (Optional)
* }
* ]
* scheduledAt: OffsetDateTime (Optional)
* matchingMode (Optional): {
+ * kind: String(queueAndMatch/scheduleAndSuspend/suspend) (Optional)
* }
* }
* }
@@ -221,8 +205,6 @@ public final class JobRouterAsyncClient {
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
Mono> upsertJobWithResponse(String jobId, BinaryData resource, RequestOptions requestOptions) {
- // Convenience API is not generated, as operation 'upsertJob' is 'application/merge-patch+json' and
- // stream-style-serialization is not enabled
return this.serviceClient.upsertJobWithResponseAsync(jobId, resource, requestOptions);
}
@@ -554,9 +536,7 @@ public Mono createJob(CreateJobOptions createJobOptions) {
/**
* Retrieves an existing job by Id.
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -571,8 +551,8 @@ public Mono createJob(CreateJobOptions createJobOptions) {
* dispositionCode: String (Optional)
* requestedWorkerSelectors (Optional): [
* (Optional){
- * key: String (Required)
- * labelOperator: String(equal/notEqual/lessThan/lessThanOrEqual/greaterThan/greaterThanOrEqual) (Required)
+ * key: String (Optional, Required on create)
+ * labelOperator: String(equal/notEqual/lessThan/lessThanOrEqual/greaterThan/greaterThanOrEqual) (Optional, Required on create)
* value: Object (Optional)
* expiresAfterSeconds: Double (Optional)
* expedite: Boolean (Optional)
@@ -590,7 +570,7 @@ public Mono createJob(CreateJobOptions createJobOptions) {
* String (Required): {
* assignmentId: String (Required)
* workerId: String (Optional)
- * assignedAt: OffsetDateTime (Required)
+ * assignedAt: OffsetDateTime (Optional, Required on create)
* completedAt: OffsetDateTime (Optional)
* closedAt: OffsetDateTime (Optional)
* }
@@ -600,12 +580,13 @@ public Mono createJob(CreateJobOptions createJobOptions) {
* }
* notes (Optional): [
* (Optional){
- * message: String (Required)
+ * message: String (Optional, Required on create)
* addedAt: OffsetDateTime (Optional)
* }
* ]
* scheduledAt: OffsetDateTime (Optional)
* matchingMode (Optional): {
+ * kind: String(queueAndMatch/scheduleAndSuspend/suspend) (Optional)
* }
* }
* }
@@ -763,67 +744,20 @@ public Mono cancelJob(String jobId, RequestOptions requestOptions) {
/**
* Retrieves list of jobs based on filter parameters.
- *
- * Query Parameters
- *
+ * Query Parameters
*
- * Query Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * maxpagesize
- * Integer
- * No
- * Number of objects to return per page.
- *
- *
- * status
- * String
- * No
- * If specified, filter jobs by status. Allowed values: "all", "pendingClassification", "queued", "assigned",
- * "completed", "closed", "cancelled", "classificationFailed", "created", "pendingSchedule", "scheduled",
- * "scheduleFailed", "waitingForActivation", "active".
- *
- *
- * queueId
- * String
- * No
- * If specified, filter jobs by queue.
- *
- *
- * channelId
- * String
- * No
- * If specified, filter jobs by channel.
- *
- *
- * classificationPolicyId
- * String
- * No
- * If specified, filter jobs by classificationPolicy.
- *
- *
- * scheduledBefore
- * OffsetDateTime
- * No
- * If specified, filter on jobs that was scheduled before or at given timestamp. Range: (-Inf,
- * scheduledBefore].
- *
- *
- * scheduledAfter
- * OffsetDateTime
- * No
- * If specified, filter on jobs that was scheduled at or after given value. Range: [scheduledAfter, +Inf).
- *
+ * Query Parameters
+ * Name Type Required Description
+ * maxpagesize Integer No Number of objects to return per page.
+ * status String No If specified, filter jobs by status. Allowed values: "all", "pendingClassification", "queued", "assigned", "completed", "closed", "cancelled", "classificationFailed", "created", "pendingSchedule", "scheduled", "scheduleFailed", "waitingForActivation", "active".
+ * queueId String No If specified, filter jobs by queue.
+ * channelId String No If specified, filter jobs by channel.
+ * classificationPolicyId String No If specified, filter jobs by classificationPolicy.
+ * scheduledBefore OffsetDateTime No If specified, filter on jobs that was scheduled before or at given timestamp. Range: (-Inf, scheduledBefore].
+ * scheduledAfter OffsetDateTime No If specified, filter on jobs that was scheduled at or after given value. Range: [scheduledAfter, +Inf).
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -838,8 +772,8 @@ public Mono cancelJob(String jobId, RequestOptions requestOptions) {
* dispositionCode: String (Optional)
* requestedWorkerSelectors (Optional): [
* (Optional){
- * key: String (Required)
- * labelOperator: String(equal/notEqual/lessThan/lessThanOrEqual/greaterThan/greaterThanOrEqual) (Required)
+ * key: String (Optional, Required on create)
+ * labelOperator: String(equal/notEqual/lessThan/lessThanOrEqual/greaterThan/greaterThanOrEqual) (Optional, Required on create)
* value: Object (Optional)
* expiresAfterSeconds: Double (Optional)
* expedite: Boolean (Optional)
@@ -857,7 +791,7 @@ public Mono cancelJob(String jobId, RequestOptions requestOptions) {
* String (Required): {
* assignmentId: String (Required)
* workerId: String (Optional)
- * assignedAt: OffsetDateTime (Required)
+ * assignedAt: OffsetDateTime (Optional, Required on create)
* completedAt: OffsetDateTime (Optional)
* closedAt: OffsetDateTime (Optional)
* }
@@ -867,12 +801,13 @@ public Mono cancelJob(String jobId, RequestOptions requestOptions) {
* }
* notes (Optional): [
* (Optional){
- * message: String (Required)
+ * message: String (Optional, Required on create)
* addedAt: OffsetDateTime (Optional)
* }
* ]
* scheduledAt: OffsetDateTime (Optional)
* matchingMode (Optional): {
+ * kind: String(queueAndMatch/scheduleAndSuspend/suspend) (Optional)
* }
* }
* }
@@ -892,9 +827,7 @@ public PagedFlux listJobs(RequestOptions requestOptions) {
/**
* Gets a job's position details.
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* jobId: String (Required)
@@ -921,17 +854,13 @@ public Mono> getQueuePositionWithResponse(String jobId, Req
/**
* Unassign a job.
- *
- * Request Body Schema
- *
+ * Request Body Schema
* {@code
* {
* suspendMatching: Boolean (Optional)
* }
* }
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* jobId: String (Required)
@@ -946,8 +875,7 @@ public Mono> getQueuePositionWithResponse(String jobId, Req
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return response payload after a job has been successfully unassigned along with {@link Response} on successful
- * completion of {@link Mono}.
+ * @return response payload after a job has been successfully unassigned along with {@link Response} on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
@@ -958,9 +886,7 @@ public Mono> unassignJobWithResponse(String jobId, String a
/**
* Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already.
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* assignmentId: String (Required)
@@ -976,8 +902,7 @@ public Mono> unassignJobWithResponse(String jobId, String a
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return response containing ids for the worker, job, and assignment from an accepted offer along with
- * {@link Response} on successful completion of {@link Mono}.
+ * @return response containing ids for the worker, job, and assignment from an accepted offer along with {@link Response} on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
@@ -1052,9 +977,7 @@ public Mono declineJobOffer(String workerId, String offerId, Request
/**
* Retrieves a queue's statistics.
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* queueId: String (Required)
@@ -1082,34 +1005,15 @@ public Mono> getQueueStatisticsWithResponse(String queueId,
/**
* Creates or updates a worker.
- *
- * Header Parameters
- *
+ * Header Parameters
*
- * Header Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * If-Match
- * String
- * No
- * The request should only proceed if an entity matches this string.
- *
- *
- * If-Unmodified-Since
- * OffsetDateTime
- * No
- * The request should only proceed if the entity was not modified after this time.
- *
+ * Header Parameters
+ * Name Type Required Description
+ * If-Match String No The request should only proceed if an entity matches this string.
+ * If-Unmodified-Since OffsetDateTime No The request should only proceed if the entity was not modified after this time.
*
* You can add these to a request with {@link RequestOptions#addHeader}
- *
- * Request Body Schema
- *
+ * Request Body Schema
* {@code
* {
* etag: String (Required)
@@ -1127,26 +1031,26 @@ public Mono> getQueueStatisticsWithResponse(String queueId,
* }
* channels (Optional): [
* (Optional){
- * channelId: String (Required)
- * capacityCostPerJob: int (Required)
+ * channelId: String (Optional, Required on create)
+ * capacityCostPerJob: int (Optional, Required on create)
* maxNumberOfJobs: Integer (Optional)
* }
* ]
* offers (Optional): [
* (Optional){
* offerId: String (Required)
- * jobId: String (Required)
- * capacityCost: int (Required)
+ * jobId: String (Optional, Required on create)
+ * capacityCost: int (Optional, Required on create)
* offeredAt: OffsetDateTime (Optional)
* expiresAt: OffsetDateTime (Optional)
* }
* ]
* assignedJobs (Optional): [
* (Optional){
- * assignmentId: String (Required)
- * jobId: String (Required)
- * capacityCost: int (Required)
- * assignedAt: OffsetDateTime (Required)
+ * assignmentId: String (Optional, Required on create)
+ * jobId: String (Optional, Required on create)
+ * capacityCost: int (Optional, Required on create)
+ * assignedAt: OffsetDateTime (Optional, Required on create)
* }
* ]
* loadRatio: Double (Optional)
@@ -1154,9 +1058,7 @@ public Mono> getQueueStatisticsWithResponse(String queueId,
* maxConcurrentOffers: Integer (Optional)
* }
* }
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -1174,26 +1076,26 @@ public Mono> getQueueStatisticsWithResponse(String queueId,
* }
* channels (Optional): [
* (Optional){
- * channelId: String (Required)
- * capacityCostPerJob: int (Required)
+ * channelId: String (Optional, Required on create)
+ * capacityCostPerJob: int (Optional, Required on create)
* maxNumberOfJobs: Integer (Optional)
* }
* ]
* offers (Optional): [
* (Optional){
* offerId: String (Required)
- * jobId: String (Required)
- * capacityCost: int (Required)
+ * jobId: String (Optional, Required on create)
+ * capacityCost: int (Optional, Required on create)
* offeredAt: OffsetDateTime (Optional)
* expiresAt: OffsetDateTime (Optional)
* }
* ]
* assignedJobs (Optional): [
* (Optional){
- * assignmentId: String (Required)
- * jobId: String (Required)
- * capacityCost: int (Required)
- * assignedAt: OffsetDateTime (Required)
+ * assignmentId: String (Optional, Required on create)
+ * jobId: String (Optional, Required on create)
+ * capacityCost: int (Optional, Required on create)
+ * assignedAt: OffsetDateTime (Optional, Required on create)
* }
* ]
* loadRatio: Double (Optional)
@@ -1215,8 +1117,6 @@ public Mono> getQueueStatisticsWithResponse(String queueId,
@ServiceMethod(returns = ReturnType.SINGLE)
Mono> upsertWorkerWithResponse(String workerId, BinaryData resource,
RequestOptions requestOptions) {
- // Convenience API is not generated, as operation 'upsertWorker' is 'application/merge-patch+json' and
- // stream-style-serialization is not enabled
return this.serviceClient.upsertWorkerWithResponseAsync(workerId, resource, requestOptions);
}
@@ -1526,9 +1426,7 @@ public Mono createWorker(CreateWorkerOptions createWorkerOptions)
/**
* Retrieves an existing worker by Id.
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -1546,26 +1444,26 @@ public Mono createWorker(CreateWorkerOptions createWorkerOptions)
* }
* channels (Optional): [
* (Optional){
- * channelId: String (Required)
- * capacityCostPerJob: int (Required)
+ * channelId: String (Optional, Required on create)
+ * capacityCostPerJob: int (Optional, Required on create)
* maxNumberOfJobs: Integer (Optional)
* }
* ]
* offers (Optional): [
* (Optional){
* offerId: String (Required)
- * jobId: String (Required)
- * capacityCost: int (Required)
+ * jobId: String (Optional, Required on create)
+ * capacityCost: int (Optional, Required on create)
* offeredAt: OffsetDateTime (Optional)
* expiresAt: OffsetDateTime (Optional)
* }
* ]
* assignedJobs (Optional): [
* (Optional){
- * assignmentId: String (Required)
- * jobId: String (Required)
- * capacityCost: int (Required)
- * assignedAt: OffsetDateTime (Required)
+ * assignmentId: String (Optional, Required on create)
+ * jobId: String (Optional, Required on create)
+ * capacityCost: int (Optional, Required on create)
+ * assignedAt: OffsetDateTime (Optional, Required on create)
* }
* ]
* loadRatio: Double (Optional)
@@ -1607,54 +1505,18 @@ public Mono> deleteWorkerWithResponse(String workerId, RequestOpt
/**
* Retrieves existing workers.
- *
- * Query Parameters
- *
+ * Query Parameters
*
- * Query Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * maxpagesize
- * Integer
- * No
- * Number of objects to return per page.
- *
- *
- * state
- * String
- * No
- * If specified, select workers by worker state. Allowed values: "active", "draining", "inactive", "all".
- *
- *
- * channelId
- * String
- * No
- * If specified, select workers who have a channel configuration with this channel.
- *
- *
- * queueId
- * String
- * No
- * If specified, select workers who are assigned to this queue.
- *
- *
- * hasCapacity
- * Boolean
- * No
- * If set to true, select only workers who have capacity for the channel specified by `channelId` or for any
- * channel if `channelId` not specified. If set to false, then will return all workers including workers without any
- * capacity for jobs. Defaults to false.
- *
+ * Query Parameters
+ * Name Type Required Description
+ * maxpagesize Integer No Number of objects to return per page.
+ * state String No If specified, select workers by worker state. Allowed values: "active", "draining", "inactive", "all".
+ * channelId String No If specified, select workers who have a channel configuration with this channel.
+ * queueId String No If specified, select workers who are assigned to this queue.
+ * hasCapacity Boolean No If set to true, select only workers who have capacity for the channel specified by `channelId` or for any channel if `channelId` not specified. If set to false, then will return all workers including workers without any capacity for jobs. Defaults to false.
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -1672,26 +1534,26 @@ public Mono> deleteWorkerWithResponse(String workerId, RequestOpt
* }
* channels (Optional): [
* (Optional){
- * channelId: String (Required)
- * capacityCostPerJob: int (Required)
+ * channelId: String (Optional, Required on create)
+ * capacityCostPerJob: int (Optional, Required on create)
* maxNumberOfJobs: Integer (Optional)
* }
* ]
* offers (Optional): [
* (Optional){
* offerId: String (Required)
- * jobId: String (Required)
- * capacityCost: int (Required)
+ * jobId: String (Optional, Required on create)
+ * capacityCost: int (Optional, Required on create)
* offeredAt: OffsetDateTime (Optional)
* expiresAt: OffsetDateTime (Optional)
* }
* ]
* assignedJobs (Optional): [
* (Optional){
- * assignmentId: String (Required)
- * jobId: String (Required)
- * capacityCost: int (Required)
- * assignedAt: OffsetDateTime (Required)
+ * assignmentId: String (Optional, Required on create)
+ * jobId: String (Optional, Required on create)
+ * capacityCost: int (Optional, Required on create)
+ * assignedAt: OffsetDateTime (Optional, Required on create)
* }
* ]
* loadRatio: Double (Optional)
@@ -1818,11 +1680,13 @@ public PagedFlux listJobs(RouterJobStatusSelector status, String queu
}
PagedFlux pagedFluxResponse = listJobs(requestOptions);
return PagedFlux.create(() -> (continuationToken, pageSize) -> {
- Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
+ Flux> flux = (continuationToken == null)
+ ? pagedFluxResponse.byPage().take(1)
: pagedFluxResponse.byPage(continuationToken).take(1);
return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
- pagedResponse.getValue().stream()
+ pagedResponse.getValue()
+ .stream()
.map(protocolMethodData -> protocolMethodData.toObject(RouterJob.class))
.collect(Collectors.toList()),
pagedResponse.getContinuationToken(), null));
@@ -1845,11 +1709,13 @@ public PagedFlux listJobs() {
RequestOptions requestOptions = new RequestOptions();
PagedFlux pagedFluxResponse = listJobs(requestOptions);
return PagedFlux.create(() -> (continuationToken, pageSize) -> {
- Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
+ Flux> flux = (continuationToken == null)
+ ? pagedFluxResponse.byPage().take(1)
: pagedFluxResponse.byPage(continuationToken).take(1);
return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
- pagedResponse.getValue().stream()
+ pagedResponse.getValue()
+ .stream()
.map(protocolMethodData -> protocolMethodData.toObject(RouterJob.class))
.collect(Collectors.toList()),
pagedResponse.getContinuationToken(), null));
@@ -1910,8 +1776,7 @@ public Mono unassignJob(String jobId, String assignmentId) {
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return response containing ids for the worker, job, and assignment from an accepted offer on successful
- * completion of {@link Mono}.
+ * @return response containing ids for the worker, job, and assignment from an accepted offer on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
@@ -2040,11 +1905,13 @@ public PagedFlux listWorkers(RouterWorkerStateSelector state, Stri
}
PagedFlux pagedFluxResponse = listWorkers(requestOptions);
return PagedFlux.create(() -> (continuationToken, pageSize) -> {
- Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
+ Flux> flux = (continuationToken == null)
+ ? pagedFluxResponse.byPage().take(1)
: pagedFluxResponse.byPage(continuationToken).take(1);
return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
- pagedResponse.getValue().stream()
+ pagedResponse.getValue()
+ .stream()
.map(protocolMethodData -> protocolMethodData.toObject(RouterWorker.class))
.collect(Collectors.toList()),
pagedResponse.getContinuationToken(), null));
@@ -2067,11 +1934,13 @@ public PagedFlux listWorkers() {
RequestOptions requestOptions = new RequestOptions();
PagedFlux pagedFluxResponse = listWorkers(requestOptions);
return PagedFlux.create(() -> (continuationToken, pageSize) -> {
- Flux> flux = (continuationToken == null) ? pagedFluxResponse.byPage().take(1)
+ Flux> flux = (continuationToken == null)
+ ? pagedFluxResponse.byPage().take(1)
: pagedFluxResponse.byPage(continuationToken).take(1);
return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
- pagedResponse.getValue().stream()
+ pagedResponse.getValue()
+ .stream()
.map(protocolMethodData -> protocolMethodData.toObject(RouterWorker.class))
.collect(Collectors.toList()),
pagedResponse.getContinuationToken(), null));
@@ -2427,4 +2296,124 @@ Mono declineJobOffer(String workerId, String offe
return declineJobOfferWithResponse(workerId, offerId, requestOptions).flatMap(FluxUtil::toMono)
.map(protocolMethodData -> protocolMethodData.toObject(DeclineJobOfferResultInternal.class));
}
+
+ /**
+ * Creates or updates a router job.
+ *
+ * @param jobId Id of a job.
+ * @param resource The resource instance.
+ * @param ifMatch The request should only proceed if an entity matches this string.
+ * @param ifUnmodifiedSince The request should only proceed if the entity was not modified after this time.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a unit of work to be routed on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Mono upsertJob(String jobId, RouterJobInternal resource, String ifMatch,
+ OffsetDateTime ifUnmodifiedSince) {
+ // Generated convenience method for upsertJobWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ if (ifMatch != null) {
+ requestOptions.setHeader(HttpHeaderName.IF_MATCH, ifMatch);
+ }
+ if (ifUnmodifiedSince != null) {
+ requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE,
+ String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince)));
+ }
+ JsonMergePatchHelper.getRouterJobInternalAccessor().prepareModelForJsonMergePatch(resource, true);
+ BinaryData resourceInBinaryData = BinaryData.fromBytes(BinaryData.fromObject(resource).toBytes());
+ JsonMergePatchHelper.getRouterJobInternalAccessor().prepareModelForJsonMergePatch(resource, false);
+ return upsertJobWithResponse(jobId, resourceInBinaryData, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(RouterJobInternal.class));
+ }
+
+ /**
+ * Creates or updates a router job.
+ *
+ * @param jobId Id of a job.
+ * @param resource The resource instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a unit of work to be routed on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Mono upsertJob(String jobId, RouterJobInternal resource) {
+ // Generated convenience method for upsertJobWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ JsonMergePatchHelper.getRouterJobInternalAccessor().prepareModelForJsonMergePatch(resource, true);
+ BinaryData resourceInBinaryData = BinaryData.fromBytes(BinaryData.fromObject(resource).toBytes());
+ JsonMergePatchHelper.getRouterJobInternalAccessor().prepareModelForJsonMergePatch(resource, false);
+ return upsertJobWithResponse(jobId, resourceInBinaryData, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(RouterJobInternal.class));
+ }
+
+ /**
+ * Creates or updates a worker.
+ *
+ * @param workerId Id of a worker.
+ * @param resource The resource instance.
+ * @param ifMatch The request should only proceed if an entity matches this string.
+ * @param ifUnmodifiedSince The request should only proceed if the entity was not modified after this time.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an entity for jobs to be routed to on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Mono upsertWorker(String workerId, RouterWorkerInternal resource, String ifMatch,
+ OffsetDateTime ifUnmodifiedSince) {
+ // Generated convenience method for upsertWorkerWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ if (ifMatch != null) {
+ requestOptions.setHeader(HttpHeaderName.IF_MATCH, ifMatch);
+ }
+ if (ifUnmodifiedSince != null) {
+ requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE,
+ String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince)));
+ }
+ JsonMergePatchHelper.getRouterWorkerInternalAccessor().prepareModelForJsonMergePatch(resource, true);
+ BinaryData resourceInBinaryData = BinaryData.fromBytes(BinaryData.fromObject(resource).toBytes());
+ JsonMergePatchHelper.getRouterWorkerInternalAccessor().prepareModelForJsonMergePatch(resource, false);
+ return upsertWorkerWithResponse(workerId, resourceInBinaryData, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(RouterWorkerInternal.class));
+ }
+
+ /**
+ * Creates or updates a worker.
+ *
+ * @param workerId Id of a worker.
+ * @param resource The resource instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an entity for jobs to be routed to on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Mono upsertWorker(String workerId, RouterWorkerInternal resource) {
+ // Generated convenience method for upsertWorkerWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ JsonMergePatchHelper.getRouterWorkerInternalAccessor().prepareModelForJsonMergePatch(resource, true);
+ BinaryData resourceInBinaryData = BinaryData.fromBytes(BinaryData.fromObject(resource).toBytes());
+ JsonMergePatchHelper.getRouterWorkerInternalAccessor().prepareModelForJsonMergePatch(resource, false);
+ return upsertWorkerWithResponse(workerId, resourceInBinaryData, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(RouterWorkerInternal.class));
+ }
}
diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterClient.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterClient.java
index 84fb6a865702..b9d4a7b823ad 100644
--- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterClient.java
+++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterClient.java
@@ -4,10 +4,7 @@
package com.azure.communication.jobrouter;
import com.azure.communication.jobrouter.implementation.JobRouterClientImpl;
-import com.azure.communication.jobrouter.implementation.accesshelpers.RouterJobConstructorProxy;
-import com.azure.communication.jobrouter.implementation.accesshelpers.RouterWorkerConstructorProxy;
-import com.azure.communication.jobrouter.implementation.converters.JobAdapter;
-import com.azure.communication.jobrouter.implementation.converters.WorkerAdapter;
+import com.azure.communication.jobrouter.implementation.JsonMergePatchHelper;
import com.azure.communication.jobrouter.implementation.models.CancelJobOptionsInternal;
import com.azure.communication.jobrouter.implementation.models.CancelJobResultInternal;
import com.azure.communication.jobrouter.implementation.models.CloseJobOptionsInternal;
@@ -21,13 +18,8 @@
import com.azure.communication.jobrouter.implementation.models.RouterJobInternal;
import com.azure.communication.jobrouter.implementation.models.RouterWorkerInternal;
import com.azure.communication.jobrouter.models.AcceptJobOfferResult;
-import com.azure.communication.jobrouter.models.CreateJobOptions;
-import com.azure.communication.jobrouter.models.CreateWorkerOptions;
-import com.azure.communication.jobrouter.models.RouterJob;
import com.azure.communication.jobrouter.models.RouterJobPositionDetails;
import com.azure.communication.jobrouter.models.RouterJobStatusSelector;
-import com.azure.communication.jobrouter.models.RouterQueueStatistics;
-import com.azure.communication.jobrouter.models.RouterWorker;
import com.azure.communication.jobrouter.models.RouterWorkerStateSelector;
import com.azure.communication.jobrouter.models.UnassignJobOptions;
import com.azure.communication.jobrouter.models.UnassignJobResult;
@@ -39,12 +31,23 @@
import com.azure.core.exception.HttpResponseException;
import com.azure.core.exception.ResourceModifiedException;
import com.azure.core.exception.ResourceNotFoundException;
+import com.azure.core.http.HttpHeaderName;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.RequestOptions;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.SimpleResponse;
import com.azure.core.util.BinaryData;
+import com.azure.core.util.DateTimeRfc1123;
import java.time.OffsetDateTime;
+import com.azure.communication.jobrouter.implementation.accesshelpers.RouterJobConstructorProxy;
+import com.azure.communication.jobrouter.implementation.accesshelpers.RouterWorkerConstructorProxy;
+import com.azure.communication.jobrouter.implementation.converters.JobAdapter;
+import com.azure.communication.jobrouter.implementation.converters.WorkerAdapter;
+import com.azure.communication.jobrouter.models.CreateJobOptions;
+import com.azure.communication.jobrouter.models.CreateWorkerOptions;
+import com.azure.communication.jobrouter.models.RouterJob;
+import com.azure.communication.jobrouter.models.RouterQueueStatistics;
+import com.azure.communication.jobrouter.models.RouterWorker;
/**
* Initializes a new instance of the synchronous JobRouterClient type.
@@ -67,34 +70,15 @@ public final class JobRouterClient {
/**
* Creates or updates a router job.
- *
- * Header Parameters
- *
+ * Header Parameters
*
- * Header Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * If-Match
- * String
- * No
- * The request should only proceed if an entity matches this string.
- *
- *
- * If-Unmodified-Since
- * OffsetDateTime
- * No
- * The request should only proceed if the entity was not modified after this time.
- *
+ * Header Parameters
+ * Name Type Required Description
+ * If-Match String No The request should only proceed if an entity matches this string.
+ * If-Unmodified-Since OffsetDateTime No The request should only proceed if the entity was not modified after this time.
*
* You can add these to a request with {@link RequestOptions#addHeader}
- *
- * Request Body Schema
- *
+ * Request Body Schema
* {@code
* {
* etag: String (Required)
@@ -109,8 +93,8 @@ public final class JobRouterClient {
* dispositionCode: String (Optional)
* requestedWorkerSelectors (Optional): [
* (Optional){
- * key: String (Required)
- * labelOperator: String(equal/notEqual/lessThan/lessThanOrEqual/greaterThan/greaterThanOrEqual) (Required)
+ * key: String (Optional, Required on create)
+ * labelOperator: String(equal/notEqual/lessThan/lessThanOrEqual/greaterThan/greaterThanOrEqual) (Optional, Required on create)
* value: Object (Optional)
* expiresAfterSeconds: Double (Optional)
* expedite: Boolean (Optional)
@@ -128,7 +112,7 @@ public final class JobRouterClient {
* String (Required): {
* assignmentId: String (Required)
* workerId: String (Optional)
- * assignedAt: OffsetDateTime (Required)
+ * assignedAt: OffsetDateTime (Optional, Required on create)
* completedAt: OffsetDateTime (Optional)
* closedAt: OffsetDateTime (Optional)
* }
@@ -138,18 +122,17 @@ public final class JobRouterClient {
* }
* notes (Optional): [
* (Optional){
- * message: String (Required)
+ * message: String (Optional, Required on create)
* addedAt: OffsetDateTime (Optional)
* }
* ]
* scheduledAt: OffsetDateTime (Optional)
* matchingMode (Optional): {
+ * kind: String(queueAndMatch/scheduleAndSuspend/suspend) (Optional)
* }
* }
* }
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -164,8 +147,8 @@ public final class JobRouterClient {
* dispositionCode: String (Optional)
* requestedWorkerSelectors (Optional): [
* (Optional){
- * key: String (Required)
- * labelOperator: String(equal/notEqual/lessThan/lessThanOrEqual/greaterThan/greaterThanOrEqual) (Required)
+ * key: String (Optional, Required on create)
+ * labelOperator: String(equal/notEqual/lessThan/lessThanOrEqual/greaterThan/greaterThanOrEqual) (Optional, Required on create)
* value: Object (Optional)
* expiresAfterSeconds: Double (Optional)
* expedite: Boolean (Optional)
@@ -183,7 +166,7 @@ public final class JobRouterClient {
* String (Required): {
* assignmentId: String (Required)
* workerId: String (Optional)
- * assignedAt: OffsetDateTime (Required)
+ * assignedAt: OffsetDateTime (Optional, Required on create)
* completedAt: OffsetDateTime (Optional)
* closedAt: OffsetDateTime (Optional)
* }
@@ -193,12 +176,13 @@ public final class JobRouterClient {
* }
* notes (Optional): [
* (Optional){
- * message: String (Required)
+ * message: String (Optional, Required on create)
* addedAt: OffsetDateTime (Optional)
* }
* ]
* scheduledAt: OffsetDateTime (Optional)
* matchingMode (Optional): {
+ * kind: String(queueAndMatch/scheduleAndSuspend/suspend) (Optional)
* }
* }
* }
@@ -215,8 +199,6 @@ public final class JobRouterClient {
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
Response upsertJobWithResponse(String jobId, BinaryData resource, RequestOptions requestOptions) {
- // Convenience API is not generated, as operation 'upsertJob' is 'application/merge-patch+json' and
- // stream-style-serialization is not enabled
return this.serviceClient.upsertJobWithResponse(jobId, resource, requestOptions);
}
@@ -556,9 +538,7 @@ public RouterJob createJob(CreateJobOptions createJobOptions) {
/**
* Retrieves an existing job by Id.
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -573,8 +553,8 @@ public RouterJob createJob(CreateJobOptions createJobOptions) {
* dispositionCode: String (Optional)
* requestedWorkerSelectors (Optional): [
* (Optional){
- * key: String (Required)
- * labelOperator: String(equal/notEqual/lessThan/lessThanOrEqual/greaterThan/greaterThanOrEqual) (Required)
+ * key: String (Optional, Required on create)
+ * labelOperator: String(equal/notEqual/lessThan/lessThanOrEqual/greaterThan/greaterThanOrEqual) (Optional, Required on create)
* value: Object (Optional)
* expiresAfterSeconds: Double (Optional)
* expedite: Boolean (Optional)
@@ -592,7 +572,7 @@ public RouterJob createJob(CreateJobOptions createJobOptions) {
* String (Required): {
* assignmentId: String (Required)
* workerId: String (Optional)
- * assignedAt: OffsetDateTime (Required)
+ * assignedAt: OffsetDateTime (Optional, Required on create)
* completedAt: OffsetDateTime (Optional)
* closedAt: OffsetDateTime (Optional)
* }
@@ -602,12 +582,13 @@ public RouterJob createJob(CreateJobOptions createJobOptions) {
* }
* notes (Optional): [
* (Optional){
- * message: String (Required)
+ * message: String (Optional, Required on create)
* addedAt: OffsetDateTime (Optional)
* }
* ]
* scheduledAt: OffsetDateTime (Optional)
* matchingMode (Optional): {
+ * kind: String(queueAndMatch/scheduleAndSuspend/suspend) (Optional)
* }
* }
* }
@@ -769,67 +750,20 @@ public BinaryData cancelJob(String jobId, RequestOptions requestOptions) {
/**
* Retrieves list of jobs based on filter parameters.
- *
- * Query Parameters
- *
+ * Query Parameters
*
- * Query Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * maxpagesize
- * Integer
- * No
- * Number of objects to return per page.
- *
- *
- * status
- * String
- * No
- * If specified, filter jobs by status. Allowed values: "all", "pendingClassification", "queued", "assigned",
- * "completed", "closed", "cancelled", "classificationFailed", "created", "pendingSchedule", "scheduled",
- * "scheduleFailed", "waitingForActivation", "active".
- *
- *
- * queueId
- * String
- * No
- * If specified, filter jobs by queue.
- *
- *
- * channelId
- * String
- * No
- * If specified, filter jobs by channel.
- *
- *
- * classificationPolicyId
- * String
- * No
- * If specified, filter jobs by classificationPolicy.
- *
- *
- * scheduledBefore
- * OffsetDateTime
- * No
- * If specified, filter on jobs that was scheduled before or at given timestamp. Range: (-Inf,
- * scheduledBefore].
- *
- *
- * scheduledAfter
- * OffsetDateTime
- * No
- * If specified, filter on jobs that was scheduled at or after given value. Range: [scheduledAfter, +Inf).
- *
+ * Query Parameters
+ * Name Type Required Description
+ * maxpagesize Integer No Number of objects to return per page.
+ * status String No If specified, filter jobs by status. Allowed values: "all", "pendingClassification", "queued", "assigned", "completed", "closed", "cancelled", "classificationFailed", "created", "pendingSchedule", "scheduled", "scheduleFailed", "waitingForActivation", "active".
+ * queueId String No If specified, filter jobs by queue.
+ * channelId String No If specified, filter jobs by channel.
+ * classificationPolicyId String No If specified, filter jobs by classificationPolicy.
+ * scheduledBefore OffsetDateTime No If specified, filter on jobs that was scheduled before or at given timestamp. Range: (-Inf, scheduledBefore].
+ * scheduledAfter OffsetDateTime No If specified, filter on jobs that was scheduled at or after given value. Range: [scheduledAfter, +Inf).
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -844,8 +778,8 @@ public BinaryData cancelJob(String jobId, RequestOptions requestOptions) {
* dispositionCode: String (Optional)
* requestedWorkerSelectors (Optional): [
* (Optional){
- * key: String (Required)
- * labelOperator: String(equal/notEqual/lessThan/lessThanOrEqual/greaterThan/greaterThanOrEqual) (Required)
+ * key: String (Optional, Required on create)
+ * labelOperator: String(equal/notEqual/lessThan/lessThanOrEqual/greaterThan/greaterThanOrEqual) (Optional, Required on create)
* value: Object (Optional)
* expiresAfterSeconds: Double (Optional)
* expedite: Boolean (Optional)
@@ -863,7 +797,7 @@ public BinaryData cancelJob(String jobId, RequestOptions requestOptions) {
* String (Required): {
* assignmentId: String (Required)
* workerId: String (Optional)
- * assignedAt: OffsetDateTime (Required)
+ * assignedAt: OffsetDateTime (Optional, Required on create)
* completedAt: OffsetDateTime (Optional)
* closedAt: OffsetDateTime (Optional)
* }
@@ -873,12 +807,13 @@ public BinaryData cancelJob(String jobId, RequestOptions requestOptions) {
* }
* notes (Optional): [
* (Optional){
- * message: String (Required)
+ * message: String (Optional, Required on create)
* addedAt: OffsetDateTime (Optional)
* }
* ]
* scheduledAt: OffsetDateTime (Optional)
* matchingMode (Optional): {
+ * kind: String(queueAndMatch/scheduleAndSuspend/suspend) (Optional)
* }
* }
* }
@@ -898,9 +833,7 @@ public PagedIterable listJobs(RequestOptions requestOptions) {
/**
* Gets a job's position details.
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* jobId: String (Required)
@@ -927,17 +860,13 @@ public Response getQueuePositionWithResponse(String jobId, RequestOp
/**
* Unassign a job.
- *
- * Request Body Schema
- *
+ * Request Body Schema
* {@code
* {
* suspendMatching: Boolean (Optional)
* }
* }
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* jobId: String (Required)
@@ -963,9 +892,7 @@ public Response unassignJobWithResponse(String jobId, String assignm
/**
* Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already.
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* assignmentId: String (Required)
@@ -981,8 +908,7 @@ public Response unassignJobWithResponse(String jobId, String assignm
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return response containing ids for the worker, job, and assignment from an accepted offer along with
- * {@link Response}.
+ * @return response containing ids for the worker, job, and assignment from an accepted offer along with {@link Response}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
@@ -1058,9 +984,7 @@ public BinaryData declineJobOffer(String workerId, String offerId, RequestOption
/**
* Retrieves a queue's statistics.
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* queueId: String (Required)
@@ -1088,34 +1012,15 @@ public Response getQueueStatisticsWithResponse(String queueId, Reque
/**
* Creates or updates a worker.
- *
- * Header Parameters
- *
+ * Header Parameters
*
- * Header Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * If-Match
- * String
- * No
- * The request should only proceed if an entity matches this string.
- *
- *
- * If-Unmodified-Since
- * OffsetDateTime
- * No
- * The request should only proceed if the entity was not modified after this time.
- *
+ * Header Parameters
+ * Name Type Required Description
+ * If-Match String No The request should only proceed if an entity matches this string.
+ * If-Unmodified-Since OffsetDateTime No The request should only proceed if the entity was not modified after this time.
*
* You can add these to a request with {@link RequestOptions#addHeader}
- *
- * Request Body Schema
- *
+ * Request Body Schema
* {@code
* {
* etag: String (Required)
@@ -1133,26 +1038,26 @@ public Response getQueueStatisticsWithResponse(String queueId, Reque
* }
* channels (Optional): [
* (Optional){
- * channelId: String (Required)
- * capacityCostPerJob: int (Required)
+ * channelId: String (Optional, Required on create)
+ * capacityCostPerJob: int (Optional, Required on create)
* maxNumberOfJobs: Integer (Optional)
* }
* ]
* offers (Optional): [
* (Optional){
* offerId: String (Required)
- * jobId: String (Required)
- * capacityCost: int (Required)
+ * jobId: String (Optional, Required on create)
+ * capacityCost: int (Optional, Required on create)
* offeredAt: OffsetDateTime (Optional)
* expiresAt: OffsetDateTime (Optional)
* }
* ]
* assignedJobs (Optional): [
* (Optional){
- * assignmentId: String (Required)
- * jobId: String (Required)
- * capacityCost: int (Required)
- * assignedAt: OffsetDateTime (Required)
+ * assignmentId: String (Optional, Required on create)
+ * jobId: String (Optional, Required on create)
+ * capacityCost: int (Optional, Required on create)
+ * assignedAt: OffsetDateTime (Optional, Required on create)
* }
* ]
* loadRatio: Double (Optional)
@@ -1160,9 +1065,7 @@ public Response getQueueStatisticsWithResponse(String queueId, Reque
* maxConcurrentOffers: Integer (Optional)
* }
* }
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -1180,26 +1083,26 @@ public Response getQueueStatisticsWithResponse(String queueId, Reque
* }
* channels (Optional): [
* (Optional){
- * channelId: String (Required)
- * capacityCostPerJob: int (Required)
+ * channelId: String (Optional, Required on create)
+ * capacityCostPerJob: int (Optional, Required on create)
* maxNumberOfJobs: Integer (Optional)
* }
* ]
* offers (Optional): [
* (Optional){
* offerId: String (Required)
- * jobId: String (Required)
- * capacityCost: int (Required)
+ * jobId: String (Optional, Required on create)
+ * capacityCost: int (Optional, Required on create)
* offeredAt: OffsetDateTime (Optional)
* expiresAt: OffsetDateTime (Optional)
* }
* ]
* assignedJobs (Optional): [
* (Optional){
- * assignmentId: String (Required)
- * jobId: String (Required)
- * capacityCost: int (Required)
- * assignedAt: OffsetDateTime (Required)
+ * assignmentId: String (Optional, Required on create)
+ * jobId: String (Optional, Required on create)
+ * capacityCost: int (Optional, Required on create)
+ * assignedAt: OffsetDateTime (Optional, Required on create)
* }
* ]
* loadRatio: Double (Optional)
@@ -1220,8 +1123,6 @@ public Response getQueueStatisticsWithResponse(String queueId, Reque
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
Response upsertWorkerWithResponse(String workerId, BinaryData resource, RequestOptions requestOptions) {
- // Convenience API is not generated, as operation 'upsertWorker' is 'application/merge-patch+json' and
- // stream-style-serialization is not enabled
return this.serviceClient.upsertWorkerWithResponse(workerId, resource, requestOptions);
}
@@ -1535,9 +1436,7 @@ public RouterWorker createWorker(CreateWorkerOptions createWorkerOptions) {
/**
* Retrieves an existing worker by Id.
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -1555,26 +1454,26 @@ public RouterWorker createWorker(CreateWorkerOptions createWorkerOptions) {
* }
* channels (Optional): [
* (Optional){
- * channelId: String (Required)
- * capacityCostPerJob: int (Required)
+ * channelId: String (Optional, Required on create)
+ * capacityCostPerJob: int (Optional, Required on create)
* maxNumberOfJobs: Integer (Optional)
* }
* ]
* offers (Optional): [
* (Optional){
* offerId: String (Required)
- * jobId: String (Required)
- * capacityCost: int (Required)
+ * jobId: String (Optional, Required on create)
+ * capacityCost: int (Optional, Required on create)
* offeredAt: OffsetDateTime (Optional)
* expiresAt: OffsetDateTime (Optional)
* }
* ]
* assignedJobs (Optional): [
* (Optional){
- * assignmentId: String (Required)
- * jobId: String (Required)
- * capacityCost: int (Required)
- * assignedAt: OffsetDateTime (Required)
+ * assignmentId: String (Optional, Required on create)
+ * jobId: String (Optional, Required on create)
+ * capacityCost: int (Optional, Required on create)
+ * assignedAt: OffsetDateTime (Optional, Required on create)
* }
* ]
* loadRatio: Double (Optional)
@@ -1616,54 +1515,18 @@ public Response deleteWorkerWithResponse(String workerId, RequestOptions r
/**
* Retrieves existing workers.
- *
- * Query Parameters
- *
+ * Query Parameters
*
- * Query Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * maxpagesize
- * Integer
- * No
- * Number of objects to return per page.
- *
- *
- * state
- * String
- * No
- * If specified, select workers by worker state. Allowed values: "active", "draining", "inactive", "all".
- *
- *
- * channelId
- * String
- * No
- * If specified, select workers who have a channel configuration with this channel.
- *
- *
- * queueId
- * String
- * No
- * If specified, select workers who are assigned to this queue.
- *
- *
- * hasCapacity
- * Boolean
- * No
- * If set to true, select only workers who have capacity for the channel specified by `channelId` or for any
- * channel if `channelId` not specified. If set to false, then will return all workers including workers without any
- * capacity for jobs. Defaults to false.
- *
+ * Query Parameters
+ * Name Type Required Description
+ * maxpagesize Integer No Number of objects to return per page.
+ * state String No If specified, select workers by worker state. Allowed values: "active", "draining", "inactive", "all".
+ * channelId String No If specified, select workers who have a channel configuration with this channel.
+ * queueId String No If specified, select workers who are assigned to this queue.
+ * hasCapacity Boolean No If set to true, select only workers who have capacity for the channel specified by `channelId` or for any channel if `channelId` not specified. If set to false, then will return all workers including workers without any capacity for jobs. Defaults to false.
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -1681,26 +1544,26 @@ public Response deleteWorkerWithResponse(String workerId, RequestOptions r
* }
* channels (Optional): [
* (Optional){
- * channelId: String (Required)
- * capacityCostPerJob: int (Required)
+ * channelId: String (Optional, Required on create)
+ * capacityCostPerJob: int (Optional, Required on create)
* maxNumberOfJobs: Integer (Optional)
* }
* ]
* offers (Optional): [
* (Optional){
* offerId: String (Required)
- * jobId: String (Required)
- * capacityCost: int (Required)
+ * jobId: String (Optional, Required on create)
+ * capacityCost: int (Optional, Required on create)
* offeredAt: OffsetDateTime (Optional)
* expiresAt: OffsetDateTime (Optional)
* }
* ]
* assignedJobs (Optional): [
* (Optional){
- * assignmentId: String (Required)
- * jobId: String (Required)
- * capacityCost: int (Required)
- * assignedAt: OffsetDateTime (Required)
+ * assignmentId: String (Optional, Required on create)
+ * jobId: String (Optional, Required on create)
+ * capacityCost: int (Optional, Required on create)
+ * assignedAt: OffsetDateTime (Optional, Required on create)
* }
* ]
* loadRatio: Double (Optional)
@@ -2389,4 +2252,124 @@ DeclineJobOfferResultInternal declineJobOffer(String workerId, String offerId,
return declineJobOfferWithResponse(workerId, offerId, requestOptions).getValue()
.toObject(DeclineJobOfferResultInternal.class);
}
+
+ /**
+ * Creates or updates a router job.
+ *
+ * @param jobId Id of a job.
+ * @param resource The resource instance.
+ * @param ifMatch The request should only proceed if an entity matches this string.
+ * @param ifUnmodifiedSince The request should only proceed if the entity was not modified after this time.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a unit of work to be routed.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ RouterJobInternal upsertJob(String jobId, RouterJobInternal resource, String ifMatch,
+ OffsetDateTime ifUnmodifiedSince) {
+ // Generated convenience method for upsertJobWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ if (ifMatch != null) {
+ requestOptions.setHeader(HttpHeaderName.IF_MATCH, ifMatch);
+ }
+ if (ifUnmodifiedSince != null) {
+ requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE,
+ String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince)));
+ }
+ JsonMergePatchHelper.getRouterJobInternalAccessor().prepareModelForJsonMergePatch(resource, true);
+ BinaryData resourceInBinaryData = BinaryData.fromBytes(BinaryData.fromObject(resource).toBytes());
+ JsonMergePatchHelper.getRouterJobInternalAccessor().prepareModelForJsonMergePatch(resource, false);
+ return upsertJobWithResponse(jobId, resourceInBinaryData, requestOptions).getValue()
+ .toObject(RouterJobInternal.class);
+ }
+
+ /**
+ * Creates or updates a router job.
+ *
+ * @param jobId Id of a job.
+ * @param resource The resource instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a unit of work to be routed.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ RouterJobInternal upsertJob(String jobId, RouterJobInternal resource) {
+ // Generated convenience method for upsertJobWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ JsonMergePatchHelper.getRouterJobInternalAccessor().prepareModelForJsonMergePatch(resource, true);
+ BinaryData resourceInBinaryData = BinaryData.fromBytes(BinaryData.fromObject(resource).toBytes());
+ JsonMergePatchHelper.getRouterJobInternalAccessor().prepareModelForJsonMergePatch(resource, false);
+ return upsertJobWithResponse(jobId, resourceInBinaryData, requestOptions).getValue()
+ .toObject(RouterJobInternal.class);
+ }
+
+ /**
+ * Creates or updates a worker.
+ *
+ * @param workerId Id of a worker.
+ * @param resource The resource instance.
+ * @param ifMatch The request should only proceed if an entity matches this string.
+ * @param ifUnmodifiedSince The request should only proceed if the entity was not modified after this time.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an entity for jobs to be routed to.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ RouterWorkerInternal upsertWorker(String workerId, RouterWorkerInternal resource, String ifMatch,
+ OffsetDateTime ifUnmodifiedSince) {
+ // Generated convenience method for upsertWorkerWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ if (ifMatch != null) {
+ requestOptions.setHeader(HttpHeaderName.IF_MATCH, ifMatch);
+ }
+ if (ifUnmodifiedSince != null) {
+ requestOptions.setHeader(HttpHeaderName.IF_UNMODIFIED_SINCE,
+ String.valueOf(new DateTimeRfc1123(ifUnmodifiedSince)));
+ }
+ JsonMergePatchHelper.getRouterWorkerInternalAccessor().prepareModelForJsonMergePatch(resource, true);
+ BinaryData resourceInBinaryData = BinaryData.fromBytes(BinaryData.fromObject(resource).toBytes());
+ JsonMergePatchHelper.getRouterWorkerInternalAccessor().prepareModelForJsonMergePatch(resource, false);
+ return upsertWorkerWithResponse(workerId, resourceInBinaryData, requestOptions).getValue()
+ .toObject(RouterWorkerInternal.class);
+ }
+
+ /**
+ * Creates or updates a worker.
+ *
+ * @param workerId Id of a worker.
+ * @param resource The resource instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an entity for jobs to be routed to.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ RouterWorkerInternal upsertWorker(String workerId, RouterWorkerInternal resource) {
+ // Generated convenience method for upsertWorkerWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ JsonMergePatchHelper.getRouterWorkerInternalAccessor().prepareModelForJsonMergePatch(resource, true);
+ BinaryData resourceInBinaryData = BinaryData.fromBytes(BinaryData.fromObject(resource).toBytes());
+ JsonMergePatchHelper.getRouterWorkerInternalAccessor().prepareModelForJsonMergePatch(resource, false);
+ return upsertWorkerWithResponse(workerId, resourceInBinaryData, requestOptions).getValue()
+ .toObject(RouterWorkerInternal.class);
+ }
}
diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterClientBuilder.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterClientBuilder.java
index 1b2ca0cc07a9..dc21bd5288ec 100644
--- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterClientBuilder.java
+++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterClientBuilder.java
@@ -3,18 +3,15 @@
// Code generated by Microsoft (R) TypeSpec Code Generator.
package com.azure.communication.jobrouter;
-import com.azure.communication.common.implementation.CommunicationConnectionString;
+import com.azure.core.client.traits.TokenCredentialTrait;
+import com.azure.core.client.traits.KeyCredentialTrait;
+import com.azure.core.client.traits.ConnectionStringTrait;
import com.azure.communication.jobrouter.implementation.JobRouterClientImpl;
import com.azure.core.annotation.Generated;
import com.azure.core.annotation.ServiceClientBuilder;
import com.azure.core.client.traits.ConfigurationTrait;
-import com.azure.core.client.traits.ConnectionStringTrait;
import com.azure.core.client.traits.EndpointTrait;
import com.azure.core.client.traits.HttpTrait;
-import com.azure.core.client.traits.KeyCredentialTrait;
-import com.azure.core.client.traits.TokenCredentialTrait;
-import com.azure.core.credential.KeyCredential;
-import com.azure.core.credential.TokenCredential;
import com.azure.core.http.HttpClient;
import com.azure.core.http.HttpHeaderName;
import com.azure.core.http.HttpHeaders;
@@ -24,8 +21,8 @@
import com.azure.core.http.policy.AddDatePolicy;
import com.azure.core.http.policy.AddHeadersFromContextPolicy;
import com.azure.core.http.policy.AddHeadersPolicy;
-import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
+import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpPipelinePolicy;
import com.azure.core.http.policy.HttpPolicyProviders;
import com.azure.core.http.policy.RequestIdPolicy;
@@ -42,6 +39,9 @@
import java.util.List;
import java.util.Map;
import java.util.Objects;
+import com.azure.communication.common.implementation.CommunicationConnectionString;
+import com.azure.core.credential.KeyCredential;
+import com.azure.core.credential.TokenCredential;
/**
* A builder for creating a new instance of the JobRouterClient type.
@@ -263,17 +263,21 @@ private HttpPipeline createHttpPipeline() {
if (headers.getSize() > 0) {
policies.add(new AddHeadersPolicy(headers));
}
- this.pipelinePolicies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
+ this.pipelinePolicies.stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
.forEach(p -> policies.add(p));
HttpPolicyProviders.addBeforeRetryPolicies(policies);
policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy()));
policies.add(new AddDatePolicy());
- this.pipelinePolicies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
+ this.pipelinePolicies.stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
.forEach(p -> policies.add(p));
HttpPolicyProviders.addAfterRetryPolicies(policies);
policies.add(new HttpLoggingPolicy(localHttpLogOptions));
HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0]))
- .httpClient(httpClient).clientOptions(localClientOptions).build();
+ .httpClient(httpClient)
+ .clientOptions(localClientOptions)
+ .build();
return httpPipeline;
}
diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterAdministrationClientImpl.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterAdministrationClientImpl.java
index 1ee22ed8e203..174e4d72b182 100644
--- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterAdministrationClientImpl.java
+++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterAdministrationClientImpl.java
@@ -152,8 +152,7 @@ public JobRouterAdministrationClientImpl(HttpPipeline httpPipeline, SerializerAd
}
/**
- * The interface defining all the services for JobRouterAdministrationClient to be used by the proxy service to
- * perform REST calls.
+ * The interface defining all the services for JobRouterAdministrationClient to be used by the proxy service to perform REST calls.
*/
@Host("{endpoint}")
@ServiceInterface(name = "JobRouterAdministrat")
@@ -589,34 +588,15 @@ Response listQueuesNextSync(@PathParam(value = "nextLink", encoded =
/**
* Creates or updates a distribution policy.
- *
- * Header Parameters
- *
+ * Header Parameters
*
- * Header Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * If-Match
- * String
- * No
- * The request should only proceed if an entity matches this string.
- *
- *
- * If-Unmodified-Since
- * OffsetDateTime
- * No
- * The request should only proceed if the entity was not modified after this time.
- *
+ * Header Parameters
+ * Name Type Required Description
+ * If-Match String No The request should only proceed if an entity matches this string.
+ * If-Unmodified-Since OffsetDateTime No The request should only proceed if the entity was not modified after this time.
*
* You can add these to a request with {@link RequestOptions#addHeader}
- *
- * Request Body Schema
- *
+ * Request Body Schema
* {@code
* {
* etag: String (Required)
@@ -624,15 +604,14 @@ Response listQueuesNextSync(@PathParam(value = "nextLink", encoded =
* name: String (Optional)
* offerExpiresAfterSeconds: Double (Optional)
* mode (Optional): {
+ * kind: String(bestWorker/longestIdle/roundRobin) (Optional)
* minConcurrentOffers: Integer (Optional)
* maxConcurrentOffers: Integer (Optional)
* bypassSelectors: Boolean (Optional)
* }
* }
* }
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -640,6 +619,7 @@ Response listQueuesNextSync(@PathParam(value = "nextLink", encoded =
* name: String (Optional)
* offerExpiresAfterSeconds: Double (Optional)
* mode (Optional): {
+ * kind: String(bestWorker/longestIdle/roundRobin) (Optional)
* minConcurrentOffers: Integer (Optional)
* maxConcurrentOffers: Integer (Optional)
* bypassSelectors: Boolean (Optional)
@@ -654,8 +634,7 @@ Response listQueuesNextSync(@PathParam(value = "nextLink", encoded =
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return policy governing how jobs are distributed to workers along with {@link Response} on successful completion
- * of {@link Mono}.
+ * @return policy governing how jobs are distributed to workers along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> upsertDistributionPolicyWithResponseAsync(String distributionPolicyId,
@@ -669,34 +648,15 @@ public Mono> upsertDistributionPolicyWithResponseAsync(Stri
/**
* Creates or updates a distribution policy.
- *
- * Header Parameters
- *
+ * Header Parameters
*
- * Header Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * If-Match
- * String
- * No
- * The request should only proceed if an entity matches this string.
- *
- *
- * If-Unmodified-Since
- * OffsetDateTime
- * No
- * The request should only proceed if the entity was not modified after this time.
- *
+ * Header Parameters
+ * Name Type Required Description
+ * If-Match String No The request should only proceed if an entity matches this string.
+ * If-Unmodified-Since OffsetDateTime No The request should only proceed if the entity was not modified after this time.
*
* You can add these to a request with {@link RequestOptions#addHeader}
- *
- * Request Body Schema
- *
+ * Request Body Schema
* {@code
* {
* etag: String (Required)
@@ -704,15 +664,14 @@ public Mono> upsertDistributionPolicyWithResponseAsync(Stri
* name: String (Optional)
* offerExpiresAfterSeconds: Double (Optional)
* mode (Optional): {
+ * kind: String(bestWorker/longestIdle/roundRobin) (Optional)
* minConcurrentOffers: Integer (Optional)
* maxConcurrentOffers: Integer (Optional)
* bypassSelectors: Boolean (Optional)
* }
* }
* }
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -720,6 +679,7 @@ public Mono> upsertDistributionPolicyWithResponseAsync(Stri
* name: String (Optional)
* offerExpiresAfterSeconds: Double (Optional)
* mode (Optional): {
+ * kind: String(bestWorker/longestIdle/roundRobin) (Optional)
* minConcurrentOffers: Integer (Optional)
* maxConcurrentOffers: Integer (Optional)
* bypassSelectors: Boolean (Optional)
@@ -747,9 +707,7 @@ public Response upsertDistributionPolicyWithResponse(String distribu
/**
* Retrieves an existing distribution policy by Id.
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -757,6 +715,7 @@ public Response upsertDistributionPolicyWithResponse(String distribu
* name: String (Optional)
* offerExpiresAfterSeconds: Double (Optional)
* mode (Optional): {
+ * kind: String(bestWorker/longestIdle/roundRobin) (Optional)
* minConcurrentOffers: Integer (Optional)
* maxConcurrentOffers: Integer (Optional)
* bypassSelectors: Boolean (Optional)
@@ -770,8 +729,7 @@ public Response upsertDistributionPolicyWithResponse(String distribu
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return policy governing how jobs are distributed to workers along with {@link Response} on successful completion
- * of {@link Mono}.
+ * @return policy governing how jobs are distributed to workers along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> getDistributionPolicyWithResponseAsync(String distributionPolicyId,
@@ -783,9 +741,7 @@ public Mono> getDistributionPolicyWithResponseAsync(String
/**
* Retrieves an existing distribution policy by Id.
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -793,6 +749,7 @@ public Mono> getDistributionPolicyWithResponseAsync(String
* name: String (Optional)
* offerExpiresAfterSeconds: Double (Optional)
* mode (Optional): {
+ * kind: String(bestWorker/longestIdle/roundRobin) (Optional)
* minConcurrentOffers: Integer (Optional)
* maxConcurrentOffers: Integer (Optional)
* bypassSelectors: Boolean (Optional)
@@ -818,28 +775,14 @@ public Response getDistributionPolicyWithResponse(String distributio
/**
* Retrieves existing distribution policies.
- *
- * Query Parameters
- *
+ * Query Parameters
*
- * Query Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * maxpagesize
- * Integer
- * No
- * Number of objects to return per page.
- *
+ * Query Parameters
+ * Name Type Required Description
+ * maxpagesize Integer No Number of objects to return per page.
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -847,6 +790,7 @@ public Response getDistributionPolicyWithResponse(String distributio
* name: String (Optional)
* offerExpiresAfterSeconds: Double (Optional)
* mode (Optional): {
+ * kind: String(bestWorker/longestIdle/roundRobin) (Optional)
* minConcurrentOffers: Integer (Optional)
* maxConcurrentOffers: Integer (Optional)
* bypassSelectors: Boolean (Optional)
@@ -859,8 +803,7 @@ public Response getDistributionPolicyWithResponse(String distributio
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return paged collection of DistributionPolicy items along with {@link PagedResponse} on successful completion of
- * {@link Mono}.
+ * @return paged collection of DistributionPolicy items along with {@link PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listDistributionPoliciesSinglePageAsync(RequestOptions requestOptions) {
@@ -874,28 +817,14 @@ private Mono> listDistributionPoliciesSinglePageAsync(
/**
* Retrieves existing distribution policies.
- *
- * Query Parameters
- *
+ * Query Parameters
*
- * Query Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * maxpagesize
- * Integer
- * No
- * Number of objects to return per page.
- *
+ * Query Parameters
+ * Name Type Required Description
+ * maxpagesize Integer No Number of objects to return per page.
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -903,6 +832,7 @@ private Mono> listDistributionPoliciesSinglePageAsync(
* name: String (Optional)
* offerExpiresAfterSeconds: Double (Optional)
* mode (Optional): {
+ * kind: String(bestWorker/longestIdle/roundRobin) (Optional)
* minConcurrentOffers: Integer (Optional)
* maxConcurrentOffers: Integer (Optional)
* bypassSelectors: Boolean (Optional)
@@ -948,28 +878,14 @@ public PagedFlux listDistributionPoliciesAsync(RequestOptions reques
/**
* Retrieves existing distribution policies.
- *
- * Query Parameters
- *
+ * Query Parameters
*
- * Query Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * maxpagesize
- * Integer
- * No
- * Number of objects to return per page.
- *
+ * Query Parameters
+ * Name Type Required Description
+ * maxpagesize Integer No Number of objects to return per page.
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -977,6 +893,7 @@ public PagedFlux listDistributionPoliciesAsync(RequestOptions reques
* name: String (Optional)
* offerExpiresAfterSeconds: Double (Optional)
* mode (Optional): {
+ * kind: String(bestWorker/longestIdle/roundRobin) (Optional)
* minConcurrentOffers: Integer (Optional)
* maxConcurrentOffers: Integer (Optional)
* bypassSelectors: Boolean (Optional)
@@ -1002,28 +919,14 @@ private PagedResponse listDistributionPoliciesSinglePage(RequestOpti
/**
* Retrieves existing distribution policies.
- *
- * Query Parameters
- *
+ * Query Parameters
*
- * Query Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * maxpagesize
- * Integer
- * No
- * Number of objects to return per page.
- *
+ * Query Parameters
+ * Name Type Required Description
+ * maxpagesize Integer No Number of objects to return per page.
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -1031,6 +934,7 @@ private PagedResponse listDistributionPoliciesSinglePage(RequestOpti
* name: String (Optional)
* offerExpiresAfterSeconds: Double (Optional)
* mode (Optional): {
+ * kind: String(bestWorker/longestIdle/roundRobin) (Optional)
* minConcurrentOffers: Integer (Optional)
* maxConcurrentOffers: Integer (Optional)
* bypassSelectors: Boolean (Optional)
@@ -1114,34 +1018,15 @@ public Response deleteDistributionPolicyWithResponse(String distributionPo
/**
* Creates or updates a classification policy.
- *
- * Header Parameters
- *
+ * Header Parameters
*
- * Header Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * If-Match
- * String
- * No
- * The request should only proceed if an entity matches this string.
- *
- *
- * If-Unmodified-Since
- * OffsetDateTime
- * No
- * The request should only proceed if the entity was not modified after this time.
- *
+ * Header Parameters
+ * Name Type Required Description
+ * If-Match String No The request should only proceed if an entity matches this string.
+ * If-Unmodified-Since OffsetDateTime No The request should only proceed if the entity was not modified after this time.
*
* You can add these to a request with {@link RequestOptions#addHeader}
- *
- * Request Body Schema
- *
+ * Request Body Schema
* {@code
* {
* etag: String (Required)
@@ -1150,19 +1035,20 @@ public Response deleteDistributionPolicyWithResponse(String distributionPo
* fallbackQueueId: String (Optional)
* queueSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* prioritizationRule (Optional): {
+ * kind: String(directMap/expression/function/static/webhook) (Optional)
* }
* workerSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* }
* }
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -1171,12 +1057,15 @@ public Response deleteDistributionPolicyWithResponse(String distributionPo
* fallbackQueueId: String (Optional)
* queueSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* prioritizationRule (Optional): {
+ * kind: String(directMap/expression/function/static/webhook) (Optional)
* }
* workerSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* }
@@ -1189,8 +1078,7 @@ public Response deleteDistributionPolicyWithResponse(String distributionPo
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return a container for the rules that govern how jobs are classified along with {@link Response} on successful
- * completion of {@link Mono}.
+ * @return a container for the rules that govern how jobs are classified along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> upsertClassificationPolicyWithResponseAsync(String classificationPolicyId,
@@ -1204,34 +1092,15 @@ public Mono> upsertClassificationPolicyWithResponseAsync(St
/**
* Creates or updates a classification policy.
- *
- * Header Parameters
- *
+ * Header Parameters
*
- * Header Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * If-Match
- * String
- * No
- * The request should only proceed if an entity matches this string.
- *
- *
- * If-Unmodified-Since
- * OffsetDateTime
- * No
- * The request should only proceed if the entity was not modified after this time.
- *
+ * Header Parameters
+ * Name Type Required Description
+ * If-Match String No The request should only proceed if an entity matches this string.
+ * If-Unmodified-Since OffsetDateTime No The request should only proceed if the entity was not modified after this time.
*
* You can add these to a request with {@link RequestOptions#addHeader}
- *
- * Request Body Schema
- *
+ * Request Body Schema
* {@code
* {
* etag: String (Required)
@@ -1240,19 +1109,20 @@ public Mono> upsertClassificationPolicyWithResponseAsync(St
* fallbackQueueId: String (Optional)
* queueSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* prioritizationRule (Optional): {
+ * kind: String(directMap/expression/function/static/webhook) (Optional)
* }
* workerSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* }
* }
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -1261,12 +1131,15 @@ public Mono> upsertClassificationPolicyWithResponseAsync(St
* fallbackQueueId: String (Optional)
* queueSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* prioritizationRule (Optional): {
+ * kind: String(directMap/expression/function/static/webhook) (Optional)
* }
* workerSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* }
@@ -1292,9 +1165,7 @@ public Response upsertClassificationPolicyWithResponse(String classi
/**
* Retrieves an existing classification policy by Id.
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -1303,12 +1174,15 @@ public Response upsertClassificationPolicyWithResponse(String classi
* fallbackQueueId: String (Optional)
* queueSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* prioritizationRule (Optional): {
+ * kind: String(directMap/expression/function/static/webhook) (Optional)
* }
* workerSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* }
@@ -1320,8 +1194,7 @@ public Response upsertClassificationPolicyWithResponse(String classi
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return a container for the rules that govern how jobs are classified along with {@link Response} on successful
- * completion of {@link Mono}.
+ * @return a container for the rules that govern how jobs are classified along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> getClassificationPolicyWithResponseAsync(String classificationPolicyId,
@@ -1333,9 +1206,7 @@ public Mono> getClassificationPolicyWithResponseAsync(Strin
/**
* Retrieves an existing classification policy by Id.
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -1344,12 +1215,15 @@ public Mono> getClassificationPolicyWithResponseAsync(Strin
* fallbackQueueId: String (Optional)
* queueSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* prioritizationRule (Optional): {
+ * kind: String(directMap/expression/function/static/webhook) (Optional)
* }
* workerSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* }
@@ -1373,28 +1247,14 @@ public Response getClassificationPolicyWithResponse(String classific
/**
* Retrieves existing classification policies.
- *
- * Query Parameters
- *
+ * Query Parameters
*
- * Query Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * maxpagesize
- * Integer
- * No
- * Number of objects to return per page.
- *
+ * Query Parameters
+ * Name Type Required Description
+ * maxpagesize Integer No Number of objects to return per page.
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -1403,12 +1263,15 @@ public Response getClassificationPolicyWithResponse(String classific
* fallbackQueueId: String (Optional)
* queueSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* prioritizationRule (Optional): {
+ * kind: String(directMap/expression/function/static/webhook) (Optional)
* }
* workerSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* }
@@ -1419,8 +1282,7 @@ public Response getClassificationPolicyWithResponse(String classific
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return paged collection of ClassificationPolicy items along with {@link PagedResponse} on successful completion
- * of {@link Mono}.
+ * @return paged collection of ClassificationPolicy items along with {@link PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listClassificationPoliciesSinglePageAsync(RequestOptions requestOptions) {
@@ -1434,28 +1296,14 @@ private Mono> listClassificationPoliciesSinglePageAsyn
/**
* Retrieves existing classification policies.
- *
- * Query Parameters
- *
+ * Query Parameters
*
- * Query Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * maxpagesize
- * Integer
- * No
- * Number of objects to return per page.
- *
+ * Query Parameters
+ * Name Type Required Description
+ * maxpagesize Integer No Number of objects to return per page.
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -1464,12 +1312,15 @@ private Mono> listClassificationPoliciesSinglePageAsyn
* fallbackQueueId: String (Optional)
* queueSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* prioritizationRule (Optional): {
+ * kind: String(directMap/expression/function/static/webhook) (Optional)
* }
* workerSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* }
@@ -1513,28 +1364,14 @@ public PagedFlux listClassificationPoliciesAsync(RequestOptions requ
/**
* Retrieves existing classification policies.
- *
- * Query Parameters
- *
+ * Query Parameters
*
- * Query Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * maxpagesize
- * Integer
- * No
- * Number of objects to return per page.
- *
+ * Query Parameters
+ * Name Type Required Description
+ * maxpagesize Integer No Number of objects to return per page.
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -1543,12 +1380,15 @@ public PagedFlux listClassificationPoliciesAsync(RequestOptions requ
* fallbackQueueId: String (Optional)
* queueSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* prioritizationRule (Optional): {
+ * kind: String(directMap/expression/function/static/webhook) (Optional)
* }
* workerSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* }
@@ -1572,28 +1412,14 @@ private PagedResponse listClassificationPoliciesSinglePage(RequestOp
/**
* Retrieves existing classification policies.
- *
- * Query Parameters
- *
+ * Query Parameters
*
- * Query Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * maxpagesize
- * Integer
- * No
- * Number of objects to return per page.
- *
+ * Query Parameters
+ * Name Type Required Description
+ * maxpagesize Integer No Number of objects to return per page.
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -1602,12 +1428,15 @@ private PagedResponse listClassificationPoliciesSinglePage(RequestOp
* fallbackQueueId: String (Optional)
* queueSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* prioritizationRule (Optional): {
+ * kind: String(directMap/expression/function/static/webhook) (Optional)
* }
* workerSelectorAttachments (Optional): [
* (Optional){
+ * kind: String(conditional/passThrough/ruleEngine/static/weightedAllocation) (Optional)
* }
* ]
* }
@@ -1689,34 +1518,15 @@ public Response deleteClassificationPolicyWithResponse(String classificati
/**
* Creates or updates a exception policy.
- *
- * Header Parameters
- *
+ * Header Parameters
*
- * Header Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * If-Match
- * String
- * No
- * The request should only proceed if an entity matches this string.
- *
- *
- * If-Unmodified-Since
- * OffsetDateTime
- * No
- * The request should only proceed if the entity was not modified after this time.
- *
+ * Header Parameters
+ * Name Type Required Description
+ * If-Match String No The request should only proceed if an entity matches this string.
+ * If-Unmodified-Since OffsetDateTime No The request should only proceed if the entity was not modified after this time.
*
* You can add these to a request with {@link RequestOptions#addHeader}
- *
- * Request Body Schema
- *
+ * Request Body Schema
* {@code
* {
* etag: String (Required)
@@ -1724,11 +1534,13 @@ public Response deleteClassificationPolicyWithResponse(String classificati
* name: String (Optional)
* exceptionRules (Optional): [
* (Optional){
- * id: String (Required)
- * trigger (Required): {
+ * id: String (Optional, Required on create)
+ * trigger (Optional, Required on create): {
+ * kind: String(queueLength/waitTime) (Optional)
* }
- * actions (Required): [
- * (Required){
+ * actions (Optional, Required on create): [
+ * (Optional, Required on create){
+ * kind: String(cancel/manualReclassify/reclassify) (Optional)
* id: String (Optional)
* }
* ]
@@ -1736,9 +1548,7 @@ public Response deleteClassificationPolicyWithResponse(String classificati
* ]
* }
* }
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -1746,11 +1556,13 @@ public Response deleteClassificationPolicyWithResponse(String classificati
* name: String (Optional)
* exceptionRules (Optional): [
* (Optional){
- * id: String (Required)
- * trigger (Required): {
+ * id: String (Optional, Required on create)
+ * trigger (Optional, Required on create): {
+ * kind: String(queueLength/waitTime) (Optional)
* }
- * actions (Required): [
- * (Required){
+ * actions (Optional, Required on create): [
+ * (Optional, Required on create){
+ * kind: String(cancel/manualReclassify/reclassify) (Optional)
* id: String (Optional)
* }
* ]
@@ -1766,8 +1578,7 @@ public Response deleteClassificationPolicyWithResponse(String classificati
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return a policy that defines actions to execute when exception are triggered along with {@link Response} on
- * successful completion of {@link Mono}.
+ * @return a policy that defines actions to execute when exception are triggered along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> upsertExceptionPolicyWithResponseAsync(String exceptionPolicyId,
@@ -1781,34 +1592,15 @@ public Mono> upsertExceptionPolicyWithResponseAsync(String
/**
* Creates or updates a exception policy.
- *
- * Header Parameters
- *
+ * Header Parameters
*
- * Header Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * If-Match
- * String
- * No
- * The request should only proceed if an entity matches this string.
- *
- *
- * If-Unmodified-Since
- * OffsetDateTime
- * No
- * The request should only proceed if the entity was not modified after this time.
- *
+ * Header Parameters
+ * Name Type Required Description
+ * If-Match String No The request should only proceed if an entity matches this string.
+ * If-Unmodified-Since OffsetDateTime No The request should only proceed if the entity was not modified after this time.
*
* You can add these to a request with {@link RequestOptions#addHeader}
- *
- * Request Body Schema
- *
+ * Request Body Schema
* {@code
* {
* etag: String (Required)
@@ -1816,11 +1608,13 @@ public Mono> upsertExceptionPolicyWithResponseAsync(String
* name: String (Optional)
* exceptionRules (Optional): [
* (Optional){
- * id: String (Required)
- * trigger (Required): {
+ * id: String (Optional, Required on create)
+ * trigger (Optional, Required on create): {
+ * kind: String(queueLength/waitTime) (Optional)
* }
- * actions (Required): [
- * (Required){
+ * actions (Optional, Required on create): [
+ * (Optional, Required on create){
+ * kind: String(cancel/manualReclassify/reclassify) (Optional)
* id: String (Optional)
* }
* ]
@@ -1828,9 +1622,7 @@ public Mono> upsertExceptionPolicyWithResponseAsync(String
* ]
* }
* }
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -1838,11 +1630,13 @@ public Mono> upsertExceptionPolicyWithResponseAsync(String
* name: String (Optional)
* exceptionRules (Optional): [
* (Optional){
- * id: String (Required)
- * trigger (Required): {
+ * id: String (Optional, Required on create)
+ * trigger (Optional, Required on create): {
+ * kind: String(queueLength/waitTime) (Optional)
* }
- * actions (Required): [
- * (Required){
+ * actions (Optional, Required on create): [
+ * (Optional, Required on create){
+ * kind: String(cancel/manualReclassify/reclassify) (Optional)
* id: String (Optional)
* }
* ]
@@ -1871,9 +1665,7 @@ public Response upsertExceptionPolicyWithResponse(String exceptionPo
/**
* Retrieves an existing exception policy by Id.
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -1881,11 +1673,13 @@ public Response upsertExceptionPolicyWithResponse(String exceptionPo
* name: String (Optional)
* exceptionRules (Optional): [
* (Optional){
- * id: String (Required)
- * trigger (Required): {
+ * id: String (Optional, Required on create)
+ * trigger (Optional, Required on create): {
+ * kind: String(queueLength/waitTime) (Optional)
* }
- * actions (Required): [
- * (Required){
+ * actions (Optional, Required on create): [
+ * (Optional, Required on create){
+ * kind: String(cancel/manualReclassify/reclassify) (Optional)
* id: String (Optional)
* }
* ]
@@ -1900,8 +1694,7 @@ public Response upsertExceptionPolicyWithResponse(String exceptionPo
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return a policy that defines actions to execute when exception are triggered along with {@link Response} on
- * successful completion of {@link Mono}.
+ * @return a policy that defines actions to execute when exception are triggered along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> getExceptionPolicyWithResponseAsync(String exceptionPolicyId,
@@ -1913,9 +1706,7 @@ public Mono> getExceptionPolicyWithResponseAsync(String exc
/**
* Retrieves an existing exception policy by Id.
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -1923,11 +1714,13 @@ public Mono> getExceptionPolicyWithResponseAsync(String exc
* name: String (Optional)
* exceptionRules (Optional): [
* (Optional){
- * id: String (Required)
- * trigger (Required): {
+ * id: String (Optional, Required on create)
+ * trigger (Optional, Required on create): {
+ * kind: String(queueLength/waitTime) (Optional)
* }
- * actions (Required): [
- * (Required){
+ * actions (Optional, Required on create): [
+ * (Optional, Required on create){
+ * kind: String(cancel/manualReclassify/reclassify) (Optional)
* id: String (Optional)
* }
* ]
@@ -1954,28 +1747,14 @@ public Response getExceptionPolicyWithResponse(String exceptionPolic
/**
* Retrieves existing exception policies.
- *
- * Query Parameters
- *
+ * Query Parameters
*
- * Query Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * maxpagesize
- * Integer
- * No
- * Number of objects to return per page.
- *
+ * Query Parameters
+ * Name Type Required Description
+ * maxpagesize Integer No Number of objects to return per page.
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -1983,11 +1762,13 @@ public Response getExceptionPolicyWithResponse(String exceptionPolic
* name: String (Optional)
* exceptionRules (Optional): [
* (Optional){
- * id: String (Required)
- * trigger (Required): {
+ * id: String (Optional, Required on create)
+ * trigger (Optional, Required on create): {
+ * kind: String(queueLength/waitTime) (Optional)
* }
- * actions (Required): [
- * (Required){
+ * actions (Optional, Required on create): [
+ * (Optional, Required on create){
+ * kind: String(cancel/manualReclassify/reclassify) (Optional)
* id: String (Optional)
* }
* ]
@@ -2001,8 +1782,7 @@ public Response getExceptionPolicyWithResponse(String exceptionPolic
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
- * @return paged collection of ExceptionPolicy items along with {@link PagedResponse} on successful completion of
- * {@link Mono}.
+ * @return paged collection of ExceptionPolicy items along with {@link PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listExceptionPoliciesSinglePageAsync(RequestOptions requestOptions) {
@@ -2016,28 +1796,14 @@ private Mono> listExceptionPoliciesSinglePageAsync(Req
/**
* Retrieves existing exception policies.
- *
- * Query Parameters
- *
+ * Query Parameters
*
- * Query Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * maxpagesize
- * Integer
- * No
- * Number of objects to return per page.
- *
+ * Query Parameters
+ * Name Type Required Description
+ * maxpagesize Integer No Number of objects to return per page.
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -2045,11 +1811,13 @@ private Mono> listExceptionPoliciesSinglePageAsync(Req
* name: String (Optional)
* exceptionRules (Optional): [
* (Optional){
- * id: String (Required)
- * trigger (Required): {
+ * id: String (Optional, Required on create)
+ * trigger (Optional, Required on create): {
+ * kind: String(queueLength/waitTime) (Optional)
* }
- * actions (Required): [
- * (Required){
+ * actions (Optional, Required on create): [
+ * (Optional, Required on create){
+ * kind: String(cancel/manualReclassify/reclassify) (Optional)
* id: String (Optional)
* }
* ]
@@ -2096,28 +1864,14 @@ public PagedFlux listExceptionPoliciesAsync(RequestOptions requestOp
/**
* Retrieves existing exception policies.
- *
- * Query Parameters
- *
+ * Query Parameters
*
- * Query Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * maxpagesize
- * Integer
- * No
- * Number of objects to return per page.
- *
+ * Query Parameters
+ * Name Type Required Description
+ * maxpagesize Integer No Number of objects to return per page.
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -2125,11 +1879,13 @@ public PagedFlux listExceptionPoliciesAsync(RequestOptions requestOp
* name: String (Optional)
* exceptionRules (Optional): [
* (Optional){
- * id: String (Required)
- * trigger (Required): {
+ * id: String (Optional, Required on create)
+ * trigger (Optional, Required on create): {
+ * kind: String(queueLength/waitTime) (Optional)
* }
- * actions (Required): [
- * (Required){
+ * actions (Optional, Required on create): [
+ * (Optional, Required on create){
+ * kind: String(cancel/manualReclassify/reclassify) (Optional)
* id: String (Optional)
* }
* ]
@@ -2156,28 +1912,14 @@ private PagedResponse listExceptionPoliciesSinglePage(RequestOptions
/**
* Retrieves existing exception policies.
- *
- * Query Parameters
- *
+ * Query Parameters
*
- * Query Parameters
- *
- * Name
- * Type
- * Required
- * Description
- *
- *
- * maxpagesize
- * Integer
- * No
- * Number of objects to return per page.
- *
+ * Query Parameters
+ * Name Type Required Description
+ * maxpagesize Integer No Number of objects to return per page.
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
- *
- * Response Body Schema
- *
+ * Response Body Schema
* {@code
* {
* etag: String (Required)
@@ -2185,11 +1927,13 @@ private PagedResponse listExceptionPoliciesSinglePage(RequestOptions
* name: String (Optional)
* exceptionRules (Optional): [
* (Optional){
- * id: String (Required)
- * trigger (Required): {
+ * id: String (Optional, Required on create)
+ * trigger (Optional, Required on create): {
+ * kind: String(queueLength/waitTime) (Optional)
* }
- * actions (Required): [
- * (Required){
+ * actions (Optional, Required on create): [
+ * (Optional, Required on create){
+ * kind: String(cancel/manualReclassify/reclassify) (Optional)
* id: String (Optional)
* }
* ]
@@ -2273,34 +2017,15 @@ public Response deleteExceptionPolicyWithResponse(String exceptionPolicyId
/**
* Creates or updates a queue.
- *
- * Header Parameters
- *
+ * Header Parameters
*
- * Header Parameters
- *
- *