internal virtual StopJobResponse StopJob(StopJobRequest request) { var marshaller = StopJobRequestMarshaller.Instance; var unmarshaller = StopJobResponseUnmarshaller.Instance; return(Invoke <StopJobRequest, StopJobResponse>(request, marshaller, unmarshaller)); }
public virtual async Task <StopJobResponse> StopJobAsync([FromBody] StopJobRequest request) { if (request == null) { throw new InvalidOperationException("request can't be empty"); } if (string.IsNullOrEmpty(request.JobClassName) == true) { throw new ArgumentNullException("request.JobClassName"); } var job = GetJobByClassName(request.JobClassName); if (job == null) { throw new InvalidOperationException($"Can't find job by name = {request.JobClassName}"); } var isStopped = job.IsRunning == true; await job.StopAsync(new CancellationToken()); return(new StopJobResponse { IsStopped = isStopped }); }
/// <summary> /// Initiates the asynchronous execution of the StopJob operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the StopJob operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/amplify-2017-07-25/StopJob">REST API Reference for StopJob Operation</seealso> public virtual Task <StopJobResponse> StopJobAsync(StopJobRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = StopJobRequestMarshaller.Instance; var unmarshaller = StopJobResponseUnmarshaller.Instance; return(InvokeAsync <StopJobRequest, StopJobResponse>(request, marshaller, unmarshaller, cancellationToken)); }
/// <summary> /// Initiates the asynchronous execution of the StopJob operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the StopJob operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/amplify-2017-07-25/StopJob">REST API Reference for StopJob Operation</seealso> public virtual Task <StopJobResponse> StopJobAsync(StopJobRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = StopJobRequestMarshaller.Instance; options.ResponseUnmarshaller = StopJobResponseUnmarshaller.Instance; return(InvokeAsync <StopJobResponse>(request, options, cancellationToken)); }
internal virtual StopJobResponse StopJob(StopJobRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = StopJobRequestMarshaller.Instance; options.ResponseUnmarshaller = StopJobResponseUnmarshaller.Instance; return(Invoke <StopJobResponse>(request, options)); }
/// <summary> /// 停止作业运行job /// </summary> /// <param name="request">请求参数信息</param> /// <returns>请求结果信息</returns> public async Task <StopJobResponse> StopJob(StopJobRequest request) { return(await new StopJobExecutor().Client(this).Execute <StopJobResponse, StopJobResult, StopJobRequest>(request).ConfigureAwait(false)); }
/// <summary> /// 停止作业运行job /// </summary> /// <param name="request">请求参数信息</param> /// <returns>请求结果信息</returns> public StopJobResponse StopJob(StopJobRequest request) { return(new StopJobExecutor().Client(this).Execute <StopJobResponse, StopJobResult, StopJobRequest>(request)); }