Search in sources :

Example 66 with AwsJsonReader

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

the class StartDocumentAnalysisResultJsonUnmarshaller method unmarshall.

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

Example 67 with AwsJsonReader

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

the class StartDocumentTextDetectionResultJsonUnmarshaller method unmarshall.

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

Example 68 with AwsJsonReader

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

the class WarningJsonUnmarshaller method unmarshall.

public Warning unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    Warning warning = new Warning();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("ErrorCode")) {
            warning.setErrorCode(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Pages")) {
            warning.setPages(new ListUnmarshaller<Integer>(IntegerJsonUnmarshaller.getInstance()).unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return warning;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 69 with AwsJsonReader

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

the class NormalizedValueJsonUnmarshaller method unmarshall.

public NormalizedValue unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    NormalizedValue normalizedValue = new NormalizedValue();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("Value")) {
            normalizedValue.setValue(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("ValueType")) {
            normalizedValue.setValueType(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return normalizedValue;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 70 with AwsJsonReader

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

the class NotificationChannelJsonUnmarshaller method unmarshall.

public NotificationChannel unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    NotificationChannel notificationChannel = new NotificationChannel();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("SNSTopicArn")) {
            notificationChannel.setSNSTopicArn(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("RoleArn")) {
            notificationChannel.setRoleArn(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return notificationChannel;
}
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