Search in sources :

Example 36 with AwsJsonReader

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

the class InputDataConfigJsonUnmarshaller method unmarshall.

public InputDataConfig unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    InputDataConfig inputDataConfig = new InputDataConfig();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("S3Uri")) {
            inputDataConfig.setS3Uri(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("ContentType")) {
            inputDataConfig.setContentType(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return inputDataConfig;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 37 with AwsJsonReader

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

the class DeleteParallelDataResultJsonUnmarshaller method unmarshall.

public DeleteParallelDataResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    DeleteParallelDataResult deleteParallelDataResult = new DeleteParallelDataResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("Name")) {
            deleteParallelDataResult.setName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Status")) {
            deleteParallelDataResult.setStatus(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return deleteParallelDataResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 38 with AwsJsonReader

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

the class DescribeTextTranslationJobResultJsonUnmarshaller method unmarshall.

public DescribeTextTranslationJobResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    DescribeTextTranslationJobResult describeTextTranslationJobResult = new DescribeTextTranslationJobResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("TextTranslationJobProperties")) {
            describeTextTranslationJobResult.setTextTranslationJobProperties(TextTranslationJobPropertiesJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return describeTextTranslationJobResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 39 with AwsJsonReader

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

the class GetParallelDataResultJsonUnmarshaller method unmarshall.

public GetParallelDataResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    GetParallelDataResult getParallelDataResult = new GetParallelDataResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("ParallelDataProperties")) {
            getParallelDataResult.setParallelDataProperties(ParallelDataPropertiesJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("DataLocation")) {
            getParallelDataResult.setDataLocation(ParallelDataDataLocationJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("AuxiliaryDataLocation")) {
            getParallelDataResult.setAuxiliaryDataLocation(ParallelDataDataLocationJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("LatestUpdateAttemptAuxiliaryDataLocation")) {
            getParallelDataResult.setLatestUpdateAttemptAuxiliaryDataLocation(ParallelDataDataLocationJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return getParallelDataResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 40 with AwsJsonReader

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

the class UpdateVocabularyResultJsonUnmarshaller method unmarshall.

public UpdateVocabularyResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    UpdateVocabularyResult updateVocabularyResult = new UpdateVocabularyResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("VocabularyName")) {
            updateVocabularyResult.setVocabularyName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("LanguageCode")) {
            updateVocabularyResult.setLanguageCode(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("LastModifiedTime")) {
            updateVocabularyResult.setLastModifiedTime(DateJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("VocabularyState")) {
            updateVocabularyResult.setVocabularyState(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return updateVocabularyResult;
}
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