@@ -0,0 +1,2514 @@
+// snippet-comment:%5BThese are tags for the AWS doc team's sample catalog. Do not remove.%5D%0A// snippet-sourcedescription:%5BListEmailIdentities.java demonstrates how to get a list of email identities that are associated with your Amazon Web Services account.%5D%0A// snippet-keyword:%5BAWS SDK for Java v2%5D%0A// snippet-keyword:%5BAmazon Simple Email Service%5D%0A// snippet-keyword:%5BCode Sample%5D%0A// snippet-sourcetype:%5Bfull-example%5D%0A%0A/*%0A   Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.%0A   SPDX-License-Identifier: Apache-2.0%0A*/%0A%0Apackage com.example.sesv2;%0A%0Aimport software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider;%0Aimport software.amazon.awssdk.regions.Region;%0Aimport software.amazon.awssdk.services.sesv2.SesV2Client;%0Aimport software.amazon.awssdk.services.sesv2.model.IdentityInfo;%0Aimport software.amazon.awssdk.services.sesv2.model.ListEmailIdentitiesRequest;%0Aimport software.amazon.awssdk.services.sesv2.model.ListEmailIdentitiesResponse;%0Aimport software.amazon.awssdk.services.sesv2.model.SesV2Exception;%0A%0Aimport java.util.List;%0A%0A/**%0A * Before running this Java V2 code example, set up your development environment, including your credentials.%0A *%0A * For more information, see the following documentation topic:%0A *%0A * https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/get-started.html%0A */%0A%0Apublic class ListEmailIdentities %7B%0A%0A        public static void main(String%5B%5D args) %7B%0A%0A                Region region = Region.US_EAST_1;%0A                SesV2Client sesv2Client = SesV2Client.builder()%0A                        .region(region)%0A                        .credentialsProvider(ProfileCredentialsProvider.create())%0A                        .build();%0A%0A                listSESIdentities(sesv2Client);%0A        %7D%0A%0A        public static void listSESIdentities(SesV2Client sesV2Client) %7B%0A%0A                ListEmailIdentitiesRequest identitiesRequest = ListEmailIdentitiesRequest.builder()%0A                        .pageSize(5)%0A                        .build();%0A%0A                try %7B%0A                        ListEmailIdentitiesResponse response = sesV2Client.listEmailIdentities(identitiesRequest);%0A                        final List%3CIdentityInfo%3E identities = response.emailIdentities();%0A                        identities.forEach(identity -%3E System.out.println(identity.identityName()));%0A%0A                %7D catch (SesV2Exception e) %7B%0A                        System.err.println(e.awsErrorDetails().errorMessage());%0A                        System.exit(1);%0A                %7D%0A        %7D%0A%7D%0A

Create ListEmailIdentities.java