// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.providerhub.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.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.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.resourcemanager.providerhub.fluent.SkusClient;
import com.azure.resourcemanager.providerhub.fluent.models.SkuResourceInner;
import com.azure.resourcemanager.providerhub.models.SkuResourceArrayResponseWithContinuation;
import reactor.core.publisher.Mono;

/** An instance of this class provides access to all the operations defined in SkusClient. */
public final class SkusClientImpl implements SkusClient {
    /** The proxy service used to perform REST calls. */
    private final SkusService service;

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

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

    /**
     * The interface defining all the services for ProviderHubSkus to be used by the proxy service to perform REST
     * calls.
     */
    @Host("{$host}")
    @ServiceInterface(name = "ProviderHubSkus")
    public interface SkusService {
        @Headers({"Content-Type: application/json"})
        @Get(
            "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}"
                + "/resourcetypeRegistrations/{resourceType}/skus/{sku}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<SkuResourceInner>> get(
            @HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("providerNamespace") String providerNamespace,
            @PathParam("resourceType") String resourceType,
            @PathParam("sku") String sku,
            @QueryParam("api-version") String apiVersion,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Put(
            "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}"
                + "/resourcetypeRegistrations/{resourceType}/skus/{sku}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<SkuResourceInner>> createOrUpdate(
            @HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("providerNamespace") String providerNamespace,
            @PathParam("resourceType") String resourceType,
            @PathParam("sku") String sku,
            @QueryParam("api-version") String apiVersion,
            @BodyParam("application/json") SkuResourceInner properties,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Delete(
            "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}"
                + "/resourcetypeRegistrations/{resourceType}/skus/{sku}")
        @ExpectedResponses({200, 204})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<Void>> delete(
            @HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("providerNamespace") String providerNamespace,
            @PathParam("resourceType") String resourceType,
            @PathParam("sku") String sku,
            @QueryParam("api-version") String apiVersion,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Get(
            "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}"
                + "/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/skus"
                + "/{sku}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<SkuResourceInner>> getNestedResourceTypeFirst(
            @HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("providerNamespace") String providerNamespace,
            @PathParam("resourceType") String resourceType,
            @PathParam("nestedResourceTypeFirst") String nestedResourceTypeFirst,
            @PathParam("sku") String sku,
            @QueryParam("api-version") String apiVersion,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Put(
            "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}"
                + "/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/skus"
                + "/{sku}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<SkuResourceInner>> createOrUpdateNestedResourceTypeFirst(
            @HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("providerNamespace") String providerNamespace,
            @PathParam("resourceType") String resourceType,
            @PathParam("nestedResourceTypeFirst") String nestedResourceTypeFirst,
            @PathParam("sku") String sku,
            @QueryParam("api-version") String apiVersion,
            @BodyParam("application/json") SkuResourceInner properties,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Delete(
            "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}"
                + "/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/skus"
                + "/{sku}")
        @ExpectedResponses({200, 204})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<Void>> deleteNestedResourceTypeFirst(
            @HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("providerNamespace") String providerNamespace,
            @PathParam("resourceType") String resourceType,
            @PathParam("nestedResourceTypeFirst") String nestedResourceTypeFirst,
            @PathParam("sku") String sku,
            @QueryParam("api-version") String apiVersion,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Get(
            "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}"
                + "/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}"
                + "/resourcetypeRegistrations/{nestedResourceTypeSecond}/skus/{sku}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<SkuResourceInner>> getNestedResourceTypeSecond(
            @HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("providerNamespace") String providerNamespace,
            @PathParam("resourceType") String resourceType,
            @PathParam("nestedResourceTypeFirst") String nestedResourceTypeFirst,
            @PathParam("nestedResourceTypeSecond") String nestedResourceTypeSecond,
            @PathParam("sku") String sku,
            @QueryParam("api-version") String apiVersion,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Put(
            "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}"
                + "/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}"
                + "/resourcetypeRegistrations/{nestedResourceTypeSecond}/skus/{sku}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<SkuResourceInner>> createOrUpdateNestedResourceTypeSecond(
            @HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("providerNamespace") String providerNamespace,
            @PathParam("resourceType") String resourceType,
            @PathParam("nestedResourceTypeFirst") String nestedResourceTypeFirst,
            @PathParam("nestedResourceTypeSecond") String nestedResourceTypeSecond,
            @PathParam("sku") String sku,
            @QueryParam("api-version") String apiVersion,
            @BodyParam("application/json") SkuResourceInner properties,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Delete(
            "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}"
                + "/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}"
                + "/resourcetypeRegistrations/{nestedResourceTypeSecond}/skus/{sku}")
        @ExpectedResponses({200, 204})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<Void>> deleteNestedResourceTypeSecond(
            @HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("providerNamespace") String providerNamespace,
            @PathParam("resourceType") String resourceType,
            @PathParam("nestedResourceTypeFirst") String nestedResourceTypeFirst,
            @PathParam("nestedResourceTypeSecond") String nestedResourceTypeSecond,
            @PathParam("sku") String sku,
            @QueryParam("api-version") String apiVersion,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Get(
            "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}"
                + "/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}"
                + "/resourcetypeRegistrations/{nestedResourceTypeSecond}/resourcetypeRegistrations"
                + "/{nestedResourceTypeThird}/skus/{sku}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<SkuResourceInner>> getNestedResourceTypeThird(
            @HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("providerNamespace") String providerNamespace,
            @PathParam("resourceType") String resourceType,
            @PathParam("nestedResourceTypeFirst") String nestedResourceTypeFirst,
            @PathParam("nestedResourceTypeSecond") String nestedResourceTypeSecond,
            @PathParam("nestedResourceTypeThird") String nestedResourceTypeThird,
            @PathParam("sku") String sku,
            @QueryParam("api-version") String apiVersion,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Put(
            "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}"
                + "/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}"
                + "/resourcetypeRegistrations/{nestedResourceTypeSecond}/resourcetypeRegistrations"
                + "/{nestedResourceTypeThird}/skus/{sku}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<SkuResourceInner>> createOrUpdateNestedResourceTypeThird(
            @HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("providerNamespace") String providerNamespace,
            @PathParam("resourceType") String resourceType,
            @PathParam("nestedResourceTypeFirst") String nestedResourceTypeFirst,
            @PathParam("nestedResourceTypeSecond") String nestedResourceTypeSecond,
            @PathParam("nestedResourceTypeThird") String nestedResourceTypeThird,
            @PathParam("sku") String sku,
            @QueryParam("api-version") String apiVersion,
            @BodyParam("application/json") SkuResourceInner properties,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Delete(
            "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}"
                + "/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}"
                + "/resourcetypeRegistrations/{nestedResourceTypeSecond}/resourcetypeRegistrations"
                + "/{nestedResourceTypeThird}/skus/{sku}")
        @ExpectedResponses({200, 204})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<Void>> deleteNestedResourceTypeThird(
            @HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("providerNamespace") String providerNamespace,
            @PathParam("resourceType") String resourceType,
            @PathParam("nestedResourceTypeFirst") String nestedResourceTypeFirst,
            @PathParam("nestedResourceTypeSecond") String nestedResourceTypeSecond,
            @PathParam("nestedResourceTypeThird") String nestedResourceTypeThird,
            @PathParam("sku") String sku,
            @QueryParam("api-version") String apiVersion,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Get(
            "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}"
                + "/resourcetypeRegistrations/{resourceType}/skus")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<SkuResourceArrayResponseWithContinuation>> listByResourceTypeRegistrations(
            @HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("providerNamespace") String providerNamespace,
            @PathParam("resourceType") String resourceType,
            @QueryParam("api-version") String apiVersion,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Get(
            "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}"
                + "/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}/skus")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<SkuResourceArrayResponseWithContinuation>> listByResourceTypeRegistrationsNestedResourceTypeFirst(
            @HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("providerNamespace") String providerNamespace,
            @PathParam("resourceType") String resourceType,
            @PathParam("nestedResourceTypeFirst") String nestedResourceTypeFirst,
            @QueryParam("api-version") String apiVersion,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Get(
            "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}"
                + "/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}"
                + "/resourcetypeRegistrations/{nestedResourceTypeSecond}/skus")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<SkuResourceArrayResponseWithContinuation>>
            listByResourceTypeRegistrationsNestedResourceTypeSecond(
                @HostParam("$host") String endpoint,
                @PathParam("subscriptionId") String subscriptionId,
                @PathParam("providerNamespace") String providerNamespace,
                @PathParam("resourceType") String resourceType,
                @PathParam("nestedResourceTypeFirst") String nestedResourceTypeFirst,
                @PathParam("nestedResourceTypeSecond") String nestedResourceTypeSecond,
                @QueryParam("api-version") String apiVersion,
                @HeaderParam("Accept") String accept,
                Context context);

        @Headers({"Content-Type: application/json"})
        @Get(
            "/subscriptions/{subscriptionId}/providers/Microsoft.ProviderHub/providerRegistrations/{providerNamespace}"
                + "/resourcetypeRegistrations/{resourceType}/resourcetypeRegistrations/{nestedResourceTypeFirst}"
                + "/resourcetypeRegistrations/{nestedResourceTypeSecond}/resourcetypeRegistrations"
                + "/{nestedResourceTypeThird}/skus")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<SkuResourceArrayResponseWithContinuation>> listByResourceTypeRegistrationsNestedResourceTypeThird(
            @HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("providerNamespace") String providerNamespace,
            @PathParam("resourceType") String resourceType,
            @PathParam("nestedResourceTypeFirst") String nestedResourceTypeFirst,
            @PathParam("nestedResourceTypeSecond") String nestedResourceTypeSecond,
            @PathParam("nestedResourceTypeThird") String nestedResourceTypeThird,
            @QueryParam("api-version") String apiVersion,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Get("{nextLink}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<SkuResourceArrayResponseWithContinuation>> listByResourceTypeRegistrationsNext(
            @PathParam(value = "nextLink", encoded = true) String nextLink,
            @HostParam("$host") String endpoint,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Get("{nextLink}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<SkuResourceArrayResponseWithContinuation>>
            listByResourceTypeRegistrationsNestedResourceTypeFirstNext(
                @PathParam(value = "nextLink", encoded = true) String nextLink,
                @HostParam("$host") String endpoint,
                @HeaderParam("Accept") String accept,
                Context context);

        @Headers({"Content-Type: application/json"})
        @Get("{nextLink}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<SkuResourceArrayResponseWithContinuation>>
            listByResourceTypeRegistrationsNestedResourceTypeSecondNext(
                @PathParam(value = "nextLink", encoded = true) String nextLink,
                @HostParam("$host") String endpoint,
                @HeaderParam("Accept") String accept,
                Context context);

        @Headers({"Content-Type: application/json"})
        @Get("{nextLink}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<SkuResourceArrayResponseWithContinuation>>
            listByResourceTypeRegistrationsNestedResourceTypeThirdNext(
                @PathParam(value = "nextLink", encoded = true) String nextLink,
                @HostParam("$host") String endpoint,
                @HeaderParam("Accept") String accept,
                Context context);
    }

    /**
     * Gets the sku details for the given resource type and sku name.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param sku The SKU.
     * @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 sku details for the given resource type and sku name along with {@link Response} on successful
     *     completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<SkuResourceInner>> getWithResponseAsync(
        String providerNamespace, String resourceType, String sku) {
        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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        if (sku == null) {
            return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .get(
                            this.client.getEndpoint(),
                            this.client.getSubscriptionId(),
                            providerNamespace,
                            resourceType,
                            sku,
                            this.client.getApiVersion(),
                            accept,
                            context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Gets the sku details for the given resource type and sku name.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param sku The SKU.
     * @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 sku details for the given resource type and sku name along with {@link Response} on successful
     *     completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<SkuResourceInner>> getWithResponseAsync(
        String providerNamespace, String resourceType, String sku, 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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        if (sku == null) {
            return Mono.error(new IllegalArgumentException("Parameter sku 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(),
                providerNamespace,
                resourceType,
                sku,
                this.client.getApiVersion(),
                accept,
                context);
    }

    /**
     * Gets the sku details for the given resource type and sku name.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param sku The SKU.
     * @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 sku details for the given resource type and sku name on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<SkuResourceInner> getAsync(String providerNamespace, String resourceType, String sku) {
        return getWithResponseAsync(providerNamespace, resourceType, sku)
            .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Gets the sku details for the given resource type and sku name.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param sku The SKU.
     * @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 sku details for the given resource type and sku name along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<SkuResourceInner> getWithResponse(
        String providerNamespace, String resourceType, String sku, Context context) {
        return getWithResponseAsync(providerNamespace, resourceType, sku, context).block();
    }

    /**
     * Gets the sku details for the given resource type and sku name.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param sku The SKU.
     * @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 sku details for the given resource type and sku name.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public SkuResourceInner get(String providerNamespace, String resourceType, String sku) {
        return getWithResponse(providerNamespace, resourceType, sku, Context.NONE).getValue();
    }

    /**
     * Creates or updates the resource type skus in the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param sku The SKU.
     * @param properties The required body parameters supplied to the resource sku 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 Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<SkuResourceInner>> createOrUpdateWithResponseAsync(
        String providerNamespace, String resourceType, String sku, SkuResourceInner properties) {
        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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        if (sku == null) {
            return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null."));
        }
        if (properties == null) {
            return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null."));
        } else {
            properties.validate();
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .createOrUpdate(
                            this.client.getEndpoint(),
                            this.client.getSubscriptionId(),
                            providerNamespace,
                            resourceType,
                            sku,
                            this.client.getApiVersion(),
                            properties,
                            accept,
                            context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Creates or updates the resource type skus in the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param sku The SKU.
     * @param properties The required body parameters supplied to the resource sku 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 response body along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<SkuResourceInner>> createOrUpdateWithResponseAsync(
        String providerNamespace, String resourceType, String sku, SkuResourceInner properties, 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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        if (sku == null) {
            return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null."));
        }
        if (properties == null) {
            return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null."));
        } else {
            properties.validate();
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .createOrUpdate(
                this.client.getEndpoint(),
                this.client.getSubscriptionId(),
                providerNamespace,
                resourceType,
                sku,
                this.client.getApiVersion(),
                properties,
                accept,
                context);
    }

    /**
     * Creates or updates the resource type skus in the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param sku The SKU.
     * @param properties The required body parameters supplied to the resource sku 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 on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<SkuResourceInner> createOrUpdateAsync(
        String providerNamespace, String resourceType, String sku, SkuResourceInner properties) {
        return createOrUpdateWithResponseAsync(providerNamespace, resourceType, sku, properties)
            .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Creates or updates the resource type skus in the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param sku The SKU.
     * @param properties The required body parameters supplied to the resource sku 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 response body along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<SkuResourceInner> createOrUpdateWithResponse(
        String providerNamespace, String resourceType, String sku, SkuResourceInner properties, Context context) {
        return createOrUpdateWithResponseAsync(providerNamespace, resourceType, sku, properties, context).block();
    }

    /**
     * Creates or updates the resource type skus in the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param sku The SKU.
     * @param properties The required body parameters supplied to the resource sku 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.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public SkuResourceInner createOrUpdate(
        String providerNamespace, String resourceType, String sku, SkuResourceInner properties) {
        return createOrUpdateWithResponse(providerNamespace, resourceType, sku, properties, Context.NONE).getValue();
    }

    /**
     * Deletes a resource type sku.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param sku The SKU.
     * @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<Response<Void>> deleteWithResponseAsync(String providerNamespace, String resourceType, String sku) {
        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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        if (sku == null) {
            return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .delete(
                            this.client.getEndpoint(),
                            this.client.getSubscriptionId(),
                            providerNamespace,
                            resourceType,
                            sku,
                            this.client.getApiVersion(),
                            accept,
                            context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Deletes a resource type sku.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param sku The SKU.
     * @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<Response<Void>> deleteWithResponseAsync(
        String providerNamespace, String resourceType, String sku, 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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        if (sku == null) {
            return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .delete(
                this.client.getEndpoint(),
                this.client.getSubscriptionId(),
                providerNamespace,
                resourceType,
                sku,
                this.client.getApiVersion(),
                accept,
                context);
    }

    /**
     * Deletes a resource type sku.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param sku The SKU.
     * @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<Void> deleteAsync(String providerNamespace, String resourceType, String sku) {
        return deleteWithResponseAsync(providerNamespace, resourceType, sku).flatMap(ignored -> Mono.empty());
    }

    /**
     * Deletes a resource type sku.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param sku The SKU.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<Void> deleteWithResponse(
        String providerNamespace, String resourceType, String sku, Context context) {
        return deleteWithResponseAsync(providerNamespace, resourceType, sku, context).block();
    }

    /**
     * Deletes a resource type sku.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param sku The SKU.
     * @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 providerNamespace, String resourceType, String sku) {
        deleteWithResponse(providerNamespace, resourceType, sku, Context.NONE);
    }

    /**
     * Gets the sku details for the given resource type and sku name.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param sku The SKU.
     * @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 sku details for the given resource type and sku name along with {@link Response} on successful
     *     completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<SkuResourceInner>> getNestedResourceTypeFirstWithResponseAsync(
        String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku) {
        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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        if (nestedResourceTypeFirst == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null."));
        }
        if (sku == null) {
            return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .getNestedResourceTypeFirst(
                            this.client.getEndpoint(),
                            this.client.getSubscriptionId(),
                            providerNamespace,
                            resourceType,
                            nestedResourceTypeFirst,
                            sku,
                            this.client.getApiVersion(),
                            accept,
                            context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Gets the sku details for the given resource type and sku name.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param sku The SKU.
     * @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 sku details for the given resource type and sku name along with {@link Response} on successful
     *     completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<SkuResourceInner>> getNestedResourceTypeFirstWithResponseAsync(
        String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku, 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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        if (nestedResourceTypeFirst == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null."));
        }
        if (sku == null) {
            return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .getNestedResourceTypeFirst(
                this.client.getEndpoint(),
                this.client.getSubscriptionId(),
                providerNamespace,
                resourceType,
                nestedResourceTypeFirst,
                sku,
                this.client.getApiVersion(),
                accept,
                context);
    }

    /**
     * Gets the sku details for the given resource type and sku name.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param sku The SKU.
     * @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 sku details for the given resource type and sku name on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<SkuResourceInner> getNestedResourceTypeFirstAsync(
        String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku) {
        return getNestedResourceTypeFirstWithResponseAsync(
                providerNamespace, resourceType, nestedResourceTypeFirst, sku)
            .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Gets the sku details for the given resource type and sku name.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param sku The SKU.
     * @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 sku details for the given resource type and sku name along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<SkuResourceInner> getNestedResourceTypeFirstWithResponse(
        String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku, Context context) {
        return getNestedResourceTypeFirstWithResponseAsync(
                providerNamespace, resourceType, nestedResourceTypeFirst, sku, context)
            .block();
    }

    /**
     * Gets the sku details for the given resource type and sku name.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param sku The SKU.
     * @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 sku details for the given resource type and sku name.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public SkuResourceInner getNestedResourceTypeFirst(
        String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku) {
        return getNestedResourceTypeFirstWithResponse(
                providerNamespace, resourceType, nestedResourceTypeFirst, sku, Context.NONE)
            .getValue();
    }

    /**
     * Creates or updates the resource type skus in the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param sku The SKU.
     * @param properties The required body parameters supplied to the resource sku 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 Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<SkuResourceInner>> createOrUpdateNestedResourceTypeFirstWithResponseAsync(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String sku,
        SkuResourceInner properties) {
        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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        if (nestedResourceTypeFirst == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null."));
        }
        if (sku == null) {
            return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null."));
        }
        if (properties == null) {
            return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null."));
        } else {
            properties.validate();
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .createOrUpdateNestedResourceTypeFirst(
                            this.client.getEndpoint(),
                            this.client.getSubscriptionId(),
                            providerNamespace,
                            resourceType,
                            nestedResourceTypeFirst,
                            sku,
                            this.client.getApiVersion(),
                            properties,
                            accept,
                            context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Creates or updates the resource type skus in the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param sku The SKU.
     * @param properties The required body parameters supplied to the resource sku 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 response body along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<SkuResourceInner>> createOrUpdateNestedResourceTypeFirstWithResponseAsync(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String sku,
        SkuResourceInner properties,
        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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        if (nestedResourceTypeFirst == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null."));
        }
        if (sku == null) {
            return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null."));
        }
        if (properties == null) {
            return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null."));
        } else {
            properties.validate();
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .createOrUpdateNestedResourceTypeFirst(
                this.client.getEndpoint(),
                this.client.getSubscriptionId(),
                providerNamespace,
                resourceType,
                nestedResourceTypeFirst,
                sku,
                this.client.getApiVersion(),
                properties,
                accept,
                context);
    }

    /**
     * Creates or updates the resource type skus in the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param sku The SKU.
     * @param properties The required body parameters supplied to the resource sku 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 on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<SkuResourceInner> createOrUpdateNestedResourceTypeFirstAsync(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String sku,
        SkuResourceInner properties) {
        return createOrUpdateNestedResourceTypeFirstWithResponseAsync(
                providerNamespace, resourceType, nestedResourceTypeFirst, sku, properties)
            .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Creates or updates the resource type skus in the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param sku The SKU.
     * @param properties The required body parameters supplied to the resource sku 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 response body along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<SkuResourceInner> createOrUpdateNestedResourceTypeFirstWithResponse(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String sku,
        SkuResourceInner properties,
        Context context) {
        return createOrUpdateNestedResourceTypeFirstWithResponseAsync(
                providerNamespace, resourceType, nestedResourceTypeFirst, sku, properties, context)
            .block();
    }

    /**
     * Creates or updates the resource type skus in the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param sku The SKU.
     * @param properties The required body parameters supplied to the resource sku 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.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public SkuResourceInner createOrUpdateNestedResourceTypeFirst(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String sku,
        SkuResourceInner properties) {
        return createOrUpdateNestedResourceTypeFirstWithResponse(
                providerNamespace, resourceType, nestedResourceTypeFirst, sku, properties, Context.NONE)
            .getValue();
    }

    /**
     * Deletes a resource type sku.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param sku The SKU.
     * @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<Response<Void>> deleteNestedResourceTypeFirstWithResponseAsync(
        String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku) {
        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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        if (nestedResourceTypeFirst == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null."));
        }
        if (sku == null) {
            return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .deleteNestedResourceTypeFirst(
                            this.client.getEndpoint(),
                            this.client.getSubscriptionId(),
                            providerNamespace,
                            resourceType,
                            nestedResourceTypeFirst,
                            sku,
                            this.client.getApiVersion(),
                            accept,
                            context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Deletes a resource type sku.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param sku The SKU.
     * @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<Response<Void>> deleteNestedResourceTypeFirstWithResponseAsync(
        String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku, 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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        if (nestedResourceTypeFirst == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null."));
        }
        if (sku == null) {
            return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .deleteNestedResourceTypeFirst(
                this.client.getEndpoint(),
                this.client.getSubscriptionId(),
                providerNamespace,
                resourceType,
                nestedResourceTypeFirst,
                sku,
                this.client.getApiVersion(),
                accept,
                context);
    }

    /**
     * Deletes a resource type sku.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param sku The SKU.
     * @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<Void> deleteNestedResourceTypeFirstAsync(
        String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku) {
        return deleteNestedResourceTypeFirstWithResponseAsync(
                providerNamespace, resourceType, nestedResourceTypeFirst, sku)
            .flatMap(ignored -> Mono.empty());
    }

    /**
     * Deletes a resource type sku.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param sku The SKU.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<Void> deleteNestedResourceTypeFirstWithResponse(
        String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku, Context context) {
        return deleteNestedResourceTypeFirstWithResponseAsync(
                providerNamespace, resourceType, nestedResourceTypeFirst, sku, context)
            .block();
    }

    /**
     * Deletes a resource type sku.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param sku The SKU.
     * @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 deleteNestedResourceTypeFirst(
        String providerNamespace, String resourceType, String nestedResourceTypeFirst, String sku) {
        deleteNestedResourceTypeFirstWithResponse(
            providerNamespace, resourceType, nestedResourceTypeFirst, sku, Context.NONE);
    }

    /**
     * Gets the sku details for the given resource type and sku name.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param sku The SKU.
     * @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 sku details for the given resource type and sku name along with {@link Response} on successful
     *     completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<SkuResourceInner>> getNestedResourceTypeSecondWithResponseAsync(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String sku) {
        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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        if (nestedResourceTypeFirst == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null."));
        }
        if (nestedResourceTypeSecond == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null."));
        }
        if (sku == null) {
            return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .getNestedResourceTypeSecond(
                            this.client.getEndpoint(),
                            this.client.getSubscriptionId(),
                            providerNamespace,
                            resourceType,
                            nestedResourceTypeFirst,
                            nestedResourceTypeSecond,
                            sku,
                            this.client.getApiVersion(),
                            accept,
                            context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Gets the sku details for the given resource type and sku name.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param sku The SKU.
     * @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 sku details for the given resource type and sku name along with {@link Response} on successful
     *     completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<SkuResourceInner>> getNestedResourceTypeSecondWithResponseAsync(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String sku,
        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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        if (nestedResourceTypeFirst == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null."));
        }
        if (nestedResourceTypeSecond == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null."));
        }
        if (sku == null) {
            return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .getNestedResourceTypeSecond(
                this.client.getEndpoint(),
                this.client.getSubscriptionId(),
                providerNamespace,
                resourceType,
                nestedResourceTypeFirst,
                nestedResourceTypeSecond,
                sku,
                this.client.getApiVersion(),
                accept,
                context);
    }

    /**
     * Gets the sku details for the given resource type and sku name.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param sku The SKU.
     * @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 sku details for the given resource type and sku name on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<SkuResourceInner> getNestedResourceTypeSecondAsync(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String sku) {
        return getNestedResourceTypeSecondWithResponseAsync(
                providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, sku)
            .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Gets the sku details for the given resource type and sku name.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param sku The SKU.
     * @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 sku details for the given resource type and sku name along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<SkuResourceInner> getNestedResourceTypeSecondWithResponse(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String sku,
        Context context) {
        return getNestedResourceTypeSecondWithResponseAsync(
                providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, sku, context)
            .block();
    }

    /**
     * Gets the sku details for the given resource type and sku name.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param sku The SKU.
     * @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 sku details for the given resource type and sku name.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public SkuResourceInner getNestedResourceTypeSecond(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String sku) {
        return getNestedResourceTypeSecondWithResponse(
                providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, sku, Context.NONE)
            .getValue();
    }

    /**
     * Creates or updates the resource type skus in the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param sku The SKU.
     * @param properties The required body parameters supplied to the resource sku 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 Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<SkuResourceInner>> createOrUpdateNestedResourceTypeSecondWithResponseAsync(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String sku,
        SkuResourceInner properties) {
        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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        if (nestedResourceTypeFirst == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null."));
        }
        if (nestedResourceTypeSecond == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null."));
        }
        if (sku == null) {
            return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null."));
        }
        if (properties == null) {
            return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null."));
        } else {
            properties.validate();
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .createOrUpdateNestedResourceTypeSecond(
                            this.client.getEndpoint(),
                            this.client.getSubscriptionId(),
                            providerNamespace,
                            resourceType,
                            nestedResourceTypeFirst,
                            nestedResourceTypeSecond,
                            sku,
                            this.client.getApiVersion(),
                            properties,
                            accept,
                            context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Creates or updates the resource type skus in the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param sku The SKU.
     * @param properties The required body parameters supplied to the resource sku 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 response body along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<SkuResourceInner>> createOrUpdateNestedResourceTypeSecondWithResponseAsync(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String sku,
        SkuResourceInner properties,
        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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        if (nestedResourceTypeFirst == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null."));
        }
        if (nestedResourceTypeSecond == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null."));
        }
        if (sku == null) {
            return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null."));
        }
        if (properties == null) {
            return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null."));
        } else {
            properties.validate();
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .createOrUpdateNestedResourceTypeSecond(
                this.client.getEndpoint(),
                this.client.getSubscriptionId(),
                providerNamespace,
                resourceType,
                nestedResourceTypeFirst,
                nestedResourceTypeSecond,
                sku,
                this.client.getApiVersion(),
                properties,
                accept,
                context);
    }

    /**
     * Creates or updates the resource type skus in the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param sku The SKU.
     * @param properties The required body parameters supplied to the resource sku 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 on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<SkuResourceInner> createOrUpdateNestedResourceTypeSecondAsync(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String sku,
        SkuResourceInner properties) {
        return createOrUpdateNestedResourceTypeSecondWithResponseAsync(
                providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, sku, properties)
            .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Creates or updates the resource type skus in the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param sku The SKU.
     * @param properties The required body parameters supplied to the resource sku 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 response body along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<SkuResourceInner> createOrUpdateNestedResourceTypeSecondWithResponse(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String sku,
        SkuResourceInner properties,
        Context context) {
        return createOrUpdateNestedResourceTypeSecondWithResponseAsync(
                providerNamespace,
                resourceType,
                nestedResourceTypeFirst,
                nestedResourceTypeSecond,
                sku,
                properties,
                context)
            .block();
    }

    /**
     * Creates or updates the resource type skus in the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param sku The SKU.
     * @param properties The required body parameters supplied to the resource sku 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.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public SkuResourceInner createOrUpdateNestedResourceTypeSecond(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String sku,
        SkuResourceInner properties) {
        return createOrUpdateNestedResourceTypeSecondWithResponse(
                providerNamespace,
                resourceType,
                nestedResourceTypeFirst,
                nestedResourceTypeSecond,
                sku,
                properties,
                Context.NONE)
            .getValue();
    }

    /**
     * Deletes a resource type sku.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param sku The SKU.
     * @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<Response<Void>> deleteNestedResourceTypeSecondWithResponseAsync(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String sku) {
        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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        if (nestedResourceTypeFirst == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null."));
        }
        if (nestedResourceTypeSecond == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null."));
        }
        if (sku == null) {
            return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .deleteNestedResourceTypeSecond(
                            this.client.getEndpoint(),
                            this.client.getSubscriptionId(),
                            providerNamespace,
                            resourceType,
                            nestedResourceTypeFirst,
                            nestedResourceTypeSecond,
                            sku,
                            this.client.getApiVersion(),
                            accept,
                            context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Deletes a resource type sku.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param sku The SKU.
     * @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<Response<Void>> deleteNestedResourceTypeSecondWithResponseAsync(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String sku,
        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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        if (nestedResourceTypeFirst == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null."));
        }
        if (nestedResourceTypeSecond == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null."));
        }
        if (sku == null) {
            return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .deleteNestedResourceTypeSecond(
                this.client.getEndpoint(),
                this.client.getSubscriptionId(),
                providerNamespace,
                resourceType,
                nestedResourceTypeFirst,
                nestedResourceTypeSecond,
                sku,
                this.client.getApiVersion(),
                accept,
                context);
    }

    /**
     * Deletes a resource type sku.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param sku The SKU.
     * @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<Void> deleteNestedResourceTypeSecondAsync(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String sku) {
        return deleteNestedResourceTypeSecondWithResponseAsync(
                providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, sku)
            .flatMap(ignored -> Mono.empty());
    }

    /**
     * Deletes a resource type sku.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param sku The SKU.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<Void> deleteNestedResourceTypeSecondWithResponse(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String sku,
        Context context) {
        return deleteNestedResourceTypeSecondWithResponseAsync(
                providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, sku, context)
            .block();
    }

    /**
     * Deletes a resource type sku.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param sku The SKU.
     * @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 deleteNestedResourceTypeSecond(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String sku) {
        deleteNestedResourceTypeSecondWithResponse(
            providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, sku, Context.NONE);
    }

    /**
     * Gets the sku details for the given resource type and sku name.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param nestedResourceTypeThird The third child resource type.
     * @param sku The SKU.
     * @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 sku details for the given resource type and sku name along with {@link Response} on successful
     *     completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<SkuResourceInner>> getNestedResourceTypeThirdWithResponseAsync(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String nestedResourceTypeThird,
        String sku) {
        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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        if (nestedResourceTypeFirst == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null."));
        }
        if (nestedResourceTypeSecond == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null."));
        }
        if (nestedResourceTypeThird == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeThird is required and cannot be null."));
        }
        if (sku == null) {
            return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .getNestedResourceTypeThird(
                            this.client.getEndpoint(),
                            this.client.getSubscriptionId(),
                            providerNamespace,
                            resourceType,
                            nestedResourceTypeFirst,
                            nestedResourceTypeSecond,
                            nestedResourceTypeThird,
                            sku,
                            this.client.getApiVersion(),
                            accept,
                            context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Gets the sku details for the given resource type and sku name.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param nestedResourceTypeThird The third child resource type.
     * @param sku The SKU.
     * @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 sku details for the given resource type and sku name along with {@link Response} on successful
     *     completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<SkuResourceInner>> getNestedResourceTypeThirdWithResponseAsync(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String nestedResourceTypeThird,
        String sku,
        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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        if (nestedResourceTypeFirst == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null."));
        }
        if (nestedResourceTypeSecond == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null."));
        }
        if (nestedResourceTypeThird == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeThird is required and cannot be null."));
        }
        if (sku == null) {
            return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .getNestedResourceTypeThird(
                this.client.getEndpoint(),
                this.client.getSubscriptionId(),
                providerNamespace,
                resourceType,
                nestedResourceTypeFirst,
                nestedResourceTypeSecond,
                nestedResourceTypeThird,
                sku,
                this.client.getApiVersion(),
                accept,
                context);
    }

    /**
     * Gets the sku details for the given resource type and sku name.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param nestedResourceTypeThird The third child resource type.
     * @param sku The SKU.
     * @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 sku details for the given resource type and sku name on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<SkuResourceInner> getNestedResourceTypeThirdAsync(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String nestedResourceTypeThird,
        String sku) {
        return getNestedResourceTypeThirdWithResponseAsync(
                providerNamespace,
                resourceType,
                nestedResourceTypeFirst,
                nestedResourceTypeSecond,
                nestedResourceTypeThird,
                sku)
            .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Gets the sku details for the given resource type and sku name.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param nestedResourceTypeThird The third child resource type.
     * @param sku The SKU.
     * @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 sku details for the given resource type and sku name along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<SkuResourceInner> getNestedResourceTypeThirdWithResponse(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String nestedResourceTypeThird,
        String sku,
        Context context) {
        return getNestedResourceTypeThirdWithResponseAsync(
                providerNamespace,
                resourceType,
                nestedResourceTypeFirst,
                nestedResourceTypeSecond,
                nestedResourceTypeThird,
                sku,
                context)
            .block();
    }

    /**
     * Gets the sku details for the given resource type and sku name.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param nestedResourceTypeThird The third child resource type.
     * @param sku The SKU.
     * @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 sku details for the given resource type and sku name.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public SkuResourceInner getNestedResourceTypeThird(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String nestedResourceTypeThird,
        String sku) {
        return getNestedResourceTypeThirdWithResponse(
                providerNamespace,
                resourceType,
                nestedResourceTypeFirst,
                nestedResourceTypeSecond,
                nestedResourceTypeThird,
                sku,
                Context.NONE)
            .getValue();
    }

    /**
     * Creates or updates the resource type skus in the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param nestedResourceTypeThird The third child resource type.
     * @param sku The SKU.
     * @param properties The required body parameters supplied to the resource sku 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 Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<SkuResourceInner>> createOrUpdateNestedResourceTypeThirdWithResponseAsync(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String nestedResourceTypeThird,
        String sku,
        SkuResourceInner properties) {
        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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        if (nestedResourceTypeFirst == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null."));
        }
        if (nestedResourceTypeSecond == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null."));
        }
        if (nestedResourceTypeThird == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeThird is required and cannot be null."));
        }
        if (sku == null) {
            return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null."));
        }
        if (properties == null) {
            return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null."));
        } else {
            properties.validate();
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .createOrUpdateNestedResourceTypeThird(
                            this.client.getEndpoint(),
                            this.client.getSubscriptionId(),
                            providerNamespace,
                            resourceType,
                            nestedResourceTypeFirst,
                            nestedResourceTypeSecond,
                            nestedResourceTypeThird,
                            sku,
                            this.client.getApiVersion(),
                            properties,
                            accept,
                            context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Creates or updates the resource type skus in the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param nestedResourceTypeThird The third child resource type.
     * @param sku The SKU.
     * @param properties The required body parameters supplied to the resource sku 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 response body along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<SkuResourceInner>> createOrUpdateNestedResourceTypeThirdWithResponseAsync(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String nestedResourceTypeThird,
        String sku,
        SkuResourceInner properties,
        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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        if (nestedResourceTypeFirst == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null."));
        }
        if (nestedResourceTypeSecond == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null."));
        }
        if (nestedResourceTypeThird == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeThird is required and cannot be null."));
        }
        if (sku == null) {
            return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null."));
        }
        if (properties == null) {
            return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null."));
        } else {
            properties.validate();
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .createOrUpdateNestedResourceTypeThird(
                this.client.getEndpoint(),
                this.client.getSubscriptionId(),
                providerNamespace,
                resourceType,
                nestedResourceTypeFirst,
                nestedResourceTypeSecond,
                nestedResourceTypeThird,
                sku,
                this.client.getApiVersion(),
                properties,
                accept,
                context);
    }

    /**
     * Creates or updates the resource type skus in the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param nestedResourceTypeThird The third child resource type.
     * @param sku The SKU.
     * @param properties The required body parameters supplied to the resource sku 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 on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<SkuResourceInner> createOrUpdateNestedResourceTypeThirdAsync(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String nestedResourceTypeThird,
        String sku,
        SkuResourceInner properties) {
        return createOrUpdateNestedResourceTypeThirdWithResponseAsync(
                providerNamespace,
                resourceType,
                nestedResourceTypeFirst,
                nestedResourceTypeSecond,
                nestedResourceTypeThird,
                sku,
                properties)
            .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Creates or updates the resource type skus in the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param nestedResourceTypeThird The third child resource type.
     * @param sku The SKU.
     * @param properties The required body parameters supplied to the resource sku 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 response body along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<SkuResourceInner> createOrUpdateNestedResourceTypeThirdWithResponse(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String nestedResourceTypeThird,
        String sku,
        SkuResourceInner properties,
        Context context) {
        return createOrUpdateNestedResourceTypeThirdWithResponseAsync(
                providerNamespace,
                resourceType,
                nestedResourceTypeFirst,
                nestedResourceTypeSecond,
                nestedResourceTypeThird,
                sku,
                properties,
                context)
            .block();
    }

    /**
     * Creates or updates the resource type skus in the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param nestedResourceTypeThird The third child resource type.
     * @param sku The SKU.
     * @param properties The required body parameters supplied to the resource sku 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.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public SkuResourceInner createOrUpdateNestedResourceTypeThird(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String nestedResourceTypeThird,
        String sku,
        SkuResourceInner properties) {
        return createOrUpdateNestedResourceTypeThirdWithResponse(
                providerNamespace,
                resourceType,
                nestedResourceTypeFirst,
                nestedResourceTypeSecond,
                nestedResourceTypeThird,
                sku,
                properties,
                Context.NONE)
            .getValue();
    }

    /**
     * Deletes a resource type sku.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param nestedResourceTypeThird The third child resource type.
     * @param sku The SKU.
     * @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<Response<Void>> deleteNestedResourceTypeThirdWithResponseAsync(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String nestedResourceTypeThird,
        String sku) {
        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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        if (nestedResourceTypeFirst == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null."));
        }
        if (nestedResourceTypeSecond == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null."));
        }
        if (nestedResourceTypeThird == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeThird is required and cannot be null."));
        }
        if (sku == null) {
            return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .deleteNestedResourceTypeThird(
                            this.client.getEndpoint(),
                            this.client.getSubscriptionId(),
                            providerNamespace,
                            resourceType,
                            nestedResourceTypeFirst,
                            nestedResourceTypeSecond,
                            nestedResourceTypeThird,
                            sku,
                            this.client.getApiVersion(),
                            accept,
                            context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Deletes a resource type sku.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param nestedResourceTypeThird The third child resource type.
     * @param sku The SKU.
     * @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<Response<Void>> deleteNestedResourceTypeThirdWithResponseAsync(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String nestedResourceTypeThird,
        String sku,
        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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        if (nestedResourceTypeFirst == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null."));
        }
        if (nestedResourceTypeSecond == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null."));
        }
        if (nestedResourceTypeThird == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeThird is required and cannot be null."));
        }
        if (sku == null) {
            return Mono.error(new IllegalArgumentException("Parameter sku is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .deleteNestedResourceTypeThird(
                this.client.getEndpoint(),
                this.client.getSubscriptionId(),
                providerNamespace,
                resourceType,
                nestedResourceTypeFirst,
                nestedResourceTypeSecond,
                nestedResourceTypeThird,
                sku,
                this.client.getApiVersion(),
                accept,
                context);
    }

    /**
     * Deletes a resource type sku.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param nestedResourceTypeThird The third child resource type.
     * @param sku The SKU.
     * @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<Void> deleteNestedResourceTypeThirdAsync(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String nestedResourceTypeThird,
        String sku) {
        return deleteNestedResourceTypeThirdWithResponseAsync(
                providerNamespace,
                resourceType,
                nestedResourceTypeFirst,
                nestedResourceTypeSecond,
                nestedResourceTypeThird,
                sku)
            .flatMap(ignored -> Mono.empty());
    }

    /**
     * Deletes a resource type sku.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param nestedResourceTypeThird The third child resource type.
     * @param sku The SKU.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<Void> deleteNestedResourceTypeThirdWithResponse(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String nestedResourceTypeThird,
        String sku,
        Context context) {
        return deleteNestedResourceTypeThirdWithResponseAsync(
                providerNamespace,
                resourceType,
                nestedResourceTypeFirst,
                nestedResourceTypeSecond,
                nestedResourceTypeThird,
                sku,
                context)
            .block();
    }

    /**
     * Deletes a resource type sku.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param nestedResourceTypeThird The third child resource type.
     * @param sku The SKU.
     * @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 deleteNestedResourceTypeThird(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String nestedResourceTypeThird,
        String sku) {
        deleteNestedResourceTypeThirdWithResponse(
            providerNamespace,
            resourceType,
            nestedResourceTypeFirst,
            nestedResourceTypeSecond,
            nestedResourceTypeThird,
            sku,
            Context.NONE);
    }

    /**
     * Gets the list of skus for the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of skus for the given resource type along with {@link PagedResponse} on successful completion of
     *     {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<SkuResourceInner>> listByResourceTypeRegistrationsSinglePageAsync(
        String providerNamespace, String resourceType) {
        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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .listByResourceTypeRegistrations(
                            this.client.getEndpoint(),
                            this.client.getSubscriptionId(),
                            providerNamespace,
                            resourceType,
                            this.client.getApiVersion(),
                            accept,
                            context))
            .<PagedResponse<SkuResourceInner>>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()));
    }

    /**
     * Gets the list of skus for the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of skus for the given resource type along with {@link PagedResponse} on successful completion of
     *     {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<SkuResourceInner>> listByResourceTypeRegistrationsSinglePageAsync(
        String providerNamespace, String resourceType, 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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .listByResourceTypeRegistrations(
                this.client.getEndpoint(),
                this.client.getSubscriptionId(),
                providerNamespace,
                resourceType,
                this.client.getApiVersion(),
                accept,
                context)
            .map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().nextLink(),
                        null));
    }

    /**
     * Gets the list of skus for the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of skus for the given resource type as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux<SkuResourceInner> listByResourceTypeRegistrationsAsync(
        String providerNamespace, String resourceType) {
        return new PagedFlux<>(
            () -> listByResourceTypeRegistrationsSinglePageAsync(providerNamespace, resourceType),
            nextLink -> listByResourceTypeRegistrationsNextSinglePageAsync(nextLink));
    }

    /**
     * Gets the list of skus for the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of skus for the given resource type as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux<SkuResourceInner> listByResourceTypeRegistrationsAsync(
        String providerNamespace, String resourceType, Context context) {
        return new PagedFlux<>(
            () -> listByResourceTypeRegistrationsSinglePageAsync(providerNamespace, resourceType, context),
            nextLink -> listByResourceTypeRegistrationsNextSinglePageAsync(nextLink, context));
    }

    /**
     * Gets the list of skus for the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of skus for the given resource type as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<SkuResourceInner> listByResourceTypeRegistrations(
        String providerNamespace, String resourceType) {
        return new PagedIterable<>(listByResourceTypeRegistrationsAsync(providerNamespace, resourceType));
    }

    /**
     * Gets the list of skus for the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of skus for the given resource type as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<SkuResourceInner> listByResourceTypeRegistrations(
        String providerNamespace, String resourceType, Context context) {
        return new PagedIterable<>(listByResourceTypeRegistrationsAsync(providerNamespace, resourceType, context));
    }

    /**
     * Gets the list of skus for the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of skus for the given resource type along with {@link PagedResponse} on successful completion of
     *     {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<SkuResourceInner>> listByResourceTypeRegistrationsNestedResourceTypeFirstSinglePageAsync(
        String providerNamespace, String resourceType, String nestedResourceTypeFirst) {
        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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        if (nestedResourceTypeFirst == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .listByResourceTypeRegistrationsNestedResourceTypeFirst(
                            this.client.getEndpoint(),
                            this.client.getSubscriptionId(),
                            providerNamespace,
                            resourceType,
                            nestedResourceTypeFirst,
                            this.client.getApiVersion(),
                            accept,
                            context))
            .<PagedResponse<SkuResourceInner>>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()));
    }

    /**
     * Gets the list of skus for the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of skus for the given resource type along with {@link PagedResponse} on successful completion of
     *     {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<SkuResourceInner>> listByResourceTypeRegistrationsNestedResourceTypeFirstSinglePageAsync(
        String providerNamespace, String resourceType, String nestedResourceTypeFirst, 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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        if (nestedResourceTypeFirst == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .listByResourceTypeRegistrationsNestedResourceTypeFirst(
                this.client.getEndpoint(),
                this.client.getSubscriptionId(),
                providerNamespace,
                resourceType,
                nestedResourceTypeFirst,
                this.client.getApiVersion(),
                accept,
                context)
            .map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().nextLink(),
                        null));
    }

    /**
     * Gets the list of skus for the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of skus for the given resource type as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux<SkuResourceInner> listByResourceTypeRegistrationsNestedResourceTypeFirstAsync(
        String providerNamespace, String resourceType, String nestedResourceTypeFirst) {
        return new PagedFlux<>(
            () ->
                listByResourceTypeRegistrationsNestedResourceTypeFirstSinglePageAsync(
                    providerNamespace, resourceType, nestedResourceTypeFirst),
            nextLink -> listByResourceTypeRegistrationsNestedResourceTypeFirstNextSinglePageAsync(nextLink));
    }

    /**
     * Gets the list of skus for the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of skus for the given resource type as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux<SkuResourceInner> listByResourceTypeRegistrationsNestedResourceTypeFirstAsync(
        String providerNamespace, String resourceType, String nestedResourceTypeFirst, Context context) {
        return new PagedFlux<>(
            () ->
                listByResourceTypeRegistrationsNestedResourceTypeFirstSinglePageAsync(
                    providerNamespace, resourceType, nestedResourceTypeFirst, context),
            nextLink -> listByResourceTypeRegistrationsNestedResourceTypeFirstNextSinglePageAsync(nextLink, context));
    }

    /**
     * Gets the list of skus for the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of skus for the given resource type as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<SkuResourceInner> listByResourceTypeRegistrationsNestedResourceTypeFirst(
        String providerNamespace, String resourceType, String nestedResourceTypeFirst) {
        return new PagedIterable<>(
            listByResourceTypeRegistrationsNestedResourceTypeFirstAsync(
                providerNamespace, resourceType, nestedResourceTypeFirst));
    }

    /**
     * Gets the list of skus for the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of skus for the given resource type as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<SkuResourceInner> listByResourceTypeRegistrationsNestedResourceTypeFirst(
        String providerNamespace, String resourceType, String nestedResourceTypeFirst, Context context) {
        return new PagedIterable<>(
            listByResourceTypeRegistrationsNestedResourceTypeFirstAsync(
                providerNamespace, resourceType, nestedResourceTypeFirst, context));
    }

    /**
     * Gets the list of skus for the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of skus for the given resource type along with {@link PagedResponse} on successful completion of
     *     {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<SkuResourceInner>>
        listByResourceTypeRegistrationsNestedResourceTypeSecondSinglePageAsync(
            String providerNamespace,
            String resourceType,
            String nestedResourceTypeFirst,
            String nestedResourceTypeSecond) {
        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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        if (nestedResourceTypeFirst == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null."));
        }
        if (nestedResourceTypeSecond == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .listByResourceTypeRegistrationsNestedResourceTypeSecond(
                            this.client.getEndpoint(),
                            this.client.getSubscriptionId(),
                            providerNamespace,
                            resourceType,
                            nestedResourceTypeFirst,
                            nestedResourceTypeSecond,
                            this.client.getApiVersion(),
                            accept,
                            context))
            .<PagedResponse<SkuResourceInner>>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()));
    }

    /**
     * Gets the list of skus for the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of skus for the given resource type along with {@link PagedResponse} on successful completion of
     *     {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<SkuResourceInner>>
        listByResourceTypeRegistrationsNestedResourceTypeSecondSinglePageAsync(
            String providerNamespace,
            String resourceType,
            String nestedResourceTypeFirst,
            String nestedResourceTypeSecond,
            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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        if (nestedResourceTypeFirst == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null."));
        }
        if (nestedResourceTypeSecond == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .listByResourceTypeRegistrationsNestedResourceTypeSecond(
                this.client.getEndpoint(),
                this.client.getSubscriptionId(),
                providerNamespace,
                resourceType,
                nestedResourceTypeFirst,
                nestedResourceTypeSecond,
                this.client.getApiVersion(),
                accept,
                context)
            .map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().nextLink(),
                        null));
    }

    /**
     * Gets the list of skus for the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of skus for the given resource type as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux<SkuResourceInner> listByResourceTypeRegistrationsNestedResourceTypeSecondAsync(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond) {
        return new PagedFlux<>(
            () ->
                listByResourceTypeRegistrationsNestedResourceTypeSecondSinglePageAsync(
                    providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond),
            nextLink -> listByResourceTypeRegistrationsNestedResourceTypeSecondNextSinglePageAsync(nextLink));
    }

    /**
     * Gets the list of skus for the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of skus for the given resource type as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux<SkuResourceInner> listByResourceTypeRegistrationsNestedResourceTypeSecondAsync(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        Context context) {
        return new PagedFlux<>(
            () ->
                listByResourceTypeRegistrationsNestedResourceTypeSecondSinglePageAsync(
                    providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, context),
            nextLink -> listByResourceTypeRegistrationsNestedResourceTypeSecondNextSinglePageAsync(nextLink, context));
    }

    /**
     * Gets the list of skus for the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of skus for the given resource type as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<SkuResourceInner> listByResourceTypeRegistrationsNestedResourceTypeSecond(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond) {
        return new PagedIterable<>(
            listByResourceTypeRegistrationsNestedResourceTypeSecondAsync(
                providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond));
    }

    /**
     * Gets the list of skus for the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of skus for the given resource type as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<SkuResourceInner> listByResourceTypeRegistrationsNestedResourceTypeSecond(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        Context context) {
        return new PagedIterable<>(
            listByResourceTypeRegistrationsNestedResourceTypeSecondAsync(
                providerNamespace, resourceType, nestedResourceTypeFirst, nestedResourceTypeSecond, context));
    }

    /**
     * Gets the list of skus for the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param nestedResourceTypeThird The third child resource type.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of skus for the given resource type along with {@link PagedResponse} on successful completion of
     *     {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<SkuResourceInner>> listByResourceTypeRegistrationsNestedResourceTypeThirdSinglePageAsync(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String nestedResourceTypeThird) {
        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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        if (nestedResourceTypeFirst == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null."));
        }
        if (nestedResourceTypeSecond == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null."));
        }
        if (nestedResourceTypeThird == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeThird is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .listByResourceTypeRegistrationsNestedResourceTypeThird(
                            this.client.getEndpoint(),
                            this.client.getSubscriptionId(),
                            providerNamespace,
                            resourceType,
                            nestedResourceTypeFirst,
                            nestedResourceTypeSecond,
                            nestedResourceTypeThird,
                            this.client.getApiVersion(),
                            accept,
                            context))
            .<PagedResponse<SkuResourceInner>>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()));
    }

    /**
     * Gets the list of skus for the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param nestedResourceTypeThird The third child resource type.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of skus for the given resource type along with {@link PagedResponse} on successful completion of
     *     {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<SkuResourceInner>> listByResourceTypeRegistrationsNestedResourceTypeThirdSinglePageAsync(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String nestedResourceTypeThird,
        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 (providerNamespace == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter providerNamespace is required and cannot be null."));
        }
        if (resourceType == null) {
            return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
        }
        if (nestedResourceTypeFirst == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeFirst is required and cannot be null."));
        }
        if (nestedResourceTypeSecond == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeSecond is required and cannot be null."));
        }
        if (nestedResourceTypeThird == null) {
            return Mono
                .error(
                    new IllegalArgumentException("Parameter nestedResourceTypeThird is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .listByResourceTypeRegistrationsNestedResourceTypeThird(
                this.client.getEndpoint(),
                this.client.getSubscriptionId(),
                providerNamespace,
                resourceType,
                nestedResourceTypeFirst,
                nestedResourceTypeSecond,
                nestedResourceTypeThird,
                this.client.getApiVersion(),
                accept,
                context)
            .map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().nextLink(),
                        null));
    }

    /**
     * Gets the list of skus for the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param nestedResourceTypeThird The third child resource type.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of skus for the given resource type as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux<SkuResourceInner> listByResourceTypeRegistrationsNestedResourceTypeThirdAsync(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String nestedResourceTypeThird) {
        return new PagedFlux<>(
            () ->
                listByResourceTypeRegistrationsNestedResourceTypeThirdSinglePageAsync(
                    providerNamespace,
                    resourceType,
                    nestedResourceTypeFirst,
                    nestedResourceTypeSecond,
                    nestedResourceTypeThird),
            nextLink -> listByResourceTypeRegistrationsNestedResourceTypeThirdNextSinglePageAsync(nextLink));
    }

    /**
     * Gets the list of skus for the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param nestedResourceTypeThird The third child resource type.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of skus for the given resource type as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux<SkuResourceInner> listByResourceTypeRegistrationsNestedResourceTypeThirdAsync(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String nestedResourceTypeThird,
        Context context) {
        return new PagedFlux<>(
            () ->
                listByResourceTypeRegistrationsNestedResourceTypeThirdSinglePageAsync(
                    providerNamespace,
                    resourceType,
                    nestedResourceTypeFirst,
                    nestedResourceTypeSecond,
                    nestedResourceTypeThird,
                    context),
            nextLink -> listByResourceTypeRegistrationsNestedResourceTypeThirdNextSinglePageAsync(nextLink, context));
    }

    /**
     * Gets the list of skus for the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param nestedResourceTypeThird The third child resource type.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of skus for the given resource type as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<SkuResourceInner> listByResourceTypeRegistrationsNestedResourceTypeThird(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String nestedResourceTypeThird) {
        return new PagedIterable<>(
            listByResourceTypeRegistrationsNestedResourceTypeThirdAsync(
                providerNamespace,
                resourceType,
                nestedResourceTypeFirst,
                nestedResourceTypeSecond,
                nestedResourceTypeThird));
    }

    /**
     * Gets the list of skus for the given resource type.
     *
     * @param providerNamespace The name of the resource provider hosted within ProviderHub.
     * @param resourceType The resource type.
     * @param nestedResourceTypeFirst The first child resource type.
     * @param nestedResourceTypeSecond The second child resource type.
     * @param nestedResourceTypeThird The third child resource type.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the list of skus for the given resource type as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<SkuResourceInner> listByResourceTypeRegistrationsNestedResourceTypeThird(
        String providerNamespace,
        String resourceType,
        String nestedResourceTypeFirst,
        String nestedResourceTypeSecond,
        String nestedResourceTypeThird,
        Context context) {
        return new PagedIterable<>(
            listByResourceTypeRegistrationsNestedResourceTypeThirdAsync(
                providerNamespace,
                resourceType,
                nestedResourceTypeFirst,
                nestedResourceTypeSecond,
                nestedResourceTypeThird,
                context));
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>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<PagedResponse<SkuResourceInner>> listByResourceTypeRegistrationsNextSinglePageAsync(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.listByResourceTypeRegistrationsNext(nextLink, this.client.getEndpoint(), accept, context))
            .<PagedResponse<SkuResourceInner>>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
     *     <p>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<PagedResponse<SkuResourceInner>> listByResourceTypeRegistrationsNextSinglePageAsync(
        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
            .listByResourceTypeRegistrationsNext(nextLink, this.client.getEndpoint(), accept, context)
            .map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().nextLink(),
                        null));
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>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<PagedResponse<SkuResourceInner>>
        listByResourceTypeRegistrationsNestedResourceTypeFirstNextSinglePageAsync(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
                        .listByResourceTypeRegistrationsNestedResourceTypeFirstNext(
                            nextLink, this.client.getEndpoint(), accept, context))
            .<PagedResponse<SkuResourceInner>>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
     *     <p>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<PagedResponse<SkuResourceInner>>
        listByResourceTypeRegistrationsNestedResourceTypeFirstNextSinglePageAsync(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
            .listByResourceTypeRegistrationsNestedResourceTypeFirstNext(
                nextLink, this.client.getEndpoint(), accept, context)
            .map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().nextLink(),
                        null));
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>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<PagedResponse<SkuResourceInner>>
        listByResourceTypeRegistrationsNestedResourceTypeSecondNextSinglePageAsync(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
                        .listByResourceTypeRegistrationsNestedResourceTypeSecondNext(
                            nextLink, this.client.getEndpoint(), accept, context))
            .<PagedResponse<SkuResourceInner>>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
     *     <p>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<PagedResponse<SkuResourceInner>>
        listByResourceTypeRegistrationsNestedResourceTypeSecondNextSinglePageAsync(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
            .listByResourceTypeRegistrationsNestedResourceTypeSecondNext(
                nextLink, this.client.getEndpoint(), accept, context)
            .map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().nextLink(),
                        null));
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>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<PagedResponse<SkuResourceInner>>
        listByResourceTypeRegistrationsNestedResourceTypeThirdNextSinglePageAsync(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
                        .listByResourceTypeRegistrationsNestedResourceTypeThirdNext(
                            nextLink, this.client.getEndpoint(), accept, context))
            .<PagedResponse<SkuResourceInner>>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
     *     <p>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<PagedResponse<SkuResourceInner>>
        listByResourceTypeRegistrationsNestedResourceTypeThirdNextSinglePageAsync(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
            .listByResourceTypeRegistrationsNestedResourceTypeThirdNext(
                nextLink, this.client.getEndpoint(), accept, context)
            .map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().nextLink(),
                        null));
    }
}
