Search in sources :

Example 51 with AwsJsonReader

use of com.amazonaws.util.json.AwsJsonReader in project aws-sdk-android by aws-amplify.

the class ExpenseFieldJsonUnmarshaller method unmarshall.

public ExpenseField unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    ExpenseField expenseField = new ExpenseField();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("Type")) {
            expenseField.setType(ExpenseTypeJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("LabelDetection")) {
            expenseField.setLabelDetection(ExpenseDetectionJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("ValueDetection")) {
            expenseField.setValueDetection(ExpenseDetectionJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("PageNumber")) {
            expenseField.setPageNumber(IntegerJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return expenseField;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 52 with AwsJsonReader

use of com.amazonaws.util.json.AwsJsonReader in project aws-sdk-android by aws-amplify.

the class GeometryJsonUnmarshaller method unmarshall.

public Geometry unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    Geometry geometry = new Geometry();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("BoundingBox")) {
            geometry.setBoundingBox(BoundingBoxJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Polygon")) {
            geometry.setPolygon(new ListUnmarshaller<Point>(PointJsonUnmarshaller.getInstance()).unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return geometry;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 53 with AwsJsonReader

use of com.amazonaws.util.json.AwsJsonReader in project aws-sdk-android by aws-amplify.

the class GetDocumentAnalysisResultJsonUnmarshaller method unmarshall.

public GetDocumentAnalysisResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    GetDocumentAnalysisResult getDocumentAnalysisResult = new GetDocumentAnalysisResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("DocumentMetadata")) {
            getDocumentAnalysisResult.setDocumentMetadata(DocumentMetadataJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("JobStatus")) {
            getDocumentAnalysisResult.setJobStatus(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("NextToken")) {
            getDocumentAnalysisResult.setNextToken(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Blocks")) {
            getDocumentAnalysisResult.setBlocks(new ListUnmarshaller<Block>(BlockJsonUnmarshaller.getInstance()).unmarshall(context));
        } else if (name.equals("Warnings")) {
            getDocumentAnalysisResult.setWarnings(new ListUnmarshaller<Warning>(WarningJsonUnmarshaller.getInstance()).unmarshall(context));
        } else if (name.equals("StatusMessage")) {
            getDocumentAnalysisResult.setStatusMessage(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("AnalyzeDocumentModelVersion")) {
            getDocumentAnalysisResult.setAnalyzeDocumentModelVersion(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return getDocumentAnalysisResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 54 with AwsJsonReader

use of com.amazonaws.util.json.AwsJsonReader in project aws-sdk-android by aws-amplify.

the class GetExpenseAnalysisResultJsonUnmarshaller method unmarshall.

public GetExpenseAnalysisResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    GetExpenseAnalysisResult getExpenseAnalysisResult = new GetExpenseAnalysisResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("DocumentMetadata")) {
            getExpenseAnalysisResult.setDocumentMetadata(DocumentMetadataJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("JobStatus")) {
            getExpenseAnalysisResult.setJobStatus(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("NextToken")) {
            getExpenseAnalysisResult.setNextToken(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("ExpenseDocuments")) {
            getExpenseAnalysisResult.setExpenseDocuments(new ListUnmarshaller<ExpenseDocument>(ExpenseDocumentJsonUnmarshaller.getInstance()).unmarshall(context));
        } else if (name.equals("Warnings")) {
            getExpenseAnalysisResult.setWarnings(new ListUnmarshaller<Warning>(WarningJsonUnmarshaller.getInstance()).unmarshall(context));
        } else if (name.equals("StatusMessage")) {
            getExpenseAnalysisResult.setStatusMessage(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("AnalyzeExpenseModelVersion")) {
            getExpenseAnalysisResult.setAnalyzeExpenseModelVersion(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return getExpenseAnalysisResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 55 with AwsJsonReader

use of com.amazonaws.util.json.AwsJsonReader in project aws-sdk-android by aws-amplify.

the class HumanLoopActivationOutputJsonUnmarshaller method unmarshall.

public HumanLoopActivationOutput unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    HumanLoopActivationOutput humanLoopActivationOutput = new HumanLoopActivationOutput();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("HumanLoopArn")) {
            humanLoopActivationOutput.setHumanLoopArn(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("HumanLoopActivationReasons")) {
            humanLoopActivationOutput.setHumanLoopActivationReasons(new ListUnmarshaller<String>(StringJsonUnmarshaller.getInstance()).unmarshall(context));
        } else if (name.equals("HumanLoopActivationConditionsEvaluationResults")) {
            humanLoopActivationOutput.setHumanLoopActivationConditionsEvaluationResults(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return humanLoopActivationOutput;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Aggregations

AwsJsonReader (com.amazonaws.util.json.AwsJsonReader)1687 StringReader (java.io.StringReader)19 AwsJsonWriter (com.amazonaws.util.json.AwsJsonWriter)14 StringWriter (java.io.StringWriter)14 Test (org.junit.Test)14 JsonUnmarshallerContext (com.amazonaws.transform.JsonUnmarshallerContext)5 Date (java.util.Date)4 ListUnmarshaller (com.amazonaws.transform.ListUnmarshaller)3 HashMap (java.util.HashMap)3 IOException (java.io.IOException)2 BigInteger (java.math.BigInteger)2 AmazonWebServiceResponse (com.amazonaws.AmazonWebServiceResponse)1 ResponseMetadata (com.amazonaws.ResponseMetadata)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 CRC32ChecksumCalculatingInputStream (com.amazonaws.util.CRC32ChecksumCalculatingInputStream)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InputStream (java.io.InputStream)1