use of software.amazon.awssdk.services.sns.SnsClient in project aws-doc-sdk-examples by awsdocs.
the class SetTopicAttributes method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + " <attribute> <topicArn> <value>\n\n" + "Where:\n" + " attribute - the attribute action to use. Valid parameters are: Policy | DisplayName | DeliveryPolicy .\n" + " topicArn - The ARN of the topic. \n" + " value - the value for the attribute.\n\n";
if (args.length < 3) {
System.out.println(USAGE);
System.exit(1);
}
String attribute = args[0];
String topicArn = args[1];
String value = args[2];
SnsClient snsClient = SnsClient.builder().region(Region.US_WEST_2).build();
setTopAttr(snsClient, attribute, topicArn, value);
snsClient.close();
}
use of software.amazon.awssdk.services.sns.SnsClient in project aws-doc-sdk-examples by awsdocs.
the class SubscribeLambda method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + " <topicArn> <lambdaArn>\n\n" + "Where:\n" + " topicArn - the ARN of the topic to subscribe.\n\n" + " lambdaArn - the ARN of an AWS Lambda function.\n\n";
if (args.length != 2) {
System.out.println(USAGE);
System.exit(1);
}
String topicArn = args[0];
String lambdaArn = args[1];
SnsClient snsClient = SnsClient.builder().region(Region.US_WEST_2).build();
String arnValue = subLambda(snsClient, topicArn, lambdaArn);
System.out.println("Subscription ARN: " + arnValue);
snsClient.close();
}
use of software.amazon.awssdk.services.sns.SnsClient in project aws-doc-sdk-examples by awsdocs.
the class SubscribeTextSMS method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + " <topicArn> <phoneNumber>\n\n" + "Where:\n" + " topicArn - the ARN of the topic to subscribe.\n\n" + " phoneNumber - a mobile phone number that receives notifications (for example, +1XXX5550100).\n\n";
if (args.length < 2) {
System.out.println(USAGE);
System.exit(1);
}
String topicArn = args[0];
String phoneNumber = args[1];
SnsClient snsClient = SnsClient.builder().region(Region.US_WEST_2).build();
subTextSNS(snsClient, topicArn, phoneNumber);
snsClient.close();
}
use of software.amazon.awssdk.services.sns.SnsClient in project aws-doc-sdk-examples by awsdocs.
the class UseMessageFilterPolicy method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + " <subscriptionArn>\n\n" + "Where:\n" + " subscriptionArn - the ARN of a subscription.\n\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String subscriptionArn = args[0];
SnsClient snsClient = SnsClient.builder().region(Region.US_EAST_1).build();
usePolicy(snsClient, subscriptionArn);
snsClient.close();
}
use of software.amazon.awssdk.services.sns.SnsClient in project aws-doc-sdk-examples by awsdocs.
the class CheckOptOut method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + " <phoneNumber>\n\n" + "Where:\n" + " phoneNumber - the mobile phone number to look up (for example, +1XXX5550100).\n\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String phoneNumber = args[0];
SnsClient snsClient = SnsClient.builder().region(Region.US_EAST_1).build();
checkPhone(snsClient, phoneNumber);
snsClient.close();
}
Aggregations