use of software.amazon.awssdk.services.sns.model.ListTagsForResourceResponse in project aws-doc-sdk-examples by awsdocs.
the class ListTags method listTopicTags.
// snippet-start:[sns.java2.list_tags.main]
public static void listTopicTags(SnsClient snsClient, String topicArn) {
try {
ListTagsForResourceRequest tagsForResourceRequest = ListTagsForResourceRequest.builder().resourceArn(topicArn).build();
ListTagsForResourceResponse response = snsClient.listTagsForResource(tagsForResourceRequest);
System.out.println(String.format("Tags for topic %s are %s.\n", topicArn, response.tags()));
} catch (SnsException e) {
System.err.println(e.awsErrorDetails().errorMessage());
System.exit(1);
}
}
Aggregations