use of software.amazon.awssdk.services.pinpoint.model.ImportJobResponse 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