import { PagedAsyncIterableIterator } from "@azure/core-paging" ; import { Usages } 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 { Usage , UsagesListByLocationOptionalParams , UsagesListByLocationResponse } from "../models" ; /** Class containing Usages operations. */ export class UsagesImpl implements Usages { private readonly client : StorageManagementClient ; param client constructor ( client ) { this . client = client ; } param location param options public listByLocation ( location , options ? ) { const iter = this . listByLocationPagingAll ( location , options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listByLocationPagingPage ( location , options ) ; } } ; } private async * listByLocationPagingPage ( location , options ? ) { let result = await this . _listByLocation ( location , options ) ; yield result . value || [ ] ; } private async * listByLocationPagingAll ( location , options ? ) { for await ( const page of this . listByLocationPagingPage ( location , options ) ) { yield * page ; } } param location param options private _listByLocation ( location , options ? ) { return this . client . sendOperationRequest ( { location , options } , listByLocationOperationSpec ) ; } } const serializer = coreClient . createSerializer ( Mappers , false ) ; const listByLocationOperationSpec = { path : "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . UsageListResult } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . location ] , headerParameters : [ Parameters . accept ] , serializer } ;