/*
 * Copyright (c) Microsoft Corporation.
 * Licensed under the MIT License.
 *
 * Code generated by Microsoft (R) AutoRest Code Generator.
 * Changes may cause incorrect behavior and will be lost if the code is regenerated.
 */

import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
import { setContinuationToken } from "../pagingHelper";
import { AppServiceEnvironments } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { WebSiteManagementClient } from "../webSiteManagementClient";
import {
  SimplePollerLike,
  OperationState,
  createHttpPoller
} from "@azure/core-lro";
import { createLroSpec } from "../lroImpl";
import {
  AppServiceEnvironmentResource,
  AppServiceEnvironmentsListNextOptionalParams,
  AppServiceEnvironmentsListOptionalParams,
  AppServiceEnvironmentsListResponse,
  AppServiceEnvironmentsListByResourceGroupNextOptionalParams,
  AppServiceEnvironmentsListByResourceGroupOptionalParams,
  AppServiceEnvironmentsListByResourceGroupResponse,
  StampCapacity,
  AppServiceEnvironmentsListCapacitiesNextOptionalParams,
  AppServiceEnvironmentsListCapacitiesOptionalParams,
  AppServiceEnvironmentsListCapacitiesResponse,
  Site,
  VirtualNetworkProfile,
  AppServiceEnvironmentsChangeVnetNextOptionalParams,
  AppServiceEnvironmentsChangeVnetOptionalParams,
  AppServiceEnvironmentsChangeVnetResponse,
  InboundEnvironmentEndpoint,
  AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsNextOptionalParams,
  AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsOptionalParams,
  AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsResponse,
  WorkerPoolResource,
  AppServiceEnvironmentsListMultiRolePoolsNextOptionalParams,
  AppServiceEnvironmentsListMultiRolePoolsOptionalParams,
  AppServiceEnvironmentsListMultiRolePoolsResponse,
  ResourceMetricDefinition,
  AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsNextOptionalParams,
  AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsOptionalParams,
  AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsResponse,
  AppServiceEnvironmentsListMultiRoleMetricDefinitionsNextOptionalParams,
  AppServiceEnvironmentsListMultiRoleMetricDefinitionsOptionalParams,
  AppServiceEnvironmentsListMultiRoleMetricDefinitionsResponse,
  SkuInfo,
  AppServiceEnvironmentsListMultiRolePoolSkusNextOptionalParams,
  AppServiceEnvironmentsListMultiRolePoolSkusOptionalParams,
  AppServiceEnvironmentsListMultiRolePoolSkusResponse,
  Usage,
  AppServiceEnvironmentsListMultiRoleUsagesNextOptionalParams,
  AppServiceEnvironmentsListMultiRoleUsagesOptionalParams,
  AppServiceEnvironmentsListMultiRoleUsagesResponse,
  OutboundEnvironmentEndpoint,
  AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsNextOptionalParams,
  AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsOptionalParams,
  AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsResponse,
  RemotePrivateEndpointConnectionARMResource,
  AppServiceEnvironmentsGetPrivateEndpointConnectionListNextOptionalParams,
  AppServiceEnvironmentsGetPrivateEndpointConnectionListOptionalParams,
  AppServiceEnvironmentsGetPrivateEndpointConnectionListResponse,
  AppServiceEnvironmentsResumeNextOptionalParams,
  AppServiceEnvironmentsResumeOptionalParams,
  AppServiceEnvironmentsResumeResponse,
  AppServicePlan,
  AppServiceEnvironmentsListAppServicePlansNextOptionalParams,
  AppServiceEnvironmentsListAppServicePlansOptionalParams,
  AppServiceEnvironmentsListAppServicePlansResponse,
  AppServiceEnvironmentsListWebAppsNextOptionalParams,
  AppServiceEnvironmentsListWebAppsOptionalParams,
  AppServiceEnvironmentsListWebAppsResponse,
  AppServiceEnvironmentsSuspendNextOptionalParams,
  AppServiceEnvironmentsSuspendOptionalParams,
  AppServiceEnvironmentsSuspendResponse,
  CsmUsageQuota,
  AppServiceEnvironmentsListUsagesNextOptionalParams,
  AppServiceEnvironmentsListUsagesOptionalParams,
  AppServiceEnvironmentsListUsagesResponse,
  AppServiceEnvironmentsListWorkerPoolsNextOptionalParams,
  AppServiceEnvironmentsListWorkerPoolsOptionalParams,
  AppServiceEnvironmentsListWorkerPoolsResponse,
  AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsNextOptionalParams,
  AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsOptionalParams,
  AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsResponse,
  AppServiceEnvironmentsListWebWorkerMetricDefinitionsNextOptionalParams,
  AppServiceEnvironmentsListWebWorkerMetricDefinitionsOptionalParams,
  AppServiceEnvironmentsListWebWorkerMetricDefinitionsResponse,
  AppServiceEnvironmentsListWorkerPoolSkusNextOptionalParams,
  AppServiceEnvironmentsListWorkerPoolSkusOptionalParams,
  AppServiceEnvironmentsListWorkerPoolSkusResponse,
  AppServiceEnvironmentsListWebWorkerUsagesNextOptionalParams,
  AppServiceEnvironmentsListWebWorkerUsagesOptionalParams,
  AppServiceEnvironmentsListWebWorkerUsagesResponse,
  AppServiceEnvironmentsGetOptionalParams,
  AppServiceEnvironmentsGetResponse,
  AppServiceEnvironmentsCreateOrUpdateOptionalParams,
  AppServiceEnvironmentsCreateOrUpdateResponse,
  AppServiceEnvironmentsDeleteOptionalParams,
  AppServiceEnvironmentPatchResource,
  AppServiceEnvironmentsUpdateOptionalParams,
  AppServiceEnvironmentsUpdateResponse,
  AppServiceEnvironmentsGetVipInfoOptionalParams,
  AppServiceEnvironmentsGetVipInfoResponse,
  AppServiceEnvironmentsGetAseCustomDnsSuffixConfigurationOptionalParams,
  AppServiceEnvironmentsGetAseCustomDnsSuffixConfigurationResponse,
  CustomDnsSuffixConfiguration,
  AppServiceEnvironmentsUpdateAseCustomDnsSuffixConfigurationOptionalParams,
  AppServiceEnvironmentsUpdateAseCustomDnsSuffixConfigurationResponse,
  AppServiceEnvironmentsDeleteAseCustomDnsSuffixConfigurationOptionalParams,
  AppServiceEnvironmentsDeleteAseCustomDnsSuffixConfigurationResponse,
  AppServiceEnvironmentsGetAseV3NetworkingConfigurationOptionalParams,
  AppServiceEnvironmentsGetAseV3NetworkingConfigurationResponse,
  AseV3NetworkingConfiguration,
  AppServiceEnvironmentsUpdateAseNetworkingConfigurationOptionalParams,
  AppServiceEnvironmentsUpdateAseNetworkingConfigurationResponse,
  AppServiceEnvironmentsListDiagnosticsOptionalParams,
  AppServiceEnvironmentsListDiagnosticsResponse,
  AppServiceEnvironmentsGetDiagnosticsItemOptionalParams,
  AppServiceEnvironmentsGetDiagnosticsItemResponse,
  AppServiceEnvironmentsGetMultiRolePoolOptionalParams,
  AppServiceEnvironmentsGetMultiRolePoolResponse,
  AppServiceEnvironmentsCreateOrUpdateMultiRolePoolOptionalParams,
  AppServiceEnvironmentsCreateOrUpdateMultiRolePoolResponse,
  AppServiceEnvironmentsUpdateMultiRolePoolOptionalParams,
  AppServiceEnvironmentsUpdateMultiRolePoolResponse,
  AppServiceEnvironmentsTestUpgradeAvailableNotificationOptionalParams,
  AppServiceEnvironmentsUpgradeOptionalParams,
  AppServiceEnvironmentsListOperationsOptionalParams,
  AppServiceEnvironmentsListOperationsResponse,
  AppServiceEnvironmentsGetPrivateEndpointConnectionOptionalParams,
  AppServiceEnvironmentsGetPrivateEndpointConnectionResponse,
  PrivateLinkConnectionApprovalRequestResource,
  AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionOptionalParams,
  AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionResponse,
  AppServiceEnvironmentsDeletePrivateEndpointConnectionOptionalParams,
  AppServiceEnvironmentsDeletePrivateEndpointConnectionResponse,
  AppServiceEnvironmentsGetPrivateLinkResourcesOptionalParams,
  AppServiceEnvironmentsGetPrivateLinkResourcesResponse,
  AppServiceEnvironmentsRebootOptionalParams,
  AppServiceEnvironmentsGetWorkerPoolOptionalParams,
  AppServiceEnvironmentsGetWorkerPoolResponse,
  AppServiceEnvironmentsCreateOrUpdateWorkerPoolOptionalParams,
  AppServiceEnvironmentsCreateOrUpdateWorkerPoolResponse,
  AppServiceEnvironmentsUpdateWorkerPoolOptionalParams,
  AppServiceEnvironmentsUpdateWorkerPoolResponse,
  AppServiceEnvironmentsListNextResponse,
  AppServiceEnvironmentsListByResourceGroupNextResponse,
  AppServiceEnvironmentsListCapacitiesNextResponse,
  AppServiceEnvironmentsChangeVnetNextResponse,
  AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsNextResponse,
  AppServiceEnvironmentsListMultiRolePoolsNextResponse,
  AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsNextResponse,
  AppServiceEnvironmentsListMultiRoleMetricDefinitionsNextResponse,
  AppServiceEnvironmentsListMultiRolePoolSkusNextResponse,
  AppServiceEnvironmentsListMultiRoleUsagesNextResponse,
  AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsNextResponse,
  AppServiceEnvironmentsGetPrivateEndpointConnectionListNextResponse,
  AppServiceEnvironmentsResumeNextResponse,
  AppServiceEnvironmentsListAppServicePlansNextResponse,
  AppServiceEnvironmentsListWebAppsNextResponse,
  AppServiceEnvironmentsSuspendNextResponse,
  AppServiceEnvironmentsListUsagesNextResponse,
  AppServiceEnvironmentsListWorkerPoolsNextResponse,
  AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsNextResponse,
  AppServiceEnvironmentsListWebWorkerMetricDefinitionsNextResponse,
  AppServiceEnvironmentsListWorkerPoolSkusNextResponse,
  AppServiceEnvironmentsListWebWorkerUsagesNextResponse
} from "../models";

/// <reference lib="esnext.asynciterable" />
/** Class containing AppServiceEnvironments operations. */
export class AppServiceEnvironmentsImpl implements AppServiceEnvironments {
  private readonly client: WebSiteManagementClient;

  /**
   * Initialize a new instance of the class AppServiceEnvironments class.
   * @param client Reference to the service client
   */
  constructor(client: WebSiteManagementClient) {
    this.client = client;
  }

  /**
   * Description for Get all App Service Environments for a subscription.
   * @param options The options parameters.
   */
  public list(
    options?: AppServiceEnvironmentsListOptionalParams
  ): PagedAsyncIterableIterator<AppServiceEnvironmentResource> {
    const iter = this.listPagingAll(options);
    return {
      next() {
        return iter.next();
      },
      [Symbol.asyncIterator]() {
        return this;
      },
      byPage: (settings?: PageSettings) => {
        if (settings?.maxPageSize) {
          throw new Error("maxPageSize is not supported by this operation.");
        }
        return this.listPagingPage(options, settings);
      }
    };
  }

  private async *listPagingPage(
    options?: AppServiceEnvironmentsListOptionalParams,
    settings?: PageSettings
  ): AsyncIterableIterator<AppServiceEnvironmentResource[]> {
    let result: AppServiceEnvironmentsListResponse;
    let continuationToken = settings?.continuationToken;
    if (!continuationToken) {
      result = await this._list(options);
      let page = result.value || [];
      continuationToken = result.nextLink;
      setContinuationToken(page, continuationToken);
      yield page;
    }
    while (continuationToken) {
      result = await this._listNext(continuationToken, options);
      continuationToken = result.nextLink;
      let page = result.value || [];
      setContinuationToken(page, continuationToken);
      yield page;
    }
  }

  private async *listPagingAll(
    options?: AppServiceEnvironmentsListOptionalParams
  ): AsyncIterableIterator<AppServiceEnvironmentResource> {
    for await (const page of this.listPagingPage(options)) {
      yield* page;
    }
  }

  /**
   * Description for Get all App Service Environments in a resource group.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param options The options parameters.
   */
  public listByResourceGroup(
    resourceGroupName: string,
    options?: AppServiceEnvironmentsListByResourceGroupOptionalParams
  ): PagedAsyncIterableIterator<AppServiceEnvironmentResource> {
    const iter = this.listByResourceGroupPagingAll(resourceGroupName, options);
    return {
      next() {
        return iter.next();
      },
      [Symbol.asyncIterator]() {
        return this;
      },
      byPage: (settings?: PageSettings) => {
        if (settings?.maxPageSize) {
          throw new Error("maxPageSize is not supported by this operation.");
        }
        return this.listByResourceGroupPagingPage(
          resourceGroupName,
          options,
          settings
        );
      }
    };
  }

  private async *listByResourceGroupPagingPage(
    resourceGroupName: string,
    options?: AppServiceEnvironmentsListByResourceGroupOptionalParams,
    settings?: PageSettings
  ): AsyncIterableIterator<AppServiceEnvironmentResource[]> {
    let result: AppServiceEnvironmentsListByResourceGroupResponse;
    let continuationToken = settings?.continuationToken;
    if (!continuationToken) {
      result = await this._listByResourceGroup(resourceGroupName, options);
      let page = result.value || [];
      continuationToken = result.nextLink;
      setContinuationToken(page, continuationToken);
      yield page;
    }
    while (continuationToken) {
      result = await this._listByResourceGroupNext(
        resourceGroupName,
        continuationToken,
        options
      );
      continuationToken = result.nextLink;
      let page = result.value || [];
      setContinuationToken(page, continuationToken);
      yield page;
    }
  }

  private async *listByResourceGroupPagingAll(
    resourceGroupName: string,
    options?: AppServiceEnvironmentsListByResourceGroupOptionalParams
  ): AsyncIterableIterator<AppServiceEnvironmentResource> {
    for await (const page of this.listByResourceGroupPagingPage(
      resourceGroupName,
      options
    )) {
      yield* page;
    }
  }

  /**
   * Description for Get the used, available, and total worker capacity an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  public listCapacities(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListCapacitiesOptionalParams
  ): PagedAsyncIterableIterator<StampCapacity> {
    const iter = this.listCapacitiesPagingAll(resourceGroupName, name, options);
    return {
      next() {
        return iter.next();
      },
      [Symbol.asyncIterator]() {
        return this;
      },
      byPage: (settings?: PageSettings) => {
        if (settings?.maxPageSize) {
          throw new Error("maxPageSize is not supported by this operation.");
        }
        return this.listCapacitiesPagingPage(
          resourceGroupName,
          name,
          options,
          settings
        );
      }
    };
  }

  private async *listCapacitiesPagingPage(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListCapacitiesOptionalParams,
    settings?: PageSettings
  ): AsyncIterableIterator<StampCapacity[]> {
    let result: AppServiceEnvironmentsListCapacitiesResponse;
    let continuationToken = settings?.continuationToken;
    if (!continuationToken) {
      result = await this._listCapacities(resourceGroupName, name, options);
      let page = result.value || [];
      continuationToken = result.nextLink;
      setContinuationToken(page, continuationToken);
      yield page;
    }
    while (continuationToken) {
      result = await this._listCapacitiesNext(
        resourceGroupName,
        name,
        continuationToken,
        options
      );
      continuationToken = result.nextLink;
      let page = result.value || [];
      setContinuationToken(page, continuationToken);
      yield page;
    }
  }

  private async *listCapacitiesPagingAll(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListCapacitiesOptionalParams
  ): AsyncIterableIterator<StampCapacity> {
    for await (const page of this.listCapacitiesPagingPage(
      resourceGroupName,
      name,
      options
    )) {
      yield* page;
    }
  }

  /**
   * Description for Move an App Service Environment to a different VNET.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param vnetInfo Details for the new virtual network.
   * @param options The options parameters.
   */
  public beginListChangeVnetAndWait(
    resourceGroupName: string,
    name: string,
    vnetInfo: VirtualNetworkProfile,
    options?: AppServiceEnvironmentsChangeVnetOptionalParams
  ): PagedAsyncIterableIterator<Site> {
    const iter = this.changeVnetPagingAll(
      resourceGroupName,
      name,
      vnetInfo,
      options
    );
    return {
      next() {
        return iter.next();
      },
      [Symbol.asyncIterator]() {
        return this;
      },
      byPage: (settings?: PageSettings) => {
        if (settings?.maxPageSize) {
          throw new Error("maxPageSize is not supported by this operation.");
        }
        return this.changeVnetPagingPage(
          resourceGroupName,
          name,
          vnetInfo,
          options,
          settings
        );
      }
    };
  }

  private async *changeVnetPagingPage(
    resourceGroupName: string,
    name: string,
    vnetInfo: VirtualNetworkProfile,
    options?: AppServiceEnvironmentsChangeVnetOptionalParams,
    settings?: PageSettings
  ): AsyncIterableIterator<Site[]> {
    let result: AppServiceEnvironmentsChangeVnetResponse;
    let continuationToken = settings?.continuationToken;
    if (!continuationToken) {
      const poller = await this._changeVnet(
        resourceGroupName,
        name,
        vnetInfo,
        options
      );
      result = await poller.pollUntilDone();
      let page = result.value || [];
      continuationToken = result.nextLink;
      setContinuationToken(page, continuationToken);
      yield page;
    }
    while (continuationToken) {
      result = await this._changeVnetNext(
        resourceGroupName,
        name,
        vnetInfo,
        continuationToken,
        options
      );
      continuationToken = result.nextLink;
      let page = result.value || [];
      setContinuationToken(page, continuationToken);
      yield page;
    }
  }

  private async *changeVnetPagingAll(
    resourceGroupName: string,
    name: string,
    vnetInfo: VirtualNetworkProfile,
    options?: AppServiceEnvironmentsChangeVnetOptionalParams
  ): AsyncIterableIterator<Site> {
    for await (const page of this.changeVnetPagingPage(
      resourceGroupName,
      name,
      vnetInfo,
      options
    )) {
      yield* page;
    }
  }

  /**
   * Description for Get the network endpoints of all inbound dependencies of an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  public listInboundNetworkDependenciesEndpoints(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsOptionalParams
  ): PagedAsyncIterableIterator<InboundEnvironmentEndpoint> {
    const iter = this.getInboundNetworkDependenciesEndpointsPagingAll(
      resourceGroupName,
      name,
      options
    );
    return {
      next() {
        return iter.next();
      },
      [Symbol.asyncIterator]() {
        return this;
      },
      byPage: (settings?: PageSettings) => {
        if (settings?.maxPageSize) {
          throw new Error("maxPageSize is not supported by this operation.");
        }
        return this.getInboundNetworkDependenciesEndpointsPagingPage(
          resourceGroupName,
          name,
          options,
          settings
        );
      }
    };
  }

  private async *getInboundNetworkDependenciesEndpointsPagingPage(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsOptionalParams,
    settings?: PageSettings
  ): AsyncIterableIterator<InboundEnvironmentEndpoint[]> {
    let result: AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsResponse;
    let continuationToken = settings?.continuationToken;
    if (!continuationToken) {
      result = await this._getInboundNetworkDependenciesEndpoints(
        resourceGroupName,
        name,
        options
      );
      let page = result.value || [];
      continuationToken = result.nextLink;
      setContinuationToken(page, continuationToken);
      yield page;
    }
    while (continuationToken) {
      result = await this._getInboundNetworkDependenciesEndpointsNext(
        resourceGroupName,
        name,
        continuationToken,
        options
      );
      continuationToken = result.nextLink;
      let page = result.value || [];
      setContinuationToken(page, continuationToken);
      yield page;
    }
  }

  private async *getInboundNetworkDependenciesEndpointsPagingAll(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsOptionalParams
  ): AsyncIterableIterator<InboundEnvironmentEndpoint> {
    for await (const page of this.getInboundNetworkDependenciesEndpointsPagingPage(
      resourceGroupName,
      name,
      options
    )) {
      yield* page;
    }
  }

  /**
   * Description for Get all multi-role pools.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  public listMultiRolePools(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListMultiRolePoolsOptionalParams
  ): PagedAsyncIterableIterator<WorkerPoolResource> {
    const iter = this.listMultiRolePoolsPagingAll(
      resourceGroupName,
      name,
      options
    );
    return {
      next() {
        return iter.next();
      },
      [Symbol.asyncIterator]() {
        return this;
      },
      byPage: (settings?: PageSettings) => {
        if (settings?.maxPageSize) {
          throw new Error("maxPageSize is not supported by this operation.");
        }
        return this.listMultiRolePoolsPagingPage(
          resourceGroupName,
          name,
          options,
          settings
        );
      }
    };
  }

  private async *listMultiRolePoolsPagingPage(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListMultiRolePoolsOptionalParams,
    settings?: PageSettings
  ): AsyncIterableIterator<WorkerPoolResource[]> {
    let result: AppServiceEnvironmentsListMultiRolePoolsResponse;
    let continuationToken = settings?.continuationToken;
    if (!continuationToken) {
      result = await this._listMultiRolePools(resourceGroupName, name, options);
      let page = result.value || [];
      continuationToken = result.nextLink;
      setContinuationToken(page, continuationToken);
      yield page;
    }
    while (continuationToken) {
      result = await this._listMultiRolePoolsNext(
        resourceGroupName,
        name,
        continuationToken,
        options
      );
      continuationToken = result.nextLink;
      let page = result.value || [];
      setContinuationToken(page, continuationToken);
      yield page;
    }
  }

  private async *listMultiRolePoolsPagingAll(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListMultiRolePoolsOptionalParams
  ): AsyncIterableIterator<WorkerPoolResource> {
    for await (const page of this.listMultiRolePoolsPagingPage(
      resourceGroupName,
      name,
      options
    )) {
      yield* page;
    }
  }

  /**
   * Description for Get metric definitions for a specific instance of a multi-role pool of an App
   * Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param instance Name of the instance in the multi-role pool.
   * @param options The options parameters.
   */
  public listMultiRolePoolInstanceMetricDefinitions(
    resourceGroupName: string,
    name: string,
    instance: string,
    options?: AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsOptionalParams
  ): PagedAsyncIterableIterator<ResourceMetricDefinition> {
    const iter = this.listMultiRolePoolInstanceMetricDefinitionsPagingAll(
      resourceGroupName,
      name,
      instance,
      options
    );
    return {
      next() {
        return iter.next();
      },
      [Symbol.asyncIterator]() {
        return this;
      },
      byPage: (settings?: PageSettings) => {
        if (settings?.maxPageSize) {
          throw new Error("maxPageSize is not supported by this operation.");
        }
        return this.listMultiRolePoolInstanceMetricDefinitionsPagingPage(
          resourceGroupName,
          name,
          instance,
          options,
          settings
        );
      }
    };
  }

  private async *listMultiRolePoolInstanceMetricDefinitionsPagingPage(
    resourceGroupName: string,
    name: string,
    instance: string,
    options?: AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsOptionalParams,
    settings?: PageSettings
  ): AsyncIterableIterator<ResourceMetricDefinition[]> {
    let result: AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsResponse;
    let continuationToken = settings?.continuationToken;
    if (!continuationToken) {
      result = await this._listMultiRolePoolInstanceMetricDefinitions(
        resourceGroupName,
        name,
        instance,
        options
      );
      let page = result.value || [];
      continuationToken = result.nextLink;
      setContinuationToken(page, continuationToken);
      yield page;
    }
    while (continuationToken) {
      result = await this._listMultiRolePoolInstanceMetricDefinitionsNext(
        resourceGroupName,
        name,
        instance,
        continuationToken,
        options
      );
      continuationToken = result.nextLink;
      let page = result.value || [];
      setContinuationToken(page, continuationToken);
      yield page;
    }
  }

  private async *listMultiRolePoolInstanceMetricDefinitionsPagingAll(
    resourceGroupName: string,
    name: string,
    instance: string,
    options?: AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsOptionalParams
  ): AsyncIterableIterator<ResourceMetricDefinition> {
    for await (const page of this.listMultiRolePoolInstanceMetricDefinitionsPagingPage(
      resourceGroupName,
      name,
      instance,
      options
    )) {
      yield* page;
    }
  }

  /**
   * Description for Get metric definitions for a multi-role pool of an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  public listMultiRoleMetricDefinitions(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListMultiRoleMetricDefinitionsOptionalParams
  ): PagedAsyncIterableIterator<ResourceMetricDefinition> {
    const iter = this.listMultiRoleMetricDefinitionsPagingAll(
      resourceGroupName,
      name,
      options
    );
    return {
      next() {
        return iter.next();
      },
      [Symbol.asyncIterator]() {
        return this;
      },
      byPage: (settings?: PageSettings) => {
        if (settings?.maxPageSize) {
          throw new Error("maxPageSize is not supported by this operation.");
        }
        return this.listMultiRoleMetricDefinitionsPagingPage(
          resourceGroupName,
          name,
          options,
          settings
        );
      }
    };
  }

  private async *listMultiRoleMetricDefinitionsPagingPage(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListMultiRoleMetricDefinitionsOptionalParams,
    settings?: PageSettings
  ): AsyncIterableIterator<ResourceMetricDefinition[]> {
    let result: AppServiceEnvironmentsListMultiRoleMetricDefinitionsResponse;
    let continuationToken = settings?.continuationToken;
    if (!continuationToken) {
      result = await this._listMultiRoleMetricDefinitions(
        resourceGroupName,
        name,
        options
      );
      let page = result.value || [];
      continuationToken = result.nextLink;
      setContinuationToken(page, continuationToken);
      yield page;
    }
    while (continuationToken) {
      result = await this._listMultiRoleMetricDefinitionsNext(
        resourceGroupName,
        name,
        continuationToken,
        options
      );
      continuationToken = result.nextLink;
      let page = result.value || [];
      setContinuationToken(page, continuationToken);
      yield page;
    }
  }

  private async *listMultiRoleMetricDefinitionsPagingAll(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListMultiRoleMetricDefinitionsOptionalParams
  ): AsyncIterableIterator<ResourceMetricDefinition> {
    for await (const page of this.listMultiRoleMetricDefinitionsPagingPage(
      resourceGroupName,
      name,
      options
    )) {
      yield* page;
    }
  }

  /**
   * Description for Get available SKUs for scaling a multi-role pool.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  public listMultiRolePoolSkus(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListMultiRolePoolSkusOptionalParams
  ): PagedAsyncIterableIterator<SkuInfo> {
    const iter = this.listMultiRolePoolSkusPagingAll(
      resourceGroupName,
      name,
      options
    );
    return {
      next() {
        return iter.next();
      },
      [Symbol.asyncIterator]() {
        return this;
      },
      byPage: (settings?: PageSettings) => {
        if (settings?.maxPageSize) {
          throw new Error("maxPageSize is not supported by this operation.");
        }
        return this.listMultiRolePoolSkusPagingPage(
          resourceGroupName,
          name,
          options,
          settings
        );
      }
    };
  }

  private async *listMultiRolePoolSkusPagingPage(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListMultiRolePoolSkusOptionalParams,
    settings?: PageSettings
  ): AsyncIterableIterator<SkuInfo[]> {
    let result: AppServiceEnvironmentsListMultiRolePoolSkusResponse;
    let continuationToken = settings?.continuationToken;
    if (!continuationToken) {
      result = await this._listMultiRolePoolSkus(
        resourceGroupName,
        name,
        options
      );
      let page = result.value || [];
      continuationToken = result.nextLink;
      setContinuationToken(page, continuationToken);
      yield page;
    }
    while (continuationToken) {
      result = await this._listMultiRolePoolSkusNext(
        resourceGroupName,
        name,
        continuationToken,
        options
      );
      continuationToken = result.nextLink;
      let page = result.value || [];
      setContinuationToken(page, continuationToken);
      yield page;
    }
  }

  private async *listMultiRolePoolSkusPagingAll(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListMultiRolePoolSkusOptionalParams
  ): AsyncIterableIterator<SkuInfo> {
    for await (const page of this.listMultiRolePoolSkusPagingPage(
      resourceGroupName,
      name,
      options
    )) {
      yield* page;
    }
  }

  /**
   * Description for Get usage metrics for a multi-role pool of an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  public listMultiRoleUsages(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListMultiRoleUsagesOptionalParams
  ): PagedAsyncIterableIterator<Usage> {
    const iter = this.listMultiRoleUsagesPagingAll(
      resourceGroupName,
      name,
      options
    );
    return {
      next() {
        return iter.next();
      },
      [Symbol.asyncIterator]() {
        return this;
      },
      byPage: (settings?: PageSettings) => {
        if (settings?.maxPageSize) {
          throw new Error("maxPageSize is not supported by this operation.");
        }
        return this.listMultiRoleUsagesPagingPage(
          resourceGroupName,
          name,
          options,
          settings
        );
      }
    };
  }

  private async *listMultiRoleUsagesPagingPage(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListMultiRoleUsagesOptionalParams,
    settings?: PageSettings
  ): AsyncIterableIterator<Usage[]> {
    let result: AppServiceEnvironmentsListMultiRoleUsagesResponse;
    let continuationToken = settings?.continuationToken;
    if (!continuationToken) {
      result = await this._listMultiRoleUsages(
        resourceGroupName,
        name,
        options
      );
      let page = result.value || [];
      continuationToken = result.nextLink;
      setContinuationToken(page, continuationToken);
      yield page;
    }
    while (continuationToken) {
      result = await this._listMultiRoleUsagesNext(
        resourceGroupName,
        name,
        continuationToken,
        options
      );
      continuationToken = result.nextLink;
      let page = result.value || [];
      setContinuationToken(page, continuationToken);
      yield page;
    }
  }

  private async *listMultiRoleUsagesPagingAll(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListMultiRoleUsagesOptionalParams
  ): AsyncIterableIterator<Usage> {
    for await (const page of this.listMultiRoleUsagesPagingPage(
      resourceGroupName,
      name,
      options
    )) {
      yield* page;
    }
  }

  /**
   * Description for Get the network endpoints of all outbound dependencies of an App Service
   * Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  public listOutboundNetworkDependenciesEndpoints(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsOptionalParams
  ): PagedAsyncIterableIterator<OutboundEnvironmentEndpoint> {
    const iter = this.getOutboundNetworkDependenciesEndpointsPagingAll(
      resourceGroupName,
      name,
      options
    );
    return {
      next() {
        return iter.next();
      },
      [Symbol.asyncIterator]() {
        return this;
      },
      byPage: (settings?: PageSettings) => {
        if (settings?.maxPageSize) {
          throw new Error("maxPageSize is not supported by this operation.");
        }
        return this.getOutboundNetworkDependenciesEndpointsPagingPage(
          resourceGroupName,
          name,
          options,
          settings
        );
      }
    };
  }

  private async *getOutboundNetworkDependenciesEndpointsPagingPage(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsOptionalParams,
    settings?: PageSettings
  ): AsyncIterableIterator<OutboundEnvironmentEndpoint[]> {
    let result: AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsResponse;
    let continuationToken = settings?.continuationToken;
    if (!continuationToken) {
      result = await this._getOutboundNetworkDependenciesEndpoints(
        resourceGroupName,
        name,
        options
      );
      let page = result.value || [];
      continuationToken = result.nextLink;
      setContinuationToken(page, continuationToken);
      yield page;
    }
    while (continuationToken) {
      result = await this._getOutboundNetworkDependenciesEndpointsNext(
        resourceGroupName,
        name,
        continuationToken,
        options
      );
      continuationToken = result.nextLink;
      let page = result.value || [];
      setContinuationToken(page, continuationToken);
      yield page;
    }
  }

  private async *getOutboundNetworkDependenciesEndpointsPagingAll(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsOptionalParams
  ): AsyncIterableIterator<OutboundEnvironmentEndpoint> {
    for await (const page of this.getOutboundNetworkDependenciesEndpointsPagingPage(
      resourceGroupName,
      name,
      options
    )) {
      yield* page;
    }
  }

  /**
   * Description for Gets the list of private endpoints associated with a hosting environment
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  public listPrivateEndpointConnectionList(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsGetPrivateEndpointConnectionListOptionalParams
  ): PagedAsyncIterableIterator<RemotePrivateEndpointConnectionARMResource> {
    const iter = this.getPrivateEndpointConnectionListPagingAll(
      resourceGroupName,
      name,
      options
    );
    return {
      next() {
        return iter.next();
      },
      [Symbol.asyncIterator]() {
        return this;
      },
      byPage: (settings?: PageSettings) => {
        if (settings?.maxPageSize) {
          throw new Error("maxPageSize is not supported by this operation.");
        }
        return this.getPrivateEndpointConnectionListPagingPage(
          resourceGroupName,
          name,
          options,
          settings
        );
      }
    };
  }

  private async *getPrivateEndpointConnectionListPagingPage(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsGetPrivateEndpointConnectionListOptionalParams,
    settings?: PageSettings
  ): AsyncIterableIterator<RemotePrivateEndpointConnectionARMResource[]> {
    let result: AppServiceEnvironmentsGetPrivateEndpointConnectionListResponse;
    let continuationToken = settings?.continuationToken;
    if (!continuationToken) {
      result = await this._getPrivateEndpointConnectionList(
        resourceGroupName,
        name,
        options
      );
      let page = result.value || [];
      continuationToken = result.nextLink;
      setContinuationToken(page, continuationToken);
      yield page;
    }
    while (continuationToken) {
      result = await this._getPrivateEndpointConnectionListNext(
        resourceGroupName,
        name,
        continuationToken,
        options
      );
      continuationToken = result.nextLink;
      let page = result.value || [];
      setContinuationToken(page, continuationToken);
      yield page;
    }
  }

  private async *getPrivateEndpointConnectionListPagingAll(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsGetPrivateEndpointConnectionListOptionalParams
  ): AsyncIterableIterator<RemotePrivateEndpointConnectionARMResource> {
    for await (const page of this.getPrivateEndpointConnectionListPagingPage(
      resourceGroupName,
      name,
      options
    )) {
      yield* page;
    }
  }

  /**
   * Description for Resume an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  public beginListResumeAndWait(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsResumeOptionalParams
  ): PagedAsyncIterableIterator<Site> {
    const iter = this.resumePagingAll(resourceGroupName, name, options);
    return {
      next() {
        return iter.next();
      },
      [Symbol.asyncIterator]() {
        return this;
      },
      byPage: (settings?: PageSettings) => {
        if (settings?.maxPageSize) {
          throw new Error("maxPageSize is not supported by this operation.");
        }
        return this.resumePagingPage(
          resourceGroupName,
          name,
          options,
          settings
        );
      }
    };
  }

  private async *resumePagingPage(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsResumeOptionalParams,
    settings?: PageSettings
  ): AsyncIterableIterator<Site[]> {
    let result: AppServiceEnvironmentsResumeResponse;
    let continuationToken = settings?.continuationToken;
    if (!continuationToken) {
      const poller = await this._resume(resourceGroupName, name, options);
      result = await poller.pollUntilDone();
      let page = result.value || [];
      continuationToken = result.nextLink;
      setContinuationToken(page, continuationToken);
      yield page;
    }
    while (continuationToken) {
      result = await this._resumeNext(
        resourceGroupName,
        name,
        continuationToken,
        options
      );
      continuationToken = result.nextLink;
      let page = result.value || [];
      setContinuationToken(page, continuationToken);
      yield page;
    }
  }

  private async *resumePagingAll(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsResumeOptionalParams
  ): AsyncIterableIterator<Site> {
    for await (const page of this.resumePagingPage(
      resourceGroupName,
      name,
      options
    )) {
      yield* page;
    }
  }

  /**
   * Description for Get all App Service plans in an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  public listAppServicePlans(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListAppServicePlansOptionalParams
  ): PagedAsyncIterableIterator<AppServicePlan> {
    const iter = this.listAppServicePlansPagingAll(
      resourceGroupName,
      name,
      options
    );
    return {
      next() {
        return iter.next();
      },
      [Symbol.asyncIterator]() {
        return this;
      },
      byPage: (settings?: PageSettings) => {
        if (settings?.maxPageSize) {
          throw new Error("maxPageSize is not supported by this operation.");
        }
        return this.listAppServicePlansPagingPage(
          resourceGroupName,
          name,
          options,
          settings
        );
      }
    };
  }

  private async *listAppServicePlansPagingPage(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListAppServicePlansOptionalParams,
    settings?: PageSettings
  ): AsyncIterableIterator<AppServicePlan[]> {
    let result: AppServiceEnvironmentsListAppServicePlansResponse;
    let continuationToken = settings?.continuationToken;
    if (!continuationToken) {
      result = await this._listAppServicePlans(
        resourceGroupName,
        name,
        options
      );
      let page = result.value || [];
      continuationToken = result.nextLink;
      setContinuationToken(page, continuationToken);
      yield page;
    }
    while (continuationToken) {
      result = await this._listAppServicePlansNext(
        resourceGroupName,
        name,
        continuationToken,
        options
      );
      continuationToken = result.nextLink;
      let page = result.value || [];
      setContinuationToken(page, continuationToken);
      yield page;
    }
  }

  private async *listAppServicePlansPagingAll(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListAppServicePlansOptionalParams
  ): AsyncIterableIterator<AppServicePlan> {
    for await (const page of this.listAppServicePlansPagingPage(
      resourceGroupName,
      name,
      options
    )) {
      yield* page;
    }
  }

  /**
   * Description for Get all apps in an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  public listWebApps(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListWebAppsOptionalParams
  ): PagedAsyncIterableIterator<Site> {
    const iter = this.listWebAppsPagingAll(resourceGroupName, name, options);
    return {
      next() {
        return iter.next();
      },
      [Symbol.asyncIterator]() {
        return this;
      },
      byPage: (settings?: PageSettings) => {
        if (settings?.maxPageSize) {
          throw new Error("maxPageSize is not supported by this operation.");
        }
        return this.listWebAppsPagingPage(
          resourceGroupName,
          name,
          options,
          settings
        );
      }
    };
  }

  private async *listWebAppsPagingPage(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListWebAppsOptionalParams,
    settings?: PageSettings
  ): AsyncIterableIterator<Site[]> {
    let result: AppServiceEnvironmentsListWebAppsResponse;
    let continuationToken = settings?.continuationToken;
    if (!continuationToken) {
      result = await this._listWebApps(resourceGroupName, name, options);
      let page = result.value || [];
      continuationToken = result.nextLink;
      setContinuationToken(page, continuationToken);
      yield page;
    }
    while (continuationToken) {
      result = await this._listWebAppsNext(
        resourceGroupName,
        name,
        continuationToken,
        options
      );
      continuationToken = result.nextLink;
      let page = result.value || [];
      setContinuationToken(page, continuationToken);
      yield page;
    }
  }

  private async *listWebAppsPagingAll(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListWebAppsOptionalParams
  ): AsyncIterableIterator<Site> {
    for await (const page of this.listWebAppsPagingPage(
      resourceGroupName,
      name,
      options
    )) {
      yield* page;
    }
  }

  /**
   * Description for Suspend an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  public beginListSuspendAndWait(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsSuspendOptionalParams
  ): PagedAsyncIterableIterator<Site> {
    const iter = this.suspendPagingAll(resourceGroupName, name, options);
    return {
      next() {
        return iter.next();
      },
      [Symbol.asyncIterator]() {
        return this;
      },
      byPage: (settings?: PageSettings) => {
        if (settings?.maxPageSize) {
          throw new Error("maxPageSize is not supported by this operation.");
        }
        return this.suspendPagingPage(
          resourceGroupName,
          name,
          options,
          settings
        );
      }
    };
  }

  private async *suspendPagingPage(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsSuspendOptionalParams,
    settings?: PageSettings
  ): AsyncIterableIterator<Site[]> {
    let result: AppServiceEnvironmentsSuspendResponse;
    let continuationToken = settings?.continuationToken;
    if (!continuationToken) {
      const poller = await this._suspend(resourceGroupName, name, options);
      result = await poller.pollUntilDone();
      let page = result.value || [];
      continuationToken = result.nextLink;
      setContinuationToken(page, continuationToken);
      yield page;
    }
    while (continuationToken) {
      result = await this._suspendNext(
        resourceGroupName,
        name,
        continuationToken,
        options
      );
      continuationToken = result.nextLink;
      let page = result.value || [];
      setContinuationToken(page, continuationToken);
      yield page;
    }
  }

  private async *suspendPagingAll(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsSuspendOptionalParams
  ): AsyncIterableIterator<Site> {
    for await (const page of this.suspendPagingPage(
      resourceGroupName,
      name,
      options
    )) {
      yield* page;
    }
  }

  /**
   * Description for Get global usage metrics of an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  public listUsages(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListUsagesOptionalParams
  ): PagedAsyncIterableIterator<CsmUsageQuota> {
    const iter = this.listUsagesPagingAll(resourceGroupName, name, options);
    return {
      next() {
        return iter.next();
      },
      [Symbol.asyncIterator]() {
        return this;
      },
      byPage: (settings?: PageSettings) => {
        if (settings?.maxPageSize) {
          throw new Error("maxPageSize is not supported by this operation.");
        }
        return this.listUsagesPagingPage(
          resourceGroupName,
          name,
          options,
          settings
        );
      }
    };
  }

  private async *listUsagesPagingPage(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListUsagesOptionalParams,
    settings?: PageSettings
  ): AsyncIterableIterator<CsmUsageQuota[]> {
    let result: AppServiceEnvironmentsListUsagesResponse;
    let continuationToken = settings?.continuationToken;
    if (!continuationToken) {
      result = await this._listUsages(resourceGroupName, name, options);
      let page = result.value || [];
      continuationToken = result.nextLink;
      setContinuationToken(page, continuationToken);
      yield page;
    }
    while (continuationToken) {
      result = await this._listUsagesNext(
        resourceGroupName,
        name,
        continuationToken,
        options
      );
      continuationToken = result.nextLink;
      let page = result.value || [];
      setContinuationToken(page, continuationToken);
      yield page;
    }
  }

  private async *listUsagesPagingAll(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListUsagesOptionalParams
  ): AsyncIterableIterator<CsmUsageQuota> {
    for await (const page of this.listUsagesPagingPage(
      resourceGroupName,
      name,
      options
    )) {
      yield* page;
    }
  }

  /**
   * Description for Get all worker pools of an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  public listWorkerPools(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListWorkerPoolsOptionalParams
  ): PagedAsyncIterableIterator<WorkerPoolResource> {
    const iter = this.listWorkerPoolsPagingAll(
      resourceGroupName,
      name,
      options
    );
    return {
      next() {
        return iter.next();
      },
      [Symbol.asyncIterator]() {
        return this;
      },
      byPage: (settings?: PageSettings) => {
        if (settings?.maxPageSize) {
          throw new Error("maxPageSize is not supported by this operation.");
        }
        return this.listWorkerPoolsPagingPage(
          resourceGroupName,
          name,
          options,
          settings
        );
      }
    };
  }

  private async *listWorkerPoolsPagingPage(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListWorkerPoolsOptionalParams,
    settings?: PageSettings
  ): AsyncIterableIterator<WorkerPoolResource[]> {
    let result: AppServiceEnvironmentsListWorkerPoolsResponse;
    let continuationToken = settings?.continuationToken;
    if (!continuationToken) {
      result = await this._listWorkerPools(resourceGroupName, name, options);
      let page = result.value || [];
      continuationToken = result.nextLink;
      setContinuationToken(page, continuationToken);
      yield page;
    }
    while (continuationToken) {
      result = await this._listWorkerPoolsNext(
        resourceGroupName,
        name,
        continuationToken,
        options
      );
      continuationToken = result.nextLink;
      let page = result.value || [];
      setContinuationToken(page, continuationToken);
      yield page;
    }
  }

  private async *listWorkerPoolsPagingAll(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListWorkerPoolsOptionalParams
  ): AsyncIterableIterator<WorkerPoolResource> {
    for await (const page of this.listWorkerPoolsPagingPage(
      resourceGroupName,
      name,
      options
    )) {
      yield* page;
    }
  }

  /**
   * Description for Get metric definitions for a specific instance of a worker pool of an App Service
   * Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param workerPoolName Name of the worker pool.
   * @param instance Name of the instance in the worker pool.
   * @param options The options parameters.
   */
  public listWorkerPoolInstanceMetricDefinitions(
    resourceGroupName: string,
    name: string,
    workerPoolName: string,
    instance: string,
    options?: AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsOptionalParams
  ): PagedAsyncIterableIterator<ResourceMetricDefinition> {
    const iter = this.listWorkerPoolInstanceMetricDefinitionsPagingAll(
      resourceGroupName,
      name,
      workerPoolName,
      instance,
      options
    );
    return {
      next() {
        return iter.next();
      },
      [Symbol.asyncIterator]() {
        return this;
      },
      byPage: (settings?: PageSettings) => {
        if (settings?.maxPageSize) {
          throw new Error("maxPageSize is not supported by this operation.");
        }
        return this.listWorkerPoolInstanceMetricDefinitionsPagingPage(
          resourceGroupName,
          name,
          workerPoolName,
          instance,
          options,
          settings
        );
      }
    };
  }

  private async *listWorkerPoolInstanceMetricDefinitionsPagingPage(
    resourceGroupName: string,
    name: string,
    workerPoolName: string,
    instance: string,
    options?: AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsOptionalParams,
    settings?: PageSettings
  ): AsyncIterableIterator<ResourceMetricDefinition[]> {
    let result: AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsResponse;
    let continuationToken = settings?.continuationToken;
    if (!continuationToken) {
      result = await this._listWorkerPoolInstanceMetricDefinitions(
        resourceGroupName,
        name,
        workerPoolName,
        instance,
        options
      );
      let page = result.value || [];
      continuationToken = result.nextLink;
      setContinuationToken(page, continuationToken);
      yield page;
    }
    while (continuationToken) {
      result = await this._listWorkerPoolInstanceMetricDefinitionsNext(
        resourceGroupName,
        name,
        workerPoolName,
        instance,
        continuationToken,
        options
      );
      continuationToken = result.nextLink;
      let page = result.value || [];
      setContinuationToken(page, continuationToken);
      yield page;
    }
  }

  private async *listWorkerPoolInstanceMetricDefinitionsPagingAll(
    resourceGroupName: string,
    name: string,
    workerPoolName: string,
    instance: string,
    options?: AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsOptionalParams
  ): AsyncIterableIterator<ResourceMetricDefinition> {
    for await (const page of this.listWorkerPoolInstanceMetricDefinitionsPagingPage(
      resourceGroupName,
      name,
      workerPoolName,
      instance,
      options
    )) {
      yield* page;
    }
  }

  /**
   * Description for Get metric definitions for a worker pool of an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param workerPoolName Name of the worker pool.
   * @param options The options parameters.
   */
  public listWebWorkerMetricDefinitions(
    resourceGroupName: string,
    name: string,
    workerPoolName: string,
    options?: AppServiceEnvironmentsListWebWorkerMetricDefinitionsOptionalParams
  ): PagedAsyncIterableIterator<ResourceMetricDefinition> {
    const iter = this.listWebWorkerMetricDefinitionsPagingAll(
      resourceGroupName,
      name,
      workerPoolName,
      options
    );
    return {
      next() {
        return iter.next();
      },
      [Symbol.asyncIterator]() {
        return this;
      },
      byPage: (settings?: PageSettings) => {
        if (settings?.maxPageSize) {
          throw new Error("maxPageSize is not supported by this operation.");
        }
        return this.listWebWorkerMetricDefinitionsPagingPage(
          resourceGroupName,
          name,
          workerPoolName,
          options,
          settings
        );
      }
    };
  }

  private async *listWebWorkerMetricDefinitionsPagingPage(
    resourceGroupName: string,
    name: string,
    workerPoolName: string,
    options?: AppServiceEnvironmentsListWebWorkerMetricDefinitionsOptionalParams,
    settings?: PageSettings
  ): AsyncIterableIterator<ResourceMetricDefinition[]> {
    let result: AppServiceEnvironmentsListWebWorkerMetricDefinitionsResponse;
    let continuationToken = settings?.continuationToken;
    if (!continuationToken) {
      result = await this._listWebWorkerMetricDefinitions(
        resourceGroupName,
        name,
        workerPoolName,
        options
      );
      let page = result.value || [];
      continuationToken = result.nextLink;
      setContinuationToken(page, continuationToken);
      yield page;
    }
    while (continuationToken) {
      result = await this._listWebWorkerMetricDefinitionsNext(
        resourceGroupName,
        name,
        workerPoolName,
        continuationToken,
        options
      );
      continuationToken = result.nextLink;
      let page = result.value || [];
      setContinuationToken(page, continuationToken);
      yield page;
    }
  }

  private async *listWebWorkerMetricDefinitionsPagingAll(
    resourceGroupName: string,
    name: string,
    workerPoolName: string,
    options?: AppServiceEnvironmentsListWebWorkerMetricDefinitionsOptionalParams
  ): AsyncIterableIterator<ResourceMetricDefinition> {
    for await (const page of this.listWebWorkerMetricDefinitionsPagingPage(
      resourceGroupName,
      name,
      workerPoolName,
      options
    )) {
      yield* page;
    }
  }

  /**
   * Description for Get available SKUs for scaling a worker pool.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param workerPoolName Name of the worker pool.
   * @param options The options parameters.
   */
  public listWorkerPoolSkus(
    resourceGroupName: string,
    name: string,
    workerPoolName: string,
    options?: AppServiceEnvironmentsListWorkerPoolSkusOptionalParams
  ): PagedAsyncIterableIterator<SkuInfo> {
    const iter = this.listWorkerPoolSkusPagingAll(
      resourceGroupName,
      name,
      workerPoolName,
      options
    );
    return {
      next() {
        return iter.next();
      },
      [Symbol.asyncIterator]() {
        return this;
      },
      byPage: (settings?: PageSettings) => {
        if (settings?.maxPageSize) {
          throw new Error("maxPageSize is not supported by this operation.");
        }
        return this.listWorkerPoolSkusPagingPage(
          resourceGroupName,
          name,
          workerPoolName,
          options,
          settings
        );
      }
    };
  }

  private async *listWorkerPoolSkusPagingPage(
    resourceGroupName: string,
    name: string,
    workerPoolName: string,
    options?: AppServiceEnvironmentsListWorkerPoolSkusOptionalParams,
    settings?: PageSettings
  ): AsyncIterableIterator<SkuInfo[]> {
    let result: AppServiceEnvironmentsListWorkerPoolSkusResponse;
    let continuationToken = settings?.continuationToken;
    if (!continuationToken) {
      result = await this._listWorkerPoolSkus(
        resourceGroupName,
        name,
        workerPoolName,
        options
      );
      let page = result.value || [];
      continuationToken = result.nextLink;
      setContinuationToken(page, continuationToken);
      yield page;
    }
    while (continuationToken) {
      result = await this._listWorkerPoolSkusNext(
        resourceGroupName,
        name,
        workerPoolName,
        continuationToken,
        options
      );
      continuationToken = result.nextLink;
      let page = result.value || [];
      setContinuationToken(page, continuationToken);
      yield page;
    }
  }

  private async *listWorkerPoolSkusPagingAll(
    resourceGroupName: string,
    name: string,
    workerPoolName: string,
    options?: AppServiceEnvironmentsListWorkerPoolSkusOptionalParams
  ): AsyncIterableIterator<SkuInfo> {
    for await (const page of this.listWorkerPoolSkusPagingPage(
      resourceGroupName,
      name,
      workerPoolName,
      options
    )) {
      yield* page;
    }
  }

  /**
   * Description for Get usage metrics for a worker pool of an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param workerPoolName Name of the worker pool.
   * @param options The options parameters.
   */
  public listWebWorkerUsages(
    resourceGroupName: string,
    name: string,
    workerPoolName: string,
    options?: AppServiceEnvironmentsListWebWorkerUsagesOptionalParams
  ): PagedAsyncIterableIterator<Usage> {
    const iter = this.listWebWorkerUsagesPagingAll(
      resourceGroupName,
      name,
      workerPoolName,
      options
    );
    return {
      next() {
        return iter.next();
      },
      [Symbol.asyncIterator]() {
        return this;
      },
      byPage: (settings?: PageSettings) => {
        if (settings?.maxPageSize) {
          throw new Error("maxPageSize is not supported by this operation.");
        }
        return this.listWebWorkerUsagesPagingPage(
          resourceGroupName,
          name,
          workerPoolName,
          options,
          settings
        );
      }
    };
  }

  private async *listWebWorkerUsagesPagingPage(
    resourceGroupName: string,
    name: string,
    workerPoolName: string,
    options?: AppServiceEnvironmentsListWebWorkerUsagesOptionalParams,
    settings?: PageSettings
  ): AsyncIterableIterator<Usage[]> {
    let result: AppServiceEnvironmentsListWebWorkerUsagesResponse;
    let continuationToken = settings?.continuationToken;
    if (!continuationToken) {
      result = await this._listWebWorkerUsages(
        resourceGroupName,
        name,
        workerPoolName,
        options
      );
      let page = result.value || [];
      continuationToken = result.nextLink;
      setContinuationToken(page, continuationToken);
      yield page;
    }
    while (continuationToken) {
      result = await this._listWebWorkerUsagesNext(
        resourceGroupName,
        name,
        workerPoolName,
        continuationToken,
        options
      );
      continuationToken = result.nextLink;
      let page = result.value || [];
      setContinuationToken(page, continuationToken);
      yield page;
    }
  }

  private async *listWebWorkerUsagesPagingAll(
    resourceGroupName: string,
    name: string,
    workerPoolName: string,
    options?: AppServiceEnvironmentsListWebWorkerUsagesOptionalParams
  ): AsyncIterableIterator<Usage> {
    for await (const page of this.listWebWorkerUsagesPagingPage(
      resourceGroupName,
      name,
      workerPoolName,
      options
    )) {
      yield* page;
    }
  }

  /**
   * Description for Get all App Service Environments for a subscription.
   * @param options The options parameters.
   */
  private _list(
    options?: AppServiceEnvironmentsListOptionalParams
  ): Promise<AppServiceEnvironmentsListResponse> {
    return this.client.sendOperationRequest({ options }, listOperationSpec);
  }

  /**
   * Description for Get all App Service Environments in a resource group.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param options The options parameters.
   */
  private _listByResourceGroup(
    resourceGroupName: string,
    options?: AppServiceEnvironmentsListByResourceGroupOptionalParams
  ): Promise<AppServiceEnvironmentsListByResourceGroupResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, options },
      listByResourceGroupOperationSpec
    );
  }

  /**
   * Description for Get the properties of an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  get(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsGetOptionalParams
  ): Promise<AppServiceEnvironmentsGetResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, options },
      getOperationSpec
    );
  }

  /**
   * Description for Create or update an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param hostingEnvironmentEnvelope Configuration details of the App Service Environment.
   * @param options The options parameters.
   */
  async beginCreateOrUpdate(
    resourceGroupName: string,
    name: string,
    hostingEnvironmentEnvelope: AppServiceEnvironmentResource,
    options?: AppServiceEnvironmentsCreateOrUpdateOptionalParams
  ): Promise<
    SimplePollerLike<
      OperationState<AppServiceEnvironmentsCreateOrUpdateResponse>,
      AppServiceEnvironmentsCreateOrUpdateResponse
    >
  > {
    const directSendOperation = async (
      args: coreClient.OperationArguments,
      spec: coreClient.OperationSpec
    ): Promise<AppServiceEnvironmentsCreateOrUpdateResponse> => {
      return this.client.sendOperationRequest(args, spec);
    };
    const sendOperationFn = async (
      args: coreClient.OperationArguments,
      spec: coreClient.OperationSpec
    ) => {
      let currentRawResponse:
        | coreClient.FullOperationResponse
        | undefined = undefined;
      const providedCallback = args.options?.onResponse;
      const callback: coreClient.RawResponseCallback = (
        rawResponse: coreClient.FullOperationResponse,
        flatResponse: unknown
      ) => {
        currentRawResponse = rawResponse;
        providedCallback?.(rawResponse, flatResponse);
      };
      const updatedArgs = {
        ...args,
        options: {
          ...args.options,
          onResponse: callback
        }
      };
      const flatResponse = await directSendOperation(updatedArgs, spec);
      return {
        flatResponse,
        rawResponse: {
          statusCode: currentRawResponse!.status,
          body: currentRawResponse!.parsedBody,
          headers: currentRawResponse!.headers.toJSON()
        }
      };
    };

    const lro = createLroSpec({
      sendOperationFn,
      args: { resourceGroupName, name, hostingEnvironmentEnvelope, options },
      spec: createOrUpdateOperationSpec
    });
    const poller = await createHttpPoller<
      AppServiceEnvironmentsCreateOrUpdateResponse,
      OperationState<AppServiceEnvironmentsCreateOrUpdateResponse>
    >(lro, {
      restoreFrom: options?.resumeFrom,
      intervalInMs: options?.updateIntervalInMs
    });
    await poller.poll();
    return poller;
  }

  /**
   * Description for Create or update an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param hostingEnvironmentEnvelope Configuration details of the App Service Environment.
   * @param options The options parameters.
   */
  async beginCreateOrUpdateAndWait(
    resourceGroupName: string,
    name: string,
    hostingEnvironmentEnvelope: AppServiceEnvironmentResource,
    options?: AppServiceEnvironmentsCreateOrUpdateOptionalParams
  ): Promise<AppServiceEnvironmentsCreateOrUpdateResponse> {
    const poller = await this.beginCreateOrUpdate(
      resourceGroupName,
      name,
      hostingEnvironmentEnvelope,
      options
    );
    return poller.pollUntilDone();
  }

  /**
   * Description for Delete an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  async beginDelete(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsDeleteOptionalParams
  ): Promise<SimplePollerLike<OperationState<void>, void>> {
    const directSendOperation = async (
      args: coreClient.OperationArguments,
      spec: coreClient.OperationSpec
    ): Promise<void> => {
      return this.client.sendOperationRequest(args, spec);
    };
    const sendOperationFn = async (
      args: coreClient.OperationArguments,
      spec: coreClient.OperationSpec
    ) => {
      let currentRawResponse:
        | coreClient.FullOperationResponse
        | undefined = undefined;
      const providedCallback = args.options?.onResponse;
      const callback: coreClient.RawResponseCallback = (
        rawResponse: coreClient.FullOperationResponse,
        flatResponse: unknown
      ) => {
        currentRawResponse = rawResponse;
        providedCallback?.(rawResponse, flatResponse);
      };
      const updatedArgs = {
        ...args,
        options: {
          ...args.options,
          onResponse: callback
        }
      };
      const flatResponse = await directSendOperation(updatedArgs, spec);
      return {
        flatResponse,
        rawResponse: {
          statusCode: currentRawResponse!.status,
          body: currentRawResponse!.parsedBody,
          headers: currentRawResponse!.headers.toJSON()
        }
      };
    };

    const lro = createLroSpec({
      sendOperationFn,
      args: { resourceGroupName, name, options },
      spec: deleteOperationSpec
    });
    const poller = await createHttpPoller<void, OperationState<void>>(lro, {
      restoreFrom: options?.resumeFrom,
      intervalInMs: options?.updateIntervalInMs
    });
    await poller.poll();
    return poller;
  }

  /**
   * Description for Delete an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  async beginDeleteAndWait(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsDeleteOptionalParams
  ): Promise<void> {
    const poller = await this.beginDelete(resourceGroupName, name, options);
    return poller.pollUntilDone();
  }

  /**
   * Description for Create or update an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param hostingEnvironmentEnvelope Configuration details of the App Service Environment.
   * @param options The options parameters.
   */
  update(
    resourceGroupName: string,
    name: string,
    hostingEnvironmentEnvelope: AppServiceEnvironmentPatchResource,
    options?: AppServiceEnvironmentsUpdateOptionalParams
  ): Promise<AppServiceEnvironmentsUpdateResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, hostingEnvironmentEnvelope, options },
      updateOperationSpec
    );
  }

  /**
   * Description for Get the used, available, and total worker capacity an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  private _listCapacities(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListCapacitiesOptionalParams
  ): Promise<AppServiceEnvironmentsListCapacitiesResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, options },
      listCapacitiesOperationSpec
    );
  }

  /**
   * Description for Get IP addresses assigned to an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  getVipInfo(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsGetVipInfoOptionalParams
  ): Promise<AppServiceEnvironmentsGetVipInfoResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, options },
      getVipInfoOperationSpec
    );
  }

  /**
   * Description for Move an App Service Environment to a different VNET.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param vnetInfo Details for the new virtual network.
   * @param options The options parameters.
   */
  private async _changeVnet(
    resourceGroupName: string,
    name: string,
    vnetInfo: VirtualNetworkProfile,
    options?: AppServiceEnvironmentsChangeVnetOptionalParams
  ): Promise<
    SimplePollerLike<
      OperationState<AppServiceEnvironmentsChangeVnetResponse>,
      AppServiceEnvironmentsChangeVnetResponse
    >
  > {
    const directSendOperation = async (
      args: coreClient.OperationArguments,
      spec: coreClient.OperationSpec
    ): Promise<AppServiceEnvironmentsChangeVnetResponse> => {
      return this.client.sendOperationRequest(args, spec);
    };
    const sendOperationFn = async (
      args: coreClient.OperationArguments,
      spec: coreClient.OperationSpec
    ) => {
      let currentRawResponse:
        | coreClient.FullOperationResponse
        | undefined = undefined;
      const providedCallback = args.options?.onResponse;
      const callback: coreClient.RawResponseCallback = (
        rawResponse: coreClient.FullOperationResponse,
        flatResponse: unknown
      ) => {
        currentRawResponse = rawResponse;
        providedCallback?.(rawResponse, flatResponse);
      };
      const updatedArgs = {
        ...args,
        options: {
          ...args.options,
          onResponse: callback
        }
      };
      const flatResponse = await directSendOperation(updatedArgs, spec);
      return {
        flatResponse,
        rawResponse: {
          statusCode: currentRawResponse!.status,
          body: currentRawResponse!.parsedBody,
          headers: currentRawResponse!.headers.toJSON()
        }
      };
    };

    const lro = createLroSpec({
      sendOperationFn,
      args: { resourceGroupName, name, vnetInfo, options },
      spec: changeVnetOperationSpec
    });
    const poller = await createHttpPoller<
      AppServiceEnvironmentsChangeVnetResponse,
      OperationState<AppServiceEnvironmentsChangeVnetResponse>
    >(lro, {
      restoreFrom: options?.resumeFrom,
      intervalInMs: options?.updateIntervalInMs
    });
    await poller.poll();
    return poller;
  }

  /**
   * Get Custom Dns Suffix configuration of an App Service Environment
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  getAseCustomDnsSuffixConfiguration(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsGetAseCustomDnsSuffixConfigurationOptionalParams
  ): Promise<AppServiceEnvironmentsGetAseCustomDnsSuffixConfigurationResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, options },
      getAseCustomDnsSuffixConfigurationOperationSpec
    );
  }

  /**
   * Update Custom Dns Suffix configuration of an App Service Environment
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param customDnsSuffixConfiguration Full view of the custom domain suffix configuration for ASEv3.
   * @param options The options parameters.
   */
  updateAseCustomDnsSuffixConfiguration(
    resourceGroupName: string,
    name: string,
    customDnsSuffixConfiguration: CustomDnsSuffixConfiguration,
    options?: AppServiceEnvironmentsUpdateAseCustomDnsSuffixConfigurationOptionalParams
  ): Promise<
    AppServiceEnvironmentsUpdateAseCustomDnsSuffixConfigurationResponse
  > {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, customDnsSuffixConfiguration, options },
      updateAseCustomDnsSuffixConfigurationOperationSpec
    );
  }

  /**
   * Delete Custom Dns Suffix configuration of an App Service Environment
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  deleteAseCustomDnsSuffixConfiguration(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsDeleteAseCustomDnsSuffixConfigurationOptionalParams
  ): Promise<
    AppServiceEnvironmentsDeleteAseCustomDnsSuffixConfigurationResponse
  > {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, options },
      deleteAseCustomDnsSuffixConfigurationOperationSpec
    );
  }

  /**
   * Description for Get networking configuration of an App Service Environment
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  getAseV3NetworkingConfiguration(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsGetAseV3NetworkingConfigurationOptionalParams
  ): Promise<AppServiceEnvironmentsGetAseV3NetworkingConfigurationResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, options },
      getAseV3NetworkingConfigurationOperationSpec
    );
  }

  /**
   * Description for Update networking configuration of an App Service Environment
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param aseNetworkingConfiguration Full view of networking configuration for an ASE.
   * @param options The options parameters.
   */
  updateAseNetworkingConfiguration(
    resourceGroupName: string,
    name: string,
    aseNetworkingConfiguration: AseV3NetworkingConfiguration,
    options?: AppServiceEnvironmentsUpdateAseNetworkingConfigurationOptionalParams
  ): Promise<AppServiceEnvironmentsUpdateAseNetworkingConfigurationResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, aseNetworkingConfiguration, options },
      updateAseNetworkingConfigurationOperationSpec
    );
  }

  /**
   * Description for Get diagnostic information for an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  listDiagnostics(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListDiagnosticsOptionalParams
  ): Promise<AppServiceEnvironmentsListDiagnosticsResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, options },
      listDiagnosticsOperationSpec
    );
  }

  /**
   * Description for Get a diagnostics item for an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param diagnosticsName Name of the diagnostics item.
   * @param options The options parameters.
   */
  getDiagnosticsItem(
    resourceGroupName: string,
    name: string,
    diagnosticsName: string,
    options?: AppServiceEnvironmentsGetDiagnosticsItemOptionalParams
  ): Promise<AppServiceEnvironmentsGetDiagnosticsItemResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, diagnosticsName, options },
      getDiagnosticsItemOperationSpec
    );
  }

  /**
   * Description for Get the network endpoints of all inbound dependencies of an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  private _getInboundNetworkDependenciesEndpoints(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsOptionalParams
  ): Promise<
    AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsResponse
  > {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, options },
      getInboundNetworkDependenciesEndpointsOperationSpec
    );
  }

  /**
   * Description for Get all multi-role pools.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  private _listMultiRolePools(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListMultiRolePoolsOptionalParams
  ): Promise<AppServiceEnvironmentsListMultiRolePoolsResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, options },
      listMultiRolePoolsOperationSpec
    );
  }

  /**
   * Description for Get properties of a multi-role pool.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  getMultiRolePool(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsGetMultiRolePoolOptionalParams
  ): Promise<AppServiceEnvironmentsGetMultiRolePoolResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, options },
      getMultiRolePoolOperationSpec
    );
  }

  /**
   * Description for Create or update a multi-role pool.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param multiRolePoolEnvelope Properties of the multi-role pool.
   * @param options The options parameters.
   */
  async beginCreateOrUpdateMultiRolePool(
    resourceGroupName: string,
    name: string,
    multiRolePoolEnvelope: WorkerPoolResource,
    options?: AppServiceEnvironmentsCreateOrUpdateMultiRolePoolOptionalParams
  ): Promise<
    SimplePollerLike<
      OperationState<AppServiceEnvironmentsCreateOrUpdateMultiRolePoolResponse>,
      AppServiceEnvironmentsCreateOrUpdateMultiRolePoolResponse
    >
  > {
    const directSendOperation = async (
      args: coreClient.OperationArguments,
      spec: coreClient.OperationSpec
    ): Promise<AppServiceEnvironmentsCreateOrUpdateMultiRolePoolResponse> => {
      return this.client.sendOperationRequest(args, spec);
    };
    const sendOperationFn = async (
      args: coreClient.OperationArguments,
      spec: coreClient.OperationSpec
    ) => {
      let currentRawResponse:
        | coreClient.FullOperationResponse
        | undefined = undefined;
      const providedCallback = args.options?.onResponse;
      const callback: coreClient.RawResponseCallback = (
        rawResponse: coreClient.FullOperationResponse,
        flatResponse: unknown
      ) => {
        currentRawResponse = rawResponse;
        providedCallback?.(rawResponse, flatResponse);
      };
      const updatedArgs = {
        ...args,
        options: {
          ...args.options,
          onResponse: callback
        }
      };
      const flatResponse = await directSendOperation(updatedArgs, spec);
      return {
        flatResponse,
        rawResponse: {
          statusCode: currentRawResponse!.status,
          body: currentRawResponse!.parsedBody,
          headers: currentRawResponse!.headers.toJSON()
        }
      };
    };

    const lro = createLroSpec({
      sendOperationFn,
      args: { resourceGroupName, name, multiRolePoolEnvelope, options },
      spec: createOrUpdateMultiRolePoolOperationSpec
    });
    const poller = await createHttpPoller<
      AppServiceEnvironmentsCreateOrUpdateMultiRolePoolResponse,
      OperationState<AppServiceEnvironmentsCreateOrUpdateMultiRolePoolResponse>
    >(lro, {
      restoreFrom: options?.resumeFrom,
      intervalInMs: options?.updateIntervalInMs
    });
    await poller.poll();
    return poller;
  }

  /**
   * Description for Create or update a multi-role pool.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param multiRolePoolEnvelope Properties of the multi-role pool.
   * @param options The options parameters.
   */
  async beginCreateOrUpdateMultiRolePoolAndWait(
    resourceGroupName: string,
    name: string,
    multiRolePoolEnvelope: WorkerPoolResource,
    options?: AppServiceEnvironmentsCreateOrUpdateMultiRolePoolOptionalParams
  ): Promise<AppServiceEnvironmentsCreateOrUpdateMultiRolePoolResponse> {
    const poller = await this.beginCreateOrUpdateMultiRolePool(
      resourceGroupName,
      name,
      multiRolePoolEnvelope,
      options
    );
    return poller.pollUntilDone();
  }

  /**
   * Description for Create or update a multi-role pool.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param multiRolePoolEnvelope Properties of the multi-role pool.
   * @param options The options parameters.
   */
  updateMultiRolePool(
    resourceGroupName: string,
    name: string,
    multiRolePoolEnvelope: WorkerPoolResource,
    options?: AppServiceEnvironmentsUpdateMultiRolePoolOptionalParams
  ): Promise<AppServiceEnvironmentsUpdateMultiRolePoolResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, multiRolePoolEnvelope, options },
      updateMultiRolePoolOperationSpec
    );
  }

  /**
   * Description for Get metric definitions for a specific instance of a multi-role pool of an App
   * Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param instance Name of the instance in the multi-role pool.
   * @param options The options parameters.
   */
  private _listMultiRolePoolInstanceMetricDefinitions(
    resourceGroupName: string,
    name: string,
    instance: string,
    options?: AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsOptionalParams
  ): Promise<
    AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsResponse
  > {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, instance, options },
      listMultiRolePoolInstanceMetricDefinitionsOperationSpec
    );
  }

  /**
   * Description for Get metric definitions for a multi-role pool of an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  private _listMultiRoleMetricDefinitions(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListMultiRoleMetricDefinitionsOptionalParams
  ): Promise<AppServiceEnvironmentsListMultiRoleMetricDefinitionsResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, options },
      listMultiRoleMetricDefinitionsOperationSpec
    );
  }

  /**
   * Description for Get available SKUs for scaling a multi-role pool.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  private _listMultiRolePoolSkus(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListMultiRolePoolSkusOptionalParams
  ): Promise<AppServiceEnvironmentsListMultiRolePoolSkusResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, options },
      listMultiRolePoolSkusOperationSpec
    );
  }

  /**
   * Send a test notification that an upgrade is available for this App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  testUpgradeAvailableNotification(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsTestUpgradeAvailableNotificationOptionalParams
  ): Promise<void> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, options },
      testUpgradeAvailableNotificationOperationSpec
    );
  }

  /**
   * Description for Initiate an upgrade of an App Service Environment if one is available.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  async beginUpgrade(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsUpgradeOptionalParams
  ): Promise<SimplePollerLike<OperationState<void>, void>> {
    const directSendOperation = async (
      args: coreClient.OperationArguments,
      spec: coreClient.OperationSpec
    ): Promise<void> => {
      return this.client.sendOperationRequest(args, spec);
    };
    const sendOperationFn = async (
      args: coreClient.OperationArguments,
      spec: coreClient.OperationSpec
    ) => {
      let currentRawResponse:
        | coreClient.FullOperationResponse
        | undefined = undefined;
      const providedCallback = args.options?.onResponse;
      const callback: coreClient.RawResponseCallback = (
        rawResponse: coreClient.FullOperationResponse,
        flatResponse: unknown
      ) => {
        currentRawResponse = rawResponse;
        providedCallback?.(rawResponse, flatResponse);
      };
      const updatedArgs = {
        ...args,
        options: {
          ...args.options,
          onResponse: callback
        }
      };
      const flatResponse = await directSendOperation(updatedArgs, spec);
      return {
        flatResponse,
        rawResponse: {
          statusCode: currentRawResponse!.status,
          body: currentRawResponse!.parsedBody,
          headers: currentRawResponse!.headers.toJSON()
        }
      };
    };

    const lro = createLroSpec({
      sendOperationFn,
      args: { resourceGroupName, name, options },
      spec: upgradeOperationSpec
    });
    const poller = await createHttpPoller<void, OperationState<void>>(lro, {
      restoreFrom: options?.resumeFrom,
      intervalInMs: options?.updateIntervalInMs
    });
    await poller.poll();
    return poller;
  }

  /**
   * Description for Initiate an upgrade of an App Service Environment if one is available.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  async beginUpgradeAndWait(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsUpgradeOptionalParams
  ): Promise<void> {
    const poller = await this.beginUpgrade(resourceGroupName, name, options);
    return poller.pollUntilDone();
  }

  /**
   * Description for Get usage metrics for a multi-role pool of an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  private _listMultiRoleUsages(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListMultiRoleUsagesOptionalParams
  ): Promise<AppServiceEnvironmentsListMultiRoleUsagesResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, options },
      listMultiRoleUsagesOperationSpec
    );
  }

  /**
   * Description for List all currently running operations on the App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  listOperations(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListOperationsOptionalParams
  ): Promise<AppServiceEnvironmentsListOperationsResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, options },
      listOperationsOperationSpec
    );
  }

  /**
   * Description for Get the network endpoints of all outbound dependencies of an App Service
   * Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  private _getOutboundNetworkDependenciesEndpoints(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsOptionalParams
  ): Promise<
    AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsResponse
  > {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, options },
      getOutboundNetworkDependenciesEndpointsOperationSpec
    );
  }

  /**
   * Description for Gets the list of private endpoints associated with a hosting environment
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  private _getPrivateEndpointConnectionList(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsGetPrivateEndpointConnectionListOptionalParams
  ): Promise<AppServiceEnvironmentsGetPrivateEndpointConnectionListResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, options },
      getPrivateEndpointConnectionListOperationSpec
    );
  }

  /**
   * Description for Gets a private endpoint connection
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param privateEndpointConnectionName Name of the private endpoint connection.
   * @param options The options parameters.
   */
  getPrivateEndpointConnection(
    resourceGroupName: string,
    name: string,
    privateEndpointConnectionName: string,
    options?: AppServiceEnvironmentsGetPrivateEndpointConnectionOptionalParams
  ): Promise<AppServiceEnvironmentsGetPrivateEndpointConnectionResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, privateEndpointConnectionName, options },
      getPrivateEndpointConnectionOperationSpec
    );
  }

  /**
   * Description for Approves or rejects a private endpoint connection
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param privateEndpointConnectionName
   * @param privateEndpointWrapper Private Endpoint Connection Approval ARM resource.
   * @param options The options parameters.
   */
  async beginApproveOrRejectPrivateEndpointConnection(
    resourceGroupName: string,
    name: string,
    privateEndpointConnectionName: string,
    privateEndpointWrapper: PrivateLinkConnectionApprovalRequestResource,
    options?: AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionOptionalParams
  ): Promise<
    SimplePollerLike<
      OperationState<
        AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionResponse
      >,
      AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionResponse
    >
  > {
    const directSendOperation = async (
      args: coreClient.OperationArguments,
      spec: coreClient.OperationSpec
    ): Promise<AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionResponse> => {
      return this.client.sendOperationRequest(args, spec);
    };
    const sendOperationFn = async (
      args: coreClient.OperationArguments,
      spec: coreClient.OperationSpec
    ) => {
      let currentRawResponse:
        | coreClient.FullOperationResponse
        | undefined = undefined;
      const providedCallback = args.options?.onResponse;
      const callback: coreClient.RawResponseCallback = (
        rawResponse: coreClient.FullOperationResponse,
        flatResponse: unknown
      ) => {
        currentRawResponse = rawResponse;
        providedCallback?.(rawResponse, flatResponse);
      };
      const updatedArgs = {
        ...args,
        options: {
          ...args.options,
          onResponse: callback
        }
      };
      const flatResponse = await directSendOperation(updatedArgs, spec);
      return {
        flatResponse,
        rawResponse: {
          statusCode: currentRawResponse!.status,
          body: currentRawResponse!.parsedBody,
          headers: currentRawResponse!.headers.toJSON()
        }
      };
    };

    const lro = createLroSpec({
      sendOperationFn,
      args: {
        resourceGroupName,
        name,
        privateEndpointConnectionName,
        privateEndpointWrapper,
        options
      },
      spec: approveOrRejectPrivateEndpointConnectionOperationSpec
    });
    const poller = await createHttpPoller<
      AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionResponse,
      OperationState<
        AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionResponse
      >
    >(lro, {
      restoreFrom: options?.resumeFrom,
      intervalInMs: options?.updateIntervalInMs
    });
    await poller.poll();
    return poller;
  }

  /**
   * Description for Approves or rejects a private endpoint connection
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param privateEndpointConnectionName
   * @param privateEndpointWrapper Private Endpoint Connection Approval ARM resource.
   * @param options The options parameters.
   */
  async beginApproveOrRejectPrivateEndpointConnectionAndWait(
    resourceGroupName: string,
    name: string,
    privateEndpointConnectionName: string,
    privateEndpointWrapper: PrivateLinkConnectionApprovalRequestResource,
    options?: AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionOptionalParams
  ): Promise<
    AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionResponse
  > {
    const poller = await this.beginApproveOrRejectPrivateEndpointConnection(
      resourceGroupName,
      name,
      privateEndpointConnectionName,
      privateEndpointWrapper,
      options
    );
    return poller.pollUntilDone();
  }

  /**
   * Description for Deletes a private endpoint connection
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param privateEndpointConnectionName
   * @param options The options parameters.
   */
  async beginDeletePrivateEndpointConnection(
    resourceGroupName: string,
    name: string,
    privateEndpointConnectionName: string,
    options?: AppServiceEnvironmentsDeletePrivateEndpointConnectionOptionalParams
  ): Promise<
    SimplePollerLike<
      OperationState<
        AppServiceEnvironmentsDeletePrivateEndpointConnectionResponse
      >,
      AppServiceEnvironmentsDeletePrivateEndpointConnectionResponse
    >
  > {
    const directSendOperation = async (
      args: coreClient.OperationArguments,
      spec: coreClient.OperationSpec
    ): Promise<AppServiceEnvironmentsDeletePrivateEndpointConnectionResponse> => {
      return this.client.sendOperationRequest(args, spec);
    };
    const sendOperationFn = async (
      args: coreClient.OperationArguments,
      spec: coreClient.OperationSpec
    ) => {
      let currentRawResponse:
        | coreClient.FullOperationResponse
        | undefined = undefined;
      const providedCallback = args.options?.onResponse;
      const callback: coreClient.RawResponseCallback = (
        rawResponse: coreClient.FullOperationResponse,
        flatResponse: unknown
      ) => {
        currentRawResponse = rawResponse;
        providedCallback?.(rawResponse, flatResponse);
      };
      const updatedArgs = {
        ...args,
        options: {
          ...args.options,
          onResponse: callback
        }
      };
      const flatResponse = await directSendOperation(updatedArgs, spec);
      return {
        flatResponse,
        rawResponse: {
          statusCode: currentRawResponse!.status,
          body: currentRawResponse!.parsedBody,
          headers: currentRawResponse!.headers.toJSON()
        }
      };
    };

    const lro = createLroSpec({
      sendOperationFn,
      args: { resourceGroupName, name, privateEndpointConnectionName, options },
      spec: deletePrivateEndpointConnectionOperationSpec
    });
    const poller = await createHttpPoller<
      AppServiceEnvironmentsDeletePrivateEndpointConnectionResponse,
      OperationState<
        AppServiceEnvironmentsDeletePrivateEndpointConnectionResponse
      >
    >(lro, {
      restoreFrom: options?.resumeFrom,
      intervalInMs: options?.updateIntervalInMs
    });
    await poller.poll();
    return poller;
  }

  /**
   * Description for Deletes a private endpoint connection
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param privateEndpointConnectionName
   * @param options The options parameters.
   */
  async beginDeletePrivateEndpointConnectionAndWait(
    resourceGroupName: string,
    name: string,
    privateEndpointConnectionName: string,
    options?: AppServiceEnvironmentsDeletePrivateEndpointConnectionOptionalParams
  ): Promise<AppServiceEnvironmentsDeletePrivateEndpointConnectionResponse> {
    const poller = await this.beginDeletePrivateEndpointConnection(
      resourceGroupName,
      name,
      privateEndpointConnectionName,
      options
    );
    return poller.pollUntilDone();
  }

  /**
   * Description for Gets the private link resources
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  getPrivateLinkResources(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsGetPrivateLinkResourcesOptionalParams
  ): Promise<AppServiceEnvironmentsGetPrivateLinkResourcesResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, options },
      getPrivateLinkResourcesOperationSpec
    );
  }

  /**
   * Description for Reboot all machines in an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  reboot(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsRebootOptionalParams
  ): Promise<void> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, options },
      rebootOperationSpec
    );
  }

  /**
   * Description for Resume an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  private async _resume(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsResumeOptionalParams
  ): Promise<
    SimplePollerLike<
      OperationState<AppServiceEnvironmentsResumeResponse>,
      AppServiceEnvironmentsResumeResponse
    >
  > {
    const directSendOperation = async (
      args: coreClient.OperationArguments,
      spec: coreClient.OperationSpec
    ): Promise<AppServiceEnvironmentsResumeResponse> => {
      return this.client.sendOperationRequest(args, spec);
    };
    const sendOperationFn = async (
      args: coreClient.OperationArguments,
      spec: coreClient.OperationSpec
    ) => {
      let currentRawResponse:
        | coreClient.FullOperationResponse
        | undefined = undefined;
      const providedCallback = args.options?.onResponse;
      const callback: coreClient.RawResponseCallback = (
        rawResponse: coreClient.FullOperationResponse,
        flatResponse: unknown
      ) => {
        currentRawResponse = rawResponse;
        providedCallback?.(rawResponse, flatResponse);
      };
      const updatedArgs = {
        ...args,
        options: {
          ...args.options,
          onResponse: callback
        }
      };
      const flatResponse = await directSendOperation(updatedArgs, spec);
      return {
        flatResponse,
        rawResponse: {
          statusCode: currentRawResponse!.status,
          body: currentRawResponse!.parsedBody,
          headers: currentRawResponse!.headers.toJSON()
        }
      };
    };

    const lro = createLroSpec({
      sendOperationFn,
      args: { resourceGroupName, name, options },
      spec: resumeOperationSpec
    });
    const poller = await createHttpPoller<
      AppServiceEnvironmentsResumeResponse,
      OperationState<AppServiceEnvironmentsResumeResponse>
    >(lro, {
      restoreFrom: options?.resumeFrom,
      intervalInMs: options?.updateIntervalInMs
    });
    await poller.poll();
    return poller;
  }

  /**
   * Description for Get all App Service plans in an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  private _listAppServicePlans(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListAppServicePlansOptionalParams
  ): Promise<AppServiceEnvironmentsListAppServicePlansResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, options },
      listAppServicePlansOperationSpec
    );
  }

  /**
   * Description for Get all apps in an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  private _listWebApps(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListWebAppsOptionalParams
  ): Promise<AppServiceEnvironmentsListWebAppsResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, options },
      listWebAppsOperationSpec
    );
  }

  /**
   * Description for Suspend an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  private async _suspend(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsSuspendOptionalParams
  ): Promise<
    SimplePollerLike<
      OperationState<AppServiceEnvironmentsSuspendResponse>,
      AppServiceEnvironmentsSuspendResponse
    >
  > {
    const directSendOperation = async (
      args: coreClient.OperationArguments,
      spec: coreClient.OperationSpec
    ): Promise<AppServiceEnvironmentsSuspendResponse> => {
      return this.client.sendOperationRequest(args, spec);
    };
    const sendOperationFn = async (
      args: coreClient.OperationArguments,
      spec: coreClient.OperationSpec
    ) => {
      let currentRawResponse:
        | coreClient.FullOperationResponse
        | undefined = undefined;
      const providedCallback = args.options?.onResponse;
      const callback: coreClient.RawResponseCallback = (
        rawResponse: coreClient.FullOperationResponse,
        flatResponse: unknown
      ) => {
        currentRawResponse = rawResponse;
        providedCallback?.(rawResponse, flatResponse);
      };
      const updatedArgs = {
        ...args,
        options: {
          ...args.options,
          onResponse: callback
        }
      };
      const flatResponse = await directSendOperation(updatedArgs, spec);
      return {
        flatResponse,
        rawResponse: {
          statusCode: currentRawResponse!.status,
          body: currentRawResponse!.parsedBody,
          headers: currentRawResponse!.headers.toJSON()
        }
      };
    };

    const lro = createLroSpec({
      sendOperationFn,
      args: { resourceGroupName, name, options },
      spec: suspendOperationSpec
    });
    const poller = await createHttpPoller<
      AppServiceEnvironmentsSuspendResponse,
      OperationState<AppServiceEnvironmentsSuspendResponse>
    >(lro, {
      restoreFrom: options?.resumeFrom,
      intervalInMs: options?.updateIntervalInMs
    });
    await poller.poll();
    return poller;
  }

  /**
   * Description for Get global usage metrics of an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  private _listUsages(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListUsagesOptionalParams
  ): Promise<AppServiceEnvironmentsListUsagesResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, options },
      listUsagesOperationSpec
    );
  }

  /**
   * Description for Get all worker pools of an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param options The options parameters.
   */
  private _listWorkerPools(
    resourceGroupName: string,
    name: string,
    options?: AppServiceEnvironmentsListWorkerPoolsOptionalParams
  ): Promise<AppServiceEnvironmentsListWorkerPoolsResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, options },
      listWorkerPoolsOperationSpec
    );
  }

  /**
   * Description for Get properties of a worker pool.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param workerPoolName Name of the worker pool.
   * @param options The options parameters.
   */
  getWorkerPool(
    resourceGroupName: string,
    name: string,
    workerPoolName: string,
    options?: AppServiceEnvironmentsGetWorkerPoolOptionalParams
  ): Promise<AppServiceEnvironmentsGetWorkerPoolResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, workerPoolName, options },
      getWorkerPoolOperationSpec
    );
  }

  /**
   * Description for Create or update a worker pool.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param workerPoolName Name of the worker pool.
   * @param workerPoolEnvelope Properties of the worker pool.
   * @param options The options parameters.
   */
  async beginCreateOrUpdateWorkerPool(
    resourceGroupName: string,
    name: string,
    workerPoolName: string,
    workerPoolEnvelope: WorkerPoolResource,
    options?: AppServiceEnvironmentsCreateOrUpdateWorkerPoolOptionalParams
  ): Promise<
    SimplePollerLike<
      OperationState<AppServiceEnvironmentsCreateOrUpdateWorkerPoolResponse>,
      AppServiceEnvironmentsCreateOrUpdateWorkerPoolResponse
    >
  > {
    const directSendOperation = async (
      args: coreClient.OperationArguments,
      spec: coreClient.OperationSpec
    ): Promise<AppServiceEnvironmentsCreateOrUpdateWorkerPoolResponse> => {
      return this.client.sendOperationRequest(args, spec);
    };
    const sendOperationFn = async (
      args: coreClient.OperationArguments,
      spec: coreClient.OperationSpec
    ) => {
      let currentRawResponse:
        | coreClient.FullOperationResponse
        | undefined = undefined;
      const providedCallback = args.options?.onResponse;
      const callback: coreClient.RawResponseCallback = (
        rawResponse: coreClient.FullOperationResponse,
        flatResponse: unknown
      ) => {
        currentRawResponse = rawResponse;
        providedCallback?.(rawResponse, flatResponse);
      };
      const updatedArgs = {
        ...args,
        options: {
          ...args.options,
          onResponse: callback
        }
      };
      const flatResponse = await directSendOperation(updatedArgs, spec);
      return {
        flatResponse,
        rawResponse: {
          statusCode: currentRawResponse!.status,
          body: currentRawResponse!.parsedBody,
          headers: currentRawResponse!.headers.toJSON()
        }
      };
    };

    const lro = createLroSpec({
      sendOperationFn,
      args: {
        resourceGroupName,
        name,
        workerPoolName,
        workerPoolEnvelope,
        options
      },
      spec: createOrUpdateWorkerPoolOperationSpec
    });
    const poller = await createHttpPoller<
      AppServiceEnvironmentsCreateOrUpdateWorkerPoolResponse,
      OperationState<AppServiceEnvironmentsCreateOrUpdateWorkerPoolResponse>
    >(lro, {
      restoreFrom: options?.resumeFrom,
      intervalInMs: options?.updateIntervalInMs
    });
    await poller.poll();
    return poller;
  }

  /**
   * Description for Create or update a worker pool.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param workerPoolName Name of the worker pool.
   * @param workerPoolEnvelope Properties of the worker pool.
   * @param options The options parameters.
   */
  async beginCreateOrUpdateWorkerPoolAndWait(
    resourceGroupName: string,
    name: string,
    workerPoolName: string,
    workerPoolEnvelope: WorkerPoolResource,
    options?: AppServiceEnvironmentsCreateOrUpdateWorkerPoolOptionalParams
  ): Promise<AppServiceEnvironmentsCreateOrUpdateWorkerPoolResponse> {
    const poller = await this.beginCreateOrUpdateWorkerPool(
      resourceGroupName,
      name,
      workerPoolName,
      workerPoolEnvelope,
      options
    );
    return poller.pollUntilDone();
  }

  /**
   * Description for Create or update a worker pool.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param workerPoolName Name of the worker pool.
   * @param workerPoolEnvelope Properties of the worker pool.
   * @param options The options parameters.
   */
  updateWorkerPool(
    resourceGroupName: string,
    name: string,
    workerPoolName: string,
    workerPoolEnvelope: WorkerPoolResource,
    options?: AppServiceEnvironmentsUpdateWorkerPoolOptionalParams
  ): Promise<AppServiceEnvironmentsUpdateWorkerPoolResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, workerPoolName, workerPoolEnvelope, options },
      updateWorkerPoolOperationSpec
    );
  }

  /**
   * Description for Get metric definitions for a specific instance of a worker pool of an App Service
   * Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param workerPoolName Name of the worker pool.
   * @param instance Name of the instance in the worker pool.
   * @param options The options parameters.
   */
  private _listWorkerPoolInstanceMetricDefinitions(
    resourceGroupName: string,
    name: string,
    workerPoolName: string,
    instance: string,
    options?: AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsOptionalParams
  ): Promise<
    AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsResponse
  > {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, workerPoolName, instance, options },
      listWorkerPoolInstanceMetricDefinitionsOperationSpec
    );
  }

  /**
   * Description for Get metric definitions for a worker pool of an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param workerPoolName Name of the worker pool.
   * @param options The options parameters.
   */
  private _listWebWorkerMetricDefinitions(
    resourceGroupName: string,
    name: string,
    workerPoolName: string,
    options?: AppServiceEnvironmentsListWebWorkerMetricDefinitionsOptionalParams
  ): Promise<AppServiceEnvironmentsListWebWorkerMetricDefinitionsResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, workerPoolName, options },
      listWebWorkerMetricDefinitionsOperationSpec
    );
  }

  /**
   * Description for Get available SKUs for scaling a worker pool.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param workerPoolName Name of the worker pool.
   * @param options The options parameters.
   */
  private _listWorkerPoolSkus(
    resourceGroupName: string,
    name: string,
    workerPoolName: string,
    options?: AppServiceEnvironmentsListWorkerPoolSkusOptionalParams
  ): Promise<AppServiceEnvironmentsListWorkerPoolSkusResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, workerPoolName, options },
      listWorkerPoolSkusOperationSpec
    );
  }

  /**
   * Description for Get usage metrics for a worker pool of an App Service Environment.
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param workerPoolName Name of the worker pool.
   * @param options The options parameters.
   */
  private _listWebWorkerUsages(
    resourceGroupName: string,
    name: string,
    workerPoolName: string,
    options?: AppServiceEnvironmentsListWebWorkerUsagesOptionalParams
  ): Promise<AppServiceEnvironmentsListWebWorkerUsagesResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, workerPoolName, options },
      listWebWorkerUsagesOperationSpec
    );
  }

  /**
   * ListNext
   * @param nextLink The nextLink from the previous successful call to the List method.
   * @param options The options parameters.
   */
  private _listNext(
    nextLink: string,
    options?: AppServiceEnvironmentsListNextOptionalParams
  ): Promise<AppServiceEnvironmentsListNextResponse> {
    return this.client.sendOperationRequest(
      { nextLink, options },
      listNextOperationSpec
    );
  }

  /**
   * ListByResourceGroupNext
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method.
   * @param options The options parameters.
   */
  private _listByResourceGroupNext(
    resourceGroupName: string,
    nextLink: string,
    options?: AppServiceEnvironmentsListByResourceGroupNextOptionalParams
  ): Promise<AppServiceEnvironmentsListByResourceGroupNextResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, nextLink, options },
      listByResourceGroupNextOperationSpec
    );
  }

  /**
   * ListCapacitiesNext
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param nextLink The nextLink from the previous successful call to the ListCapacities method.
   * @param options The options parameters.
   */
  private _listCapacitiesNext(
    resourceGroupName: string,
    name: string,
    nextLink: string,
    options?: AppServiceEnvironmentsListCapacitiesNextOptionalParams
  ): Promise<AppServiceEnvironmentsListCapacitiesNextResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, nextLink, options },
      listCapacitiesNextOperationSpec
    );
  }

  /**
   * ChangeVnetNext
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param vnetInfo Details for the new virtual network.
   * @param nextLink The nextLink from the previous successful call to the ChangeVnet method.
   * @param options The options parameters.
   */
  private _changeVnetNext(
    resourceGroupName: string,
    name: string,
    vnetInfo: VirtualNetworkProfile,
    nextLink: string,
    options?: AppServiceEnvironmentsChangeVnetNextOptionalParams
  ): Promise<AppServiceEnvironmentsChangeVnetNextResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, vnetInfo, nextLink, options },
      changeVnetNextOperationSpec
    );
  }

  /**
   * GetInboundNetworkDependenciesEndpointsNext
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param nextLink The nextLink from the previous successful call to the
   *                 GetInboundNetworkDependenciesEndpoints method.
   * @param options The options parameters.
   */
  private _getInboundNetworkDependenciesEndpointsNext(
    resourceGroupName: string,
    name: string,
    nextLink: string,
    options?: AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsNextOptionalParams
  ): Promise<
    AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsNextResponse
  > {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, nextLink, options },
      getInboundNetworkDependenciesEndpointsNextOperationSpec
    );
  }

  /**
   * ListMultiRolePoolsNext
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param nextLink The nextLink from the previous successful call to the ListMultiRolePools method.
   * @param options The options parameters.
   */
  private _listMultiRolePoolsNext(
    resourceGroupName: string,
    name: string,
    nextLink: string,
    options?: AppServiceEnvironmentsListMultiRolePoolsNextOptionalParams
  ): Promise<AppServiceEnvironmentsListMultiRolePoolsNextResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, nextLink, options },
      listMultiRolePoolsNextOperationSpec
    );
  }

  /**
   * ListMultiRolePoolInstanceMetricDefinitionsNext
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param instance Name of the instance in the multi-role pool.
   * @param nextLink The nextLink from the previous successful call to the
   *                 ListMultiRolePoolInstanceMetricDefinitions method.
   * @param options The options parameters.
   */
  private _listMultiRolePoolInstanceMetricDefinitionsNext(
    resourceGroupName: string,
    name: string,
    instance: string,
    nextLink: string,
    options?: AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsNextOptionalParams
  ): Promise<
    AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsNextResponse
  > {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, instance, nextLink, options },
      listMultiRolePoolInstanceMetricDefinitionsNextOperationSpec
    );
  }

  /**
   * ListMultiRoleMetricDefinitionsNext
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param nextLink The nextLink from the previous successful call to the ListMultiRoleMetricDefinitions
   *                 method.
   * @param options The options parameters.
   */
  private _listMultiRoleMetricDefinitionsNext(
    resourceGroupName: string,
    name: string,
    nextLink: string,
    options?: AppServiceEnvironmentsListMultiRoleMetricDefinitionsNextOptionalParams
  ): Promise<AppServiceEnvironmentsListMultiRoleMetricDefinitionsNextResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, nextLink, options },
      listMultiRoleMetricDefinitionsNextOperationSpec
    );
  }

  /**
   * ListMultiRolePoolSkusNext
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param nextLink The nextLink from the previous successful call to the ListMultiRolePoolSkus method.
   * @param options The options parameters.
   */
  private _listMultiRolePoolSkusNext(
    resourceGroupName: string,
    name: string,
    nextLink: string,
    options?: AppServiceEnvironmentsListMultiRolePoolSkusNextOptionalParams
  ): Promise<AppServiceEnvironmentsListMultiRolePoolSkusNextResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, nextLink, options },
      listMultiRolePoolSkusNextOperationSpec
    );
  }

  /**
   * ListMultiRoleUsagesNext
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param nextLink The nextLink from the previous successful call to the ListMultiRoleUsages method.
   * @param options The options parameters.
   */
  private _listMultiRoleUsagesNext(
    resourceGroupName: string,
    name: string,
    nextLink: string,
    options?: AppServiceEnvironmentsListMultiRoleUsagesNextOptionalParams
  ): Promise<AppServiceEnvironmentsListMultiRoleUsagesNextResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, nextLink, options },
      listMultiRoleUsagesNextOperationSpec
    );
  }

  /**
   * GetOutboundNetworkDependenciesEndpointsNext
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param nextLink The nextLink from the previous successful call to the
   *                 GetOutboundNetworkDependenciesEndpoints method.
   * @param options The options parameters.
   */
  private _getOutboundNetworkDependenciesEndpointsNext(
    resourceGroupName: string,
    name: string,
    nextLink: string,
    options?: AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsNextOptionalParams
  ): Promise<
    AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsNextResponse
  > {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, nextLink, options },
      getOutboundNetworkDependenciesEndpointsNextOperationSpec
    );
  }

  /**
   * GetPrivateEndpointConnectionListNext
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param nextLink The nextLink from the previous successful call to the
   *                 GetPrivateEndpointConnectionList method.
   * @param options The options parameters.
   */
  private _getPrivateEndpointConnectionListNext(
    resourceGroupName: string,
    name: string,
    nextLink: string,
    options?: AppServiceEnvironmentsGetPrivateEndpointConnectionListNextOptionalParams
  ): Promise<
    AppServiceEnvironmentsGetPrivateEndpointConnectionListNextResponse
  > {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, nextLink, options },
      getPrivateEndpointConnectionListNextOperationSpec
    );
  }

  /**
   * ResumeNext
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param nextLink The nextLink from the previous successful call to the Resume method.
   * @param options The options parameters.
   */
  private _resumeNext(
    resourceGroupName: string,
    name: string,
    nextLink: string,
    options?: AppServiceEnvironmentsResumeNextOptionalParams
  ): Promise<AppServiceEnvironmentsResumeNextResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, nextLink, options },
      resumeNextOperationSpec
    );
  }

  /**
   * ListAppServicePlansNext
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param nextLink The nextLink from the previous successful call to the ListAppServicePlans method.
   * @param options The options parameters.
   */
  private _listAppServicePlansNext(
    resourceGroupName: string,
    name: string,
    nextLink: string,
    options?: AppServiceEnvironmentsListAppServicePlansNextOptionalParams
  ): Promise<AppServiceEnvironmentsListAppServicePlansNextResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, nextLink, options },
      listAppServicePlansNextOperationSpec
    );
  }

  /**
   * ListWebAppsNext
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param nextLink The nextLink from the previous successful call to the ListWebApps method.
   * @param options The options parameters.
   */
  private _listWebAppsNext(
    resourceGroupName: string,
    name: string,
    nextLink: string,
    options?: AppServiceEnvironmentsListWebAppsNextOptionalParams
  ): Promise<AppServiceEnvironmentsListWebAppsNextResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, nextLink, options },
      listWebAppsNextOperationSpec
    );
  }

  /**
   * SuspendNext
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param nextLink The nextLink from the previous successful call to the Suspend method.
   * @param options The options parameters.
   */
  private _suspendNext(
    resourceGroupName: string,
    name: string,
    nextLink: string,
    options?: AppServiceEnvironmentsSuspendNextOptionalParams
  ): Promise<AppServiceEnvironmentsSuspendNextResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, nextLink, options },
      suspendNextOperationSpec
    );
  }

  /**
   * ListUsagesNext
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param nextLink The nextLink from the previous successful call to the ListUsages method.
   * @param options The options parameters.
   */
  private _listUsagesNext(
    resourceGroupName: string,
    name: string,
    nextLink: string,
    options?: AppServiceEnvironmentsListUsagesNextOptionalParams
  ): Promise<AppServiceEnvironmentsListUsagesNextResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, nextLink, options },
      listUsagesNextOperationSpec
    );
  }

  /**
   * ListWorkerPoolsNext
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param nextLink The nextLink from the previous successful call to the ListWorkerPools method.
   * @param options The options parameters.
   */
  private _listWorkerPoolsNext(
    resourceGroupName: string,
    name: string,
    nextLink: string,
    options?: AppServiceEnvironmentsListWorkerPoolsNextOptionalParams
  ): Promise<AppServiceEnvironmentsListWorkerPoolsNextResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, nextLink, options },
      listWorkerPoolsNextOperationSpec
    );
  }

  /**
   * ListWorkerPoolInstanceMetricDefinitionsNext
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param workerPoolName Name of the worker pool.
   * @param instance Name of the instance in the worker pool.
   * @param nextLink The nextLink from the previous successful call to the
   *                 ListWorkerPoolInstanceMetricDefinitions method.
   * @param options The options parameters.
   */
  private _listWorkerPoolInstanceMetricDefinitionsNext(
    resourceGroupName: string,
    name: string,
    workerPoolName: string,
    instance: string,
    nextLink: string,
    options?: AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsNextOptionalParams
  ): Promise<
    AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsNextResponse
  > {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, workerPoolName, instance, nextLink, options },
      listWorkerPoolInstanceMetricDefinitionsNextOperationSpec
    );
  }

  /**
   * ListWebWorkerMetricDefinitionsNext
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param workerPoolName Name of the worker pool.
   * @param nextLink The nextLink from the previous successful call to the ListWebWorkerMetricDefinitions
   *                 method.
   * @param options The options parameters.
   */
  private _listWebWorkerMetricDefinitionsNext(
    resourceGroupName: string,
    name: string,
    workerPoolName: string,
    nextLink: string,
    options?: AppServiceEnvironmentsListWebWorkerMetricDefinitionsNextOptionalParams
  ): Promise<AppServiceEnvironmentsListWebWorkerMetricDefinitionsNextResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, workerPoolName, nextLink, options },
      listWebWorkerMetricDefinitionsNextOperationSpec
    );
  }

  /**
   * ListWorkerPoolSkusNext
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param workerPoolName Name of the worker pool.
   * @param nextLink The nextLink from the previous successful call to the ListWorkerPoolSkus method.
   * @param options The options parameters.
   */
  private _listWorkerPoolSkusNext(
    resourceGroupName: string,
    name: string,
    workerPoolName: string,
    nextLink: string,
    options?: AppServiceEnvironmentsListWorkerPoolSkusNextOptionalParams
  ): Promise<AppServiceEnvironmentsListWorkerPoolSkusNextResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, workerPoolName, nextLink, options },
      listWorkerPoolSkusNextOperationSpec
    );
  }

  /**
   * ListWebWorkerUsagesNext
   * @param resourceGroupName Name of the resource group to which the resource belongs.
   * @param name Name of the App Service Environment.
   * @param workerPoolName Name of the worker pool.
   * @param nextLink The nextLink from the previous successful call to the ListWebWorkerUsages method.
   * @param options The options parameters.
   */
  private _listWebWorkerUsagesNext(
    resourceGroupName: string,
    name: string,
    workerPoolName: string,
    nextLink: string,
    options?: AppServiceEnvironmentsListWebWorkerUsagesNextOptionalParams
  ): Promise<AppServiceEnvironmentsListWebWorkerUsagesNextResponse> {
    return this.client.sendOperationRequest(
      { resourceGroupName, name, workerPoolName, nextLink, options },
      listWebWorkerUsagesNextOperationSpec
    );
  }
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);

const listOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/providers/Microsoft.Web/hostingEnvironments",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.AppServiceEnvironmentCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [Parameters.$host, Parameters.subscriptionId],
  headerParameters: [Parameters.accept],
  serializer
};
const listByResourceGroupOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.AppServiceEnvironmentCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const getOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.AppServiceEnvironmentResource
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const createOrUpdateOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}",
  httpMethod: "PUT",
  responses: {
    200: {
      bodyMapper: Mappers.AppServiceEnvironmentResource
    },
    201: {
      bodyMapper: Mappers.AppServiceEnvironmentResource
    },
    202: {
      bodyMapper: Mappers.AppServiceEnvironmentResource
    },
    204: {
      bodyMapper: Mappers.AppServiceEnvironmentResource
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  requestBody: Parameters.hostingEnvironmentEnvelope,
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept, Parameters.contentType],
  mediaType: "json",
  serializer
};
const deleteOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}",
  httpMethod: "DELETE",
  responses: {
    200: {},
    201: {},
    202: {},
    204: {},
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion, Parameters.forceDelete],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const updateOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}",
  httpMethod: "PATCH",
  responses: {
    200: {
      bodyMapper: Mappers.AppServiceEnvironmentResource
    },
    201: {
      bodyMapper: Mappers.AppServiceEnvironmentResource
    },
    202: {
      bodyMapper: Mappers.AppServiceEnvironmentResource
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  requestBody: Parameters.hostingEnvironmentEnvelope1,
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept, Parameters.contentType],
  mediaType: "json",
  serializer
};
const listCapacitiesOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/capacities/compute",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.StampCapacityCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const getVipInfoOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/capacities/virtualip",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.AddressResponse
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const changeVnetOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/changeVirtualNetwork",
  httpMethod: "POST",
  responses: {
    200: {
      bodyMapper: Mappers.WebAppCollection
    },
    201: {
      bodyMapper: Mappers.WebAppCollection
    },
    202: {
      bodyMapper: Mappers.WebAppCollection
    },
    204: {
      bodyMapper: Mappers.WebAppCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  requestBody: Parameters.vnetInfo,
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept, Parameters.contentType],
  mediaType: "json",
  serializer
};
const getAseCustomDnsSuffixConfigurationOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/customdnssuffix",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.CustomDnsSuffixConfiguration
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const updateAseCustomDnsSuffixConfigurationOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/customdnssuffix",
  httpMethod: "PUT",
  responses: {
    200: {
      bodyMapper: Mappers.CustomDnsSuffixConfiguration
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  requestBody: Parameters.customDnsSuffixConfiguration,
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept, Parameters.contentType],
  mediaType: "json",
  serializer
};
const deleteAseCustomDnsSuffixConfigurationOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/customdnssuffix",
  httpMethod: "DELETE",
  responses: {
    200: {
      bodyMapper: {
        type: { name: "Dictionary", value: { type: { name: "any" } } }
      }
    },
    204: {
      bodyMapper: {
        type: { name: "Dictionary", value: { type: { name: "any" } } }
      }
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const getAseV3NetworkingConfigurationOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/networking",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.AseV3NetworkingConfiguration
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const updateAseNetworkingConfigurationOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/networking",
  httpMethod: "PUT",
  responses: {
    200: {
      bodyMapper: Mappers.AseV3NetworkingConfiguration
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  requestBody: Parameters.aseNetworkingConfiguration,
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept, Parameters.contentType],
  mediaType: "json",
  serializer
};
const listDiagnosticsOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: {
        type: {
          name: "Sequence",
          element: {
            type: {
              name: "Composite",
              className: "HostingEnvironmentDiagnostics"
            }
          }
        }
      }
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const getDiagnosticsItemOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics/{diagnosticsName}",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.HostingEnvironmentDiagnostics
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.diagnosticsName
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const getInboundNetworkDependenciesEndpointsOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/inboundNetworkDependenciesEndpoints",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.InboundEnvironmentEndpointCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const listMultiRolePoolsOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.WorkerPoolCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const getMultiRolePoolOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.WorkerPoolResource
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const createOrUpdateMultiRolePoolOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default",
  httpMethod: "PUT",
  responses: {
    200: {
      bodyMapper: Mappers.WorkerPoolResource
    },
    201: {
      bodyMapper: Mappers.WorkerPoolResource
    },
    202: {
      bodyMapper: Mappers.WorkerPoolResource
    },
    204: {
      bodyMapper: Mappers.WorkerPoolResource
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  requestBody: Parameters.multiRolePoolEnvelope,
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept, Parameters.contentType],
  mediaType: "json",
  serializer
};
const updateMultiRolePoolOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default",
  httpMethod: "PATCH",
  responses: {
    200: {
      bodyMapper: Mappers.WorkerPoolResource
    },
    202: {
      bodyMapper: Mappers.WorkerPoolResource
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  requestBody: Parameters.multiRolePoolEnvelope,
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept, Parameters.contentType],
  mediaType: "json",
  serializer
};
const listMultiRolePoolInstanceMetricDefinitionsOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metricdefinitions",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.ResourceMetricDefinitionCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.instance
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const listMultiRoleMetricDefinitionsOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/metricdefinitions",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.ResourceMetricDefinitionCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const listMultiRolePoolSkusOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/skus",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.SkuInfoCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const testUpgradeAvailableNotificationOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/testUpgradeAvailableNotification",
  httpMethod: "POST",
  responses: {
    200: {},
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const upgradeOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/upgrade",
  httpMethod: "POST",
  responses: {
    200: {},
    201: {},
    202: {},
    204: {},
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const listMultiRoleUsagesOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/usages",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.UsageCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const listOperationsOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/operations",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: {
        type: {
          name: "Sequence",
          element: { type: { name: "Composite", className: "Operation" } }
        }
      }
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const getOutboundNetworkDependenciesEndpointsOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/outboundNetworkDependenciesEndpoints",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.OutboundEnvironmentEndpointCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const getPrivateEndpointConnectionListOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.PrivateEndpointConnectionCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const getPrivateEndpointConnectionOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections/{privateEndpointConnectionName}",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.RemotePrivateEndpointConnectionARMResource
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.privateEndpointConnectionName
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const approveOrRejectPrivateEndpointConnectionOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections/{privateEndpointConnectionName}",
  httpMethod: "PUT",
  responses: {
    200: {
      bodyMapper: Mappers.RemotePrivateEndpointConnectionARMResource
    },
    201: {
      bodyMapper: Mappers.RemotePrivateEndpointConnectionARMResource
    },
    202: {
      bodyMapper: Mappers.RemotePrivateEndpointConnectionARMResource
    },
    204: {
      bodyMapper: Mappers.RemotePrivateEndpointConnectionARMResource
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  requestBody: Parameters.privateEndpointWrapper,
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.privateEndpointConnectionName
  ],
  headerParameters: [Parameters.accept, Parameters.contentType],
  mediaType: "json",
  serializer
};
const deletePrivateEndpointConnectionOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections/{privateEndpointConnectionName}",
  httpMethod: "DELETE",
  responses: {
    200: {
      bodyMapper: {
        type: { name: "Dictionary", value: { type: { name: "any" } } }
      }
    },
    201: {
      bodyMapper: {
        type: { name: "Dictionary", value: { type: { name: "any" } } }
      }
    },
    202: {
      bodyMapper: {
        type: { name: "Dictionary", value: { type: { name: "any" } } }
      }
    },
    204: {
      bodyMapper: {
        type: { name: "Dictionary", value: { type: { name: "any" } } }
      }
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.privateEndpointConnectionName
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const getPrivateLinkResourcesOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateLinkResources",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.PrivateLinkResourcesWrapper
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const rebootOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/reboot",
  httpMethod: "POST",
  responses: {
    202: {},
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const resumeOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/resume",
  httpMethod: "POST",
  responses: {
    200: {
      bodyMapper: Mappers.WebAppCollection
    },
    201: {
      bodyMapper: Mappers.WebAppCollection
    },
    202: {
      bodyMapper: Mappers.WebAppCollection
    },
    204: {
      bodyMapper: Mappers.WebAppCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const listAppServicePlansOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/serverfarms",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.AppServicePlanCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const listWebAppsOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/sites",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.WebAppCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion, Parameters.propertiesToInclude],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const suspendOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/suspend",
  httpMethod: "POST",
  responses: {
    200: {
      bodyMapper: Mappers.WebAppCollection
    },
    201: {
      bodyMapper: Mappers.WebAppCollection
    },
    202: {
      bodyMapper: Mappers.WebAppCollection
    },
    204: {
      bodyMapper: Mappers.WebAppCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const listUsagesOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/usages",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.CsmUsageQuotaCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion, Parameters.filter],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const listWorkerPoolsOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.WorkerPoolCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const getWorkerPoolOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.WorkerPoolResource
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.workerPoolName
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const createOrUpdateWorkerPoolOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}",
  httpMethod: "PUT",
  responses: {
    200: {
      bodyMapper: Mappers.WorkerPoolResource
    },
    201: {
      bodyMapper: Mappers.WorkerPoolResource
    },
    202: {
      bodyMapper: Mappers.WorkerPoolResource
    },
    204: {
      bodyMapper: Mappers.WorkerPoolResource
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  requestBody: Parameters.workerPoolEnvelope,
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.workerPoolName
  ],
  headerParameters: [Parameters.accept, Parameters.contentType],
  mediaType: "json",
  serializer
};
const updateWorkerPoolOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}",
  httpMethod: "PATCH",
  responses: {
    200: {
      bodyMapper: Mappers.WorkerPoolResource
    },
    202: {
      bodyMapper: Mappers.WorkerPoolResource
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  requestBody: Parameters.workerPoolEnvelope,
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.workerPoolName
  ],
  headerParameters: [Parameters.accept, Parameters.contentType],
  mediaType: "json",
  serializer
};
const listWorkerPoolInstanceMetricDefinitionsOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}/metricdefinitions",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.ResourceMetricDefinitionCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.instance,
    Parameters.workerPoolName
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const listWebWorkerMetricDefinitionsOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/metricdefinitions",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.ResourceMetricDefinitionCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.workerPoolName
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const listWorkerPoolSkusOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/skus",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.SkuInfoCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.workerPoolName
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const listWebWorkerUsagesOperationSpec: coreClient.OperationSpec = {
  path:
    "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/usages",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.UsageCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  queryParameters: [Parameters.apiVersion],
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.workerPoolName
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const listNextOperationSpec: coreClient.OperationSpec = {
  path: "{nextLink}",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.AppServiceEnvironmentCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.nextLink
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
  path: "{nextLink}",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.AppServiceEnvironmentCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.nextLink
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const listCapacitiesNextOperationSpec: coreClient.OperationSpec = {
  path: "{nextLink}",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.StampCapacityCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.nextLink
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const changeVnetNextOperationSpec: coreClient.OperationSpec = {
  path: "{nextLink}",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.WebAppCollection
    },
    202: {
      bodyMapper: Mappers.WebAppCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.nextLink
  ],
  headerParameters: [Parameters.accept, Parameters.contentType],
  mediaType: "json",
  serializer
};
const getInboundNetworkDependenciesEndpointsNextOperationSpec: coreClient.OperationSpec = {
  path: "{nextLink}",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.InboundEnvironmentEndpointCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.nextLink
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const listMultiRolePoolsNextOperationSpec: coreClient.OperationSpec = {
  path: "{nextLink}",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.WorkerPoolCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.nextLink
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const listMultiRolePoolInstanceMetricDefinitionsNextOperationSpec: coreClient.OperationSpec = {
  path: "{nextLink}",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.ResourceMetricDefinitionCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.nextLink,
    Parameters.instance
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const listMultiRoleMetricDefinitionsNextOperationSpec: coreClient.OperationSpec = {
  path: "{nextLink}",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.ResourceMetricDefinitionCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.nextLink
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const listMultiRolePoolSkusNextOperationSpec: coreClient.OperationSpec = {
  path: "{nextLink}",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.SkuInfoCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.nextLink
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const listMultiRoleUsagesNextOperationSpec: coreClient.OperationSpec = {
  path: "{nextLink}",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.UsageCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.nextLink
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const getOutboundNetworkDependenciesEndpointsNextOperationSpec: coreClient.OperationSpec = {
  path: "{nextLink}",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.OutboundEnvironmentEndpointCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.nextLink
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const getPrivateEndpointConnectionListNextOperationSpec: coreClient.OperationSpec = {
  path: "{nextLink}",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.PrivateEndpointConnectionCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.nextLink
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const resumeNextOperationSpec: coreClient.OperationSpec = {
  path: "{nextLink}",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.WebAppCollection
    },
    202: {
      bodyMapper: Mappers.WebAppCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.nextLink
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const listAppServicePlansNextOperationSpec: coreClient.OperationSpec = {
  path: "{nextLink}",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.AppServicePlanCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.nextLink
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const listWebAppsNextOperationSpec: coreClient.OperationSpec = {
  path: "{nextLink}",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.WebAppCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.nextLink
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const suspendNextOperationSpec: coreClient.OperationSpec = {
  path: "{nextLink}",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.WebAppCollection
    },
    202: {
      bodyMapper: Mappers.WebAppCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.nextLink
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const listUsagesNextOperationSpec: coreClient.OperationSpec = {
  path: "{nextLink}",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.CsmUsageQuotaCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.nextLink
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const listWorkerPoolsNextOperationSpec: coreClient.OperationSpec = {
  path: "{nextLink}",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.WorkerPoolCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.nextLink
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const listWorkerPoolInstanceMetricDefinitionsNextOperationSpec: coreClient.OperationSpec = {
  path: "{nextLink}",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.ResourceMetricDefinitionCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.nextLink,
    Parameters.instance,
    Parameters.workerPoolName
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const listWebWorkerMetricDefinitionsNextOperationSpec: coreClient.OperationSpec = {
  path: "{nextLink}",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.ResourceMetricDefinitionCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.nextLink,
    Parameters.workerPoolName
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const listWorkerPoolSkusNextOperationSpec: coreClient.OperationSpec = {
  path: "{nextLink}",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.SkuInfoCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.nextLink,
    Parameters.workerPoolName
  ],
  headerParameters: [Parameters.accept],
  serializer
};
const listWebWorkerUsagesNextOperationSpec: coreClient.OperationSpec = {
  path: "{nextLink}",
  httpMethod: "GET",
  responses: {
    200: {
      bodyMapper: Mappers.UsageCollection
    },
    default: {
      bodyMapper: Mappers.DefaultErrorResponse
    }
  },
  urlParameters: [
    Parameters.$host,
    Parameters.subscriptionId,
    Parameters.resourceGroupName,
    Parameters.name,
    Parameters.nextLink,
    Parameters.workerPoolName
  ],
  headerParameters: [Parameters.accept],
  serializer
};
