Search in sources :

Example 1 with GetTopicAttributesRequest

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

the class GetTopicAttributes method getSNSTopicAttributes.

// snippet-start:[sns.java2.GetTopicAttributes.main]
public static void getSNSTopicAttributes(SnsClient snsClient, String topicArn) {
    try {
        GetTopicAttributesRequest request = GetTopicAttributesRequest.builder().topicArn(topicArn).build();
        GetTopicAttributesResponse result = snsClient.getTopicAttributes(request);
        System.out.println("\n\nStatus is " + result.sdkHttpResponse().statusCode() + "\n\nAttributes: \n\n" + result.attributes());
    } catch (SnsException e) {
        System.err.println(e.awsErrorDetails().errorMessage());
        System.exit(1);
    }
}
Also used : GetTopicAttributesRequest(software.amazon.awssdk.services.sns.model.GetTopicAttributesRequest) GetTopicAttributesResponse(software.amazon.awssdk.services.sns.model.GetTopicAttributesResponse) SnsException(software.amazon.awssdk.services.sns.model.SnsException)

Aggregations

GetTopicAttributesRequest (software.amazon.awssdk.services.sns.model.GetTopicAttributesRequest)1 GetTopicAttributesResponse (software.amazon.awssdk.services.sns.model.GetTopicAttributesResponse)1 SnsException (software.amazon.awssdk.services.sns.model.SnsException)1