Search in sources :

Example 1 with SetSmsAttributesResponse

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

the class SetSMSAttributes method setSNSAttributes.

// snippet-start:[sns.java2.SetSMSAttributes.main]
public static void setSNSAttributes(SnsClient snsClient, HashMap<String, String> attributes) {
    try {
        SetSmsAttributesRequest request = SetSmsAttributesRequest.builder().attributes(attributes).build();
        SetSmsAttributesResponse result = snsClient.setSMSAttributes(request);
        System.out.println("Set default Attributes to " + attributes + ". Status was " + result.sdkHttpResponse().statusCode());
    } catch (SnsException e) {
        System.err.println(e.awsErrorDetails().errorMessage());
        System.exit(1);
    }
}
Also used : SetSmsAttributesRequest(software.amazon.awssdk.services.sns.model.SetSmsAttributesRequest) SnsException(software.amazon.awssdk.services.sns.model.SnsException) SetSmsAttributesResponse(software.amazon.awssdk.services.sns.model.SetSmsAttributesResponse)

Aggregations

SetSmsAttributesRequest (software.amazon.awssdk.services.sns.model.SetSmsAttributesRequest)1 SetSmsAttributesResponse (software.amazon.awssdk.services.sns.model.SetSmsAttributesResponse)1 SnsException (software.amazon.awssdk.services.sns.model.SnsException)1