Search in sources :

Example 11 with JsonUnmarshallerContext

use of com.amazonaws.transform.JsonUnmarshallerContext in project aws-sdk-android by aws-amplify.

the class ValidationExceptionUnmarshaller method unmarshall.

@Override
public AmazonServiceException unmarshall(JsonErrorResponse error) throws Exception {
    ValidationException e = (ValidationException) super.unmarshall(error);
    e.setErrorCode("ValidationException");
    final AwsJsonReader jsonReader = JsonUtils.getJsonReader(new StringReader(error.get("FieldList")));
    e.setFieldList(new ListUnmarshaller<ValidationExceptionField>(ValidationExceptionFieldJsonUnmarshaller.getInstance()).unmarshall(new JsonUnmarshallerContext(jsonReader)));
    e.setReason(String.valueOf(error.get("Reason")));
    return e;
}
Also used : ValidationException(com.amazonaws.services.geo.model.ValidationException) ListUnmarshaller(com.amazonaws.transform.ListUnmarshaller) StringReader(java.io.StringReader) JsonUnmarshallerContext(com.amazonaws.transform.JsonUnmarshallerContext) AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Aggregations

JsonUnmarshallerContext (com.amazonaws.transform.JsonUnmarshallerContext)11 Test (org.junit.Test)6 AwsJsonReader (com.amazonaws.util.json.AwsJsonReader)5 ByteArrayInputStream (java.io.ByteArrayInputStream)5 StringReader (java.io.StringReader)4 ListUnmarshaller (com.amazonaws.transform.ListUnmarshaller)3 Unmarshaller (com.amazonaws.transform.Unmarshaller)3 MapUnmarshaller (com.amazonaws.transform.MapUnmarshaller)2 InputStream (java.io.InputStream)2 CRC32 (java.util.zip.CRC32)2 AmazonWebServiceResponse (com.amazonaws.AmazonWebServiceResponse)1 ResponseMetadata (com.amazonaws.ResponseMetadata)1 HttpResponse (com.amazonaws.http.HttpResponse)1 CRC32MismatchException (com.amazonaws.internal.CRC32MismatchException)1 InvalidContactFlowException (com.amazonaws.services.connect.model.InvalidContactFlowException)1 InvalidContactFlowModuleException (com.amazonaws.services.connect.model.InvalidContactFlowModuleException)1 ValidationException (com.amazonaws.services.geo.model.ValidationException)1 InvokeResult (com.amazonaws.services.lambda.model.InvokeResult)1 CRC32ChecksumCalculatingInputStream (com.amazonaws.util.CRC32ChecksumCalculatingInputStream)1 IOException (java.io.IOException)1