/// <summary>
 /// Gets the first page of the Data Lake Analytics JobInformation
 /// objects within the specified resource group with a link to the
 /// next page, if any.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.DataLake.AnalyticsJob.IJobOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group.
 /// </param>
 /// <param name='accountName'>
 /// Required. The name of the Data Lake Analytics account to get the
 /// job from
 /// </param>
 /// <param name='parameters'>
 /// Optional. Query parameters. If null is passed returns all JobInfo
 /// items.
 /// </param>
 /// <returns>
 /// List of jobInfo items.
 /// </returns>
 public static Task<JobInfoListResponse> ListAsync(this IJobOperations operations, string resourceGroupName, string accountName, JobListParameters parameters)
 {
     return operations.ListAsync(resourceGroupName, accountName, parameters, CancellationToken.None);
 }
        public List<JobInformation> ListJobs(string resourceGroupName, string accountName, string filter, int? top,
            int? skip)
        {
            if (string.IsNullOrEmpty(resourceGroupName))
            {
                resourceGroupName = GetResourceGroupByAccountName(accountName);
            }

            var parameters = new JobListParameters
            {
                Filter = filter,
                Top = top,
                Skip = skip
            };

            var jobList = new List<JobInformation>();
            var response = _jobClient.Jobs.List(resourceGroupName, accountName, parameters);

            jobList.AddRange(response.Value);
            while (!string.IsNullOrEmpty(response.NextLink))
            {
                response = ListJobsWithNextLink(response.NextLink, resourceGroupName);
                jobList.AddRange(response.Value);
            }

            return jobList;
        }
 /// <summary>
 /// Gets the first page of the Data Lake Analytics JobInformation
 /// objects within the specified resource group with a link to the
 /// next page, if any.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.DataLake.AnalyticsJob.IJobOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group.
 /// </param>
 /// <param name='accountName'>
 /// Required. The name of the Data Lake Analytics account to get the
 /// job from
 /// </param>
 /// <param name='parameters'>
 /// Optional. Query parameters. If null is passed returns all JobInfo
 /// items.
 /// </param>
 /// <returns>
 /// List of jobInfo items.
 /// </returns>
 public static JobInfoListResponse List(this IJobOperations operations, string resourceGroupName, string accountName, JobListParameters parameters)
 {
     return Task.Factory.StartNew((object s) => 
     {
         return ((IJobOperations)s).ListAsync(resourceGroupName, accountName, parameters);
     }
     , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }