Search in sources :

Example 1 with CreateApplicationRequest

use of software.amazon.awssdk.services.pinpoint.model.CreateApplicationRequest in project aws-doc-sdk-examples by awsdocs.

the class CreateApp method createApplication.

// snippet-start:[pinpoint.java2.createapp.main]
public static String createApplication(PinpointClient pinpoint, String appName) {
    try {
        CreateApplicationRequest appRequest = CreateApplicationRequest.builder().name(appName).build();
        CreateAppRequest request = CreateAppRequest.builder().createApplicationRequest(appRequest).build();
        CreateAppResponse result = pinpoint.createApp(request);
        return result.applicationResponse().id();
    } catch (PinpointException e) {
        System.err.println(e.awsErrorDetails().errorMessage());
        System.exit(1);
    }
    return "";
}
Also used : CreateApplicationRequest(software.amazon.awssdk.services.pinpoint.model.CreateApplicationRequest) PinpointException(software.amazon.awssdk.services.pinpoint.model.PinpointException) CreateAppResponse(software.amazon.awssdk.services.pinpoint.model.CreateAppResponse) CreateAppRequest(software.amazon.awssdk.services.pinpoint.model.CreateAppRequest)

Aggregations

CreateAppRequest (software.amazon.awssdk.services.pinpoint.model.CreateAppRequest)1 CreateAppResponse (software.amazon.awssdk.services.pinpoint.model.CreateAppResponse)1 CreateApplicationRequest (software.amazon.awssdk.services.pinpoint.model.CreateApplicationRequest)1 PinpointException (software.amazon.awssdk.services.pinpoint.model.PinpointException)1