import { PagedAsyncIterableIterator } from "@azure/core-paging" ; import { DeletedWebApps } from "../operationsInterfaces" ; import * as coreClient from "@azure/core-client" ; import * as Mappers from "../models/mappers" ; import * as Parameters from "../models/parameters" ; import { WebSiteManagementClient } from "../webSiteManagementClient" ; import { DeletedSite , DeletedWebAppsListNextOptionalParams , DeletedWebAppsListOptionalParams , DeletedWebAppsListByLocationNextOptionalParams , DeletedWebAppsListByLocationOptionalParams , DeletedWebAppsListResponse , DeletedWebAppsListByLocationResponse , DeletedWebAppsGetDeletedWebAppByLocationOptionalParams , DeletedWebAppsGetDeletedWebAppByLocationResponse , DeletedWebAppsListNextResponse , DeletedWebAppsListByLocationNextResponse } from "../models" ; /** Class containing DeletedWebApps operations. */ export class DeletedWebAppsImpl implements DeletedWebApps { private readonly client : WebSiteManagementClient ; param client constructor ( client ) { this . client = client ; } param options public list ( options ? ) { const iter = this . listPagingAll ( options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listPagingPage ( options ) ; } } ; } private async * listPagingPage ( options ? ) { 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 ? ) { for await ( const page of this . listPagingPage ( options ) ) { yield * page ; } } param location param options public listByLocation ( location , options ? ) { const iter = this . listByLocationPagingAll ( location , options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listByLocationPagingPage ( location , options ) ; } } ; } private async * listByLocationPagingPage ( location , options ? ) { let result = await this . _listByLocation ( location , options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _listByLocationNext ( location , continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * listByLocationPagingAll ( location , options ? ) { for await ( const page of this . listByLocationPagingPage ( location , options ) ) { yield * page ; } } param options private _list ( options ? ) { return this . client . sendOperationRequest ( { options } , listOperationSpec ) ; } param location param options private _listByLocation ( location , options ? ) { return this . client . sendOperationRequest ( { location , options } , listByLocationOperationSpec ) ; } param location param deletedSiteId param options getDeletedWebAppByLocation ( location , deletedSiteId , options ? ) { return this . client . sendOperationRequest ( { location , deletedSiteId , options } , getDeletedWebAppByLocationOperationSpec ) ; } param nextLink param options private _listNext ( nextLink , options ? ) { return this . client . sendOperationRequest ( { nextLink , options } , listNextOperationSpec ) ; } param location param nextLink param options private _listByLocationNext ( location , nextLink , options ? ) { return this . client . sendOperationRequest ( { location , nextLink , options } , listByLocationNextOperationSpec ) ; } } const serializer = coreClient . createSerializer ( Mappers , false ) ; const listOperationSpec = { path : "/subscriptions/{subscriptionId}/providers/Microsoft.Web/deletedSites" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . DeletedWebAppCollection } , default : { bodyMapper : Mappers . DefaultErrorResponse } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId ] , headerParameters : [ Parameters . accept ] , serializer } ; const listByLocationOperationSpec = { path : "/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/deletedSites" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . DeletedWebAppCollection } , default : { bodyMapper : Mappers . DefaultErrorResponse } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . location ] , headerParameters : [ Parameters . accept ] , serializer } ; const getDeletedWebAppByLocationOperationSpec = { path : "/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/deletedSites/{deletedSiteId}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . DeletedSite } , default : { bodyMapper : Mappers . DefaultErrorResponse } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . location , Parameters . deletedSiteId ] , headerParameters : [ Parameters . accept ] , serializer } ; const listNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . DeletedWebAppCollection } , default : { bodyMapper : Mappers . DefaultErrorResponse } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . nextLink ] , headerParameters : [ Parameters . accept ] , serializer } ; const listByLocationNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . DeletedWebAppCollection } , default : { bodyMapper : Mappers . DefaultErrorResponse } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . nextLink , Parameters . location ] , headerParameters : [ Parameters . accept ] , serializer } ;