Search in sources :

Example 16 with AwsJsonReader

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

the class ListMedicalTranscriptionJobsResultJsonUnmarshaller method unmarshall.

public ListMedicalTranscriptionJobsResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    ListMedicalTranscriptionJobsResult listMedicalTranscriptionJobsResult = new ListMedicalTranscriptionJobsResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("Status")) {
            listMedicalTranscriptionJobsResult.setStatus(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("NextToken")) {
            listMedicalTranscriptionJobsResult.setNextToken(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("MedicalTranscriptionJobSummaries")) {
            listMedicalTranscriptionJobsResult.setMedicalTranscriptionJobSummaries(new ListUnmarshaller<MedicalTranscriptionJobSummary>(MedicalTranscriptionJobSummaryJsonUnmarshaller.getInstance()).unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return listMedicalTranscriptionJobsResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 17 with AwsJsonReader

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

the class BlockJsonUnmarshaller method unmarshall.

public Block unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    Block block = new Block();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("BlockType")) {
            block.setBlockType(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Confidence")) {
            block.setConfidence(FloatJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Text")) {
            block.setText(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("TextType")) {
            block.setTextType(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("RowIndex")) {
            block.setRowIndex(IntegerJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("ColumnIndex")) {
            block.setColumnIndex(IntegerJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("RowSpan")) {
            block.setRowSpan(IntegerJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("ColumnSpan")) {
            block.setColumnSpan(IntegerJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Geometry")) {
            block.setGeometry(GeometryJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Id")) {
            block.setId(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Relationships")) {
            block.setRelationships(new ListUnmarshaller<Relationship>(RelationshipJsonUnmarshaller.getInstance()).unmarshall(context));
        } else if (name.equals("EntityTypes")) {
            block.setEntityTypes(new ListUnmarshaller<String>(StringJsonUnmarshaller.getInstance()).unmarshall(context));
        } else if (name.equals("SelectionStatus")) {
            block.setSelectionStatus(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Page")) {
            block.setPage(IntegerJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Query")) {
            block.setQuery(QueryJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return block;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 18 with AwsJsonReader

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

the class DetectDocumentTextResultJsonUnmarshaller method unmarshall.

public DetectDocumentTextResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    DetectDocumentTextResult detectDocumentTextResult = new DetectDocumentTextResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("DocumentMetadata")) {
            detectDocumentTextResult.setDocumentMetadata(DocumentMetadataJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Blocks")) {
            detectDocumentTextResult.setBlocks(new ListUnmarshaller<Block>(BlockJsonUnmarshaller.getInstance()).unmarshall(context));
        } else if (name.equals("DetectDocumentTextModelVersion")) {
            detectDocumentTextResult.setDetectDocumentTextModelVersion(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return detectDocumentTextResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 19 with AwsJsonReader

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

the class IdentityDocumentJsonUnmarshaller method unmarshall.

public IdentityDocument unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    IdentityDocument identityDocument = new IdentityDocument();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("DocumentIndex")) {
            identityDocument.setDocumentIndex(IntegerJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("IdentityDocumentFields")) {
            identityDocument.setIdentityDocumentFields(new ListUnmarshaller<IdentityDocumentField>(IdentityDocumentFieldJsonUnmarshaller.getInstance()).unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return identityDocument;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 20 with AwsJsonReader

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

the class LineItemFieldsJsonUnmarshaller method unmarshall.

public LineItemFields unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    LineItemFields lineItemFields = new LineItemFields();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("LineItemExpenseFields")) {
            lineItemFields.setLineItemExpenseFields(new ListUnmarshaller<ExpenseField>(ExpenseFieldJsonUnmarshaller.getInstance()).unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return lineItemFields;
}
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