import { PagedAsyncIterableIterator } from "@azure/core-paging" ; import { Provider } 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 { ApplicationStackResource , ProviderGetAvailableStacksNextOptionalParams , ProviderGetAvailableStacksOptionalParams , FunctionAppStack , ProviderGetFunctionAppStacksNextOptionalParams , ProviderGetFunctionAppStacksOptionalParams , ProviderGetFunctionAppStacksForLocationNextOptionalParams , ProviderGetFunctionAppStacksForLocationOptionalParams , WebAppStack , ProviderGetWebAppStacksForLocationNextOptionalParams , ProviderGetWebAppStacksForLocationOptionalParams , CsmOperationDescription , ProviderListOperationsNextOptionalParams , ProviderListOperationsOptionalParams , ProviderGetWebAppStacksNextOptionalParams , ProviderGetWebAppStacksOptionalParams , ProviderGetAvailableStacksOnPremNextOptionalParams , ProviderGetAvailableStacksOnPremOptionalParams , ProviderGetAvailableStacksResponse , ProviderGetFunctionAppStacksResponse , ProviderGetFunctionAppStacksForLocationResponse , ProviderGetWebAppStacksForLocationResponse , ProviderListOperationsResponse , ProviderGetWebAppStacksResponse , ProviderGetAvailableStacksOnPremResponse , ProviderGetAvailableStacksNextResponse , ProviderGetFunctionAppStacksNextResponse , ProviderGetFunctionAppStacksForLocationNextResponse , ProviderGetWebAppStacksForLocationNextResponse , ProviderListOperationsNextResponse , ProviderGetWebAppStacksNextResponse , ProviderGetAvailableStacksOnPremNextResponse } from "../models" ; /** Class containing Provider operations. */ export class ProviderImpl implements Provider { private readonly client : WebSiteManagementClient ; param client constructor ( client ) { this . client = client ; } param options public listAvailableStacks ( options ? ) { const iter = this . getAvailableStacksPagingAll ( options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . getAvailableStacksPagingPage ( options ) ; } } ; } private async * getAvailableStacksPagingPage ( options ? ) { let result = await this . _getAvailableStacks ( options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _getAvailableStacksNext ( continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * getAvailableStacksPagingAll ( options ? ) { for await ( const page of this . getAvailableStacksPagingPage ( options ) ) { yield * page ; } } param options public listFunctionAppStacks ( options ? ) { const iter = this . getFunctionAppStacksPagingAll ( options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . getFunctionAppStacksPagingPage ( options ) ; } } ; } private async * getFunctionAppStacksPagingPage ( options ? ) { let result = await this . _getFunctionAppStacks ( options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _getFunctionAppStacksNext ( continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * getFunctionAppStacksPagingAll ( options ? ) { for await ( const page of this . getFunctionAppStacksPagingPage ( options ) ) { yield * page ; } } param location param options public listFunctionAppStacksForLocation ( location , options ? ) { const iter = this . getFunctionAppStacksForLocationPagingAll ( location , options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . getFunctionAppStacksForLocationPagingPage ( location , options ) ; } } ; } private async * getFunctionAppStacksForLocationPagingPage ( location , options ? ) { let result = await this . _getFunctionAppStacksForLocation ( location , options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _getFunctionAppStacksForLocationNext ( location , continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * getFunctionAppStacksForLocationPagingAll ( location , options ? ) { for await ( const page of this . getFunctionAppStacksForLocationPagingPage ( location , options ) ) { yield * page ; } } param location param options public listWebAppStacksForLocation ( location , options ? ) { const iter = this . getWebAppStacksForLocationPagingAll ( location , options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . getWebAppStacksForLocationPagingPage ( location , options ) ; } } ; } private async * getWebAppStacksForLocationPagingPage ( location , options ? ) { let result = await this . _getWebAppStacksForLocation ( location , options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _getWebAppStacksForLocationNext ( location , continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * getWebAppStacksForLocationPagingAll ( location , options ? ) { for await ( const page of this . getWebAppStacksForLocationPagingPage ( location , options ) ) { yield * page ; } } param options public listOperations ( options ? ) { const iter = this . listOperationsPagingAll ( options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listOperationsPagingPage ( options ) ; } } ; } private async * listOperationsPagingPage ( options ? ) { let result = await this . _listOperations ( options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _listOperationsNext ( continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * listOperationsPagingAll ( options ? ) { for await ( const page of this . listOperationsPagingPage ( options ) ) { yield * page ; } } param options public listWebAppStacks ( options ? ) { const iter = this . getWebAppStacksPagingAll ( options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . getWebAppStacksPagingPage ( options ) ; } } ; } private async * getWebAppStacksPagingPage ( options ? ) { let result = await this . _getWebAppStacks ( options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _getWebAppStacksNext ( continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * getWebAppStacksPagingAll ( options ? ) { for await ( const page of this . getWebAppStacksPagingPage ( options ) ) { yield * page ; } } param options public listAvailableStacksOnPrem ( options ? ) { const iter = this . getAvailableStacksOnPremPagingAll ( options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . getAvailableStacksOnPremPagingPage ( options ) ; } } ; } private async * getAvailableStacksOnPremPagingPage ( options ? ) { let result = await this . _getAvailableStacksOnPrem ( options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _getAvailableStacksOnPremNext ( continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * getAvailableStacksOnPremPagingAll ( options ? ) { for await ( const page of this . getAvailableStacksOnPremPagingPage ( options ) ) { yield * page ; } } param options private _getAvailableStacks ( options ? ) { return this . client . sendOperationRequest ( { options } , getAvailableStacksOperationSpec ) ; } param options private _getFunctionAppStacks ( options ? ) { return this . client . sendOperationRequest ( { options } , getFunctionAppStacksOperationSpec ) ; } param location param options private _getFunctionAppStacksForLocation ( location , options ? ) { return this . client . sendOperationRequest ( { location , options } , getFunctionAppStacksForLocationOperationSpec ) ; } param location param options private _getWebAppStacksForLocation ( location , options ? ) { return this . client . sendOperationRequest ( { location , options } , getWebAppStacksForLocationOperationSpec ) ; } param options private _listOperations ( options ? ) { return this . client . sendOperationRequest ( { options } , listOperationsOperationSpec ) ; } param options private _getWebAppStacks ( options ? ) { return this . client . sendOperationRequest ( { options } , getWebAppStacksOperationSpec ) ; } param options private _getAvailableStacksOnPrem ( options ? ) { return this . client . sendOperationRequest ( { options } , getAvailableStacksOnPremOperationSpec ) ; } param nextLink param options private _getAvailableStacksNext ( nextLink , options ? ) { return this . client . sendOperationRequest ( { nextLink , options } , getAvailableStacksNextOperationSpec ) ; } param nextLink param options private _getFunctionAppStacksNext ( nextLink , options ? ) { return this . client . sendOperationRequest ( { nextLink , options } , getFunctionAppStacksNextOperationSpec ) ; } param location param nextLink param options private _getFunctionAppStacksForLocationNext ( location , nextLink , options ? ) { return this . client . sendOperationRequest ( { location , nextLink , options } , getFunctionAppStacksForLocationNextOperationSpec ) ; } param location param nextLink param options private _getWebAppStacksForLocationNext ( location , nextLink , options ? ) { return this . client . sendOperationRequest ( { location , nextLink , options } , getWebAppStacksForLocationNextOperationSpec ) ; } param nextLink param options private _listOperationsNext ( nextLink , options ? ) { return this . client . sendOperationRequest ( { nextLink , options } , listOperationsNextOperationSpec ) ; } param nextLink param options private _getWebAppStacksNext ( nextLink , options ? ) { return this . client . sendOperationRequest ( { nextLink , options } , getWebAppStacksNextOperationSpec ) ; } param nextLink param options private _getAvailableStacksOnPremNext ( nextLink , options ? ) { return this . client . sendOperationRequest ( { nextLink , options } , getAvailableStacksOnPremNextOperationSpec ) ; } } const serializer = coreClient . createSerializer ( Mappers , false ) ; const getAvailableStacksOperationSpec = { path : "/providers/Microsoft.Web/availableStacks" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ApplicationStackCollection } , default : { bodyMapper : Mappers . DefaultErrorResponse } } , queryParameters : [ Parameters . apiVersion , Parameters . osTypeSelected ] , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept ] , serializer } ; const getFunctionAppStacksOperationSpec = { path : "/providers/Microsoft.Web/functionAppStacks" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . FunctionAppStackCollection } , default : { bodyMapper : Mappers . DefaultErrorResponse } } , queryParameters : [ Parameters . apiVersion , Parameters . stackOsType ] , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept ] , serializer } ; const getFunctionAppStacksForLocationOperationSpec = { path : "/providers/Microsoft.Web/locations/{location}/functionAppStacks" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . FunctionAppStackCollection } , default : { bodyMapper : Mappers . DefaultErrorResponse } } , queryParameters : [ Parameters . apiVersion , Parameters . stackOsType1 ] , urlParameters : [ Parameters . $host , Parameters . location ] , headerParameters : [ Parameters . accept ] , serializer } ; const getWebAppStacksForLocationOperationSpec = { path : "/providers/Microsoft.Web/locations/{location}/webAppStacks" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . WebAppStackCollection } , default : { bodyMapper : Mappers . DefaultErrorResponse } } , queryParameters : [ Parameters . apiVersion , Parameters . stackOsType2 ] , urlParameters : [ Parameters . $host , Parameters . location ] , headerParameters : [ Parameters . accept ] , serializer } ; const listOperationsOperationSpec = { path : "/providers/Microsoft.Web/operations" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . CsmOperationCollection } , default : { bodyMapper : Mappers . DefaultErrorResponse } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept ] , serializer } ; const getWebAppStacksOperationSpec = { path : "/providers/Microsoft.Web/webAppStacks" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . WebAppStackCollection } , default : { bodyMapper : Mappers . DefaultErrorResponse } } , queryParameters : [ Parameters . apiVersion , Parameters . stackOsType3 ] , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept ] , serializer } ; const getAvailableStacksOnPremOperationSpec = { path : "/subscriptions/{subscriptionId}/providers/Microsoft.Web/availableStacks" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ApplicationStackCollection } , default : { bodyMapper : Mappers . DefaultErrorResponse } } , queryParameters : [ Parameters . apiVersion , Parameters . osTypeSelected1 ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId ] , headerParameters : [ Parameters . accept ] , serializer } ; const getAvailableStacksNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ApplicationStackCollection } , default : { bodyMapper : Mappers . DefaultErrorResponse } } , queryParameters : [ Parameters . apiVersion , Parameters . osTypeSelected ] , urlParameters : [ Parameters . $host , Parameters . nextLink ] , headerParameters : [ Parameters . accept ] , serializer } ; const getFunctionAppStacksNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . FunctionAppStackCollection } , default : { bodyMapper : Mappers . DefaultErrorResponse } } , queryParameters : [ Parameters . apiVersion , Parameters . stackOsType ] , urlParameters : [ Parameters . $host , Parameters . nextLink ] , headerParameters : [ Parameters . accept ] , serializer } ; const getFunctionAppStacksForLocationNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . FunctionAppStackCollection } , default : { bodyMapper : Mappers . DefaultErrorResponse } } , queryParameters : [ Parameters . apiVersion , Parameters . stackOsType1 ] , urlParameters : [ Parameters . $host , Parameters . nextLink , Parameters . location ] , headerParameters : [ Parameters . accept ] , serializer } ; const getWebAppStacksForLocationNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . WebAppStackCollection } , default : { bodyMapper : Mappers . DefaultErrorResponse } } , queryParameters : [ Parameters . apiVersion , Parameters . stackOsType2 ] , urlParameters : [ Parameters . $host , Parameters . nextLink , Parameters . location ] , headerParameters : [ Parameters . accept ] , serializer } ; const listOperationsNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . CsmOperationCollection } , default : { bodyMapper : Mappers . DefaultErrorResponse } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . nextLink ] , headerParameters : [ Parameters . accept ] , serializer } ; const getWebAppStacksNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . WebAppStackCollection } , default : { bodyMapper : Mappers . DefaultErrorResponse } } , queryParameters : [ Parameters . apiVersion , Parameters . stackOsType3 ] , urlParameters : [ Parameters . $host , Parameters . nextLink ] , headerParameters : [ Parameters . accept ] , serializer } ; const getAvailableStacksOnPremNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ApplicationStackCollection } , default : { bodyMapper : Mappers . DefaultErrorResponse } } , queryParameters : [ Parameters . apiVersion , Parameters . osTypeSelected1 ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . nextLink ] , headerParameters : [ Parameters . accept ] , serializer } ;