1 /*
2  * Copyright 2015-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * 
4  * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5  * the License. A copy of the License is located at
6  * 
7  * http://aws.amazon.com/apache2.0
8  * 
9  * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10  * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11  * and limitations under the License.
12  */

13 package com.amazonaws.services.simpleemail.model.transform;
14
15 import org.w3c.dom.Node;
16 import javax.annotation.Generated;
17
18 import com.amazonaws.AmazonServiceException;
19 import com.amazonaws.util.XpathUtils;
20 import com.amazonaws.transform.StandardErrorUnmarshaller;
21
22 import com.amazonaws.services.simpleemail.model.InvalidSNSDestinationException;
23
24 @Generated("com.amazonaws:aws-java-sdk-code-generator")
25 public class InvalidSNSDestinationExceptionUnmarshaller extends StandardErrorUnmarshaller {
26
27     public InvalidSNSDestinationExceptionUnmarshaller() {
28         super(InvalidSNSDestinationException.class);
29     }
30
31     @Override
32     public AmazonServiceException unmarshall(Node node) throws Exception {
33         // Bail out if this isn't the right error code that this
34         // marshaller understands
35         String errorCode = parseErrorCode(node);
36         if (errorCode == null || !errorCode.equals("InvalidSNSDestination"))
37             return null;
38
39         InvalidSNSDestinationException e = (InvalidSNSDestinationException) super.unmarshall(node);
40         e.setConfigurationSetName(XpathUtils.asString(getErrorPropertyPath("ConfigurationSetName"), node));
41         e.setEventDestinationName(XpathUtils.asString(getErrorPropertyPath("EventDestinationName"), node));
42
43         return e;
44     }
45 }
46