Search in sources :

Example 1 with AwsJsonReader

use of com.amazonaws.util.json.AwsJsonReader in project amazon-cognito-android by aws.

the class UpdateRecordsResultJsonUnmarshaller method unmarshall.

public UpdateRecordsResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    UpdateRecordsResult updateRecordsResult = new UpdateRecordsResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("Records")) {
            updateRecordsResult.setRecords(new ListUnmarshaller<Record>(RecordJsonUnmarshaller.getInstance()).unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return updateRecordsResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 2 with AwsJsonReader

use of com.amazonaws.util.json.AwsJsonReader in project amazon-cognito-android by aws.

the class DeleteDatasetResultJsonUnmarshaller method unmarshall.

public DeleteDatasetResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    DeleteDatasetResult deleteDatasetResult = new DeleteDatasetResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("Dataset")) {
            deleteDatasetResult.setDataset(DatasetJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return deleteDatasetResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 3 with AwsJsonReader

use of com.amazonaws.util.json.AwsJsonReader in project amazon-cognito-android by aws.

the class ListRecordsResultJsonUnmarshaller method unmarshall.

public ListRecordsResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    ListRecordsResult listRecordsResult = new ListRecordsResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("Records")) {
            listRecordsResult.setRecords(new ListUnmarshaller<Record>(RecordJsonUnmarshaller.getInstance()).unmarshall(context));
        } else if (name.equals("NextToken")) {
            listRecordsResult.setNextToken(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Count")) {
            listRecordsResult.setCount(IntegerJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("DatasetSyncCount")) {
            listRecordsResult.setDatasetSyncCount(LongJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("LastModifiedBy")) {
            listRecordsResult.setLastModifiedBy(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("MergedDatasetNames")) {
            listRecordsResult.setMergedDatasetNames(new ListUnmarshaller<String>(StringJsonUnmarshaller.getInstance()).unmarshall(context));
        } else if (name.equals("DatasetExists")) {
            listRecordsResult.setDatasetExists(BooleanJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("DatasetDeletedAfterRequestedSyncCount")) {
            listRecordsResult.setDatasetDeletedAfterRequestedSyncCount(BooleanJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("SyncSessionToken")) {
            listRecordsResult.setSyncSessionToken(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return listRecordsResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 4 with AwsJsonReader

use of com.amazonaws.util.json.AwsJsonReader in project amazon-cognito-android by aws.

the class RegisterDeviceResultJsonUnmarshaller method unmarshall.

public RegisterDeviceResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    RegisterDeviceResult registerDeviceResult = new RegisterDeviceResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("DeviceId")) {
            registerDeviceResult.setDeviceId(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return registerDeviceResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 5 with AwsJsonReader

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

the class AnalyzeIDDetectionsJsonUnmarshaller method unmarshall.

public AnalyzeIDDetections unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    AnalyzeIDDetections analyzeIDDetections = new AnalyzeIDDetections();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("Text")) {
            analyzeIDDetections.setText(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("NormalizedValue")) {
            analyzeIDDetections.setNormalizedValue(NormalizedValueJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Confidence")) {
            analyzeIDDetections.setConfidence(FloatJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return analyzeIDDetections;
}
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