Search in sources :

Example 11 with PinpointClient

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();
}
Also used : PinpointClient(software.amazon.awssdk.services.pinpoint.PinpointClient)

Example 12 with PinpointClient

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();
}
Also used : PinpointClient(software.amazon.awssdk.services.pinpoint.PinpointClient)

Example 13 with PinpointClient

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();
}
Also used : PinpointClient(software.amazon.awssdk.services.pinpoint.PinpointClient)

Example 14 with PinpointClient

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();
}
Also used : UpdateEndpointResponse(software.amazon.awssdk.services.pinpoint.model.UpdateEndpointResponse) EndpointResponse(software.amazon.awssdk.services.pinpoint.model.EndpointResponse) GetEndpointResponse(software.amazon.awssdk.services.pinpoint.model.GetEndpointResponse) PinpointClient(software.amazon.awssdk.services.pinpoint.PinpointClient)

Example 15 with PinpointClient

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();
}
Also used : PinpointClient(software.amazon.awssdk.services.pinpoint.PinpointClient)

Aggregations

PinpointClient (software.amazon.awssdk.services.pinpoint.PinpointClient)18 Region (software.amazon.awssdk.regions.Region)1 CreateImportJobResponse (software.amazon.awssdk.services.pinpoint.model.CreateImportJobResponse)1 CreateSegmentResponse (software.amazon.awssdk.services.pinpoint.model.CreateSegmentResponse)1 EndpointResponse (software.amazon.awssdk.services.pinpoint.model.EndpointResponse)1 GetEndpointResponse (software.amazon.awssdk.services.pinpoint.model.GetEndpointResponse)1 ImportJobResponse (software.amazon.awssdk.services.pinpoint.model.ImportJobResponse)1 SMSChannelResponse (software.amazon.awssdk.services.pinpoint.model.SMSChannelResponse)1 SegmentResponse (software.amazon.awssdk.services.pinpoint.model.SegmentResponse)1 UpdateEndpointResponse (software.amazon.awssdk.services.pinpoint.model.UpdateEndpointResponse)1 S3Client (software.amazon.awssdk.services.s3.S3Client)1