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

package com.azure.resourcemanager.managednetworkfabric.implementation;

import com.azure.core.annotation.BodyParam;
import com.azure.core.annotation.Delete;
import com.azure.core.annotation.ExpectedResponses;
import com.azure.core.annotation.Get;
import com.azure.core.annotation.HeaderParam;
import com.azure.core.annotation.Headers;
import com.azure.core.annotation.Host;
import com.azure.core.annotation.HostParam;
import com.azure.core.annotation.Patch;
import com.azure.core.annotation.PathParam;
import com.azure.core.annotation.Post;
import com.azure.core.annotation.Put;
import com.azure.core.annotation.QueryParam;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceInterface;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.UnexpectedResponseExceptionType;
import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.PagedResponse;
import com.azure.core.http.rest.PagedResponseBase;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.RestProxy;
import com.azure.core.management.exception.ManagementException;
import com.azure.core.management.polling.PollResult;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.core.util.polling.PollerFlux;
import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.managednetworkfabric.fluent.L3IsolationDomainsClient;
import com.azure.resourcemanager.managednetworkfabric.fluent.models.L3IsolationDomainInner;
import com.azure.resourcemanager.managednetworkfabric.models.EnableDisableOnResources;
import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainPatch;
import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainsListResult;
import com.azure.resourcemanager.managednetworkfabric.models.UpdateAdministrativeState;
import java.nio.ByteBuffer;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

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

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

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

    /**
     * The interface defining all the services for AzureNetworkFabricManagementServiceApiL3IsolationDomains to be used
     * by the proxy service to perform REST calls.
     */
    @Host("{$host}")
    @ServiceInterface(name = "AzureNetworkFabricMa")
    public interface L3IsolationDomainsService {
        @Headers({"Content-Type: application/json"})
        @Put(
            "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}")
        @ExpectedResponses({200, 201})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<Flux<ByteBuffer>>> create(
            @HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @QueryParam("api-version") String apiVersion,
            @PathParam("l3IsolationDomainName") String l3IsolationDomainName,
            @BodyParam("application/json") L3IsolationDomainInner body,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Get(
            "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<L3IsolationDomainInner>> getByResourceGroup(
            @HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @QueryParam("api-version") String apiVersion,
            @PathParam("l3IsolationDomainName") String l3IsolationDomainName,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Patch(
            "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}")
        @ExpectedResponses({200, 202})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<Flux<ByteBuffer>>> update(
            @HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @QueryParam("api-version") String apiVersion,
            @PathParam("l3IsolationDomainName") String l3IsolationDomainName,
            @BodyParam("application/json") L3IsolationDomainPatch body,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Delete(
            "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}")
        @ExpectedResponses({200, 202, 204})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<Flux<ByteBuffer>>> delete(
            @HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @QueryParam("api-version") String apiVersion,
            @PathParam("l3IsolationDomainName") String l3IsolationDomainName,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Get(
            "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<L3IsolationDomainsListResult>> listByResourceGroup(
            @HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @QueryParam("api-version") String apiVersion,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<L3IsolationDomainsListResult>> list(
            @HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @QueryParam("api-version") String apiVersion,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Post(
            "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/updateAdministrativeState")
        @ExpectedResponses({202})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<Flux<ByteBuffer>>> updateAdministrativeState(
            @HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @QueryParam("api-version") String apiVersion,
            @PathParam("l3IsolationDomainName") String l3IsolationDomainName,
            @BodyParam("application/json") UpdateAdministrativeState body,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Post(
            "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/updateOptionBAdministrativeState")
        @ExpectedResponses({202})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<Flux<ByteBuffer>>> updateOptionBAdministrativeState(
            @HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @QueryParam("api-version") String apiVersion,
            @PathParam("l3IsolationDomainName") String l3IsolationDomainName,
            @BodyParam("application/json") UpdateAdministrativeState body,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Post(
            "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/clearArpTable")
        @ExpectedResponses({202})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<Flux<ByteBuffer>>> clearArpTable(
            @HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @QueryParam("api-version") String apiVersion,
            @PathParam("l3IsolationDomainName") String l3IsolationDomainName,
            @BodyParam("application/json") EnableDisableOnResources body,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Post(
            "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/{l3IsolationDomainName}/clearNeighborTable")
        @ExpectedResponses({202})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<Flux<ByteBuffer>>> clearNeighborTable(
            @HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @QueryParam("api-version") String apiVersion,
            @PathParam("l3IsolationDomainName") String l3IsolationDomainName,
            @BodyParam("application/json") EnableDisableOnResources body,
            @HeaderParam("Accept") String accept,
            Context context);

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

    /**
     * Create L3 Isolation Domain.
     *
     * <p>Create isolation domain resources for layer 3 connectivity between compute nodes and for communication with
     * external services .This configuration is applied on the devices only after the creation of networks is completed
     * and isolation domain is enabled.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @param body Request payload.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 L3IsolationDomain resource definition along with {@link Response} on successful completion of {@link
     *     Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<Flux<ByteBuffer>>> createWithResponseAsync(
        String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainInner body) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
        }
        if (l3IsolationDomainName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null."));
        }
        if (body == null) {
            return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
        } else {
            body.validate();
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .create(
                            this.client.getEndpoint(),
                            this.client.getSubscriptionId(),
                            resourceGroupName,
                            this.client.getApiVersion(),
                            l3IsolationDomainName,
                            body,
                            accept,
                            context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Create L3 Isolation Domain.
     *
     * <p>Create isolation domain resources for layer 3 connectivity between compute nodes and for communication with
     * external services .This configuration is applied on the devices only after the creation of networks is completed
     * and isolation domain is enabled.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @param body Request payload.
     * @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 L3IsolationDomain resource definition along with {@link Response} on successful completion of {@link
     *     Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<Flux<ByteBuffer>>> createWithResponseAsync(
        String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainInner body, Context context) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
        }
        if (l3IsolationDomainName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null."));
        }
        if (body == null) {
            return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
        } else {
            body.validate();
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .create(
                this.client.getEndpoint(),
                this.client.getSubscriptionId(),
                resourceGroupName,
                this.client.getApiVersion(),
                l3IsolationDomainName,
                body,
                accept,
                context);
    }

    /**
     * Create L3 Isolation Domain.
     *
     * <p>Create isolation domain resources for layer 3 connectivity between compute nodes and for communication with
     * external services .This configuration is applied on the devices only after the creation of networks is completed
     * and isolation domain is enabled.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @param body Request payload.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link PollerFlux} for polling of the L3IsolationDomain resource definition.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux<PollResult<L3IsolationDomainInner>, L3IsolationDomainInner> beginCreateAsync(
        String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainInner body) {
        Mono<Response<Flux<ByteBuffer>>> mono = createWithResponseAsync(resourceGroupName, l3IsolationDomainName, body);
        return this
            .client
            .<L3IsolationDomainInner, L3IsolationDomainInner>getLroResult(
                mono,
                this.client.getHttpPipeline(),
                L3IsolationDomainInner.class,
                L3IsolationDomainInner.class,
                this.client.getContext());
    }

    /**
     * Create L3 Isolation Domain.
     *
     * <p>Create isolation domain resources for layer 3 connectivity between compute nodes and for communication with
     * external services .This configuration is applied on the devices only after the creation of networks is completed
     * and isolation domain is enabled.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @param body Request payload.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link PollerFlux} for polling of the L3IsolationDomain resource definition.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux<PollResult<L3IsolationDomainInner>, L3IsolationDomainInner> beginCreateAsync(
        String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainInner body, Context context) {
        context = this.client.mergeContext(context);
        Mono<Response<Flux<ByteBuffer>>> mono =
            createWithResponseAsync(resourceGroupName, l3IsolationDomainName, body, context);
        return this
            .client
            .<L3IsolationDomainInner, L3IsolationDomainInner>getLroResult(
                mono,
                this.client.getHttpPipeline(),
                L3IsolationDomainInner.class,
                L3IsolationDomainInner.class,
                context);
    }

    /**
     * Create L3 Isolation Domain.
     *
     * <p>Create isolation domain resources for layer 3 connectivity between compute nodes and for communication with
     * external services .This configuration is applied on the devices only after the creation of networks is completed
     * and isolation domain is enabled.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @param body Request payload.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of the L3IsolationDomain resource definition.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller<PollResult<L3IsolationDomainInner>, L3IsolationDomainInner> beginCreate(
        String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainInner body) {
        return this.beginCreateAsync(resourceGroupName, l3IsolationDomainName, body).getSyncPoller();
    }

    /**
     * Create L3 Isolation Domain.
     *
     * <p>Create isolation domain resources for layer 3 connectivity between compute nodes and for communication with
     * external services .This configuration is applied on the devices only after the creation of networks is completed
     * and isolation domain is enabled.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @param body Request payload.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of the L3IsolationDomain resource definition.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller<PollResult<L3IsolationDomainInner>, L3IsolationDomainInner> beginCreate(
        String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainInner body, Context context) {
        return this.beginCreateAsync(resourceGroupName, l3IsolationDomainName, body, context).getSyncPoller();
    }

    /**
     * Create L3 Isolation Domain.
     *
     * <p>Create isolation domain resources for layer 3 connectivity between compute nodes and for communication with
     * external services .This configuration is applied on the devices only after the creation of networks is completed
     * and isolation domain is enabled.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @param body Request payload.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 L3IsolationDomain resource definition on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<L3IsolationDomainInner> createAsync(
        String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainInner body) {
        return beginCreateAsync(resourceGroupName, l3IsolationDomainName, body)
            .last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Create L3 Isolation Domain.
     *
     * <p>Create isolation domain resources for layer 3 connectivity between compute nodes and for communication with
     * external services .This configuration is applied on the devices only after the creation of networks is completed
     * and isolation domain is enabled.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @param body Request payload.
     * @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 L3IsolationDomain resource definition on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<L3IsolationDomainInner> createAsync(
        String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainInner body, Context context) {
        return beginCreateAsync(resourceGroupName, l3IsolationDomainName, body, context)
            .last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Create L3 Isolation Domain.
     *
     * <p>Create isolation domain resources for layer 3 connectivity between compute nodes and for communication with
     * external services .This configuration is applied on the devices only after the creation of networks is completed
     * and isolation domain is enabled.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @param body Request payload.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 L3IsolationDomain resource definition.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public L3IsolationDomainInner create(
        String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainInner body) {
        return createAsync(resourceGroupName, l3IsolationDomainName, body).block();
    }

    /**
     * Create L3 Isolation Domain.
     *
     * <p>Create isolation domain resources for layer 3 connectivity between compute nodes and for communication with
     * external services .This configuration is applied on the devices only after the creation of networks is completed
     * and isolation domain is enabled.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @param body Request payload.
     * @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 L3IsolationDomain resource definition.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public L3IsolationDomainInner create(
        String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainInner body, Context context) {
        return createAsync(resourceGroupName, l3IsolationDomainName, body, context).block();
    }

    /**
     * Gets a L3 Isolation Domain.
     *
     * <p>Retrieves details of this L3 Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 L3IsolationDomain resource definition along with {@link Response} on successful completion of {@link
     *     Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<L3IsolationDomainInner>> getByResourceGroupWithResponseAsync(
        String resourceGroupName, String l3IsolationDomainName) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
        }
        if (l3IsolationDomainName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .getByResourceGroup(
                            this.client.getEndpoint(),
                            this.client.getSubscriptionId(),
                            resourceGroupName,
                            this.client.getApiVersion(),
                            l3IsolationDomainName,
                            accept,
                            context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Gets a L3 Isolation Domain.
     *
     * <p>Retrieves details of this L3 Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @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 L3IsolationDomain resource definition along with {@link Response} on successful completion of {@link
     *     Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<L3IsolationDomainInner>> getByResourceGroupWithResponseAsync(
        String resourceGroupName, String l3IsolationDomainName, Context context) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
        }
        if (l3IsolationDomainName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .getByResourceGroup(
                this.client.getEndpoint(),
                this.client.getSubscriptionId(),
                resourceGroupName,
                this.client.getApiVersion(),
                l3IsolationDomainName,
                accept,
                context);
    }

    /**
     * Gets a L3 Isolation Domain.
     *
     * <p>Retrieves details of this L3 Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 L3IsolationDomain resource definition on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<L3IsolationDomainInner> getByResourceGroupAsync(
        String resourceGroupName, String l3IsolationDomainName) {
        return getByResourceGroupWithResponseAsync(resourceGroupName, l3IsolationDomainName)
            .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Gets a L3 Isolation Domain.
     *
     * <p>Retrieves details of this L3 Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @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 L3IsolationDomain resource definition along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<L3IsolationDomainInner> getByResourceGroupWithResponse(
        String resourceGroupName, String l3IsolationDomainName, Context context) {
        return getByResourceGroupWithResponseAsync(resourceGroupName, l3IsolationDomainName, context).block();
    }

    /**
     * Gets a L3 Isolation Domain.
     *
     * <p>Retrieves details of this L3 Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 L3IsolationDomain resource definition.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public L3IsolationDomainInner getByResourceGroup(String resourceGroupName, String l3IsolationDomainName) {
        return getByResourceGroupWithResponse(resourceGroupName, l3IsolationDomainName, Context.NONE).getValue();
    }

    /**
     * Updates a L3 Isolation Domain.
     *
     * <p>API to update certain properties of the L3 Isolation Domain resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @param body API to update certain properties of the L3 Isolation Domain resource.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the L3IsolationDomain resource definition along with {@link Response} on successful completion of {@link
     *     Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<Flux<ByteBuffer>>> updateWithResponseAsync(
        String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainPatch body) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
        }
        if (l3IsolationDomainName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null."));
        }
        if (body == null) {
            return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
        } else {
            body.validate();
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .update(
                            this.client.getEndpoint(),
                            this.client.getSubscriptionId(),
                            resourceGroupName,
                            this.client.getApiVersion(),
                            l3IsolationDomainName,
                            body,
                            accept,
                            context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Updates a L3 Isolation Domain.
     *
     * <p>API to update certain properties of the L3 Isolation Domain resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @param body API to update certain properties of the L3 Isolation Domain resource.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the L3IsolationDomain resource definition along with {@link Response} on successful completion of {@link
     *     Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<Flux<ByteBuffer>>> updateWithResponseAsync(
        String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainPatch body, Context context) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
        }
        if (l3IsolationDomainName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null."));
        }
        if (body == null) {
            return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
        } else {
            body.validate();
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .update(
                this.client.getEndpoint(),
                this.client.getSubscriptionId(),
                resourceGroupName,
                this.client.getApiVersion(),
                l3IsolationDomainName,
                body,
                accept,
                context);
    }

    /**
     * Updates a L3 Isolation Domain.
     *
     * <p>API to update certain properties of the L3 Isolation Domain resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @param body API to update certain properties of the L3 Isolation Domain resource.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link PollerFlux} for polling of the L3IsolationDomain resource definition.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux<PollResult<L3IsolationDomainInner>, L3IsolationDomainInner> beginUpdateAsync(
        String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainPatch body) {
        Mono<Response<Flux<ByteBuffer>>> mono = updateWithResponseAsync(resourceGroupName, l3IsolationDomainName, body);
        return this
            .client
            .<L3IsolationDomainInner, L3IsolationDomainInner>getLroResult(
                mono,
                this.client.getHttpPipeline(),
                L3IsolationDomainInner.class,
                L3IsolationDomainInner.class,
                this.client.getContext());
    }

    /**
     * Updates a L3 Isolation Domain.
     *
     * <p>API to update certain properties of the L3 Isolation Domain resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @param body API to update certain properties of the L3 Isolation Domain resource.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link PollerFlux} for polling of the L3IsolationDomain resource definition.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux<PollResult<L3IsolationDomainInner>, L3IsolationDomainInner> beginUpdateAsync(
        String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainPatch body, Context context) {
        context = this.client.mergeContext(context);
        Mono<Response<Flux<ByteBuffer>>> mono =
            updateWithResponseAsync(resourceGroupName, l3IsolationDomainName, body, context);
        return this
            .client
            .<L3IsolationDomainInner, L3IsolationDomainInner>getLroResult(
                mono,
                this.client.getHttpPipeline(),
                L3IsolationDomainInner.class,
                L3IsolationDomainInner.class,
                context);
    }

    /**
     * Updates a L3 Isolation Domain.
     *
     * <p>API to update certain properties of the L3 Isolation Domain resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @param body API to update certain properties of the L3 Isolation Domain resource.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of the L3IsolationDomain resource definition.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller<PollResult<L3IsolationDomainInner>, L3IsolationDomainInner> beginUpdate(
        String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainPatch body) {
        return this.beginUpdateAsync(resourceGroupName, l3IsolationDomainName, body).getSyncPoller();
    }

    /**
     * Updates a L3 Isolation Domain.
     *
     * <p>API to update certain properties of the L3 Isolation Domain resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @param body API to update certain properties of the L3 Isolation Domain resource.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of the L3IsolationDomain resource definition.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller<PollResult<L3IsolationDomainInner>, L3IsolationDomainInner> beginUpdate(
        String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainPatch body, Context context) {
        return this.beginUpdateAsync(resourceGroupName, l3IsolationDomainName, body, context).getSyncPoller();
    }

    /**
     * Updates a L3 Isolation Domain.
     *
     * <p>API to update certain properties of the L3 Isolation Domain resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @param body API to update certain properties of the L3 Isolation Domain resource.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the L3IsolationDomain resource definition on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<L3IsolationDomainInner> updateAsync(
        String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainPatch body) {
        return beginUpdateAsync(resourceGroupName, l3IsolationDomainName, body)
            .last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Updates a L3 Isolation Domain.
     *
     * <p>API to update certain properties of the L3 Isolation Domain resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @param body API to update certain properties of the L3 Isolation Domain resource.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the L3IsolationDomain resource definition on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<L3IsolationDomainInner> updateAsync(
        String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainPatch body, Context context) {
        return beginUpdateAsync(resourceGroupName, l3IsolationDomainName, body, context)
            .last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Updates a L3 Isolation Domain.
     *
     * <p>API to update certain properties of the L3 Isolation Domain resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @param body API to update certain properties of the L3 Isolation Domain resource.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the L3IsolationDomain resource definition.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public L3IsolationDomainInner update(
        String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainPatch body) {
        return updateAsync(resourceGroupName, l3IsolationDomainName, body).block();
    }

    /**
     * Updates a L3 Isolation Domain.
     *
     * <p>API to update certain properties of the L3 Isolation Domain resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @param body API to update certain properties of the L3 Isolation Domain resource.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the L3IsolationDomain resource definition.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public L3IsolationDomainInner update(
        String resourceGroupName, String l3IsolationDomainName, L3IsolationDomainPatch body, Context context) {
        return updateAsync(resourceGroupName, l3IsolationDomainName, body, context).block();
    }

    /**
     * Deletes a L3 Isolation Domain.
     *
     * <p>Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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<Flux<ByteBuffer>>> deleteWithResponseAsync(
        String resourceGroupName, String l3IsolationDomainName) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
        }
        if (l3IsolationDomainName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .delete(
                            this.client.getEndpoint(),
                            this.client.getSubscriptionId(),
                            resourceGroupName,
                            this.client.getApiVersion(),
                            l3IsolationDomainName,
                            accept,
                            context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Deletes a L3 Isolation Domain.
     *
     * <p>Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @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<Flux<ByteBuffer>>> deleteWithResponseAsync(
        String resourceGroupName, String l3IsolationDomainName, Context context) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
        }
        if (l3IsolationDomainName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter l3IsolationDomainName 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(),
                resourceGroupName,
                this.client.getApiVersion(),
                l3IsolationDomainName,
                accept,
                context);
    }

    /**
     * Deletes a L3 Isolation Domain.
     *
     * <p>Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link PollerFlux} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux<PollResult<Void>, Void> beginDeleteAsync(
        String resourceGroupName, String l3IsolationDomainName) {
        Mono<Response<Flux<ByteBuffer>>> mono = deleteWithResponseAsync(resourceGroupName, l3IsolationDomainName);
        return this
            .client
            .<Void, Void>getLroResult(
                mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext());
    }

    /**
     * Deletes a L3 Isolation Domain.
     *
     * <p>Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link PollerFlux} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux<PollResult<Void>, Void> beginDeleteAsync(
        String resourceGroupName, String l3IsolationDomainName, Context context) {
        context = this.client.mergeContext(context);
        Mono<Response<Flux<ByteBuffer>>> mono =
            deleteWithResponseAsync(resourceGroupName, l3IsolationDomainName, context);
        return this
            .client
            .<Void, Void>getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
    }

    /**
     * Deletes a L3 Isolation Domain.
     *
     * <p>Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller<PollResult<Void>, Void> beginDelete(String resourceGroupName, String l3IsolationDomainName) {
        return this.beginDeleteAsync(resourceGroupName, l3IsolationDomainName).getSyncPoller();
    }

    /**
     * Deletes a L3 Isolation Domain.
     *
     * <p>Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller<PollResult<Void>, Void> beginDelete(
        String resourceGroupName, String l3IsolationDomainName, Context context) {
        return this.beginDeleteAsync(resourceGroupName, l3IsolationDomainName, context).getSyncPoller();
    }

    /**
     * Deletes a L3 Isolation Domain.
     *
     * <p>Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 resourceGroupName, String l3IsolationDomainName) {
        return beginDeleteAsync(resourceGroupName, l3IsolationDomainName)
            .last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Deletes a L3 Isolation Domain.
     *
     * <p>Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return A {@link Mono} that completes when a successful response is received.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Void> deleteAsync(String resourceGroupName, String l3IsolationDomainName, Context context) {
        return beginDeleteAsync(resourceGroupName, l3IsolationDomainName, context)
            .last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Deletes a L3 Isolation Domain.
     *
     * <p>Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void delete(String resourceGroupName, String l3IsolationDomainName) {
        deleteAsync(resourceGroupName, l3IsolationDomainName).block();
    }

    /**
     * Deletes a L3 Isolation Domain.
     *
     * <p>Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3 Isolation Domain.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void delete(String resourceGroupName, String l3IsolationDomainName, Context context) {
        deleteAsync(resourceGroupName, l3IsolationDomainName, context).block();
    }

    /**
     * List L3IsolationDomains by resource group.
     *
     * <p>Displays L3IsolationDomains list by resource group GET method.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return list of L3IsolationDomains along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<L3IsolationDomainInner>> listByResourceGroupSinglePageAsync(String resourceGroupName) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .listByResourceGroup(
                            this.client.getEndpoint(),
                            this.client.getSubscriptionId(),
                            resourceGroupName,
                            this.client.getApiVersion(),
                            accept,
                            context))
            .<PagedResponse<L3IsolationDomainInner>>map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().nextLink(),
                        null))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * List L3IsolationDomains by resource group.
     *
     * <p>Displays L3IsolationDomains list by resource group GET method.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return list of L3IsolationDomains along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<L3IsolationDomainInner>> listByResourceGroupSinglePageAsync(
        String resourceGroupName, Context context) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .listByResourceGroup(
                this.client.getEndpoint(),
                this.client.getSubscriptionId(),
                resourceGroupName,
                this.client.getApiVersion(),
                accept,
                context)
            .map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().nextLink(),
                        null));
    }

    /**
     * List L3IsolationDomains by resource group.
     *
     * <p>Displays L3IsolationDomains list by resource group GET method.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return list of L3IsolationDomains as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux<L3IsolationDomainInner> listByResourceGroupAsync(String resourceGroupName) {
        return new PagedFlux<>(
            () -> listByResourceGroupSinglePageAsync(resourceGroupName),
            nextLink -> listByResourceGroupNextSinglePageAsync(nextLink));
    }

    /**
     * List L3IsolationDomains by resource group.
     *
     * <p>Displays L3IsolationDomains list by resource group GET method.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return list of L3IsolationDomains as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux<L3IsolationDomainInner> listByResourceGroupAsync(String resourceGroupName, Context context) {
        return new PagedFlux<>(
            () -> listByResourceGroupSinglePageAsync(resourceGroupName, context),
            nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context));
    }

    /**
     * List L3IsolationDomains by resource group.
     *
     * <p>Displays L3IsolationDomains list by resource group GET method.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return list of L3IsolationDomains as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<L3IsolationDomainInner> listByResourceGroup(String resourceGroupName) {
        return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName));
    }

    /**
     * List L3IsolationDomains by resource group.
     *
     * <p>Displays L3IsolationDomains list by resource group GET method.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return list of L3IsolationDomains as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<L3IsolationDomainInner> listByResourceGroup(String resourceGroupName, Context context) {
        return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context));
    }

    /**
     * List L3IsolationDomains by subscription.
     *
     * <p>Displays L3IsolationDomains list by subscription GET method.
     *
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return list of L3IsolationDomains along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<L3IsolationDomainInner>> listSinglePageAsync() {
        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."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .list(
                            this.client.getEndpoint(),
                            this.client.getSubscriptionId(),
                            this.client.getApiVersion(),
                            accept,
                            context))
            .<PagedResponse<L3IsolationDomainInner>>map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().nextLink(),
                        null))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * List L3IsolationDomains by subscription.
     *
     * <p>Displays L3IsolationDomains list by subscription GET method.
     *
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return list of L3IsolationDomains along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<L3IsolationDomainInner>> listSinglePageAsync(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."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .list(
                this.client.getEndpoint(),
                this.client.getSubscriptionId(),
                this.client.getApiVersion(),
                accept,
                context)
            .map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().nextLink(),
                        null));
    }

    /**
     * List L3IsolationDomains by subscription.
     *
     * <p>Displays L3IsolationDomains list by subscription GET method.
     *
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return list of L3IsolationDomains as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux<L3IsolationDomainInner> listAsync() {
        return new PagedFlux<>(
            () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink));
    }

    /**
     * List L3IsolationDomains by subscription.
     *
     * <p>Displays L3IsolationDomains list by subscription GET method.
     *
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return list of L3IsolationDomains as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux<L3IsolationDomainInner> listAsync(Context context) {
        return new PagedFlux<>(
            () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context));
    }

    /**
     * List L3IsolationDomains by subscription.
     *
     * <p>Displays L3IsolationDomains list by subscription GET method.
     *
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return list of L3IsolationDomains as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<L3IsolationDomainInner> list() {
        return new PagedIterable<>(listAsync());
    }

    /**
     * List L3IsolationDomains by subscription.
     *
     * <p>Displays L3IsolationDomains list by subscription GET method.
     *
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return list of L3IsolationDomains as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<L3IsolationDomainInner> list(Context context) {
        return new PagedIterable<>(listAsync(context));
    }

    /**
     * executes enable operation to the underlying resources.
     *
     * <p>Enables racks for this Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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<Flux<ByteBuffer>>> updateAdministrativeStateWithResponseAsync(
        String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
        }
        if (l3IsolationDomainName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null."));
        }
        if (body == null) {
            return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
        } else {
            body.validate();
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .updateAdministrativeState(
                            this.client.getEndpoint(),
                            this.client.getSubscriptionId(),
                            resourceGroupName,
                            this.client.getApiVersion(),
                            l3IsolationDomainName,
                            body,
                            accept,
                            context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * executes enable operation to the underlying resources.
     *
     * <p>Enables racks for this Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @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<Flux<ByteBuffer>>> updateAdministrativeStateWithResponseAsync(
        String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body, Context context) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
        }
        if (l3IsolationDomainName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null."));
        }
        if (body == null) {
            return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
        } else {
            body.validate();
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .updateAdministrativeState(
                this.client.getEndpoint(),
                this.client.getSubscriptionId(),
                resourceGroupName,
                this.client.getApiVersion(),
                l3IsolationDomainName,
                body,
                accept,
                context);
    }

    /**
     * executes enable operation to the underlying resources.
     *
     * <p>Enables racks for this Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link PollerFlux} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux<PollResult<Void>, Void> beginUpdateAdministrativeStateAsync(
        String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body) {
        Mono<Response<Flux<ByteBuffer>>> mono =
            updateAdministrativeStateWithResponseAsync(resourceGroupName, l3IsolationDomainName, body);
        return this
            .client
            .<Void, Void>getLroResult(
                mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext());
    }

    /**
     * executes enable operation to the underlying resources.
     *
     * <p>Enables racks for this Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link PollerFlux} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux<PollResult<Void>, Void> beginUpdateAdministrativeStateAsync(
        String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body, Context context) {
        context = this.client.mergeContext(context);
        Mono<Response<Flux<ByteBuffer>>> mono =
            updateAdministrativeStateWithResponseAsync(resourceGroupName, l3IsolationDomainName, body, context);
        return this
            .client
            .<Void, Void>getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
    }

    /**
     * executes enable operation to the underlying resources.
     *
     * <p>Enables racks for this Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller<PollResult<Void>, Void> beginUpdateAdministrativeState(
        String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body) {
        return this.beginUpdateAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, body).getSyncPoller();
    }

    /**
     * executes enable operation to the underlying resources.
     *
     * <p>Enables racks for this Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller<PollResult<Void>, Void> beginUpdateAdministrativeState(
        String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body, Context context) {
        return this
            .beginUpdateAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, body, context)
            .getSyncPoller();
    }

    /**
     * executes enable operation to the underlying resources.
     *
     * <p>Enables racks for this Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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> updateAdministrativeStateAsync(
        String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body) {
        return beginUpdateAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, body)
            .last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * executes enable operation to the underlying resources.
     *
     * <p>Enables racks for this Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return A {@link Mono} that completes when a successful response is received.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Void> updateAdministrativeStateAsync(
        String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body, Context context) {
        return beginUpdateAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, body, context)
            .last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * executes enable operation to the underlying resources.
     *
     * <p>Enables racks for this Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @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 updateAdministrativeState(
        String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body) {
        updateAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, body).block();
    }

    /**
     * executes enable operation to the underlying resources.
     *
     * <p>Enables racks for this Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void updateAdministrativeState(
        String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body, Context context) {
        updateAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, body, context).block();
    }

    /**
     * Update route targets on CE devices. List the CE network device ARM resource IDs in the request body payload.
     *
     * <p>Update administrative state of option B on CE devices.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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<Flux<ByteBuffer>>> updateOptionBAdministrativeStateWithResponseAsync(
        String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
        }
        if (l3IsolationDomainName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null."));
        }
        if (body == null) {
            return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
        } else {
            body.validate();
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .updateOptionBAdministrativeState(
                            this.client.getEndpoint(),
                            this.client.getSubscriptionId(),
                            resourceGroupName,
                            this.client.getApiVersion(),
                            l3IsolationDomainName,
                            body,
                            accept,
                            context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Update route targets on CE devices. List the CE network device ARM resource IDs in the request body payload.
     *
     * <p>Update administrative state of option B on CE devices.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @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<Flux<ByteBuffer>>> updateOptionBAdministrativeStateWithResponseAsync(
        String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body, Context context) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
        }
        if (l3IsolationDomainName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null."));
        }
        if (body == null) {
            return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
        } else {
            body.validate();
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .updateOptionBAdministrativeState(
                this.client.getEndpoint(),
                this.client.getSubscriptionId(),
                resourceGroupName,
                this.client.getApiVersion(),
                l3IsolationDomainName,
                body,
                accept,
                context);
    }

    /**
     * Update route targets on CE devices. List the CE network device ARM resource IDs in the request body payload.
     *
     * <p>Update administrative state of option B on CE devices.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link PollerFlux} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux<PollResult<Void>, Void> beginUpdateOptionBAdministrativeStateAsync(
        String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body) {
        Mono<Response<Flux<ByteBuffer>>> mono =
            updateOptionBAdministrativeStateWithResponseAsync(resourceGroupName, l3IsolationDomainName, body);
        return this
            .client
            .<Void, Void>getLroResult(
                mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext());
    }

    /**
     * Update route targets on CE devices. List the CE network device ARM resource IDs in the request body payload.
     *
     * <p>Update administrative state of option B on CE devices.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link PollerFlux} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux<PollResult<Void>, Void> beginUpdateOptionBAdministrativeStateAsync(
        String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body, Context context) {
        context = this.client.mergeContext(context);
        Mono<Response<Flux<ByteBuffer>>> mono =
            updateOptionBAdministrativeStateWithResponseAsync(resourceGroupName, l3IsolationDomainName, body, context);
        return this
            .client
            .<Void, Void>getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
    }

    /**
     * Update route targets on CE devices. List the CE network device ARM resource IDs in the request body payload.
     *
     * <p>Update administrative state of option B on CE devices.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller<PollResult<Void>, Void> beginUpdateOptionBAdministrativeState(
        String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body) {
        return this
            .beginUpdateOptionBAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, body)
            .getSyncPoller();
    }

    /**
     * Update route targets on CE devices. List the CE network device ARM resource IDs in the request body payload.
     *
     * <p>Update administrative state of option B on CE devices.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller<PollResult<Void>, Void> beginUpdateOptionBAdministrativeState(
        String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body, Context context) {
        return this
            .beginUpdateOptionBAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, body, context)
            .getSyncPoller();
    }

    /**
     * Update route targets on CE devices. List the CE network device ARM resource IDs in the request body payload.
     *
     * <p>Update administrative state of option B on CE devices.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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> updateOptionBAdministrativeStateAsync(
        String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body) {
        return beginUpdateOptionBAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, body)
            .last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Update route targets on CE devices. List the CE network device ARM resource IDs in the request body payload.
     *
     * <p>Update administrative state of option B on CE devices.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return A {@link Mono} that completes when a successful response is received.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Void> updateOptionBAdministrativeStateAsync(
        String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body, Context context) {
        return beginUpdateOptionBAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, body, context)
            .last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Update route targets on CE devices. List the CE network device ARM resource IDs in the request body payload.
     *
     * <p>Update administrative state of option B on CE devices.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @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 updateOptionBAdministrativeState(
        String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body) {
        updateOptionBAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, body).block();
    }

    /**
     * Update route targets on CE devices. List the CE network device ARM resource IDs in the request body payload.
     *
     * <p>Update administrative state of option B on CE devices.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void updateOptionBAdministrativeState(
        String resourceGroupName, String l3IsolationDomainName, UpdateAdministrativeState body, Context context) {
        updateOptionBAdministrativeStateAsync(resourceGroupName, l3IsolationDomainName, body, context).block();
    }

    /**
     * executes clear ARP operation to the underlying resources.
     *
     * <p>Clears ARP tables for this Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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<Flux<ByteBuffer>>> clearArpTableWithResponseAsync(
        String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
        }
        if (l3IsolationDomainName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null."));
        }
        if (body == null) {
            return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
        } else {
            body.validate();
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .clearArpTable(
                            this.client.getEndpoint(),
                            this.client.getSubscriptionId(),
                            resourceGroupName,
                            this.client.getApiVersion(),
                            l3IsolationDomainName,
                            body,
                            accept,
                            context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * executes clear ARP operation to the underlying resources.
     *
     * <p>Clears ARP tables for this Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @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<Flux<ByteBuffer>>> clearArpTableWithResponseAsync(
        String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body, Context context) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
        }
        if (l3IsolationDomainName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null."));
        }
        if (body == null) {
            return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
        } else {
            body.validate();
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .clearArpTable(
                this.client.getEndpoint(),
                this.client.getSubscriptionId(),
                resourceGroupName,
                this.client.getApiVersion(),
                l3IsolationDomainName,
                body,
                accept,
                context);
    }

    /**
     * executes clear ARP operation to the underlying resources.
     *
     * <p>Clears ARP tables for this Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link PollerFlux} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux<PollResult<Void>, Void> beginClearArpTableAsync(
        String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body) {
        Mono<Response<Flux<ByteBuffer>>> mono =
            clearArpTableWithResponseAsync(resourceGroupName, l3IsolationDomainName, body);
        return this
            .client
            .<Void, Void>getLroResult(
                mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext());
    }

    /**
     * executes clear ARP operation to the underlying resources.
     *
     * <p>Clears ARP tables for this Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link PollerFlux} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux<PollResult<Void>, Void> beginClearArpTableAsync(
        String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body, Context context) {
        context = this.client.mergeContext(context);
        Mono<Response<Flux<ByteBuffer>>> mono =
            clearArpTableWithResponseAsync(resourceGroupName, l3IsolationDomainName, body, context);
        return this
            .client
            .<Void, Void>getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
    }

    /**
     * executes clear ARP operation to the underlying resources.
     *
     * <p>Clears ARP tables for this Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller<PollResult<Void>, Void> beginClearArpTable(
        String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body) {
        return this.beginClearArpTableAsync(resourceGroupName, l3IsolationDomainName, body).getSyncPoller();
    }

    /**
     * executes clear ARP operation to the underlying resources.
     *
     * <p>Clears ARP tables for this Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller<PollResult<Void>, Void> beginClearArpTable(
        String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body, Context context) {
        return this.beginClearArpTableAsync(resourceGroupName, l3IsolationDomainName, body, context).getSyncPoller();
    }

    /**
     * executes clear ARP operation to the underlying resources.
     *
     * <p>Clears ARP tables for this Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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> clearArpTableAsync(
        String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body) {
        return beginClearArpTableAsync(resourceGroupName, l3IsolationDomainName, body)
            .last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * executes clear ARP operation to the underlying resources.
     *
     * <p>Clears ARP tables for this Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return A {@link Mono} that completes when a successful response is received.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Void> clearArpTableAsync(
        String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body, Context context) {
        return beginClearArpTableAsync(resourceGroupName, l3IsolationDomainName, body, context)
            .last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * executes clear ARP operation to the underlying resources.
     *
     * <p>Clears ARP tables for this Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @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 clearArpTable(String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body) {
        clearArpTableAsync(resourceGroupName, l3IsolationDomainName, body).block();
    }

    /**
     * executes clear ARP operation to the underlying resources.
     *
     * <p>Clears ARP tables for this Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void clearArpTable(
        String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body, Context context) {
        clearArpTableAsync(resourceGroupName, l3IsolationDomainName, body, context).block();
    }

    /**
     * executes ipv6 clear neighbor tables operation to the underlying resources.
     *
     * <p>Clears IPv6 neighbor tables for this Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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<Flux<ByteBuffer>>> clearNeighborTableWithResponseAsync(
        String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
        }
        if (l3IsolationDomainName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null."));
        }
        if (body == null) {
            return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
        } else {
            body.validate();
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .clearNeighborTable(
                            this.client.getEndpoint(),
                            this.client.getSubscriptionId(),
                            resourceGroupName,
                            this.client.getApiVersion(),
                            l3IsolationDomainName,
                            body,
                            accept,
                            context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * executes ipv6 clear neighbor tables operation to the underlying resources.
     *
     * <p>Clears IPv6 neighbor tables for this Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @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<Flux<ByteBuffer>>> clearNeighborTableWithResponseAsync(
        String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body, Context context) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
        }
        if (l3IsolationDomainName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter l3IsolationDomainName is required and cannot be null."));
        }
        if (body == null) {
            return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
        } else {
            body.validate();
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .clearNeighborTable(
                this.client.getEndpoint(),
                this.client.getSubscriptionId(),
                resourceGroupName,
                this.client.getApiVersion(),
                l3IsolationDomainName,
                body,
                accept,
                context);
    }

    /**
     * executes ipv6 clear neighbor tables operation to the underlying resources.
     *
     * <p>Clears IPv6 neighbor tables for this Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link PollerFlux} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux<PollResult<Void>, Void> beginClearNeighborTableAsync(
        String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body) {
        Mono<Response<Flux<ByteBuffer>>> mono =
            clearNeighborTableWithResponseAsync(resourceGroupName, l3IsolationDomainName, body);
        return this
            .client
            .<Void, Void>getLroResult(
                mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext());
    }

    /**
     * executes ipv6 clear neighbor tables operation to the underlying resources.
     *
     * <p>Clears IPv6 neighbor tables for this Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link PollerFlux} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux<PollResult<Void>, Void> beginClearNeighborTableAsync(
        String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body, Context context) {
        context = this.client.mergeContext(context);
        Mono<Response<Flux<ByteBuffer>>> mono =
            clearNeighborTableWithResponseAsync(resourceGroupName, l3IsolationDomainName, body, context);
        return this
            .client
            .<Void, Void>getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
    }

    /**
     * executes ipv6 clear neighbor tables operation to the underlying resources.
     *
     * <p>Clears IPv6 neighbor tables for this Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller<PollResult<Void>, Void> beginClearNeighborTable(
        String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body) {
        return this.beginClearNeighborTableAsync(resourceGroupName, l3IsolationDomainName, body).getSyncPoller();
    }

    /**
     * executes ipv6 clear neighbor tables operation to the underlying resources.
     *
     * <p>Clears IPv6 neighbor tables for this Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller<PollResult<Void>, Void> beginClearNeighborTable(
        String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body, Context context) {
        return this
            .beginClearNeighborTableAsync(resourceGroupName, l3IsolationDomainName, body, context)
            .getSyncPoller();
    }

    /**
     * executes ipv6 clear neighbor tables operation to the underlying resources.
     *
     * <p>Clears IPv6 neighbor tables for this Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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> clearNeighborTableAsync(
        String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body) {
        return beginClearNeighborTableAsync(resourceGroupName, l3IsolationDomainName, body)
            .last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * executes ipv6 clear neighbor tables operation to the underlying resources.
     *
     * <p>Clears IPv6 neighbor tables for this Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return A {@link Mono} that completes when a successful response is received.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Void> clearNeighborTableAsync(
        String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body, Context context) {
        return beginClearNeighborTableAsync(resourceGroupName, l3IsolationDomainName, body, context)
            .last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * executes ipv6 clear neighbor tables operation to the underlying resources.
     *
     * <p>Clears IPv6 neighbor tables for this Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @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 clearNeighborTable(
        String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body) {
        clearNeighborTableAsync(resourceGroupName, l3IsolationDomainName, body).block();
    }

    /**
     * executes ipv6 clear neighbor tables operation to the underlying resources.
     *
     * <p>Clears IPv6 neighbor tables for this Isolation Domain.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param l3IsolationDomainName Name of the L3IsolationDomain.
     * @param body Request payload.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void clearNeighborTable(
        String resourceGroupName, String l3IsolationDomainName, EnableDisableOnResources body, Context context) {
        clearNeighborTableAsync(resourceGroupName, l3IsolationDomainName, body, context).block();
    }

    /**
     * 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 list of L3IsolationDomains along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<L3IsolationDomainInner>> listByResourceGroupNextSinglePageAsync(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.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context))
            .<PagedResponse<L3IsolationDomainInner>>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 list of L3IsolationDomains along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<L3IsolationDomainInner>> listByResourceGroupNextSinglePageAsync(
        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
            .listByResourceGroupNext(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 list of L3IsolationDomains along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<L3IsolationDomainInner>> listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context))
            .<PagedResponse<L3IsolationDomainInner>>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 list of L3IsolationDomains along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<L3IsolationDomainInner>> listBySubscriptionNextSinglePageAsync(
        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
            .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)
            .map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().nextLink(),
                        null));
    }
}
