/// <summary>
 /// Get the list of jobs in a job collection matching a filter on job
 /// state.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.WindowsAzure.Scheduler.IJobOperations.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the List Jobs with filter
 /// operation.
 /// </param>
 /// <returns>
 /// The List Jobs operation response.
 /// </returns>
 public static JobListResponse ListWithFilter(this IJobOperations operations, JobListWithFilterParameters parameters)
 {
     return Task.Factory.StartNew((object s) => 
     {
         return ((IJobOperations)s).ListWithFilterAsync(parameters);
     }
     , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
 /// <summary>
 /// Get the list of jobs in a job collection matching a filter on job
 /// state.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.WindowsAzure.Scheduler.IJobOperations.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the List Jobs with filter
 /// operation.
 /// </param>
 /// <returns>
 /// The List Jobs operation response.
 /// </returns>
 public static Task<JobListResponse> ListWithFilterAsync(this IJobOperations operations, JobListWithFilterParameters parameters)
 {
     return operations.ListWithFilterAsync(parameters, CancellationToken.None);
 }
 /// <summary>
 /// Get the list of jobs in a job collection matching a filter on job
 /// state.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.WindowsAzure.Scheduler.IJobOperations.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the List Jobs with filter operation.
 /// </param>
 /// <returns>
 /// The List Jobs operation response.
 /// </returns>
 public static JobListResponse ListWithFilter(this IJobOperations operations, JobListWithFilterParameters parameters)
 {
     try
     {
         return operations.ListWithFilterAsync(parameters).Result;
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }