import { PagedAsyncIterableIterator } from "@azure/core-paging" ; import { CertificateRegistrationProvider } from "../operationsInterfaces" ; import * as coreClient from "@azure/core-client" ; import * as Mappers from "../models/mappers" ; import * as Parameters from "../models/parameters" ; import { WebSiteManagementClient } from "../webSiteManagementClient" ; import { CsmOperationDescription , CertificateRegistrationProviderListOperationsNextOptionalParams , CertificateRegistrationProviderListOperationsOptionalParams , CertificateRegistrationProviderListOperationsResponse , CertificateRegistrationProviderListOperationsNextResponse } from "../models" ; /** Class containing CertificateRegistrationProvider operations. */ export class CertificateRegistrationProviderImpl implements CertificateRegistrationProvider { private readonly client : WebSiteManagementClient ; param client constructor ( client ) { this . client = client ; } param options public listOperations ( options ? ) { const iter = this . listOperationsPagingAll ( options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listOperationsPagingPage ( options ) ; } } ; } private async * listOperationsPagingPage ( options ? ) { let result = await this . _listOperations ( options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _listOperationsNext ( continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * listOperationsPagingAll ( options ? ) { for await ( const page of this . listOperationsPagingPage ( options ) ) { yield * page ; } } param options private _listOperations ( options ? ) { return this . client . sendOperationRequest ( { options } , listOperationsOperationSpec ) ; } param nextLink param options private _listOperationsNext ( nextLink , options ? ) { return this . client . sendOperationRequest ( { nextLink , options } , listOperationsNextOperationSpec ) ; } } const serializer = coreClient . createSerializer ( Mappers , false ) ; const listOperationsOperationSpec = { path : "/providers/Microsoft.CertificateRegistration/operations" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . CsmOperationCollection } , default : { bodyMapper : Mappers . DefaultErrorResponse } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept ] , serializer } ; const listOperationsNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . CsmOperationCollection } , default : { bodyMapper : Mappers . DefaultErrorResponse } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . nextLink ] , headerParameters : [ Parameters . accept ] , serializer } ;