import { PagedAsyncIterableIterator } from "@azure/core-paging" ; import { Paging } from "../operationsInterfaces" ; import * as coreClient from "@azure/core-client" ; import * as Mappers from "../models/mappers" ; import * as Parameters from "../models/parameters" ; import { CustomUrlPagingClient } from "../customUrlPagingClient" ; import { Product , PagingGetPagesPartialUrlNextOptionalParams , PagingGetPagesPartialUrlOptionalParams , PagingGetPagesPartialUrlOperationNextOptionalParams , PagingGetPagesPartialUrlOperationOptionalParams , PagingGetPagesPartialUrlResponse , PagingGetPagesPartialUrlOperationResponse , PagingGetPagesPartialUrlOperationNextResponse , PagingGetPagesPartialUrlNextResponse } from "../models" ; /** Class containing Paging operations. */ export class PagingImpl implements Paging { private readonly client : CustomUrlPagingClient ; param client constructor ( client ) { this . client = client ; } param accountName param options public listPagesPartialUrl ( accountName , options ? ) { const iter = this . getPagesPartialUrlPagingAll ( accountName , options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . getPagesPartialUrlPagingPage ( accountName , options ) ; } } ; } private async * getPagesPartialUrlPagingPage ( accountName , options ? ) { let result = await this . _getPagesPartialUrl ( accountName , options ) ; yield result . values || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _getPagesPartialUrlNext ( accountName , continuationToken , options ) ; continuationToken = result . nextLink ; yield result . values || [ ] ; } } private async * getPagesPartialUrlPagingAll ( accountName , options ? ) { for await ( const page of this . getPagesPartialUrlPagingPage ( accountName , options ) ) { yield * page ; } } param accountName param options public listPagesPartialUrlOperation ( accountName , options ? ) { const iter = this . getPagesPartialUrlOperationPagingAll ( accountName , options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . getPagesPartialUrlOperationPagingPage ( accountName , options ) ; } } ; } private async * getPagesPartialUrlOperationPagingPage ( accountName , options ? ) { let result = await this . _getPagesPartialUrlOperation ( accountName , options ) ; yield result . values || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _getPagesPartialUrlOperationNext ( accountName , continuationToken , options ) ; continuationToken = result . nextLink ; yield result . values || [ ] ; } } private async * getPagesPartialUrlOperationPagingAll ( accountName , options ? ) { for await ( const page of this . getPagesPartialUrlOperationPagingPage ( accountName , options ) ) { yield * page ; } } param accountName param nextLink param options public listPagesPartialUrlOperationNext ( accountName , nextLink , options ? ) { const iter = this . getPagesPartialUrlOperationNextPagingAll ( accountName , nextLink , options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . getPagesPartialUrlOperationNextPagingPage ( accountName , nextLink , options ) ; } } ; } private async * getPagesPartialUrlOperationNextPagingPage ( accountName , nextLink , options ? ) { let result = await this . _getPagesPartialUrlOperationNext ( accountName , nextLink , options ) ; yield result . values || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _getPagesPartialUrlOperationNext ( accountName , continuationToken , options ) ; continuationToken = result . nextLink ; yield result . values || [ ] ; } } private async * getPagesPartialUrlOperationNextPagingAll ( accountName , nextLink , options ? ) { for await ( const page of this . getPagesPartialUrlOperationNextPagingPage ( accountName , nextLink , options ) ) { yield * page ; } } param accountName param options private _getPagesPartialUrl ( accountName , options ? ) { return this . client . sendOperationRequest ( { accountName , options } , getPagesPartialUrlOperationSpec ) ; } param accountName param options private _getPagesPartialUrlOperation ( accountName , options ? ) { return this . client . sendOperationRequest ( { accountName , options } , getPagesPartialUrlOperationOperationSpec ) ; } param accountName param nextLink param options private _getPagesPartialUrlOperationNext ( accountName , nextLink , options ? ) { return this . client . sendOperationRequest ( { accountName , nextLink , options } , getPagesPartialUrlOperationNextOperationSpec ) ; } param accountName param nextLink param options private _getPagesPartialUrlNext ( accountName , nextLink , options ? ) { return this . client . sendOperationRequest ( { accountName , nextLink , options } , getPagesPartialUrlNextOperationSpec ) ; } } const serializer = coreClient . createSerializer ( Mappers , false ) ; const getPagesPartialUrlOperationSpec = { path : "/paging/customurl/partialnextlink" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ProductResult } , default : { } } , urlParameters : [ Parameters . accountName , Parameters . host ] , headerParameters : [ Parameters . accept ] , serializer } ; const getPagesPartialUrlOperationOperationSpec = { path : "/paging/customurl/partialnextlinkop" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ProductResult } , default : { } } , urlParameters : [ Parameters . accountName , Parameters . host ] , headerParameters : [ Parameters . accept ] , serializer } ; const getPagesPartialUrlOperationNextOperationSpec = { path : "/paging/customurl/{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ProductResult } , default : { } } , urlParameters : [ Parameters . accountName , Parameters . host , Parameters . nextLink ] , headerParameters : [ Parameters . accept ] , serializer } ; const getPagesPartialUrlNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ProductResult } , default : { } } , urlParameters : [ Parameters . accountName , Parameters . host , Parameters . nextLink ] , headerParameters : [ Parameters . accept ] , serializer } ;