Ejemplo n.º 1
0
        public virtual Pageable <CloudJob> ListFromJobSchedule(string jobScheduleId, JobListFromJobScheduleOptions jobListFromJobScheduleOptions, CancellationToken cancellationToken = default)
        {
            if (jobScheduleId == null)
            {
                throw new ArgumentNullException(nameof(jobScheduleId));
            }

            Page <CloudJob> FirstPageFunc(int?pageSizeHint)
            {
                var response = RestClient.ListFromJobSchedule(jobScheduleId, jobListFromJobScheduleOptions, cancellationToken);

                return(Page.FromValues(response.Value.Value, response.Value.OdataNextLink, response.GetRawResponse()));
            }

            Page <CloudJob> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                var response = RestClient.ListFromJobScheduleNextPage(nextLink, jobScheduleId, jobListFromJobScheduleOptions, cancellationToken);

                return(Page.FromValues(response.Value.Value, response.Value.OdataNextLink, response.GetRawResponse()));
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Lists the jobs that have been created under the specified job schedule.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='jobScheduleId'>
 /// The id of the job schedule from which you want to get a list of jobs.
 /// </param>
 /// <param name='jobListFromJobScheduleOptions'>
 /// Additional parameters for the operation
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <Microsoft.Rest.Azure.IPage <CloudJob> > ListFromJobScheduleAsync(this IJobOperations operations, string jobScheduleId, JobListFromJobScheduleOptions jobListFromJobScheduleOptions = default(JobListFromJobScheduleOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     using (var _result = await operations.ListFromJobScheduleWithHttpMessagesAsync(jobScheduleId, jobListFromJobScheduleOptions, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Lists the jobs that have been created under the specified job schedule.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='jobScheduleId'>
 /// The id of the job schedule from which you want to get a list of jobs.
 /// </param>
 /// <param name='jobListFromJobScheduleOptions'>
 /// Additional parameters for the operation
 /// </param>
 public static Microsoft.Rest.Azure.IPage <CloudJob> ListFromJobSchedule(this IJobOperations operations, string jobScheduleId, JobListFromJobScheduleOptions jobListFromJobScheduleOptions = default(JobListFromJobScheduleOptions))
 {
     return(System.Threading.Tasks.Task.Factory.StartNew(s => ((IJobOperations)s).ListFromJobScheduleAsync(jobScheduleId, jobListFromJobScheduleOptions), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Lists the Jobs that have been created under the specified Job Schedule.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='jobScheduleId'>
 /// The ID of the Job Schedule from which you want to get a list of Jobs.
 /// </param>
 /// <param name='jobListFromJobScheduleOptions'>
 /// Additional parameters for the operation
 /// </param>
 public static IPage <CloudJob> ListFromJobSchedule(this IJobOperations operations, string jobScheduleId, JobListFromJobScheduleOptions jobListFromJobScheduleOptions = default(JobListFromJobScheduleOptions))
 {
     return(operations.ListFromJobScheduleAsync(jobScheduleId, jobListFromJobScheduleOptions).GetAwaiter().GetResult());
 }