/// <summary> /// Updates the properties of the specified Task. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='jobId'> /// The ID of the Job containing the Task. /// </param> /// <param name='taskId'> /// The ID of the Task to update. /// </param> /// <param name='constraints'> /// Constraints that apply to this Task. If omitted, the Task is given the /// default constraints. For multi-instance Tasks, updating the retention time /// applies only to the primary Task and not subtasks. /// </param> /// <param name='taskUpdateOptions'> /// Additional parameters for the operation /// </param> public static TaskUpdateHeaders Update(this ITaskOperations operations, string jobId, string taskId, TaskConstraints constraints = default(TaskConstraints), TaskUpdateOptions taskUpdateOptions = default(TaskUpdateOptions)) { return(operations.UpdateAsync(jobId, taskId, constraints, taskUpdateOptions).GetAwaiter().GetResult()); }
/// <summary> /// Updates the properties of the specified Task. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='jobId'> /// The ID of the Job containing the Task. /// </param> /// <param name='taskId'> /// The ID of the Task to update. /// </param> /// <param name='constraints'> /// Constraints that apply to this Task. If omitted, the Task is given the /// default constraints. For multi-instance Tasks, updating the retention time /// applies only to the primary Task and not subtasks. /// </param> /// <param name='taskUpdateOptions'> /// Additional parameters for the operation /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <TaskUpdateHeaders> UpdateAsync(this ITaskOperations operations, string jobId, string taskId, TaskConstraints constraints = default(TaskConstraints), TaskUpdateOptions taskUpdateOptions = default(TaskUpdateOptions), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UpdateWithHttpMessagesAsync(jobId, taskId, constraints, taskUpdateOptions, null, cancellationToken).ConfigureAwait(false)) { return(_result.Headers); } }
/// <summary> /// Updates the properties of the specified task. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='jobId'> /// The id of the job containing the task. /// </param> /// <param name='taskId'> /// The id of the task to update. /// </param> /// <param name='constraints'> /// Constraints that apply to this task. If omitted, the task is given the /// default constraints. /// </param> /// <param name='taskUpdateOptions'> /// Additional parameters for the operation /// </param> public static TaskUpdateHeaders Update(this ITaskOperations operations, string jobId, string taskId, TaskConstraints constraints = default(TaskConstraints), TaskUpdateOptions taskUpdateOptions = default(TaskUpdateOptions)) { return(System.Threading.Tasks.Task.Factory.StartNew(s => ((ITaskOperations)s).UpdateAsync(jobId, taskId, constraints, taskUpdateOptions), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }