import { PagedAsyncIterableIterator } from "@azure/core-paging" ; import { VpnSiteLinks } 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 { VpnSiteLink , VpnSiteLinksListByVpnSiteNextOptionalParams , VpnSiteLinksListByVpnSiteOptionalParams , VpnSiteLinksGetOptionalParams , VpnSiteLinksGetResponse , VpnSiteLinksListByVpnSiteResponse , VpnSiteLinksListByVpnSiteNextResponse } from "../models" ; /** Class containing VpnSiteLinks operations. */ export class VpnSiteLinksImpl implements VpnSiteLinks { private readonly client : NetworkManagementClient ; param client constructor ( client ) { this . client = client ; } param resourceGroupName param vpnSiteName param options public listByVpnSite ( resourceGroupName , vpnSiteName , options ? ) { const iter = this . listByVpnSitePagingAll ( resourceGroupName , vpnSiteName , options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listByVpnSitePagingPage ( resourceGroupName , vpnSiteName , options ) ; } } ; } private async * listByVpnSitePagingPage ( resourceGroupName , vpnSiteName , options ? ) { let result = await this . _listByVpnSite ( resourceGroupName , vpnSiteName , options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _listByVpnSiteNext ( resourceGroupName , vpnSiteName , continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * listByVpnSitePagingAll ( resourceGroupName , vpnSiteName , options ? ) { for await ( const page of this . listByVpnSitePagingPage ( resourceGroupName , vpnSiteName , options ) ) { yield * page ; } } param resourceGroupName param vpnSiteName param vpnSiteLinkName param options get ( resourceGroupName , vpnSiteName , vpnSiteLinkName , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , vpnSiteName , vpnSiteLinkName , options } , getOperationSpec ) ; } param resourceGroupName param vpnSiteName param options private _listByVpnSite ( resourceGroupName , vpnSiteName , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , vpnSiteName , options } , listByVpnSiteOperationSpec ) ; } param resourceGroupName param vpnSiteName param nextLink param options private _listByVpnSiteNext ( resourceGroupName , vpnSiteName , nextLink , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , vpnSiteName , nextLink , options } , listByVpnSiteNextOperationSpec ) ; } } const serializer = coreClient . createSerializer ( Mappers , false ) ; const getOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}/vpnSiteLinks/{vpnSiteLinkName}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . VpnSiteLink } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . resourceGroupName , Parameters . subscriptionId , Parameters . vpnSiteName , Parameters . vpnSiteLinkName ] , headerParameters : [ Parameters . accept ] , serializer } ; const listByVpnSiteOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}/vpnSiteLinks" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ListVpnSiteLinksResult } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . resourceGroupName , Parameters . subscriptionId , Parameters . vpnSiteName ] , headerParameters : [ Parameters . accept ] , serializer } ; const listByVpnSiteNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ListVpnSiteLinksResult } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . resourceGroupName , Parameters . subscriptionId , Parameters . nextLink , Parameters . vpnSiteName ] , headerParameters : [ Parameters . accept ] , serializer } ;