use of software.amazon.awssdk.services.pinpoint.PinpointClient in project aws-doc-sdk-examples by awsdocs.
the class CreateCampaign method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + "CreateCampaign <appId> <segmentId>\n\n" + "Where:\n" + " appId - the ID of the application to create the campaign in.\n\n" + " segmentId - the ID of the segment to create the campaign from.\n\n";
if (args.length != 2) {
System.out.println(USAGE);
System.exit(1);
}
String appId = args[0];
String segmentId = args[1];
PinpointClient pinpoint = PinpointClient.builder().region(Region.US_EAST_1).build();
createPinCampaign(pinpoint, appId, segmentId);
pinpoint.close();
}
use of software.amazon.awssdk.services.pinpoint.PinpointClient in project aws-doc-sdk-examples by awsdocs.
the class DeleteApp method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + "DeleteApp <appId>\n\n" + "Where:\n" + " appId - the ID of the application to delete.\n\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String appId = args[0];
System.out.println("Deleting an application with ID: " + appId);
PinpointClient pinpoint = PinpointClient.builder().region(Region.US_EAST_1).build();
deletePinApp(pinpoint, appId);
System.out.println("Done");
pinpoint.close();
}
use of software.amazon.awssdk.services.pinpoint.PinpointClient in project aws-doc-sdk-examples by awsdocs.
the class ExportEndpoints method main.
public static void main(String[] args) {
final String USAGE = "\n" + "This program performs the following steps:\n\n" + "1) Exports the endpoints to an Amazon S3 bucket.\n" + "2) Downloads the exported endpoints files from Amazon S3.\n" + "3) Parses the endpoints files to obtain the endpoint IDs and prints them.\n" + "Usage: ExportEndpoints <applicationId> <s3BucketName> <iamExportRoleArn> <path>\n\n" + "Where:\n" + " applicationId - The ID of the Amazon Pinpoint application that has the endpoint.\n" + " s3BucketName - The name of the Amazon S3 bucket to export the JSON file to. \n" + " iamExportRoleArn - The ARN of an IAM role that grants Amazon Pinpoint write permissions to the S3 bucket." + " path - The path where the files downloaded from the Amazon S3 bucket are written (for example, C:/AWS/).\n";
if (args.length != 4) {
System.out.println(USAGE);
System.exit(1);
}
String applicationId = args[0];
String s3BucketName = args[1];
String iamExportRoleArn = args[2];
String path = args[3];
System.out.println("Deleting an application with ID: " + applicationId);
Region region = Region.US_EAST_1;
PinpointClient pinpoint = PinpointClient.builder().region(region).build();
S3Client s3Client = S3Client.builder().region(region).build();
exportAllEndpoints(pinpoint, s3Client, applicationId, s3BucketName, path, iamExportRoleArn);
pinpoint.close();
s3Client.close();
}
use of software.amazon.awssdk.services.pinpoint.PinpointClient in project aws-doc-sdk-examples by awsdocs.
the class ListSegments method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + "ListSegments <appId>\n\n" + "Where:\n" + " appId - the ID of the application that contains a segment.\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();
listSegs(pinpoint, appId);
pinpoint.close();
}
use of software.amazon.awssdk.services.pinpoint.PinpointClient in project aws-doc-sdk-examples by awsdocs.
the class SendEmailMessage method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + " <subject> <appId> <senderAddress> <toAddress>\n\n" + "Where:\n" + " subject - the email subject to use.\n\n" + " appId - the Amazon Pinpoint project/application ID to use when you send this message\n\n" + " senderAddress - the from address. This address has to be verified in Amazon Pinpoint in the region you're using to send email \n\n" + " toAddress - the to address. This address has to be verified in Amazon Pinpoint in the region you're using to send email \n\n";
if (args.length != 4) {
System.out.println(USAGE);
System.exit(1);
}
String subject = args[0];
String appId = args[1];
String senderAddress = args[2];
String toAddress = args[3];
System.out.println("Sending a message");
PinpointClient pinpoint = PinpointClient.builder().region(Region.US_EAST_1).build();
sendEmail(pinpoint, subject, appId, senderAddress, toAddress);
System.out.println("Email was sent");
pinpoint.close();
}
Aggregations