com.azure.resourcemanager.appplatform.implementation.PredefinedAcceleratorsClientImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-appplatform Show documentation
Show all versions of azure-resourcemanager-appplatform Show documentation
This package contains Microsoft Azure App Platform Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.appplatform.implementation;
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.PathParam;
import com.azure.core.annotation.Post;
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.appplatform.fluent.PredefinedAcceleratorsClient;
import com.azure.resourcemanager.appplatform.fluent.models.PredefinedAcceleratorResourceInner;
import com.azure.resourcemanager.appplatform.models.PredefinedAcceleratorResourceCollection;
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 PredefinedAcceleratorsClient.
*/
public final class PredefinedAcceleratorsClientImpl implements PredefinedAcceleratorsClient {
/**
* The proxy service used to perform REST calls.
*/
private final PredefinedAcceleratorsService service;
/**
* The service client containing this operation class.
*/
private final AppPlatformManagementClientImpl client;
/**
* Initializes an instance of PredefinedAcceleratorsClientImpl.
*
* @param client the instance of the service client containing this operation class.
*/
PredefinedAcceleratorsClientImpl(AppPlatformManagementClientImpl client) {
this.service = RestProxy.create(PredefinedAcceleratorsService.class, client.getHttpPipeline(),
client.getSerializerAdapter());
this.client = client;
}
/**
* The interface defining all the services for AppPlatformManagementClientPredefinedAccelerators to be used by the
* proxy service to perform REST calls.
*/
@Host("{$host}")
@ServiceInterface(name = "AppPlatformManagemen")
public interface PredefinedAcceleratorsService {
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> list(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("serviceName") String serviceName,
@PathParam("applicationAcceleratorName") String applicationAcceleratorName,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> get(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("serviceName") String serviceName,
@PathParam("applicationAcceleratorName") String applicationAcceleratorName,
@PathParam("predefinedAcceleratorName") String predefinedAcceleratorName,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> disable(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("serviceName") String serviceName,
@PathParam("applicationAcceleratorName") String applicationAcceleratorName,
@PathParam("predefinedAcceleratorName") String predefinedAcceleratorName,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> enable(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("serviceName") String serviceName,
@PathParam("applicationAcceleratorName") String applicationAcceleratorName,
@PathParam("predefinedAcceleratorName") String predefinedAcceleratorName,
@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);
}
/**
* Handle requests to list all predefined accelerators.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param applicationAcceleratorName The name of the application accelerator.
* @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 response body along with {@link PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSinglePageAsync(String resourceGroupName,
String serviceName, String applicationAcceleratorName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (serviceName == null) {
return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));
}
if (applicationAcceleratorName == null) {
return Mono.error(
new IllegalArgumentException("Parameter applicationAcceleratorName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, serviceName, applicationAcceleratorName, 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()));
}
/**
* Handle requests to list all predefined accelerators.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param applicationAcceleratorName The name of the application accelerator.
* @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 response body along with {@link PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSinglePageAsync(String resourceGroupName,
String serviceName, String applicationAcceleratorName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (serviceName == null) {
return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));
}
if (applicationAcceleratorName == null) {
return Mono.error(
new IllegalArgumentException("Parameter applicationAcceleratorName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
resourceGroupName, serviceName, applicationAcceleratorName, accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* Handle requests to list all predefined accelerators.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param applicationAcceleratorName The name of the application accelerator.
* @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 paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux listAsync(String resourceGroupName, String serviceName,
String applicationAcceleratorName) {
return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, serviceName, applicationAcceleratorName),
nextLink -> listNextSinglePageAsync(nextLink));
}
/**
* Handle requests to list all predefined accelerators.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param applicationAcceleratorName The name of the application accelerator.
* @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 paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAsync(String resourceGroupName, String serviceName,
String applicationAcceleratorName, Context context) {
return new PagedFlux<>(
() -> listSinglePageAsync(resourceGroupName, serviceName, applicationAcceleratorName, context),
nextLink -> listNextSinglePageAsync(nextLink, context));
}
/**
* Handle requests to list all predefined accelerators.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param applicationAcceleratorName The name of the application accelerator.
* @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 paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list(String resourceGroupName, String serviceName,
String applicationAcceleratorName) {
return new PagedIterable<>(listAsync(resourceGroupName, serviceName, applicationAcceleratorName));
}
/**
* Handle requests to list all predefined accelerators.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param applicationAcceleratorName The name of the application accelerator.
* @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 paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list(String resourceGroupName, String serviceName,
String applicationAcceleratorName, Context context) {
return new PagedIterable<>(listAsync(resourceGroupName, serviceName, applicationAcceleratorName, context));
}
/**
* Get the predefined accelerator.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param applicationAcceleratorName The name of the application accelerator.
* @param predefinedAcceleratorName The name of the predefined accelerator.
* @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 predefined accelerator along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> getWithResponseAsync(String resourceGroupName,
String serviceName, String applicationAcceleratorName, String predefinedAcceleratorName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (serviceName == null) {
return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));
}
if (applicationAcceleratorName == null) {
return Mono.error(
new IllegalArgumentException("Parameter applicationAcceleratorName is required and cannot be null."));
}
if (predefinedAcceleratorName == null) {
return Mono.error(
new IllegalArgumentException("Parameter predefinedAcceleratorName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, serviceName, applicationAcceleratorName,
predefinedAcceleratorName, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get the predefined accelerator.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param applicationAcceleratorName The name of the application accelerator.
* @param predefinedAcceleratorName The name of the predefined accelerator.
* @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 predefined accelerator along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getWithResponseAsync(String resourceGroupName,
String serviceName, String applicationAcceleratorName, String predefinedAcceleratorName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (serviceName == null) {
return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));
}
if (applicationAcceleratorName == null) {
return Mono.error(
new IllegalArgumentException("Parameter applicationAcceleratorName is required and cannot be null."));
}
if (predefinedAcceleratorName == null) {
return Mono.error(
new IllegalArgumentException("Parameter predefinedAcceleratorName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName, accept, context);
}
/**
* Get the predefined accelerator.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param applicationAcceleratorName The name of the application accelerator.
* @param predefinedAcceleratorName The name of the predefined accelerator.
* @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 predefined accelerator on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono getAsync(String resourceGroupName, String serviceName,
String applicationAcceleratorName, String predefinedAcceleratorName) {
return getWithResponseAsync(resourceGroupName, serviceName, applicationAcceleratorName,
predefinedAcceleratorName).flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Get the predefined accelerator.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param applicationAcceleratorName The name of the application accelerator.
* @param predefinedAcceleratorName The name of the predefined accelerator.
* @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 predefined accelerator along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getWithResponse(String resourceGroupName, String serviceName,
String applicationAcceleratorName, String predefinedAcceleratorName, Context context) {
return getWithResponseAsync(resourceGroupName, serviceName, applicationAcceleratorName,
predefinedAcceleratorName, context).block();
}
/**
* Get the predefined accelerator.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param applicationAcceleratorName The name of the application accelerator.
* @param predefinedAcceleratorName The name of the predefined accelerator.
* @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 predefined accelerator.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public PredefinedAcceleratorResourceInner get(String resourceGroupName, String serviceName,
String applicationAcceleratorName, String predefinedAcceleratorName) {
return getWithResponse(resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName,
Context.NONE).getValue();
}
/**
* Disable predefined accelerator.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param applicationAcceleratorName The name of the application accelerator.
* @param predefinedAcceleratorName The name of the predefined accelerator.
* @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)
public Mono>> disableWithResponseAsync(String resourceGroupName, String serviceName,
String applicationAcceleratorName, String predefinedAcceleratorName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (serviceName == null) {
return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));
}
if (applicationAcceleratorName == null) {
return Mono.error(
new IllegalArgumentException("Parameter applicationAcceleratorName is required and cannot be null."));
}
if (predefinedAcceleratorName == null) {
return Mono.error(
new IllegalArgumentException("Parameter predefinedAcceleratorName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.disable(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, serviceName, applicationAcceleratorName,
predefinedAcceleratorName, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Disable predefined accelerator.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param applicationAcceleratorName The name of the application accelerator.
* @param predefinedAcceleratorName The name of the predefined accelerator.
* @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>> disableWithResponseAsync(String resourceGroupName, String serviceName,
String applicationAcceleratorName, String predefinedAcceleratorName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (serviceName == null) {
return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));
}
if (applicationAcceleratorName == null) {
return Mono.error(
new IllegalArgumentException("Parameter applicationAcceleratorName is required and cannot be null."));
}
if (predefinedAcceleratorName == null) {
return Mono.error(
new IllegalArgumentException("Parameter predefinedAcceleratorName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.disable(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName, accept, context);
}
/**
* Disable predefined accelerator.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param applicationAcceleratorName The name of the application accelerator.
* @param predefinedAcceleratorName The name of the predefined accelerator.
* @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)
public PollerFlux, Void> beginDisableAsync(String resourceGroupName, String serviceName,
String applicationAcceleratorName, String predefinedAcceleratorName) {
Mono>> mono = disableWithResponseAsync(resourceGroupName, serviceName,
applicationAcceleratorName, predefinedAcceleratorName);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
this.client.getContext());
}
/**
* Disable predefined accelerator.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param applicationAcceleratorName The name of the application accelerator.
* @param predefinedAcceleratorName The name of the predefined accelerator.
* @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> beginDisableAsync(String resourceGroupName, String serviceName,
String applicationAcceleratorName, String predefinedAcceleratorName, Context context) {
context = this.client.mergeContext(context);
Mono>> mono = disableWithResponseAsync(resourceGroupName, serviceName,
applicationAcceleratorName, predefinedAcceleratorName, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
context);
}
/**
* Disable predefined accelerator.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param applicationAcceleratorName The name of the application accelerator.
* @param predefinedAcceleratorName The name of the predefined accelerator.
* @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> beginDisable(String resourceGroupName, String serviceName,
String applicationAcceleratorName, String predefinedAcceleratorName) {
return this
.beginDisableAsync(resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName)
.getSyncPoller();
}
/**
* Disable predefined accelerator.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param applicationAcceleratorName The name of the application accelerator.
* @param predefinedAcceleratorName The name of the predefined accelerator.
* @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> beginDisable(String resourceGroupName, String serviceName,
String applicationAcceleratorName, String predefinedAcceleratorName, Context context) {
return this.beginDisableAsync(resourceGroupName, serviceName, applicationAcceleratorName,
predefinedAcceleratorName, context).getSyncPoller();
}
/**
* Disable predefined accelerator.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param applicationAcceleratorName The name of the application accelerator.
* @param predefinedAcceleratorName The name of the predefined accelerator.
* @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)
public Mono disableAsync(String resourceGroupName, String serviceName, String applicationAcceleratorName,
String predefinedAcceleratorName) {
return beginDisableAsync(resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName)
.last().flatMap(this.client::getLroFinalResultOrError);
}
/**
* Disable predefined accelerator.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param applicationAcceleratorName The name of the application accelerator.
* @param predefinedAcceleratorName The name of the predefined accelerator.
* @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 disableAsync(String resourceGroupName, String serviceName, String applicationAcceleratorName,
String predefinedAcceleratorName, Context context) {
return beginDisableAsync(resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName,
context).last().flatMap(this.client::getLroFinalResultOrError);
}
/**
* Disable predefined accelerator.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param applicationAcceleratorName The name of the application accelerator.
* @param predefinedAcceleratorName The name of the predefined accelerator.
* @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 disable(String resourceGroupName, String serviceName, String applicationAcceleratorName,
String predefinedAcceleratorName) {
disableAsync(resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName).block();
}
/**
* Disable predefined accelerator.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param applicationAcceleratorName The name of the application accelerator.
* @param predefinedAcceleratorName The name of the predefined accelerator.
* @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 disable(String resourceGroupName, String serviceName, String applicationAcceleratorName,
String predefinedAcceleratorName, Context context) {
disableAsync(resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName, context)
.block();
}
/**
* Enable predefined accelerator.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param applicationAcceleratorName The name of the application accelerator.
* @param predefinedAcceleratorName The name of the predefined accelerator.
* @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)
public Mono>> enableWithResponseAsync(String resourceGroupName, String serviceName,
String applicationAcceleratorName, String predefinedAcceleratorName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (serviceName == null) {
return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));
}
if (applicationAcceleratorName == null) {
return Mono.error(
new IllegalArgumentException("Parameter applicationAcceleratorName is required and cannot be null."));
}
if (predefinedAcceleratorName == null) {
return Mono.error(
new IllegalArgumentException("Parameter predefinedAcceleratorName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.enable(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, serviceName, applicationAcceleratorName,
predefinedAcceleratorName, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Enable predefined accelerator.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param applicationAcceleratorName The name of the application accelerator.
* @param predefinedAcceleratorName The name of the predefined accelerator.
* @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>> enableWithResponseAsync(String resourceGroupName, String serviceName,
String applicationAcceleratorName, String predefinedAcceleratorName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (serviceName == null) {
return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null."));
}
if (applicationAcceleratorName == null) {
return Mono.error(
new IllegalArgumentException("Parameter applicationAcceleratorName is required and cannot be null."));
}
if (predefinedAcceleratorName == null) {
return Mono.error(
new IllegalArgumentException("Parameter predefinedAcceleratorName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.enable(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName, accept, context);
}
/**
* Enable predefined accelerator.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param applicationAcceleratorName The name of the application accelerator.
* @param predefinedAcceleratorName The name of the predefined accelerator.
* @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)
public PollerFlux, Void> beginEnableAsync(String resourceGroupName, String serviceName,
String applicationAcceleratorName, String predefinedAcceleratorName) {
Mono>> mono = enableWithResponseAsync(resourceGroupName, serviceName,
applicationAcceleratorName, predefinedAcceleratorName);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
this.client.getContext());
}
/**
* Enable predefined accelerator.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param applicationAcceleratorName The name of the application accelerator.
* @param predefinedAcceleratorName The name of the predefined accelerator.
* @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> beginEnableAsync(String resourceGroupName, String serviceName,
String applicationAcceleratorName, String predefinedAcceleratorName, Context context) {
context = this.client.mergeContext(context);
Mono>> mono = enableWithResponseAsync(resourceGroupName, serviceName,
applicationAcceleratorName, predefinedAcceleratorName, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
context);
}
/**
* Enable predefined accelerator.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param applicationAcceleratorName The name of the application accelerator.
* @param predefinedAcceleratorName The name of the predefined accelerator.
* @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> beginEnable(String resourceGroupName, String serviceName,
String applicationAcceleratorName, String predefinedAcceleratorName) {
return this
.beginEnableAsync(resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName)
.getSyncPoller();
}
/**
* Enable predefined accelerator.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param applicationAcceleratorName The name of the application accelerator.
* @param predefinedAcceleratorName The name of the predefined accelerator.
* @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> beginEnable(String resourceGroupName, String serviceName,
String applicationAcceleratorName, String predefinedAcceleratorName, Context context) {
return this.beginEnableAsync(resourceGroupName, serviceName, applicationAcceleratorName,
predefinedAcceleratorName, context).getSyncPoller();
}
/**
* Enable predefined accelerator.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param applicationAcceleratorName The name of the application accelerator.
* @param predefinedAcceleratorName The name of the predefined accelerator.
* @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)
public Mono enableAsync(String resourceGroupName, String serviceName, String applicationAcceleratorName,
String predefinedAcceleratorName) {
return beginEnableAsync(resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName)
.last().flatMap(this.client::getLroFinalResultOrError);
}
/**
* Enable predefined accelerator.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param applicationAcceleratorName The name of the application accelerator.
* @param predefinedAcceleratorName The name of the predefined accelerator.
* @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 enableAsync(String resourceGroupName, String serviceName, String applicationAcceleratorName,
String predefinedAcceleratorName, Context context) {
return beginEnableAsync(resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName,
context).last().flatMap(this.client::getLroFinalResultOrError);
}
/**
* Enable predefined accelerator.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param applicationAcceleratorName The name of the application accelerator.
* @param predefinedAcceleratorName The name of the predefined accelerator.
* @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 enable(String resourceGroupName, String serviceName, String applicationAcceleratorName,
String predefinedAcceleratorName) {
enableAsync(resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName).block();
}
/**
* Enable predefined accelerator.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param applicationAcceleratorName The name of the application accelerator.
* @param predefinedAcceleratorName The name of the predefined accelerator.
* @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 enable(String resourceGroupName, String serviceName, String applicationAcceleratorName,
String predefinedAcceleratorName, Context context) {
enableAsync(resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName, context)
.block();
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items
*
* The nextLink parameter.
* @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 response body 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
*
* The nextLink parameter.
* @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 response body 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));
}
}