Search in sources :

Example 1 with ListUnmarshaller

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

the class InvalidContactFlowModuleExceptionUnmarshaller method unmarshall.

@Override
public AmazonServiceException unmarshall(JsonErrorResponse error) throws Exception {
    InvalidContactFlowModuleException e = (InvalidContactFlowModuleException) super.unmarshall(error);
    e.setErrorCode("InvalidContactFlowModuleException");
    final AwsJsonReader jsonReader = JsonUtils.getJsonReader(new StringReader(error.get("Problems")));
    e.setProblems(new ListUnmarshaller<ProblemDetail>(ProblemDetailJsonUnmarshaller.getInstance()).unmarshall(new JsonUnmarshallerContext(jsonReader)));
    return e;
}
Also used : InvalidContactFlowModuleException(com.amazonaws.services.connect.model.InvalidContactFlowModuleException) ListUnmarshaller(com.amazonaws.transform.ListUnmarshaller) StringReader(java.io.StringReader) JsonUnmarshallerContext(com.amazonaws.transform.JsonUnmarshallerContext) AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 2 with ListUnmarshaller

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

the class InvalidContactFlowExceptionUnmarshaller method unmarshall.

@Override
public AmazonServiceException unmarshall(JsonErrorResponse error) throws Exception {
    InvalidContactFlowException e = (InvalidContactFlowException) super.unmarshall(error);
    e.setErrorCode("InvalidContactFlowException");
    final AwsJsonReader jsonReader = JsonUtils.getJsonReader(new StringReader(error.get("problems")));
    e.setProblems(new ListUnmarshaller<ProblemDetail>(ProblemDetailJsonUnmarshaller.getInstance()).unmarshall(new JsonUnmarshallerContext(jsonReader)));
    return e;
}
Also used : ListUnmarshaller(com.amazonaws.transform.ListUnmarshaller) StringReader(java.io.StringReader) InvalidContactFlowException(com.amazonaws.services.connect.model.InvalidContactFlowException) JsonUnmarshallerContext(com.amazonaws.transform.JsonUnmarshallerContext) AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 3 with ListUnmarshaller

use of com.amazonaws.transform.ListUnmarshaller 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)3 ListUnmarshaller (com.amazonaws.transform.ListUnmarshaller)3 AwsJsonReader (com.amazonaws.util.json.AwsJsonReader)3 StringReader (java.io.StringReader)3 InvalidContactFlowException (com.amazonaws.services.connect.model.InvalidContactFlowException)1 InvalidContactFlowModuleException (com.amazonaws.services.connect.model.InvalidContactFlowModuleException)1 ValidationException (com.amazonaws.services.geo.model.ValidationException)1