import { PagedAsyncIterableIterator } from "@azure/core-paging" ; import { Operations } from "../operationsInterfaces" ; import * as coreClient from "@azure/core-client" ; import * as Mappers from "../models/mappers" ; import * as Parameters from "../models/parameters" ; import { StorageManagementClient } from "../storageManagementClient" ; import { Operation , OperationsListOptionalParams , OperationsListResponse } from "../models" ; /** Class containing Operations operations. */ export class OperationsImpl implements Operations { private readonly client : StorageManagementClient ; 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 || [ ] ; } 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 ) ; } } const serializer = coreClient . createSerializer ( Mappers , false ) ; const listOperationSpec = { path : "/providers/Microsoft.Storage/operations" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . OperationListResult } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host ] , headerParameters : [ Parameters . accept ] , serializer } ;