
com.azure.communication.jobrouter.implementation.JobRouterAdministrationClientImpl Maven / Gradle / Ivy
// 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;
import com.azure.communication.jobrouter.JobRouterServiceVersion;
import com.azure.core.annotation.BodyParam;
import com.azure.core.annotation.Delete;
import com.azure.core.annotation.ExpectedResponses;
import com.azure.core.annotation.Get;
import com.azure.core.annotation.HeaderParam;
import com.azure.core.annotation.Host;
import com.azure.core.annotation.HostParam;
import com.azure.core.annotation.Patch;
import com.azure.core.annotation.PathParam;
import com.azure.core.annotation.QueryParam;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceInterface;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.UnexpectedResponseExceptionType;
import com.azure.core.exception.ClientAuthenticationException;
import com.azure.core.exception.HttpResponseException;
import com.azure.core.exception.ResourceModifiedException;
import com.azure.core.exception.ResourceNotFoundException;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.policy.RetryPolicy;
import com.azure.core.http.policy.UserAgentPolicy;
import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.PagedResponse;
import com.azure.core.http.rest.PagedResponseBase;
import com.azure.core.http.rest.RequestOptions;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.RestProxy;
import com.azure.core.util.BinaryData;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.core.util.UrlBuilder;
import com.azure.core.util.serializer.JacksonAdapter;
import com.azure.core.util.serializer.SerializerAdapter;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import reactor.core.publisher.Mono;
/**
* Initializes a new instance of the JobRouterAdministrationClient type.
*/
public final class JobRouterAdministrationClientImpl {
/**
* The proxy service used to perform REST calls.
*/
private final JobRouterAdministrationClientService service;
/**
* Uri of your Communication resource.
*/
private final String endpoint;
/**
* Gets Uri of your Communication resource.
*
* @return the endpoint value.
*/
public String getEndpoint() {
return this.endpoint;
}
/**
* Service version.
*/
private final JobRouterServiceVersion serviceVersion;
/**
* Gets Service version.
*
* @return the serviceVersion value.
*/
public JobRouterServiceVersion getServiceVersion() {
return this.serviceVersion;
}
/**
* The HTTP pipeline to send requests through.
*/
private final HttpPipeline httpPipeline;
/**
* Gets The HTTP pipeline to send requests through.
*
* @return the httpPipeline value.
*/
public HttpPipeline getHttpPipeline() {
return this.httpPipeline;
}
/**
* The serializer to serialize an object into a string.
*/
private final SerializerAdapter serializerAdapter;
/**
* Gets The serializer to serialize an object into a string.
*
* @return the serializerAdapter value.
*/
public SerializerAdapter getSerializerAdapter() {
return this.serializerAdapter;
}
/**
* Initializes an instance of JobRouterAdministrationClient client.
*
* @param endpoint Uri of your Communication resource.
* @param serviceVersion Service version.
*/
public JobRouterAdministrationClientImpl(String endpoint, JobRouterServiceVersion serviceVersion) {
this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(),
JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion);
}
/**
* Initializes an instance of JobRouterAdministrationClient client.
*
* @param httpPipeline The HTTP pipeline to send requests through.
* @param endpoint Uri of your Communication resource.
* @param serviceVersion Service version.
*/
public JobRouterAdministrationClientImpl(HttpPipeline httpPipeline, String endpoint,
JobRouterServiceVersion serviceVersion) {
this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion);
}
/**
* Initializes an instance of JobRouterAdministrationClient client.
*
* @param httpPipeline The HTTP pipeline to send requests through.
* @param serializerAdapter The serializer to serialize an object into a string.
* @param endpoint Uri of your Communication resource.
* @param serviceVersion Service version.
*/
public JobRouterAdministrationClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter,
String endpoint, JobRouterServiceVersion serviceVersion) {
this.httpPipeline = httpPipeline;
this.serializerAdapter = serializerAdapter;
this.endpoint = endpoint;
this.serviceVersion = serviceVersion;
this.service = RestProxy.create(JobRouterAdministrationClientService.class, this.httpPipeline,
this.getSerializerAdapter());
}
/**
* The interface defining all the services for JobRouterAdministrationClient to be used by the proxy service to
* perform REST calls.
*/
@Host("{endpoint}")
@ServiceInterface(name = "JobRouterAdministrat")
public interface JobRouterAdministrationClientService {
@Patch("/routing/distributionPolicies/{distributionPolicyId}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> upsertDistributionPolicy(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("distributionPolicyId") String distributionPolicyId,
@HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept,
@BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions,
Context context);
@Patch("/routing/distributionPolicies/{distributionPolicyId}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response upsertDistributionPolicySync(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("distributionPolicyId") String distributionPolicyId,
@HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept,
@BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions,
Context context);
@Get("/routing/distributionPolicies/{distributionPolicyId}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> getDistributionPolicy(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("distributionPolicyId") String distributionPolicyId, @HeaderParam("accept") String accept,
RequestOptions requestOptions, Context context);
@Get("/routing/distributionPolicies/{distributionPolicyId}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response getDistributionPolicySync(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("distributionPolicyId") String distributionPolicyId, @HeaderParam("accept") String accept,
RequestOptions requestOptions, Context context);
@Get("/routing/distributionPolicies")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> listDistributionPolicies(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
RequestOptions requestOptions, Context context);
@Get("/routing/distributionPolicies")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response listDistributionPoliciesSync(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
RequestOptions requestOptions, Context context);
@Delete("/routing/distributionPolicies/{distributionPolicyId}")
@ExpectedResponses({ 204 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> deleteDistributionPolicy(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("distributionPolicyId") String distributionPolicyId, @HeaderParam("accept") String accept,
RequestOptions requestOptions, Context context);
@Delete("/routing/distributionPolicies/{distributionPolicyId}")
@ExpectedResponses({ 204 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response deleteDistributionPolicySync(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("distributionPolicyId") String distributionPolicyId, @HeaderParam("accept") String accept,
RequestOptions requestOptions, Context context);
@Patch("/routing/classificationPolicies/{classificationPolicyId}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> upsertClassificationPolicy(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("classificationPolicyId") String classificationPolicyId,
@HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept,
@BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions,
Context context);
@Patch("/routing/classificationPolicies/{classificationPolicyId}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response upsertClassificationPolicySync(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("classificationPolicyId") String classificationPolicyId,
@HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept,
@BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions,
Context context);
@Get("/routing/classificationPolicies/{classificationPolicyId}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> getClassificationPolicy(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("classificationPolicyId") String classificationPolicyId, @HeaderParam("accept") String accept,
RequestOptions requestOptions, Context context);
@Get("/routing/classificationPolicies/{classificationPolicyId}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response getClassificationPolicySync(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("classificationPolicyId") String classificationPolicyId, @HeaderParam("accept") String accept,
RequestOptions requestOptions, Context context);
@Get("/routing/classificationPolicies")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> listClassificationPolicies(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
RequestOptions requestOptions, Context context);
@Get("/routing/classificationPolicies")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response listClassificationPoliciesSync(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
RequestOptions requestOptions, Context context);
@Delete("/routing/classificationPolicies/{classificationPolicyId}")
@ExpectedResponses({ 204 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> deleteClassificationPolicy(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("classificationPolicyId") String classificationPolicyId, @HeaderParam("accept") String accept,
RequestOptions requestOptions, Context context);
@Delete("/routing/classificationPolicies/{classificationPolicyId}")
@ExpectedResponses({ 204 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response deleteClassificationPolicySync(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion,
@PathParam("classificationPolicyId") String classificationPolicyId, @HeaderParam("accept") String accept,
RequestOptions requestOptions, Context context);
@Patch("/routing/exceptionPolicies/{exceptionPolicyId}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> upsertExceptionPolicy(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("exceptionPolicyId") String exceptionPolicyId,
@HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept,
@BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions,
Context context);
@Patch("/routing/exceptionPolicies/{exceptionPolicyId}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response upsertExceptionPolicySync(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("exceptionPolicyId") String exceptionPolicyId,
@HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept,
@BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions,
Context context);
@Get("/routing/exceptionPolicies/{exceptionPolicyId}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> getExceptionPolicy(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("exceptionPolicyId") String exceptionPolicyId,
@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
@Get("/routing/exceptionPolicies/{exceptionPolicyId}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response getExceptionPolicySync(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("exceptionPolicyId") String exceptionPolicyId,
@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
@Get("/routing/exceptionPolicies")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> listExceptionPolicies(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
RequestOptions requestOptions, Context context);
@Get("/routing/exceptionPolicies")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response listExceptionPoliciesSync(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
RequestOptions requestOptions, Context context);
@Delete("/routing/exceptionPolicies/{exceptionPolicyId}")
@ExpectedResponses({ 204 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> deleteExceptionPolicy(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("exceptionPolicyId") String exceptionPolicyId,
@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
@Delete("/routing/exceptionPolicies/{exceptionPolicyId}")
@ExpectedResponses({ 204 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response deleteExceptionPolicySync(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("exceptionPolicyId") String exceptionPolicyId,
@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
@Patch("/routing/queues/{queueId}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> upsertQueue(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("queueId") String queueId,
@HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept,
@BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions,
Context context);
@Patch("/routing/queues/{queueId}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response upsertQueueSync(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("queueId") String queueId,
@HeaderParam("Content-Type") String contentType, @HeaderParam("accept") String accept,
@BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions,
Context context);
@Get("/routing/queues/{queueId}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> getQueue(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("queueId") String queueId,
@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
@Get("/routing/queues/{queueId}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response getQueueSync(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("queueId") String queueId,
@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
@Get("/routing/queues")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> listQueues(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
RequestOptions requestOptions, Context context);
@Get("/routing/queues")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response listQueuesSync(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept,
RequestOptions requestOptions, Context context);
@Delete("/routing/queues/{queueId}")
@ExpectedResponses({ 204 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> deleteQueue(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("queueId") String queueId,
@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
@Delete("/routing/queues/{queueId}")
@ExpectedResponses({ 204 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response deleteQueueSync(@HostParam("endpoint") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("queueId") String queueId,
@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> listDistributionPoliciesNext(
@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response listDistributionPoliciesNextSync(
@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> listClassificationPoliciesNext(
@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response listClassificationPoliciesNextSync(
@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> listExceptionPoliciesNext(
@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response listExceptionPoliciesNextSync(
@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
@HeaderParam("accept") String accept, RequestOptions requestOptions, Context context);
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> listQueuesNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions,
Context context);
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response listQueuesNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
@HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, RequestOptions requestOptions,
Context context);
}
/**
* Creates or updates a distribution policy.
*
* Header Parameters
*
*
* Header Parameters
*
* Name
* Type
* Required
* Description
*
*
* If-Match
* String
* No
* The request should only proceed if an entity matches this string.
*
*
* If-Unmodified-Since
* OffsetDateTime
* No
* The request should only proceed if the entity was not modified after this time.
*
*
* You can add these to a request with {@link RequestOptions#addHeader}
*
* Request Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* offerExpiresAfterSeconds: Double (Optional)
* mode (Optional): {
* minConcurrentOffers: Integer (Optional)
* maxConcurrentOffers: Integer (Optional)
* bypassSelectors: Boolean (Optional)
* }
* }
* }
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* offerExpiresAfterSeconds: Double (Optional)
* mode (Optional): {
* minConcurrentOffers: Integer (Optional)
* maxConcurrentOffers: Integer (Optional)
* bypassSelectors: Boolean (Optional)
* }
* }
* }
*
* @param distributionPolicyId Id of a distribution policy.
* @param resource The resource instance.
* @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 policy governing how jobs are distributed to workers along with {@link Response} on successful completion
* of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> upsertDistributionPolicyWithResponseAsync(String distributionPolicyId,
BinaryData resource, RequestOptions requestOptions) {
final String contentType = "application/merge-patch+json";
final String accept = "application/json";
return FluxUtil.withContext(
context -> service.upsertDistributionPolicy(this.getEndpoint(), this.getServiceVersion().getVersion(),
distributionPolicyId, contentType, accept, resource, requestOptions, context));
}
/**
* Creates or updates a distribution policy.
*
* Header Parameters
*
*
* Header Parameters
*
* Name
* Type
* Required
* Description
*
*
* If-Match
* String
* No
* The request should only proceed if an entity matches this string.
*
*
* If-Unmodified-Since
* OffsetDateTime
* No
* The request should only proceed if the entity was not modified after this time.
*
*
* You can add these to a request with {@link RequestOptions#addHeader}
*
* Request Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* offerExpiresAfterSeconds: Double (Optional)
* mode (Optional): {
* minConcurrentOffers: Integer (Optional)
* maxConcurrentOffers: Integer (Optional)
* bypassSelectors: Boolean (Optional)
* }
* }
* }
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* offerExpiresAfterSeconds: Double (Optional)
* mode (Optional): {
* minConcurrentOffers: Integer (Optional)
* maxConcurrentOffers: Integer (Optional)
* bypassSelectors: Boolean (Optional)
* }
* }
* }
*
* @param distributionPolicyId Id of a distribution policy.
* @param resource The resource instance.
* @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 policy governing how jobs are distributed to workers along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response upsertDistributionPolicyWithResponse(String distributionPolicyId, BinaryData resource,
RequestOptions requestOptions) {
final String contentType = "application/merge-patch+json";
final String accept = "application/json";
return service.upsertDistributionPolicySync(this.getEndpoint(), this.getServiceVersion().getVersion(),
distributionPolicyId, contentType, accept, resource, requestOptions, Context.NONE);
}
/**
* Retrieves an existing distribution policy by Id.
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* offerExpiresAfterSeconds: Double (Optional)
* mode (Optional): {
* minConcurrentOffers: Integer (Optional)
* maxConcurrentOffers: Integer (Optional)
* bypassSelectors: Boolean (Optional)
* }
* }
* }
*
* @param distributionPolicyId Id of a distribution policy.
* @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 policy governing how jobs are distributed to workers along with {@link Response} on successful completion
* of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> getDistributionPolicyWithResponseAsync(String distributionPolicyId,
RequestOptions requestOptions) {
final String accept = "application/json";
return FluxUtil.withContext(context -> service.getDistributionPolicy(this.getEndpoint(),
this.getServiceVersion().getVersion(), distributionPolicyId, accept, requestOptions, context));
}
/**
* Retrieves an existing distribution policy by Id.
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* offerExpiresAfterSeconds: Double (Optional)
* mode (Optional): {
* minConcurrentOffers: Integer (Optional)
* maxConcurrentOffers: Integer (Optional)
* bypassSelectors: Boolean (Optional)
* }
* }
* }
*
* @param distributionPolicyId Id of a distribution policy.
* @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 policy governing how jobs are distributed to workers along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getDistributionPolicyWithResponse(String distributionPolicyId,
RequestOptions requestOptions) {
final String accept = "application/json";
return service.getDistributionPolicySync(this.getEndpoint(), this.getServiceVersion().getVersion(),
distributionPolicyId, accept, requestOptions, Context.NONE);
}
/**
* Retrieves existing distribution policies.
*
* Query Parameters
*
*
* Query Parameters
*
* Name
* Type
* Required
* Description
*
*
* maxpagesize
* Integer
* No
* Number of objects to return per page.
*
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* offerExpiresAfterSeconds: Double (Optional)
* mode (Optional): {
* minConcurrentOffers: Integer (Optional)
* maxConcurrentOffers: Integer (Optional)
* bypassSelectors: Boolean (Optional)
* }
* }
* }
*
* @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 paged collection of DistributionPolicy items along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listDistributionPoliciesSinglePageAsync(RequestOptions requestOptions) {
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listDistributionPolicies(this.getEndpoint(),
this.getServiceVersion().getVersion(), accept, requestOptions, context))
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
}
/**
* Retrieves existing distribution policies.
*
* Query Parameters
*
*
* Query Parameters
*
* Name
* Type
* Required
* Description
*
*
* maxpagesize
* Integer
* No
* Number of objects to return per page.
*
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* offerExpiresAfterSeconds: Double (Optional)
* mode (Optional): {
* minConcurrentOffers: Integer (Optional)
* maxConcurrentOffers: Integer (Optional)
* bypassSelectors: Boolean (Optional)
* }
* }
* }
*
* @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 paged collection of DistributionPolicy items as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux listDistributionPoliciesAsync(RequestOptions requestOptions) {
RequestOptions requestOptionsForNextPage = new RequestOptions();
requestOptionsForNextPage.setContext(
requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE);
return new PagedFlux<>((pageSize) -> {
RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
if (pageSize != null) {
requestOptionsLocal.addRequestCallback(requestLocal -> {
UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl());
urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize));
requestLocal.setUrl(urlBuilder.toString());
});
}
return listDistributionPoliciesSinglePageAsync(requestOptionsLocal);
}, (nextLink, pageSize) -> {
RequestOptions requestOptionsLocal = new RequestOptions();
requestOptionsLocal.setContext(requestOptionsForNextPage.getContext());
if (pageSize != null) {
requestOptionsLocal.addRequestCallback(requestLocal -> {
UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl());
urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize));
requestLocal.setUrl(urlBuilder.toString());
});
}
return listDistributionPoliciesNextSinglePageAsync(nextLink, requestOptionsLocal);
});
}
/**
* Retrieves existing distribution policies.
*
* Query Parameters
*
*
* Query Parameters
*
* Name
* Type
* Required
* Description
*
*
* maxpagesize
* Integer
* No
* Number of objects to return per page.
*
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* offerExpiresAfterSeconds: Double (Optional)
* mode (Optional): {
* minConcurrentOffers: Integer (Optional)
* maxConcurrentOffers: Integer (Optional)
* bypassSelectors: Boolean (Optional)
* }
* }
* }
*
* @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 paged collection of DistributionPolicy items along with {@link PagedResponse}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private PagedResponse listDistributionPoliciesSinglePage(RequestOptions requestOptions) {
final String accept = "application/json";
Response res = service.listDistributionPoliciesSync(this.getEndpoint(),
this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE);
return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
}
/**
* Retrieves existing distribution policies.
*
* Query Parameters
*
*
* Query Parameters
*
* Name
* Type
* Required
* Description
*
*
* maxpagesize
* Integer
* No
* Number of objects to return per page.
*
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* offerExpiresAfterSeconds: Double (Optional)
* mode (Optional): {
* minConcurrentOffers: Integer (Optional)
* maxConcurrentOffers: Integer (Optional)
* bypassSelectors: Boolean (Optional)
* }
* }
* }
*
* @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 paged collection of DistributionPolicy items as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listDistributionPolicies(RequestOptions requestOptions) {
RequestOptions requestOptionsForNextPage = new RequestOptions();
requestOptionsForNextPage.setContext(
requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE);
return new PagedIterable<>((pageSize) -> {
RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
if (pageSize != null) {
requestOptionsLocal.addRequestCallback(requestLocal -> {
UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl());
urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize));
requestLocal.setUrl(urlBuilder.toString());
});
}
return listDistributionPoliciesSinglePage(requestOptionsLocal);
}, (nextLink, pageSize) -> {
RequestOptions requestOptionsLocal = new RequestOptions();
requestOptionsLocal.setContext(requestOptionsForNextPage.getContext());
if (pageSize != null) {
requestOptionsLocal.addRequestCallback(requestLocal -> {
UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl());
urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize));
requestLocal.setUrl(urlBuilder.toString());
});
}
return listDistributionPoliciesNextSinglePage(nextLink, requestOptionsLocal);
});
}
/**
* Delete a distribution policy by Id.
*
* @param distributionPolicyId Id of a distribution policy.
* @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}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> deleteDistributionPolicyWithResponseAsync(String distributionPolicyId,
RequestOptions requestOptions) {
final String accept = "application/json";
return FluxUtil.withContext(context -> service.deleteDistributionPolicy(this.getEndpoint(),
this.getServiceVersion().getVersion(), distributionPolicyId, accept, requestOptions, context));
}
/**
* Delete a distribution policy by Id.
*
* @param distributionPolicyId Id of a distribution policy.
* @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}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response deleteDistributionPolicyWithResponse(String distributionPolicyId,
RequestOptions requestOptions) {
final String accept = "application/json";
return service.deleteDistributionPolicySync(this.getEndpoint(), this.getServiceVersion().getVersion(),
distributionPolicyId, accept, requestOptions, Context.NONE);
}
/**
* Creates or updates a classification policy.
*
* Header Parameters
*
*
* Header Parameters
*
* Name
* Type
* Required
* Description
*
*
* If-Match
* String
* No
* The request should only proceed if an entity matches this string.
*
*
* If-Unmodified-Since
* OffsetDateTime
* No
* The request should only proceed if the entity was not modified after this time.
*
*
* You can add these to a request with {@link RequestOptions#addHeader}
*
* Request Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* fallbackQueueId: String (Optional)
* queueSelectorAttachments (Optional): [
* (Optional){
* }
* ]
* prioritizationRule (Optional): {
* }
* workerSelectorAttachments (Optional): [
* (Optional){
* }
* ]
* }
* }
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* fallbackQueueId: String (Optional)
* queueSelectorAttachments (Optional): [
* (Optional){
* }
* ]
* prioritizationRule (Optional): {
* }
* workerSelectorAttachments (Optional): [
* (Optional){
* }
* ]
* }
* }
*
* @param classificationPolicyId Id of a classification policy.
* @param resource The resource instance.
* @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 a container for the rules that govern how jobs are classified along with {@link Response} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> upsertClassificationPolicyWithResponseAsync(String classificationPolicyId,
BinaryData resource, RequestOptions requestOptions) {
final String contentType = "application/merge-patch+json";
final String accept = "application/json";
return FluxUtil.withContext(
context -> service.upsertClassificationPolicy(this.getEndpoint(), this.getServiceVersion().getVersion(),
classificationPolicyId, contentType, accept, resource, requestOptions, context));
}
/**
* Creates or updates a classification policy.
*
* Header Parameters
*
*
* Header Parameters
*
* Name
* Type
* Required
* Description
*
*
* If-Match
* String
* No
* The request should only proceed if an entity matches this string.
*
*
* If-Unmodified-Since
* OffsetDateTime
* No
* The request should only proceed if the entity was not modified after this time.
*
*
* You can add these to a request with {@link RequestOptions#addHeader}
*
* Request Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* fallbackQueueId: String (Optional)
* queueSelectorAttachments (Optional): [
* (Optional){
* }
* ]
* prioritizationRule (Optional): {
* }
* workerSelectorAttachments (Optional): [
* (Optional){
* }
* ]
* }
* }
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* fallbackQueueId: String (Optional)
* queueSelectorAttachments (Optional): [
* (Optional){
* }
* ]
* prioritizationRule (Optional): {
* }
* workerSelectorAttachments (Optional): [
* (Optional){
* }
* ]
* }
* }
*
* @param classificationPolicyId Id of a classification policy.
* @param resource The resource instance.
* @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 a container for the rules that govern how jobs are classified along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response upsertClassificationPolicyWithResponse(String classificationPolicyId,
BinaryData resource, RequestOptions requestOptions) {
final String contentType = "application/merge-patch+json";
final String accept = "application/json";
return service.upsertClassificationPolicySync(this.getEndpoint(), this.getServiceVersion().getVersion(),
classificationPolicyId, contentType, accept, resource, requestOptions, Context.NONE);
}
/**
* Retrieves an existing classification policy by Id.
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* fallbackQueueId: String (Optional)
* queueSelectorAttachments (Optional): [
* (Optional){
* }
* ]
* prioritizationRule (Optional): {
* }
* workerSelectorAttachments (Optional): [
* (Optional){
* }
* ]
* }
* }
*
* @param classificationPolicyId Id of a classification policy.
* @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 a container for the rules that govern how jobs are classified along with {@link Response} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> getClassificationPolicyWithResponseAsync(String classificationPolicyId,
RequestOptions requestOptions) {
final String accept = "application/json";
return FluxUtil.withContext(context -> service.getClassificationPolicy(this.getEndpoint(),
this.getServiceVersion().getVersion(), classificationPolicyId, accept, requestOptions, context));
}
/**
* Retrieves an existing classification policy by Id.
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* fallbackQueueId: String (Optional)
* queueSelectorAttachments (Optional): [
* (Optional){
* }
* ]
* prioritizationRule (Optional): {
* }
* workerSelectorAttachments (Optional): [
* (Optional){
* }
* ]
* }
* }
*
* @param classificationPolicyId Id of a classification policy.
* @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 a container for the rules that govern how jobs are classified along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getClassificationPolicyWithResponse(String classificationPolicyId,
RequestOptions requestOptions) {
final String accept = "application/json";
return service.getClassificationPolicySync(this.getEndpoint(), this.getServiceVersion().getVersion(),
classificationPolicyId, accept, requestOptions, Context.NONE);
}
/**
* Retrieves existing classification policies.
*
* Query Parameters
*
*
* Query Parameters
*
* Name
* Type
* Required
* Description
*
*
* maxpagesize
* Integer
* No
* Number of objects to return per page.
*
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* fallbackQueueId: String (Optional)
* queueSelectorAttachments (Optional): [
* (Optional){
* }
* ]
* prioritizationRule (Optional): {
* }
* workerSelectorAttachments (Optional): [
* (Optional){
* }
* ]
* }
* }
*
* @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 paged collection of ClassificationPolicy items along with {@link PagedResponse} on successful completion
* of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listClassificationPoliciesSinglePageAsync(RequestOptions requestOptions) {
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listClassificationPolicies(this.getEndpoint(),
this.getServiceVersion().getVersion(), accept, requestOptions, context))
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
}
/**
* Retrieves existing classification policies.
*
* Query Parameters
*
*
* Query Parameters
*
* Name
* Type
* Required
* Description
*
*
* maxpagesize
* Integer
* No
* Number of objects to return per page.
*
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* fallbackQueueId: String (Optional)
* queueSelectorAttachments (Optional): [
* (Optional){
* }
* ]
* prioritizationRule (Optional): {
* }
* workerSelectorAttachments (Optional): [
* (Optional){
* }
* ]
* }
* }
*
* @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 paged collection of ClassificationPolicy items as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux listClassificationPoliciesAsync(RequestOptions requestOptions) {
RequestOptions requestOptionsForNextPage = new RequestOptions();
requestOptionsForNextPage.setContext(
requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE);
return new PagedFlux<>((pageSize) -> {
RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
if (pageSize != null) {
requestOptionsLocal.addRequestCallback(requestLocal -> {
UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl());
urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize));
requestLocal.setUrl(urlBuilder.toString());
});
}
return listClassificationPoliciesSinglePageAsync(requestOptionsLocal);
}, (nextLink, pageSize) -> {
RequestOptions requestOptionsLocal = new RequestOptions();
requestOptionsLocal.setContext(requestOptionsForNextPage.getContext());
if (pageSize != null) {
requestOptionsLocal.addRequestCallback(requestLocal -> {
UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl());
urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize));
requestLocal.setUrl(urlBuilder.toString());
});
}
return listClassificationPoliciesNextSinglePageAsync(nextLink, requestOptionsLocal);
});
}
/**
* Retrieves existing classification policies.
*
* Query Parameters
*
*
* Query Parameters
*
* Name
* Type
* Required
* Description
*
*
* maxpagesize
* Integer
* No
* Number of objects to return per page.
*
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* fallbackQueueId: String (Optional)
* queueSelectorAttachments (Optional): [
* (Optional){
* }
* ]
* prioritizationRule (Optional): {
* }
* workerSelectorAttachments (Optional): [
* (Optional){
* }
* ]
* }
* }
*
* @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 paged collection of ClassificationPolicy items along with {@link PagedResponse}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private PagedResponse listClassificationPoliciesSinglePage(RequestOptions requestOptions) {
final String accept = "application/json";
Response res = service.listClassificationPoliciesSync(this.getEndpoint(),
this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE);
return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
}
/**
* Retrieves existing classification policies.
*
* Query Parameters
*
*
* Query Parameters
*
* Name
* Type
* Required
* Description
*
*
* maxpagesize
* Integer
* No
* Number of objects to return per page.
*
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* fallbackQueueId: String (Optional)
* queueSelectorAttachments (Optional): [
* (Optional){
* }
* ]
* prioritizationRule (Optional): {
* }
* workerSelectorAttachments (Optional): [
* (Optional){
* }
* ]
* }
* }
*
* @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 paged collection of ClassificationPolicy items as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listClassificationPolicies(RequestOptions requestOptions) {
RequestOptions requestOptionsForNextPage = new RequestOptions();
requestOptionsForNextPage.setContext(
requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE);
return new PagedIterable<>((pageSize) -> {
RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
if (pageSize != null) {
requestOptionsLocal.addRequestCallback(requestLocal -> {
UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl());
urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize));
requestLocal.setUrl(urlBuilder.toString());
});
}
return listClassificationPoliciesSinglePage(requestOptionsLocal);
}, (nextLink, pageSize) -> {
RequestOptions requestOptionsLocal = new RequestOptions();
requestOptionsLocal.setContext(requestOptionsForNextPage.getContext());
if (pageSize != null) {
requestOptionsLocal.addRequestCallback(requestLocal -> {
UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl());
urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize));
requestLocal.setUrl(urlBuilder.toString());
});
}
return listClassificationPoliciesNextSinglePage(nextLink, requestOptionsLocal);
});
}
/**
* Delete a classification policy by Id.
*
* @param classificationPolicyId Id of a classification policy.
* @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}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> deleteClassificationPolicyWithResponseAsync(String classificationPolicyId,
RequestOptions requestOptions) {
final String accept = "application/json";
return FluxUtil.withContext(context -> service.deleteClassificationPolicy(this.getEndpoint(),
this.getServiceVersion().getVersion(), classificationPolicyId, accept, requestOptions, context));
}
/**
* Delete a classification policy by Id.
*
* @param classificationPolicyId Id of a classification policy.
* @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}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response deleteClassificationPolicyWithResponse(String classificationPolicyId,
RequestOptions requestOptions) {
final String accept = "application/json";
return service.deleteClassificationPolicySync(this.getEndpoint(), this.getServiceVersion().getVersion(),
classificationPolicyId, accept, requestOptions, Context.NONE);
}
/**
* Creates or updates a exception policy.
*
* Header Parameters
*
*
* Header Parameters
*
* Name
* Type
* Required
* Description
*
*
* If-Match
* String
* No
* The request should only proceed if an entity matches this string.
*
*
* If-Unmodified-Since
* OffsetDateTime
* No
* The request should only proceed if the entity was not modified after this time.
*
*
* You can add these to a request with {@link RequestOptions#addHeader}
*
* Request Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* exceptionRules (Optional): [
* (Optional){
* id: String (Required)
* trigger (Required): {
* }
* actions (Required): [
* (Required){
* id: String (Optional)
* }
* ]
* }
* ]
* }
* }
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* exceptionRules (Optional): [
* (Optional){
* id: String (Required)
* trigger (Required): {
* }
* actions (Required): [
* (Required){
* id: String (Optional)
* }
* ]
* }
* ]
* }
* }
*
* @param exceptionPolicyId Id of an exception policy.
* @param resource The resource instance.
* @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 a policy that defines actions to execute when exception are triggered along with {@link Response} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> upsertExceptionPolicyWithResponseAsync(String exceptionPolicyId,
BinaryData resource, RequestOptions requestOptions) {
final String contentType = "application/merge-patch+json";
final String accept = "application/json";
return FluxUtil.withContext(
context -> service.upsertExceptionPolicy(this.getEndpoint(), this.getServiceVersion().getVersion(),
exceptionPolicyId, contentType, accept, resource, requestOptions, context));
}
/**
* Creates or updates a exception policy.
*
* Header Parameters
*
*
* Header Parameters
*
* Name
* Type
* Required
* Description
*
*
* If-Match
* String
* No
* The request should only proceed if an entity matches this string.
*
*
* If-Unmodified-Since
* OffsetDateTime
* No
* The request should only proceed if the entity was not modified after this time.
*
*
* You can add these to a request with {@link RequestOptions#addHeader}
*
* Request Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* exceptionRules (Optional): [
* (Optional){
* id: String (Required)
* trigger (Required): {
* }
* actions (Required): [
* (Required){
* id: String (Optional)
* }
* ]
* }
* ]
* }
* }
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* exceptionRules (Optional): [
* (Optional){
* id: String (Required)
* trigger (Required): {
* }
* actions (Required): [
* (Required){
* id: String (Optional)
* }
* ]
* }
* ]
* }
* }
*
* @param exceptionPolicyId Id of an exception policy.
* @param resource The resource instance.
* @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 a policy that defines actions to execute when exception are triggered along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response upsertExceptionPolicyWithResponse(String exceptionPolicyId, BinaryData resource,
RequestOptions requestOptions) {
final String contentType = "application/merge-patch+json";
final String accept = "application/json";
return service.upsertExceptionPolicySync(this.getEndpoint(), this.getServiceVersion().getVersion(),
exceptionPolicyId, contentType, accept, resource, requestOptions, Context.NONE);
}
/**
* Retrieves an existing exception policy by Id.
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* exceptionRules (Optional): [
* (Optional){
* id: String (Required)
* trigger (Required): {
* }
* actions (Required): [
* (Required){
* id: String (Optional)
* }
* ]
* }
* ]
* }
* }
*
* @param exceptionPolicyId Id of an exception policy.
* @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 a policy that defines actions to execute when exception are triggered along with {@link Response} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> getExceptionPolicyWithResponseAsync(String exceptionPolicyId,
RequestOptions requestOptions) {
final String accept = "application/json";
return FluxUtil.withContext(context -> service.getExceptionPolicy(this.getEndpoint(),
this.getServiceVersion().getVersion(), exceptionPolicyId, accept, requestOptions, context));
}
/**
* Retrieves an existing exception policy by Id.
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* exceptionRules (Optional): [
* (Optional){
* id: String (Required)
* trigger (Required): {
* }
* actions (Required): [
* (Required){
* id: String (Optional)
* }
* ]
* }
* ]
* }
* }
*
* @param exceptionPolicyId Id of an exception policy.
* @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 a policy that defines actions to execute when exception are triggered along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getExceptionPolicyWithResponse(String exceptionPolicyId,
RequestOptions requestOptions) {
final String accept = "application/json";
return service.getExceptionPolicySync(this.getEndpoint(), this.getServiceVersion().getVersion(),
exceptionPolicyId, accept, requestOptions, Context.NONE);
}
/**
* Retrieves existing exception policies.
*
* Query Parameters
*
*
* Query Parameters
*
* Name
* Type
* Required
* Description
*
*
* maxpagesize
* Integer
* No
* Number of objects to return per page.
*
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* exceptionRules (Optional): [
* (Optional){
* id: String (Required)
* trigger (Required): {
* }
* actions (Required): [
* (Required){
* id: String (Optional)
* }
* ]
* }
* ]
* }
* }
*
* @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 paged collection of ExceptionPolicy items along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listExceptionPoliciesSinglePageAsync(RequestOptions requestOptions) {
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listExceptionPolicies(this.getEndpoint(),
this.getServiceVersion().getVersion(), accept, requestOptions, context))
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
}
/**
* Retrieves existing exception policies.
*
* Query Parameters
*
*
* Query Parameters
*
* Name
* Type
* Required
* Description
*
*
* maxpagesize
* Integer
* No
* Number of objects to return per page.
*
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* exceptionRules (Optional): [
* (Optional){
* id: String (Required)
* trigger (Required): {
* }
* actions (Required): [
* (Required){
* id: String (Optional)
* }
* ]
* }
* ]
* }
* }
*
* @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 paged collection of ExceptionPolicy items as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux listExceptionPoliciesAsync(RequestOptions requestOptions) {
RequestOptions requestOptionsForNextPage = new RequestOptions();
requestOptionsForNextPage.setContext(
requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE);
return new PagedFlux<>((pageSize) -> {
RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
if (pageSize != null) {
requestOptionsLocal.addRequestCallback(requestLocal -> {
UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl());
urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize));
requestLocal.setUrl(urlBuilder.toString());
});
}
return listExceptionPoliciesSinglePageAsync(requestOptionsLocal);
}, (nextLink, pageSize) -> {
RequestOptions requestOptionsLocal = new RequestOptions();
requestOptionsLocal.setContext(requestOptionsForNextPage.getContext());
if (pageSize != null) {
requestOptionsLocal.addRequestCallback(requestLocal -> {
UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl());
urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize));
requestLocal.setUrl(urlBuilder.toString());
});
}
return listExceptionPoliciesNextSinglePageAsync(nextLink, requestOptionsLocal);
});
}
/**
* Retrieves existing exception policies.
*
* Query Parameters
*
*
* Query Parameters
*
* Name
* Type
* Required
* Description
*
*
* maxpagesize
* Integer
* No
* Number of objects to return per page.
*
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* exceptionRules (Optional): [
* (Optional){
* id: String (Required)
* trigger (Required): {
* }
* actions (Required): [
* (Required){
* id: String (Optional)
* }
* ]
* }
* ]
* }
* }
*
* @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 paged collection of ExceptionPolicy items along with {@link PagedResponse}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private PagedResponse listExceptionPoliciesSinglePage(RequestOptions requestOptions) {
final String accept = "application/json";
Response res = service.listExceptionPoliciesSync(this.getEndpoint(),
this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE);
return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
}
/**
* Retrieves existing exception policies.
*
* Query Parameters
*
*
* Query Parameters
*
* Name
* Type
* Required
* Description
*
*
* maxpagesize
* Integer
* No
* Number of objects to return per page.
*
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* exceptionRules (Optional): [
* (Optional){
* id: String (Required)
* trigger (Required): {
* }
* actions (Required): [
* (Required){
* id: String (Optional)
* }
* ]
* }
* ]
* }
* }
*
* @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 paged collection of ExceptionPolicy items as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listExceptionPolicies(RequestOptions requestOptions) {
RequestOptions requestOptionsForNextPage = new RequestOptions();
requestOptionsForNextPage.setContext(
requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE);
return new PagedIterable<>((pageSize) -> {
RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
if (pageSize != null) {
requestOptionsLocal.addRequestCallback(requestLocal -> {
UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl());
urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize));
requestLocal.setUrl(urlBuilder.toString());
});
}
return listExceptionPoliciesSinglePage(requestOptionsLocal);
}, (nextLink, pageSize) -> {
RequestOptions requestOptionsLocal = new RequestOptions();
requestOptionsLocal.setContext(requestOptionsForNextPage.getContext());
if (pageSize != null) {
requestOptionsLocal.addRequestCallback(requestLocal -> {
UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl());
urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize));
requestLocal.setUrl(urlBuilder.toString());
});
}
return listExceptionPoliciesNextSinglePage(nextLink, requestOptionsLocal);
});
}
/**
* Deletes a exception policy by Id.
*
* @param exceptionPolicyId Id of an exception policy.
* @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}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> deleteExceptionPolicyWithResponseAsync(String exceptionPolicyId,
RequestOptions requestOptions) {
final String accept = "application/json";
return FluxUtil.withContext(context -> service.deleteExceptionPolicy(this.getEndpoint(),
this.getServiceVersion().getVersion(), exceptionPolicyId, accept, requestOptions, context));
}
/**
* Deletes a exception policy by Id.
*
* @param exceptionPolicyId Id of an exception policy.
* @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}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response deleteExceptionPolicyWithResponse(String exceptionPolicyId, RequestOptions requestOptions) {
final String accept = "application/json";
return service.deleteExceptionPolicySync(this.getEndpoint(), this.getServiceVersion().getVersion(),
exceptionPolicyId, accept, requestOptions, Context.NONE);
}
/**
* Creates or updates a queue.
*
* Header Parameters
*
*
* Header Parameters
*
* Name
* Type
* Required
* Description
*
*
* If-Match
* String
* No
* The request should only proceed if an entity matches this string.
*
*
* If-Unmodified-Since
* OffsetDateTime
* No
* The request should only proceed if the entity was not modified after this time.
*
*
* You can add these to a request with {@link RequestOptions#addHeader}
*
* Request Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* distributionPolicyId: String (Optional)
* labels (Optional): {
* String: Object (Required)
* }
* exceptionPolicyId: String (Optional)
* }
* }
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* distributionPolicyId: String (Optional)
* labels (Optional): {
* String: Object (Required)
* }
* exceptionPolicyId: String (Optional)
* }
* }
*
* @param queueId Id of a queue.
* @param resource The resource instance.
* @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 a queue that can contain jobs to be routed along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> upsertQueueWithResponseAsync(String queueId, BinaryData resource,
RequestOptions requestOptions) {
final String contentType = "application/merge-patch+json";
final String accept = "application/json";
return FluxUtil.withContext(context -> service.upsertQueue(this.getEndpoint(),
this.getServiceVersion().getVersion(), queueId, contentType, accept, resource, requestOptions, context));
}
/**
* Creates or updates a queue.
*
* Header Parameters
*
*
* Header Parameters
*
* Name
* Type
* Required
* Description
*
*
* If-Match
* String
* No
* The request should only proceed if an entity matches this string.
*
*
* If-Unmodified-Since
* OffsetDateTime
* No
* The request should only proceed if the entity was not modified after this time.
*
*
* You can add these to a request with {@link RequestOptions#addHeader}
*
* Request Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* distributionPolicyId: String (Optional)
* labels (Optional): {
* String: Object (Required)
* }
* exceptionPolicyId: String (Optional)
* }
* }
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* distributionPolicyId: String (Optional)
* labels (Optional): {
* String: Object (Required)
* }
* exceptionPolicyId: String (Optional)
* }
* }
*
* @param queueId Id of a queue.
* @param resource The resource instance.
* @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 a queue that can contain jobs to be routed along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response upsertQueueWithResponse(String queueId, BinaryData resource,
RequestOptions requestOptions) {
final String contentType = "application/merge-patch+json";
final String accept = "application/json";
return service.upsertQueueSync(this.getEndpoint(), this.getServiceVersion().getVersion(), queueId, contentType,
accept, resource, requestOptions, Context.NONE);
}
/**
* Retrieves an existing queue by Id.
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* distributionPolicyId: String (Optional)
* labels (Optional): {
* String: Object (Required)
* }
* exceptionPolicyId: String (Optional)
* }
* }
*
* @param queueId Id of a queue.
* @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 a queue that can contain jobs to be routed along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> getQueueWithResponseAsync(String queueId, RequestOptions requestOptions) {
final String accept = "application/json";
return FluxUtil.withContext(context -> service.getQueue(this.getEndpoint(),
this.getServiceVersion().getVersion(), queueId, accept, requestOptions, context));
}
/**
* Retrieves an existing queue by Id.
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* distributionPolicyId: String (Optional)
* labels (Optional): {
* String: Object (Required)
* }
* exceptionPolicyId: String (Optional)
* }
* }
*
* @param queueId Id of a queue.
* @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 a queue that can contain jobs to be routed along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getQueueWithResponse(String queueId, RequestOptions requestOptions) {
final String accept = "application/json";
return service.getQueueSync(this.getEndpoint(), this.getServiceVersion().getVersion(), queueId, accept,
requestOptions, Context.NONE);
}
/**
* Retrieves existing queues.
*
* Query Parameters
*
*
* Query Parameters
*
* Name
* Type
* Required
* Description
*
*
* maxpagesize
* Integer
* No
* Number of objects to return per page.
*
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* distributionPolicyId: String (Optional)
* labels (Optional): {
* String: Object (Required)
* }
* exceptionPolicyId: String (Optional)
* }
* }
*
* @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 paged collection of RouterQueue items along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listQueuesSinglePageAsync(RequestOptions requestOptions) {
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listQueues(this.getEndpoint(), this.getServiceVersion().getVersion(),
accept, requestOptions, context))
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
}
/**
* Retrieves existing queues.
*
* Query Parameters
*
*
* Query Parameters
*
* Name
* Type
* Required
* Description
*
*
* maxpagesize
* Integer
* No
* Number of objects to return per page.
*
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* distributionPolicyId: String (Optional)
* labels (Optional): {
* String: Object (Required)
* }
* exceptionPolicyId: String (Optional)
* }
* }
*
* @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 paged collection of RouterQueue items as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux listQueuesAsync(RequestOptions requestOptions) {
RequestOptions requestOptionsForNextPage = new RequestOptions();
requestOptionsForNextPage.setContext(
requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE);
return new PagedFlux<>((pageSize) -> {
RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
if (pageSize != null) {
requestOptionsLocal.addRequestCallback(requestLocal -> {
UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl());
urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize));
requestLocal.setUrl(urlBuilder.toString());
});
}
return listQueuesSinglePageAsync(requestOptionsLocal);
}, (nextLink, pageSize) -> {
RequestOptions requestOptionsLocal = new RequestOptions();
requestOptionsLocal.setContext(requestOptionsForNextPage.getContext());
if (pageSize != null) {
requestOptionsLocal.addRequestCallback(requestLocal -> {
UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl());
urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize));
requestLocal.setUrl(urlBuilder.toString());
});
}
return listQueuesNextSinglePageAsync(nextLink, requestOptionsLocal);
});
}
/**
* Retrieves existing queues.
*
* Query Parameters
*
*
* Query Parameters
*
* Name
* Type
* Required
* Description
*
*
* maxpagesize
* Integer
* No
* Number of objects to return per page.
*
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* distributionPolicyId: String (Optional)
* labels (Optional): {
* String: Object (Required)
* }
* exceptionPolicyId: String (Optional)
* }
* }
*
* @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 paged collection of RouterQueue items along with {@link PagedResponse}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private PagedResponse listQueuesSinglePage(RequestOptions requestOptions) {
final String accept = "application/json";
Response res = service.listQueuesSync(this.getEndpoint(), this.getServiceVersion().getVersion(),
accept, requestOptions, Context.NONE);
return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
}
/**
* Retrieves existing queues.
*
* Query Parameters
*
*
* Query Parameters
*
* Name
* Type
* Required
* Description
*
*
* maxpagesize
* Integer
* No
* Number of objects to return per page.
*
*
* You can add these to a request with {@link RequestOptions#addQueryParam}
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* distributionPolicyId: String (Optional)
* labels (Optional): {
* String: Object (Required)
* }
* exceptionPolicyId: String (Optional)
* }
* }
*
* @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 paged collection of RouterQueue items as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listQueues(RequestOptions requestOptions) {
RequestOptions requestOptionsForNextPage = new RequestOptions();
requestOptionsForNextPage.setContext(
requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE);
return new PagedIterable<>((pageSize) -> {
RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
if (pageSize != null) {
requestOptionsLocal.addRequestCallback(requestLocal -> {
UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl());
urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize));
requestLocal.setUrl(urlBuilder.toString());
});
}
return listQueuesSinglePage(requestOptionsLocal);
}, (nextLink, pageSize) -> {
RequestOptions requestOptionsLocal = new RequestOptions();
requestOptionsLocal.setContext(requestOptionsForNextPage.getContext());
if (pageSize != null) {
requestOptionsLocal.addRequestCallback(requestLocal -> {
UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl());
urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize));
requestLocal.setUrl(urlBuilder.toString());
});
}
return listQueuesNextSinglePage(nextLink, requestOptionsLocal);
});
}
/**
* Deletes a queue by Id.
*
* @param queueId Id of a queue.
* @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}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> deleteQueueWithResponseAsync(String queueId, RequestOptions requestOptions) {
final String accept = "application/json";
return FluxUtil.withContext(context -> service.deleteQueue(this.getEndpoint(),
this.getServiceVersion().getVersion(), queueId, accept, requestOptions, context));
}
/**
* Deletes a queue by Id.
*
* @param queueId Id of a queue.
* @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}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response deleteQueueWithResponse(String queueId, RequestOptions requestOptions) {
final String accept = "application/json";
return service.deleteQueueSync(this.getEndpoint(), this.getServiceVersion().getVersion(), queueId, accept,
requestOptions, Context.NONE);
}
/**
* Retrieves existing distribution policies.
*
* Get the next page of items.
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* offerExpiresAfterSeconds: Double (Optional)
* mode (Optional): {
* minConcurrentOffers: Integer (Optional)
* maxConcurrentOffers: Integer (Optional)
* bypassSelectors: Boolean (Optional)
* }
* }
* }
*
* @param nextLink The URL to get the next list of items
*
* The nextLink parameter.
* @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 paged collection of DistributionPolicy items along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listDistributionPoliciesNextSinglePageAsync(String nextLink,
RequestOptions requestOptions) {
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listDistributionPoliciesNext(nextLink, this.getEndpoint(), accept,
requestOptions, context))
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
}
/**
* Retrieves existing distribution policies.
*
* Get the next page of items.
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* offerExpiresAfterSeconds: Double (Optional)
* mode (Optional): {
* minConcurrentOffers: Integer (Optional)
* maxConcurrentOffers: Integer (Optional)
* bypassSelectors: Boolean (Optional)
* }
* }
* }
*
* @param nextLink The URL to get the next list of items
*
* The nextLink parameter.
* @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 paged collection of DistributionPolicy items along with {@link PagedResponse}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private PagedResponse listDistributionPoliciesNextSinglePage(String nextLink,
RequestOptions requestOptions) {
final String accept = "application/json";
Response res = service.listDistributionPoliciesNextSync(nextLink, this.getEndpoint(), accept,
requestOptions, Context.NONE);
return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
}
/**
* Retrieves existing classification policies.
*
* Get the next page of items.
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* fallbackQueueId: String (Optional)
* queueSelectorAttachments (Optional): [
* (Optional){
* }
* ]
* prioritizationRule (Optional): {
* }
* workerSelectorAttachments (Optional): [
* (Optional){
* }
* ]
* }
* }
*
* @param nextLink The URL to get the next list of items
*
* The nextLink parameter.
* @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 paged collection of ClassificationPolicy items along with {@link PagedResponse} on successful completion
* of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listClassificationPoliciesNextSinglePageAsync(String nextLink,
RequestOptions requestOptions) {
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listClassificationPoliciesNext(nextLink, this.getEndpoint(), accept,
requestOptions, context))
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
}
/**
* Retrieves existing classification policies.
*
* Get the next page of items.
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* fallbackQueueId: String (Optional)
* queueSelectorAttachments (Optional): [
* (Optional){
* }
* ]
* prioritizationRule (Optional): {
* }
* workerSelectorAttachments (Optional): [
* (Optional){
* }
* ]
* }
* }
*
* @param nextLink The URL to get the next list of items
*
* The nextLink parameter.
* @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 paged collection of ClassificationPolicy items along with {@link PagedResponse}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private PagedResponse listClassificationPoliciesNextSinglePage(String nextLink,
RequestOptions requestOptions) {
final String accept = "application/json";
Response res = service.listClassificationPoliciesNextSync(nextLink, this.getEndpoint(), accept,
requestOptions, Context.NONE);
return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
}
/**
* Retrieves existing exception policies.
*
* Get the next page of items.
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* exceptionRules (Optional): [
* (Optional){
* id: String (Required)
* trigger (Required): {
* }
* actions (Required): [
* (Required){
* id: String (Optional)
* }
* ]
* }
* ]
* }
* }
*
* @param nextLink The URL to get the next list of items
*
* The nextLink parameter.
* @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 paged collection of ExceptionPolicy items along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listExceptionPoliciesNextSinglePageAsync(String nextLink,
RequestOptions requestOptions) {
final String accept = "application/json";
return FluxUtil.withContext(
context -> service.listExceptionPoliciesNext(nextLink, this.getEndpoint(), accept, requestOptions, context))
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
}
/**
* Retrieves existing exception policies.
*
* Get the next page of items.
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* exceptionRules (Optional): [
* (Optional){
* id: String (Required)
* trigger (Required): {
* }
* actions (Required): [
* (Required){
* id: String (Optional)
* }
* ]
* }
* ]
* }
* }
*
* @param nextLink The URL to get the next list of items
*
* The nextLink parameter.
* @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 paged collection of ExceptionPolicy items along with {@link PagedResponse}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private PagedResponse listExceptionPoliciesNextSinglePage(String nextLink,
RequestOptions requestOptions) {
final String accept = "application/json";
Response res
= service.listExceptionPoliciesNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE);
return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
}
/**
* Retrieves existing queues.
*
* Get the next page of items.
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* distributionPolicyId: String (Optional)
* labels (Optional): {
* String: Object (Required)
* }
* exceptionPolicyId: String (Optional)
* }
* }
*
* @param nextLink The URL to get the next list of items
*
* The nextLink parameter.
* @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 paged collection of RouterQueue items along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listQueuesNextSinglePageAsync(String nextLink,
RequestOptions requestOptions) {
final String accept = "application/json";
return FluxUtil
.withContext(
context -> service.listQueuesNext(nextLink, this.getEndpoint(), accept, requestOptions, context))
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
}
/**
* Retrieves existing queues.
*
* Get the next page of items.
*
* Response Body Schema
*
* {@code
* {
* etag: String (Required)
* id: String (Required)
* name: String (Optional)
* distributionPolicyId: String (Optional)
* labels (Optional): {
* String: Object (Required)
* }
* exceptionPolicyId: String (Optional)
* }
* }
*
* @param nextLink The URL to get the next list of items
*
* The nextLink parameter.
* @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 paged collection of RouterQueue items along with {@link PagedResponse}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private PagedResponse listQueuesNextSinglePage(String nextLink, RequestOptions requestOptions) {
final String accept = "application/json";
Response res
= service.listQueuesNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE);
return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
}
private List getValues(BinaryData binaryData, String path) {
try {
Map, ?> obj = binaryData.toObject(Map.class);
List> values = (List>) obj.get(path);
return values.stream().map(BinaryData::fromObject).collect(Collectors.toList());
} catch (RuntimeException e) {
return null;
}
}
private String getNextLink(BinaryData binaryData, String path) {
try {
Map, ?> obj = binaryData.toObject(Map.class);
return (String) obj.get(path);
} catch (RuntimeException e) {
return null;
}
}
}