Search in sources :

Example 1 with ListPhoneNumbersOptedOutRequest

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

the class ListOptOut method listOpts.

// snippet-start:[sns.java2.ListOptOut.main]
public static void listOpts(SnsClient snsClient) {
    try {
        ListPhoneNumbersOptedOutRequest request = ListPhoneNumbersOptedOutRequest.builder().build();
        ListPhoneNumbersOptedOutResponse result = snsClient.listPhoneNumbersOptedOut(request);
        System.out.println("Status is " + result.sdkHttpResponse().statusCode() + "\n\nPhone Numbers: \n\n" + result.phoneNumbers());
    } catch (SnsException e) {
        System.err.println(e.awsErrorDetails().errorMessage());
        System.exit(1);
    }
}
Also used : SnsException(software.amazon.awssdk.services.sns.model.SnsException) ListPhoneNumbersOptedOutRequest(software.amazon.awssdk.services.sns.model.ListPhoneNumbersOptedOutRequest) ListPhoneNumbersOptedOutResponse(software.amazon.awssdk.services.sns.model.ListPhoneNumbersOptedOutResponse)

Aggregations

ListPhoneNumbersOptedOutRequest (software.amazon.awssdk.services.sns.model.ListPhoneNumbersOptedOutRequest)1 ListPhoneNumbersOptedOutResponse (software.amazon.awssdk.services.sns.model.ListPhoneNumbersOptedOutResponse)1 SnsException (software.amazon.awssdk.services.sns.model.SnsException)1