Search in sources :

Example 1 with ListSubscriptionsResponse

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

the class ListSubscriptions method listSNSSubscriptions.

// snippet-start:[sns.java2.ListSubscriptions.main]
public static void listSNSSubscriptions(SnsClient snsClient) {
    try {
        ListSubscriptionsRequest request = ListSubscriptionsRequest.builder().build();
        ListSubscriptionsResponse result = snsClient.listSubscriptions(request);
        System.out.println(result.subscriptions());
    } catch (SnsException e) {
        System.err.println(e.awsErrorDetails().errorMessage());
        System.exit(1);
    }
}
Also used : ListSubscriptionsResponse(software.amazon.awssdk.services.sns.model.ListSubscriptionsResponse) ListSubscriptionsRequest(software.amazon.awssdk.services.sns.model.ListSubscriptionsRequest) SnsException(software.amazon.awssdk.services.sns.model.SnsException)

Aggregations

ListSubscriptionsRequest (software.amazon.awssdk.services.sns.model.ListSubscriptionsRequest)1 ListSubscriptionsResponse (software.amazon.awssdk.services.sns.model.ListSubscriptionsResponse)1 SnsException (software.amazon.awssdk.services.sns.model.SnsException)1