Пример #1
0
        internal virtual StopTextTranslationJobResponse StopTextTranslationJob(StopTextTranslationJobRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = StopTextTranslationJobRequestMarshaller.Instance;
            options.ResponseUnmarshaller = StopTextTranslationJobResponseUnmarshaller.Instance;

            return(Invoke <StopTextTranslationJobResponse>(request, options));
        }
Пример #2
0
        /// <summary>
        /// Initiates the asynchronous execution of the StopTextTranslationJob operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the StopTextTranslationJob operation on AmazonTranslateClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        ///
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndStopTextTranslationJob
        ///         operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/StopTextTranslationJob">REST API Reference for StopTextTranslationJob Operation</seealso>
        public virtual IAsyncResult BeginStopTextTranslationJob(StopTextTranslationJobRequest request, AsyncCallback callback, object state)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = StopTextTranslationJobRequestMarshaller.Instance;
            options.ResponseUnmarshaller = StopTextTranslationJobResponseUnmarshaller.Instance;

            return(BeginInvoke(request, options, callback, state));
        }
Пример #3
0
        public static async Task Main()
        {
            var client = new AmazonTranslateClient();
            var jobId  = "sample-job-id";

            var request = new StopTextTranslationJobRequest
            {
                JobId = jobId,
            };
        }
Пример #4
0
        /// <summary>
        /// Sends a request to stop a text translation job.
        /// </summary>
        /// <param name="client">Initialized AmazonTrnslateClient object.</param>
        /// <param name="request">The request object to be passed to the
        /// StopTextJobAsync method.</param>
        public static async Task StopTranslationJobAsync(
            AmazonTranslateClient client,
            StopTextTranslationJobRequest request)
        {
            var response = await client.StopTextTranslationJobAsync(request);

            if (response.HttpStatusCode == System.Net.HttpStatusCode.OK)
            {
                Console.WriteLine($"{response.JobId} as status: {response.JobStatus}");
            }
        }
Пример #5
0
        /// <summary>
        /// Stops an asynchronous batch translation job that is in progress.
        ///
        ///
        /// <para>
        /// If the job's state is <code>IN_PROGRESS</code>, the job will be marked for termination
        /// and put into the <code>STOP_REQUESTED</code> state. If the job completes before it
        /// can be stopped, it is put into the <code>COMPLETED</code> state. Otherwise, the job
        /// is put into the <code>STOPPED</code> state.
        /// </para>
        ///
        /// <para>
        /// Asynchronous batch translation jobs are started with the <a>StartTextTranslationJob</a>
        /// operation. You can use the <a>DescribeTextTranslationJob</a> or <a>ListTextTranslationJobs</a>
        /// operations to get a batch translation job's <code>JobId</code>.
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the StopTextTranslationJob service method.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        ///
        /// <returns>The response from the StopTextTranslationJob service method, as returned by Translate.</returns>
        /// <exception cref="Amazon.Translate.Model.InternalServerException">
        /// An internal server error occurred. Retry your request.
        /// </exception>
        /// <exception cref="Amazon.Translate.Model.ResourceNotFoundException">
        /// The resource you are looking for has not been found. Review the resource you're looking
        /// for and see if a different resource will accomplish your needs before retrying the
        /// revised request.
        /// </exception>
        /// <exception cref="Amazon.Translate.Model.TooManyRequestsException">
        /// You have made too many requests within a short period of time. Wait for a short time
        /// and then try your request again.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/StopTextTranslationJob">REST API Reference for StopTextTranslationJob Operation</seealso>
        public virtual Task <StopTextTranslationJobResponse> StopTextTranslationJobAsync(StopTextTranslationJobRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = StopTextTranslationJobRequestMarshaller.Instance;
            options.ResponseUnmarshaller = StopTextTranslationJobResponseUnmarshaller.Instance;

            return(InvokeAsync <StopTextTranslationJobResponse>(request, options, cancellationToken));
        }