import { PagedAsyncIterableIterator } from "@azure/core-paging" ; import { LoadBalancerLoadBalancingRules } 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 { LoadBalancingRule , LoadBalancerLoadBalancingRulesListNextOptionalParams , LoadBalancerLoadBalancingRulesListOptionalParams , LoadBalancerLoadBalancingRulesListResponse , LoadBalancerLoadBalancingRulesGetOptionalParams , LoadBalancerLoadBalancingRulesGetResponse , LoadBalancerLoadBalancingRulesListNextResponse } from "../models" ; /** Class containing LoadBalancerLoadBalancingRules operations. */ export class LoadBalancerLoadBalancingRulesImpl implements LoadBalancerLoadBalancingRules { private readonly client : NetworkManagementClient ; param client constructor ( client ) { this . client = client ; } param resourceGroupName param loadBalancerName param options public list ( resourceGroupName , loadBalancerName , options ? ) { const iter = this . listPagingAll ( resourceGroupName , loadBalancerName , options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listPagingPage ( resourceGroupName , loadBalancerName , options ) ; } } ; } private async * listPagingPage ( resourceGroupName , loadBalancerName , options ? ) { let result = await this . _list ( resourceGroupName , loadBalancerName , options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _listNext ( resourceGroupName , loadBalancerName , continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * listPagingAll ( resourceGroupName , loadBalancerName , options ? ) { for await ( const page of this . listPagingPage ( resourceGroupName , loadBalancerName , options ) ) { yield * page ; } } param resourceGroupName param loadBalancerName param options private _list ( resourceGroupName , loadBalancerName , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , loadBalancerName , options } , listOperationSpec ) ; } param resourceGroupName param loadBalancerName param loadBalancingRuleName param options get ( resourceGroupName , loadBalancerName , loadBalancingRuleName , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , loadBalancerName , loadBalancingRuleName , options } , getOperationSpec ) ; } param resourceGroupName param loadBalancerName param nextLink param options private _listNext ( resourceGroupName , loadBalancerName , nextLink , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , loadBalancerName , nextLink , options } , listNextOperationSpec ) ; } } const serializer = coreClient . createSerializer ( Mappers , false ) ; const listOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . LoadBalancerLoadBalancingRuleListResult } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . resourceGroupName , Parameters . subscriptionId , Parameters . loadBalancerName ] , headerParameters : [ Parameters . accept ] , serializer } ; const getOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . LoadBalancingRule } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . resourceGroupName , Parameters . subscriptionId , Parameters . loadBalancerName , Parameters . loadBalancingRuleName ] , headerParameters : [ Parameters . accept ] , serializer } ; const listNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . LoadBalancerLoadBalancingRuleListResult } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . resourceGroupName , Parameters . subscriptionId , Parameters . nextLink , Parameters . loadBalancerName ] , headerParameters : [ Parameters . accept ] , serializer } ;