Search in sources :

Example 1 with ListTextTranslationJobsResponse

use of software.amazon.awssdk.services.translate.model.ListTextTranslationJobsResponse in project aws-doc-sdk-examples by awsdocs.

the class ListTextTranslationJobs method getTranslationJobs.

// snippet-start:[translate.java2._list_jobs.main]
public static void getTranslationJobs(TranslateClient translateClient) {
    try {
        ListTextTranslationJobsRequest textTranslationJobsRequest = ListTextTranslationJobsRequest.builder().maxResults(10).build();
        ListTextTranslationJobsResponse jobsResponse = translateClient.listTextTranslationJobs(textTranslationJobsRequest);
        List<TextTranslationJobProperties> props = jobsResponse.textTranslationJobPropertiesList();
        for (TextTranslationJobProperties prop : props) {
            System.out.println("The job name is: " + prop.jobName());
            System.out.println("The job id is: " + prop.jobId());
        }
    } catch (TranslateException e) {
        System.err.println(e.getMessage());
        System.exit(1);
    }
}
Also used : TextTranslationJobProperties(software.amazon.awssdk.services.translate.model.TextTranslationJobProperties) ListTextTranslationJobsResponse(software.amazon.awssdk.services.translate.model.ListTextTranslationJobsResponse) ListTextTranslationJobsRequest(software.amazon.awssdk.services.translate.model.ListTextTranslationJobsRequest) TranslateException(software.amazon.awssdk.services.translate.model.TranslateException)

Aggregations

ListTextTranslationJobsRequest (software.amazon.awssdk.services.translate.model.ListTextTranslationJobsRequest)1 ListTextTranslationJobsResponse (software.amazon.awssdk.services.translate.model.ListTextTranslationJobsResponse)1 TextTranslationJobProperties (software.amazon.awssdk.services.translate.model.TextTranslationJobProperties)1 TranslateException (software.amazon.awssdk.services.translate.model.TranslateException)1