use of software.amazon.awssdk.services.pinpoint.PinpointClient in project aws-doc-sdk-examples by awsdocs.
the class CreateSegment method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + "CreateSegment <appId>\n\n" + "Where:\n" + " appId - the application ID to create a segment 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();
SegmentResponse result = createSegment(pinpoint, appId);
System.out.println("Segment " + result.name() + " created.");
System.out.println(result.segmentType());
pinpoint.close();
}
use of software.amazon.awssdk.services.pinpoint.PinpointClient in project aws-doc-sdk-examples by awsdocs.
the class GetSegmentById method main.
public static void main(String[] args) {
final String USAGE = "\n" + "CreateApp - create an application in the Amazon Pinpoint dashboard\n\n" + "Usage:" + " <appId> <segmentId>\n\n" + "Where:\n" + " appId - the id of the application.\n\n" + " segmentId - the id of the segment.\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();
System.out.println("Name of the segment is " + getSegmentById(pinpoint, appId, segmentId));
pinpoint.close();
}
use of software.amazon.awssdk.services.pinpoint.PinpointClient in project aws-doc-sdk-examples by awsdocs.
the class ImportSegment method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + "ImportSegment <appId> <bucket> <key> <roleArn> \n\n" + "Where:\n" + " appId - the application ID to create a segment for.\n\n" + " bucket - the name of the Amazon S3 bucket that contains the segment definitons.\n\n" + " key - the key of the S3 object. " + " roleArn - ARN of the role that allows Amazon Pinpoint to access S3. You need to set trust management for this to work. See https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html";
if (args.length != 4) {
System.out.println(USAGE);
System.exit(1);
}
String appId = args[0];
String bucket = args[1];
String key = args[2];
String roleArn = args[3];
PinpointClient pinpoint = PinpointClient.builder().region(Region.US_EAST_1).build();
ImportJobResponse response = createImportSegment(pinpoint, appId, bucket, key, roleArn);
System.out.println("Import job for " + bucket + " submitted.");
System.out.println("See application " + response.applicationId() + " for import job status.");
System.out.println("See application " + response.jobStatus() + " for import job status.");
pinpoint.close();
}
Aggregations