@@ -0,0 +1,3186 @@
+//snippet-sourcedescription:%5BListJobs.java demonstrates how to get information about all completed MediaConvert job.%5D%0A//snippet-keyword:%5BSDK for Java 2.0%5D%0A//snippet-keyword:%5BCode Sample%5D%0A//snippet-service:%5BAWS Elemental MediaConvert%5D%0A//snippet-sourcetype:%5Bfull-example%5D%0A//snippet-sourcedate:%5B7/30/2020%5D%0A//snippet-sourceauthor:%5Bsmacdon - AWS %5D%0A%0A/*%0A * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at:%0A *%0A *    http://aws.amazon.com/apache2.0%0A *%0A * This file is distributed on an %22AS IS%22 BASIS, WITHOUT WARRANTIES%0A * OR CONDITIONS OF ANY KIND, either express or implied. See the%0A * License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage com.example.mediaconvert;%0A%0A// snippet-start:%5Bmediaconvert.java.list_jobs.import%5D%0Aimport software.amazon.awssdk.core.exception.SdkException;%0Aimport software.amazon.awssdk.regions.Region;%0Aimport software.amazon.awssdk.services.mediaconvert.MediaConvertClient;%0Aimport software.amazon.awssdk.services.mediaconvert.model.ListJobsRequest;%0Aimport software.amazon.awssdk.services.mediaconvert.model.DescribeEndpointsResponse;%0Aimport software.amazon.awssdk.services.mediaconvert.model.DescribeEndpointsRequest;%0Aimport software.amazon.awssdk.services.mediaconvert.model.ListJobsResponse;%0Aimport software.amazon.awssdk.services.mediaconvert.model.Job;%0Aimport java.net.URI;%0Aimport java.util.List;%0A// snippet-end:%5Bmediaconvert.java.list_jobs.import%5D%0A%0Apublic class ListJobs %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A%0A        Region region = Region.US_WEST_2;%0A        MediaConvertClient mc = MediaConvertClient.builder()%0A                .region(region)%0A                .build();%0A%0A        listCompleteJobs(mc);%0A    %7D%0A%0A    // snippet-start:%5Bmediaconvert.java.list_jobs.main%5D%0A    public static void listCompleteJobs(MediaConvertClient mc) %7B%0A%0A        try %7B%0A%0A            DescribeEndpointsResponse res = mc.describeEndpoints(DescribeEndpointsRequest.builder()%0A                .maxResults(20)%0A                .build());%0A%0A            if (res.endpoints().size() %3C= 0) %7B%0A                System.out.println(%22Cannot find MediaConvert service endpoint URL!%22);%0A                System.exit(1);%0A            %7D%0A%0A            String endpointURL = res.endpoints().get(0).url();%0A%0A            MediaConvertClient emc = MediaConvertClient.builder()%0A                .region(Region.US_WEST_2)%0A                .endpointOverride(URI.create(endpointURL))%0A                .build();%0A%0A            ListJobsRequest jobsRequest = ListJobsRequest.builder()%0A                .maxResults(10)%0A                .status(%22COMPLETE%22)%0A                .build();%0A%0A            ListJobsResponse jobsResponse = emc.listJobs(jobsRequest);%0A            List%3CJob%3E jobs = jobsResponse.jobs();%0A%0A            for (Job job: jobs) %7B%0A                System.out.println(%22The JOB ARN is : %22+job.arn());%0A            %7D%0A        %7D catch (SdkException e) %7B%0A            System.out.println(e.toString());%0A        %7D%0A        // snippet-end:%5Bmediaconvert.java.list_jobs.main%5D%0A    %7D%0A%7D%0A

Create ListJobs.java