import { PagedAsyncIterableIterator } from "@azure/core-paging" ; import { WebCategories } from "../operationsInterfaces" ; import * as coreClient from "@azure/core-client" ; import * as Mappers from "../models/mappers" ; import * as Parameters from "../models/parameters" ; import { NetworkManagementClient } from "../networkManagementClient" ; import { AzureWebCategory , WebCategoriesListBySubscriptionNextOptionalParams , WebCategoriesListBySubscriptionOptionalParams , WebCategoriesGetOptionalParams , WebCategoriesGetResponse , WebCategoriesListBySubscriptionResponse , WebCategoriesListBySubscriptionNextResponse } from "../models" ; /** Class containing WebCategories operations. */ export class WebCategoriesImpl implements WebCategories { private readonly client : NetworkManagementClient ; param client constructor ( client ) { this . client = client ; } param options public listBySubscription ( options ? ) { const iter = this . listBySubscriptionPagingAll ( options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listBySubscriptionPagingPage ( options ) ; } } ; } private async * listBySubscriptionPagingPage ( options ? ) { let result = await this . _listBySubscription ( options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _listBySubscriptionNext ( continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * listBySubscriptionPagingAll ( options ? ) { for await ( const page of this . listBySubscriptionPagingPage ( options ) ) { yield * page ; } } param name param options get ( name , options ? ) { return this . client . sendOperationRequest ( { name , options } , getOperationSpec ) ; } param options private _listBySubscription ( options ? ) { return this . client . sendOperationRequest ( { options } , listBySubscriptionOperationSpec ) ; } param nextLink param options private _listBySubscriptionNext ( nextLink , options ? ) { return this . client . sendOperationRequest ( { nextLink , options } , listBySubscriptionNextOperationSpec ) ; } } const serializer = coreClient . createSerializer ( Mappers , false ) ; const getOperationSpec = { path : "/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureWebCategories/{name}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . AzureWebCategory } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion , Parameters . expand ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . name ] , headerParameters : [ Parameters . accept ] , serializer } ; const listBySubscriptionOperationSpec = { path : "/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureWebCategories" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . AzureWebCategoryListResult } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId ] , headerParameters : [ Parameters . accept ] , serializer } ; const listBySubscriptionNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . AzureWebCategoryListResult } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . nextLink ] , headerParameters : [ Parameters . accept ] , serializer } ;