All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.resourcemanager.netapp.implementation.VolumeQuotaRulesClientImpl Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for NetAppFiles Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft NetApp Files Azure Resource Provider specification. Package tag package-preview-2024-07-01-preview.

There is a newer version: 1.6.0-beta.1
Show newest version
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.netapp.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.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.netapp.fluent.VolumeQuotaRulesClient;
import com.azure.resourcemanager.netapp.fluent.models.VolumeQuotaRuleInner;
import com.azure.resourcemanager.netapp.models.VolumeQuotaRulePatch;
import com.azure.resourcemanager.netapp.models.VolumeQuotaRulesList;
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 VolumeQuotaRulesClient.
 */
public final class VolumeQuotaRulesClientImpl implements VolumeQuotaRulesClient {
    /**
     * The proxy service used to perform REST calls.
     */
    private final VolumeQuotaRulesService service;

    /**
     * The service client containing this operation class.
     */
    private final NetAppManagementClientImpl client;

    /**
     * Initializes an instance of VolumeQuotaRulesClientImpl.
     * 
     * @param client the instance of the service client containing this operation class.
     */
    VolumeQuotaRulesClientImpl(NetAppManagementClientImpl client) {
        this.service
            = RestProxy.create(VolumeQuotaRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
        this.client = client;
    }

    /**
     * The interface defining all the services for NetAppManagementClientVolumeQuotaRules to be used by the proxy
     * service to perform REST calls.
     */
    @Host("{$host}")
    @ServiceInterface(name = "NetAppManagementClie")
    public interface VolumeQuotaRulesService {
        @Headers({ "Content-Type: application/json" })
        @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/volumeQuotaRules")
        @ExpectedResponses({ 200 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono> listByVolume(@HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
            @PathParam("poolName") String poolName, @PathParam("volumeName") String volumeName,
            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);

        @Headers({ "Content-Type: application/json" })
        @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/volumeQuotaRules/{volumeQuotaRuleName}")
        @ExpectedResponses({ 200 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono> get(@HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
            @PathParam("poolName") String poolName, @PathParam("volumeName") String volumeName,
            @PathParam("volumeQuotaRuleName") String volumeQuotaRuleName, @QueryParam("api-version") String apiVersion,
            @HeaderParam("Accept") String accept, Context context);

        @Headers({ "Content-Type: application/json" })
        @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/volumeQuotaRules/{volumeQuotaRuleName}")
        @ExpectedResponses({ 200, 201 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono>> create(@HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
            @PathParam("poolName") String poolName, @PathParam("volumeName") String volumeName,
            @PathParam("volumeQuotaRuleName") String volumeQuotaRuleName, @QueryParam("api-version") String apiVersion,
            @BodyParam("application/json") VolumeQuotaRuleInner body, @HeaderParam("Accept") String accept,
            Context context);

        @Headers({ "Content-Type: application/json" })
        @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/volumeQuotaRules/{volumeQuotaRuleName}")
        @ExpectedResponses({ 200, 202 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono>> update(@HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
            @PathParam("poolName") String poolName, @PathParam("volumeName") String volumeName,
            @PathParam("volumeQuotaRuleName") String volumeQuotaRuleName, @QueryParam("api-version") String apiVersion,
            @BodyParam("application/json") VolumeQuotaRulePatch body, @HeaderParam("Accept") String accept,
            Context context);

        @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" })
        @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/volumeQuotaRules/{volumeQuotaRuleName}")
        @ExpectedResponses({ 200, 202, 204 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono>> delete(@HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
            @PathParam("poolName") String poolName, @PathParam("volumeName") String volumeName,
            @PathParam("volumeQuotaRuleName") String volumeQuotaRuleName, @QueryParam("api-version") String apiVersion,
            Context context);
    }

    /**
     * Get all quota rules for a volume
     * 
     * List all quota rules associated with the volume.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @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 list of Volume Quota Rules along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> listByVolumeSinglePageAsync(String resourceGroupName,
        String accountName, String poolName, String volumeName) {
        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 (accountName == null) {
            return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
        }
        if (poolName == null) {
            return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null."));
        }
        if (volumeName == null) {
            return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.listByVolume(this.client.getEndpoint(), this.client.getSubscriptionId(),
                resourceGroupName, accountName, poolName, volumeName, this.client.getApiVersion(), accept, context))
            .>map(res -> new PagedResponseBase<>(res.getRequest(),
                res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get all quota rules for a volume
     * 
     * List all quota rules associated with the volume.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @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 list of Volume Quota Rules along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> listByVolumeSinglePageAsync(String resourceGroupName,
        String accountName, String poolName, String volumeName, 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 (accountName == null) {
            return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
        }
        if (poolName == null) {
            return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null."));
        }
        if (volumeName == null) {
            return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .listByVolume(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName,
                poolName, volumeName, this.client.getApiVersion(), accept, context)
            .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
                res.getValue().value(), null, null));
    }

    /**
     * Get all quota rules for a volume
     * 
     * List all quota rules associated with the volume.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @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 list of Volume Quota Rules as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux listByVolumeAsync(String resourceGroupName, String accountName,
        String poolName, String volumeName) {
        return new PagedFlux<>(() -> listByVolumeSinglePageAsync(resourceGroupName, accountName, poolName, volumeName));
    }

    /**
     * Get all quota rules for a volume
     * 
     * List all quota rules associated with the volume.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @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 list of Volume Quota Rules as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux listByVolumeAsync(String resourceGroupName, String accountName,
        String poolName, String volumeName, Context context) {
        return new PagedFlux<>(
            () -> listByVolumeSinglePageAsync(resourceGroupName, accountName, poolName, volumeName, context));
    }

    /**
     * Get all quota rules for a volume
     * 
     * List all quota rules associated with the volume.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @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 list of Volume Quota Rules as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable listByVolume(String resourceGroupName, String accountName,
        String poolName, String volumeName) {
        return new PagedIterable<>(listByVolumeAsync(resourceGroupName, accountName, poolName, volumeName));
    }

    /**
     * Get all quota rules for a volume
     * 
     * List all quota rules associated with the volume.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @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 list of Volume Quota Rules as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable listByVolume(String resourceGroupName, String accountName,
        String poolName, String volumeName, Context context) {
        return new PagedIterable<>(listByVolumeAsync(resourceGroupName, accountName, poolName, volumeName, context));
    }

    /**
     * Describe a quota rule
     * 
     * Get details of the specified quota rule.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @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 details of the specified quota rule along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> getWithResponseAsync(String resourceGroupName, String accountName,
        String poolName, String volumeName, String volumeQuotaRuleName) {
        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 (accountName == null) {
            return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
        }
        if (poolName == null) {
            return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null."));
        }
        if (volumeName == null) {
            return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null."));
        }
        if (volumeQuotaRuleName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter volumeQuotaRuleName is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(),
                resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, this.client.getApiVersion(),
                accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Describe a quota rule
     * 
     * Get details of the specified quota rule.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @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 details of the specified quota rule along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> getWithResponseAsync(String resourceGroupName, String accountName,
        String poolName, String volumeName, String volumeQuotaRuleName, 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 (accountName == null) {
            return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
        }
        if (poolName == null) {
            return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null."));
        }
        if (volumeName == null) {
            return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null."));
        }
        if (volumeQuotaRuleName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter volumeQuotaRuleName is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName,
            poolName, volumeName, volumeQuotaRuleName, this.client.getApiVersion(), accept, context);
    }

    /**
     * Describe a quota rule
     * 
     * Get details of the specified quota rule.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @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 details of the specified quota rule on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono getAsync(String resourceGroupName, String accountName, String poolName,
        String volumeName, String volumeQuotaRuleName) {
        return getWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName)
            .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Describe a quota rule
     * 
     * Get details of the specified quota rule.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @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 details of the specified quota rule along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response getWithResponse(String resourceGroupName, String accountName, String poolName,
        String volumeName, String volumeQuotaRuleName, Context context) {
        return getWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, context)
            .block();
    }

    /**
     * Describe a quota rule
     * 
     * Get details of the specified quota rule.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @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 details of the specified quota rule.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public VolumeQuotaRuleInner get(String resourceGroupName, String accountName, String poolName, String volumeName,
        String volumeQuotaRuleName) {
        return getWithResponse(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, Context.NONE)
            .getValue();
    }

    /**
     * Create a quota rule
     * 
     * Create the specified quota rule within the given volume.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @param body Quota rule object supplied in the body of the 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 quota Rule of a Volume along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>> createWithResponseAsync(String resourceGroupName, String accountName,
        String poolName, String volumeName, String volumeQuotaRuleName, VolumeQuotaRuleInner body) {
        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 (accountName == null) {
            return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
        }
        if (poolName == null) {
            return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null."));
        }
        if (volumeName == null) {
            return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null."));
        }
        if (volumeQuotaRuleName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter volumeQuotaRuleName is required and cannot be null."));
        }
        if (body == null) {
            return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
        } else {
            body.validate();
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(),
                resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, this.client.getApiVersion(),
                body, accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Create a quota rule
     * 
     * Create the specified quota rule within the given volume.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @param body Quota rule object supplied in the body of the operation.
     * @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 quota Rule of a Volume along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>> createWithResponseAsync(String resourceGroupName, String accountName,
        String poolName, String volumeName, String volumeQuotaRuleName, VolumeQuotaRuleInner body, 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 (accountName == null) {
            return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
        }
        if (poolName == null) {
            return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null."));
        }
        if (volumeName == null) {
            return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null."));
        }
        if (volumeQuotaRuleName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter volumeQuotaRuleName is required and cannot be null."));
        }
        if (body == null) {
            return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
        } else {
            body.validate();
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
            accountName, poolName, volumeName, volumeQuotaRuleName, this.client.getApiVersion(), body, accept, context);
    }

    /**
     * Create a quota rule
     * 
     * Create the specified quota rule within the given volume.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @param body Quota rule object supplied in the body of the 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 quota Rule of a Volume.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, VolumeQuotaRuleInner> beginCreateAsync(
        String resourceGroupName, String accountName, String poolName, String volumeName, String volumeQuotaRuleName,
        VolumeQuotaRuleInner body) {
        Mono>> mono
            = createWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, body);
        return this.client.getLroResult(mono, this.client.getHttpPipeline(),
            VolumeQuotaRuleInner.class, VolumeQuotaRuleInner.class, this.client.getContext());
    }

    /**
     * Create a quota rule
     * 
     * Create the specified quota rule within the given volume.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @param body Quota rule object supplied in the body of the operation.
     * @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 quota Rule of a Volume.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, VolumeQuotaRuleInner> beginCreateAsync(
        String resourceGroupName, String accountName, String poolName, String volumeName, String volumeQuotaRuleName,
        VolumeQuotaRuleInner body, Context context) {
        context = this.client.mergeContext(context);
        Mono>> mono = createWithResponseAsync(resourceGroupName, accountName, poolName,
            volumeName, volumeQuotaRuleName, body, context);
        return this.client.getLroResult(mono, this.client.getHttpPipeline(),
            VolumeQuotaRuleInner.class, VolumeQuotaRuleInner.class, context);
    }

    /**
     * Create a quota rule
     * 
     * Create the specified quota rule within the given volume.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @param body Quota rule object supplied in the body of the 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 quota Rule of a Volume.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, VolumeQuotaRuleInner> beginCreate(String resourceGroupName,
        String accountName, String poolName, String volumeName, String volumeQuotaRuleName, VolumeQuotaRuleInner body) {
        return this.beginCreateAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, body)
            .getSyncPoller();
    }

    /**
     * Create a quota rule
     * 
     * Create the specified quota rule within the given volume.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @param body Quota rule object supplied in the body of the operation.
     * @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 quota Rule of a Volume.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, VolumeQuotaRuleInner> beginCreate(String resourceGroupName,
        String accountName, String poolName, String volumeName, String volumeQuotaRuleName, VolumeQuotaRuleInner body,
        Context context) {
        return this
            .beginCreateAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, body, context)
            .getSyncPoller();
    }

    /**
     * Create a quota rule
     * 
     * Create the specified quota rule within the given volume.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @param body Quota rule object supplied in the body of the 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 quota Rule of a Volume on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono createAsync(String resourceGroupName, String accountName, String poolName,
        String volumeName, String volumeQuotaRuleName, VolumeQuotaRuleInner body) {
        return beginCreateAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, body).last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Create a quota rule
     * 
     * Create the specified quota rule within the given volume.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @param body Quota rule object supplied in the body of the operation.
     * @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 quota Rule of a Volume on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono createAsync(String resourceGroupName, String accountName, String poolName,
        String volumeName, String volumeQuotaRuleName, VolumeQuotaRuleInner body, Context context) {
        return beginCreateAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, body,
            context).last().flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Create a quota rule
     * 
     * Create the specified quota rule within the given volume.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @param body Quota rule object supplied in the body of the 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 quota Rule of a Volume.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public VolumeQuotaRuleInner create(String resourceGroupName, String accountName, String poolName, String volumeName,
        String volumeQuotaRuleName, VolumeQuotaRuleInner body) {
        return createAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, body).block();
    }

    /**
     * Create a quota rule
     * 
     * Create the specified quota rule within the given volume.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @param body Quota rule object supplied in the body of the operation.
     * @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 quota Rule of a Volume.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public VolumeQuotaRuleInner create(String resourceGroupName, String accountName, String poolName, String volumeName,
        String volumeQuotaRuleName, VolumeQuotaRuleInner body, Context context) {
        return createAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, body, context)
            .block();
    }

    /**
     * Update a quota rule
     * 
     * Patch a quota rule.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @param body Quota rule object supplied in the body of the 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 quota Rule of a Volume along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>> updateWithResponseAsync(String resourceGroupName, String accountName,
        String poolName, String volumeName, String volumeQuotaRuleName, VolumeQuotaRulePatch body) {
        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 (accountName == null) {
            return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
        }
        if (poolName == null) {
            return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null."));
        }
        if (volumeName == null) {
            return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null."));
        }
        if (volumeQuotaRuleName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter volumeQuotaRuleName is required and cannot be null."));
        }
        if (body == null) {
            return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
        } else {
            body.validate();
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(),
                resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, this.client.getApiVersion(),
                body, accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Update a quota rule
     * 
     * Patch a quota rule.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @param body Quota rule object supplied in the body of the operation.
     * @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 quota Rule of a Volume along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>> updateWithResponseAsync(String resourceGroupName, String accountName,
        String poolName, String volumeName, String volumeQuotaRuleName, VolumeQuotaRulePatch body, 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 (accountName == null) {
            return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
        }
        if (poolName == null) {
            return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null."));
        }
        if (volumeName == null) {
            return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null."));
        }
        if (volumeQuotaRuleName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter volumeQuotaRuleName is required and cannot be null."));
        }
        if (body == null) {
            return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
        } else {
            body.validate();
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
            accountName, poolName, volumeName, volumeQuotaRuleName, this.client.getApiVersion(), body, accept, context);
    }

    /**
     * Update a quota rule
     * 
     * Patch a quota rule.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @param body Quota rule object supplied in the body of the 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 quota Rule of a Volume.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, VolumeQuotaRuleInner> beginUpdateAsync(
        String resourceGroupName, String accountName, String poolName, String volumeName, String volumeQuotaRuleName,
        VolumeQuotaRulePatch body) {
        Mono>> mono
            = updateWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, body);
        return this.client.getLroResult(mono, this.client.getHttpPipeline(),
            VolumeQuotaRuleInner.class, VolumeQuotaRuleInner.class, this.client.getContext());
    }

    /**
     * Update a quota rule
     * 
     * Patch a quota rule.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @param body Quota rule object supplied in the body of the operation.
     * @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 quota Rule of a Volume.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, VolumeQuotaRuleInner> beginUpdateAsync(
        String resourceGroupName, String accountName, String poolName, String volumeName, String volumeQuotaRuleName,
        VolumeQuotaRulePatch body, Context context) {
        context = this.client.mergeContext(context);
        Mono>> mono = updateWithResponseAsync(resourceGroupName, accountName, poolName,
            volumeName, volumeQuotaRuleName, body, context);
        return this.client.getLroResult(mono, this.client.getHttpPipeline(),
            VolumeQuotaRuleInner.class, VolumeQuotaRuleInner.class, context);
    }

    /**
     * Update a quota rule
     * 
     * Patch a quota rule.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @param body Quota rule object supplied in the body of the 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 quota Rule of a Volume.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, VolumeQuotaRuleInner> beginUpdate(String resourceGroupName,
        String accountName, String poolName, String volumeName, String volumeQuotaRuleName, VolumeQuotaRulePatch body) {
        return this.beginUpdateAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, body)
            .getSyncPoller();
    }

    /**
     * Update a quota rule
     * 
     * Patch a quota rule.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @param body Quota rule object supplied in the body of the operation.
     * @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 quota Rule of a Volume.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, VolumeQuotaRuleInner> beginUpdate(String resourceGroupName,
        String accountName, String poolName, String volumeName, String volumeQuotaRuleName, VolumeQuotaRulePatch body,
        Context context) {
        return this
            .beginUpdateAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, body, context)
            .getSyncPoller();
    }

    /**
     * Update a quota rule
     * 
     * Patch a quota rule.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @param body Quota rule object supplied in the body of the 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 quota Rule of a Volume on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono updateAsync(String resourceGroupName, String accountName, String poolName,
        String volumeName, String volumeQuotaRuleName, VolumeQuotaRulePatch body) {
        return beginUpdateAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, body).last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Update a quota rule
     * 
     * Patch a quota rule.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @param body Quota rule object supplied in the body of the operation.
     * @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 quota Rule of a Volume on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono updateAsync(String resourceGroupName, String accountName, String poolName,
        String volumeName, String volumeQuotaRuleName, VolumeQuotaRulePatch body, Context context) {
        return beginUpdateAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, body,
            context).last().flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Update a quota rule
     * 
     * Patch a quota rule.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @param body Quota rule object supplied in the body of the 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 quota Rule of a Volume.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public VolumeQuotaRuleInner update(String resourceGroupName, String accountName, String poolName, String volumeName,
        String volumeQuotaRuleName, VolumeQuotaRulePatch body) {
        return updateAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, body).block();
    }

    /**
     * Update a quota rule
     * 
     * Patch a quota rule.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @param body Quota rule object supplied in the body of the operation.
     * @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 quota Rule of a Volume.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public VolumeQuotaRuleInner update(String resourceGroupName, String accountName, String poolName, String volumeName,
        String volumeQuotaRuleName, VolumeQuotaRulePatch body, Context context) {
        return updateAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, body, context)
            .block();
    }

    /**
     * Delete a quota rule
     * 
     * Delete quota rule.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @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 resourceGroupName, String accountName,
        String poolName, String volumeName, String volumeQuotaRuleName) {
        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 (accountName == null) {
            return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
        }
        if (poolName == null) {
            return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null."));
        }
        if (volumeName == null) {
            return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null."));
        }
        if (volumeQuotaRuleName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter volumeQuotaRuleName is required and cannot be null."));
        }
        return FluxUtil
            .withContext(
                context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
                    accountName, poolName, volumeName, volumeQuotaRuleName, this.client.getApiVersion(), context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Delete a quota rule
     * 
     * Delete quota rule.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @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 resourceGroupName, String accountName,
        String poolName, String volumeName, String volumeQuotaRuleName, 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 (accountName == null) {
            return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
        }
        if (poolName == null) {
            return Mono.error(new IllegalArgumentException("Parameter poolName is required and cannot be null."));
        }
        if (volumeName == null) {
            return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null."));
        }
        if (volumeQuotaRuleName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter volumeQuotaRuleName is required and cannot be null."));
        }
        context = this.client.mergeContext(context);
        return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
            accountName, poolName, volumeName, volumeQuotaRuleName, this.client.getApiVersion(), context);
    }

    /**
     * Delete a quota rule
     * 
     * Delete quota rule.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @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 resourceGroupName, String accountName,
        String poolName, String volumeName, String volumeQuotaRuleName) {
        Mono>> mono
            = deleteWithResponseAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName);
        return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
            this.client.getContext());
    }

    /**
     * Delete a quota rule
     * 
     * Delete quota rule.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @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 resourceGroupName, String accountName,
        String poolName, String volumeName, String volumeQuotaRuleName, Context context) {
        context = this.client.mergeContext(context);
        Mono>> mono = deleteWithResponseAsync(resourceGroupName, accountName, poolName,
            volumeName, volumeQuotaRuleName, context);
        return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
            context);
    }

    /**
     * Delete a quota rule
     * 
     * Delete quota rule.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @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 resourceGroupName, String accountName, String poolName,
        String volumeName, String volumeQuotaRuleName) {
        return this.beginDeleteAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName)
            .getSyncPoller();
    }

    /**
     * Delete a quota rule
     * 
     * Delete quota rule.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @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 resourceGroupName, String accountName, String poolName,
        String volumeName, String volumeQuotaRuleName, Context context) {
        return this.beginDeleteAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, context)
            .getSyncPoller();
    }

    /**
     * Delete a quota rule
     * 
     * Delete quota rule.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @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 resourceGroupName, String accountName, String poolName, String volumeName,
        String volumeQuotaRuleName) {
        return beginDeleteAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName).last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Delete a quota rule
     * 
     * Delete quota rule.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @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 resourceGroupName, String accountName, String poolName, String volumeName,
        String volumeQuotaRuleName, Context context) {
        return beginDeleteAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, context)
            .last().flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Delete a quota rule
     * 
     * Delete quota rule.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @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 resourceGroupName, String accountName, String poolName, String volumeName,
        String volumeQuotaRuleName) {
        deleteAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName).block();
    }

    /**
     * Delete a quota rule
     * 
     * Delete quota rule.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param accountName The name of the NetApp account.
     * @param poolName The name of the capacity pool.
     * @param volumeName The name of the volume.
     * @param volumeQuotaRuleName The name of volume quota rule.
     * @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 resourceGroupName, String accountName, String poolName, String volumeName,
        String volumeQuotaRuleName, Context context) {
        deleteAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, context).block();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy