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

com.azure.resourcemanager.avs.implementation.WorkloadNetworksClientImpl Maven / Gradle / Ivy

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

package com.azure.resourcemanager.avs.implementation;

import com.azure.core.annotation.BodyParam;
import com.azure.core.annotation.Delete;
import com.azure.core.annotation.ExpectedResponses;
import com.azure.core.annotation.Get;
import com.azure.core.annotation.HeaderParam;
import com.azure.core.annotation.Headers;
import com.azure.core.annotation.Host;
import com.azure.core.annotation.HostParam;
import com.azure.core.annotation.Patch;
import com.azure.core.annotation.PathParam;
import com.azure.core.annotation.Put;
import com.azure.core.annotation.QueryParam;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceInterface;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.UnexpectedResponseExceptionType;
import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.PagedResponse;
import com.azure.core.http.rest.PagedResponseBase;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.RestProxy;
import com.azure.core.management.exception.ManagementException;
import com.azure.core.management.polling.PollResult;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.core.util.polling.PollerFlux;
import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.avs.fluent.WorkloadNetworksClient;
import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDhcpInner;
import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsServiceInner;
import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsZoneInner;
import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkGatewayInner;
import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkInner;
import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPortMirroringInner;
import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPublicIpInner;
import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkSegmentInner;
import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVirtualMachineInner;
import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVMGroupInner;
import com.azure.resourcemanager.avs.models.WorkloadNetworkDhcpList;
import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsServicesList;
import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsZonesList;
import com.azure.resourcemanager.avs.models.WorkloadNetworkGatewayList;
import com.azure.resourcemanager.avs.models.WorkloadNetworkList;
import com.azure.resourcemanager.avs.models.WorkloadNetworkPortMirroringList;
import com.azure.resourcemanager.avs.models.WorkloadNetworkPublicIPsList;
import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentsList;
import com.azure.resourcemanager.avs.models.WorkloadNetworkVirtualMachinesList;
import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroupsList;
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 WorkloadNetworksClient.
 */
public final class WorkloadNetworksClientImpl implements WorkloadNetworksClient {
    /**
     * The proxy service used to perform REST calls.
     */
    private final WorkloadNetworksService service;

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

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

