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