use of software.amazon.awssdk.services.pinpoint.model.CreateAppRequest 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 "";
}
Aggregations