    /**
     * The interface defining all the services for AvsClientWorkloadNetworks to be used by the proxy service to perform
     * REST calls.
     */
    @Host("{$host}")
    @ServiceInterface(name = "AvsClientWorkloadNet")
    public interface WorkloadNetworksService {
        @Headers({ "Content-Type: application/json" })
        @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks")
        @ExpectedResponses({ 200 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono> list(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
            Context context);

        @Headers({ "Content-Type: application/json" })
        @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default")
        @ExpectedResponses({ 200 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono> get(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
            Context context);

        @Headers({ "Content-Type: application/json" })
        @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations")
        @ExpectedResponses({ 200 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono> listDhcp(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
            Context context);

        @Headers({ "Content-Type: application/json" })
        @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}")
        @ExpectedResponses({ 200 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono> getDhcp(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName, @PathParam("dhcpId") String dhcpId,
            @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
            Context context);

        @Headers({ "Content-Type: application/json" })
        @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}")
        @ExpectedResponses({ 200, 201 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono>> createDhcp(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName, @PathParam("dhcpId") String dhcpId,
            @BodyParam("application/json") WorkloadNetworkDhcpInner workloadNetworkDhcp,
            @HeaderParam("Accept") String accept, Context context);

        @Headers({ "Content-Type: application/json" })
        @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}")
        @ExpectedResponses({ 200, 202 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono>> updateDhcp(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName, @PathParam("dhcpId") String dhcpId,
            @BodyParam("application/json") WorkloadNetworkDhcpInner workloadNetworkDhcp,
            @HeaderParam("Accept") String accept, Context context);

        @Headers({ "Content-Type: application/json" })
        @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}")
        @ExpectedResponses({ 200, 202, 204 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono>> deleteDhcp(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName, @PathParam("dhcpId") String dhcpId,
            @HeaderParam("Accept") String accept, Context context);

        @Headers({ "Content-Type: application/json" })
        @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices")
        @ExpectedResponses({ 200 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono> listDnsServices(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
            Context context);

        @Headers({ "Content-Type: application/json" })
        @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}")
        @ExpectedResponses({ 200 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono> getDnsService(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName, @PathParam("dnsServiceId") String dnsServiceId,
            @HeaderParam("Accept") String accept, Context context);

        @Headers({ "Content-Type: application/json" })
        @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}")
        @ExpectedResponses({ 200, 201 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono>> createDnsService(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName, @PathParam("dnsServiceId") String dnsServiceId,
            @BodyParam("application/json") WorkloadNetworkDnsServiceInner workloadNetworkDnsService,
            @HeaderParam("Accept") String accept, Context context);

        @Headers({ "Content-Type: application/json" })
        @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}")
        @ExpectedResponses({ 200, 202 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono>> updateDnsService(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName, @PathParam("dnsServiceId") String dnsServiceId,
            @BodyParam("application/json") WorkloadNetworkDnsServiceInner workloadNetworkDnsService,
            @HeaderParam("Accept") String accept, Context context);

        @Headers({ "Content-Type: application/json" })
        @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}")
        @ExpectedResponses({ 200, 202, 204 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono>> deleteDnsService(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName, @PathParam("dnsServiceId") String dnsServiceId,
            @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
            Context context);

        @Headers({ "Content-Type: application/json" })
        @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones")
        @ExpectedResponses({ 200 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono> listDnsZones(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
            Context context);

        @Headers({ "Content-Type: application/json" })
        @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}")
        @ExpectedResponses({ 200 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono> getDnsZone(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName, @PathParam("dnsZoneId") String dnsZoneId,
            @HeaderParam("Accept") String accept, Context context);

        @Headers({ "Content-Type: application/json" })
        @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}")
        @ExpectedResponses({ 200, 201 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono>> createDnsZone(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName, @PathParam("dnsZoneId") String dnsZoneId,
            @BodyParam("application/json") WorkloadNetworkDnsZoneInner workloadNetworkDnsZone,
            @HeaderParam("Accept") String accept, Context context);

        @Headers({ "Content-Type: application/json" })
        @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}")
        @ExpectedResponses({ 200, 202 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono>> updateDnsZone(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName, @PathParam("dnsZoneId") String dnsZoneId,
            @BodyParam("application/json") WorkloadNetworkDnsZoneInner workloadNetworkDnsZone,
            @HeaderParam("Accept") String accept, Context context);

        @Headers({ "Content-Type: application/json" })
        @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}")
        @ExpectedResponses({ 200, 202, 204 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono>> deleteDnsZone(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName, @PathParam("dnsZoneId") String dnsZoneId,
            @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
            Context context);

        @Headers({ "Content-Type: application/json" })
        @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways")
        @ExpectedResponses({ 200 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono> listGateways(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
            Context context);

        @Headers({ "Content-Type: application/json" })
        @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways/{gatewayId}")
        @ExpectedResponses({ 200 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono> getGateway(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName, @PathParam("gatewayId") String gatewayId,
            @HeaderParam("Accept") String accept, Context context);

        @Headers({ "Content-Type: application/json" })
        @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles")
        @ExpectedResponses({ 200 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono> listPortMirroring(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
            Context context);

        @Headers({ "Content-Type: application/json" })
        @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}")
        @ExpectedResponses({ 200 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono> getPortMirroring(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName,
            @PathParam("portMirroringId") String portMirroringId, @HeaderParam("Accept") String accept,
            Context context);

        @Headers({ "Content-Type: application/json" })
        @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}")
        @ExpectedResponses({ 200, 201 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono>> createPortMirroring(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName,
            @PathParam("portMirroringId") String portMirroringId,
            @BodyParam("application/json") WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring,
            @HeaderParam("Accept") String accept, Context context);

        @Headers({ "Content-Type: application/json" })
        @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}")
        @ExpectedResponses({ 200, 202 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono>> updatePortMirroring(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName,
            @PathParam("portMirroringId") String portMirroringId,
            @BodyParam("application/json") WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring,
            @HeaderParam("Accept") String accept, Context context);

        @Headers({ "Content-Type: application/json" })
        @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}")
        @ExpectedResponses({ 200, 202, 204 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono>> deletePortMirroring(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("portMirroringId") String portMirroringId,
            @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
            Context context);

        @Headers({ "Content-Type: application/json" })
        @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs")
        @ExpectedResponses({ 200 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono> listPublicIPs(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
            Context context);

        @Headers({ "Content-Type: application/json" })
        @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}")
        @ExpectedResponses({ 200 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono> getPublicIp(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName, @PathParam("publicIPId") String publicIpId,
            @HeaderParam("Accept") String accept, Context context);

        @Headers({ "Content-Type: application/json" })
        @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}")
        @ExpectedResponses({ 200, 201 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono>> createPublicIp(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName, @PathParam("publicIPId") String publicIpId,
            @BodyParam("application/json") WorkloadNetworkPublicIpInner workloadNetworkPublicIp,
            @HeaderParam("Accept") String accept, Context context);

        @Headers({ "Content-Type: application/json" })
        @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}")
        @ExpectedResponses({ 200, 202, 204 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono>> deletePublicIp(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName, @PathParam("publicIPId") String publicIpId,
            @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
            Context context);

        @Headers({ "Content-Type: application/json" })
        @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments")
        @ExpectedResponses({ 200 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono> listSegments(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
            Context context);

        @Headers({ "Content-Type: application/json" })
        @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}")
        @ExpectedResponses({ 200 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono> getSegment(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName, @PathParam("segmentId") String segmentId,
            @HeaderParam("Accept") String accept, Context context);

        @Headers({ "Content-Type: application/json" })
        @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}")
        @ExpectedResponses({ 200, 201 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono>> createSegments(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName, @PathParam("segmentId") String segmentId,
            @BodyParam("application/json") WorkloadNetworkSegmentInner workloadNetworkSegment,
            @HeaderParam("Accept") String accept, Context context);

        @Headers({ "Content-Type: application/json" })
        @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}")
        @ExpectedResponses({ 200, 202 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono>> updateSegments(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName, @PathParam("segmentId") String segmentId,
            @BodyParam("application/json") WorkloadNetworkSegmentInner workloadNetworkSegment,
            @HeaderParam("Accept") String accept, Context context);

        @Headers({ "Content-Type: application/json" })
        @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}")
        @ExpectedResponses({ 200, 202, 204 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono>> deleteSegment(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName, @PathParam("segmentId") String segmentId,
            @HeaderParam("Accept") String accept, Context context);

        @Headers({ "Content-Type: application/json" })
        @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines")
        @ExpectedResponses({ 200 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono> listVirtualMachines(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
            Context context);

        @Headers({ "Content-Type: application/json" })
        @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines/{virtualMachineId}")
        @ExpectedResponses({ 200 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono> getVirtualMachine(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName,
            @PathParam("virtualMachineId") String virtualMachineId, @HeaderParam("Accept") String accept,
            Context context);

        @Headers({ "Content-Type: application/json" })
        @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups")
        @ExpectedResponses({ 200 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono> listVMGroups(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
            Context context);

        @Headers({ "Content-Type: application/json" })
        @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}")
        @ExpectedResponses({ 200 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono> getVMGroup(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName, @PathParam("vmGroupId") String vmGroupId,
            @HeaderParam("Accept") String accept, Context context);

        @Headers({ "Content-Type: application/json" })
        @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}")
        @ExpectedResponses({ 200, 201 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono>> createVMGroup(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName, @PathParam("vmGroupId") String vmGroupId,
            @BodyParam("application/json") WorkloadNetworkVMGroupInner workloadNetworkVMGroup,
            @HeaderParam("Accept") String accept, Context context);

        @Headers({ "Content-Type: application/json" })
        @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}")
        @ExpectedResponses({ 200, 202 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono>> updateVMGroup(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("privateCloudName") String privateCloudName, @PathParam("vmGroupId") String vmGroupId,
            @BodyParam("application/json") WorkloadNetworkVMGroupInner workloadNetworkVMGroup,
            @HeaderParam("Accept") String accept, Context context);

        @Headers({ "Content-Type: application/json" })
        @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}")
        @ExpectedResponses({ 200, 202, 204 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono>> deleteVMGroup(@HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vmGroupId") String vmGroupId,
            @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept,
            Context context);

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

        @Headers({ "Content-Type: application/json" })
        @Get("{nextLink}")
        @ExpectedResponses({ 200 })
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono> listDhcpNext(
            @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> listDnsServicesNext(
            @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> listDnsZonesNext(
            @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> listGatewaysNext(
            @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> listPortMirroringNext(
            @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> listPublicIPsNext(
            @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> listSegmentsNext(
            @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> listVirtualMachinesNext(
            @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> listVMGroupsNext(
            @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
            @HeaderParam("Accept") String accept, Context context);
    }

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

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

    /**
     * List WorkloadNetwork resources by PrivateCloud.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetwork list operation as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux listAsync(String resourceGroupName, String privateCloudName) {
        return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName),
            nextLink -> listNextSinglePageAsync(nextLink));
    }

    /**
     * List WorkloadNetwork resources by PrivateCloud.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetwork list operation as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux listAsync(String resourceGroupName, String privateCloudName,
        Context context) {
        return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName, context),
            nextLink -> listNextSinglePageAsync(nextLink, context));
    }

    /**
     * List WorkloadNetwork resources by PrivateCloud.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetwork list operation as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable list(String resourceGroupName, String privateCloudName) {
        return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName));
    }

    /**
     * List WorkloadNetwork resources by PrivateCloud.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetwork list operation as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable list(String resourceGroupName, String privateCloudName,
        Context context) {
        return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, context));
    }

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

    /**
     * Get a WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @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 WorkloadNetwork along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName,
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
            resourceGroupName, privateCloudName, accept, context);
    }

    /**
     * Get a WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 WorkloadNetwork on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono getAsync(String resourceGroupName, String privateCloudName) {
        return getWithResponseAsync(resourceGroupName, privateCloudName)
            .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Get a WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @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 WorkloadNetwork along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response getWithResponse(String resourceGroupName, String privateCloudName,
        Context context) {
        return getWithResponseAsync(resourceGroupName, privateCloudName, context).block();
    }

    /**
     * Get a WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 WorkloadNetwork.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkInner get(String resourceGroupName, String privateCloudName) {
        return getWithResponse(resourceGroupName, privateCloudName, Context.NONE).getValue();
    }

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

    /**
     * List WorkloadNetworkDhcp resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkDhcp list operation along with {@link PagedResponse} on successful
     * completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> listDhcpSinglePageAsync(String resourceGroupName,
        String privateCloudName, 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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .listDhcp(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
                resourceGroupName, privateCloudName, accept, context)
            .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
                res.getValue().value(), res.getValue().nextLink(), null));
    }

    /**
     * List WorkloadNetworkDhcp resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkDhcp list operation as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux listDhcpAsync(String resourceGroupName, String privateCloudName) {
        return new PagedFlux<>(() -> listDhcpSinglePageAsync(resourceGroupName, privateCloudName),
            nextLink -> listDhcpNextSinglePageAsync(nextLink));
    }

    /**
     * List WorkloadNetworkDhcp resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkDhcp list operation as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux listDhcpAsync(String resourceGroupName, String privateCloudName,
        Context context) {
        return new PagedFlux<>(() -> listDhcpSinglePageAsync(resourceGroupName, privateCloudName, context),
            nextLink -> listDhcpNextSinglePageAsync(nextLink, context));
    }

    /**
     * List WorkloadNetworkDhcp resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkDhcp list operation as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable listDhcp(String resourceGroupName, String privateCloudName) {
        return new PagedIterable<>(listDhcpAsync(resourceGroupName, privateCloudName));
    }

    /**
     * List WorkloadNetworkDhcp resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkDhcp list operation as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable listDhcp(String resourceGroupName, String privateCloudName,
        Context context) {
        return new PagedIterable<>(listDhcpAsync(resourceGroupName, privateCloudName, context));
    }

    /**
     * Get a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param dhcpId The ID of the DHCP configuration.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 WorkloadNetworkDhcp along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> getDhcpWithResponseAsync(String resourceGroupName, String dhcpId,
        String privateCloudName) {
        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 (dhcpId == null) {
            return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null."));
        }
        if (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.getDhcp(this.client.getEndpoint(), this.client.getApiVersion(),
                this.client.getSubscriptionId(), resourceGroupName, dhcpId, privateCloudName, accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param dhcpId The ID of the DHCP configuration.
     * @param privateCloudName Name of the private cloud.
     * @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 WorkloadNetworkDhcp along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> getDhcpWithResponseAsync(String resourceGroupName, String dhcpId,
        String privateCloudName, 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 (dhcpId == null) {
            return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null."));
        }
        if (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.getDhcp(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
            resourceGroupName, dhcpId, privateCloudName, accept, context);
    }

    /**
     * Get a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param dhcpId The ID of the DHCP configuration.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 WorkloadNetworkDhcp on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono getDhcpAsync(String resourceGroupName, String dhcpId,
        String privateCloudName) {
        return getDhcpWithResponseAsync(resourceGroupName, dhcpId, privateCloudName)
            .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Get a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param dhcpId The ID of the DHCP configuration.
     * @param privateCloudName Name of the private cloud.
     * @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 WorkloadNetworkDhcp along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response getDhcpWithResponse(String resourceGroupName, String dhcpId,
        String privateCloudName, Context context) {
        return getDhcpWithResponseAsync(resourceGroupName, dhcpId, privateCloudName, context).block();
    }

    /**
     * Get a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param dhcpId The ID of the DHCP configuration.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 WorkloadNetworkDhcp.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkDhcpInner getDhcp(String resourceGroupName, String dhcpId, String privateCloudName) {
        return getDhcpWithResponse(resourceGroupName, dhcpId, privateCloudName, Context.NONE).getValue();
    }

    /**
     * Create a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dhcpId The ID of the DHCP configuration.
     * @param workloadNetworkDhcp Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX DHCP along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>> createDhcpWithResponseAsync(String resourceGroupName,
        String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) {
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (dhcpId == null) {
            return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null."));
        }
        if (workloadNetworkDhcp == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null."));
        } else {
            workloadNetworkDhcp.validate();
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.createDhcp(this.client.getEndpoint(), this.client.getApiVersion(),
                this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp,
                accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Create a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dhcpId The ID of the DHCP configuration.
     * @param workloadNetworkDhcp Resource create parameters.
     * @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 nSX DHCP along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>> createDhcpWithResponseAsync(String resourceGroupName,
        String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp, 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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (dhcpId == null) {
            return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null."));
        }
        if (workloadNetworkDhcp == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null."));
        } else {
            workloadNetworkDhcp.validate();
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.createDhcp(this.client.getEndpoint(), this.client.getApiVersion(),
            this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, accept,
            context);
    }

    /**
     * Create a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dhcpId The ID of the DHCP configuration.
     * @param workloadNetworkDhcp Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 nSX DHCP.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, WorkloadNetworkDhcpInner> beginCreateDhcpAsync(
        String resourceGroupName, String privateCloudName, String dhcpId,
        WorkloadNetworkDhcpInner workloadNetworkDhcp) {
        Mono>> mono
            = createDhcpWithResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp);
        return this.client.getLroResult(mono,
            this.client.getHttpPipeline(), WorkloadNetworkDhcpInner.class, WorkloadNetworkDhcpInner.class,
            this.client.getContext());
    }

    /**
     * Create a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dhcpId The ID of the DHCP configuration.
     * @param workloadNetworkDhcp Resource create parameters.
     * @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 nSX DHCP.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, WorkloadNetworkDhcpInner> beginCreateDhcpAsync(
        String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp,
        Context context) {
        context = this.client.mergeContext(context);
        Mono>> mono
            = createDhcpWithResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context);
        return this.client.getLroResult(mono,
            this.client.getHttpPipeline(), WorkloadNetworkDhcpInner.class, WorkloadNetworkDhcpInner.class, context);
    }

    /**
     * Create a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dhcpId The ID of the DHCP configuration.
     * @param workloadNetworkDhcp Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 nSX DHCP.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, WorkloadNetworkDhcpInner> beginCreateDhcp(
        String resourceGroupName, String privateCloudName, String dhcpId,
        WorkloadNetworkDhcpInner workloadNetworkDhcp) {
        return this.beginCreateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp)
            .getSyncPoller();
    }

    /**
     * Create a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dhcpId The ID of the DHCP configuration.
     * @param workloadNetworkDhcp Resource create parameters.
     * @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 nSX DHCP.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, WorkloadNetworkDhcpInner> beginCreateDhcp(
        String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp,
        Context context) {
        return this.beginCreateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context)
            .getSyncPoller();
    }

    /**
     * Create a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dhcpId The ID of the DHCP configuration.
     * @param workloadNetworkDhcp Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX DHCP on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono createDhcpAsync(String resourceGroupName, String privateCloudName,
        String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) {
        return beginCreateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Create a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dhcpId The ID of the DHCP configuration.
     * @param workloadNetworkDhcp Resource create parameters.
     * @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 nSX DHCP on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono createDhcpAsync(String resourceGroupName, String privateCloudName,
        String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context) {
        return beginCreateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context).last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Create a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dhcpId The ID of the DHCP configuration.
     * @param workloadNetworkDhcp Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX DHCP.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkDhcpInner createDhcp(String resourceGroupName, String privateCloudName, String dhcpId,
        WorkloadNetworkDhcpInner workloadNetworkDhcp) {
        return createDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).block();
    }

    /**
     * Create a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dhcpId The ID of the DHCP configuration.
     * @param workloadNetworkDhcp Resource create parameters.
     * @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 nSX DHCP.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkDhcpInner createDhcp(String resourceGroupName, String privateCloudName, String dhcpId,
        WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context) {
        return createDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context).block();
    }

    /**
     * Update a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dhcpId The ID of the DHCP configuration.
     * @param workloadNetworkDhcp The resource properties to be updated.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX DHCP along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>> updateDhcpWithResponseAsync(String resourceGroupName,
        String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) {
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (dhcpId == null) {
            return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null."));
        }
        if (workloadNetworkDhcp == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null."));
        } else {
            workloadNetworkDhcp.validate();
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.updateDhcp(this.client.getEndpoint(), this.client.getApiVersion(),
                this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp,
                accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Update a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dhcpId The ID of the DHCP configuration.
     * @param workloadNetworkDhcp The resource properties to be updated.
     * @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 nSX DHCP along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>> updateDhcpWithResponseAsync(String resourceGroupName,
        String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp, 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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (dhcpId == null) {
            return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null."));
        }
        if (workloadNetworkDhcp == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null."));
        } else {
            workloadNetworkDhcp.validate();
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.updateDhcp(this.client.getEndpoint(), this.client.getApiVersion(),
            this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, accept,
            context);
    }

    /**
     * Update a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dhcpId The ID of the DHCP configuration.
     * @param workloadNetworkDhcp The resource properties to be updated.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 nSX DHCP.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, WorkloadNetworkDhcpInner> beginUpdateDhcpAsync(
        String resourceGroupName, String privateCloudName, String dhcpId,
        WorkloadNetworkDhcpInner workloadNetworkDhcp) {
        Mono>> mono
            = updateDhcpWithResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp);
        return this.client.getLroResult(mono,
            this.client.getHttpPipeline(), WorkloadNetworkDhcpInner.class, WorkloadNetworkDhcpInner.class,
            this.client.getContext());
    }

    /**
     * Update a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dhcpId The ID of the DHCP configuration.
     * @param workloadNetworkDhcp The resource properties to be updated.
     * @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 nSX DHCP.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, WorkloadNetworkDhcpInner> beginUpdateDhcpAsync(
        String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp,
        Context context) {
        context = this.client.mergeContext(context);
        Mono>> mono
            = updateDhcpWithResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context);
        return this.client.getLroResult(mono,
            this.client.getHttpPipeline(), WorkloadNetworkDhcpInner.class, WorkloadNetworkDhcpInner.class, context);
    }

    /**
     * Update a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dhcpId The ID of the DHCP configuration.
     * @param workloadNetworkDhcp The resource properties to be updated.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 nSX DHCP.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, WorkloadNetworkDhcpInner> beginUpdateDhcp(
        String resourceGroupName, String privateCloudName, String dhcpId,
        WorkloadNetworkDhcpInner workloadNetworkDhcp) {
        return this.beginUpdateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp)
            .getSyncPoller();
    }

    /**
     * Update a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dhcpId The ID of the DHCP configuration.
     * @param workloadNetworkDhcp The resource properties to be updated.
     * @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 nSX DHCP.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, WorkloadNetworkDhcpInner> beginUpdateDhcp(
        String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp,
        Context context) {
        return this.beginUpdateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context)
            .getSyncPoller();
    }

    /**
     * Update a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dhcpId The ID of the DHCP configuration.
     * @param workloadNetworkDhcp The resource properties to be updated.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX DHCP on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono updateDhcpAsync(String resourceGroupName, String privateCloudName,
        String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) {
        return beginUpdateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Update a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dhcpId The ID of the DHCP configuration.
     * @param workloadNetworkDhcp The resource properties to be updated.
     * @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 nSX DHCP on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono updateDhcpAsync(String resourceGroupName, String privateCloudName,
        String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context) {
        return beginUpdateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context).last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Update a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dhcpId The ID of the DHCP configuration.
     * @param workloadNetworkDhcp The resource properties to be updated.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX DHCP.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkDhcpInner updateDhcp(String resourceGroupName, String privateCloudName, String dhcpId,
        WorkloadNetworkDhcpInner workloadNetworkDhcp) {
        return updateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).block();
    }

    /**
     * Update a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dhcpId The ID of the DHCP configuration.
     * @param workloadNetworkDhcp The resource properties to be updated.
     * @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 nSX DHCP.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkDhcpInner updateDhcp(String resourceGroupName, String privateCloudName, String dhcpId,
        WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context) {
        return updateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context).block();
    }

    /**
     * Delete a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dhcpId The ID of the DHCP configuration.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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>> deleteDhcpWithResponseAsync(String resourceGroupName,
        String privateCloudName, String dhcpId) {
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (dhcpId == null) {
            return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.deleteDhcp(this.client.getEndpoint(), this.client.getApiVersion(),
                this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dhcpId, accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Delete a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dhcpId The ID of the DHCP configuration.
     * @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>> deleteDhcpWithResponseAsync(String resourceGroupName,
        String privateCloudName, String dhcpId, 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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (dhcpId == null) {
            return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.deleteDhcp(this.client.getEndpoint(), this.client.getApiVersion(),
            this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dhcpId, accept, context);
    }

    /**
     * Delete a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dhcpId The ID of the DHCP configuration.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link PollerFlux} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, Void> beginDeleteDhcpAsync(String resourceGroupName, String privateCloudName,
        String dhcpId) {
        Mono>> mono
            = deleteDhcpWithResponseAsync(resourceGroupName, privateCloudName, dhcpId);
        return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
            this.client.getContext());
    }

    /**
     * Delete a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dhcpId The ID of the DHCP configuration.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link PollerFlux} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, Void> beginDeleteDhcpAsync(String resourceGroupName, String privateCloudName,
        String dhcpId, Context context) {
        context = this.client.mergeContext(context);
        Mono>> mono
            = deleteDhcpWithResponseAsync(resourceGroupName, privateCloudName, dhcpId, context);
        return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
            context);
    }

    /**
     * Delete a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dhcpId The ID of the DHCP configuration.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, Void> beginDeleteDhcp(String resourceGroupName, String privateCloudName,
        String dhcpId) {
        return this.beginDeleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId).getSyncPoller();
    }

    /**
     * Delete a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dhcpId The ID of the DHCP configuration.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, Void> beginDeleteDhcp(String resourceGroupName, String privateCloudName,
        String dhcpId, Context context) {
        return this.beginDeleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId, context).getSyncPoller();
    }

    /**
     * Delete a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dhcpId The ID of the DHCP configuration.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 deleteDhcpAsync(String resourceGroupName, String privateCloudName, String dhcpId) {
        return beginDeleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId).last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Delete a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dhcpId The ID of the DHCP configuration.
     * @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 deleteDhcpAsync(String resourceGroupName, String privateCloudName, String dhcpId,
        Context context) {
        return beginDeleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId, context).last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Delete a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dhcpId The ID of the DHCP configuration.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @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 deleteDhcp(String resourceGroupName, String privateCloudName, String dhcpId) {
        deleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId).block();
    }

    /**
     * Delete a WorkloadNetworkDhcp.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dhcpId The ID of the DHCP configuration.
     * @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 deleteDhcp(String resourceGroupName, String privateCloudName, String dhcpId, Context context) {
        deleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId, context).block();
    }

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

    /**
     * List WorkloadNetworkDnsService resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkDnsService list operation along with {@link PagedResponse} on successful
     * completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> listDnsServicesSinglePageAsync(String resourceGroupName,
        String privateCloudName, 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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .listDnsServices(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
                resourceGroupName, privateCloudName, accept, context)
            .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
                res.getValue().value(), res.getValue().nextLink(), null));
    }

    /**
     * List WorkloadNetworkDnsService resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkDnsService list operation as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux listDnsServicesAsync(String resourceGroupName,
        String privateCloudName) {
        return new PagedFlux<>(() -> listDnsServicesSinglePageAsync(resourceGroupName, privateCloudName),
            nextLink -> listDnsServicesNextSinglePageAsync(nextLink));
    }

    /**
     * List WorkloadNetworkDnsService resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkDnsService list operation as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux listDnsServicesAsync(String resourceGroupName,
        String privateCloudName, Context context) {
        return new PagedFlux<>(() -> listDnsServicesSinglePageAsync(resourceGroupName, privateCloudName, context),
            nextLink -> listDnsServicesNextSinglePageAsync(nextLink, context));
    }

    /**
     * List WorkloadNetworkDnsService resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkDnsService list operation as paginated response with
     * {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable listDnsServices(String resourceGroupName,
        String privateCloudName) {
        return new PagedIterable<>(listDnsServicesAsync(resourceGroupName, privateCloudName));
    }

    /**
     * List WorkloadNetworkDnsService resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkDnsService list operation as paginated response with
     * {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable listDnsServices(String resourceGroupName,
        String privateCloudName, Context context) {
        return new PagedIterable<>(listDnsServicesAsync(resourceGroupName, privateCloudName, context));
    }

    /**
     * Get a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsServiceId ID of the DNS service.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 WorkloadNetworkDnsService along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> getDnsServiceWithResponseAsync(String resourceGroupName,
        String privateCloudName, String dnsServiceId) {
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (dnsServiceId == null) {
            return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.getDnsService(this.client.getEndpoint(), this.client.getApiVersion(),
                this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsServiceId, accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsServiceId ID of the DNS service.
     * @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 WorkloadNetworkDnsService along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> getDnsServiceWithResponseAsync(String resourceGroupName,
        String privateCloudName, String dnsServiceId, 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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (dnsServiceId == null) {
            return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.getDnsService(this.client.getEndpoint(), this.client.getApiVersion(),
            this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsServiceId, accept, context);
    }

    /**
     * Get a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsServiceId ID of the DNS service.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 WorkloadNetworkDnsService on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono getDnsServiceAsync(String resourceGroupName, String privateCloudName,
        String dnsServiceId) {
        return getDnsServiceWithResponseAsync(resourceGroupName, privateCloudName, dnsServiceId)
            .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Get a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsServiceId ID of the DNS service.
     * @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 WorkloadNetworkDnsService along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response getDnsServiceWithResponse(String resourceGroupName,
        String privateCloudName, String dnsServiceId, Context context) {
        return getDnsServiceWithResponseAsync(resourceGroupName, privateCloudName, dnsServiceId, context).block();
    }

    /**
     * Get a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsServiceId ID of the DNS service.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 WorkloadNetworkDnsService.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkDnsServiceInner getDnsService(String resourceGroupName, String privateCloudName,
        String dnsServiceId) {
        return getDnsServiceWithResponse(resourceGroupName, privateCloudName, dnsServiceId, Context.NONE).getValue();
    }

    /**
     * Create a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsServiceId ID of the DNS service.
     * @param workloadNetworkDnsService Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX DNS Service along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>> createDnsServiceWithResponseAsync(String resourceGroupName,
        String privateCloudName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService) {
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (dnsServiceId == null) {
            return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null."));
        }
        if (workloadNetworkDnsService == null) {
            return Mono.error(
                new IllegalArgumentException("Parameter workloadNetworkDnsService is required and cannot be null."));
        } else {
            workloadNetworkDnsService.validate();
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.createDnsService(this.client.getEndpoint(), this.client.getApiVersion(),
                this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsServiceId,
                workloadNetworkDnsService, accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Create a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsServiceId ID of the DNS service.
     * @param workloadNetworkDnsService Resource create parameters.
     * @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 nSX DNS Service along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>> createDnsServiceWithResponseAsync(String resourceGroupName,
        String privateCloudName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService,
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (dnsServiceId == null) {
            return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null."));
        }
        if (workloadNetworkDnsService == null) {
            return Mono.error(
                new IllegalArgumentException("Parameter workloadNetworkDnsService is required and cannot be null."));
        } else {
            workloadNetworkDnsService.validate();
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.createDnsService(this.client.getEndpoint(), this.client.getApiVersion(),
            this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsServiceId,
            workloadNetworkDnsService, accept, context);
    }

    /**
     * Create a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsServiceId ID of the DNS service.
     * @param workloadNetworkDnsService Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 nSX DNS Service.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, WorkloadNetworkDnsServiceInner>
        beginCreateDnsServiceAsync(String resourceGroupName, String privateCloudName, String dnsServiceId,
            WorkloadNetworkDnsServiceInner workloadNetworkDnsService) {
        Mono>> mono = createDnsServiceWithResponseAsync(resourceGroupName, privateCloudName,
            dnsServiceId, workloadNetworkDnsService);
        return this.client.getLroResult(mono,
            this.client.getHttpPipeline(), WorkloadNetworkDnsServiceInner.class, WorkloadNetworkDnsServiceInner.class,
            this.client.getContext());
    }

    /**
     * Create a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsServiceId ID of the DNS service.
     * @param workloadNetworkDnsService Resource create parameters.
     * @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 nSX DNS Service.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, WorkloadNetworkDnsServiceInner>
        beginCreateDnsServiceAsync(String resourceGroupName, String privateCloudName, String dnsServiceId,
            WorkloadNetworkDnsServiceInner workloadNetworkDnsService, Context context) {
        context = this.client.mergeContext(context);
        Mono>> mono = createDnsServiceWithResponseAsync(resourceGroupName, privateCloudName,
            dnsServiceId, workloadNetworkDnsService, context);
        return this.client.getLroResult(mono,
            this.client.getHttpPipeline(), WorkloadNetworkDnsServiceInner.class, WorkloadNetworkDnsServiceInner.class,
            context);
    }

    /**
     * Create a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsServiceId ID of the DNS service.
     * @param workloadNetworkDnsService Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 nSX DNS Service.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, WorkloadNetworkDnsServiceInner> beginCreateDnsService(
        String resourceGroupName, String privateCloudName, String dnsServiceId,
        WorkloadNetworkDnsServiceInner workloadNetworkDnsService) {
        return this
            .beginCreateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService)
            .getSyncPoller();
    }

    /**
     * Create a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsServiceId ID of the DNS service.
     * @param workloadNetworkDnsService Resource create parameters.
     * @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 nSX DNS Service.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, WorkloadNetworkDnsServiceInner> beginCreateDnsService(
        String resourceGroupName, String privateCloudName, String dnsServiceId,
        WorkloadNetworkDnsServiceInner workloadNetworkDnsService, Context context) {
        return this
            .beginCreateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService,
                context)
            .getSyncPoller();
    }

    /**
     * Create a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsServiceId ID of the DNS service.
     * @param workloadNetworkDnsService Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX DNS Service on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono createDnsServiceAsync(String resourceGroupName,
        String privateCloudName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService) {
        return beginCreateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService)
            .last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Create a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsServiceId ID of the DNS service.
     * @param workloadNetworkDnsService Resource create parameters.
     * @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 nSX DNS Service on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono createDnsServiceAsync(String resourceGroupName,
        String privateCloudName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService,
        Context context) {
        return beginCreateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService,
            context).last().flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Create a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsServiceId ID of the DNS service.
     * @param workloadNetworkDnsService Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX DNS Service.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkDnsServiceInner createDnsService(String resourceGroupName, String privateCloudName,
        String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService) {
        return createDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService)
            .block();
    }

    /**
     * Create a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsServiceId ID of the DNS service.
     * @param workloadNetworkDnsService Resource create parameters.
     * @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 nSX DNS Service.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkDnsServiceInner createDnsService(String resourceGroupName, String privateCloudName,
        String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService, Context context) {
        return createDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService,
            context).block();
    }

    /**
     * Update a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsServiceId ID of the DNS service.
     * @param workloadNetworkDnsService The resource properties to be updated.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX DNS Service along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>> updateDnsServiceWithResponseAsync(String resourceGroupName,
        String privateCloudName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService) {
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (dnsServiceId == null) {
            return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null."));
        }
        if (workloadNetworkDnsService == null) {
            return Mono.error(
                new IllegalArgumentException("Parameter workloadNetworkDnsService is required and cannot be null."));
        } else {
            workloadNetworkDnsService.validate();
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.updateDnsService(this.client.getEndpoint(), this.client.getApiVersion(),
                this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsServiceId,
                workloadNetworkDnsService, accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Update a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsServiceId ID of the DNS service.
     * @param workloadNetworkDnsService The resource properties to be updated.
     * @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 nSX DNS Service along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>> updateDnsServiceWithResponseAsync(String resourceGroupName,
        String privateCloudName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService,
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (dnsServiceId == null) {
            return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null."));
        }
        if (workloadNetworkDnsService == null) {
            return Mono.error(
                new IllegalArgumentException("Parameter workloadNetworkDnsService is required and cannot be null."));
        } else {
            workloadNetworkDnsService.validate();
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.updateDnsService(this.client.getEndpoint(), this.client.getApiVersion(),
            this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsServiceId,
            workloadNetworkDnsService, accept, context);
    }

    /**
     * Update a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsServiceId ID of the DNS service.
     * @param workloadNetworkDnsService The resource properties to be updated.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 nSX DNS Service.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, WorkloadNetworkDnsServiceInner>
        beginUpdateDnsServiceAsync(String resourceGroupName, String privateCloudName, String dnsServiceId,
            WorkloadNetworkDnsServiceInner workloadNetworkDnsService) {
        Mono>> mono = updateDnsServiceWithResponseAsync(resourceGroupName, privateCloudName,
            dnsServiceId, workloadNetworkDnsService);
        return this.client.getLroResult(mono,
            this.client.getHttpPipeline(), WorkloadNetworkDnsServiceInner.class, WorkloadNetworkDnsServiceInner.class,
            this.client.getContext());
    }

    /**
     * Update a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsServiceId ID of the DNS service.
     * @param workloadNetworkDnsService The resource properties to be updated.
     * @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 nSX DNS Service.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, WorkloadNetworkDnsServiceInner>
        beginUpdateDnsServiceAsync(String resourceGroupName, String privateCloudName, String dnsServiceId,
            WorkloadNetworkDnsServiceInner workloadNetworkDnsService, Context context) {
        context = this.client.mergeContext(context);
        Mono>> mono = updateDnsServiceWithResponseAsync(resourceGroupName, privateCloudName,
            dnsServiceId, workloadNetworkDnsService, context);
        return this.client.getLroResult(mono,
            this.client.getHttpPipeline(), WorkloadNetworkDnsServiceInner.class, WorkloadNetworkDnsServiceInner.class,
            context);
    }

    /**
     * Update a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsServiceId ID of the DNS service.
     * @param workloadNetworkDnsService The resource properties to be updated.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 nSX DNS Service.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, WorkloadNetworkDnsServiceInner> beginUpdateDnsService(
        String resourceGroupName, String privateCloudName, String dnsServiceId,
        WorkloadNetworkDnsServiceInner workloadNetworkDnsService) {
        return this
            .beginUpdateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService)
            .getSyncPoller();
    }

    /**
     * Update a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsServiceId ID of the DNS service.
     * @param workloadNetworkDnsService The resource properties to be updated.
     * @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 nSX DNS Service.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, WorkloadNetworkDnsServiceInner> beginUpdateDnsService(
        String resourceGroupName, String privateCloudName, String dnsServiceId,
        WorkloadNetworkDnsServiceInner workloadNetworkDnsService, Context context) {
        return this
            .beginUpdateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService,
                context)
            .getSyncPoller();
    }

    /**
     * Update a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsServiceId ID of the DNS service.
     * @param workloadNetworkDnsService The resource properties to be updated.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX DNS Service on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono updateDnsServiceAsync(String resourceGroupName,
        String privateCloudName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService) {
        return beginUpdateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService)
            .last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Update a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsServiceId ID of the DNS service.
     * @param workloadNetworkDnsService The resource properties to be updated.
     * @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 nSX DNS Service on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono updateDnsServiceAsync(String resourceGroupName,
        String privateCloudName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService,
        Context context) {
        return beginUpdateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService,
            context).last().flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Update a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsServiceId ID of the DNS service.
     * @param workloadNetworkDnsService The resource properties to be updated.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX DNS Service.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkDnsServiceInner updateDnsService(String resourceGroupName, String privateCloudName,
        String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService) {
        return updateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService)
            .block();
    }

    /**
     * Update a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsServiceId ID of the DNS service.
     * @param workloadNetworkDnsService The resource properties to be updated.
     * @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 nSX DNS Service.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkDnsServiceInner updateDnsService(String resourceGroupName, String privateCloudName,
        String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService, Context context) {
        return updateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService,
            context).block();
    }

    /**
     * Delete a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param dnsServiceId ID of the DNS service.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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>> deleteDnsServiceWithResponseAsync(String resourceGroupName,
        String dnsServiceId, String privateCloudName) {
        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 (dnsServiceId == null) {
            return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null."));
        }
        if (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.deleteDnsService(this.client.getEndpoint(), this.client.getApiVersion(),
                this.client.getSubscriptionId(), resourceGroupName, dnsServiceId, privateCloudName, accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Delete a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param dnsServiceId ID of the DNS service.
     * @param privateCloudName Name of the private cloud.
     * @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>> deleteDnsServiceWithResponseAsync(String resourceGroupName,
        String dnsServiceId, String privateCloudName, 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 (dnsServiceId == null) {
            return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null."));
        }
        if (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.deleteDnsService(this.client.getEndpoint(), this.client.getApiVersion(),
            this.client.getSubscriptionId(), resourceGroupName, dnsServiceId, privateCloudName, accept, context);
    }

    /**
     * Delete a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param dnsServiceId ID of the DNS service.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link PollerFlux} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, Void> beginDeleteDnsServiceAsync(String resourceGroupName, String dnsServiceId,
        String privateCloudName) {
        Mono>> mono
            = deleteDnsServiceWithResponseAsync(resourceGroupName, dnsServiceId, privateCloudName);
        return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
            this.client.getContext());
    }

    /**
     * Delete a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param dnsServiceId ID of the DNS service.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link PollerFlux} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, Void> beginDeleteDnsServiceAsync(String resourceGroupName, String dnsServiceId,
        String privateCloudName, Context context) {
        context = this.client.mergeContext(context);
        Mono>> mono
            = deleteDnsServiceWithResponseAsync(resourceGroupName, dnsServiceId, privateCloudName, context);
        return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
            context);
    }

    /**
     * Delete a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param dnsServiceId ID of the DNS service.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, Void> beginDeleteDnsService(String resourceGroupName, String dnsServiceId,
        String privateCloudName) {
        return this.beginDeleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName).getSyncPoller();
    }

    /**
     * Delete a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param dnsServiceId ID of the DNS service.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, Void> beginDeleteDnsService(String resourceGroupName, String dnsServiceId,
        String privateCloudName, Context context) {
        return this.beginDeleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName, context)
            .getSyncPoller();
    }

    /**
     * Delete a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param dnsServiceId ID of the DNS service.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 deleteDnsServiceAsync(String resourceGroupName, String dnsServiceId, String privateCloudName) {
        return beginDeleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName).last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Delete a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param dnsServiceId ID of the DNS service.
     * @param privateCloudName Name of the private cloud.
     * @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 deleteDnsServiceAsync(String resourceGroupName, String dnsServiceId, String privateCloudName,
        Context context) {
        return beginDeleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName, context).last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Delete a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param dnsServiceId ID of the DNS service.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @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 deleteDnsService(String resourceGroupName, String dnsServiceId, String privateCloudName) {
        deleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName).block();
    }

    /**
     * Delete a WorkloadNetworkDnsService.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param dnsServiceId ID of the DNS service.
     * @param privateCloudName Name of the private cloud.
     * @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 deleteDnsService(String resourceGroupName, String dnsServiceId, String privateCloudName,
        Context context) {
        deleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName, context).block();
    }

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

    /**
     * List WorkloadNetworkDnsZone resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkDnsZone list operation along with {@link PagedResponse} on successful
     * completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> listDnsZonesSinglePageAsync(String resourceGroupName,
        String privateCloudName, 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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .listDnsZones(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
                resourceGroupName, privateCloudName, accept, context)
            .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
                res.getValue().value(), res.getValue().nextLink(), null));
    }

    /**
     * List WorkloadNetworkDnsZone resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkDnsZone list operation as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux listDnsZonesAsync(String resourceGroupName,
        String privateCloudName) {
        return new PagedFlux<>(() -> listDnsZonesSinglePageAsync(resourceGroupName, privateCloudName),
            nextLink -> listDnsZonesNextSinglePageAsync(nextLink));
    }

    /**
     * List WorkloadNetworkDnsZone resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkDnsZone list operation as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux listDnsZonesAsync(String resourceGroupName, String privateCloudName,
        Context context) {
        return new PagedFlux<>(() -> listDnsZonesSinglePageAsync(resourceGroupName, privateCloudName, context),
            nextLink -> listDnsZonesNextSinglePageAsync(nextLink, context));
    }

    /**
     * List WorkloadNetworkDnsZone resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkDnsZone list operation as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable listDnsZones(String resourceGroupName, String privateCloudName) {
        return new PagedIterable<>(listDnsZonesAsync(resourceGroupName, privateCloudName));
    }

    /**
     * List WorkloadNetworkDnsZone resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkDnsZone list operation as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable listDnsZones(String resourceGroupName, String privateCloudName,
        Context context) {
        return new PagedIterable<>(listDnsZonesAsync(resourceGroupName, privateCloudName, context));
    }

    /**
     * Get a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsZoneId ID of the DNS zone.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 WorkloadNetworkDnsZone along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> getDnsZoneWithResponseAsync(String resourceGroupName,
        String privateCloudName, String dnsZoneId) {
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (dnsZoneId == null) {
            return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.getDnsZone(this.client.getEndpoint(), this.client.getApiVersion(),
                this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsZoneId, accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsZoneId ID of the DNS zone.
     * @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 WorkloadNetworkDnsZone along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> getDnsZoneWithResponseAsync(String resourceGroupName,
        String privateCloudName, String dnsZoneId, 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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (dnsZoneId == null) {
            return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.getDnsZone(this.client.getEndpoint(), this.client.getApiVersion(),
            this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsZoneId, accept, context);
    }

    /**
     * Get a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsZoneId ID of the DNS zone.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 WorkloadNetworkDnsZone on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono getDnsZoneAsync(String resourceGroupName, String privateCloudName,
        String dnsZoneId) {
        return getDnsZoneWithResponseAsync(resourceGroupName, privateCloudName, dnsZoneId)
            .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Get a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsZoneId ID of the DNS zone.
     * @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 WorkloadNetworkDnsZone along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response getDnsZoneWithResponse(String resourceGroupName,
        String privateCloudName, String dnsZoneId, Context context) {
        return getDnsZoneWithResponseAsync(resourceGroupName, privateCloudName, dnsZoneId, context).block();
    }

    /**
     * Get a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsZoneId ID of the DNS zone.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 WorkloadNetworkDnsZone.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkDnsZoneInner getDnsZone(String resourceGroupName, String privateCloudName, String dnsZoneId) {
        return getDnsZoneWithResponse(resourceGroupName, privateCloudName, dnsZoneId, Context.NONE).getValue();
    }

    /**
     * Create a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsZoneId ID of the DNS zone.
     * @param workloadNetworkDnsZone Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX DNS Zone along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>> createDnsZoneWithResponseAsync(String resourceGroupName,
        String privateCloudName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) {
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (dnsZoneId == null) {
            return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null."));
        }
        if (workloadNetworkDnsZone == null) {
            return Mono.error(
                new IllegalArgumentException("Parameter workloadNetworkDnsZone is required and cannot be null."));
        } else {
            workloadNetworkDnsZone.validate();
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.createDnsZone(this.client.getEndpoint(), this.client.getApiVersion(),
                this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone,
                accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Create a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsZoneId ID of the DNS zone.
     * @param workloadNetworkDnsZone Resource create parameters.
     * @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 nSX DNS Zone along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>> createDnsZoneWithResponseAsync(String resourceGroupName,
        String privateCloudName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone,
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (dnsZoneId == null) {
            return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null."));
        }
        if (workloadNetworkDnsZone == null) {
            return Mono.error(
                new IllegalArgumentException("Parameter workloadNetworkDnsZone is required and cannot be null."));
        } else {
            workloadNetworkDnsZone.validate();
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.createDnsZone(this.client.getEndpoint(), this.client.getApiVersion(),
            this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone,
            accept, context);
    }

    /**
     * Create a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsZoneId ID of the DNS zone.
     * @param workloadNetworkDnsZone Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 nSX DNS Zone.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, WorkloadNetworkDnsZoneInner> beginCreateDnsZoneAsync(
        String resourceGroupName, String privateCloudName, String dnsZoneId,
        WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) {
        Mono>> mono
            = createDnsZoneWithResponseAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone);
        return this.client.getLroResult(mono,
            this.client.getHttpPipeline(), WorkloadNetworkDnsZoneInner.class, WorkloadNetworkDnsZoneInner.class,
            this.client.getContext());
    }

    /**
     * Create a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsZoneId ID of the DNS zone.
     * @param workloadNetworkDnsZone Resource create parameters.
     * @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 nSX DNS Zone.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, WorkloadNetworkDnsZoneInner> beginCreateDnsZoneAsync(
        String resourceGroupName, String privateCloudName, String dnsZoneId,
        WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context) {
        context = this.client.mergeContext(context);
        Mono>> mono = createDnsZoneWithResponseAsync(resourceGroupName, privateCloudName,
            dnsZoneId, workloadNetworkDnsZone, context);
        return this.client.getLroResult(mono,
            this.client.getHttpPipeline(), WorkloadNetworkDnsZoneInner.class, WorkloadNetworkDnsZoneInner.class,
            context);
    }

    /**
     * Create a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsZoneId ID of the DNS zone.
     * @param workloadNetworkDnsZone Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 nSX DNS Zone.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, WorkloadNetworkDnsZoneInner> beginCreateDnsZone(
        String resourceGroupName, String privateCloudName, String dnsZoneId,
        WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) {
        return this.beginCreateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone)
            .getSyncPoller();
    }

    /**
     * Create a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsZoneId ID of the DNS zone.
     * @param workloadNetworkDnsZone Resource create parameters.
     * @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 nSX DNS Zone.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, WorkloadNetworkDnsZoneInner> beginCreateDnsZone(
        String resourceGroupName, String privateCloudName, String dnsZoneId,
        WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context) {
        return this
            .beginCreateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context)
            .getSyncPoller();
    }

    /**
     * Create a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsZoneId ID of the DNS zone.
     * @param workloadNetworkDnsZone Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX DNS Zone on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono createDnsZoneAsync(String resourceGroupName, String privateCloudName,
        String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) {
        return beginCreateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone).last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Create a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsZoneId ID of the DNS zone.
     * @param workloadNetworkDnsZone Resource create parameters.
     * @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 nSX DNS Zone on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono createDnsZoneAsync(String resourceGroupName, String privateCloudName,
        String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context) {
        return beginCreateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context)
            .last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Create a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsZoneId ID of the DNS zone.
     * @param workloadNetworkDnsZone Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX DNS Zone.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkDnsZoneInner createDnsZone(String resourceGroupName, String privateCloudName,
        String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) {
        return createDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone).block();
    }

    /**
     * Create a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsZoneId ID of the DNS zone.
     * @param workloadNetworkDnsZone Resource create parameters.
     * @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 nSX DNS Zone.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkDnsZoneInner createDnsZone(String resourceGroupName, String privateCloudName,
        String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context) {
        return createDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context)
            .block();
    }

    /**
     * Update a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsZoneId ID of the DNS zone.
     * @param workloadNetworkDnsZone The resource properties to be updated.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX DNS Zone along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>> updateDnsZoneWithResponseAsync(String resourceGroupName,
        String privateCloudName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) {
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (dnsZoneId == null) {
            return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null."));
        }
        if (workloadNetworkDnsZone == null) {
            return Mono.error(
                new IllegalArgumentException("Parameter workloadNetworkDnsZone is required and cannot be null."));
        } else {
            workloadNetworkDnsZone.validate();
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.updateDnsZone(this.client.getEndpoint(), this.client.getApiVersion(),
                this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone,
                accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Update a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsZoneId ID of the DNS zone.
     * @param workloadNetworkDnsZone The resource properties to be updated.
     * @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 nSX DNS Zone along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>> updateDnsZoneWithResponseAsync(String resourceGroupName,
        String privateCloudName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone,
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (dnsZoneId == null) {
            return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null."));
        }
        if (workloadNetworkDnsZone == null) {
            return Mono.error(
                new IllegalArgumentException("Parameter workloadNetworkDnsZone is required and cannot be null."));
        } else {
            workloadNetworkDnsZone.validate();
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.updateDnsZone(this.client.getEndpoint(), this.client.getApiVersion(),
            this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone,
            accept, context);
    }

    /**
     * Update a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsZoneId ID of the DNS zone.
     * @param workloadNetworkDnsZone The resource properties to be updated.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 nSX DNS Zone.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, WorkloadNetworkDnsZoneInner> beginUpdateDnsZoneAsync(
        String resourceGroupName, String privateCloudName, String dnsZoneId,
        WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) {
        Mono>> mono
            = updateDnsZoneWithResponseAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone);
        return this.client.getLroResult(mono,
            this.client.getHttpPipeline(), WorkloadNetworkDnsZoneInner.class, WorkloadNetworkDnsZoneInner.class,
            this.client.getContext());
    }

    /**
     * Update a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsZoneId ID of the DNS zone.
     * @param workloadNetworkDnsZone The resource properties to be updated.
     * @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 nSX DNS Zone.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, WorkloadNetworkDnsZoneInner> beginUpdateDnsZoneAsync(
        String resourceGroupName, String privateCloudName, String dnsZoneId,
        WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context) {
        context = this.client.mergeContext(context);
        Mono>> mono = updateDnsZoneWithResponseAsync(resourceGroupName, privateCloudName,
            dnsZoneId, workloadNetworkDnsZone, context);
        return this.client.getLroResult(mono,
            this.client.getHttpPipeline(), WorkloadNetworkDnsZoneInner.class, WorkloadNetworkDnsZoneInner.class,
            context);
    }

    /**
     * Update a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsZoneId ID of the DNS zone.
     * @param workloadNetworkDnsZone The resource properties to be updated.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 nSX DNS Zone.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, WorkloadNetworkDnsZoneInner> beginUpdateDnsZone(
        String resourceGroupName, String privateCloudName, String dnsZoneId,
        WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) {
        return this.beginUpdateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone)
            .getSyncPoller();
    }

    /**
     * Update a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsZoneId ID of the DNS zone.
     * @param workloadNetworkDnsZone The resource properties to be updated.
     * @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 nSX DNS Zone.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, WorkloadNetworkDnsZoneInner> beginUpdateDnsZone(
        String resourceGroupName, String privateCloudName, String dnsZoneId,
        WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context) {
        return this
            .beginUpdateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context)
            .getSyncPoller();
    }

    /**
     * Update a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsZoneId ID of the DNS zone.
     * @param workloadNetworkDnsZone The resource properties to be updated.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX DNS Zone on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono updateDnsZoneAsync(String resourceGroupName, String privateCloudName,
        String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) {
        return beginUpdateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone).last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Update a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsZoneId ID of the DNS zone.
     * @param workloadNetworkDnsZone The resource properties to be updated.
     * @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 nSX DNS Zone on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono updateDnsZoneAsync(String resourceGroupName, String privateCloudName,
        String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context) {
        return beginUpdateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context)
            .last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Update a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsZoneId ID of the DNS zone.
     * @param workloadNetworkDnsZone The resource properties to be updated.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX DNS Zone.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkDnsZoneInner updateDnsZone(String resourceGroupName, String privateCloudName,
        String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) {
        return updateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone).block();
    }

    /**
     * Update a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param dnsZoneId ID of the DNS zone.
     * @param workloadNetworkDnsZone The resource properties to be updated.
     * @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 nSX DNS Zone.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkDnsZoneInner updateDnsZone(String resourceGroupName, String privateCloudName,
        String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context) {
        return updateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context)
            .block();
    }

    /**
     * Delete a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param dnsZoneId ID of the DNS zone.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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>> deleteDnsZoneWithResponseAsync(String resourceGroupName, String dnsZoneId,
        String privateCloudName) {
        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 (dnsZoneId == null) {
            return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null."));
        }
        if (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.deleteDnsZone(this.client.getEndpoint(), this.client.getApiVersion(),
                this.client.getSubscriptionId(), resourceGroupName, dnsZoneId, privateCloudName, accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Delete a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param dnsZoneId ID of the DNS zone.
     * @param privateCloudName Name of the private cloud.
     * @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>> deleteDnsZoneWithResponseAsync(String resourceGroupName, String dnsZoneId,
        String privateCloudName, 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 (dnsZoneId == null) {
            return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null."));
        }
        if (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.deleteDnsZone(this.client.getEndpoint(), this.client.getApiVersion(),
            this.client.getSubscriptionId(), resourceGroupName, dnsZoneId, privateCloudName, accept, context);
    }

    /**
     * Delete a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param dnsZoneId ID of the DNS zone.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link PollerFlux} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, Void> beginDeleteDnsZoneAsync(String resourceGroupName, String dnsZoneId,
        String privateCloudName) {
        Mono>> mono
            = deleteDnsZoneWithResponseAsync(resourceGroupName, dnsZoneId, privateCloudName);
        return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
            this.client.getContext());
    }

    /**
     * Delete a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param dnsZoneId ID of the DNS zone.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link PollerFlux} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, Void> beginDeleteDnsZoneAsync(String resourceGroupName, String dnsZoneId,
        String privateCloudName, Context context) {
        context = this.client.mergeContext(context);
        Mono>> mono
            = deleteDnsZoneWithResponseAsync(resourceGroupName, dnsZoneId, privateCloudName, context);
        return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
            context);
    }

    /**
     * Delete a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param dnsZoneId ID of the DNS zone.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, Void> beginDeleteDnsZone(String resourceGroupName, String dnsZoneId,
        String privateCloudName) {
        return this.beginDeleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName).getSyncPoller();
    }

    /**
     * Delete a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param dnsZoneId ID of the DNS zone.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, Void> beginDeleteDnsZone(String resourceGroupName, String dnsZoneId,
        String privateCloudName, Context context) {
        return this.beginDeleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName, context).getSyncPoller();
    }

    /**
     * Delete a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param dnsZoneId ID of the DNS zone.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 deleteDnsZoneAsync(String resourceGroupName, String dnsZoneId, String privateCloudName) {
        return beginDeleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName).last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Delete a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param dnsZoneId ID of the DNS zone.
     * @param privateCloudName Name of the private cloud.
     * @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 deleteDnsZoneAsync(String resourceGroupName, String dnsZoneId, String privateCloudName,
        Context context) {
        return beginDeleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName, context).last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Delete a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param dnsZoneId ID of the DNS zone.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @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 deleteDnsZone(String resourceGroupName, String dnsZoneId, String privateCloudName) {
        deleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName).block();
    }

    /**
     * Delete a WorkloadNetworkDnsZone.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param dnsZoneId ID of the DNS zone.
     * @param privateCloudName Name of the private cloud.
     * @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 deleteDnsZone(String resourceGroupName, String dnsZoneId, String privateCloudName, Context context) {
        deleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName, context).block();
    }

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

    /**
     * List WorkloadNetworkGateway resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkGateway list operation along with {@link PagedResponse} on successful
     * completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> listGatewaysSinglePageAsync(String resourceGroupName,
        String privateCloudName, 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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .listGateways(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
                resourceGroupName, privateCloudName, accept, context)
            .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
                res.getValue().value(), res.getValue().nextLink(), null));
    }

    /**
     * List WorkloadNetworkGateway resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkGateway list operation as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux listGatewaysAsync(String resourceGroupName,
        String privateCloudName) {
        return new PagedFlux<>(() -> listGatewaysSinglePageAsync(resourceGroupName, privateCloudName),
            nextLink -> listGatewaysNextSinglePageAsync(nextLink));
    }

    /**
     * List WorkloadNetworkGateway resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkGateway list operation as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux listGatewaysAsync(String resourceGroupName, String privateCloudName,
        Context context) {
        return new PagedFlux<>(() -> listGatewaysSinglePageAsync(resourceGroupName, privateCloudName, context),
            nextLink -> listGatewaysNextSinglePageAsync(nextLink, context));
    }

    /**
     * List WorkloadNetworkGateway resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkGateway list operation as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable listGateways(String resourceGroupName, String privateCloudName) {
        return new PagedIterable<>(listGatewaysAsync(resourceGroupName, privateCloudName));
    }

    /**
     * List WorkloadNetworkGateway resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkGateway list operation as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable listGateways(String resourceGroupName, String privateCloudName,
        Context context) {
        return new PagedIterable<>(listGatewaysAsync(resourceGroupName, privateCloudName, context));
    }

    /**
     * Get a WorkloadNetworkGateway.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param gatewayId The ID of the NSX Gateway.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 WorkloadNetworkGateway along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> getGatewayWithResponseAsync(String resourceGroupName,
        String privateCloudName, String gatewayId) {
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (gatewayId == null) {
            return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.getGateway(this.client.getEndpoint(), this.client.getApiVersion(),
                this.client.getSubscriptionId(), resourceGroupName, privateCloudName, gatewayId, accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get a WorkloadNetworkGateway.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param gatewayId The ID of the NSX Gateway.
     * @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 WorkloadNetworkGateway along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> getGatewayWithResponseAsync(String resourceGroupName,
        String privateCloudName, String gatewayId, 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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (gatewayId == null) {
            return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.getGateway(this.client.getEndpoint(), this.client.getApiVersion(),
            this.client.getSubscriptionId(), resourceGroupName, privateCloudName, gatewayId, accept, context);
    }

    /**
     * Get a WorkloadNetworkGateway.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param gatewayId The ID of the NSX Gateway.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 WorkloadNetworkGateway on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono getGatewayAsync(String resourceGroupName, String privateCloudName,
        String gatewayId) {
        return getGatewayWithResponseAsync(resourceGroupName, privateCloudName, gatewayId)
            .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Get a WorkloadNetworkGateway.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param gatewayId The ID of the NSX Gateway.
     * @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 WorkloadNetworkGateway along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response getGatewayWithResponse(String resourceGroupName,
        String privateCloudName, String gatewayId, Context context) {
        return getGatewayWithResponseAsync(resourceGroupName, privateCloudName, gatewayId, context).block();
    }

    /**
     * Get a WorkloadNetworkGateway.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param gatewayId The ID of the NSX Gateway.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 WorkloadNetworkGateway.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkGatewayInner getGateway(String resourceGroupName, String privateCloudName, String gatewayId) {
        return getGatewayWithResponse(resourceGroupName, privateCloudName, gatewayId, Context.NONE).getValue();
    }

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

    /**
     * List WorkloadNetworkPortMirroring resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkPortMirroring list operation along with {@link PagedResponse} on
     * successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>
        listPortMirroringSinglePageAsync(String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .listPortMirroring(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
                resourceGroupName, privateCloudName, accept, context)
            .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
                res.getValue().value(), res.getValue().nextLink(), null));
    }

    /**
     * List WorkloadNetworkPortMirroring resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkPortMirroring list operation as paginated response with
     * {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux listPortMirroringAsync(String resourceGroupName,
        String privateCloudName) {
        return new PagedFlux<>(() -> listPortMirroringSinglePageAsync(resourceGroupName, privateCloudName),
            nextLink -> listPortMirroringNextSinglePageAsync(nextLink));
    }

    /**
     * List WorkloadNetworkPortMirroring resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkPortMirroring list operation as paginated response with
     * {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux listPortMirroringAsync(String resourceGroupName,
        String privateCloudName, Context context) {
        return new PagedFlux<>(() -> listPortMirroringSinglePageAsync(resourceGroupName, privateCloudName, context),
            nextLink -> listPortMirroringNextSinglePageAsync(nextLink, context));
    }

    /**
     * List WorkloadNetworkPortMirroring resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkPortMirroring list operation as paginated response with
     * {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable listPortMirroring(String resourceGroupName,
        String privateCloudName) {
        return new PagedIterable<>(listPortMirroringAsync(resourceGroupName, privateCloudName));
    }

    /**
     * List WorkloadNetworkPortMirroring resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkPortMirroring list operation as paginated response with
     * {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable listPortMirroring(String resourceGroupName,
        String privateCloudName, Context context) {
        return new PagedIterable<>(listPortMirroringAsync(resourceGroupName, privateCloudName, context));
    }

    /**
     * Get a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 WorkloadNetworkPortMirroring along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>
        getPortMirroringWithResponseAsync(String resourceGroupName, String privateCloudName, String portMirroringId) {
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (portMirroringId == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.getPortMirroring(this.client.getEndpoint(), this.client.getApiVersion(),
                this.client.getSubscriptionId(), resourceGroupName, privateCloudName, portMirroringId, accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @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 WorkloadNetworkPortMirroring along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> getPortMirroringWithResponseAsync(
        String resourceGroupName, String privateCloudName, String portMirroringId, 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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (portMirroringId == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.getPortMirroring(this.client.getEndpoint(), this.client.getApiVersion(),
            this.client.getSubscriptionId(), resourceGroupName, privateCloudName, portMirroringId, accept, context);
    }

    /**
     * Get a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 WorkloadNetworkPortMirroring on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono getPortMirroringAsync(String resourceGroupName,
        String privateCloudName, String portMirroringId) {
        return getPortMirroringWithResponseAsync(resourceGroupName, privateCloudName, portMirroringId)
            .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Get a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @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 WorkloadNetworkPortMirroring along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response getPortMirroringWithResponse(String resourceGroupName,
        String privateCloudName, String portMirroringId, Context context) {
        return getPortMirroringWithResponseAsync(resourceGroupName, privateCloudName, portMirroringId, context).block();
    }

    /**
     * Get a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 WorkloadNetworkPortMirroring.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkPortMirroringInner getPortMirroring(String resourceGroupName, String privateCloudName,
        String portMirroringId) {
        return getPortMirroringWithResponse(resourceGroupName, privateCloudName, portMirroringId, Context.NONE)
            .getValue();
    }

    /**
     * Create a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @param workloadNetworkPortMirroring Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX Port Mirroring along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>> createPortMirroringWithResponseAsync(String resourceGroupName,
        String privateCloudName, String portMirroringId,
        WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) {
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (portMirroringId == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null."));
        }
        if (workloadNetworkPortMirroring == null) {
            return Mono.error(
                new IllegalArgumentException("Parameter workloadNetworkPortMirroring is required and cannot be null."));
        } else {
            workloadNetworkPortMirroring.validate();
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.createPortMirroring(this.client.getEndpoint(), this.client.getApiVersion(),
                this.client.getSubscriptionId(), resourceGroupName, privateCloudName, portMirroringId,
                workloadNetworkPortMirroring, accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Create a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @param workloadNetworkPortMirroring Resource create parameters.
     * @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 nSX Port Mirroring along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>> createPortMirroringWithResponseAsync(String resourceGroupName,
        String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring,
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (portMirroringId == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null."));
        }
        if (workloadNetworkPortMirroring == null) {
            return Mono.error(
                new IllegalArgumentException("Parameter workloadNetworkPortMirroring is required and cannot be null."));
        } else {
            workloadNetworkPortMirroring.validate();
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.createPortMirroring(this.client.getEndpoint(), this.client.getApiVersion(),
            this.client.getSubscriptionId(), resourceGroupName, privateCloudName, portMirroringId,
            workloadNetworkPortMirroring, accept, context);
    }

    /**
     * Create a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @param workloadNetworkPortMirroring Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 nSX Port Mirroring.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, WorkloadNetworkPortMirroringInner>
        beginCreatePortMirroringAsync(String resourceGroupName, String privateCloudName, String portMirroringId,
            WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) {
        Mono>> mono = createPortMirroringWithResponseAsync(resourceGroupName,
            privateCloudName, portMirroringId, workloadNetworkPortMirroring);
        return this.client.getLroResult(mono,
            this.client.getHttpPipeline(), WorkloadNetworkPortMirroringInner.class,
            WorkloadNetworkPortMirroringInner.class, this.client.getContext());
    }

    /**
     * Create a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @param workloadNetworkPortMirroring Resource create parameters.
     * @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 nSX Port Mirroring.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, WorkloadNetworkPortMirroringInner>
        beginCreatePortMirroringAsync(String resourceGroupName, String privateCloudName, String portMirroringId,
            WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context) {
        context = this.client.mergeContext(context);
        Mono>> mono = createPortMirroringWithResponseAsync(resourceGroupName,
            privateCloudName, portMirroringId, workloadNetworkPortMirroring, context);
        return this.client.getLroResult(mono,
            this.client.getHttpPipeline(), WorkloadNetworkPortMirroringInner.class,
            WorkloadNetworkPortMirroringInner.class, context);
    }

    /**
     * Create a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @param workloadNetworkPortMirroring Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 nSX Port Mirroring.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, WorkloadNetworkPortMirroringInner>
        beginCreatePortMirroring(String resourceGroupName, String privateCloudName, String portMirroringId,
            WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) {
        return this
            .beginCreatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId,
                workloadNetworkPortMirroring)
            .getSyncPoller();
    }

    /**
     * Create a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @param workloadNetworkPortMirroring Resource create parameters.
     * @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 nSX Port Mirroring.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, WorkloadNetworkPortMirroringInner>
        beginCreatePortMirroring(String resourceGroupName, String privateCloudName, String portMirroringId,
            WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context) {
        return this
            .beginCreatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId,
                workloadNetworkPortMirroring, context)
            .getSyncPoller();
    }

    /**
     * Create a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @param workloadNetworkPortMirroring Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX Port Mirroring on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono createPortMirroringAsync(String resourceGroupName,
        String privateCloudName, String portMirroringId,
        WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) {
        return beginCreatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId,
            workloadNetworkPortMirroring).last().flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Create a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @param workloadNetworkPortMirroring Resource create parameters.
     * @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 nSX Port Mirroring on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono createPortMirroringAsync(String resourceGroupName,
        String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring,
        Context context) {
        return beginCreatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId,
            workloadNetworkPortMirroring, context).last().flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Create a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @param workloadNetworkPortMirroring Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX Port Mirroring.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkPortMirroringInner createPortMirroring(String resourceGroupName, String privateCloudName,
        String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) {
        return createPortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId,
            workloadNetworkPortMirroring).block();
    }

    /**
     * Create a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @param workloadNetworkPortMirroring Resource create parameters.
     * @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 nSX Port Mirroring.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkPortMirroringInner createPortMirroring(String resourceGroupName, String privateCloudName,
        String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context) {
        return createPortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId,
            workloadNetworkPortMirroring, context).block();
    }

    /**
     * Update a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @param workloadNetworkPortMirroring The resource properties to be updated.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX Port Mirroring along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>> updatePortMirroringWithResponseAsync(String resourceGroupName,
        String privateCloudName, String portMirroringId,
        WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) {
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (portMirroringId == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null."));
        }
        if (workloadNetworkPortMirroring == null) {
            return Mono.error(
                new IllegalArgumentException("Parameter workloadNetworkPortMirroring is required and cannot be null."));
        } else {
            workloadNetworkPortMirroring.validate();
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.updatePortMirroring(this.client.getEndpoint(), this.client.getApiVersion(),
                this.client.getSubscriptionId(), resourceGroupName, privateCloudName, portMirroringId,
                workloadNetworkPortMirroring, accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Update a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @param workloadNetworkPortMirroring The resource properties to be updated.
     * @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 nSX Port Mirroring along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>> updatePortMirroringWithResponseAsync(String resourceGroupName,
        String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring,
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (portMirroringId == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null."));
        }
        if (workloadNetworkPortMirroring == null) {
            return Mono.error(
                new IllegalArgumentException("Parameter workloadNetworkPortMirroring is required and cannot be null."));
        } else {
            workloadNetworkPortMirroring.validate();
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.updatePortMirroring(this.client.getEndpoint(), this.client.getApiVersion(),
            this.client.getSubscriptionId(), resourceGroupName, privateCloudName, portMirroringId,
            workloadNetworkPortMirroring, accept, context);
    }

    /**
     * Update a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @param workloadNetworkPortMirroring The resource properties to be updated.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 nSX Port Mirroring.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, WorkloadNetworkPortMirroringInner>
        beginUpdatePortMirroringAsync(String resourceGroupName, String privateCloudName, String portMirroringId,
            WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) {
        Mono>> mono = updatePortMirroringWithResponseAsync(resourceGroupName,
            privateCloudName, portMirroringId, workloadNetworkPortMirroring);
        return this.client.getLroResult(mono,
            this.client.getHttpPipeline(), WorkloadNetworkPortMirroringInner.class,
            WorkloadNetworkPortMirroringInner.class, this.client.getContext());
    }

    /**
     * Update a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @param workloadNetworkPortMirroring The resource properties to be updated.
     * @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 nSX Port Mirroring.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, WorkloadNetworkPortMirroringInner>
        beginUpdatePortMirroringAsync(String resourceGroupName, String privateCloudName, String portMirroringId,
            WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context) {
        context = this.client.mergeContext(context);
        Mono>> mono = updatePortMirroringWithResponseAsync(resourceGroupName,
            privateCloudName, portMirroringId, workloadNetworkPortMirroring, context);
        return this.client.getLroResult(mono,
            this.client.getHttpPipeline(), WorkloadNetworkPortMirroringInner.class,
            WorkloadNetworkPortMirroringInner.class, context);
    }

    /**
     * Update a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @param workloadNetworkPortMirroring The resource properties to be updated.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 nSX Port Mirroring.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, WorkloadNetworkPortMirroringInner>
        beginUpdatePortMirroring(String resourceGroupName, String privateCloudName, String portMirroringId,
            WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) {
        return this
            .beginUpdatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId,
                workloadNetworkPortMirroring)
            .getSyncPoller();
    }

    /**
     * Update a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @param workloadNetworkPortMirroring The resource properties to be updated.
     * @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 nSX Port Mirroring.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, WorkloadNetworkPortMirroringInner>
        beginUpdatePortMirroring(String resourceGroupName, String privateCloudName, String portMirroringId,
            WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context) {
        return this
            .beginUpdatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId,
                workloadNetworkPortMirroring, context)
            .getSyncPoller();
    }

    /**
     * Update a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @param workloadNetworkPortMirroring The resource properties to be updated.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX Port Mirroring on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono updatePortMirroringAsync(String resourceGroupName,
        String privateCloudName, String portMirroringId,
        WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) {
        return beginUpdatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId,
            workloadNetworkPortMirroring).last().flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Update a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @param workloadNetworkPortMirroring The resource properties to be updated.
     * @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 nSX Port Mirroring on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono updatePortMirroringAsync(String resourceGroupName,
        String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring,
        Context context) {
        return beginUpdatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId,
            workloadNetworkPortMirroring, context).last().flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Update a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @param workloadNetworkPortMirroring The resource properties to be updated.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX Port Mirroring.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkPortMirroringInner updatePortMirroring(String resourceGroupName, String privateCloudName,
        String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) {
        return updatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId,
            workloadNetworkPortMirroring).block();
    }

    /**
     * Update a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @param workloadNetworkPortMirroring The resource properties to be updated.
     * @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 nSX Port Mirroring.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkPortMirroringInner updatePortMirroring(String resourceGroupName, String privateCloudName,
        String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context) {
        return updatePortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId,
            workloadNetworkPortMirroring, context).block();
    }

    /**
     * Delete a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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>> deletePortMirroringWithResponseAsync(String resourceGroupName,
        String portMirroringId, String privateCloudName) {
        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 (portMirroringId == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null."));
        }
        if (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.deletePortMirroring(this.client.getEndpoint(), this.client.getApiVersion(),
                this.client.getSubscriptionId(), resourceGroupName, portMirroringId, privateCloudName, accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Delete a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @param privateCloudName Name of the private cloud.
     * @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>> deletePortMirroringWithResponseAsync(String resourceGroupName,
        String portMirroringId, String privateCloudName, 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 (portMirroringId == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null."));
        }
        if (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.deletePortMirroring(this.client.getEndpoint(), this.client.getApiVersion(),
            this.client.getSubscriptionId(), resourceGroupName, portMirroringId, privateCloudName, accept, context);
    }

    /**
     * Delete a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link PollerFlux} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, Void> beginDeletePortMirroringAsync(String resourceGroupName,
        String portMirroringId, String privateCloudName) {
        Mono>> mono
            = deletePortMirroringWithResponseAsync(resourceGroupName, portMirroringId, privateCloudName);
        return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
            this.client.getContext());
    }

    /**
     * Delete a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link PollerFlux} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, Void> beginDeletePortMirroringAsync(String resourceGroupName,
        String portMirroringId, String privateCloudName, Context context) {
        context = this.client.mergeContext(context);
        Mono>> mono
            = deletePortMirroringWithResponseAsync(resourceGroupName, portMirroringId, privateCloudName, context);
        return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
            context);
    }

    /**
     * Delete a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, Void> beginDeletePortMirroring(String resourceGroupName, String portMirroringId,
        String privateCloudName) {
        return this.beginDeletePortMirroringAsync(resourceGroupName, portMirroringId, privateCloudName).getSyncPoller();
    }

    /**
     * Delete a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, Void> beginDeletePortMirroring(String resourceGroupName, String portMirroringId,
        String privateCloudName, Context context) {
        return this.beginDeletePortMirroringAsync(resourceGroupName, portMirroringId, privateCloudName, context)
            .getSyncPoller();
    }

    /**
     * Delete a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 deletePortMirroringAsync(String resourceGroupName, String portMirroringId,
        String privateCloudName) {
        return beginDeletePortMirroringAsync(resourceGroupName, portMirroringId, privateCloudName).last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Delete a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @param privateCloudName Name of the private cloud.
     * @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 deletePortMirroringAsync(String resourceGroupName, String portMirroringId,
        String privateCloudName, Context context) {
        return beginDeletePortMirroringAsync(resourceGroupName, portMirroringId, privateCloudName, context).last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Delete a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @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 deletePortMirroring(String resourceGroupName, String portMirroringId, String privateCloudName) {
        deletePortMirroringAsync(resourceGroupName, portMirroringId, privateCloudName).block();
    }

    /**
     * Delete a WorkloadNetworkPortMirroring.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param portMirroringId ID of the NSX port mirroring profile.
     * @param privateCloudName Name of the private cloud.
     * @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 deletePortMirroring(String resourceGroupName, String portMirroringId, String privateCloudName,
        Context context) {
        deletePortMirroringAsync(resourceGroupName, portMirroringId, privateCloudName, context).block();
    }

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

    /**
     * List WorkloadNetworkPublicIP resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkPublicIP list operation along with {@link PagedResponse} on successful
     * completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> listPublicIPsSinglePageAsync(String resourceGroupName,
        String privateCloudName, 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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .listPublicIPs(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
                resourceGroupName, privateCloudName, accept, context)
            .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
                res.getValue().value(), res.getValue().nextLink(), null));
    }

    /**
     * List WorkloadNetworkPublicIP resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkPublicIP list operation as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux listPublicIPsAsync(String resourceGroupName,
        String privateCloudName) {
        return new PagedFlux<>(() -> listPublicIPsSinglePageAsync(resourceGroupName, privateCloudName),
            nextLink -> listPublicIPsNextSinglePageAsync(nextLink));
    }

    /**
     * List WorkloadNetworkPublicIP resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkPublicIP list operation as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux listPublicIPsAsync(String resourceGroupName,
        String privateCloudName, Context context) {
        return new PagedFlux<>(() -> listPublicIPsSinglePageAsync(resourceGroupName, privateCloudName, context),
            nextLink -> listPublicIPsNextSinglePageAsync(nextLink, context));
    }

    /**
     * List WorkloadNetworkPublicIP resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkPublicIP list operation as paginated response with
     * {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable listPublicIPs(String resourceGroupName,
        String privateCloudName) {
        return new PagedIterable<>(listPublicIPsAsync(resourceGroupName, privateCloudName));
    }

    /**
     * List WorkloadNetworkPublicIP resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkPublicIP list operation as paginated response with
     * {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable listPublicIPs(String resourceGroupName, String privateCloudName,
        Context context) {
        return new PagedIterable<>(listPublicIPsAsync(resourceGroupName, privateCloudName, context));
    }

    /**
     * Get a WorkloadNetworkPublicIP.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param publicIpId ID of the DNS zone.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 WorkloadNetworkPublicIP along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> getPublicIpWithResponseAsync(String resourceGroupName,
        String privateCloudName, String publicIpId) {
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (publicIpId == null) {
            return Mono.error(new IllegalArgumentException("Parameter publicIpId is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.getPublicIp(this.client.getEndpoint(), this.client.getApiVersion(),
                this.client.getSubscriptionId(), resourceGroupName, privateCloudName, publicIpId, accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get a WorkloadNetworkPublicIP.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param publicIpId ID of the DNS zone.
     * @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 WorkloadNetworkPublicIP along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> getPublicIpWithResponseAsync(String resourceGroupName,
        String privateCloudName, String publicIpId, 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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (publicIpId == null) {
            return Mono.error(new IllegalArgumentException("Parameter publicIpId is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.getPublicIp(this.client.getEndpoint(), this.client.getApiVersion(),
            this.client.getSubscriptionId(), resourceGroupName, privateCloudName, publicIpId, accept, context);
    }

    /**
     * Get a WorkloadNetworkPublicIP.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param publicIpId ID of the DNS zone.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 WorkloadNetworkPublicIP on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono getPublicIpAsync(String resourceGroupName, String privateCloudName,
        String publicIpId) {
        return getPublicIpWithResponseAsync(resourceGroupName, privateCloudName, publicIpId)
            .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Get a WorkloadNetworkPublicIP.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param publicIpId ID of the DNS zone.
     * @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 WorkloadNetworkPublicIP along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response getPublicIpWithResponse(String resourceGroupName,
        String privateCloudName, String publicIpId, Context context) {
        return getPublicIpWithResponseAsync(resourceGroupName, privateCloudName, publicIpId, context).block();
    }

    /**
     * Get a WorkloadNetworkPublicIP.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param publicIpId ID of the DNS zone.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 WorkloadNetworkPublicIP.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkPublicIpInner getPublicIp(String resourceGroupName, String privateCloudName,
        String publicIpId) {
        return getPublicIpWithResponse(resourceGroupName, privateCloudName, publicIpId, Context.NONE).getValue();
    }

    /**
     * Create a WorkloadNetworkPublicIP.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param publicIpId ID of the DNS zone.
     * @param workloadNetworkPublicIp Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX Public IP Block along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>> createPublicIpWithResponseAsync(String resourceGroupName,
        String privateCloudName, String publicIpId, WorkloadNetworkPublicIpInner workloadNetworkPublicIp) {
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (publicIpId == null) {
            return Mono.error(new IllegalArgumentException("Parameter publicIpId is required and cannot be null."));
        }
        if (workloadNetworkPublicIp == null) {
            return Mono.error(
                new IllegalArgumentException("Parameter workloadNetworkPublicIp is required and cannot be null."));
        } else {
            workloadNetworkPublicIp.validate();
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.createPublicIp(this.client.getEndpoint(), this.client.getApiVersion(),
                this.client.getSubscriptionId(), resourceGroupName, privateCloudName, publicIpId,
                workloadNetworkPublicIp, accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Create a WorkloadNetworkPublicIP.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param publicIpId ID of the DNS zone.
     * @param workloadNetworkPublicIp Resource create parameters.
     * @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 nSX Public IP Block along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>> createPublicIpWithResponseAsync(String resourceGroupName,
        String privateCloudName, String publicIpId, WorkloadNetworkPublicIpInner workloadNetworkPublicIp,
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (publicIpId == null) {
            return Mono.error(new IllegalArgumentException("Parameter publicIpId is required and cannot be null."));
        }
        if (workloadNetworkPublicIp == null) {
            return Mono.error(
                new IllegalArgumentException("Parameter workloadNetworkPublicIp is required and cannot be null."));
        } else {
            workloadNetworkPublicIp.validate();
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.createPublicIp(this.client.getEndpoint(), this.client.getApiVersion(),
            this.client.getSubscriptionId(), resourceGroupName, privateCloudName, publicIpId, workloadNetworkPublicIp,
            accept, context);
    }

    /**
     * Create a WorkloadNetworkPublicIP.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param publicIpId ID of the DNS zone.
     * @param workloadNetworkPublicIp Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 nSX Public IP Block.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, WorkloadNetworkPublicIpInner> beginCreatePublicIpAsync(
        String resourceGroupName, String privateCloudName, String publicIpId,
        WorkloadNetworkPublicIpInner workloadNetworkPublicIp) {
        Mono>> mono
            = createPublicIpWithResponseAsync(resourceGroupName, privateCloudName, publicIpId, workloadNetworkPublicIp);
        return this.client.getLroResult(mono,
            this.client.getHttpPipeline(), WorkloadNetworkPublicIpInner.class, WorkloadNetworkPublicIpInner.class,
            this.client.getContext());
    }

    /**
     * Create a WorkloadNetworkPublicIP.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param publicIpId ID of the DNS zone.
     * @param workloadNetworkPublicIp Resource create parameters.
     * @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 nSX Public IP Block.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, WorkloadNetworkPublicIpInner> beginCreatePublicIpAsync(
        String resourceGroupName, String privateCloudName, String publicIpId,
        WorkloadNetworkPublicIpInner workloadNetworkPublicIp, Context context) {
        context = this.client.mergeContext(context);
        Mono>> mono = createPublicIpWithResponseAsync(resourceGroupName, privateCloudName,
            publicIpId, workloadNetworkPublicIp, context);
        return this.client.getLroResult(mono,
            this.client.getHttpPipeline(), WorkloadNetworkPublicIpInner.class, WorkloadNetworkPublicIpInner.class,
            context);
    }

    /**
     * Create a WorkloadNetworkPublicIP.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param publicIpId ID of the DNS zone.
     * @param workloadNetworkPublicIp Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 nSX Public IP Block.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, WorkloadNetworkPublicIpInner> beginCreatePublicIp(
        String resourceGroupName, String privateCloudName, String publicIpId,
        WorkloadNetworkPublicIpInner workloadNetworkPublicIp) {
        return this.beginCreatePublicIpAsync(resourceGroupName, privateCloudName, publicIpId, workloadNetworkPublicIp)
            .getSyncPoller();
    }

    /**
     * Create a WorkloadNetworkPublicIP.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param publicIpId ID of the DNS zone.
     * @param workloadNetworkPublicIp Resource create parameters.
     * @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 nSX Public IP Block.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, WorkloadNetworkPublicIpInner> beginCreatePublicIp(
        String resourceGroupName, String privateCloudName, String publicIpId,
        WorkloadNetworkPublicIpInner workloadNetworkPublicIp, Context context) {
        return this
            .beginCreatePublicIpAsync(resourceGroupName, privateCloudName, publicIpId, workloadNetworkPublicIp, context)
            .getSyncPoller();
    }

    /**
     * Create a WorkloadNetworkPublicIP.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param publicIpId ID of the DNS zone.
     * @param workloadNetworkPublicIp Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX Public IP Block on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono createPublicIpAsync(String resourceGroupName, String privateCloudName,
        String publicIpId, WorkloadNetworkPublicIpInner workloadNetworkPublicIp) {
        return beginCreatePublicIpAsync(resourceGroupName, privateCloudName, publicIpId, workloadNetworkPublicIp).last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Create a WorkloadNetworkPublicIP.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param publicIpId ID of the DNS zone.
     * @param workloadNetworkPublicIp Resource create parameters.
     * @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 nSX Public IP Block on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono createPublicIpAsync(String resourceGroupName, String privateCloudName,
        String publicIpId, WorkloadNetworkPublicIpInner workloadNetworkPublicIp, Context context) {
        return beginCreatePublicIpAsync(resourceGroupName, privateCloudName, publicIpId, workloadNetworkPublicIp,
            context).last().flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Create a WorkloadNetworkPublicIP.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param publicIpId ID of the DNS zone.
     * @param workloadNetworkPublicIp Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX Public IP Block.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkPublicIpInner createPublicIp(String resourceGroupName, String privateCloudName,
        String publicIpId, WorkloadNetworkPublicIpInner workloadNetworkPublicIp) {
        return createPublicIpAsync(resourceGroupName, privateCloudName, publicIpId, workloadNetworkPublicIp).block();
    }

    /**
     * Create a WorkloadNetworkPublicIP.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param publicIpId ID of the DNS zone.
     * @param workloadNetworkPublicIp Resource create parameters.
     * @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 nSX Public IP Block.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkPublicIpInner createPublicIp(String resourceGroupName, String privateCloudName,
        String publicIpId, WorkloadNetworkPublicIpInner workloadNetworkPublicIp, Context context) {
        return createPublicIpAsync(resourceGroupName, privateCloudName, publicIpId, workloadNetworkPublicIp, context)
            .block();
    }

    /**
     * Delete a WorkloadNetworkPublicIP.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param publicIpId ID of the DNS zone.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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>> deletePublicIpWithResponseAsync(String resourceGroupName,
        String publicIpId, String privateCloudName) {
        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 (publicIpId == null) {
            return Mono.error(new IllegalArgumentException("Parameter publicIpId is required and cannot be null."));
        }
        if (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.deletePublicIp(this.client.getEndpoint(), this.client.getApiVersion(),
                this.client.getSubscriptionId(), resourceGroupName, publicIpId, privateCloudName, accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Delete a WorkloadNetworkPublicIP.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param publicIpId ID of the DNS zone.
     * @param privateCloudName Name of the private cloud.
     * @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>> deletePublicIpWithResponseAsync(String resourceGroupName,
        String publicIpId, String privateCloudName, 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 (publicIpId == null) {
            return Mono.error(new IllegalArgumentException("Parameter publicIpId is required and cannot be null."));
        }
        if (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.deletePublicIp(this.client.getEndpoint(), this.client.getApiVersion(),
            this.client.getSubscriptionId(), resourceGroupName, publicIpId, privateCloudName, accept, context);
    }

    /**
     * Delete a WorkloadNetworkPublicIP.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param publicIpId ID of the DNS zone.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link PollerFlux} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, Void> beginDeletePublicIpAsync(String resourceGroupName, String publicIpId,
        String privateCloudName) {
        Mono>> mono
            = deletePublicIpWithResponseAsync(resourceGroupName, publicIpId, privateCloudName);
        return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
            this.client.getContext());
    }

    /**
     * Delete a WorkloadNetworkPublicIP.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param publicIpId ID of the DNS zone.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link PollerFlux} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, Void> beginDeletePublicIpAsync(String resourceGroupName, String publicIpId,
        String privateCloudName, Context context) {
        context = this.client.mergeContext(context);
        Mono>> mono
            = deletePublicIpWithResponseAsync(resourceGroupName, publicIpId, privateCloudName, context);
        return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
            context);
    }

    /**
     * Delete a WorkloadNetworkPublicIP.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param publicIpId ID of the DNS zone.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, Void> beginDeletePublicIp(String resourceGroupName, String publicIpId,
        String privateCloudName) {
        return this.beginDeletePublicIpAsync(resourceGroupName, publicIpId, privateCloudName).getSyncPoller();
    }

    /**
     * Delete a WorkloadNetworkPublicIP.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param publicIpId ID of the DNS zone.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, Void> beginDeletePublicIp(String resourceGroupName, String publicIpId,
        String privateCloudName, Context context) {
        return this.beginDeletePublicIpAsync(resourceGroupName, publicIpId, privateCloudName, context).getSyncPoller();
    }

    /**
     * Delete a WorkloadNetworkPublicIP.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param publicIpId ID of the DNS zone.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 deletePublicIpAsync(String resourceGroupName, String publicIpId, String privateCloudName) {
        return beginDeletePublicIpAsync(resourceGroupName, publicIpId, privateCloudName).last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Delete a WorkloadNetworkPublicIP.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param publicIpId ID of the DNS zone.
     * @param privateCloudName Name of the private cloud.
     * @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 deletePublicIpAsync(String resourceGroupName, String publicIpId, String privateCloudName,
        Context context) {
        return beginDeletePublicIpAsync(resourceGroupName, publicIpId, privateCloudName, context).last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Delete a WorkloadNetworkPublicIP.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param publicIpId ID of the DNS zone.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @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 deletePublicIp(String resourceGroupName, String publicIpId, String privateCloudName) {
        deletePublicIpAsync(resourceGroupName, publicIpId, privateCloudName).block();
    }

    /**
     * Delete a WorkloadNetworkPublicIP.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param publicIpId ID of the DNS zone.
     * @param privateCloudName Name of the private cloud.
     * @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 deletePublicIp(String resourceGroupName, String publicIpId, String privateCloudName, Context context) {
        deletePublicIpAsync(resourceGroupName, publicIpId, privateCloudName, context).block();
    }

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

    /**
     * List WorkloadNetworkSegment resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkSegment list operation along with {@link PagedResponse} on successful
     * completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> listSegmentsSinglePageAsync(String resourceGroupName,
        String privateCloudName, 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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .listSegments(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
                resourceGroupName, privateCloudName, accept, context)
            .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
                res.getValue().value(), res.getValue().nextLink(), null));
    }

    /**
     * List WorkloadNetworkSegment resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkSegment list operation as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux listSegmentsAsync(String resourceGroupName,
        String privateCloudName) {
        return new PagedFlux<>(() -> listSegmentsSinglePageAsync(resourceGroupName, privateCloudName),
            nextLink -> listSegmentsNextSinglePageAsync(nextLink));
    }

    /**
     * List WorkloadNetworkSegment resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkSegment list operation as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux listSegmentsAsync(String resourceGroupName, String privateCloudName,
        Context context) {
        return new PagedFlux<>(() -> listSegmentsSinglePageAsync(resourceGroupName, privateCloudName, context),
            nextLink -> listSegmentsNextSinglePageAsync(nextLink, context));
    }

    /**
     * List WorkloadNetworkSegment resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkSegment list operation as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable listSegments(String resourceGroupName, String privateCloudName) {
        return new PagedIterable<>(listSegmentsAsync(resourceGroupName, privateCloudName));
    }

    /**
     * List WorkloadNetworkSegment resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkSegment list operation as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable listSegments(String resourceGroupName, String privateCloudName,
        Context context) {
        return new PagedIterable<>(listSegmentsAsync(resourceGroupName, privateCloudName, context));
    }

    /**
     * Get a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 WorkloadNetworkSegment along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> getSegmentWithResponseAsync(String resourceGroupName,
        String privateCloudName, String segmentId) {
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (segmentId == null) {
            return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.getSegment(this.client.getEndpoint(), this.client.getApiVersion(),
                this.client.getSubscriptionId(), resourceGroupName, privateCloudName, segmentId, accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @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 WorkloadNetworkSegment along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> getSegmentWithResponseAsync(String resourceGroupName,
        String privateCloudName, String segmentId, 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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (segmentId == null) {
            return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.getSegment(this.client.getEndpoint(), this.client.getApiVersion(),
            this.client.getSubscriptionId(), resourceGroupName, privateCloudName, segmentId, accept, context);
    }

    /**
     * Get a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 WorkloadNetworkSegment on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono getSegmentAsync(String resourceGroupName, String privateCloudName,
        String segmentId) {
        return getSegmentWithResponseAsync(resourceGroupName, privateCloudName, segmentId)
            .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Get a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @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 WorkloadNetworkSegment along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response getSegmentWithResponse(String resourceGroupName,
        String privateCloudName, String segmentId, Context context) {
        return getSegmentWithResponseAsync(resourceGroupName, privateCloudName, segmentId, context).block();
    }

    /**
     * Get a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 WorkloadNetworkSegment.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkSegmentInner getSegment(String resourceGroupName, String privateCloudName, String segmentId) {
        return getSegmentWithResponse(resourceGroupName, privateCloudName, segmentId, Context.NONE).getValue();
    }

    /**
     * Create a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @param workloadNetworkSegment Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX Segment along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>> createSegmentsWithResponseAsync(String resourceGroupName,
        String privateCloudName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) {
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (segmentId == null) {
            return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null."));
        }
        if (workloadNetworkSegment == null) {
            return Mono.error(
                new IllegalArgumentException("Parameter workloadNetworkSegment is required and cannot be null."));
        } else {
            workloadNetworkSegment.validate();
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.createSegments(this.client.getEndpoint(), this.client.getApiVersion(),
                this.client.getSubscriptionId(), resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment,
                accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Create a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @param workloadNetworkSegment Resource create parameters.
     * @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 nSX Segment along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>> createSegmentsWithResponseAsync(String resourceGroupName,
        String privateCloudName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment,
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (segmentId == null) {
            return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null."));
        }
        if (workloadNetworkSegment == null) {
            return Mono.error(
                new IllegalArgumentException("Parameter workloadNetworkSegment is required and cannot be null."));
        } else {
            workloadNetworkSegment.validate();
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.createSegments(this.client.getEndpoint(), this.client.getApiVersion(),
            this.client.getSubscriptionId(), resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment,
            accept, context);
    }

    /**
     * Create a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @param workloadNetworkSegment Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 nSX Segment.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, WorkloadNetworkSegmentInner> beginCreateSegmentsAsync(
        String resourceGroupName, String privateCloudName, String segmentId,
        WorkloadNetworkSegmentInner workloadNetworkSegment) {
        Mono>> mono
            = createSegmentsWithResponseAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment);
        return this.client.getLroResult(mono,
            this.client.getHttpPipeline(), WorkloadNetworkSegmentInner.class, WorkloadNetworkSegmentInner.class,
            this.client.getContext());
    }

    /**
     * Create a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @param workloadNetworkSegment Resource create parameters.
     * @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 nSX Segment.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, WorkloadNetworkSegmentInner> beginCreateSegmentsAsync(
        String resourceGroupName, String privateCloudName, String segmentId,
        WorkloadNetworkSegmentInner workloadNetworkSegment, Context context) {
        context = this.client.mergeContext(context);
        Mono>> mono = createSegmentsWithResponseAsync(resourceGroupName, privateCloudName,
            segmentId, workloadNetworkSegment, context);
        return this.client.getLroResult(mono,
            this.client.getHttpPipeline(), WorkloadNetworkSegmentInner.class, WorkloadNetworkSegmentInner.class,
            context);
    }

    /**
     * Create a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @param workloadNetworkSegment Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 nSX Segment.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, WorkloadNetworkSegmentInner> beginCreateSegments(
        String resourceGroupName, String privateCloudName, String segmentId,
        WorkloadNetworkSegmentInner workloadNetworkSegment) {
        return this.beginCreateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment)
            .getSyncPoller();
    }

    /**
     * Create a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @param workloadNetworkSegment Resource create parameters.
     * @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 nSX Segment.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, WorkloadNetworkSegmentInner> beginCreateSegments(
        String resourceGroupName, String privateCloudName, String segmentId,
        WorkloadNetworkSegmentInner workloadNetworkSegment, Context context) {
        return this
            .beginCreateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, context)
            .getSyncPoller();
    }

    /**
     * Create a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @param workloadNetworkSegment Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX Segment on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono createSegmentsAsync(String resourceGroupName, String privateCloudName,
        String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) {
        return beginCreateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment).last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Create a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @param workloadNetworkSegment Resource create parameters.
     * @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 nSX Segment on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono createSegmentsAsync(String resourceGroupName, String privateCloudName,
        String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment, Context context) {
        return beginCreateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, context)
            .last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Create a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @param workloadNetworkSegment Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX Segment.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkSegmentInner createSegments(String resourceGroupName, String privateCloudName,
        String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) {
        return createSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment).block();
    }

    /**
     * Create a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @param workloadNetworkSegment Resource create parameters.
     * @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 nSX Segment.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkSegmentInner createSegments(String resourceGroupName, String privateCloudName,
        String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment, Context context) {
        return createSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, context)
            .block();
    }

    /**
     * Update a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @param workloadNetworkSegment The resource properties to be updated.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX Segment along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>> updateSegmentsWithResponseAsync(String resourceGroupName,
        String privateCloudName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) {
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (segmentId == null) {
            return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null."));
        }
        if (workloadNetworkSegment == null) {
            return Mono.error(
                new IllegalArgumentException("Parameter workloadNetworkSegment is required and cannot be null."));
        } else {
            workloadNetworkSegment.validate();
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.updateSegments(this.client.getEndpoint(), this.client.getApiVersion(),
                this.client.getSubscriptionId(), resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment,
                accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Update a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @param workloadNetworkSegment The resource properties to be updated.
     * @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 nSX Segment along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>> updateSegmentsWithResponseAsync(String resourceGroupName,
        String privateCloudName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment,
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (segmentId == null) {
            return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null."));
        }
        if (workloadNetworkSegment == null) {
            return Mono.error(
                new IllegalArgumentException("Parameter workloadNetworkSegment is required and cannot be null."));
        } else {
            workloadNetworkSegment.validate();
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.updateSegments(this.client.getEndpoint(), this.client.getApiVersion(),
            this.client.getSubscriptionId(), resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment,
            accept, context);
    }

    /**
     * Update a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @param workloadNetworkSegment The resource properties to be updated.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 nSX Segment.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, WorkloadNetworkSegmentInner> beginUpdateSegmentsAsync(
        String resourceGroupName, String privateCloudName, String segmentId,
        WorkloadNetworkSegmentInner workloadNetworkSegment) {
        Mono>> mono
            = updateSegmentsWithResponseAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment);
        return this.client.getLroResult(mono,
            this.client.getHttpPipeline(), WorkloadNetworkSegmentInner.class, WorkloadNetworkSegmentInner.class,
            this.client.getContext());
    }

    /**
     * Update a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @param workloadNetworkSegment The resource properties to be updated.
     * @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 nSX Segment.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, WorkloadNetworkSegmentInner> beginUpdateSegmentsAsync(
        String resourceGroupName, String privateCloudName, String segmentId,
        WorkloadNetworkSegmentInner workloadNetworkSegment, Context context) {
        context = this.client.mergeContext(context);
        Mono>> mono = updateSegmentsWithResponseAsync(resourceGroupName, privateCloudName,
            segmentId, workloadNetworkSegment, context);
        return this.client.getLroResult(mono,
            this.client.getHttpPipeline(), WorkloadNetworkSegmentInner.class, WorkloadNetworkSegmentInner.class,
            context);
    }

    /**
     * Update a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @param workloadNetworkSegment The resource properties to be updated.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 nSX Segment.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, WorkloadNetworkSegmentInner> beginUpdateSegments(
        String resourceGroupName, String privateCloudName, String segmentId,
        WorkloadNetworkSegmentInner workloadNetworkSegment) {
        return this.beginUpdateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment)
            .getSyncPoller();
    }

    /**
     * Update a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @param workloadNetworkSegment The resource properties to be updated.
     * @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 nSX Segment.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, WorkloadNetworkSegmentInner> beginUpdateSegments(
        String resourceGroupName, String privateCloudName, String segmentId,
        WorkloadNetworkSegmentInner workloadNetworkSegment, Context context) {
        return this
            .beginUpdateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, context)
            .getSyncPoller();
    }

    /**
     * Update a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @param workloadNetworkSegment The resource properties to be updated.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX Segment on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono updateSegmentsAsync(String resourceGroupName, String privateCloudName,
        String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) {
        return beginUpdateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment).last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Update a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @param workloadNetworkSegment The resource properties to be updated.
     * @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 nSX Segment on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono updateSegmentsAsync(String resourceGroupName, String privateCloudName,
        String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment, Context context) {
        return beginUpdateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, context)
            .last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Update a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @param workloadNetworkSegment The resource properties to be updated.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX Segment.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkSegmentInner updateSegments(String resourceGroupName, String privateCloudName,
        String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) {
        return updateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment).block();
    }

    /**
     * Update a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @param workloadNetworkSegment The resource properties to be updated.
     * @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 nSX Segment.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkSegmentInner updateSegments(String resourceGroupName, String privateCloudName,
        String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment, Context context) {
        return updateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, context)
            .block();
    }

    /**
     * Delete a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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>> deleteSegmentWithResponseAsync(String resourceGroupName,
        String privateCloudName, String segmentId) {
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (segmentId == null) {
            return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.deleteSegment(this.client.getEndpoint(), this.client.getApiVersion(),
                this.client.getSubscriptionId(), resourceGroupName, privateCloudName, segmentId, accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Delete a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @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>> deleteSegmentWithResponseAsync(String resourceGroupName,
        String privateCloudName, String segmentId, 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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (segmentId == null) {
            return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.deleteSegment(this.client.getEndpoint(), this.client.getApiVersion(),
            this.client.getSubscriptionId(), resourceGroupName, privateCloudName, segmentId, accept, context);
    }

    /**
     * Delete a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link PollerFlux} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, Void> beginDeleteSegmentAsync(String resourceGroupName,
        String privateCloudName, String segmentId) {
        Mono>> mono
            = deleteSegmentWithResponseAsync(resourceGroupName, privateCloudName, segmentId);
        return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
            this.client.getContext());
    }

    /**
     * Delete a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link PollerFlux} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, Void> beginDeleteSegmentAsync(String resourceGroupName,
        String privateCloudName, String segmentId, Context context) {
        context = this.client.mergeContext(context);
        Mono>> mono
            = deleteSegmentWithResponseAsync(resourceGroupName, privateCloudName, segmentId, context);
        return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
            context);
    }

    /**
     * Delete a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, Void> beginDeleteSegment(String resourceGroupName, String privateCloudName,
        String segmentId) {
        return this.beginDeleteSegmentAsync(resourceGroupName, privateCloudName, segmentId).getSyncPoller();
    }

    /**
     * Delete a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, Void> beginDeleteSegment(String resourceGroupName, String privateCloudName,
        String segmentId, Context context) {
        return this.beginDeleteSegmentAsync(resourceGroupName, privateCloudName, segmentId, context).getSyncPoller();
    }

    /**
     * Delete a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 deleteSegmentAsync(String resourceGroupName, String privateCloudName, String segmentId) {
        return beginDeleteSegmentAsync(resourceGroupName, privateCloudName, segmentId).last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Delete a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @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 deleteSegmentAsync(String resourceGroupName, String privateCloudName, String segmentId,
        Context context) {
        return beginDeleteSegmentAsync(resourceGroupName, privateCloudName, segmentId, context).last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Delete a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @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 deleteSegment(String resourceGroupName, String privateCloudName, String segmentId) {
        deleteSegmentAsync(resourceGroupName, privateCloudName, segmentId).block();
    }

    /**
     * Delete a WorkloadNetworkSegment.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param segmentId The ID of the NSX Segment.
     * @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 deleteSegment(String resourceGroupName, String privateCloudName, String segmentId, Context context) {
        deleteSegmentAsync(resourceGroupName, privateCloudName, segmentId, context).block();
    }

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

    /**
     * List WorkloadNetworkVirtualMachine resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkVirtualMachine list operation along with {@link PagedResponse} on
     * successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>
        listVirtualMachinesSinglePageAsync(String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .listVirtualMachines(this.client.getEndpoint(), this.client.getApiVersion(),
                this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context)
            .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
                res.getValue().value(), res.getValue().nextLink(), null));
    }

    /**
     * List WorkloadNetworkVirtualMachine resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkVirtualMachine list operation as paginated response with
     * {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux listVirtualMachinesAsync(String resourceGroupName,
        String privateCloudName) {
        return new PagedFlux<>(() -> listVirtualMachinesSinglePageAsync(resourceGroupName, privateCloudName),
            nextLink -> listVirtualMachinesNextSinglePageAsync(nextLink));
    }

    /**
     * List WorkloadNetworkVirtualMachine resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkVirtualMachine list operation as paginated response with
     * {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux listVirtualMachinesAsync(String resourceGroupName,
        String privateCloudName, Context context) {
        return new PagedFlux<>(() -> listVirtualMachinesSinglePageAsync(resourceGroupName, privateCloudName, context),
            nextLink -> listVirtualMachinesNextSinglePageAsync(nextLink, context));
    }

    /**
     * List WorkloadNetworkVirtualMachine resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkVirtualMachine list operation as paginated response with
     * {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable listVirtualMachines(String resourceGroupName,
        String privateCloudName) {
        return new PagedIterable<>(listVirtualMachinesAsync(resourceGroupName, privateCloudName));
    }

    /**
     * List WorkloadNetworkVirtualMachine resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkVirtualMachine list operation as paginated response with
     * {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable listVirtualMachines(String resourceGroupName,
        String privateCloudName, Context context) {
        return new PagedIterable<>(listVirtualMachinesAsync(resourceGroupName, privateCloudName, context));
    }

    /**
     * Get a WorkloadNetworkVirtualMachine.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param virtualMachineId ID of the virtual machine.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 WorkloadNetworkVirtualMachine along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>
        getVirtualMachineWithResponseAsync(String resourceGroupName, String privateCloudName, String virtualMachineId) {
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (virtualMachineId == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter virtualMachineId is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.getVirtualMachine(this.client.getEndpoint(), this.client.getApiVersion(),
                this.client.getSubscriptionId(), resourceGroupName, privateCloudName, virtualMachineId, accept,
                context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get a WorkloadNetworkVirtualMachine.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param virtualMachineId ID of the virtual machine.
     * @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 WorkloadNetworkVirtualMachine along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> getVirtualMachineWithResponseAsync(
        String resourceGroupName, String privateCloudName, String virtualMachineId, 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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (virtualMachineId == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter virtualMachineId is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.getVirtualMachine(this.client.getEndpoint(), this.client.getApiVersion(),
            this.client.getSubscriptionId(), resourceGroupName, privateCloudName, virtualMachineId, accept, context);
    }

    /**
     * Get a WorkloadNetworkVirtualMachine.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param virtualMachineId ID of the virtual machine.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 WorkloadNetworkVirtualMachine on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono getVirtualMachineAsync(String resourceGroupName,
        String privateCloudName, String virtualMachineId) {
        return getVirtualMachineWithResponseAsync(resourceGroupName, privateCloudName, virtualMachineId)
            .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Get a WorkloadNetworkVirtualMachine.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param virtualMachineId ID of the virtual machine.
     * @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 WorkloadNetworkVirtualMachine along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response getVirtualMachineWithResponse(String resourceGroupName,
        String privateCloudName, String virtualMachineId, Context context) {
        return getVirtualMachineWithResponseAsync(resourceGroupName, privateCloudName, virtualMachineId, context)
            .block();
    }

    /**
     * Get a WorkloadNetworkVirtualMachine.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param virtualMachineId ID of the virtual machine.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 WorkloadNetworkVirtualMachine.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkVirtualMachineInner getVirtualMachine(String resourceGroupName, String privateCloudName,
        String virtualMachineId) {
        return getVirtualMachineWithResponse(resourceGroupName, privateCloudName, virtualMachineId, Context.NONE)
            .getValue();
    }

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

    /**
     * List WorkloadNetworkVMGroup resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkVMGroup list operation along with {@link PagedResponse} on successful
     * completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> listVMGroupsSinglePageAsync(String resourceGroupName,
        String privateCloudName, 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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .listVMGroups(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
                resourceGroupName, privateCloudName, accept, context)
            .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
                res.getValue().value(), res.getValue().nextLink(), null));
    }

    /**
     * List WorkloadNetworkVMGroup resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkVMGroup list operation as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux listVMGroupsAsync(String resourceGroupName,
        String privateCloudName) {
        return new PagedFlux<>(() -> listVMGroupsSinglePageAsync(resourceGroupName, privateCloudName),
            nextLink -> listVMGroupsNextSinglePageAsync(nextLink));
    }

    /**
     * List WorkloadNetworkVMGroup resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkVMGroup list operation as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux listVMGroupsAsync(String resourceGroupName, String privateCloudName,
        Context context) {
        return new PagedFlux<>(() -> listVMGroupsSinglePageAsync(resourceGroupName, privateCloudName, context),
            nextLink -> listVMGroupsNextSinglePageAsync(nextLink, context));
    }

    /**
     * List WorkloadNetworkVMGroup resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkVMGroup list operation as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable listVMGroups(String resourceGroupName, String privateCloudName) {
        return new PagedIterable<>(listVMGroupsAsync(resourceGroupName, privateCloudName));
    }

    /**
     * List WorkloadNetworkVMGroup resources by WorkloadNetwork.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkVMGroup list operation as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable listVMGroups(String resourceGroupName, String privateCloudName,
        Context context) {
        return new PagedIterable<>(listVMGroupsAsync(resourceGroupName, privateCloudName, context));
    }

    /**
     * Get a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param vmGroupId ID of the VM group.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 WorkloadNetworkVMGroup along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> getVMGroupWithResponseAsync(String resourceGroupName,
        String privateCloudName, String vmGroupId) {
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (vmGroupId == null) {
            return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.getVMGroup(this.client.getEndpoint(), this.client.getApiVersion(),
                this.client.getSubscriptionId(), resourceGroupName, privateCloudName, vmGroupId, accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param vmGroupId ID of the VM group.
     * @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 WorkloadNetworkVMGroup along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> getVMGroupWithResponseAsync(String resourceGroupName,
        String privateCloudName, String vmGroupId, 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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (vmGroupId == null) {
            return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.getVMGroup(this.client.getEndpoint(), this.client.getApiVersion(),
            this.client.getSubscriptionId(), resourceGroupName, privateCloudName, vmGroupId, accept, context);
    }

    /**
     * Get a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param vmGroupId ID of the VM group.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 WorkloadNetworkVMGroup on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono getVMGroupAsync(String resourceGroupName, String privateCloudName,
        String vmGroupId) {
        return getVMGroupWithResponseAsync(resourceGroupName, privateCloudName, vmGroupId)
            .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Get a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param vmGroupId ID of the VM group.
     * @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 WorkloadNetworkVMGroup along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response getVMGroupWithResponse(String resourceGroupName,
        String privateCloudName, String vmGroupId, Context context) {
        return getVMGroupWithResponseAsync(resourceGroupName, privateCloudName, vmGroupId, context).block();
    }

    /**
     * Get a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param vmGroupId ID of the VM group.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 WorkloadNetworkVMGroup.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkVMGroupInner getVMGroup(String resourceGroupName, String privateCloudName, String vmGroupId) {
        return getVMGroupWithResponse(resourceGroupName, privateCloudName, vmGroupId, Context.NONE).getValue();
    }

    /**
     * Create a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param vmGroupId ID of the VM group.
     * @param workloadNetworkVMGroup Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX VM Group along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>> createVMGroupWithResponseAsync(String resourceGroupName,
        String privateCloudName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) {
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (vmGroupId == null) {
            return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null."));
        }
        if (workloadNetworkVMGroup == null) {
            return Mono.error(
                new IllegalArgumentException("Parameter workloadNetworkVMGroup is required and cannot be null."));
        } else {
            workloadNetworkVMGroup.validate();
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.createVMGroup(this.client.getEndpoint(), this.client.getApiVersion(),
                this.client.getSubscriptionId(), resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup,
                accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Create a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param vmGroupId ID of the VM group.
     * @param workloadNetworkVMGroup Resource create parameters.
     * @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 nSX VM Group along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>> createVMGroupWithResponseAsync(String resourceGroupName,
        String privateCloudName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup,
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (vmGroupId == null) {
            return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null."));
        }
        if (workloadNetworkVMGroup == null) {
            return Mono.error(
                new IllegalArgumentException("Parameter workloadNetworkVMGroup is required and cannot be null."));
        } else {
            workloadNetworkVMGroup.validate();
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.createVMGroup(this.client.getEndpoint(), this.client.getApiVersion(),
            this.client.getSubscriptionId(), resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup,
            accept, context);
    }

    /**
     * Create a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param vmGroupId ID of the VM group.
     * @param workloadNetworkVMGroup Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 nSX VM Group.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, WorkloadNetworkVMGroupInner> beginCreateVMGroupAsync(
        String resourceGroupName, String privateCloudName, String vmGroupId,
        WorkloadNetworkVMGroupInner workloadNetworkVMGroup) {
        Mono>> mono
            = createVMGroupWithResponseAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup);
        return this.client.getLroResult(mono,
            this.client.getHttpPipeline(), WorkloadNetworkVMGroupInner.class, WorkloadNetworkVMGroupInner.class,
            this.client.getContext());
    }

    /**
     * Create a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param vmGroupId ID of the VM group.
     * @param workloadNetworkVMGroup Resource create parameters.
     * @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 nSX VM Group.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, WorkloadNetworkVMGroupInner> beginCreateVMGroupAsync(
        String resourceGroupName, String privateCloudName, String vmGroupId,
        WorkloadNetworkVMGroupInner workloadNetworkVMGroup, Context context) {
        context = this.client.mergeContext(context);
        Mono>> mono = createVMGroupWithResponseAsync(resourceGroupName, privateCloudName,
            vmGroupId, workloadNetworkVMGroup, context);
        return this.client.getLroResult(mono,
            this.client.getHttpPipeline(), WorkloadNetworkVMGroupInner.class, WorkloadNetworkVMGroupInner.class,
            context);
    }

    /**
     * Create a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param vmGroupId ID of the VM group.
     * @param workloadNetworkVMGroup Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 nSX VM Group.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, WorkloadNetworkVMGroupInner> beginCreateVMGroup(
        String resourceGroupName, String privateCloudName, String vmGroupId,
        WorkloadNetworkVMGroupInner workloadNetworkVMGroup) {
        return this.beginCreateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup)
            .getSyncPoller();
    }

    /**
     * Create a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param vmGroupId ID of the VM group.
     * @param workloadNetworkVMGroup Resource create parameters.
     * @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 nSX VM Group.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, WorkloadNetworkVMGroupInner> beginCreateVMGroup(
        String resourceGroupName, String privateCloudName, String vmGroupId,
        WorkloadNetworkVMGroupInner workloadNetworkVMGroup, Context context) {
        return this
            .beginCreateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, context)
            .getSyncPoller();
    }

    /**
     * Create a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param vmGroupId ID of the VM group.
     * @param workloadNetworkVMGroup Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX VM Group on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono createVMGroupAsync(String resourceGroupName, String privateCloudName,
        String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) {
        return beginCreateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup).last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Create a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param vmGroupId ID of the VM group.
     * @param workloadNetworkVMGroup Resource create parameters.
     * @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 nSX VM Group on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono createVMGroupAsync(String resourceGroupName, String privateCloudName,
        String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup, Context context) {
        return beginCreateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, context)
            .last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Create a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param vmGroupId ID of the VM group.
     * @param workloadNetworkVMGroup Resource create parameters.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX VM Group.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkVMGroupInner createVMGroup(String resourceGroupName, String privateCloudName,
        String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) {
        return createVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup).block();
    }

    /**
     * Create a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param vmGroupId ID of the VM group.
     * @param workloadNetworkVMGroup Resource create parameters.
     * @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 nSX VM Group.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkVMGroupInner createVMGroup(String resourceGroupName, String privateCloudName,
        String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup, Context context) {
        return createVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, context)
            .block();
    }

    /**
     * Update a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param vmGroupId ID of the VM group.
     * @param workloadNetworkVMGroup The resource properties to be updated.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX VM Group along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>> updateVMGroupWithResponseAsync(String resourceGroupName,
        String privateCloudName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) {
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (vmGroupId == null) {
            return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null."));
        }
        if (workloadNetworkVMGroup == null) {
            return Mono.error(
                new IllegalArgumentException("Parameter workloadNetworkVMGroup is required and cannot be null."));
        } else {
            workloadNetworkVMGroup.validate();
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.updateVMGroup(this.client.getEndpoint(), this.client.getApiVersion(),
                this.client.getSubscriptionId(), resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup,
                accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Update a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param vmGroupId ID of the VM group.
     * @param workloadNetworkVMGroup The resource properties to be updated.
     * @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 nSX VM Group along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>> updateVMGroupWithResponseAsync(String resourceGroupName,
        String privateCloudName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup,
        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 (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        if (vmGroupId == null) {
            return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null."));
        }
        if (workloadNetworkVMGroup == null) {
            return Mono.error(
                new IllegalArgumentException("Parameter workloadNetworkVMGroup is required and cannot be null."));
        } else {
            workloadNetworkVMGroup.validate();
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.updateVMGroup(this.client.getEndpoint(), this.client.getApiVersion(),
            this.client.getSubscriptionId(), resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup,
            accept, context);
    }

    /**
     * Update a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param vmGroupId ID of the VM group.
     * @param workloadNetworkVMGroup The resource properties to be updated.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 nSX VM Group.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, WorkloadNetworkVMGroupInner> beginUpdateVMGroupAsync(
        String resourceGroupName, String privateCloudName, String vmGroupId,
        WorkloadNetworkVMGroupInner workloadNetworkVMGroup) {
        Mono>> mono
            = updateVMGroupWithResponseAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup);
        return this.client.getLroResult(mono,
            this.client.getHttpPipeline(), WorkloadNetworkVMGroupInner.class, WorkloadNetworkVMGroupInner.class,
            this.client.getContext());
    }

    /**
     * Update a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param vmGroupId ID of the VM group.
     * @param workloadNetworkVMGroup The resource properties to be updated.
     * @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 nSX VM Group.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, WorkloadNetworkVMGroupInner> beginUpdateVMGroupAsync(
        String resourceGroupName, String privateCloudName, String vmGroupId,
        WorkloadNetworkVMGroupInner workloadNetworkVMGroup, Context context) {
        context = this.client.mergeContext(context);
        Mono>> mono = updateVMGroupWithResponseAsync(resourceGroupName, privateCloudName,
            vmGroupId, workloadNetworkVMGroup, context);
        return this.client.getLroResult(mono,
            this.client.getHttpPipeline(), WorkloadNetworkVMGroupInner.class, WorkloadNetworkVMGroupInner.class,
            context);
    }

    /**
     * Update a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param vmGroupId ID of the VM group.
     * @param workloadNetworkVMGroup The resource properties to be updated.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 nSX VM Group.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, WorkloadNetworkVMGroupInner> beginUpdateVMGroup(
        String resourceGroupName, String privateCloudName, String vmGroupId,
        WorkloadNetworkVMGroupInner workloadNetworkVMGroup) {
        return this.beginUpdateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup)
            .getSyncPoller();
    }

    /**
     * Update a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param vmGroupId ID of the VM group.
     * @param workloadNetworkVMGroup The resource properties to be updated.
     * @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 nSX VM Group.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, WorkloadNetworkVMGroupInner> beginUpdateVMGroup(
        String resourceGroupName, String privateCloudName, String vmGroupId,
        WorkloadNetworkVMGroupInner workloadNetworkVMGroup, Context context) {
        return this
            .beginUpdateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, context)
            .getSyncPoller();
    }

    /**
     * Update a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param vmGroupId ID of the VM group.
     * @param workloadNetworkVMGroup The resource properties to be updated.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX VM Group on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono updateVMGroupAsync(String resourceGroupName, String privateCloudName,
        String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) {
        return beginUpdateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup).last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Update a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param vmGroupId ID of the VM group.
     * @param workloadNetworkVMGroup The resource properties to be updated.
     * @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 nSX VM Group on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono updateVMGroupAsync(String resourceGroupName, String privateCloudName,
        String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup, Context context) {
        return beginUpdateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, context)
            .last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Update a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param vmGroupId ID of the VM group.
     * @param workloadNetworkVMGroup The resource properties to be updated.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return nSX VM Group.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkVMGroupInner updateVMGroup(String resourceGroupName, String privateCloudName,
        String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) {
        return updateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup).block();
    }

    /**
     * Update a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param privateCloudName Name of the private cloud.
     * @param vmGroupId ID of the VM group.
     * @param workloadNetworkVMGroup The resource properties to be updated.
     * @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 nSX VM Group.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public WorkloadNetworkVMGroupInner updateVMGroup(String resourceGroupName, String privateCloudName,
        String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup, Context context) {
        return updateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, context)
            .block();
    }

    /**
     * Delete a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param vmGroupId ID of the VM group.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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>> deleteVMGroupWithResponseAsync(String resourceGroupName, String vmGroupId,
        String privateCloudName) {
        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 (vmGroupId == null) {
            return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null."));
        }
        if (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.deleteVMGroup(this.client.getEndpoint(), this.client.getApiVersion(),
                this.client.getSubscriptionId(), resourceGroupName, vmGroupId, privateCloudName, accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Delete a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param vmGroupId ID of the VM group.
     * @param privateCloudName Name of the private cloud.
     * @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>> deleteVMGroupWithResponseAsync(String resourceGroupName, String vmGroupId,
        String privateCloudName, 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 (vmGroupId == null) {
            return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null."));
        }
        if (privateCloudName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.deleteVMGroup(this.client.getEndpoint(), this.client.getApiVersion(),
            this.client.getSubscriptionId(), resourceGroupName, vmGroupId, privateCloudName, accept, context);
    }

    /**
     * Delete a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param vmGroupId ID of the VM group.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link PollerFlux} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, Void> beginDeleteVMGroupAsync(String resourceGroupName, String vmGroupId,
        String privateCloudName) {
        Mono>> mono
            = deleteVMGroupWithResponseAsync(resourceGroupName, vmGroupId, privateCloudName);
        return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
            this.client.getContext());
    }

    /**
     * Delete a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param vmGroupId ID of the VM group.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link PollerFlux} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    private PollerFlux, Void> beginDeleteVMGroupAsync(String resourceGroupName, String vmGroupId,
        String privateCloudName, Context context) {
        context = this.client.mergeContext(context);
        Mono>> mono
            = deleteVMGroupWithResponseAsync(resourceGroupName, vmGroupId, privateCloudName, context);
        return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
            context);
    }

    /**
     * Delete a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param vmGroupId ID of the VM group.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, Void> beginDeleteVMGroup(String resourceGroupName, String vmGroupId,
        String privateCloudName) {
        return this.beginDeleteVMGroupAsync(resourceGroupName, vmGroupId, privateCloudName).getSyncPoller();
    }

    /**
     * Delete a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param vmGroupId ID of the VM group.
     * @param privateCloudName Name of the private cloud.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    public SyncPoller, Void> beginDeleteVMGroup(String resourceGroupName, String vmGroupId,
        String privateCloudName, Context context) {
        return this.beginDeleteVMGroupAsync(resourceGroupName, vmGroupId, privateCloudName, context).getSyncPoller();
    }

    /**
     * Delete a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param vmGroupId ID of the VM group.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws 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 deleteVMGroupAsync(String resourceGroupName, String vmGroupId, String privateCloudName) {
        return beginDeleteVMGroupAsync(resourceGroupName, vmGroupId, privateCloudName).last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Delete a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param vmGroupId ID of the VM group.
     * @param privateCloudName Name of the private cloud.
     * @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 deleteVMGroupAsync(String resourceGroupName, String vmGroupId, String privateCloudName,
        Context context) {
        return beginDeleteVMGroupAsync(resourceGroupName, vmGroupId, privateCloudName, context).last()
            .flatMap(this.client::getLroFinalResultOrError);
    }

    /**
     * Delete a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param vmGroupId ID of the VM group.
     * @param privateCloudName Name of the private cloud.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @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 deleteVMGroup(String resourceGroupName, String vmGroupId, String privateCloudName) {
        deleteVMGroupAsync(resourceGroupName, vmGroupId, privateCloudName).block();
    }

    /**
     * Delete a WorkloadNetworkVMGroup.
     * 
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param vmGroupId ID of the VM group.
     * @param privateCloudName Name of the private cloud.
     * @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 deleteVMGroup(String resourceGroupName, String vmGroupId, String privateCloudName, Context context) {
        deleteVMGroupAsync(resourceGroupName, vmGroupId, privateCloudName, context).block();
    }

    /**
     * Get the next page of items.
     * 
     * @param nextLink The URL to get the next list of items.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetwork list operation along with {@link PagedResponse} on successful
     * completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> listNextSinglePageAsync(String nextLink) {
        if (nextLink == null) {
            return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
        }
        if (this.client.getEndpoint() == null) {
            return Mono.error(
                new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context))
            .>map(res -> new PagedResponseBase<>(res.getRequest(),
                res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get the next page of items.
     * 
     * @param nextLink The URL to get the next list of items.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetwork list operation along with {@link PagedResponse} on successful
     * completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> listNextSinglePageAsync(String nextLink, Context context) {
        if (nextLink == null) {
            return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
        }
        if (this.client.getEndpoint() == null) {
            return Mono.error(
                new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.listNext(nextLink, this.client.getEndpoint(), accept, context)
            .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
                res.getValue().value(), res.getValue().nextLink(), null));
    }

    /**
     * Get the next page of items.
     * 
     * @param nextLink The URL to get the next list of items.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkDhcp list operation along with {@link PagedResponse} on successful
     * completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> listDhcpNextSinglePageAsync(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.listDhcpNext(nextLink, this.client.getEndpoint(), accept, context))
            .>map(res -> new PagedResponseBase<>(res.getRequest(),
                res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get the next page of items.
     * 
     * @param nextLink The URL to get the next list of items.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkDhcp list operation along with {@link PagedResponse} on successful
     * completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> listDhcpNextSinglePageAsync(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.listDhcpNext(nextLink, this.client.getEndpoint(), accept, context)
            .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
                res.getValue().value(), res.getValue().nextLink(), null));
    }

    /**
     * Get the next page of items.
     * 
     * @param nextLink The URL to get the next list of items.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkDnsService list operation along with {@link PagedResponse} on successful
     * completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> listDnsServicesNextSinglePageAsync(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.listDnsServicesNext(nextLink, this.client.getEndpoint(), accept, context))
            .>map(res -> new PagedResponseBase<>(res.getRequest(),
                res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get the next page of items.
     * 
     * @param nextLink The URL to get the next list of items.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkDnsService list operation along with {@link PagedResponse} on successful
     * completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> listDnsServicesNextSinglePageAsync(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.listDnsServicesNext(nextLink, this.client.getEndpoint(), accept, context)
            .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
                res.getValue().value(), res.getValue().nextLink(), null));
    }

    /**
     * Get the next page of items.
     * 
     * @param nextLink The URL to get the next list of items.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkDnsZone list operation along with {@link PagedResponse} on successful
     * completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> listDnsZonesNextSinglePageAsync(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.listDnsZonesNext(nextLink, this.client.getEndpoint(), accept, context))
            .>map(res -> new PagedResponseBase<>(res.getRequest(),
                res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get the next page of items.
     * 
     * @param nextLink The URL to get the next list of items.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkDnsZone list operation along with {@link PagedResponse} on successful
     * completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> listDnsZonesNextSinglePageAsync(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.listDnsZonesNext(nextLink, this.client.getEndpoint(), accept, context)
            .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
                res.getValue().value(), res.getValue().nextLink(), null));
    }

    /**
     * Get the next page of items.
     * 
     * @param nextLink The URL to get the next list of items.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkGateway list operation along with {@link PagedResponse} on successful
     * completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> listGatewaysNextSinglePageAsync(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.listGatewaysNext(nextLink, this.client.getEndpoint(), accept, context))
            .>map(res -> new PagedResponseBase<>(res.getRequest(),
                res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get the next page of items.
     * 
     * @param nextLink The URL to get the next list of items.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkGateway list operation along with {@link PagedResponse} on successful
     * completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> listGatewaysNextSinglePageAsync(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.listGatewaysNext(nextLink, this.client.getEndpoint(), accept, context)
            .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
                res.getValue().value(), res.getValue().nextLink(), null));
    }

    /**
     * Get the next page of items.
     * 
     * @param nextLink The URL to get the next list of items.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkPortMirroring list operation along with {@link PagedResponse} on
     * successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>
        listPortMirroringNextSinglePageAsync(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.listPortMirroringNext(nextLink, this.client.getEndpoint(), accept, context))
            .>map(res -> new PagedResponseBase<>(res.getRequest(),
                res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get the next page of items.
     * 
     * @param nextLink The URL to get the next list of items.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkPortMirroring list operation along with {@link PagedResponse} on
     * successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> listPortMirroringNextSinglePageAsync(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.listPortMirroringNext(nextLink, this.client.getEndpoint(), accept, context)
            .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
                res.getValue().value(), res.getValue().nextLink(), null));
    }

    /**
     * Get the next page of items.
     * 
     * @param nextLink The URL to get the next list of items.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkPublicIP list operation along with {@link PagedResponse} on successful
     * completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> listPublicIPsNextSinglePageAsync(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.listPublicIPsNext(nextLink, this.client.getEndpoint(), accept, context))
            .>map(res -> new PagedResponseBase<>(res.getRequest(),
                res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get the next page of items.
     * 
     * @param nextLink The URL to get the next list of items.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkPublicIP list operation along with {@link PagedResponse} on successful
     * completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> listPublicIPsNextSinglePageAsync(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.listPublicIPsNext(nextLink, this.client.getEndpoint(), accept, context)
            .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
                res.getValue().value(), res.getValue().nextLink(), null));
    }

    /**
     * Get the next page of items.
     * 
     * @param nextLink The URL to get the next list of items.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkSegment list operation along with {@link PagedResponse} on successful
     * completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> listSegmentsNextSinglePageAsync(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.listSegmentsNext(nextLink, this.client.getEndpoint(), accept, context))
            .>map(res -> new PagedResponseBase<>(res.getRequest(),
                res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get the next page of items.
     * 
     * @param nextLink The URL to get the next list of items.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkSegment list operation along with {@link PagedResponse} on successful
     * completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> listSegmentsNextSinglePageAsync(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.listSegmentsNext(nextLink, this.client.getEndpoint(), accept, context)
            .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
                res.getValue().value(), res.getValue().nextLink(), null));
    }

    /**
     * Get the next page of items.
     * 
     * @param nextLink The URL to get the next list of items.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkVirtualMachine list operation along with {@link PagedResponse} on
     * successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>
        listVirtualMachinesNextSinglePageAsync(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.listVirtualMachinesNext(nextLink, this.client.getEndpoint(), accept, context))
            .>map(res -> new PagedResponseBase<>(res.getRequest(),
                res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get the next page of items.
     * 
     * @param nextLink The URL to get the next list of items.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkVirtualMachine list operation along with {@link PagedResponse} on
     * successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono>
        listVirtualMachinesNextSinglePageAsync(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.listVirtualMachinesNext(nextLink, this.client.getEndpoint(), accept, context)
            .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
                res.getValue().value(), res.getValue().nextLink(), null));
    }

    /**
     * Get the next page of items.
     * 
     * @param nextLink The URL to get the next list of items.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkVMGroup list operation along with {@link PagedResponse} on successful
     * completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> listVMGroupsNextSinglePageAsync(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.listVMGroupsNext(nextLink, this.client.getEndpoint(), accept, context))
            .>map(res -> new PagedResponseBase<>(res.getRequest(),
                res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get the next page of items.
     * 
     * @param nextLink The URL to get the next list of items.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of a WorkloadNetworkVMGroup list operation along with {@link PagedResponse} on successful
     * completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono> listVMGroupsNextSinglePageAsync(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.listVMGroupsNext(nextLink, this.client.getEndpoint(), accept, context)
            .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
                res.getValue().value(), res.getValue().nextLink(), null));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy