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


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: () => {
        return this.listByResourceGroupPagingPage(resourceGroupName, options);
      }
    };
  }


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


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: () => {
        return this.listCapacitiesPagingPage(resourceGroupName, name, options);
      }
    };
  }


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


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: () => {
        return this.changeVnetPagingPage(
          resourceGroupName,
          name,
          vnetInfo,
          options
        );
      }
    };
  }


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


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: () => {
        return this.getInboundNetworkDependenciesEndpointsPagingPage(
          resourceGroupName,
          name,
          options
        );
      }
    };
  }


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


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: () => {
        return this.listMultiRolePoolsPagingPage(
          resourceGroupName,
          name,
          options
        );
      }
    };
  }


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


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: () => {
        return this.listMultiRolePoolInstanceMetricDefinitionsPagingPage(
          resourceGroupName,
          name,
          instance,
          options
        );
      }
    };
  }


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


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: () => {
        return this.listMultiRoleMetricDefinitionsPagingPage(
          resourceGroupName,
          name,
          options
        );
      }
    };
  }


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


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: () => {
        return this.listMultiRolePoolSkusPagingPage(
          resourceGroupName,
          name,
          options
        );
      }
    };
  }


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


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: () => {
        return this.listMultiRoleUsagesPagingPage(
          resourceGroupName,
          name,
          options
        );
      }
    };
  }


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


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: () => {
        return this.getOutboundNetworkDependenciesEndpointsPagingPage(
          resourceGroupName,
          name,
          options
        );
      }
    };
  }


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


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 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: () => {
        return this.resumePagingPage(resourceGroupName, name, options);
      }
    };
  }


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


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: () => {
        return this.listAppServicePlansPagingPage(
          resourceGroupName,
          name,
          options
        );
      }
    };
  }


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


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: () => {
        return this.listWebAppsPagingPage(resourceGroupName, name, options);
      }
    };
  }


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


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: () => {
        return this.suspendPagingPage(resourceGroupName, name, options);
      }
    };
  }


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


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: () => {
        return this.listUsagesPagingPage(resourceGroupName, name, options);
      }
    };
  }


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


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: () => {
        return this.listWorkerPoolsPagingPage(resourceGroupName, name, options);
      }
    };
  }


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


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: () => {
        return this.listWorkerPoolInstanceMetricDefinitionsPagingPage(
          resourceGroupName,
          name,
          workerPoolName,
          instance,
          options
        );
      }
    };
  }


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


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: () => {
        return this.listWebWorkerMetricDefinitionsPagingPage(
          resourceGroupName,
          name,
          workerPoolName,
          options
        );
      }
    };
  }


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


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: () => {
        return this.listWorkerPoolSkusPagingPage(
          resourceGroupName,
          name,
          workerPoolName,
          options
        );
      }
    };
  }


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


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: () => {
        return this.listWebWorkerUsagesPagingPage(
          resourceGroupName,
          name,
          workerPoolName,
          options
        );
      }
    };
  }


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


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<
    PollerLike<
      PollOperationState<AppServiceEnvironmentsCreateOrUpdateResponse>,
      AppServiceEnvironmentsCreateOrUpdateResponse
    >
  > {
    const directSendOperation = async (
      args: coreClient.OperationArguments,
      spec: coreClient.OperationSpec
    ): Promise<AppServiceEnvironmentsCreateOrUpdateResponse> => {
      return this.client.sendOperationRequest(args, spec);
    };
    const sendOperation = 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 = new LroImpl(
      sendOperation,
      { resourceGroupName, name, hostingEnvironmentEnvelope, options },
      createOrUpdateOperationSpec
    );
    return new LroEngine(lro, {
      resumeFrom: options?.resumeFrom,
      intervalInMs: options?.updateIntervalInMs
    });
  }


/**
   * 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<PollerLike<PollOperationState<void>, void>> {
    const directSendOperation = async (
      args: coreClient.OperationArguments,
      spec: coreClient.OperationSpec
    ): Promise<void> => {
      return this.client.sendOperationRequest(args, spec);
    };
    const sendOperation = 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 = new LroImpl(
      sendOperation,
      { resourceGroupName, name, options },
      deleteOperationSpec
    );
    return new LroEngine(lro, {
      resumeFrom: options?.resumeFrom,
      intervalInMs: options?.updateIntervalInMs
    });
  }


/**
   * 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<
    PollerLike<
      PollOperationState<AppServiceEnvironmentsChangeVnetResponse>,
      AppServiceEnvironmentsChangeVnetResponse
    >
  > {
    const directSendOperation = async (
      args: coreClient.OperationArguments,
      spec: coreClient.OperationSpec
    ): Promise<AppServiceEnvironmentsChangeVnetResponse> => {
      return this.client.sendOperationRequest(args, spec);
    };
    const sendOperation = 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 = new LroImpl(
      sendOperation,
      { resourceGroupName, name, vnetInfo, options },
      changeVnetOperationSpec
    );
    return new LroEngine(lro, {
      resumeFrom: options?.resumeFrom,
      intervalInMs: options?.updateIntervalInMs
    });
  }


/**
   * 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<
    PollerLike<
      PollOperationState<
        AppServiceEnvironmentsCreateOrUpdateMultiRolePoolResponse
      >,
      AppServiceEnvironmentsCreateOrUpdateMultiRolePoolResponse
    >
  > {
    const directSendOperation = async (
      args: coreClient.OperationArguments,
      spec: coreClient.OperationSpec
    ): Promise<AppServiceEnvironmentsCreateOrUpdateMultiRolePoolResponse> => {
      return this.client.sendOperationRequest(args, spec);
    };
    const sendOperation = 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 = new LroImpl(
      sendOperation,
      { resourceGroupName, name, multiRolePoolEnvelope, options },
      createOrUpdateMultiRolePoolOperationSpec
    );
    return new LroEngine(lro, {
      resumeFrom: options?.resumeFrom,
      intervalInMs: options?.updateIntervalInMs
    });
  }


/**
   * 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
    );
  }


/**
   * 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 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<
    PollerLike<
      PollOperationState<AppServiceEnvironmentsResumeResponse>,
      AppServiceEnvironmentsResumeResponse
    >
  > {
    const directSendOperation = async (
      args: coreClient.OperationArguments,
      spec: coreClient.OperationSpec
    ): Promise<AppServiceEnvironmentsResumeResponse> => {
      return this.client.sendOperationRequest(args, spec);
    };
    const sendOperation = 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 = new LroImpl(
      sendOperation,
      { resourceGroupName, name, options },
      resumeOperationSpec
    );
    return new LroEngine(lro, {
      resumeFrom: options?.resumeFrom,
      intervalInMs: options?.updateIntervalInMs
    });
  }


/**
   * 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<
    PollerLike<
      PollOperationState<AppServiceEnvironmentsSuspendResponse>,
      AppServiceEnvironmentsSuspendResponse
    >
  > {
    const directSendOperation = async (
      args: coreClient.OperationArguments,
      spec: coreClient.OperationSpec
    ): Promise<AppServiceEnvironmentsSuspendResponse> => {
      return this.client.sendOperationRequest(args, spec);
    };
    const sendOperation = 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 = new LroImpl(
      sendOperation,
      { resourceGroupName, name, options },
      suspendOperationSpec
    );
    return new LroEngine(lro, {
      resumeFrom: options?.resumeFrom,
      intervalInMs: options?.updateIntervalInMs
    });
  }


/**
   * 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<
    PollerLike<
      PollOperationState<
        AppServiceEnvironmentsCreateOrUpdateWorkerPoolResponse
      >,
      AppServiceEnvironmentsCreateOrUpdateWorkerPoolResponse
    >
  > {
    const directSendOperation = async (
      args: coreClient.OperationArguments,
      spec: coreClient.OperationSpec
    ): Promise<AppServiceEnvironmentsCreateOrUpdateWorkerPoolResponse> => {
      return this.client.sendOperationRequest(args, spec);
    };
    const sendOperation = 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 = new LroImpl(
      sendOperation,
      { resourceGroupName, name, workerPoolName, workerPoolEnvelope, options },
      createOrUpdateWorkerPoolOperationSpec
    );
    return new LroEngine(lro, {
      resumeFrom: options?.resumeFrom,
      intervalInMs: options?.updateIntervalInMs
    });
  }


/**
   * 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
    );
  }


/**
   * 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
    );
  }