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.ConnectorsClient;
import com.azure.resourcemanager.servicelinker.fluent.models.ConfigurationResultInner;
import com.azure.resourcemanager.servicelinker.fluent.models.DryrunResourceInner;
import com.azure.resourcemanager.servicelinker.fluent.models.LinkerResourceInner;
import com.azure.resourcemanager.servicelinker.fluent.models.ValidateOperationResultInner;
import com.azure.resourcemanager.servicelinker.models.ConfigurationInfo;
import com.azure.resourcemanager.servicelinker.models.DryrunList;
import com.azure.resourcemanager.servicelinker.models.DryrunPatch;
import com.azure.resourcemanager.servicelinker.models.LinkerPatch;
import com.azure.resourcemanager.servicelinker.models.ResourceList;
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 ConnectorsClient.
*/
public final class ConnectorsClientImpl implements ConnectorsClient {
/**
* The proxy service used to perform REST calls.
*/
private final ConnectorsService service;
/**
* The service client containing this operation class.
*/
private final ServiceLinkerManagementClientImpl client;
/**
* Initializes an instance of ConnectorsClientImpl.
*
* @param client the instance of the service client containing this operation class.
*/
ConnectorsClientImpl(ServiceLinkerManagementClientImpl client) {
this.service
= RestProxy.create(ConnectorsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
this.client = client;
}
/**
* The interface defining all the services for ServiceLinkerManagementClientConnectors to be used by the proxy
* service to perform REST calls.
*/
@Host("{$host}")
@ServiceInterface(name = "ServiceLinkerManagem")
public interface ConnectorsService {
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listDryrun(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns/{dryrunName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getDryrun(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location,
@QueryParam("api-version") String apiVersion, @PathParam("dryrunName") String dryrunName,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns/{dryrunName}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> createDryrun(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location,
@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("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns/{dryrunName}")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> updateDryrun(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location,
@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("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/dryruns/{dryrunName}")
@ExpectedResponses({ 200, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> deleteDryrun(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location,
@QueryParam("api-version") String apiVersion, @PathParam("dryrunName") String dryrunName,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> list(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> get(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location,
@PathParam("connectorName") String connectorName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> createOrUpdate(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location,
@PathParam("connectorName") String connectorName, @QueryParam("api-version") String apiVersion,
@BodyParam("application/json") LinkerResourceInner parameters, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName}")
@ExpectedResponses({ 200, 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> delete(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location,
@PathParam("connectorName") String connectorName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Patch("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName}")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> update(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location,
@PathParam("connectorName") String connectorName, @QueryParam("api-version") String apiVersion,
@BodyParam("application/json") LinkerPatch parameters, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName}/validate")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> validate(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location,
@PathParam("connectorName") String connectorName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceLinker/locations/{location}/connectors/{connectorName}/generateConfigurations")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> generateConfigurations(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location,
@PathParam("connectorName") String connectorName, @QueryParam("api-version") String apiVersion,
@BodyParam("application/json") ConfigurationInfo parameters, @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> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
@HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context);
}
/**
* list dryrun jobs.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId,
String resourceGroupName, String location) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (subscriptionId == null) {
return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (location == null) {
return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listDryrun(this.client.getEndpoint(), subscriptionId, resourceGroupName,
location, 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 subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId,
String resourceGroupName, String location, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (subscriptionId == null) {
return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (location == null) {
return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listDryrun(this.client.getEndpoint(), subscriptionId, resourceGroupName, location,
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 subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId, String resourceGroupName,
String location) {
return new PagedFlux<>(() -> listDryrunSinglePageAsync(subscriptionId, resourceGroupName, location),
nextLink -> listDryrunNextSinglePageAsync(nextLink));
}
/**
* list dryrun jobs.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId, String resourceGroupName,
String location, Context context) {
return new PagedFlux<>(() -> listDryrunSinglePageAsync(subscriptionId, resourceGroupName, location, context),
nextLink -> listDryrunNextSinglePageAsync(nextLink, context));
}
/**
* list dryrun jobs.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId, String resourceGroupName,
String location) {
return new PagedIterable<>(listDryrunAsync(subscriptionId, resourceGroupName, location));
}
/**
* list dryrun jobs.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId, String resourceGroupName,
String location, Context context) {
return new PagedIterable<>(listDryrunAsync(subscriptionId, resourceGroupName, location, context));
}
/**
* get a dryrun job.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId,
String resourceGroupName, String location, String dryrunName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (subscriptionId == null) {
return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (location == null) {
return Mono.error(new IllegalArgumentException("Parameter location 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(), subscriptionId, resourceGroupName,
location, this.client.getApiVersion(), dryrunName, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* get a dryrun job.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId,
String resourceGroupName, String location, 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 (subscriptionId == null) {
return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (location == null) {
return Mono.error(new IllegalArgumentException("Parameter location 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(), subscriptionId, resourceGroupName, location,
this.client.getApiVersion(), dryrunName, accept, context);
}
/**
* get a dryrun job.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId, String resourceGroupName, String location,
String dryrunName) {
return getDryrunWithResponseAsync(subscriptionId, resourceGroupName, location, dryrunName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* get a dryrun job.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId, String resourceGroupName,
String location, String dryrunName, Context context) {
return getDryrunWithResponseAsync(subscriptionId, resourceGroupName, location, dryrunName, context).block();
}
/**
* get a dryrun job.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId, String resourceGroupName, String location,
String dryrunName) {
return getDryrunWithResponse(subscriptionId, resourceGroupName, location, dryrunName, Context.NONE).getValue();
}
/**
* create a dryrun job to do necessary check before actual creation.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId,
String resourceGroupName, String location, 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 (subscriptionId == null) {
return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (location == null) {
return Mono.error(new IllegalArgumentException("Parameter location 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(), subscriptionId, resourceGroupName,
location, 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 subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId,
String resourceGroupName, String location, 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 (subscriptionId == null) {
return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (location == null) {
return Mono.error(new IllegalArgumentException("Parameter location 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(), subscriptionId, resourceGroupName, location,
this.client.getApiVersion(), dryrunName, parameters, accept, context);
}
/**
* create a dryrun job to do necessary check before actual creation.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId, String resourceGroupName, String location, String dryrunName,
DryrunResourceInner parameters) {
Mono>> mono
= createDryrunWithResponseAsync(subscriptionId, resourceGroupName, location, 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 subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId, String resourceGroupName, String location, String dryrunName,
DryrunResourceInner parameters, Context context) {
context = this.client.mergeContext(context);
Mono>> mono = createDryrunWithResponseAsync(subscriptionId, resourceGroupName,
location, 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 subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId,
String resourceGroupName, String location, String dryrunName, DryrunResourceInner parameters) {
return this.beginCreateDryrunAsync(subscriptionId, resourceGroupName, location, dryrunName, parameters)
.getSyncPoller();
}
/**
* create a dryrun job to do necessary check before actual creation.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId,
String resourceGroupName, String location, String dryrunName, DryrunResourceInner parameters, Context context) {
return this.beginCreateDryrunAsync(subscriptionId, resourceGroupName, location, dryrunName, parameters, context)
.getSyncPoller();
}
/**
* create a dryrun job to do necessary check before actual creation.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId, String resourceGroupName,
String location, String dryrunName, DryrunResourceInner parameters) {
return beginCreateDryrunAsync(subscriptionId, resourceGroupName, location, dryrunName, parameters).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* create a dryrun job to do necessary check before actual creation.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId, String resourceGroupName,
String location, String dryrunName, DryrunResourceInner parameters, Context context) {
return beginCreateDryrunAsync(subscriptionId, resourceGroupName, location, dryrunName, parameters, context)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* create a dryrun job to do necessary check before actual creation.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId, String resourceGroupName, String location,
String dryrunName, DryrunResourceInner parameters) {
return createDryrunAsync(subscriptionId, resourceGroupName, location, dryrunName, parameters).block();
}
/**
* create a dryrun job to do necessary check before actual creation.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId, String resourceGroupName, String location,
String dryrunName, DryrunResourceInner parameters, Context context) {
return createDryrunAsync(subscriptionId, resourceGroupName, location, dryrunName, parameters, context).block();
}
/**
* update a dryrun job to do necessary check before actual creation.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId,
String resourceGroupName, String location, 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 (subscriptionId == null) {
return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (location == null) {
return Mono.error(new IllegalArgumentException("Parameter location 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(), subscriptionId, resourceGroupName,
location, this.client.getApiVersion(), dryrunName, parameters, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* update a dryrun job to do necessary check before actual creation.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId,
String resourceGroupName, String location, 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 (subscriptionId == null) {
return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (location == null) {
return Mono.error(new IllegalArgumentException("Parameter location 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(), subscriptionId, resourceGroupName, location,
this.client.getApiVersion(), dryrunName, parameters, accept, context);
}
/**
* update a dryrun job to do necessary check before actual creation.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId, String resourceGroupName, String location, String dryrunName, DryrunPatch parameters) {
Mono>> mono
= updateDryrunWithResponseAsync(subscriptionId, resourceGroupName, location, dryrunName, parameters);
return this.client.getLroResult(mono, this.client.getHttpPipeline(),
DryrunResourceInner.class, DryrunResourceInner.class, this.client.getContext());
}
/**
* update a dryrun job to do necessary check before actual creation.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId, String resourceGroupName, String location, String dryrunName, DryrunPatch parameters,
Context context) {
context = this.client.mergeContext(context);
Mono>> mono = updateDryrunWithResponseAsync(subscriptionId, resourceGroupName,
location, dryrunName, parameters, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(),
DryrunResourceInner.class, DryrunResourceInner.class, context);
}
/**
* update a dryrun job to do necessary check before actual creation.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId,
String resourceGroupName, String location, String dryrunName, DryrunPatch parameters) {
return this.beginUpdateDryrunAsync(subscriptionId, resourceGroupName, location, dryrunName, parameters)
.getSyncPoller();
}
/**
* update a dryrun job to do necessary check before actual creation.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId,
String resourceGroupName, String location, String dryrunName, DryrunPatch parameters, Context context) {
return this.beginUpdateDryrunAsync(subscriptionId, resourceGroupName, location, dryrunName, parameters, context)
.getSyncPoller();
}
/**
* update a dryrun job to do necessary check before actual creation.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId, String resourceGroupName,
String location, String dryrunName, DryrunPatch parameters) {
return beginUpdateDryrunAsync(subscriptionId, resourceGroupName, location, dryrunName, parameters).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* update a dryrun job to do necessary check before actual creation.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId, String resourceGroupName,
String location, String dryrunName, DryrunPatch parameters, Context context) {
return beginUpdateDryrunAsync(subscriptionId, resourceGroupName, location, dryrunName, parameters, context)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* update a dryrun job to do necessary check before actual creation.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId, String resourceGroupName, String location,
String dryrunName, DryrunPatch parameters) {
return updateDryrunAsync(subscriptionId, resourceGroupName, location, dryrunName, parameters).block();
}
/**
* update a dryrun job to do necessary check before actual creation.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId, String resourceGroupName, String location,
String dryrunName, DryrunPatch parameters, Context context) {
return updateDryrunAsync(subscriptionId, resourceGroupName, location, dryrunName, parameters, context).block();
}
/**
* delete a dryrun job.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId, String resourceGroupName,
String location, String dryrunName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (subscriptionId == null) {
return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (location == null) {
return Mono.error(new IllegalArgumentException("Parameter location 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(), subscriptionId, resourceGroupName,
location, this.client.getApiVersion(), dryrunName, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* delete a dryrun job.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId, String resourceGroupName,
String location, 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 (subscriptionId == null) {
return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (location == null) {
return Mono.error(new IllegalArgumentException("Parameter location 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(), subscriptionId, resourceGroupName, location,
this.client.getApiVersion(), dryrunName, accept, context);
}
/**
* delete a dryrun job.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId, String resourceGroupName, String location,
String dryrunName) {
return deleteDryrunWithResponseAsync(subscriptionId, resourceGroupName, location, dryrunName)
.flatMap(ignored -> Mono.empty());
}
/**
* delete a dryrun job.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId, String resourceGroupName, String location,
String dryrunName, Context context) {
return deleteDryrunWithResponseAsync(subscriptionId, resourceGroupName, location, dryrunName, context).block();
}
/**
* delete a dryrun job.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 subscriptionId, String resourceGroupName, String location, String dryrunName) {
deleteDryrunWithResponse(subscriptionId, resourceGroupName, location, dryrunName, Context.NONE);
}
/**
* Returns list of connector which connects to the resource, which supports to config the target service during the
* resource provision.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 Linker along with {@link PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSinglePageAsync(String subscriptionId,
String resourceGroupName, String location) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (subscriptionId == null) {
return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (location == null) {
return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.list(this.client.getEndpoint(), subscriptionId, resourceGroupName, location,
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()));
}
/**
* Returns list of connector which connects to the resource, which supports to config the target service during the
* resource provision.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 Linker along with {@link PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSinglePageAsync(String subscriptionId,
String resourceGroupName, String location, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (subscriptionId == null) {
return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (location == null) {
return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.list(this.client.getEndpoint(), subscriptionId, resourceGroupName, location, this.client.getApiVersion(),
accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* Returns list of connector which connects to the resource, which supports to config the target service during the
* resource provision.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 Linker as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAsync(String subscriptionId, String resourceGroupName, String location) {
return new PagedFlux<>(() -> listSinglePageAsync(subscriptionId, resourceGroupName, location),
nextLink -> listNextSinglePageAsync(nextLink));
}
/**
* Returns list of connector which connects to the resource, which supports to config the target service during the
* resource provision.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 Linker as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAsync(String subscriptionId, String resourceGroupName, String location,
Context context) {
return new PagedFlux<>(() -> listSinglePageAsync(subscriptionId, resourceGroupName, location, context),
nextLink -> listNextSinglePageAsync(nextLink, context));
}
/**
* Returns list of connector which connects to the resource, which supports to config the target service during the
* resource provision.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 Linker as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list(String subscriptionId, String resourceGroupName, String location) {
return new PagedIterable<>(listAsync(subscriptionId, resourceGroupName, location));
}
/**
* Returns list of connector which connects to the resource, which supports to config the target service during the
* resource provision.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @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 Linker as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list(String subscriptionId, String resourceGroupName, String location,
Context context) {
return new PagedIterable<>(listAsync(subscriptionId, resourceGroupName, location, context));
}
/**
* Returns Connector resource for a given name.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of 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 linker of source and target resource along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getWithResponseAsync(String subscriptionId, String resourceGroupName,
String location, String connectorName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (subscriptionId == null) {
return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (location == null) {
return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));
}
if (connectorName == null) {
return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.get(this.client.getEndpoint(), subscriptionId, resourceGroupName, location,
connectorName, this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Returns Connector resource for a given name.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of 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 linker of source and target resource along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getWithResponseAsync(String subscriptionId, String resourceGroupName,
String location, String connectorName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (subscriptionId == null) {
return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (location == null) {
return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));
}
if (connectorName == null) {
return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.get(this.client.getEndpoint(), subscriptionId, resourceGroupName, location, connectorName,
this.client.getApiVersion(), accept, context);
}
/**
* Returns Connector resource for a given name.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of 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 linker of source and target resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono getAsync(String subscriptionId, String resourceGroupName, String location,
String connectorName) {
return getWithResponseAsync(subscriptionId, resourceGroupName, location, connectorName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Returns Connector resource for a given name.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of 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 linker of source and target resource along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getWithResponse(String subscriptionId, String resourceGroupName,
String location, String connectorName, Context context) {
return getWithResponseAsync(subscriptionId, resourceGroupName, location, connectorName, context).block();
}
/**
* Returns Connector resource for a given name.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of 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 linker of source and target resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public LinkerResourceInner get(String subscriptionId, String resourceGroupName, String location,
String connectorName) {
return getWithResponse(subscriptionId, resourceGroupName, location, connectorName, Context.NONE).getValue();
}
/**
* Create or update Connector resource.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of resource.
* @param parameters Connector details.
* @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 linker of source and target resource along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createOrUpdateWithResponseAsync(String subscriptionId,
String resourceGroupName, String location, String connectorName, LinkerResourceInner parameters) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (subscriptionId == null) {
return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (location == null) {
return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));
}
if (connectorName == null) {
return Mono.error(new IllegalArgumentException("Parameter connectorName 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.createOrUpdate(this.client.getEndpoint(), subscriptionId, resourceGroupName,
location, connectorName, this.client.getApiVersion(), parameters, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Create or update Connector resource.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of resource.
* @param parameters Connector details.
* @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 linker of source and target resource along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createOrUpdateWithResponseAsync(String subscriptionId,
String resourceGroupName, String location, String connectorName, LinkerResourceInner parameters,
Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (subscriptionId == null) {
return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (location == null) {
return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));
}
if (connectorName == null) {
return Mono.error(new IllegalArgumentException("Parameter connectorName 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.createOrUpdate(this.client.getEndpoint(), subscriptionId, resourceGroupName, location,
connectorName, this.client.getApiVersion(), parameters, accept, context);
}
/**
* Create or update Connector resource.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of resource.
* @param parameters Connector details.
* @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 linker of source and target resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, LinkerResourceInner> beginCreateOrUpdateAsync(
String subscriptionId, String resourceGroupName, String location, String connectorName,
LinkerResourceInner parameters) {
Mono>> mono
= createOrUpdateWithResponseAsync(subscriptionId, resourceGroupName, location, connectorName, parameters);
return this.client.getLroResult(mono, this.client.getHttpPipeline(),
LinkerResourceInner.class, LinkerResourceInner.class, this.client.getContext());
}
/**
* Create or update Connector resource.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of resource.
* @param parameters Connector details.
* @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 linker of source and target resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, LinkerResourceInner> beginCreateOrUpdateAsync(
String subscriptionId, String resourceGroupName, String location, String connectorName,
LinkerResourceInner parameters, Context context) {
context = this.client.mergeContext(context);
Mono>> mono = createOrUpdateWithResponseAsync(subscriptionId, resourceGroupName,
location, connectorName, parameters, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(),
LinkerResourceInner.class, LinkerResourceInner.class, context);
}
/**
* Create or update Connector resource.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of resource.
* @param parameters Connector details.
* @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 linker of source and target resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, LinkerResourceInner> beginCreateOrUpdate(String subscriptionId,
String resourceGroupName, String location, String connectorName, LinkerResourceInner parameters) {
return this.beginCreateOrUpdateAsync(subscriptionId, resourceGroupName, location, connectorName, parameters)
.getSyncPoller();
}
/**
* Create or update Connector resource.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of resource.
* @param parameters Connector details.
* @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 linker of source and target resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, LinkerResourceInner> beginCreateOrUpdate(String subscriptionId,
String resourceGroupName, String location, String connectorName, LinkerResourceInner parameters,
Context context) {
return this
.beginCreateOrUpdateAsync(subscriptionId, resourceGroupName, location, connectorName, parameters, context)
.getSyncPoller();
}
/**
* Create or update Connector resource.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of resource.
* @param parameters Connector details.
* @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 linker of source and target resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createOrUpdateAsync(String subscriptionId, String resourceGroupName,
String location, String connectorName, LinkerResourceInner parameters) {
return beginCreateOrUpdateAsync(subscriptionId, resourceGroupName, location, connectorName, parameters).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create or update Connector resource.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of resource.
* @param parameters Connector details.
* @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 linker of source and target resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createOrUpdateAsync(String subscriptionId, String resourceGroupName,
String location, String connectorName, LinkerResourceInner parameters, Context context) {
return beginCreateOrUpdateAsync(subscriptionId, resourceGroupName, location, connectorName, parameters, context)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create or update Connector resource.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of resource.
* @param parameters Connector details.
* @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 linker of source and target resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public LinkerResourceInner createOrUpdate(String subscriptionId, String resourceGroupName, String location,
String connectorName, LinkerResourceInner parameters) {
return createOrUpdateAsync(subscriptionId, resourceGroupName, location, connectorName, parameters).block();
}
/**
* Create or update Connector resource.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of resource.
* @param parameters Connector details.
* @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 linker of source and target resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public LinkerResourceInner createOrUpdate(String subscriptionId, String resourceGroupName, String location,
String connectorName, LinkerResourceInner parameters, Context context) {
return createOrUpdateAsync(subscriptionId, resourceGroupName, location, connectorName, parameters, context)
.block();
}
/**
* Delete a Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of 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 Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> deleteWithResponseAsync(String subscriptionId, String resourceGroupName,
String location, String connectorName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (subscriptionId == null) {
return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (location == null) {
return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));
}
if (connectorName == null) {
return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.delete(this.client.getEndpoint(), subscriptionId, resourceGroupName,
location, connectorName, this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Delete a Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of 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 Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> deleteWithResponseAsync(String subscriptionId, String resourceGroupName,
String location, String connectorName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (subscriptionId == null) {
return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (location == null) {
return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));
}
if (connectorName == null) {
return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.delete(this.client.getEndpoint(), subscriptionId, resourceGroupName, location, connectorName,
this.client.getApiVersion(), accept, context);
}
/**
* Delete a Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of 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 long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, Void> beginDeleteAsync(String subscriptionId, String resourceGroupName,
String location, String connectorName) {
Mono>> mono
= deleteWithResponseAsync(subscriptionId, resourceGroupName, location, connectorName);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
this.client.getContext());
}
/**
* Delete a Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of 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 long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, Void> beginDeleteAsync(String subscriptionId, String resourceGroupName,
String location, String connectorName, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= deleteWithResponseAsync(subscriptionId, resourceGroupName, location, connectorName, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
context);
}
/**
* Delete a Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of 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 long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginDelete(String subscriptionId, String resourceGroupName,
String location, String connectorName) {
return this.beginDeleteAsync(subscriptionId, resourceGroupName, location, connectorName).getSyncPoller();
}
/**
* Delete a Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of 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 long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginDelete(String subscriptionId, String resourceGroupName,
String location, String connectorName, Context context) {
return this.beginDeleteAsync(subscriptionId, resourceGroupName, location, connectorName, context)
.getSyncPoller();
}
/**
* Delete a Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of 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 {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono deleteAsync(String subscriptionId, String resourceGroupName, String location,
String connectorName) {
return beginDeleteAsync(subscriptionId, resourceGroupName, location, connectorName).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Delete a Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of 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 {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono deleteAsync(String subscriptionId, String resourceGroupName, String location,
String connectorName, Context context) {
return beginDeleteAsync(subscriptionId, resourceGroupName, location, connectorName, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Delete a Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of 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.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void delete(String subscriptionId, String resourceGroupName, String location, String connectorName) {
deleteAsync(subscriptionId, resourceGroupName, location, connectorName).block();
}
/**
* Delete a Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of 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.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void delete(String subscriptionId, String resourceGroupName, String location, String connectorName,
Context context) {
deleteAsync(subscriptionId, resourceGroupName, location, connectorName, context).block();
}
/**
* Operation to update an existing Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of resource.
* @param parameters Connector details.
* @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 linker of source and target resource along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> updateWithResponseAsync(String subscriptionId, String resourceGroupName,
String location, String connectorName, LinkerPatch parameters) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (subscriptionId == null) {
return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (location == null) {
return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));
}
if (connectorName == null) {
return Mono.error(new IllegalArgumentException("Parameter connectorName 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.update(this.client.getEndpoint(), subscriptionId, resourceGroupName,
location, connectorName, this.client.getApiVersion(), parameters, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Operation to update an existing Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of resource.
* @param parameters Connector details.
* @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 linker of source and target resource along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> updateWithResponseAsync(String subscriptionId, String resourceGroupName,
String location, String connectorName, LinkerPatch parameters, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (subscriptionId == null) {
return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (location == null) {
return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));
}
if (connectorName == null) {
return Mono.error(new IllegalArgumentException("Parameter connectorName 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.update(this.client.getEndpoint(), subscriptionId, resourceGroupName, location, connectorName,
this.client.getApiVersion(), parameters, accept, context);
}
/**
* Operation to update an existing Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of resource.
* @param parameters Connector details.
* @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 linker of source and target resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, LinkerResourceInner> beginUpdateAsync(String subscriptionId,
String resourceGroupName, String location, String connectorName, LinkerPatch parameters) {
Mono>> mono
= updateWithResponseAsync(subscriptionId, resourceGroupName, location, connectorName, parameters);
return this.client.getLroResult(mono, this.client.getHttpPipeline(),
LinkerResourceInner.class, LinkerResourceInner.class, this.client.getContext());
}
/**
* Operation to update an existing Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of resource.
* @param parameters Connector details.
* @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 linker of source and target resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, LinkerResourceInner> beginUpdateAsync(String subscriptionId,
String resourceGroupName, String location, String connectorName, LinkerPatch parameters, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= updateWithResponseAsync(subscriptionId, resourceGroupName, location, connectorName, parameters, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(),
LinkerResourceInner.class, LinkerResourceInner.class, context);
}
/**
* Operation to update an existing Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of resource.
* @param parameters Connector details.
* @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 linker of source and target resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, LinkerResourceInner> beginUpdate(String subscriptionId,
String resourceGroupName, String location, String connectorName, LinkerPatch parameters) {
return this.beginUpdateAsync(subscriptionId, resourceGroupName, location, connectorName, parameters)
.getSyncPoller();
}
/**
* Operation to update an existing Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of resource.
* @param parameters Connector details.
* @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 linker of source and target resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, LinkerResourceInner> beginUpdate(String subscriptionId,
String resourceGroupName, String location, String connectorName, LinkerPatch parameters, Context context) {
return this.beginUpdateAsync(subscriptionId, resourceGroupName, location, connectorName, parameters, context)
.getSyncPoller();
}
/**
* Operation to update an existing Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of resource.
* @param parameters Connector details.
* @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 linker of source and target resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono updateAsync(String subscriptionId, String resourceGroupName, String location,
String connectorName, LinkerPatch parameters) {
return beginUpdateAsync(subscriptionId, resourceGroupName, location, connectorName, parameters).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Operation to update an existing Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of resource.
* @param parameters Connector details.
* @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 linker of source and target resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono updateAsync(String subscriptionId, String resourceGroupName, String location,
String connectorName, LinkerPatch parameters, Context context) {
return beginUpdateAsync(subscriptionId, resourceGroupName, location, connectorName, parameters, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Operation to update an existing Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of resource.
* @param parameters Connector details.
* @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 linker of source and target resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public LinkerResourceInner update(String subscriptionId, String resourceGroupName, String location,
String connectorName, LinkerPatch parameters) {
return updateAsync(subscriptionId, resourceGroupName, location, connectorName, parameters).block();
}
/**
* Operation to update an existing Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of resource.
* @param parameters Connector details.
* @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 linker of source and target resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public LinkerResourceInner update(String subscriptionId, String resourceGroupName, String location,
String connectorName, LinkerPatch parameters, Context context) {
return updateAsync(subscriptionId, resourceGroupName, location, connectorName, parameters, context).block();
}
/**
* Validate a Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of 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 validation operation result for a Linker along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> validateWithResponseAsync(String subscriptionId, String resourceGroupName,
String location, String connectorName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (subscriptionId == null) {
return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (location == null) {
return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));
}
if (connectorName == null) {
return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.validate(this.client.getEndpoint(), subscriptionId, resourceGroupName,
location, connectorName, this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Validate a Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of 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 validation operation result for a Linker along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> validateWithResponseAsync(String subscriptionId, String resourceGroupName,
String location, String connectorName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (subscriptionId == null) {
return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (location == null) {
return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));
}
if (connectorName == null) {
return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.validate(this.client.getEndpoint(), subscriptionId, resourceGroupName, location, connectorName,
this.client.getApiVersion(), accept, context);
}
/**
* Validate a Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of 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 the validation operation result for a Linker.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, ValidateOperationResultInner>
beginValidateAsync(String subscriptionId, String resourceGroupName, String location, String connectorName) {
Mono>> mono
= validateWithResponseAsync(subscriptionId, resourceGroupName, location, connectorName);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), ValidateOperationResultInner.class, ValidateOperationResultInner.class,
this.client.getContext());
}
/**
* Validate a Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of 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 the validation operation result for a Linker.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, ValidateOperationResultInner> beginValidateAsync(
String subscriptionId, String resourceGroupName, String location, String connectorName, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= validateWithResponseAsync(subscriptionId, resourceGroupName, location, connectorName, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), ValidateOperationResultInner.class, ValidateOperationResultInner.class,
context);
}
/**
* Validate a Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of 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 the validation operation result for a Linker.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ValidateOperationResultInner>
beginValidate(String subscriptionId, String resourceGroupName, String location, String connectorName) {
return this.beginValidateAsync(subscriptionId, resourceGroupName, location, connectorName).getSyncPoller();
}
/**
* Validate a Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of 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 the validation operation result for a Linker.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ValidateOperationResultInner> beginValidate(
String subscriptionId, String resourceGroupName, String location, String connectorName, Context context) {
return this.beginValidateAsync(subscriptionId, resourceGroupName, location, connectorName, context)
.getSyncPoller();
}
/**
* Validate a Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of 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 validation operation result for a Linker on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono validateAsync(String subscriptionId, String resourceGroupName,
String location, String connectorName) {
return beginValidateAsync(subscriptionId, resourceGroupName, location, connectorName).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Validate a Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of 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 validation operation result for a Linker on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono validateAsync(String subscriptionId, String resourceGroupName,
String location, String connectorName, Context context) {
return beginValidateAsync(subscriptionId, resourceGroupName, location, connectorName, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Validate a Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of 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 validation operation result for a Linker.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ValidateOperationResultInner validate(String subscriptionId, String resourceGroupName, String location,
String connectorName) {
return validateAsync(subscriptionId, resourceGroupName, location, connectorName).block();
}
/**
* Validate a Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of 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 validation operation result for a Linker.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ValidateOperationResultInner validate(String subscriptionId, String resourceGroupName, String location,
String connectorName, Context context) {
return validateAsync(subscriptionId, resourceGroupName, location, connectorName, context).block();
}
/**
* Generate configurations for a Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of 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 subscriptionId,
String resourceGroupName, String location, String connectorName, ConfigurationInfo parameters) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (subscriptionId == null) {
return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (location == null) {
return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));
}
if (connectorName == null) {
return Mono.error(new IllegalArgumentException("Parameter connectorName 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(), subscriptionId,
resourceGroupName, location, connectorName, this.client.getApiVersion(), parameters, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Generate configurations for a Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of 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 subscriptionId,
String resourceGroupName, String location, String connectorName, 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 (subscriptionId == null) {
return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (location == null) {
return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));
}
if (connectorName == null) {
return Mono.error(new IllegalArgumentException("Parameter connectorName 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(), subscriptionId, resourceGroupName, location,
connectorName, this.client.getApiVersion(), parameters, accept, context);
}
/**
* Generate configurations for a Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of 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 subscriptionId, String resourceGroupName,
String location, String connectorName) {
final ConfigurationInfo parameters = null;
return generateConfigurationsWithResponseAsync(subscriptionId, resourceGroupName, location, connectorName,
parameters).flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Generate configurations for a Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of 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 subscriptionId,
String resourceGroupName, String location, String connectorName, ConfigurationInfo parameters,
Context context) {
return generateConfigurationsWithResponseAsync(subscriptionId, resourceGroupName, location, connectorName,
parameters, context).block();
}
/**
* Generate configurations for a Connector.
*
* @param subscriptionId The ID of the target subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param location The name of Azure region.
* @param connectorName The name of 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 subscriptionId, String resourceGroupName,
String location, String connectorName) {
final ConfigurationInfo parameters = null;
return generateConfigurationsWithResponse(subscriptionId, resourceGroupName, location, connectorName,
parameters, Context.NONE).getValue();
}
/**
* 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 the list of Linker along with {@link PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listNextSinglePageAsync(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.listNext(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 Linker along with {@link PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listNextSinglePageAsync(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.listNext(nextLink, this.client.getEndpoint(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
}