use of software.amazon.awssdk.services.pinpoint.PinpointClient in project aws-doc-sdk-examples by awsdocs.
the class CreateApp method main.
public static void main(String[] args) {
final String USAGE = "\n" + "CreateApp - create an application in the Amazon Pinpoint dashboard\n\n" + "Usage: CreateApp <appName>\n\n" + "Where:\n" + " appName - the name of the application to create.\n\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String appName = args[0];
System.out.println("Creating an application with name: " + appName);
PinpointClient pinpoint = PinpointClient.builder().region(Region.US_EAST_1).build();
String appID = createApplication(pinpoint, appName);
System.out.println("App ID is: " + appID);
pinpoint.close();
}
use of software.amazon.awssdk.services.pinpoint.PinpointClient in project aws-doc-sdk-examples by awsdocs.
the class DeleteEndpoint method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + "DeleteEndpoint <appName> <endpointId >\n\n" + "Where:\n" + " appId - the id of the application to delete.\n\n" + " endpointId - the id of the endpoint to delete.\n";
if (args.length != 2) {
System.out.println(USAGE);
System.exit(1);
}
String appId = args[0];
String endpointId = args[1];
System.out.println("Deleting an endpoint with id: " + endpointId);
PinpointClient pinpoint = PinpointClient.builder().region(Region.US_EAST_1).build();
deletePinEncpoint(pinpoint, appId, endpointId);
pinpoint.close();
}
use of software.amazon.awssdk.services.pinpoint.PinpointClient in project aws-doc-sdk-examples by awsdocs.
the class SendMessage method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + "SendMessage <message> <appId> <originationNumber> <destinationNumber> \n\n" + "Where:\n" + " message - the body of the message to send.\n\n" + " appId - the Amazon Pinpoint project/application ID to use when you send this message.\n\n" + " originationNumber - the phone number or short code that you specify has to be associated with your Amazon Pinpoint account. For best results, specify long codes in E.164 format (for example, +1-555-555-5654). " + " destinationNumber - the recipient's phone number. For best results, you should specify the phone number in E.164 format (for example, +1-555-555-5654). ";
if (args.length != 4) {
System.out.println(USAGE);
System.exit(1);
}
String message = args[0];
String appId = args[1];
String originationNumber = args[2];
String destinationNumber = args[3];
System.out.println("Sending a message");
PinpointClient pinpoint = PinpointClient.builder().region(Region.US_EAST_1).build();
sendSMSMessage(pinpoint, message, appId, originationNumber, destinationNumber);
pinpoint.close();
}
use of software.amazon.awssdk.services.pinpoint.PinpointClient in project aws-doc-sdk-examples by awsdocs.
the class UpdateEndpoint method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + "CreateEndpoint <appId>\n\n" + "Where:\n" + " appId - the ID of the application to create an endpoint for.\n\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String appId = args[0];
PinpointClient pinpoint = PinpointClient.builder().region(Region.US_EAST_1).build();
EndpointResponse response = createEndpoint(pinpoint, appId);
System.out.println("Got Endpoint: " + response.id());
pinpoint.close();
}
use of software.amazon.awssdk.services.pinpoint.PinpointClient in project aws-doc-sdk-examples by awsdocs.
the class AddExampleEndpoints method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + " <appId>\n\n" + "Where:\n" + " appId - the ID of the application.\n\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String applicationId = args[0];
PinpointClient pinpoint = PinpointClient.builder().region(Region.US_EAST_1).build();
updateEndpointsViaBatch(pinpoint, applicationId);
pinpoint.close();
}
Aggregations