public virtual Pageable <PoolUsageMetrics> ListUsageMetrics(PoolListUsageMetricsOptions poolListUsageMetricsOptions, CancellationToken cancellationToken = default) { Page <PoolUsageMetrics> FirstPageFunc(int?pageSizeHint) { var response = RestClient.ListUsageMetrics(poolListUsageMetricsOptions, cancellationToken); return(Page.FromValues(response.Value.Value, response.Value.OdataNextLink, response.GetRawResponse())); } Page <PoolUsageMetrics> NextPageFunc(string nextLink, int?pageSizeHint) { var response = RestClient.ListUsageMetricsNextPage(nextLink, poolListUsageMetricsOptions, cancellationToken); return(Page.FromValues(response.Value.Value, response.Value.OdataNextLink, response.GetRawResponse())); } return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc)); }
public virtual AsyncPageable <PoolUsageMetrics> ListUsageMetricsAsync(PoolListUsageMetricsOptions poolListUsageMetricsOptions, CancellationToken cancellationToken = default) { async Task <Page <PoolUsageMetrics> > FirstPageFunc(int?pageSizeHint) { var response = await RestClient.ListUsageMetricsAsync(poolListUsageMetricsOptions, cancellationToken).ConfigureAwait(false); return(Page.FromValues(response.Value.Value, response.Value.OdataNextLink, response.GetRawResponse())); } async Task <Page <PoolUsageMetrics> > NextPageFunc(string nextLink, int?pageSizeHint) { var response = await RestClient.ListUsageMetricsNextPageAsync(nextLink, poolListUsageMetricsOptions, cancellationToken).ConfigureAwait(false); return(Page.FromValues(response.Value.Value, response.Value.OdataNextLink, response.GetRawResponse())); } return(PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc)); }
/// <summary> /// Lists the usage metrics, aggregated by Pool across individual time /// intervals, for the specified Account. /// </summary> /// <remarks> /// If you do not specify a $filter clause including a poolId, the response /// includes all Pools that existed in the Account in the time range of the /// returned aggregation intervals. If you do not specify a $filter clause /// including a startTime or endTime these filters default to the start and end /// times of the last aggregation interval currently available; that is, only /// the last aggregation interval is returned. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='poolListUsageMetricsOptions'> /// Additional parameters for the operation /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <PoolUsageMetrics> > ListUsageMetricsAsync(this IPoolOperations operations, PoolListUsageMetricsOptions poolListUsageMetricsOptions = default(PoolListUsageMetricsOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListUsageMetricsWithHttpMessagesAsync(poolListUsageMetricsOptions, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Lists the usage metrics, aggregated by Pool across individual time /// intervals, for the specified Account. /// </summary> /// <remarks> /// If you do not specify a $filter clause including a poolId, the response /// includes all Pools that existed in the Account in the time range of the /// returned aggregation intervals. If you do not specify a $filter clause /// including a startTime or endTime these filters default to the start and end /// times of the last aggregation interval currently available; that is, only /// the last aggregation interval is returned. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='poolListUsageMetricsOptions'> /// Additional parameters for the operation /// </param> public static IPage <PoolUsageMetrics> ListUsageMetrics(this IPoolOperations operations, PoolListUsageMetricsOptions poolListUsageMetricsOptions = default(PoolListUsageMetricsOptions)) { return(operations.ListUsageMetricsAsync(poolListUsageMetricsOptions).GetAwaiter().GetResult()); }