use of software.amazon.awssdk.services.pinpoint.model.SMSChannelResponse in project aws-doc-sdk-examples by awsdocs.
the class UpdateChannel method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + "CreateChannel <appId>\n\n" + "Where:\n" + " appId - the name of the application whose channel is updated.\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();
SMSChannelResponse getResponse = getSMSChannel(pinpoint, appId);
toggleSmsChannel(pinpoint, appId, getResponse);
pinpoint.close();
}
use of software.amazon.awssdk.services.pinpoint.model.SMSChannelResponse in project aws-doc-sdk-examples by awsdocs.
the class UpdateChannel method getSMSChannel.
// snippet-start:[pinpoint.java2.updatechannel.main]
private static SMSChannelResponse getSMSChannel(PinpointClient client, String appId) {
try {
GetSmsChannelRequest request = GetSmsChannelRequest.builder().applicationId(appId).build();
SMSChannelResponse response = client.getSmsChannel(request).smsChannelResponse();
System.out.println("Channel state is " + response.enabled());
return response;
} catch (PinpointException e) {
System.err.println(e.awsErrorDetails().errorMessage());
System.exit(1);
}
return null;
}
Aggregations