public virtual AsyncPageable <CloudJobSchedule> ListAsync(JobScheduleListOptions jobScheduleListOptions, CancellationToken cancellationToken = default) { async Task <Page <CloudJobSchedule> > FirstPageFunc(int?pageSizeHint) { var response = await RestClient.ListAsync(jobScheduleListOptions, cancellationToken).ConfigureAwait(false); return(Page.FromValues(response.Value.Value, response.Value.OdataNextLink, response.GetRawResponse())); } async Task <Page <CloudJobSchedule> > NextPageFunc(string nextLink, int?pageSizeHint) { var response = await RestClient.ListNextPageAsync(nextLink, jobScheduleListOptions, cancellationToken).ConfigureAwait(false); return(Page.FromValues(response.Value.Value, response.Value.OdataNextLink, response.GetRawResponse())); } return(PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc)); }
public virtual Pageable <CloudJobSchedule> List(JobScheduleListOptions jobScheduleListOptions, CancellationToken cancellationToken = default) { Page <CloudJobSchedule> FirstPageFunc(int?pageSizeHint) { var response = RestClient.List(jobScheduleListOptions, cancellationToken); return(Page.FromValues(response.Value.Value, response.Value.OdataNextLink, response.GetRawResponse())); } Page <CloudJobSchedule> NextPageFunc(string nextLink, int?pageSizeHint) { var response = RestClient.ListNextPage(nextLink, jobScheduleListOptions, cancellationToken); return(Page.FromValues(response.Value.Value, response.Value.OdataNextLink, response.GetRawResponse())); } return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc)); }
/// <summary> /// Lists all of the Job Schedules in the specified Account. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='jobScheduleListOptions'> /// Additional parameters for the operation /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <CloudJobSchedule> > ListAsync(this IJobScheduleOperations operations, JobScheduleListOptions jobScheduleListOptions = default(JobScheduleListOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(jobScheduleListOptions, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Lists all of the Job Schedules in the specified Account. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='jobScheduleListOptions'> /// Additional parameters for the operation /// </param> public static IPage <CloudJobSchedule> List(this IJobScheduleOperations operations, JobScheduleListOptions jobScheduleListOptions = default(JobScheduleListOptions)) { return(operations.ListAsync(jobScheduleListOptions).GetAwaiter().GetResult()); }
/// <summary> /// Lists all of the job schedules in the specified account. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='jobScheduleListOptions'> /// Additional parameters for the operation /// </param> public static Microsoft.Rest.Azure.IPage <CloudJobSchedule> List(this IJobScheduleOperations operations, JobScheduleListOptions jobScheduleListOptions = default(JobScheduleListOptions)) { return(System.Threading.Tasks.Task.Factory.StartNew(s => ((IJobScheduleOperations)s).ListAsync(jobScheduleListOptions), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }