diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/AzureCommunicationRoutingServiceVersion.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/AzureCommunicationRoutingServiceVersion.java index 99dfec2bdcc9..dc7efe4ecf36 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/AzureCommunicationRoutingServiceVersion.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/AzureCommunicationRoutingServiceVersion.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter; 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 004461ab4c76..87c65e4b3929 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter; import com.azure.communication.jobrouter.implementation.JobRouterAdministrationClientImpl; @@ -115,6 +115,7 @@ public final class JobRouterAdministrationAsyncClient { @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' return this.serviceClient.upsertDistributionPolicyWithResponseAsync( distributionPolicyId, resource, requestOptions); } @@ -366,6 +367,7 @@ public Mono> deleteDistributionPolicyWithResponse( @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' return this.serviceClient.upsertClassificationPolicyWithResponseAsync( classificationPolicyId, resource, requestOptions); } @@ -658,6 +660,7 @@ public Mono> deleteClassificationPolicyWithResponse( @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' return this.serviceClient.upsertExceptionPolicyWithResponseAsync(exceptionPolicyId, resource, requestOptions); } @@ -915,6 +918,7 @@ public Mono> deleteExceptionPolicyWithResponse( @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' return this.serviceClient.upsertQueueWithResponseAsync(queueId, resource, requestOptions); } 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 db80ae29c85a..41ee272109c7 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter; import com.azure.communication.jobrouter.implementation.JobRouterAdministrationClientImpl; @@ -111,6 +111,7 @@ 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' return this.serviceClient.upsertDistributionPolicyWithResponse(distributionPolicyId, resource, requestOptions); } @@ -375,6 +376,7 @@ public Response deleteDistributionPolicyWithResponse( @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' return this.serviceClient.upsertClassificationPolicyWithResponse( classificationPolicyId, resource, requestOptions); } @@ -483,9 +485,10 @@ public Response createClassificationPolicyWithResponse( public ClassificationPolicy createClassificationPolicy( CreateClassificationPolicyOptions createClassificationPolicyOptions) { RequestOptions requestOptions = new RequestOptions(); - ClassificationPolicyInternal internal = this.createClassificationPolicyWithResponse(createClassificationPolicyOptions, requestOptions) - .getValue() - .toObject(ClassificationPolicyInternal.class); + ClassificationPolicyInternal internal = + this.createClassificationPolicyWithResponse(createClassificationPolicyOptions, requestOptions) + .getValue() + .toObject(ClassificationPolicyInternal.class); return ClassificationPolicyConstructorProxy.create(internal); } @@ -664,6 +667,7 @@ public Response deleteClassificationPolicyWithResponse( @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' return this.serviceClient.upsertExceptionPolicyWithResponse(exceptionPolicyId, resource, requestOptions); } @@ -933,6 +937,7 @@ 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' return this.serviceClient.upsertQueueWithResponse(queueId, resource, requestOptions); } @@ -988,14 +993,18 @@ Response upsertQueueWithResponse(String queueId, BinaryData resource * @return a queue that can contain jobs to be routed along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateQueueWithResponse( - String id, BinaryData resource, RequestOptions requestOptions) { + public Response updateQueueWithResponse(String id, BinaryData resource, RequestOptions requestOptions) { RouterQueue routerQueue = BinaryData.fromObject(resource).toObject(RouterQueue.class); RouterQueueInternal routerQueueInternal = QueueAdapter.convertRouterQueueToRouterQueueInternal(routerQueue); - Response response = this.serviceClient.upsertQueueWithResponse( - id, BinaryData.fromObject(routerQueueInternal), requestOptions); + Response response = + this.serviceClient.upsertQueueWithResponse( + id, BinaryData.fromObject(routerQueueInternal), requestOptions); RouterQueueInternal internal = response.getValue().toObject(RouterQueueInternal.class); - return new SimpleResponse(response.getRequest(), response.getStatusCode(), response.getHeaders(), BinaryData.fromObject(RouterQueueConstructorProxy.create(internal))); + return new SimpleResponse( + response.getRequest(), + response.getStatusCode(), + response.getHeaders(), + BinaryData.fromObject(RouterQueueConstructorProxy.create(internal))); } /** 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 ffd4c6802324..b144b26297c1 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 @@ -1,15 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter; import com.azure.communication.common.implementation.CommunicationConnectionString; 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.AzureKeyCredentialTrait; 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.credential.AzureKeyCredential; @@ -46,9 +44,7 @@ public final class JobRouterAdministrationClientBuilder implements HttpTrait, ConfigurationTrait, - EndpointTrait, - ConnectionStringTrait, - AzureKeyCredentialTrait { + EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -61,6 +57,7 @@ public final class JobRouterAdministrationClientBuilder @Generated private final List pipelinePolicies; private CommunicationConnectionString connectionString; + private AzureKeyCredential credential; /** Create an instance of the JobRouterAdministrationClientBuilder. */ @@ -309,8 +306,7 @@ public JobRouterAdministrationClientBuilder connectionString(String connectionSt */ @Override public JobRouterAdministrationClientBuilder credential(AzureKeyCredential credential) { - this.credential = Objects.requireNonNull( - credential, "'credential' cannot be null."); + this.credential = Objects.requireNonNull(credential, "'credential' cannot be null."); return this; } } 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 69963995984b..716859906486 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 @@ -1,11 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter; import com.azure.communication.jobrouter.implementation.JobRouterClientImpl; import com.azure.communication.jobrouter.implementation.converters.JobAdapter; import com.azure.communication.jobrouter.implementation.converters.WorkerAdapter; +import com.azure.communication.jobrouter.implementation.models.CancelJobOptions; +import com.azure.communication.jobrouter.implementation.models.CancelJobResult; +import com.azure.communication.jobrouter.implementation.models.CloseJobOptions; +import com.azure.communication.jobrouter.implementation.models.CloseJobResult; +import com.azure.communication.jobrouter.implementation.models.CompleteJobOptions; +import com.azure.communication.jobrouter.implementation.models.CompleteJobResult; +import com.azure.communication.jobrouter.implementation.models.DeclineJobOfferOptions; +import com.azure.communication.jobrouter.implementation.models.DeclineJobOfferResult; +import com.azure.communication.jobrouter.implementation.models.ReclassifyJobOptions; +import com.azure.communication.jobrouter.implementation.models.ReclassifyJobResult; import com.azure.communication.jobrouter.implementation.models.RouterJobInternal; import com.azure.communication.jobrouter.implementation.models.RouterWorkerInternal; import com.azure.communication.jobrouter.models.AcceptJobOfferResult; @@ -195,6 +205,7 @@ 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' return this.serviceClient.upsertJobWithResponseAsync(jobId, resource, requestOptions); } @@ -459,105 +470,63 @@ public Mono> deleteJobWithResponse(String jobId, RequestOptions r * *
{@code
      * {
-     *     String: String (Optional)
      * }
      * }
* - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @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. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> reclassifyJobWithResponse(String jobId, RequestOptions requestOptions) { - return this.serviceClient.reclassifyJobWithResponseAsync(jobId, requestOptions); - } - - /** - * Submits request to cancel an existing job by Id while supplying free-form cancellation reason. - * - *

Request Body Schema + *

Response Body Schema * *

{@code
      * {
-     *     note: String (Optional)
-     *     dispositionCode: String (Optional)
      * }
      * }
* - * @param jobId Id of the job. + * @param jobId The id of the job. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @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. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return response payload from reclassifying a job along with {@link Response} on successful completion of {@link + * Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> cancelJobWithResponse(String jobId, RequestOptions requestOptions) { - return this.serviceClient.cancelJobWithResponseAsync(jobId, requestOptions); + Mono> reclassifyJobWithResponse(String jobId, RequestOptions requestOptions) { + return this.serviceClient.reclassifyJobWithResponseAsync(jobId, requestOptions); } /** - * Completes an assigned job. + * Submits request to cancel an existing job by Id while supplying free-form cancellation reason. * *

Request Body Schema * *

{@code
      * {
-     *     assignmentId: String (Required)
      *     note: String (Optional)
+     *     dispositionCode: String (Optional)
      * }
      * }
* - * @param jobId Id of the job. - * @param options Request model for completing job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @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. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> completeJobWithResponse( - String jobId, BinaryData options, RequestOptions requestOptions) { - return this.serviceClient.completeJobWithResponseAsync(jobId, options, requestOptions); - } - - /** - * Closes a completed job. - * - *

Request Body Schema + *

Response Body Schema * *

{@code
      * {
-     *     assignmentId: String (Required)
-     *     dispositionCode: String (Optional)
-     *     closeAt: OffsetDateTime (Optional)
-     *     note: String (Optional)
      * }
      * }
* - * @param jobId Id of the job. - * @param options Request model for closing job. + * @param jobId The id of the job. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @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. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return response payload from cancelling a job along with {@link Response} on successful completion of {@link + * Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> closeJobWithResponse(String jobId, BinaryData options, RequestOptions requestOptions) { - return this.serviceClient.closeJobWithResponseAsync(jobId, options, requestOptions); + Mono> cancelJobWithResponse(String jobId, RequestOptions requestOptions) { + return this.serviceClient.cancelJobWithResponseAsync(jobId, requestOptions); } /** @@ -696,8 +665,8 @@ public Mono> getQueuePositionWithResponse(String jobId, Req * } * } * - * @param jobId Id of the job to un-assign. - * @param assignmentId Id of the assignment to un-assign. + * @param jobId The id of the job. + * @param assignmentId The Id of the job assignment. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -727,7 +696,7 @@ public Mono> unassignJobWithResponse( * } * * @param workerId Id of the worker. - * @param offerId Id of the offer. + * @param offerId The Id of the offer. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -754,18 +723,26 @@ public Mono> acceptJobOfferWithResponse( * } * } * + *

Response Body Schema + * + *

{@code
+     * {
+     * }
+     * }
+ * * @param workerId Id of the worker. - * @param offerId Id of the offer. + * @param offerId The Id of the offer. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @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. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return response payload from declining a job along with {@link Response} on successful completion of {@link + * Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> declineJobOfferWithResponse( + Mono> declineJobOfferWithResponse( String workerId, String offerId, RequestOptions requestOptions) { return this.serviceClient.declineJobOfferWithResponseAsync(workerId, offerId, requestOptions); } @@ -919,6 +896,7 @@ 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' return this.serviceClient.upsertWorkerWithResponseAsync(workerId, resource, requestOptions); } @@ -1276,21 +1254,23 @@ public Mono deleteJob(String jobId) { /** * Submits request to cancel an existing job by Id while supplying free-form cancellation reason. * - * @param jobId Id of the job. + * @param jobId The id of the job. * @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 {@link Mono} that completes when a successful response is received. + * @return response payload from cancelling a job on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono cancelJob(String jobId) { + Mono cancelJob(String jobId) { // Generated convenience method for cancelJobWithResponse RequestOptions requestOptions = new RequestOptions(); - return cancelJobWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono); + return cancelJobWithResponse(jobId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(CancelJobResult.class)); } /** @@ -1429,8 +1409,8 @@ public Mono getQueuePosition(String jobId) { /** * Un-assign a job. * - * @param jobId Id of the job to un-assign. - * @param assignmentId Id of the assignment to un-assign. + * @param jobId The id of the job. + * @param assignmentId The Id of the job assignment. * @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. @@ -1453,7 +1433,7 @@ public Mono unassignJob(String jobId, String assignmentId) { * Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already. * * @param workerId Id of the worker. - * @param offerId Id of the offer. + * @param offerId The Id of the offer. * @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. @@ -1477,21 +1457,23 @@ public Mono acceptJobOffer(String workerId, String offerId * Declines an offer to work on a job. * * @param workerId Id of the worker. - * @param offerId Id of the offer. + * @param offerId The Id of the offer. * @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 {@link Mono} that completes when a successful response is received. + * @return response payload from declining a job on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono declineJobOffer(String workerId, String offerId) { + Mono declineJobOffer(String workerId, String offerId) { // Generated convenience method for declineJobOfferWithResponse RequestOptions requestOptions = new RequestOptions(); - return declineJobOfferWithResponse(workerId, offerId, requestOptions).flatMap(FluxUtil::toMono); + return declineJobOfferWithResponse(workerId, offerId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(DeclineJobOfferResult.class)); } /** @@ -1657,7 +1639,7 @@ public PagedFlux listWorkers() { /** * Submits request to cancel an existing job by Id while supplying free-form cancellation reason. * - * @param jobId Id of the job. + * @param jobId The id of the job. * @param options Request model for cancelling job. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1665,110 +1647,290 @@ public PagedFlux listWorkers() { * @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 {@link Mono} that completes when a successful response is received. + * @return response payload from cancelling a job on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono cancelJob(String jobId, CancelJobOptions options) { + Mono cancelJob(String jobId, CancelJobOptions options) { // Generated convenience method for cancelJobWithResponse RequestOptions requestOptions = new RequestOptions(); if (options != null) { requestOptions.setBody(BinaryData.fromObject(options)); } - return cancelJobWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono); + return cancelJobWithResponse(jobId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(CancelJobResult.class)); } /** - * Completes an assigned job. + * Un-assign a job. * - * @param jobId Id of the job. - * @param options Request model for completing job. + * @param jobId The id of the job. + * @param assignmentId The Id of the job assignment. + * @param options Request body for unassign route. * @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 {@link Mono} that completes when a successful response is received. + * @return response payload after a job has been successfully unassigned on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono completeJob(String jobId, CompleteJobOptions options) { - // Generated convenience method for completeJobWithResponse + public Mono unassignJob(String jobId, String assignmentId, UnassignJobOptions options) { + // Generated convenience method for unassignJobWithResponse RequestOptions requestOptions = new RequestOptions(); - return completeJobWithResponse(jobId, BinaryData.fromObject(options), requestOptions).flatMap(FluxUtil::toMono); + if (options != null) { + requestOptions.setBody(BinaryData.fromObject(options)); + } + return unassignJobWithResponse(jobId, assignmentId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(UnassignJobResult.class)); + } + + /** + * Declines an offer to work on a job. + * + * @param workerId Id of the worker. + * @param offerId The Id of the offer. + * @param options Request model for declining offer. + * @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 response payload from declining a job on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono declineJobOffer(String workerId, String offerId, DeclineJobOfferOptions options) { + // Generated convenience method for declineJobOfferWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (options != null) { + requestOptions.setBody(BinaryData.fromObject(options)); + } + return declineJobOfferWithResponse(workerId, offerId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(DeclineJobOfferResult.class)); + } + + /** + * Completes an assigned job. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     note: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     * }
+     * }
+ * + * @param jobId The id of the job. + * @param assignmentId The Id of the job assignment. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @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. + * @return response payload from completing a job along with {@link Response} on successful completion of {@link + * Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> completeJobWithResponse( + String jobId, String assignmentId, RequestOptions requestOptions) { + return this.serviceClient.completeJobWithResponseAsync(jobId, assignmentId, requestOptions); } /** * Closes a completed job. * - * @param jobId Id of the job. - * @param options Request model for closing job. + *

Request Body Schema + * + *

{@code
+     * {
+     *     dispositionCode: String (Optional)
+     *     closeAt: OffsetDateTime (Optional)
+     *     note: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     * }
+     * }
+ * + * @param jobId The id of the job. + * @param assignmentId The Id of the job assignment. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @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. + * @return response payload from closing a job along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> closeJobWithResponse(String jobId, String assignmentId, RequestOptions requestOptions) { + return this.serviceClient.closeJobWithResponseAsync(jobId, assignmentId, requestOptions); + } + + /** + * Reclassify a job. + * + * @param jobId The id of the job. + * @param options Request object for reclassifying a job. * @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 {@link Mono} that completes when a successful response is received. + * @return response payload from reclassifying a job on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono closeJob(String jobId, CloseJobOptions options) { - // Generated convenience method for closeJobWithResponse + Mono reclassifyJob(String jobId, ReclassifyJobOptions options) { + // Generated convenience method for reclassifyJobWithResponse RequestOptions requestOptions = new RequestOptions(); - return closeJobWithResponse(jobId, BinaryData.fromObject(options), requestOptions).flatMap(FluxUtil::toMono); + if (options != null) { + requestOptions.setBody(BinaryData.fromObject(options)); + } + return reclassifyJobWithResponse(jobId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ReclassifyJobResult.class)); } /** - * Un-assign a job. + * Reclassify a job. * - * @param jobId Id of the job to un-assign. - * @param assignmentId Id of the assignment to un-assign. - * @param options Request body for unassign route. + * @param jobId The id of the job. * @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 response payload after a job has been successfully unassigned on successful completion of {@link Mono}. + * @return response payload from reclassifying a job on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono unassignJob(String jobId, String assignmentId, UnassignJobOptions options) { - // Generated convenience method for unassignJobWithResponse + Mono reclassifyJob(String jobId) { + // Generated convenience method for reclassifyJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return reclassifyJobWithResponse(jobId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ReclassifyJobResult.class)); + } + + /** + * Completes an assigned job. + * + * @param jobId The id of the job. + * @param assignmentId The Id of the job assignment. + * @param options Request model for completing job. + * @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 response payload from completing a job on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono completeJob(String jobId, String assignmentId, CompleteJobOptions options) { + // Generated convenience method for completeJobWithResponse RequestOptions requestOptions = new RequestOptions(); if (options != null) { requestOptions.setBody(BinaryData.fromObject(options)); } - return unassignJobWithResponse(jobId, assignmentId, requestOptions) + return completeJobWithResponse(jobId, assignmentId, requestOptions) .flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(UnassignJobResult.class)); + .map(protocolMethodData -> protocolMethodData.toObject(CompleteJobResult.class)); } /** - * Declines an offer to work on a job. + * Completes an assigned job. * - * @param workerId Id of the worker. - * @param offerId Id of the offer. - * @param options Request model for declining offer. + * @param jobId The id of the job. + * @param assignmentId The Id of the job assignment. * @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 {@link Mono} that completes when a successful response is received. + * @return response payload from completing a job on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono declineJobOffer(String workerId, String offerId, DeclineJobOfferOptions options) { - // Generated convenience method for declineJobOfferWithResponse + Mono completeJob(String jobId, String assignmentId) { + // Generated convenience method for completeJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return completeJobWithResponse(jobId, assignmentId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(CompleteJobResult.class)); + } + + /** + * Closes a completed job. + * + * @param jobId The id of the job. + * @param assignmentId The Id of the job assignment. + * @param options Request model for closing job. + * @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 response payload from closing a job on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono closeJob(String jobId, String assignmentId, CloseJobOptions options) { + // Generated convenience method for closeJobWithResponse RequestOptions requestOptions = new RequestOptions(); if (options != null) { requestOptions.setBody(BinaryData.fromObject(options)); } - return declineJobOfferWithResponse(workerId, offerId, requestOptions).flatMap(FluxUtil::toMono); + return closeJobWithResponse(jobId, assignmentId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(CloseJobResult.class)); + } + + /** + * Closes a completed job. + * + * @param jobId The id of the job. + * @param assignmentId The Id of the job assignment. + * @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 response payload from closing a job on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono closeJob(String jobId, String assignmentId) { + // Generated convenience method for closeJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return closeJobWithResponse(jobId, assignmentId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(CloseJobResult.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 f680655d7b95..05edb87786d4 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 @@ -1,12 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter; import com.azure.communication.jobrouter.implementation.JobRouterClientImpl; 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.models.CancelJobOptions; +import com.azure.communication.jobrouter.implementation.models.CancelJobResult; +import com.azure.communication.jobrouter.implementation.models.CloseJobOptions; +import com.azure.communication.jobrouter.implementation.models.CloseJobResult; +import com.azure.communication.jobrouter.implementation.models.CompleteJobOptions; +import com.azure.communication.jobrouter.implementation.models.CompleteJobResult; +import com.azure.communication.jobrouter.implementation.models.DeclineJobOfferOptions; +import com.azure.communication.jobrouter.implementation.models.DeclineJobOfferResult; +import com.azure.communication.jobrouter.implementation.models.ReclassifyJobOptions; +import com.azure.communication.jobrouter.implementation.models.ReclassifyJobResult; import com.azure.communication.jobrouter.implementation.models.RouterJobInternal; import com.azure.communication.jobrouter.implementation.models.RouterWorkerInternal; import com.azure.communication.jobrouter.models.AcceptJobOfferResult; @@ -190,6 +200,7 @@ 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' return this.serviceClient.upsertJobWithResponse(jobId, resource, requestOptions); } @@ -452,104 +463,61 @@ public Response deleteJobWithResponse(String jobId, RequestOptions request * *
{@code
      * {
-     *     String: String (Optional)
      * }
      * }
* - * @param jobId Id of the job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @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. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - Response reclassifyJobWithResponse(String jobId, RequestOptions requestOptions) { - return this.serviceClient.reclassifyJobWithResponse(jobId, requestOptions); - } - - /** - * Submits request to cancel an existing job by Id while supplying free-form cancellation reason. - * - *

Request Body Schema + *

Response Body Schema * *

{@code
      * {
-     *     note: String (Optional)
-     *     dispositionCode: String (Optional)
      * }
      * }
* - * @param jobId Id of the job. + * @param jobId The id of the job. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @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. - * @return the {@link Response}. + * @return response payload from reclassifying a job along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response cancelJobWithResponse(String jobId, RequestOptions requestOptions) { - return this.serviceClient.cancelJobWithResponse(jobId, requestOptions); + Response reclassifyJobWithResponse(String jobId, RequestOptions requestOptions) { + return this.serviceClient.reclassifyJobWithResponse(jobId, requestOptions); } /** - * Completes an assigned job. + * Submits request to cancel an existing job by Id while supplying free-form cancellation reason. * *

Request Body Schema * *

{@code
      * {
-     *     assignmentId: String (Required)
      *     note: String (Optional)
+     *     dispositionCode: String (Optional)
      * }
      * }
* - * @param jobId Id of the job. - * @param options Request model for completing job. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @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. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response completeJobWithResponse(String jobId, BinaryData options, RequestOptions requestOptions) { - return this.serviceClient.completeJobWithResponse(jobId, options, requestOptions); - } - - /** - * Closes a completed job. - * - *

Request Body Schema + *

Response Body Schema * *

{@code
      * {
-     *     assignmentId: String (Required)
-     *     dispositionCode: String (Optional)
-     *     closeAt: OffsetDateTime (Optional)
-     *     note: String (Optional)
      * }
      * }
* - * @param jobId Id of the job. - * @param options Request model for closing job. + * @param jobId The id of the job. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @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. - * @return the {@link Response}. + * @return response payload from cancelling a job along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response closeJobWithResponse(String jobId, BinaryData options, RequestOptions requestOptions) { - return this.serviceClient.closeJobWithResponse(jobId, options, requestOptions); + Response cancelJobWithResponse(String jobId, RequestOptions requestOptions) { + return this.serviceClient.cancelJobWithResponse(jobId, requestOptions); } /** @@ -688,8 +656,8 @@ public Response getQueuePositionWithResponse(String jobId, RequestOp * } * } * - * @param jobId Id of the job to un-assign. - * @param assignmentId Id of the assignment to un-assign. + * @param jobId The id of the job. + * @param assignmentId The Id of the job assignment. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -718,7 +686,7 @@ public Response unassignJobWithResponse( * } * * @param workerId Id of the worker. - * @param offerId Id of the offer. + * @param offerId The Id of the offer. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -745,18 +713,25 @@ public Response acceptJobOfferWithResponse( * } * } * + *

Response Body Schema + * + *

{@code
+     * {
+     * }
+     * }
+ * * @param workerId Id of the worker. - * @param offerId Id of the offer. + * @param offerId The Id of the offer. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @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. - * @return the {@link Response}. + * @return response payload from declining a job along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response declineJobOfferWithResponse(String workerId, String offerId, RequestOptions requestOptions) { + Response declineJobOfferWithResponse(String workerId, String offerId, RequestOptions requestOptions) { return this.serviceClient.declineJobOfferWithResponse(workerId, offerId, requestOptions); } @@ -908,6 +883,7 @@ 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' return this.serviceClient.upsertWorkerWithResponse(workerId, resource, requestOptions); } @@ -1060,9 +1036,10 @@ public Response createWorkerWithResponse( @ServiceMethod(returns = ReturnType.SINGLE) public RouterWorker createWorker(CreateWorkerOptions createWorkerOptions) { RequestOptions requestOptions = new RequestOptions(); - RouterWorkerInternal internal = this.createWorkerWithResponse(createWorkerOptions, requestOptions) - .getValue() - .toObject(RouterWorkerInternal.class); + RouterWorkerInternal internal = + this.createWorkerWithResponse(createWorkerOptions, requestOptions) + .getValue() + .toObject(RouterWorkerInternal.class); return RouterWorkerConstructorProxy.create(internal); } @@ -1263,20 +1240,21 @@ public void deleteJob(String jobId) { /** * Submits request to cancel an existing job by Id while supplying free-form cancellation reason. * - * @param jobId Id of the job. + * @param jobId The id of the job. * @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 response payload from cancelling a job. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void cancelJob(String jobId) { + CancelJobResult cancelJob(String jobId) { // Generated convenience method for cancelJobWithResponse RequestOptions requestOptions = new RequestOptions(); - cancelJobWithResponse(jobId, requestOptions).getValue(); + return cancelJobWithResponse(jobId, requestOptions).getValue().toObject(CancelJobResult.class); } /** @@ -1369,8 +1347,8 @@ public RouterJobPositionDetails getQueuePosition(String jobId) { /** * Un-assign a job. * - * @param jobId Id of the job to un-assign. - * @param assignmentId Id of the assignment to un-assign. + * @param jobId The id of the job. + * @param assignmentId The Id of the job assignment. * @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. @@ -1393,7 +1371,7 @@ public UnassignJobResult unassignJob(String jobId, String assignmentId) { * Accepts an offer to work on a job and returns a 409/Conflict if another agent accepted the job already. * * @param workerId Id of the worker. - * @param offerId Id of the offer. + * @param offerId The Id of the offer. * @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. @@ -1416,20 +1394,23 @@ public AcceptJobOfferResult acceptJobOffer(String workerId, String offerId) { * Declines an offer to work on a job. * * @param workerId Id of the worker. - * @param offerId Id of the offer. + * @param offerId The Id of the offer. * @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 response payload from declining a job. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void declineJobOffer(String workerId, String offerId) { + DeclineJobOfferResult declineJobOffer(String workerId, String offerId) { // Generated convenience method for declineJobOfferWithResponse RequestOptions requestOptions = new RequestOptions(); - declineJobOfferWithResponse(workerId, offerId, requestOptions).getValue(); + return declineJobOfferWithResponse(workerId, offerId, requestOptions) + .getValue() + .toObject(DeclineJobOfferResult.class); } /** @@ -1550,7 +1531,7 @@ public PagedIterable listWorkers() { /** * Submits request to cancel an existing job by Id while supplying free-form cancellation reason. * - * @param jobId Id of the job. + * @param jobId The id of the job. * @param options Request model for cancelling job. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1558,106 +1539,278 @@ public PagedIterable listWorkers() { * @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 payload from cancelling a job. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void cancelJob(String jobId, CancelJobOptions options) { + CancelJobResult cancelJob(String jobId, CancelJobOptions options) { // Generated convenience method for cancelJobWithResponse RequestOptions requestOptions = new RequestOptions(); if (options != null) { requestOptions.setBody(BinaryData.fromObject(options)); } - cancelJobWithResponse(jobId, requestOptions).getValue(); + return cancelJobWithResponse(jobId, requestOptions).getValue().toObject(CancelJobResult.class); } /** - * Completes an assigned job. + * Un-assign a job. * - * @param jobId Id of the job. - * @param options Request model for completing job. + * @param jobId The id of the job. + * @param assignmentId The Id of the job assignment. + * @param options Request body for unassign route. * @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 response payload after a job has been successfully unassigned. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void completeJob(String jobId, CompleteJobOptions options) { - // Generated convenience method for completeJobWithResponse + public UnassignJobResult unassignJob(String jobId, String assignmentId, UnassignJobOptions options) { + // Generated convenience method for unassignJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (options != null) { + requestOptions.setBody(BinaryData.fromObject(options)); + } + return unassignJobWithResponse(jobId, assignmentId, requestOptions) + .getValue() + .toObject(UnassignJobResult.class); + } + + /** + * Declines an offer to work on a job. + * + * @param workerId Id of the worker. + * @param offerId The Id of the offer. + * @param options Request model for declining offer. + * @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 response payload from declining a job. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + DeclineJobOfferResult declineJobOffer(String workerId, String offerId, DeclineJobOfferOptions options) { + // Generated convenience method for declineJobOfferWithResponse RequestOptions requestOptions = new RequestOptions(); - completeJobWithResponse(jobId, BinaryData.fromObject(options), requestOptions).getValue(); + if (options != null) { + requestOptions.setBody(BinaryData.fromObject(options)); + } + return declineJobOfferWithResponse(workerId, offerId, requestOptions) + .getValue() + .toObject(DeclineJobOfferResult.class); + } + + /** + * Completes an assigned job. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     note: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     * }
+     * }
+ * + * @param jobId The id of the job. + * @param assignmentId The Id of the job assignment. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @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. + * @return response payload from completing a job along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Response completeJobWithResponse(String jobId, String assignmentId, RequestOptions requestOptions) { + return this.serviceClient.completeJobWithResponse(jobId, assignmentId, requestOptions); } /** * Closes a completed job. * - * @param jobId Id of the job. - * @param options Request model for closing job. + *

Request Body Schema + * + *

{@code
+     * {
+     *     dispositionCode: String (Optional)
+     *     closeAt: OffsetDateTime (Optional)
+     *     note: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     * }
+     * }
+ * + * @param jobId The id of the job. + * @param assignmentId The Id of the job assignment. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @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. + * @return response payload from closing a job along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Response closeJobWithResponse(String jobId, String assignmentId, RequestOptions requestOptions) { + return this.serviceClient.closeJobWithResponse(jobId, assignmentId, requestOptions); + } + + /** + * Reclassify a job. + * + * @param jobId The id of the job. + * @param options Request object for reclassifying a job. * @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 response payload from reclassifying a job. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void closeJob(String jobId, CloseJobOptions options) { - // Generated convenience method for closeJobWithResponse + ReclassifyJobResult reclassifyJob(String jobId, ReclassifyJobOptions options) { + // Generated convenience method for reclassifyJobWithResponse RequestOptions requestOptions = new RequestOptions(); - closeJobWithResponse(jobId, BinaryData.fromObject(options), requestOptions).getValue(); + if (options != null) { + requestOptions.setBody(BinaryData.fromObject(options)); + } + return reclassifyJobWithResponse(jobId, requestOptions).getValue().toObject(ReclassifyJobResult.class); } /** - * Un-assign a job. + * Reclassify a job. * - * @param jobId Id of the job to un-assign. - * @param assignmentId Id of the assignment to un-assign. - * @param options Request body for unassign route. + * @param jobId The id of the job. * @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 response payload after a job has been successfully unassigned. + * @return response payload from reclassifying a job. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public UnassignJobResult unassignJob(String jobId, String assignmentId, UnassignJobOptions options) { - // Generated convenience method for unassignJobWithResponse + ReclassifyJobResult reclassifyJob(String jobId) { + // Generated convenience method for reclassifyJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return reclassifyJobWithResponse(jobId, requestOptions).getValue().toObject(ReclassifyJobResult.class); + } + + /** + * Completes an assigned job. + * + * @param jobId The id of the job. + * @param assignmentId The Id of the job assignment. + * @param options Request model for completing job. + * @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 response payload from completing a job. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + CompleteJobResult completeJob(String jobId, String assignmentId, CompleteJobOptions options) { + // Generated convenience method for completeJobWithResponse RequestOptions requestOptions = new RequestOptions(); if (options != null) { requestOptions.setBody(BinaryData.fromObject(options)); } - return unassignJobWithResponse(jobId, assignmentId, requestOptions) + return completeJobWithResponse(jobId, assignmentId, requestOptions) .getValue() - .toObject(UnassignJobResult.class); + .toObject(CompleteJobResult.class); } /** - * Declines an offer to work on a job. + * Completes an assigned job. * - * @param workerId Id of the worker. - * @param offerId Id of the offer. - * @param options Request model for declining offer. + * @param jobId The id of the job. + * @param assignmentId The Id of the job assignment. * @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 response payload from completing a job. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void declineJobOffer(String workerId, String offerId, DeclineJobOfferOptions options) { - // Generated convenience method for declineJobOfferWithResponse + CompleteJobResult completeJob(String jobId, String assignmentId) { + // Generated convenience method for completeJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return completeJobWithResponse(jobId, assignmentId, requestOptions) + .getValue() + .toObject(CompleteJobResult.class); + } + + /** + * Closes a completed job. + * + * @param jobId The id of the job. + * @param assignmentId The Id of the job assignment. + * @param options Request model for closing job. + * @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 response payload from closing a job. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + CloseJobResult closeJob(String jobId, String assignmentId, CloseJobOptions options) { + // Generated convenience method for closeJobWithResponse RequestOptions requestOptions = new RequestOptions(); if (options != null) { requestOptions.setBody(BinaryData.fromObject(options)); } - declineJobOfferWithResponse(workerId, offerId, requestOptions).getValue(); + return closeJobWithResponse(jobId, assignmentId, requestOptions).getValue().toObject(CloseJobResult.class); + } + + /** + * Closes a completed job. + * + * @param jobId The id of the job. + * @param assignmentId The Id of the job assignment. + * @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 response payload from closing a job. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + CloseJobResult closeJob(String jobId, String assignmentId) { + // Generated convenience method for closeJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return closeJobWithResponse(jobId, assignmentId, requestOptions).getValue().toObject(CloseJobResult.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 333c3d21ed89..1867826603c4 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 @@ -1,18 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter; import com.azure.communication.common.implementation.CommunicationConnectionString; 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.AzureKeyCredentialTrait; 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.TokenCredentialTrait; import com.azure.core.credential.AzureKeyCredential; import com.azure.core.credential.TokenCredential; import com.azure.core.http.HttpClient; @@ -48,10 +45,7 @@ public final class JobRouterClientBuilder implements HttpTrait, ConfigurationTrait, - EndpointTrait, - ConnectionStringTrait, - AzureKeyCredentialTrait, - TokenCredentialTrait { + EndpointTrait { @Generated private static final String SDK_NAME = "name"; @@ -62,8 +56,11 @@ public final class JobRouterClientBuilder CoreUtils.getProperties("azure-communication-jobrouter.properties"); @Generated private final List pipelinePolicies; + private TokenCredential tokenCredential; + private AzureKeyCredential credential; + private CommunicationConnectionString connectionString; /** Create an instance of the JobRouterClientBuilder. */ @@ -292,8 +289,8 @@ public JobRouterClient buildClient() { /** * Sets the {@link TokenCredential} used to authorize requests sent to the service. Refer to the Azure SDK for Java - * identity and authentication - * documentation for more details on proper usage of the {@link TokenCredential} type. + * identity and authentication documentation for more details + * on proper usage of the {@link TokenCredential} type. * * @param tokenCredential {@link TokenCredential} used to authorize requests sent to the service. * @return Updated {@link JobRouterClientBuilder} object. @@ -313,8 +310,7 @@ public JobRouterClientBuilder credential(TokenCredential tokenCredential) { */ @Override public JobRouterClientBuilder credential(AzureKeyCredential credential) { - this.credential = Objects.requireNonNull( - credential, "'credential' cannot be null."); + this.credential = Objects.requireNonNull(credential, "'credential' cannot be null."); return this; } 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 724e4f2d6ffd..3ce550fe075d 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.implementation; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterClientImpl.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterClientImpl.java index 55b281470607..1b916624dac4 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterClientImpl.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.implementation; @@ -289,7 +289,7 @@ Response deleteJobSync( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> reclassifyJob( + Mono> reclassifyJob( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, @@ -309,7 +309,7 @@ Mono> reclassifyJob( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response reclassifyJobSync( + Response reclassifyJobSync( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, @@ -329,7 +329,7 @@ Response reclassifyJobSync( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> cancelJob( + Mono> cancelJob( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, @@ -349,7 +349,7 @@ Mono> cancelJob( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response cancelJobSync( + Response cancelJobSync( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, @@ -357,7 +357,7 @@ Response cancelJobSync( RequestOptions requestOptions, Context context); - @Post("/routing/jobs/{jobId}:complete") + @Post("/routing/jobs/{jobId}/assignments/{assignmentId}:complete") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -369,16 +369,16 @@ Response cancelJobSync( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> completeJob( + Mono> completeJob( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, + @PathParam("assignmentId") String assignmentId, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData options, RequestOptions requestOptions, Context context); - @Post("/routing/jobs/{jobId}:complete") + @Post("/routing/jobs/{jobId}/assignments/{assignmentId}:complete") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -390,17 +390,17 @@ Mono> completeJob( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response completeJobSync( + Response completeJobSync( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, + @PathParam("assignmentId") String assignmentId, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData options, RequestOptions requestOptions, Context context); - @Post("/routing/jobs/{jobId}:close") - @ExpectedResponses({200, 202}) + @Post("/routing/jobs/{jobId}/assignments/{assignmentId}:close") + @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, code = {401}) @@ -411,17 +411,17 @@ Response completeJobSync( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> closeJob( + Mono> closeJob( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, + @PathParam("assignmentId") String assignmentId, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData options, RequestOptions requestOptions, Context context); - @Post("/routing/jobs/{jobId}:close") - @ExpectedResponses({200, 202}) + @Post("/routing/jobs/{jobId}/assignments/{assignmentId}:close") + @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, code = {401}) @@ -432,12 +432,12 @@ Mono> closeJob( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response closeJobSync( + Response closeJobSync( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, + @PathParam("assignmentId") String assignmentId, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData options, RequestOptions requestOptions, Context context); @@ -615,7 +615,7 @@ Response acceptJobOfferSync( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> declineJobOffer( + Mono> declineJobOffer( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("workerId") String workerId, @@ -636,7 +636,7 @@ Mono> declineJobOffer( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response declineJobOfferSync( + Response declineJobOfferSync( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("workerId") String workerId, @@ -1427,20 +1427,27 @@ public Response deleteJobWithResponse(String jobId, RequestOptions request * *
{@code
      * {
-     *     String: String (Optional)
      * }
      * }
* - * @param jobId Id of the job. + *

Response Body Schema + * + *

{@code
+     * {
+     * }
+     * }
+ * + * @param jobId The id of the job. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @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. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return response payload from reclassifying a job along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> reclassifyJobWithResponseAsync(String jobId, RequestOptions requestOptions) { + public Mono> reclassifyJobWithResponseAsync(String jobId, RequestOptions requestOptions) { final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback( @@ -1468,20 +1475,26 @@ public Mono> reclassifyJobWithResponseAsync(String jobId, Request * *
{@code
      * {
-     *     String: String (Optional)
      * }
      * }
* - * @param jobId Id of the job. + *

Response Body Schema + * + *

{@code
+     * {
+     * }
+     * }
+ * + * @param jobId The id of the job. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @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. - * @return the {@link Response}. + * @return response payload from reclassifying a job along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response reclassifyJobWithResponse(String jobId, RequestOptions requestOptions) { + public Response reclassifyJobWithResponse(String jobId, RequestOptions requestOptions) { final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback( @@ -1512,16 +1525,24 @@ public Response reclassifyJobWithResponse(String jobId, RequestOptions req * } * } * - * @param jobId Id of the job. + *

Response Body Schema + * + *

{@code
+     * {
+     * }
+     * }
+ * + * @param jobId The id of the job. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @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. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return response payload from cancelling a job along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> cancelJobWithResponseAsync(String jobId, RequestOptions requestOptions) { + public Mono> cancelJobWithResponseAsync(String jobId, RequestOptions requestOptions) { final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback( @@ -1554,16 +1575,23 @@ public Mono> cancelJobWithResponseAsync(String jobId, RequestOpti * } * } * - * @param jobId Id of the job. + *

Response Body Schema + * + *

{@code
+     * {
+     * }
+     * }
+ * + * @param jobId The id of the job. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @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. - * @return the {@link Response}. + * @return response payload from cancelling a job along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response cancelJobWithResponse(String jobId, RequestOptions requestOptions) { + public Response cancelJobWithResponse(String jobId, RequestOptions requestOptions) { final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback( @@ -1589,33 +1617,48 @@ public Response cancelJobWithResponse(String jobId, RequestOptions request * *
{@code
      * {
-     *     assignmentId: String (Required)
      *     note: String (Optional)
      * }
      * }
* - * @param jobId Id of the job. - * @param options Request model for completing job. + *

Response Body Schema + * + *

{@code
+     * {
+     * }
+     * }
+ * + * @param jobId The id of the job. + * @param assignmentId The Id of the job assignment. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @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. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return response payload from completing a job along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> completeJobWithResponseAsync( - String jobId, BinaryData options, RequestOptions requestOptions) { + public Mono> completeJobWithResponseAsync( + String jobId, String assignmentId, RequestOptions requestOptions) { final String accept = "application/json"; + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + requestOptionsLocal.addRequestCallback( + requestLocal -> { + if (requestLocal.getBody() != null + && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { + requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); + } + }); return FluxUtil.withContext( context -> service.completeJob( this.getEndpoint(), this.getServiceVersion().getVersion(), jobId, + assignmentId, accept, - options, - requestOptions, + requestOptionsLocal, context)); } @@ -1626,30 +1669,45 @@ public Mono> completeJobWithResponseAsync( * *
{@code
      * {
-     *     assignmentId: String (Required)
      *     note: String (Optional)
      * }
      * }
* - * @param jobId Id of the job. - * @param options Request model for completing job. + *

Response Body Schema + * + *

{@code
+     * {
+     * }
+     * }
+ * + * @param jobId The id of the job. + * @param assignmentId The Id of the job assignment. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @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. - * @return the {@link Response}. + * @return response payload from completing a job along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response completeJobWithResponse(String jobId, BinaryData options, RequestOptions requestOptions) { + public Response completeJobWithResponse( + String jobId, String assignmentId, RequestOptions requestOptions) { final String accept = "application/json"; + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + requestOptionsLocal.addRequestCallback( + requestLocal -> { + if (requestLocal.getBody() != null + && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { + requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); + } + }); return service.completeJobSync( this.getEndpoint(), this.getServiceVersion().getVersion(), jobId, + assignmentId, accept, - options, - requestOptions, + requestOptionsLocal, Context.NONE); } @@ -1660,35 +1718,49 @@ public Response completeJobWithResponse(String jobId, BinaryData options, * *
{@code
      * {
-     *     assignmentId: String (Required)
      *     dispositionCode: String (Optional)
      *     closeAt: OffsetDateTime (Optional)
      *     note: String (Optional)
      * }
      * }
* - * @param jobId Id of the job. - * @param options Request model for closing job. + *

Response Body Schema + * + *

{@code
+     * {
+     * }
+     * }
+ * + * @param jobId The id of the job. + * @param assignmentId The Id of the job assignment. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @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. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return response payload from closing a job along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> closeJobWithResponseAsync( - String jobId, BinaryData options, RequestOptions requestOptions) { + public Mono> closeJobWithResponseAsync( + String jobId, String assignmentId, RequestOptions requestOptions) { final String accept = "application/json"; + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + requestOptionsLocal.addRequestCallback( + requestLocal -> { + if (requestLocal.getBody() != null + && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { + requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); + } + }); return FluxUtil.withContext( context -> service.closeJob( this.getEndpoint(), this.getServiceVersion().getVersion(), jobId, + assignmentId, accept, - options, - requestOptions, + requestOptionsLocal, context)); } @@ -1699,32 +1771,46 @@ public Mono> closeJobWithResponseAsync( * *
{@code
      * {
-     *     assignmentId: String (Required)
      *     dispositionCode: String (Optional)
      *     closeAt: OffsetDateTime (Optional)
      *     note: String (Optional)
      * }
      * }
* - * @param jobId Id of the job. - * @param options Request model for closing job. + *

Response Body Schema + * + *

{@code
+     * {
+     * }
+     * }
+ * + * @param jobId The id of the job. + * @param assignmentId The Id of the job assignment. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @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. - * @return the {@link Response}. + * @return response payload from closing a job along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response closeJobWithResponse(String jobId, BinaryData options, RequestOptions requestOptions) { + public Response closeJobWithResponse(String jobId, String assignmentId, RequestOptions requestOptions) { final String accept = "application/json"; + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + requestOptionsLocal.addRequestCallback( + requestLocal -> { + if (requestLocal.getBody() != null + && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { + requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); + } + }); return service.closeJobSync( this.getEndpoint(), this.getServiceVersion().getVersion(), jobId, + assignmentId, accept, - options, - requestOptions, + requestOptionsLocal, Context.NONE); } @@ -2251,8 +2337,8 @@ public Response getQueuePositionWithResponse(String jobId, RequestOp * } * } * - * @param jobId Id of the job to un-assign. - * @param assignmentId Id of the assignment to un-assign. + * @param jobId The id of the job. + * @param assignmentId The Id of the job assignment. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -2305,8 +2391,8 @@ public Mono> unassignJobWithResponseAsync( * } * } * - * @param jobId Id of the job to un-assign. - * @param assignmentId Id of the assignment to un-assign. + * @param jobId The id of the job. + * @param assignmentId The Id of the job assignment. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -2350,7 +2436,7 @@ public Response unassignJobWithResponse( * } * * @param workerId Id of the worker. - * @param offerId Id of the offer. + * @param offerId The Id of the offer. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -2389,7 +2475,7 @@ public Mono> acceptJobOfferWithResponseAsync( * } * * @param workerId Id of the worker. - * @param offerId Id of the offer. + * @param offerId The Id of the offer. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -2423,17 +2509,25 @@ public Response acceptJobOfferWithResponse( * } * } * + *

Response Body Schema + * + *

{@code
+     * {
+     * }
+     * }
+ * * @param workerId Id of the worker. - * @param offerId Id of the offer. + * @param offerId The Id of the offer. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @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. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return response payload from declining a job along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> declineJobOfferWithResponseAsync( + public Mono> declineJobOfferWithResponseAsync( String workerId, String offerId, RequestOptions requestOptions) { final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; @@ -2467,17 +2561,25 @@ public Mono> declineJobOfferWithResponseAsync( * } * } * + *

Response Body Schema + * + *

{@code
+     * {
+     * }
+     * }
+ * * @param workerId Id of the worker. - * @param offerId Id of the offer. + * @param offerId The Id of the offer. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @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. - * @return the {@link Response}. + * @return response payload from declining a job along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response declineJobOfferWithResponse(String workerId, String offerId, RequestOptions requestOptions) { + public Response declineJobOfferWithResponse( + String workerId, String offerId, RequestOptions requestOptions) { final String accept = "application/json"; RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; requestOptionsLocal.addRequestCallback( diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/CancelJobOptions.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/CancelJobOptions.java new file mode 100644 index 000000000000..919e055f8311 --- /dev/null +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/CancelJobOptions.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.communication.jobrouter.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Request payload for deleting a job. */ +@Fluent +public final class CancelJobOptions { + /* + * A note that will be appended to the jobs' Notes collection with the current timestamp. + */ + @Generated + @JsonProperty(value = "note") + private String note; + + /* + * Indicates the outcome of the job, populate this field with your own custom values. If not provided, default + * value of "Cancelled" is set. + */ + @Generated + @JsonProperty(value = "dispositionCode") + private String dispositionCode; + + /** Creates an instance of CancelJobOptions class. */ + @Generated + public CancelJobOptions() {} + + /** + * Get the note property: A note that will be appended to the jobs' Notes collection with the current timestamp. + * + * @return the note value. + */ + @Generated + public String getNote() { + return this.note; + } + + /** + * Set the note property: A note that will be appended to the jobs' Notes collection with the current timestamp. + * + * @param note the note value to set. + * @return the CancelJobOptions object itself. + */ + @Generated + public CancelJobOptions setNote(String note) { + this.note = note; + return this; + } + + /** + * Get the dispositionCode property: Indicates the outcome of the job, populate this field with your own custom + * values. If not provided, default value of "Cancelled" is set. + * + * @return the dispositionCode value. + */ + @Generated + public String getDispositionCode() { + return this.dispositionCode; + } + + /** + * Set the dispositionCode property: Indicates the outcome of the job, populate this field with your own custom + * values. If not provided, default value of "Cancelled" is set. + * + * @param dispositionCode the dispositionCode value to set. + * @return the CancelJobOptions object itself. + */ + @Generated + public CancelJobOptions setDispositionCode(String dispositionCode) { + this.dispositionCode = dispositionCode; + return this; + } +} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/CancelJobResult.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/CancelJobResult.java new file mode 100644 index 000000000000..2073b931201d --- /dev/null +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/CancelJobResult.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.communication.jobrouter.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; + +/** Response payload from cancelling a job. */ +@Immutable +public final class CancelJobResult { + /** Creates an instance of CancelJobResult class. */ + @Generated + private CancelJobResult() {} +} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/CloseJobOptions.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/CloseJobOptions.java new file mode 100644 index 000000000000..ecd8383d5670 --- /dev/null +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/CloseJobOptions.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.communication.jobrouter.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Request payload for closing jobs. */ +@Fluent +public final class CloseJobOptions { + /* + * Indicates the outcome of the job, populate this field with your own custom values. + */ + @Generated + @JsonProperty(value = "dispositionCode") + private String dispositionCode; + + /* + * If not provided, worker capacity is released immediately along with a JobClosedEvent notification. If provided, + * worker capacity is released along with a JobClosedEvent notification at a future time in UTC. + */ + @Generated + @JsonProperty(value = "closeAt") + private OffsetDateTime closeAt; + + /* + * A note that will be appended to the jobs' Notes collection with the current timestamp. + */ + @Generated + @JsonProperty(value = "note") + private String note; + + /** Creates an instance of CloseJobOptions class. */ + @Generated + public CloseJobOptions() {} + + /** + * Get the dispositionCode property: Indicates the outcome of the job, populate this field with your own custom + * values. + * + * @return the dispositionCode value. + */ + @Generated + public String getDispositionCode() { + return this.dispositionCode; + } + + /** + * Set the dispositionCode property: Indicates the outcome of the job, populate this field with your own custom + * values. + * + * @param dispositionCode the dispositionCode value to set. + * @return the CloseJobOptions object itself. + */ + @Generated + public CloseJobOptions setDispositionCode(String dispositionCode) { + this.dispositionCode = dispositionCode; + return this; + } + + /** + * Get the closeAt property: If not provided, worker capacity is released immediately along with a JobClosedEvent + * notification. If provided, worker capacity is released along with a JobClosedEvent notification at a future time + * in UTC. + * + * @return the closeAt value. + */ + @Generated + public OffsetDateTime getCloseAt() { + return this.closeAt; + } + + /** + * Set the closeAt property: If not provided, worker capacity is released immediately along with a JobClosedEvent + * notification. If provided, worker capacity is released along with a JobClosedEvent notification at a future time + * in UTC. + * + * @param closeAt the closeAt value to set. + * @return the CloseJobOptions object itself. + */ + @Generated + public CloseJobOptions setCloseAt(OffsetDateTime closeAt) { + this.closeAt = closeAt; + return this; + } + + /** + * Get the note property: A note that will be appended to the jobs' Notes collection with the current timestamp. + * + * @return the note value. + */ + @Generated + public String getNote() { + return this.note; + } + + /** + * Set the note property: A note that will be appended to the jobs' Notes collection with the current timestamp. + * + * @param note the note value to set. + * @return the CloseJobOptions object itself. + */ + @Generated + public CloseJobOptions setNote(String note) { + this.note = note; + return this; + } +} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/CloseJobResult.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/CloseJobResult.java new file mode 100644 index 000000000000..956dd78a7617 --- /dev/null +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/CloseJobResult.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.communication.jobrouter.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; + +/** Response payload from closing a job. */ +@Immutable +public final class CloseJobResult { + /** Creates an instance of CloseJobResult class. */ + @Generated + private CloseJobResult() {} +} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/CompleteJobOptions.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/CompleteJobOptions.java new file mode 100644 index 000000000000..0024629d0597 --- /dev/null +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/CompleteJobOptions.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.communication.jobrouter.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Request payload for completing jobs. */ +@Fluent +public final class CompleteJobOptions { + /* + * A note that will be appended to the jobs' Notes collection with the current timestamp. + */ + @Generated + @JsonProperty(value = "note") + private String note; + + /** Creates an instance of CompleteJobOptions class. */ + @Generated + public CompleteJobOptions() {} + + /** + * Get the note property: A note that will be appended to the jobs' Notes collection with the current timestamp. + * + * @return the note value. + */ + @Generated + public String getNote() { + return this.note; + } + + /** + * Set the note property: A note that will be appended to the jobs' Notes collection with the current timestamp. + * + * @param note the note value to set. + * @return the CompleteJobOptions object itself. + */ + @Generated + public CompleteJobOptions setNote(String note) { + this.note = note; + return this; + } +} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/CompleteJobResult.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/CompleteJobResult.java new file mode 100644 index 000000000000..bf70997e3de9 --- /dev/null +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/CompleteJobResult.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.communication.jobrouter.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; + +/** Response payload from completing a job. */ +@Immutable +public final class CompleteJobResult { + /** Creates an instance of CompleteJobResult class. */ + @Generated + private CompleteJobResult() {} +} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/DeclineJobOfferOptions.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/DeclineJobOfferOptions.java new file mode 100644 index 000000000000..9e4c25a061bc --- /dev/null +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/DeclineJobOfferOptions.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.communication.jobrouter.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Request payload for declining offers. */ +@Fluent +public final class DeclineJobOfferOptions { + /* + * If the RetryOfferAt is not provided, then this job will not be offered again to the worker who declined this job + * unless the worker is de-registered and re-registered. If a RetryOfferAt time is provided, then the job will be + * re-matched to eligible workers at the retry time in UTC. The worker that declined the job will also be eligible + * for the job at that time. + */ + @Generated + @JsonProperty(value = "retryOfferAt") + private OffsetDateTime retryOfferAt; + + /** Creates an instance of DeclineJobOfferOptions class. */ + @Generated + public DeclineJobOfferOptions() {} + + /** + * Get the retryOfferAt property: If the RetryOfferAt is not provided, then this job will not be offered again to + * the worker who declined this job unless the worker is de-registered and re-registered. If a RetryOfferAt time is + * provided, then the job will be re-matched to eligible workers at the retry time in UTC. The worker that declined + * the job will also be eligible for the job at that time. + * + * @return the retryOfferAt value. + */ + @Generated + public OffsetDateTime getRetryOfferAt() { + return this.retryOfferAt; + } + + /** + * Set the retryOfferAt property: If the RetryOfferAt is not provided, then this job will not be offered again to + * the worker who declined this job unless the worker is de-registered and re-registered. If a RetryOfferAt time is + * provided, then the job will be re-matched to eligible workers at the retry time in UTC. The worker that declined + * the job will also be eligible for the job at that time. + * + * @param retryOfferAt the retryOfferAt value to set. + * @return the DeclineJobOfferOptions object itself. + */ + @Generated + public DeclineJobOfferOptions setRetryOfferAt(OffsetDateTime retryOfferAt) { + this.retryOfferAt = retryOfferAt; + return this; + } +} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/DeclineJobOfferResult.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/DeclineJobOfferResult.java new file mode 100644 index 000000000000..4fb17e5d621c --- /dev/null +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/DeclineJobOfferResult.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.communication.jobrouter.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; + +/** Response payload from declining a job. */ +@Immutable +public final class DeclineJobOfferResult { + /** Creates an instance of DeclineJobOfferResult class. */ + @Generated + private DeclineJobOfferResult() {} +} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ReclassifyJobOptions.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ReclassifyJobOptions.java new file mode 100644 index 000000000000..3c7f66c737cd --- /dev/null +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ReclassifyJobOptions.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.communication.jobrouter.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; + +/** Request payload for reclassifying jobs. */ +@Immutable +public final class ReclassifyJobOptions { + /** Creates an instance of ReclassifyJobOptions class. */ + @Generated + public ReclassifyJobOptions() {} +} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ReclassifyJobResult.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ReclassifyJobResult.java new file mode 100644 index 000000000000..769f6b602281 --- /dev/null +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/ReclassifyJobResult.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.communication.jobrouter.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; + +/** Response payload from reclassifying a job. */ +@Immutable +public final class ReclassifyJobResult { + /** Creates an instance of ReclassifyJobResult class. */ + @Generated + private ReclassifyJobResult() {} +} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/package-info.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/package-info.java new file mode 100644 index 000000000000..77ec5b880f4f --- /dev/null +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/models/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * + * + * Package containing the data models for AzureCommunicationRoutingService. Azure Communication Routing Service. + * + */ +package com.azure.communication.jobrouter.implementation.models; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/package-info.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/package-info.java index b43bb89d6f43..dbe5badf5177 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/package-info.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/package-info.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - /** Package containing the implementations for AzureCommunicationRoutingService. Azure Communication Routing Service. */ package com.azure.communication.jobrouter.implementation; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/AcceptJobOfferResult.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/AcceptJobOfferResult.java index 4ebf9a474015..0e1d3c75df51 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/AcceptJobOfferResult.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/AcceptJobOfferResult.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/BestWorkerMode.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/BestWorkerMode.java index f7a8e09d6fae..6f389b34d9c0 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/BestWorkerMode.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/BestWorkerMode.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; @@ -11,7 +11,7 @@ /** Jobs are distributed to the worker with the strongest abilities available. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("best-worker") +@JsonTypeName("bestWorker") @Fluent public final class BestWorkerMode extends DistributionMode { diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CancelExceptionAction.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CancelExceptionAction.java index eacb4f608ad0..a69bfe166da7 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CancelExceptionAction.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/CancelExceptionAction.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; @@ -16,16 +16,14 @@ public final class CancelExceptionAction extends ExceptionAction { /* - * (Optional) A note that will be appended to the jobs' Notes collection with the - * current timestamp. + * A note that will be appended to the jobs' Notes collection with the current timestamp. */ @Generated @JsonProperty(value = "note") private String note; /* - * (Optional) Indicates the outcome of the job, populate this field with your own - * custom values. + * Indicates the outcome of the job, populate this field with your own custom values. */ @Generated @JsonProperty(value = "dispositionCode") @@ -36,8 +34,7 @@ public final class CancelExceptionAction extends ExceptionAction { public CancelExceptionAction() {} /** - * Get the note property: (Optional) A note that will be appended to the jobs' Notes collection with the current - * timestamp. + * Get the note property: A note that will be appended to the jobs' Notes collection with the current timestamp. * * @return the note value. */ @@ -47,8 +44,7 @@ public String getNote() { } /** - * Set the note property: (Optional) A note that will be appended to the jobs' Notes collection with the current - * timestamp. + * Set the note property: A note that will be appended to the jobs' Notes collection with the current timestamp. * * @param note the note value to set. * @return the CancelExceptionAction object itself. @@ -60,8 +56,8 @@ public CancelExceptionAction setNote(String note) { } /** - * Get the dispositionCode property: (Optional) Indicates the outcome of the job, populate this field with your own - * custom values. + * Get the dispositionCode property: Indicates the outcome of the job, populate this field with your own custom + * values. * * @return the dispositionCode value. */ @@ -71,8 +67,8 @@ public String getDispositionCode() { } /** - * Set the dispositionCode property: (Optional) Indicates the outcome of the job, populate this field with your own - * custom values. + * Set the dispositionCode property: Indicates the outcome of the job, populate this field with your own custom + * values. * * @param dispositionCode the dispositionCode value to set. * @return the CancelExceptionAction object itself. @@ -82,4 +78,12 @@ public CancelExceptionAction setDispositionCode(String dispositionCode) { this.dispositionCode = dispositionCode; return this; } + + /** {@inheritDoc} */ + @Generated + @Override + public CancelExceptionAction setId(String id) { + super.setId(id); + return this; + } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ClassificationPolicy.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ClassificationPolicy.java index 7a928b873ffa..d5a60c145413 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ClassificationPolicy.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ClassificationPolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.communication.jobrouter.implementation.accesshelpers.ClassificationPolicyConstructorProxy; @@ -39,19 +39,7 @@ public final class ClassificationPolicy { private String fallbackQueueId; /* - * A rule of one of the following types: - * - * StaticRule: A rule - * providing static rules that always return the same result, regardless of - * input. - * DirectMapRule: A rule that return the same labels as the input - * labels. - * ExpressionRule: A rule providing inline expression - * rules. - * FunctionRule: A rule providing a binding to an HTTP Triggered Azure - * Function. - * WebhookRule: A rule providing a binding to a webserver following - * OAuth2.0 authentication protocol. + * The rule to determine a priority score for a given job. */ @Generated @JsonProperty(value = "prioritizationRule") @@ -68,16 +56,17 @@ public ClassificationPolicy() {} */ ClassificationPolicy(ClassificationPolicyInternal internal) { id = internal.getId(); - setName(internal.getName()); setPrioritizationRule(RouterRuleAdapter.convertRouterRuleToPublic(internal.getPrioritizationRule())); setFallbackQueueId(internal.getFallbackQueueId()); - setQueueSelectorAttachments(internal.getQueueSelectorAttachments().stream() - .map(LabelSelectorAdapter::convertQueueSelectorAttachmentToPublic) - .collect(Collectors.toList())); - setWorkerSelectorAttachments(internal.getWorkerSelectorAttachments().stream() - .map(LabelSelectorAdapter::convertWorkerSelectorAttachmentToPublic) - .collect(Collectors.toList())); + setQueueSelectorAttachments( + internal.getQueueSelectorAttachments().stream() + .map(LabelSelectorAdapter::convertQueueSelectorAttachmentToPublic) + .collect(Collectors.toList())); + setWorkerSelectorAttachments( + internal.getWorkerSelectorAttachments().stream() + .map(LabelSelectorAdapter::convertWorkerSelectorAttachmentToPublic) + .collect(Collectors.toList())); } static { @@ -139,12 +128,7 @@ public ClassificationPolicy setFallbackQueueId(String fallbackQueueId) { } /** - * Get the prioritizationRule property: A rule of one of the following types: - * - *

StaticRule: A rule providing static rules that always return the same result, regardless of input. - * DirectMapRule: A rule that return the same labels as the input labels. ExpressionRule: A rule providing inline - * expression rules. FunctionRule: A rule providing a binding to an HTTP Triggered Azure Function. WebhookRule: A - * rule providing a binding to a webserver following OAuth2.0 authentication protocol. + * Get the prioritizationRule property: The rule to determine a priority score for a given job. * * @return the prioritizationRule value. */ @@ -154,12 +138,7 @@ public RouterRule getPrioritizationRule() { } /** - * Set the prioritizationRule property: A rule of one of the following types: - * - *

StaticRule: A rule providing static rules that always return the same result, regardless of input. - * DirectMapRule: A rule that return the same labels as the input labels. ExpressionRule: A rule providing inline - * expression rules. FunctionRule: A rule providing a binding to an HTTP Triggered Azure Function. WebhookRule: A - * rule providing a binding to a webserver following OAuth2.0 authentication protocol. + * Set the prioritizationRule property: The rule to determine a priority score for a given job. * * @param prioritizationRule the prioritizationRule value to set. * @return the ClassificationPolicy object itself. @@ -171,7 +150,7 @@ public ClassificationPolicy setPrioritizationRule(RouterRule prioritizationRule) } /* - * Concurrency Token. + * The entity tag for this resource. */ @Generated @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) @@ -191,7 +170,7 @@ public ClassificationPolicy setPrioritizationRule(RouterRule prioritizationRule) private List workerSelectorAttachments; /** - * Get the etag property: Concurrency Token. + * Get the etag property: The entity tag for this resource. * * @return the etag value. */ diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ConditionalQueueSelectorAttachment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ConditionalQueueSelectorAttachment.java index adca7630e5a2..c7390418fd66 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ConditionalQueueSelectorAttachment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ConditionalQueueSelectorAttachment.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; @@ -18,19 +18,7 @@ public final class ConditionalQueueSelectorAttachment extends QueueSelectorAttachment { /* - * A rule of one of the following types: - * - * StaticRule: A rule - * providing static rules that always return the same result, regardless of - * input. - * DirectMapRule: A rule that return the same labels as the input - * labels. - * ExpressionRule: A rule providing inline expression - * rules. - * FunctionRule: A rule providing a binding to an HTTP Triggered Azure - * Function. - * WebhookRule: A rule providing a binding to a webserver following - * OAuth2.0 authentication protocol. + * The condition that must be true for the queue selectors to be attached */ @Generated @JsonProperty(value = "condition") @@ -59,12 +47,7 @@ public ConditionalQueueSelectorAttachment( } /** - * Get the condition property: A rule of one of the following types: - * - *

StaticRule: A rule providing static rules that always return the same result, regardless of input. - * DirectMapRule: A rule that return the same labels as the input labels. ExpressionRule: A rule providing inline - * expression rules. FunctionRule: A rule providing a binding to an HTTP Triggered Azure Function. WebhookRule: A - * rule providing a binding to a webserver following OAuth2.0 authentication protocol. + * Get the condition property: The condition that must be true for the queue selectors to be attached. * * @return the condition value. */ diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ConditionalWorkerSelectorAttachment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ConditionalWorkerSelectorAttachment.java index 04919d68814f..ef73b387b64e 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ConditionalWorkerSelectorAttachment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ConditionalWorkerSelectorAttachment.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; @@ -18,19 +18,7 @@ public final class ConditionalWorkerSelectorAttachment extends WorkerSelectorAttachment { /* - * A rule of one of the following types: - * - * StaticRule: A rule - * providing static rules that always return the same result, regardless of - * input. - * DirectMapRule: A rule that return the same labels as the input - * labels. - * ExpressionRule: A rule providing inline expression - * rules. - * FunctionRule: A rule providing a binding to an HTTP Triggered Azure - * Function. - * WebhookRule: A rule providing a binding to a webserver following - * OAuth2.0 authentication protocol. + * The condition that must be true for the worker selectors to be attached */ @Generated @JsonProperty(value = "condition") @@ -59,12 +47,7 @@ public ConditionalWorkerSelectorAttachment( } /** - * Get the condition property: A rule of one of the following types: - * - *

StaticRule: A rule providing static rules that always return the same result, regardless of input. - * DirectMapRule: A rule that return the same labels as the input labels. ExpressionRule: A rule providing inline - * expression rules. FunctionRule: A rule providing a binding to an HTTP Triggered Azure Function. WebhookRule: A - * rule providing a binding to a webserver following OAuth2.0 authentication protocol. + * Get the condition property: The condition that must be true for the worker selectors to be attached. * * @return the condition value. */ diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DirectMapRouterRule.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DirectMapRouterRule.java index dde017c25f8f..8e56fe18d84f 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DirectMapRouterRule.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DirectMapRouterRule.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; @@ -10,7 +10,7 @@ /** A rule that return the same labels as the input labels. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("direct-map-rule") +@JsonTypeName("directMap") @Immutable public final class DirectMapRouterRule extends RouterRule { diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DistributionMode.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DistributionMode.java index 0667cec64938..c553f53b1bdb 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DistributionMode.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DistributionMode.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; @@ -18,9 +18,9 @@ defaultImpl = DistributionMode.class) @JsonTypeName("DistributionMode") @JsonSubTypes({ - @JsonSubTypes.Type(name = "best-worker", value = BestWorkerMode.class), - @JsonSubTypes.Type(name = "longest-idle", value = LongestIdleMode.class), - @JsonSubTypes.Type(name = "round-robin", value = RoundRobinMode.class) + @JsonSubTypes.Type(name = "bestWorker", value = BestWorkerMode.class), + @JsonSubTypes.Type(name = "longestIdle", value = LongestIdleMode.class), + @JsonSubTypes.Type(name = "roundRobin", value = RoundRobinMode.class) }) @Fluent public class DistributionMode { diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DistributionPolicy.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DistributionPolicy.java index 6af241feae0a..6ca6321cf4d9 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DistributionPolicy.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/DistributionPolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.communication.jobrouter.implementation.accesshelpers.DistributionPolicyConstructorProxy; @@ -9,7 +9,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonProperty; - import java.time.Duration; /** Policy governing how jobs are distributed to workers. */ @@ -54,7 +53,6 @@ public DistributionPolicy() {} */ DistributionPolicy(DistributionPolicyInternal internal) { id = internal.getId(); - setName(internal.getName()); setMode(DistributionPolicyAdapter.convertDistributionModeToPublic(internal.getMode())); setOfferExpiresAfter(Duration.ofSeconds(internal.getOfferExpiresAfterSeconds().longValue())); @@ -97,8 +95,8 @@ public DistributionPolicy setName(String name) { } /** - * Get the offerExpiresAfter property: The duration after which any offers created under this policy - * will be expired. + * Get the offerExpiresAfter property: The duration after which any offers created under this policy will be + * expired. * * @return the offerExpiresAfter value. */ @@ -107,8 +105,8 @@ public Duration getOfferExpiresAfter() { } /** - * Set the offerExpiresAfter property: The duration after which any offers created under this policy - * will be expired. + * Set the offerExpiresAfter property: The duration after which any offers created under this policy will be + * expired. * * @param offerExpiresAfter the offerExpiresAfter value to set. * @return the DistributionPolicy object itself. @@ -141,14 +139,14 @@ public DistributionPolicy setMode(DistributionMode mode) { } /* - * Concurrency Token. + * The entity tag for this resource. */ @Generated @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; /** - * Get the etag property: Concurrency Token. + * Get the etag property: The entity tag for this resource. * * @return the etag value. */ @@ -156,4 +154,35 @@ public DistributionPolicy setMode(DistributionMode mode) { public String getEtag() { return this.etag; } + + /* + * The number of seconds after which any offers created under this policy will be expired. + */ + @Generated + @JsonProperty(value = "offerExpiresAfterSeconds") + private Double offerExpiresAfterSeconds; + + /** + * Get the offerExpiresAfterSeconds property: The number of seconds after which any offers created under this policy + * will be expired. + * + * @return the offerExpiresAfterSeconds value. + */ + @Generated + public Double getOfferExpiresAfterSeconds() { + return this.offerExpiresAfterSeconds; + } + + /** + * Set the offerExpiresAfterSeconds property: The number of seconds after which any offers created under this policy + * will be expired. + * + * @param offerExpiresAfterSeconds the offerExpiresAfterSeconds value to set. + * @return the DistributionPolicy object itself. + */ + @Generated + public DistributionPolicy setOfferExpiresAfterSeconds(Double offerExpiresAfterSeconds) { + this.offerExpiresAfterSeconds = offerExpiresAfterSeconds; + return this; + } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionAction.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionAction.java index 77f1c85afca0..c29e3c78d1be 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionAction.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionAction.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -19,10 +19,10 @@ @JsonTypeName("ExceptionAction") @JsonSubTypes({ @JsonSubTypes.Type(name = "cancel", value = CancelExceptionAction.class), - @JsonSubTypes.Type(name = "manual-reclassify", value = ManualReclassifyExceptionAction.class), + @JsonSubTypes.Type(name = "manualReclassify", value = ManualReclassifyExceptionAction.class), @JsonSubTypes.Type(name = "reclassify", value = ReclassifyExceptionAction.class) }) -@Immutable +@Fluent public class ExceptionAction { /** Creates an instance of ExceptionAction class. */ @@ -33,7 +33,7 @@ public ExceptionAction() {} * Unique Id of the exception action */ @Generated - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "id") private String id; /** @@ -45,4 +45,16 @@ public ExceptionAction() {} public String getId() { return this.id; } + + /** + * Set the id property: Unique Id of the exception action. + * + * @param id the id value to set. + * @return the ExceptionAction object itself. + */ + @Generated + public ExceptionAction setId(String id) { + this.id = id; + return this; + } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionPolicy.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionPolicy.java index f7b0ef1014bb..60d8d4149dd2 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionPolicy.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionPolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.communication.jobrouter.implementation.accesshelpers.ExceptionPolicyConstructorProxy; @@ -9,7 +9,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonProperty; - import java.util.List; /** A policy that defines actions to execute when exception are triggered. */ @@ -119,7 +118,6 @@ public ExceptionPolicy setExceptionRules(List exceptionRules) { */ ExceptionPolicy(ExceptionPolicyInternal internal) { id = internal.getId(); - setName(internal.getName()); setExceptionRules(ExceptionPolicyAdapter.convertExceptionRulesToPublic(internal.getExceptionRules())); } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionRule.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionRule.java index fabde06e21fd..1b2bca426b6e 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionRule.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionRule.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionTrigger.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionTrigger.java index 0ef147497149..d9d06c3aeef3 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionTrigger.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExceptionTrigger.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; @@ -17,8 +17,8 @@ defaultImpl = ExceptionTrigger.class) @JsonTypeName("ExceptionTrigger") @JsonSubTypes({ - @JsonSubTypes.Type(name = "queue-length", value = QueueLengthExceptionTrigger.class), - @JsonSubTypes.Type(name = "wait-time", value = WaitTimeExceptionTrigger.class) + @JsonSubTypes.Type(name = "queueLength", value = QueueLengthExceptionTrigger.class), + @JsonSubTypes.Type(name = "waitTime", value = WaitTimeExceptionTrigger.class) }) @Immutable public class ExceptionTrigger { diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExpressionRouterRule.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExpressionRouterRule.java index 00ec86e1ec42..a5373f25e31b 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExpressionRouterRule.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExpressionRouterRule.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; @@ -12,7 +12,7 @@ /** A rule providing inline expression rules. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("expression-rule") +@JsonTypeName("expression") @Fluent public final class ExpressionRouterRule extends RouterRule { diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExpressionRouterRuleLanguage.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExpressionRouterRuleLanguage.java index 63a12bc123e8..45df92c8d36f 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExpressionRouterRuleLanguage.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ExpressionRouterRuleLanguage.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/FunctionRouterRule.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/FunctionRouterRule.java index 77473ba1326e..3e29dd6e82cd 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/FunctionRouterRule.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/FunctionRouterRule.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; @@ -12,7 +12,7 @@ /** A rule providing a binding to an HTTP Triggered Azure Function. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("azure-function-rule") +@JsonTypeName("function") @Fluent public final class FunctionRouterRule extends RouterRule { diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/FunctionRouterRuleCredential.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/FunctionRouterRuleCredential.java index ec4aef7867f6..8ca0b2f4ce46 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/FunctionRouterRuleCredential.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/FunctionRouterRuleCredential.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/JobMatchingMode.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/JobMatchingMode.java index e535c8fe1b30..40a2a5f967df 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/JobMatchingMode.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/JobMatchingMode.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; @@ -22,8 +22,8 @@ defaultImpl = JobMatchingMode.class) @JsonTypeName("JobMatchingMode") @JsonSubTypes({ - @JsonSubTypes.Type(name = "schedule-and-suspend", value = ScheduleAndSuspendMode.class), - @JsonSubTypes.Type(name = "queue-and-match", value = QueueAndMatchMode.class), + @JsonSubTypes.Type(name = "scheduleAndSuspend", value = ScheduleAndSuspendMode.class), + @JsonSubTypes.Type(name = "queueAndMatch", value = QueueAndMatchMode.class), @JsonSubTypes.Type(name = "suspend", value = SuspendMode.class) }) @Immutable diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/LabelOperator.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/LabelOperator.java index 15c11e29455d..e1722600fb62 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/LabelOperator.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/LabelOperator.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/LongestIdleMode.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/LongestIdleMode.java index 444902b8b58d..db55577df97d 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/LongestIdleMode.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/LongestIdleMode.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; @@ -10,7 +10,7 @@ /** Jobs are directed to the worker who has been idle longest. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("longest-idle") +@JsonTypeName("longestIdle") @Fluent public final class LongestIdleMode extends DistributionMode { diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ManualReclassifyExceptionAction.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ManualReclassifyExceptionAction.java index 969305fb58f6..af0ff0937fe3 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ManualReclassifyExceptionAction.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ManualReclassifyExceptionAction.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; @@ -12,7 +12,7 @@ /** An action that manually reclassifies a job by providing the queue, priority and worker selectors. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("manual-reclassify") +@JsonTypeName("manualReclassify") @Fluent public final class ManualReclassifyExceptionAction extends ExceptionAction { @@ -106,4 +106,12 @@ public ManualReclassifyExceptionAction setWorkerSelectors(List labe this.labelsToUpsert = labelsToUpsert; return this; } + + /** {@inheritDoc} */ + @Generated + @Override + public ReclassifyExceptionAction setId(String id) { + super.setId(id); + return this; + } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RoundRobinMode.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RoundRobinMode.java index 5691a8229d4d..29620d732ba7 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RoundRobinMode.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RoundRobinMode.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; @@ -12,7 +12,7 @@ * Jobs are distributed in order to workers, starting with the worker that is after the last worker to receive a job. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("round-robin") +@JsonTypeName("roundRobin") @Fluent public final class RoundRobinMode extends DistributionMode { diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterChannel.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterChannel.java index ec9528613766..cb3c56f7f76b 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterChannel.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterChannel.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJob.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJob.java index a81e2b63829e..1f78f9c93246 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJob.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJob.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.communication.jobrouter.implementation.accesshelpers.RouterJobConstructorProxy; @@ -10,7 +10,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonProperty; - import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -84,16 +83,15 @@ public final class RouterJob { private String dispositionCode; /* - * A collection of manually specified label selectors, which a worker must satisfy - * in order to process this job. + * A collection of manually specified label selectors, which a worker must satisfy in order to process this job. */ @Generated @JsonProperty(value = "requestedWorkerSelectors") private List requestedWorkerSelectors; /* - * A collection of label selectors attached by a classification policy, which a - * worker must satisfy in order to process this job. + * A collection of label selectors attached by a classification policy, which a worker must satisfy in order to + * process this job. */ @Generated @JsonProperty(value = "attachedWorkerSelectors", access = JsonProperty.Access.WRITE_ONLY) @@ -107,8 +105,7 @@ public final class RouterJob { private Map labels; /* - * A collection of the assignments of the job. - * Key is AssignmentId. + * A collection of the assignments of the job. Key is AssignmentId. */ @Generated @JsonProperty(value = "assignments", access = JsonProperty.Access.WRITE_ONLY) @@ -135,18 +132,7 @@ public final class RouterJob { private OffsetDateTime scheduledAt; /* - * The matching mode to be applied to this job. - * - * Supported types: - * - * - * QueueAndMatchMode: Used when matching worker to a job is required to be - * done right after job is queued. - * ScheduleAndSuspendMode: Used for scheduling - * jobs to be queued at a future time. At specified time, matching of a worker to - * the job will not start automatically. - * SuspendMode: Used when matching workers - * to a job needs to be suspended. + * If provided, will determine how job matching will be carried out. Default mode: QueueAndMatchMode. */ @Generated @JsonProperty(value = "matchingMode") @@ -163,30 +149,40 @@ public RouterJob() {} */ RouterJob(RouterJobInternal internal) { id = internal.getId(); - requestedWorkerSelectors = internal.getRequestedWorkerSelectors().stream() - .map(ws -> LabelSelectorAdapter.convertWorkerSelectorToPublic(ws)) - .collect(Collectors.toList()); - attachedWorkerSelectors = internal.getAttachedWorkerSelectors().stream() - .map(ws -> LabelSelectorAdapter.convertWorkerSelectorToPublic(ws)) - .collect(Collectors.toList()); - assignments = internal.getAssignments().entrySet().stream() - .collect(Collectors.toMap(Map.Entry::getKey, entry -> entry.getValue())); + requestedWorkerSelectors = + internal.getRequestedWorkerSelectors().stream() + .map(ws -> LabelSelectorAdapter.convertWorkerSelectorToPublic(ws)) + .collect(Collectors.toList()); + attachedWorkerSelectors = + internal.getAttachedWorkerSelectors().stream() + .map(ws -> LabelSelectorAdapter.convertWorkerSelectorToPublic(ws)) + .collect(Collectors.toList()); + assignments = + internal.getAssignments().entrySet().stream() + .collect(Collectors.toMap(Map.Entry::getKey, entry -> entry.getValue())); status = RouterJobStatus.fromString(internal.getStatus().toString()); enqueuedAt = internal.getEnqueuedAt(); scheduledAt = internal.getScheduledAt(); - setChannelId(internal.getChannelId()); setChannelReference(internal.getChannelReference()); setQueueId(internal.getQueueId()); - setLabels(internal.getLabels().entrySet().stream() - .collect(Collectors.toMap(Map.Entry::getKey, entry -> RouterValueConstructorProxy.create(entry.getValue())))); + setLabels( + internal.getLabels().entrySet().stream() + .collect( + Collectors.toMap( + Map.Entry::getKey, + entry -> RouterValueConstructorProxy.create(entry.getValue())))); setNotes(internal.getNotes()); setPriority(internal.getPriority()); setClassificationPolicyId(internal.getClassificationPolicyId()); setDispositionCode(internal.getDispositionCode()); setClassificationPolicyId(internal.getClassificationPolicyId()); - setTags(internal.getTags().entrySet().stream() - .collect(Collectors.toMap(Map.Entry::getKey, entry -> RouterValueConstructorProxy.create(entry.getValue())))); + setTags( + internal.getTags().entrySet().stream() + .collect( + Collectors.toMap( + Map.Entry::getKey, + entry -> RouterValueConstructorProxy.create(entry.getValue())))); setMatchingMode(internal.getMatchingMode()); } @@ -194,7 +190,6 @@ public RouterJob() {} RouterJobConstructorProxy.setAccessor(internal -> new RouterJob(internal)); } - /** * Get the id property: The id of the job. * @@ -465,14 +460,8 @@ public OffsetDateTime getScheduledAt() { } /** - * Get the matchingMode property: The matching mode to be applied to this job. - * - *

Supported types: - * - *

QueueAndMatchMode: Used when matching worker to a job is required to be done right after job is queued. - * ScheduleAndSuspendMode: Used for scheduling jobs to be queued at a future time. At specified time, matching of a - * worker to the job will not start automatically. SuspendMode: Used when matching workers to a job needs to be - * suspended. + * Get the matchingMode property: If provided, will determine how job matching will be carried out. Default mode: + * QueueAndMatchMode. * * @return the matchingMode value. */ @@ -482,14 +471,8 @@ public JobMatchingMode getMatchingMode() { } /** - * Set the matchingMode property: The matching mode to be applied to this job. - * - *

Supported types: - * - *

QueueAndMatchMode: Used when matching worker to a job is required to be done right after job is queued. - * ScheduleAndSuspendMode: Used for scheduling jobs to be queued at a future time. At specified time, matching of a - * worker to the job will not start automatically. SuspendMode: Used when matching workers to a job needs to be - * suspended. + * Set the matchingMode property: If provided, will determine how job matching will be carried out. Default mode: + * QueueAndMatchMode. * * @param matchingMode the matchingMode value to set. * @return the RouterJob object itself. @@ -501,14 +484,14 @@ public RouterJob setMatchingMode(JobMatchingMode matchingMode) { } /* - * Concurrency Token. + * The entity tag for this resource. */ @Generated @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; /** - * Get the etag property: Concurrency Token. + * Get the etag property: The entity tag for this resource. * * @return the etag value. */ diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobAssignment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobAssignment.java index c425df7d71d3..2ebe869150cb 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobAssignment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobAssignment.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; @@ -17,7 +17,7 @@ public final class RouterJobAssignment { * The Id of the job assignment. */ @Generated - @JsonProperty(value = "assignmentId") + @JsonProperty(value = "assignmentId", access = JsonProperty.Access.WRITE_ONLY) private String assignmentId; /* @@ -48,21 +48,6 @@ public final class RouterJobAssignment { @JsonProperty(value = "closedAt") private OffsetDateTime closedAt; - /** - * Creates an instance of RouterJobAssignment class. - * - * @param assignmentId the assignmentId value to set. - * @param assignedAt the assignedAt value to set. - */ - @Generated - @JsonCreator - private RouterJobAssignment( - @JsonProperty(value = "assignmentId") String assignmentId, - @JsonProperty(value = "assignedAt") OffsetDateTime assignedAt) { - this.assignmentId = assignmentId; - this.assignedAt = assignedAt; - } - /** * Get the assignmentId property: The Id of the job assignment. * @@ -112,4 +97,15 @@ public OffsetDateTime getCompletedAt() { public OffsetDateTime getClosedAt() { return this.closedAt; } + + /** + * Creates an instance of RouterJobAssignment class. + * + * @param assignedAt the assignedAt value to set. + */ + @Generated + @JsonCreator + private RouterJobAssignment(@JsonProperty(value = "assignedAt") OffsetDateTime assignedAt) { + this.assignedAt = assignedAt; + } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobNote.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobNote.java index 1f5a81e2bbe2..3b5739db4823 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobNote.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobNote.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobOffer.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobOffer.java index bcaa3bf254e1..d6442c306501 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobOffer.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobOffer.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; @@ -17,7 +17,7 @@ public final class RouterJobOffer { * The Id of the offer. */ @Generated - @JsonProperty(value = "offerId") + @JsonProperty(value = "offerId", access = JsonProperty.Access.WRITE_ONLY) private String offerId; /* @@ -48,24 +48,6 @@ public final class RouterJobOffer { @JsonProperty(value = "expiresAt") private OffsetDateTime expiresAt; - /** - * Creates an instance of RouterJobOffer class. - * - * @param offerId the offerId value to set. - * @param jobId the jobId value to set. - * @param capacityCost the capacityCost value to set. - */ - @Generated - @JsonCreator - private RouterJobOffer( - @JsonProperty(value = "offerId") String offerId, - @JsonProperty(value = "jobId") String jobId, - @JsonProperty(value = "capacityCost") int capacityCost) { - this.offerId = offerId; - this.jobId = jobId; - this.capacityCost = capacityCost; - } - /** * Get the offerId property: The Id of the offer. * @@ -115,4 +97,18 @@ public OffsetDateTime getOfferedAt() { public OffsetDateTime getExpiresAt() { return this.expiresAt; } + + /** + * Creates an instance of RouterJobOffer class. + * + * @param jobId the jobId value to set. + * @param capacityCost the capacityCost value to set. + */ + @Generated + @JsonCreator + private RouterJobOffer( + @JsonProperty(value = "jobId") String jobId, @JsonProperty(value = "capacityCost") int capacityCost) { + this.jobId = jobId; + this.capacityCost = capacityCost; + } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobPositionDetails.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobPositionDetails.java index 7d8dac21ca9c..3139d95b86d3 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobPositionDetails.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobPositionDetails.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobStatus.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobStatus.java index 3adbbc49af17..85058daa0c37 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobStatus.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobStatusSelector.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobStatusSelector.java index 76f61b53b72a..1dddbfe1985c 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobStatusSelector.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterJobStatusSelector.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterQueue.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterQueue.java index d1e7b7a08c87..722b58141fc4 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterQueue.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterQueue.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.communication.jobrouter.implementation.accesshelpers.RouterQueueConstructorProxy; @@ -9,7 +9,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonProperty; - import java.util.Map; import java.util.stream.Collectors; @@ -32,8 +31,7 @@ public final class RouterQueue { private String name; /* - * The ID of the distribution policy that will determine how a job is distributed - * to workers. + * The ID of the distribution policy that will determine how a job is distributed to workers. */ @Generated @JsonProperty(value = "distributionPolicyId") @@ -47,8 +45,7 @@ public final class RouterQueue { private Map labels; /* - * (Optional) The ID of the exception policy that determines various job - * escalation rules. + * The ID of the exception policy that determines various job escalation rules. */ @Generated @JsonProperty(value = "exceptionPolicyId") @@ -65,15 +62,17 @@ public final class RouterQueue { */ RouterQueue(RouterQueueInternal internal) { id = internal.getId(); - setName(internal.getName()); setDistributionPolicyId(internal.getDistributionPolicyId()); setExceptionPolicyId(internal.getExceptionPolicyId()); - setLabels(internal.getLabels().entrySet().stream() - .collect(Collectors.toMap(entry -> entry.getKey(), entry -> RouterValueConstructorProxy.create(entry.getValue())))); + setLabels( + internal.getLabels().entrySet().stream() + .collect( + Collectors.toMap( + entry -> entry.getKey(), + entry -> RouterValueConstructorProxy.create(entry.getValue())))); } - /** Creates an instance of RouterQueue class. */ @Generated public RouterQueue() {} @@ -157,8 +156,7 @@ public RouterQueue setLabels(Map labels) { } /** - * Get the exceptionPolicyId property: (Optional) The ID of the exception policy that determines various job - * escalation rules. + * Get the exceptionPolicyId property: The ID of the exception policy that determines various job escalation rules. * * @return the exceptionPolicyId value. */ @@ -168,8 +166,7 @@ public String getExceptionPolicyId() { } /** - * Set the exceptionPolicyId property: (Optional) The ID of the exception policy that determines various job - * escalation rules. + * Set the exceptionPolicyId property: The ID of the exception policy that determines various job escalation rules. * * @param exceptionPolicyId the exceptionPolicyId value to set. * @return the RouterQueue object itself. @@ -181,14 +178,14 @@ public RouterQueue setExceptionPolicyId(String exceptionPolicyId) { } /* - * Concurrency Token. + * The entity tag for this resource. */ @Generated @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; /** - * Get the etag property: Concurrency Token. + * Get the etag property: The entity tag for this resource. * * @return the etag value. */ diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterQueueSelector.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterQueueSelector.java index a0c6fe71bb47..d0da5d19e33c 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterQueueSelector.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterQueueSelector.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; @@ -20,8 +20,7 @@ public final class RouterQueueSelector { private String key; /* - * Describes how the value of the label is compared to the value defined on the - * label selector + * Describes how the value of the label is compared to the value defined on the label selector */ @Generated @JsonProperty(value = "labelOperator") diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterQueueStatistics.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterQueueStatistics.java index 9de9dfe86180..1f3ccce39531 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterQueueStatistics.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterQueueStatistics.java @@ -1,13 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; - import java.time.Duration; import java.util.Map; @@ -97,4 +96,22 @@ public Map getEstimatedWaitTime() { public Double getLongestJobWaitTimeMinutes() { return this.longestJobWaitTimeMinutes; } + + /* + * The estimated wait time of this queue rounded up to the nearest minute, grouped by job priority + */ + @Generated + @JsonProperty(value = "estimatedWaitTimeMinutes") + private Map estimatedWaitTimeMinutes; + + /** + * Get the estimatedWaitTimeMinutes property: The estimated wait time of this queue rounded up to the nearest + * minute, grouped by job priority. + * + * @return the estimatedWaitTimeMinutes value. + */ + @Generated + public Map getEstimatedWaitTimeMinutes() { + return this.estimatedWaitTimeMinutes; + } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterRule.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterRule.java index 1ac511771c77..9200290180eb 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterRule.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterRule.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; @@ -22,11 +22,11 @@ defaultImpl = RouterRule.class) @JsonTypeName("RouterRule") @JsonSubTypes({ - @JsonSubTypes.Type(name = "direct-map-rule", value = DirectMapRouterRule.class), - @JsonSubTypes.Type(name = "expression-rule", value = ExpressionRouterRule.class), - @JsonSubTypes.Type(name = "azure-function-rule", value = FunctionRouterRule.class), - @JsonSubTypes.Type(name = "static-rule", value = StaticRouterRule.class), - @JsonSubTypes.Type(name = "webhook-rule", value = WebhookRouterRule.class) + @JsonSubTypes.Type(name = "directMap", value = DirectMapRouterRule.class), + @JsonSubTypes.Type(name = "expression", value = ExpressionRouterRule.class), + @JsonSubTypes.Type(name = "function", value = FunctionRouterRule.class), + @JsonSubTypes.Type(name = "static", value = StaticRouterRule.class), + @JsonSubTypes.Type(name = "webhook", value = WebhookRouterRule.class) }) @Immutable public class RouterRule { diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorker.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorker.java index 5c77730a2205..16a74652c0c8 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorker.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorker.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.communication.jobrouter.implementation.accesshelpers.RouterValueConstructorProxy; @@ -9,7 +9,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonProperty; - import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -60,8 +59,8 @@ public final class RouterWorker { private List assignedJobs; /* - * A value indicating the workers capacity. A value of '1' means all capacity is - * consumed. A value of '0' means no capacity is currently consumed. + * A value indicating the workers capacity. A value of '1' means all capacity is consumed. A value of '0' means no + * capacity is currently consumed. */ @Generated @JsonProperty(value = "loadRatio", access = JsonProperty.Access.WRITE_ONLY) @@ -89,11 +88,18 @@ public RouterWorker() {} offers = internal.getOffers(); assignedJobs = internal.getAssignedJobs(); loadRatio = internal.getLoadRatio(); - - setLabels(internal.getLabels().entrySet().stream() - .collect(Collectors.toMap(Map.Entry::getKey, entry -> RouterValueConstructorProxy.create(entry.getValue())))); - setTags(internal.getTags().entrySet().stream() - .collect(Collectors.toMap(Map.Entry::getKey, entry -> RouterValueConstructorProxy.create(entry.getValue())))); + setLabels( + internal.getLabels().entrySet().stream() + .collect( + Collectors.toMap( + Map.Entry::getKey, + entry -> RouterValueConstructorProxy.create(entry.getValue())))); + setTags( + internal.getTags().entrySet().stream() + .collect( + Collectors.toMap( + Map.Entry::getKey, + entry -> RouterValueConstructorProxy.create(entry.getValue())))); setQueues(internal.getQueues()); setAvailableForOffers(internal.isAvailableForOffers()); setChannels(internal.getChannels()); @@ -104,7 +110,6 @@ public RouterWorker() {} RouterWorkerConstructorProxy.setAccessor(internal -> new RouterWorker(internal)); } - /** * Get the id property: Id of the worker. * @@ -221,7 +226,7 @@ public RouterWorker setAvailableForOffers(Boolean availableForOffers) { } /* - * Concurrency Token. + * The entity tag for this resource. */ @Generated @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) @@ -249,7 +254,7 @@ public RouterWorker setAvailableForOffers(Boolean availableForOffers) { private List channels; /** - * Get the etag property: Concurrency Token. + * Get the etag property: The entity tag for this resource. * * @return the etag value. */ diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorkerAssignment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorkerAssignment.java index 028ebb563a0c..547848dd61a1 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorkerAssignment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorkerAssignment.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorkerSelector.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorkerSelector.java index f53281ca33f4..fa44a650a63a 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorkerSelector.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorkerSelector.java @@ -1,13 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; - import java.time.Duration; import java.time.OffsetDateTime; @@ -23,8 +22,7 @@ public final class RouterWorkerSelector { private String key; /* - * Describes how the value of the label is compared to the value defined on the - * label selector + * Describes how the value of the label is compared to the value defined on the label selector */ @Generated @JsonProperty(value = "labelOperator") @@ -180,4 +178,33 @@ public RouterWorkerSelectorStatus getStatus() { public OffsetDateTime getExpiresAt() { return this.expiresAt; } + + /* + * Describes how long this label selector is valid in seconds. + */ + @Generated + @JsonProperty(value = "expiresAfterSeconds") + private Double expiresAfterSeconds; + + /** + * Get the expiresAfterSeconds property: Describes how long this label selector is valid in seconds. + * + * @return the expiresAfterSeconds value. + */ + @Generated + public Double getExpiresAfterSeconds() { + return this.expiresAfterSeconds; + } + + /** + * Set the expiresAfterSeconds property: Describes how long this label selector is valid in seconds. + * + * @param expiresAfterSeconds the expiresAfterSeconds value to set. + * @return the RouterWorkerSelector object itself. + */ + @Generated + public RouterWorkerSelector setExpiresAfterSeconds(Double expiresAfterSeconds) { + this.expiresAfterSeconds = expiresAfterSeconds; + return this; + } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorkerSelectorStatus.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorkerSelectorStatus.java index 10f227759afb..c88da12e0980 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorkerSelectorStatus.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorkerSelectorStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorkerState.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorkerState.java index fa776cf99feb..d6cf090516c3 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorkerState.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorkerState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorkerStateSelector.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorkerStateSelector.java index 29e47db55aac..6d852550c833 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorkerStateSelector.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RouterWorkerStateSelector.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RuleEngineQueueSelectorAttachment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RuleEngineQueueSelectorAttachment.java index b9acff00c72f..81ff9a3ce495 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RuleEngineQueueSelectorAttachment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RuleEngineQueueSelectorAttachment.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; @@ -12,24 +12,12 @@ /** Attaches queue selectors to a job when the RouterRule is resolved. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("rule-engine") +@JsonTypeName("ruleEngine") @Immutable public final class RuleEngineQueueSelectorAttachment extends QueueSelectorAttachment { /* - * A rule of one of the following types: - * - * StaticRule: A rule - * providing static rules that always return the same result, regardless of - * input. - * DirectMapRule: A rule that return the same labels as the input - * labels. - * ExpressionRule: A rule providing inline expression - * rules. - * FunctionRule: A rule providing a binding to an HTTP Triggered Azure - * Function. - * WebhookRule: A rule providing a binding to a webserver following - * OAuth2.0 authentication protocol. + * A RouterRule that resolves a collection of queue selectors to attach */ @Generated @JsonProperty(value = "rule") @@ -47,12 +35,7 @@ public RuleEngineQueueSelectorAttachment(@JsonProperty(value = "rule") RouterRul } /** - * Get the rule property: A rule of one of the following types: - * - *

StaticRule: A rule providing static rules that always return the same result, regardless of input. - * DirectMapRule: A rule that return the same labels as the input labels. ExpressionRule: A rule providing inline - * expression rules. FunctionRule: A rule providing a binding to an HTTP Triggered Azure Function. WebhookRule: A - * rule providing a binding to a webserver following OAuth2.0 authentication protocol. + * Get the rule property: A RouterRule that resolves a collection of queue selectors to attach. * * @return the rule value. */ diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RuleEngineWorkerSelectorAttachment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RuleEngineWorkerSelectorAttachment.java index ecf509730c8c..3cc879acf6cf 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RuleEngineWorkerSelectorAttachment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/RuleEngineWorkerSelectorAttachment.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; @@ -12,24 +12,12 @@ /** Attaches worker selectors to a job when a RouterRule is resolved. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("rule-engine") +@JsonTypeName("ruleEngine") @Immutable public final class RuleEngineWorkerSelectorAttachment extends WorkerSelectorAttachment { /* - * A rule of one of the following types: - * - * StaticRule: A rule - * providing static rules that always return the same result, regardless of - * input. - * DirectMapRule: A rule that return the same labels as the input - * labels. - * ExpressionRule: A rule providing inline expression - * rules. - * FunctionRule: A rule providing a binding to an HTTP Triggered Azure - * Function. - * WebhookRule: A rule providing a binding to a webserver following - * OAuth2.0 authentication protocol. + * A RouterRule that resolves a collection of worker selectors to attach */ @Generated @JsonProperty(value = "rule") @@ -47,12 +35,7 @@ public RuleEngineWorkerSelectorAttachment(@JsonProperty(value = "rule") RouterRu } /** - * Get the rule property: A rule of one of the following types: - * - *

StaticRule: A rule providing static rules that always return the same result, regardless of input. - * DirectMapRule: A rule that return the same labels as the input labels. ExpressionRule: A rule providing inline - * expression rules. FunctionRule: A rule providing a binding to an HTTP Triggered Azure Function. WebhookRule: A - * rule providing a binding to a webserver following OAuth2.0 authentication protocol. + * Get the rule property: A RouterRule that resolves a collection of worker selectors to attach. * * @return the rule value. */ diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ScheduleAndSuspendMode.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ScheduleAndSuspendMode.java index 2582ec713b98..a806335ac3b0 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ScheduleAndSuspendMode.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ScheduleAndSuspendMode.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; @@ -16,7 +16,7 @@ * worker to a job will not start automatically. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("schedule-and-suspend") +@JsonTypeName("scheduleAndSuspend") @Immutable public final class ScheduleAndSuspendMode extends JobMatchingMode { diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ScoringRuleOptions.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ScoringRuleOptions.java index 9b7910b46479..b6631bd1f1e6 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ScoringRuleOptions.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ScoringRuleOptions.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ScoringRuleParameterSelector.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ScoringRuleParameterSelector.java index 66f13af3349a..4c313201a51b 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ScoringRuleParameterSelector.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/ScoringRuleParameterSelector.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/StaticQueueSelectorAttachment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/StaticQueueSelectorAttachment.java index 0a91462bdcfd..172e5dea9387 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/StaticQueueSelectorAttachment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/StaticQueueSelectorAttachment.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; @@ -17,8 +17,7 @@ public final class StaticQueueSelectorAttachment extends QueueSelectorAttachment { /* - * Describes a condition that must be met against a set of labels for queue - * selection + * The queue selector to attach. */ @Generated @JsonProperty(value = "queueSelector") @@ -36,8 +35,7 @@ public StaticQueueSelectorAttachment(@JsonProperty(value = "queueSelector") Rout } /** - * Get the queueSelector property: Describes a condition that must be met against a set of labels for queue - * selection. + * Get the queueSelector property: The queue selector to attach. * * @return the queueSelector value. */ diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/StaticRouterRule.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/StaticRouterRule.java index 85f4708ea934..2ffd42a9753f 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/StaticRouterRule.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/StaticRouterRule.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; @@ -11,7 +11,7 @@ /** A rule providing static rules that always return the same result, regardless of input. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("static-rule") +@JsonTypeName("static") @Fluent public final class StaticRouterRule extends RouterRule { diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/StaticWorkerSelectorAttachment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/StaticWorkerSelectorAttachment.java index 225f3ed64b57..ecfce27bb378 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/StaticWorkerSelectorAttachment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/StaticWorkerSelectorAttachment.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; @@ -17,8 +17,7 @@ public final class StaticWorkerSelectorAttachment extends WorkerSelectorAttachment { /* - * Describes a condition that must be met against a set of labels for worker - * selection + * The worker selector to attach. */ @Generated @JsonProperty(value = "workerSelector") @@ -36,8 +35,7 @@ public StaticWorkerSelectorAttachment(@JsonProperty(value = "workerSelector") Ro } /** - * Get the workerSelector property: Describes a condition that must be met against a set of labels for worker - * selection. + * Get the workerSelector property: The worker selector to attach. * * @return the workerSelector value. */ diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/SuspendMode.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/SuspendMode.java index da928b855974..c3802e72ac20 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/SuspendMode.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/SuspendMode.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/UnassignJobOptions.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/UnassignJobOptions.java index e2634acee37f..ecd2769d872f 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/UnassignJobOptions.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/UnassignJobOptions.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/UnassignJobResult.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/UnassignJobResult.java index 8ba83f33a69e..2990c8b7e96a 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/UnassignJobResult.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/UnassignJobResult.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WaitTimeExceptionTrigger.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WaitTimeExceptionTrigger.java index b91afe3449fb..cccb65278239 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WaitTimeExceptionTrigger.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WaitTimeExceptionTrigger.java @@ -1,19 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; - import java.time.Duration; /** Trigger for an exception action on exceeding wait time. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("wait-time") +@JsonTypeName("waitTime") @Immutable public final class WaitTimeExceptionTrigger extends ExceptionTrigger { @@ -41,4 +41,21 @@ public WaitTimeExceptionTrigger(@JsonProperty(value = "thresholdSeconds") Durati public Duration getThreshold() { return this.threshold; } + + /* + * Threshold for wait time for this trigger. + */ + @Generated + @JsonProperty(value = "thresholdSeconds") + private double thresholdSeconds; + + /** + * Get the thresholdSeconds property: Threshold for wait time for this trigger. + * + * @return the thresholdSeconds value. + */ + @Generated + public double getThresholdSeconds() { + return this.thresholdSeconds; + } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WebhookRouterRule.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WebhookRouterRule.java index 9985bfc941e0..b75db0c477e8 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WebhookRouterRule.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WebhookRouterRule.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Fluent; @@ -11,7 +11,7 @@ /** A rule providing a binding to an external web server. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("webhook-rule") +@JsonTypeName("webhook") @Fluent public final class WebhookRouterRule extends RouterRule { diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WeightedAllocationQueueSelectorAttachment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WeightedAllocationQueueSelectorAttachment.java index 94d75d755df0..9d49bc1f043f 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WeightedAllocationQueueSelectorAttachment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WeightedAllocationQueueSelectorAttachment.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; @@ -13,7 +13,7 @@ /** Describes multiple sets of queue selectors, of which one will be selected and attached according to a weighting. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("weighted-allocation-queue-selector") +@JsonTypeName("weightedAllocation") @Immutable public final class WeightedAllocationQueueSelectorAttachment extends QueueSelectorAttachment { diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WeightedAllocationWorkerSelectorAttachment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WeightedAllocationWorkerSelectorAttachment.java index e7a2f0259c1b..9499bf96bbad 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WeightedAllocationWorkerSelectorAttachment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WeightedAllocationWorkerSelectorAttachment.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; @@ -13,7 +13,7 @@ /** Describes multiple sets of worker selectors, of which one will be selected and attached according to a weighting. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("weighted-allocation-worker-selector") +@JsonTypeName("weightedAllocation") @Immutable public final class WeightedAllocationWorkerSelectorAttachment extends WorkerSelectorAttachment { diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WorkerSelectorAttachment.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WorkerSelectorAttachment.java index 08d260814862..2bdfdd4dde40 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WorkerSelectorAttachment.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WorkerSelectorAttachment.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; @@ -18,12 +18,10 @@ @JsonTypeName("WorkerSelectorAttachment") @JsonSubTypes({ @JsonSubTypes.Type(name = "conditional", value = ConditionalWorkerSelectorAttachment.class), - @JsonSubTypes.Type(name = "pass-through", value = PassThroughWorkerSelectorAttachment.class), - @JsonSubTypes.Type(name = "rule-engine", value = RuleEngineWorkerSelectorAttachment.class), + @JsonSubTypes.Type(name = "passThrough", value = PassThroughWorkerSelectorAttachment.class), + @JsonSubTypes.Type(name = "ruleEngine", value = RuleEngineWorkerSelectorAttachment.class), @JsonSubTypes.Type(name = "static", value = StaticWorkerSelectorAttachment.class), - @JsonSubTypes.Type( - name = "weighted-allocation-worker-selector", - value = WeightedAllocationWorkerSelectorAttachment.class) + @JsonSubTypes.Type(name = "weightedAllocation", value = WeightedAllocationWorkerSelectorAttachment.class) }) @Immutable public class WorkerSelectorAttachment { diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WorkerWeightedAllocation.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WorkerWeightedAllocation.java index 6b5624943abc..a28236e52341 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WorkerWeightedAllocation.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/WorkerWeightedAllocation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.models; import com.azure.core.annotation.Generated; @@ -21,8 +21,7 @@ public final class WorkerWeightedAllocation { private double weight; /* - * A collection of worker selectors that will be applied if this allocation is - * selected. + * A collection of worker selectors that will be applied if this allocation is selected. */ @Generated @JsonProperty(value = "workerSelectors") diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/package-info.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/package-info.java index 32c517cba0a9..9efe06d507e5 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/package-info.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/models/package-info.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - /** Package containing the data models for AzureCommunicationRoutingService. Azure Communication Routing Service. */ package com.azure.communication.jobrouter.models; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/package-info.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/package-info.java index b26631ce1e50..80cb6ebc4abd 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/package-info.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/package-info.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - /** Package containing the classes for AzureCommunicationRoutingService. Azure Communication Routing Service. */ package com.azure.communication.jobrouter; diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/module-info.java b/sdk/communication/azure-communication-jobrouter/src/main/java/module-info.java index bcef7b0d9ec5..644b8dd049e8 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/module-info.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/module-info.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. module com.azure.communication.jobrouter { requires transitive com.azure.core; @@ -9,11 +9,19 @@ exports com.azure.communication.jobrouter; exports com.azure.communication.jobrouter.models; + opens com.azure.communication.jobrouter.implementation.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.communication.jobrouter.models to + com.azure.core, + com.fasterxml.jackson.databind; opens com.azure.communication.jobrouter.models to com.azure.core, com.fasterxml.jackson.databind, com.azure.communication.jobrouter.implementation.converters, com.azure.communication.jobrouter.implementation.models; - - opens com.azure.communication.jobrouter.implementation.models to com.azure.communication.jobrouter.implementation.converters, com.azure.core, com.fasterxml.jackson.databind; + opens com.azure.communication.jobrouter.implementation.models to + com.azure.communication.jobrouter.implementation.converters, + com.azure.core, + com.fasterxml.jackson.databind; } diff --git a/sdk/communication/azure-communication-jobrouter/src/test/java/com/azure/communication/jobrouter/generated/JobRouterAdministrationClientTestBase.java b/sdk/communication/azure-communication-jobrouter/src/test/java/com/azure/communication/jobrouter/generated/JobRouterAdministrationClientTestBase.java index 1c07aec6decb..b0db97f3246a 100644 --- a/sdk/communication/azure-communication-jobrouter/src/test/java/com/azure/communication/jobrouter/generated/JobRouterAdministrationClientTestBase.java +++ b/sdk/communication/azure-communication-jobrouter/src/test/java/com/azure/communication/jobrouter/generated/JobRouterAdministrationClientTestBase.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.communication.jobrouter.generated; diff --git a/sdk/communication/azure-communication-jobrouter/tsp-location.yaml b/sdk/communication/azure-communication-jobrouter/tsp-location.yaml new file mode 100644 index 000000000000..33b6a76b6a67 --- /dev/null +++ b/sdk/communication/azure-communication-jobrouter/tsp-location.yaml @@ -0,0 +1,5 @@ +commit: 952ffd9739be86e9c82c309f12c5c4449b126ca4 +additionalDirectories: [] +directory: specification/communication/Communication.JobRouter +repo: Azure/azure-rest-api-specs +