/// <summary> /// Initiates the asynchronous execution of the DescribeTextTranslationJob operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeTextTranslationJob 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 EndDescribeTextTranslationJob /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/DescribeTextTranslationJob">REST API Reference for DescribeTextTranslationJob Operation</seealso> public virtual IAsyncResult BeginDescribeTextTranslationJob(DescribeTextTranslationJobRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeTextTranslationJobRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeTextTranslationJobResponseUnmarshaller.Instance; return(BeginInvoke(request, options, callback, state)); }
/// <summary> /// Gets the properties associated with an asycnhronous batch translation job including /// name, ID, status, source and target languages, input/output S3 buckets, and so on. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeTextTranslationJob service method.</param> /// /// <returns>The response from the DescribeTextTranslationJob 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/DescribeTextTranslationJob">REST API Reference for DescribeTextTranslationJob Operation</seealso> public virtual DescribeTextTranslationJobResponse DescribeTextTranslationJob(DescribeTextTranslationJobRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeTextTranslationJobRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeTextTranslationJobResponseUnmarshaller.Instance; return(Invoke <DescribeTextTranslationJobResponse>(request, options)); }
/// <summary> /// Retrieve information about an Amazon Translate text translation job. /// </summary> /// <param name="client">The initialized Amazon Translate client object.</param> /// <param name="request">The DescribeTextTranslationJobRequest object.</param> /// <returns>The TextTranslationJobProperties object containing /// information about the text translation job..</returns> public static async Task<TextTranslationJobProperties> DescribeTranslationJobAsync( AmazonTranslateClient client, DescribeTextTranslationJobRequest request) { var response = await client.DescribeTextTranslationJobAsync(request); if (response.HttpStatusCode == System.Net.HttpStatusCode.OK) { return response.TextTranslationJobProperties; } else { return null; } }
public static async Task Main() { var client = new AmazonTranslateClient(); // The Job Id is generated when the text translation job is started // with a call to the StartTextTranslationJob method. var jobId = ""; var request = new DescribeTextTranslationJobRequest { JobId = jobId, }; var jobProperties = await DescribeTranslationJobAsync(client, request); DisplayTranslationJobDetails(jobProperties); }
/// <summary> /// Gets the properties associated with an asycnhronous batch translation job including /// name, ID, status, source and target languages, input/output S3 buckets, and so on. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeTextTranslationJob 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 DescribeTextTranslationJob 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/DescribeTextTranslationJob">REST API Reference for DescribeTextTranslationJob Operation</seealso> public virtual Task <DescribeTextTranslationJobResponse> DescribeTextTranslationJobAsync(DescribeTextTranslationJobRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeTextTranslationJobRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeTextTranslationJobResponseUnmarshaller.Instance; return(InvokeAsync <DescribeTextTranslationJobResponse>(request, options, cancellationToken)); }