Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.servicelinker.implementation;
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.Headers;
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.Post;
import com.azure.core.annotation.Put;
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.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.Response;
import com.azure.core.http.rest.RestProxy;
import com.azure.core.management.exception.ManagementException;
import com.azure.core.management.polling.PollResult;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.core.util.polling.PollerFlux;
import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.servicelinker.fluent.LinkersOperationsClient;
import com.azure.resourcemanager.servicelinker.fluent.models.ConfigurationResultInner;
import com.azure.resourcemanager.servicelinker.fluent.models.DaprConfigurationResourceInner;
import com.azure.resourcemanager.servicelinker.fluent.models.DryrunResourceInner;
import com.azure.resourcemanager.servicelinker.models.ConfigurationInfo;
import com.azure.resourcemanager.servicelinker.models.DaprConfigurationList;
import com.azure.resourcemanager.servicelinker.models.DryrunList;
import com.azure.resourcemanager.servicelinker.models.DryrunPatch;
import java.nio.ByteBuffer;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
/**
* An instance of this class provides access to all the operations defined in LinkersOperationsClient.
*/
public final class LinkersOperationsClientImpl implements LinkersOperationsClient {
/**
* The proxy service used to perform REST calls.
*/
private final LinkersOperationsService service;
/**
* The service client containing this operation class.
*/
private final ServiceLinkerManagementClientImpl client;
/**
* Initializes an instance of LinkersOperationsClientImpl.
*
* @param client the instance of the service client containing this operation class.
*/
LinkersOperationsClientImpl(ServiceLinkerManagementClientImpl client) {
this.service
= RestProxy.create(LinkersOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
this.client = client;
}
/**
* The interface defining all the services for ServiceLinkerManagementClientLinkersOperations to be used by the
* proxy service to perform REST calls.
*/
@Host("{$host}")
@ServiceInterface(name = "ServiceLinkerManagem")
public interface LinkersOperationsService {
@Headers({ "Content-Type: application/json" })
@Get("/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listDryrun(@HostParam("$host") String endpoint,
@PathParam(value = "resourceUri", encoded = true) String resourceUri,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getDryrun(@HostParam("$host") String endpoint,
@PathParam(value = "resourceUri", encoded = true) String resourceUri,
@QueryParam("api-version") String apiVersion, @PathParam("dryrunName") String dryrunName,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> createDryrun(@HostParam("$host") String endpoint,
@PathParam(value = "resourceUri", encoded = true) String resourceUri,
@QueryParam("api-version") String apiVersion, @PathParam("dryrunName") String dryrunName,
@BodyParam("application/json") DryrunResourceInner parameters, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Patch("/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName}")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> updateDryrun(@HostParam("$host") String endpoint,
@PathParam(value = "resourceUri", encoded = true) String resourceUri,
@QueryParam("api-version") String apiVersion, @PathParam("dryrunName") String dryrunName,
@BodyParam("application/json") DryrunPatch parameters, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Delete("/{resourceUri}/providers/Microsoft.ServiceLinker/dryruns/{dryrunName}")
@ExpectedResponses({ 200, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> deleteDryrun(@HostParam("$host") String endpoint,
@PathParam(value = "resourceUri", encoded = true) String resourceUri,
@QueryParam("api-version") String apiVersion, @PathParam("dryrunName") String dryrunName,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}/generateConfigurations")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> generateConfigurations(@HostParam("$host") String endpoint,
@PathParam(value = "resourceUri", encoded = true) String resourceUri,
@QueryParam("api-version") String apiVersion, @PathParam("linkerName") String linkerName,
@BodyParam("application/json") ConfigurationInfo parameters, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Get("/{resourceUri}/providers/Microsoft.ServiceLinker/daprConfigurations")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listDaprConfigurations(@HostParam("$host") String endpoint,
@PathParam(value = "resourceUri", encoded = true) String resourceUri,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listDryrunNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
@HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listDaprConfigurationsNext(
@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
@HeaderParam("Accept") String accept, Context context);
}
/**
* list dryrun jobs.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the list of dryrun along with {@link PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listDryrunSinglePageAsync(String resourceUri) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceUri == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listDryrun(this.client.getEndpoint(), resourceUri,
this.client.getApiVersion(), accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(),
res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* list dryrun jobs.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the list of dryrun along with {@link PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listDryrunSinglePageAsync(String resourceUri, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceUri == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.listDryrun(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* list dryrun jobs.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the list of dryrun as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listDryrunAsync(String resourceUri) {
return new PagedFlux<>(() -> listDryrunSinglePageAsync(resourceUri),
nextLink -> listDryrunNextSinglePageAsync(nextLink));
}
/**
* list dryrun jobs.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the list of dryrun as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listDryrunAsync(String resourceUri, Context context) {
return new PagedFlux<>(() -> listDryrunSinglePageAsync(resourceUri, context),
nextLink -> listDryrunNextSinglePageAsync(nextLink, context));
}
/**
* list dryrun jobs.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the list of dryrun as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listDryrun(String resourceUri) {
return new PagedIterable<>(listDryrunAsync(resourceUri));
}
/**
* list dryrun jobs.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the list of dryrun as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listDryrun(String resourceUri, Context context) {
return new PagedIterable<>(listDryrunAsync(resourceUri, context));
}
/**
* get a dryrun job.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param dryrunName The name of dryrun.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a dryrun job along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getDryrunWithResponseAsync(String resourceUri, String dryrunName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceUri == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
}
if (dryrunName == null) {
return Mono.error(new IllegalArgumentException("Parameter dryrunName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.getDryrun(this.client.getEndpoint(), resourceUri,
this.client.getApiVersion(), dryrunName, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* get a dryrun job.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param dryrunName The name of dryrun.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a dryrun job along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getDryrunWithResponseAsync(String resourceUri, String dryrunName,
Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceUri == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
}
if (dryrunName == null) {
return Mono.error(new IllegalArgumentException("Parameter dryrunName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.getDryrun(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), dryrunName,
accept, context);
}
/**
* get a dryrun job.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param dryrunName The name of dryrun.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a dryrun job on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono getDryrunAsync(String resourceUri, String dryrunName) {
return getDryrunWithResponseAsync(resourceUri, dryrunName).flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* get a dryrun job.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param dryrunName The name of dryrun.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a dryrun job along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getDryrunWithResponse(String resourceUri, String dryrunName, Context context) {
return getDryrunWithResponseAsync(resourceUri, dryrunName, context).block();
}
/**
* get a dryrun job.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param dryrunName The name of dryrun.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a dryrun job.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DryrunResourceInner getDryrun(String resourceUri, String dryrunName) {
return getDryrunWithResponse(resourceUri, dryrunName, Context.NONE).getValue();
}
/**
* create a dryrun job to do necessary check before actual creation.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param dryrunName The name of dryrun.
* @param parameters dryrun resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a dryrun job resource along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createDryrunWithResponseAsync(String resourceUri, String dryrunName,
DryrunResourceInner parameters) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceUri == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
}
if (dryrunName == null) {
return Mono.error(new IllegalArgumentException("Parameter dryrunName is required and cannot be null."));
}
if (parameters == null) {
return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
} else {
parameters.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.createDryrun(this.client.getEndpoint(), resourceUri,
this.client.getApiVersion(), dryrunName, parameters, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* create a dryrun job to do necessary check before actual creation.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param dryrunName The name of dryrun.
* @param parameters dryrun resource.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a dryrun job resource along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createDryrunWithResponseAsync(String resourceUri, String dryrunName,
DryrunResourceInner parameters, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceUri == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
}
if (dryrunName == null) {
return Mono.error(new IllegalArgumentException("Parameter dryrunName is required and cannot be null."));
}
if (parameters == null) {
return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
} else {
parameters.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.createDryrun(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), dryrunName,
parameters, accept, context);
}
/**
* create a dryrun job to do necessary check before actual creation.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param dryrunName The name of dryrun.
* @param parameters dryrun resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of a dryrun job resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, DryrunResourceInner> beginCreateDryrunAsync(String resourceUri,
String dryrunName, DryrunResourceInner parameters) {
Mono>> mono = createDryrunWithResponseAsync(resourceUri, dryrunName, parameters);
return this.client.getLroResult(mono, this.client.getHttpPipeline(),
DryrunResourceInner.class, DryrunResourceInner.class, this.client.getContext());
}
/**
* create a dryrun job to do necessary check before actual creation.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param dryrunName The name of dryrun.
* @param parameters dryrun resource.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of a dryrun job resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, DryrunResourceInner> beginCreateDryrunAsync(String resourceUri,
String dryrunName, DryrunResourceInner parameters, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= createDryrunWithResponseAsync(resourceUri, dryrunName, parameters, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(),
DryrunResourceInner.class, DryrunResourceInner.class, context);
}
/**
* create a dryrun job to do necessary check before actual creation.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param dryrunName The name of dryrun.
* @param parameters dryrun resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of a dryrun job resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, DryrunResourceInner> beginCreateDryrun(String resourceUri,
String dryrunName, DryrunResourceInner parameters) {
return this.beginCreateDryrunAsync(resourceUri, dryrunName, parameters).getSyncPoller();
}
/**
* create a dryrun job to do necessary check before actual creation.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param dryrunName The name of dryrun.
* @param parameters dryrun resource.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of a dryrun job resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, DryrunResourceInner> beginCreateDryrun(String resourceUri,
String dryrunName, DryrunResourceInner parameters, Context context) {
return this.beginCreateDryrunAsync(resourceUri, dryrunName, parameters, context).getSyncPoller();
}
/**
* create a dryrun job to do necessary check before actual creation.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param dryrunName The name of dryrun.
* @param parameters dryrun resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a dryrun job resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createDryrunAsync(String resourceUri, String dryrunName,
DryrunResourceInner parameters) {
return beginCreateDryrunAsync(resourceUri, dryrunName, parameters).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* create a dryrun job to do necessary check before actual creation.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param dryrunName The name of dryrun.
* @param parameters dryrun resource.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a dryrun job resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createDryrunAsync(String resourceUri, String dryrunName,
DryrunResourceInner parameters, Context context) {
return beginCreateDryrunAsync(resourceUri, dryrunName, parameters, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* create a dryrun job to do necessary check before actual creation.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param dryrunName The name of dryrun.
* @param parameters dryrun resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a dryrun job resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DryrunResourceInner createDryrun(String resourceUri, String dryrunName, DryrunResourceInner parameters) {
return createDryrunAsync(resourceUri, dryrunName, parameters).block();
}
/**
* create a dryrun job to do necessary check before actual creation.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param dryrunName The name of dryrun.
* @param parameters dryrun resource.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a dryrun job resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DryrunResourceInner createDryrun(String resourceUri, String dryrunName, DryrunResourceInner parameters,
Context context) {
return createDryrunAsync(resourceUri, dryrunName, parameters, context).block();
}
/**
* add a dryrun job to do necessary check before actual creation.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param dryrunName The name of dryrun.
* @param parameters dryrun resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a dryrun job resource along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> updateDryrunWithResponseAsync(String resourceUri, String dryrunName,
DryrunPatch parameters) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceUri == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
}
if (dryrunName == null) {
return Mono.error(new IllegalArgumentException("Parameter dryrunName is required and cannot be null."));
}
if (parameters == null) {
return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
} else {
parameters.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.updateDryrun(this.client.getEndpoint(), resourceUri,
this.client.getApiVersion(), dryrunName, parameters, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* add a dryrun job to do necessary check before actual creation.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param dryrunName The name of dryrun.
* @param parameters dryrun resource.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a dryrun job resource along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> updateDryrunWithResponseAsync(String resourceUri, String dryrunName,
DryrunPatch parameters, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceUri == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
}
if (dryrunName == null) {
return Mono.error(new IllegalArgumentException("Parameter dryrunName is required and cannot be null."));
}
if (parameters == null) {
return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
} else {
parameters.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.updateDryrun(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), dryrunName,
parameters, accept, context);
}
/**
* add a dryrun job to do necessary check before actual creation.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param dryrunName The name of dryrun.
* @param parameters dryrun resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of a dryrun job resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, DryrunResourceInner> beginUpdateDryrunAsync(String resourceUri,
String dryrunName, DryrunPatch parameters) {
Mono>> mono = updateDryrunWithResponseAsync(resourceUri, dryrunName, parameters);
return this.client.getLroResult(mono, this.client.getHttpPipeline(),
DryrunResourceInner.class, DryrunResourceInner.class, this.client.getContext());
}
/**
* add a dryrun job to do necessary check before actual creation.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param dryrunName The name of dryrun.
* @param parameters dryrun resource.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of a dryrun job resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, DryrunResourceInner> beginUpdateDryrunAsync(String resourceUri,
String dryrunName, DryrunPatch parameters, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= updateDryrunWithResponseAsync(resourceUri, dryrunName, parameters, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(),
DryrunResourceInner.class, DryrunResourceInner.class, context);
}
/**
* add a dryrun job to do necessary check before actual creation.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param dryrunName The name of dryrun.
* @param parameters dryrun resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of a dryrun job resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, DryrunResourceInner> beginUpdateDryrun(String resourceUri,
String dryrunName, DryrunPatch parameters) {
return this.beginUpdateDryrunAsync(resourceUri, dryrunName, parameters).getSyncPoller();
}
/**
* add a dryrun job to do necessary check before actual creation.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param dryrunName The name of dryrun.
* @param parameters dryrun resource.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of a dryrun job resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, DryrunResourceInner> beginUpdateDryrun(String resourceUri,
String dryrunName, DryrunPatch parameters, Context context) {
return this.beginUpdateDryrunAsync(resourceUri, dryrunName, parameters, context).getSyncPoller();
}
/**
* add a dryrun job to do necessary check before actual creation.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param dryrunName The name of dryrun.
* @param parameters dryrun resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a dryrun job resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono updateDryrunAsync(String resourceUri, String dryrunName, DryrunPatch parameters) {
return beginUpdateDryrunAsync(resourceUri, dryrunName, parameters).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* add a dryrun job to do necessary check before actual creation.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param dryrunName The name of dryrun.
* @param parameters dryrun resource.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a dryrun job resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono updateDryrunAsync(String resourceUri, String dryrunName, DryrunPatch parameters,
Context context) {
return beginUpdateDryrunAsync(resourceUri, dryrunName, parameters, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* add a dryrun job to do necessary check before actual creation.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param dryrunName The name of dryrun.
* @param parameters dryrun resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a dryrun job resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DryrunResourceInner updateDryrun(String resourceUri, String dryrunName, DryrunPatch parameters) {
return updateDryrunAsync(resourceUri, dryrunName, parameters).block();
}
/**
* add a dryrun job to do necessary check before actual creation.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param dryrunName The name of dryrun.
* @param parameters dryrun resource.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a dryrun job resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DryrunResourceInner updateDryrun(String resourceUri, String dryrunName, DryrunPatch parameters,
Context context) {
return updateDryrunAsync(resourceUri, dryrunName, parameters, context).block();
}
/**
* delete a dryrun job.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param dryrunName The name of dryrun.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> deleteDryrunWithResponseAsync(String resourceUri, String dryrunName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceUri == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
}
if (dryrunName == null) {
return Mono.error(new IllegalArgumentException("Parameter dryrunName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.deleteDryrun(this.client.getEndpoint(), resourceUri,
this.client.getApiVersion(), dryrunName, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* delete a dryrun job.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param dryrunName The name of dryrun.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> deleteDryrunWithResponseAsync(String resourceUri, String dryrunName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceUri == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
}
if (dryrunName == null) {
return Mono.error(new IllegalArgumentException("Parameter dryrunName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.deleteDryrun(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), dryrunName,
accept, context);
}
/**
* delete a dryrun job.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param dryrunName The name of dryrun.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono deleteDryrunAsync(String resourceUri, String dryrunName) {
return deleteDryrunWithResponseAsync(resourceUri, dryrunName).flatMap(ignored -> Mono.empty());
}
/**
* delete a dryrun job.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param dryrunName The name of dryrun.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response deleteDryrunWithResponse(String resourceUri, String dryrunName, Context context) {
return deleteDryrunWithResponseAsync(resourceUri, dryrunName, context).block();
}
/**
* delete a dryrun job.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param dryrunName The name of dryrun.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void deleteDryrun(String resourceUri, String dryrunName) {
deleteDryrunWithResponse(resourceUri, dryrunName, Context.NONE);
}
/**
* Generate configurations for a Linker.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param parameters Connection Info, including format, secret store, etc.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return configurations for source resource, include appSettings, connectionString and serviceBindings along with
* {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> generateConfigurationsWithResponseAsync(String resourceUri,
String linkerName, ConfigurationInfo parameters) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceUri == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
}
if (linkerName == null) {
return Mono.error(new IllegalArgumentException("Parameter linkerName is required and cannot be null."));
}
if (parameters != null) {
parameters.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.generateConfigurations(this.client.getEndpoint(), resourceUri,
this.client.getApiVersion(), linkerName, parameters, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Generate configurations for a Linker.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param parameters Connection Info, including format, secret store, etc.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return configurations for source resource, include appSettings, connectionString and serviceBindings along with
* {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> generateConfigurationsWithResponseAsync(String resourceUri,
String linkerName, ConfigurationInfo parameters, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceUri == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
}
if (linkerName == null) {
return Mono.error(new IllegalArgumentException("Parameter linkerName is required and cannot be null."));
}
if (parameters != null) {
parameters.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.generateConfigurations(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(),
linkerName, parameters, accept, context);
}
/**
* Generate configurations for a Linker.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return configurations for source resource, include appSettings, connectionString and serviceBindings on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono generateConfigurationsAsync(String resourceUri, String linkerName) {
final ConfigurationInfo parameters = null;
return generateConfigurationsWithResponseAsync(resourceUri, linkerName, parameters)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Generate configurations for a Linker.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @param parameters Connection Info, including format, secret store, etc.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return configurations for source resource, include appSettings, connectionString and serviceBindings along with
* {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response generateConfigurationsWithResponse(String resourceUri, String linkerName,
ConfigurationInfo parameters, Context context) {
return generateConfigurationsWithResponseAsync(resourceUri, linkerName, parameters, context).block();
}
/**
* Generate configurations for a Linker.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param linkerName The name Linker resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return configurations for source resource, include appSettings, connectionString and serviceBindings.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ConfigurationResultInner generateConfigurations(String resourceUri, String linkerName) {
final ConfigurationInfo parameters = null;
return generateConfigurationsWithResponse(resourceUri, linkerName, parameters, Context.NONE).getValue();
}
/**
* List the dapr configuration supported by Service Connector.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return dapr configuration list supported by Service Connector along with {@link PagedResponse} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>
listDaprConfigurationsSinglePageAsync(String resourceUri) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceUri == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listDaprConfigurations(this.client.getEndpoint(), resourceUri,
this.client.getApiVersion(), accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(),
res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* List the dapr configuration supported by Service Connector.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return dapr configuration list supported by Service Connector along with {@link PagedResponse} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>
listDaprConfigurationsSinglePageAsync(String resourceUri, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceUri == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listDaprConfigurations(this.client.getEndpoint(), resourceUri, this.client.getApiVersion(), accept,
context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* List the dapr configuration supported by Service Connector.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return dapr configuration list supported by Service Connector as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listDaprConfigurationsAsync(String resourceUri) {
return new PagedFlux<>(() -> listDaprConfigurationsSinglePageAsync(resourceUri),
nextLink -> listDaprConfigurationsNextSinglePageAsync(nextLink));
}
/**
* List the dapr configuration supported by Service Connector.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return dapr configuration list supported by Service Connector as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listDaprConfigurationsAsync(String resourceUri, Context context) {
return new PagedFlux<>(() -> listDaprConfigurationsSinglePageAsync(resourceUri, context),
nextLink -> listDaprConfigurationsNextSinglePageAsync(nextLink, context));
}
/**
* List the dapr configuration supported by Service Connector.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return dapr configuration list supported by Service Connector as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listDaprConfigurations(String resourceUri) {
return new PagedIterable<>(listDaprConfigurationsAsync(resourceUri));
}
/**
* List the dapr configuration supported by Service Connector.
*
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return dapr configuration list supported by Service Connector as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listDaprConfigurations(String resourceUri, Context context) {
return new PagedIterable<>(listDaprConfigurationsAsync(resourceUri, context));
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the list of dryrun along with {@link PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listDryrunNextSinglePageAsync(String nextLink) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listDryrunNext(nextLink, this.client.getEndpoint(), accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(),
res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the list of dryrun along with {@link PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listDryrunNextSinglePageAsync(String nextLink, Context context) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.listDryrunNext(nextLink, this.client.getEndpoint(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return dapr configuration list supported by Service Connector along with {@link PagedResponse} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>
listDaprConfigurationsNextSinglePageAsync(String nextLink) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(
context -> service.listDaprConfigurationsNext(nextLink, this.client.getEndpoint(), accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(),
res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return dapr configuration list supported by Service Connector along with {@link PagedResponse} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>
listDaprConfigurationsNextSinglePageAsync(String nextLink, Context context) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.listDaprConfigurationsNext(nextLink, this.client.getEndpoint(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
}