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