use of software.amazon.awssdk.services.sns.model.UntagResourceRequest in project aws-doc-sdk-examples by awsdocs.
the class DeleteTag method removeTag.
// snippet-start:[sns.java2.delete_tags.main]
public static void removeTag(SnsClient snsClient, String topicArn, String tagKey) {
try {
UntagResourceRequest resourceRequest = UntagResourceRequest.builder().resourceArn(topicArn).tagKeys(tagKey).build();
snsClient.untagResource(resourceRequest);
System.out.println(tagKey + " was deleted from " + topicArn);
} catch (SnsException e) {
System.err.println(e.awsErrorDetails().errorMessage());
System.exit(1);
}
}
Aggregations