import { PagedAsyncIterableIterator } from "@azure/core-paging" ; import { NetworkInterfaceIPConfigurations } 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 { NetworkInterfaceIPConfiguration , NetworkInterfaceIPConfigurationsListNextOptionalParams , NetworkInterfaceIPConfigurationsListOptionalParams , NetworkInterfaceIPConfigurationsListResponse , NetworkInterfaceIPConfigurationsGetOptionalParams , NetworkInterfaceIPConfigurationsGetResponse , NetworkInterfaceIPConfigurationsListNextResponse } from "../models" ; /** Class containing NetworkInterfaceIPConfigurations operations. */ export class NetworkInterfaceIPConfigurationsImpl implements NetworkInterfaceIPConfigurations { private readonly client : NetworkManagementClient ; param client constructor ( client ) { this . client = client ; } param resourceGroupName param networkInterfaceName param options public list ( resourceGroupName , networkInterfaceName , options ? ) { const iter = this . listPagingAll ( resourceGroupName , networkInterfaceName , options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listPagingPage ( resourceGroupName , networkInterfaceName , options ) ; } } ; } private async * listPagingPage ( resourceGroupName , networkInterfaceName , options ? ) { let result = await this . _list ( resourceGroupName , networkInterfaceName , options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _listNext ( resourceGroupName , networkInterfaceName , continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * listPagingAll ( resourceGroupName , networkInterfaceName , options ? ) { for await ( const page of this . listPagingPage ( resourceGroupName , networkInterfaceName , options ) ) { yield * page ; } } param resourceGroupName param networkInterfaceName param options private _list ( resourceGroupName , networkInterfaceName , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , networkInterfaceName , options } , listOperationSpec ) ; } param resourceGroupName param networkInterfaceName param ipConfigurationName param options get ( resourceGroupName , networkInterfaceName , ipConfigurationName , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , networkInterfaceName , ipConfigurationName , options } , getOperationSpec ) ; } param resourceGroupName param networkInterfaceName param nextLink param options private _listNext ( resourceGroupName , networkInterfaceName , nextLink , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , networkInterfaceName , nextLink , options } , listNextOperationSpec ) ; } } const serializer = coreClient . createSerializer ( Mappers , false ) ; const listOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . NetworkInterfaceIPConfigurationListResult } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . resourceGroupName , Parameters . subscriptionId , Parameters . networkInterfaceName ] , headerParameters : [ Parameters . accept ] , serializer } ; const getOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . NetworkInterfaceIPConfiguration } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . resourceGroupName , Parameters . subscriptionId , Parameters . networkInterfaceName , Parameters . ipConfigurationName ] , headerParameters : [ Parameters . accept ] , serializer } ; const listNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . NetworkInterfaceIPConfigurationListResult } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . resourceGroupName , Parameters . subscriptionId , Parameters . nextLink , Parameters . networkInterfaceName ] , headerParameters : [ Parameters . accept ] , serializer } ;