import { PagedAsyncIterableIterator } from "@azure/core-paging" ; import { AuthorizationOperations } from "../operationsInterfaces" ; import * as coreClient from "@azure/core-client" ; import * as Mappers from "../models/mappers" ; import * as Parameters from "../models/parameters" ; import { ManagementLockClient } from "../managementLockClient" ; import { Operation , AuthorizationOperationsListNextOptionalParams , AuthorizationOperationsListOptionalParams , AuthorizationOperationsListResponse , AuthorizationOperationsListNextResponse } from "../models" ; /** Class containing AuthorizationOperations operations. */ export class AuthorizationOperationsImpl implements AuthorizationOperations { private readonly client : ManagementLockClient ; param client constructor ( client ) { this . client = client ; } param options public list ( options ? ) { const iter = this . listPagingAll ( options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listPagingPage ( options ) ; } } ; } private async * listPagingPage ( options ? ) { let result = await this . _list ( options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _listNext ( continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * listPagingAll ( options ? ) { for await ( const page of this . listPagingPage ( options ) ) { yield * page ; } } param options private _list ( options ? ) { return this . client . sendOperationRequest ( { options } , listOperationSpec ) ; } param nextLink param options private _listNext ( nextLink , options ? ) { return this . client . sendOperationRequest ( { nextLink , options } , listNextOperationSpec ) ; } } const serializer = coreClient . createSerializer ( Mappers , false ) ; const listOperationSpec = { path : "/providers/Microsoft.Authorization/operations" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . OperationListResult } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept ] , serializer } ; const listNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . OperationListResult } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . nextLink ] , headerParameters : [ Parameters . accept ] , serializer } ;