use of software.amazon.awssdk.services.sns.model.DeleteTopicResponse in project aws-doc-sdk-examples by awsdocs.
the class DeleteTopic method deleteSNSTopic.
// snippet-start:[sns.java2.DeleteTopic.main]
public static void deleteSNSTopic(SnsClient snsClient, String topicArn) {
try {
DeleteTopicRequest request = DeleteTopicRequest.builder().topicArn(topicArn).build();
DeleteTopicResponse result = snsClient.deleteTopic(request);
System.out.println("\n\nStatus was " + result.sdkHttpResponse().statusCode());
} catch (SnsException e) {
System.err.println(e.awsErrorDetails().errorMessage());
System.exit(1);
}
}
Aggregations