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);
}
}
Aggregations