/// <summary>
 /// Lists the files in a Task's directory on its Compute Node.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='jobId'>
 /// The ID of the Job that contains the Task.
 /// </param>
 /// <param name='taskId'>
 /// The ID of the Task whose files you want to list.
 /// </param>
 /// <param name='recursive'>
 /// Whether to list children of the Task directory. This parameter can be used
 /// in combination with the filter parameter to list specific type of files.
 /// </param>
 /// <param name='fileListFromTaskOptions'>
 /// Additional parameters for the operation
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <NodeFile> > ListFromTaskAsync(this IFileOperations operations, string jobId, string taskId, bool?recursive = default(bool?), FileListFromTaskOptions fileListFromTaskOptions = default(FileListFromTaskOptions), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListFromTaskWithHttpMessagesAsync(jobId, taskId, recursive, fileListFromTaskOptions, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Lists the files in a task's directory on its compute node.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='jobId'>
 /// The id of the job that contains the task.
 /// </param>
 /// <param name='taskId'>
 /// The id of the task whose files you want to list.
 /// </param>
 /// <param name='recursive'>
 /// Whether to list children of a directory.
 /// </param>
 /// <param name='fileListFromTaskOptions'>
 /// Additional parameters for the operation
 /// </param>
 public static Microsoft.Rest.Azure.IPage <NodeFile> ListFromTask(this IFileOperations operations, string jobId, string taskId, bool?recursive = default(bool?), FileListFromTaskOptions fileListFromTaskOptions = default(FileListFromTaskOptions))
 {
     return(System.Threading.Tasks.Task.Factory.StartNew(s => ((IFileOperations)s).ListFromTaskAsync(jobId, taskId, recursive, fileListFromTaskOptions), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Lists the files in a Task's directory on its Compute Node.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='jobId'>
 /// The ID of the Job that contains the Task.
 /// </param>
 /// <param name='taskId'>
 /// The ID of the Task whose files you want to list.
 /// </param>
 /// <param name='recursive'>
 /// Whether to list children of the Task directory. This parameter can be used
 /// in combination with the filter parameter to list specific type of files.
 /// </param>
 /// <param name='fileListFromTaskOptions'>
 /// Additional parameters for the operation
 /// </param>
 public static IPage <NodeFile> ListFromTask(this IFileOperations operations, string jobId, string taskId, bool?recursive = default(bool?), FileListFromTaskOptions fileListFromTaskOptions = default(FileListFromTaskOptions))
 {
     return(operations.ListFromTaskAsync(jobId, taskId, recursive, fileListFromTaskOptions).GetAwaiter().GetResult());
 }
Exemple #4
0
        public virtual Pageable <NodeFile> ListFromTask(string jobId, string taskId, bool?recursive, FileListFromTaskOptions fileListFromTaskOptions, CancellationToken cancellationToken = default)
        {
            if (jobId == null)
            {
                throw new ArgumentNullException(nameof(jobId));
            }
            if (taskId == null)
            {
                throw new ArgumentNullException(nameof(taskId));
            }

            Page <NodeFile> FirstPageFunc(int?pageSizeHint)
            {
                var response = RestClient.ListFromTask(jobId, taskId, recursive, fileListFromTaskOptions, cancellationToken);

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

            Page <NodeFile> NextPageFunc(string nextLink, int?pageSizeHint)
            {
                var response = RestClient.ListFromTaskNextPage(nextLink, jobId, taskId, recursive, fileListFromTaskOptions, cancellationToken);

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

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc));
        }