use of software.amazon.awssdk.services.sns.SnsClient in project aws-doc-sdk-examples by awsdocs.
the class SetSMSAttributes method main.
public static void main(String[] args) {
HashMap<String, String> attributes = new HashMap<>(1);
attributes.put("DefaultSMSType", "Transactional");
attributes.put("UsageReportS3Bucket", "janbucket");
SnsClient snsClient = SnsClient.builder().region(Region.US_WEST_2).build();
setSNSAttributes(snsClient, attributes);
snsClient.close();
}
use of software.amazon.awssdk.services.sns.SnsClient in project aws-doc-sdk-examples by awsdocs.
the class SubscribeEmail method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + " <topicArn> <email>\n\n" + "Where:\n" + " topicArn - the ARN of the topic to subscribe.\n\n" + " email - the email address to use.\n\n";
if (args.length != 2) {
System.out.println(USAGE);
System.exit(1);
}
String topicArn = args[0];
String email = args[1];
SnsClient snsClient = SnsClient.builder().region(Region.US_WEST_2).build();
subEmail(snsClient, topicArn, email);
snsClient.close();
}
use of software.amazon.awssdk.services.sns.SnsClient in project aws-doc-sdk-examples by awsdocs.
the class AddTags method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + " <topicArn>\n\n" + "Where:\n" + " topicArn - the ARN of the topic to which tags are added.\n\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String topicArn = args[0];
SnsClient snsClient = SnsClient.builder().region(Region.US_EAST_1).build();
addTopicTags(snsClient, topicArn);
snsClient.close();
}
use of software.amazon.awssdk.services.sns.SnsClient in project aws-doc-sdk-examples by awsdocs.
the class DeleteTag method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + " <topicArn> <tagKey>\n\n" + "Where:\n" + " topicArn - the ARN of the topic to which tags are added.\n\n" + " tagKey - the key of the tag to delete.";
if (args.length != 2) {
System.out.println(USAGE);
System.exit(1);
}
String topicArn = args[0];
String tagKey = args[1];
SnsClient snsClient = SnsClient.builder().region(Region.US_EAST_1).build();
removeTag(snsClient, topicArn, tagKey);
snsClient.close();
}
use of software.amazon.awssdk.services.sns.SnsClient in project aws-doc-sdk-examples by awsdocs.
the class GetSMSAtrributes method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + " <topicArn>\n\n" + "Where:\n" + " topicArn - the ARN of the topic from which to retrieve attributes.\n\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String topicArn = args[0];
SnsClient snsClient = SnsClient.builder().region(Region.US_WEST_2).build();
getSNSAttrutes(snsClient, topicArn);
snsClient.close();
}
Aggregations