Search in sources :

Example 31 with AwsJsonReader

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

the class UpdateParallelDataResultJsonUnmarshaller method unmarshall.

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

Example 32 with AwsJsonReader

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

the class StartMedicalTranscriptionJobResultJsonUnmarshaller method unmarshall.

public StartMedicalTranscriptionJobResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    StartMedicalTranscriptionJobResult startMedicalTranscriptionJobResult = new StartMedicalTranscriptionJobResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("MedicalTranscriptionJob")) {
            startMedicalTranscriptionJobResult.setMedicalTranscriptionJob(MedicalTranscriptionJobJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return startMedicalTranscriptionJobResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 33 with AwsJsonReader

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

the class StartTranscriptionJobResultJsonUnmarshaller method unmarshall.

public StartTranscriptionJobResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    StartTranscriptionJobResult startTranscriptionJobResult = new StartTranscriptionJobResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("TranscriptionJob")) {
            startTranscriptionJobResult.setTranscriptionJob(TranscriptionJobJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return startTranscriptionJobResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 34 with AwsJsonReader

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

the class SubtitlesJsonUnmarshaller method unmarshall.

public Subtitles unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    Subtitles subtitles = new Subtitles();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("Formats")) {
            subtitles.setFormats(new ListUnmarshaller<String>(StringJsonUnmarshaller.getInstance()).unmarshall(context));
        } else if (name.equals("OutputStartIndex")) {
            subtitles.setOutputStartIndex(IntegerJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return subtitles;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 35 with AwsJsonReader

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

the class SubtitlesOutputJsonUnmarshaller method unmarshall.

public SubtitlesOutput unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    SubtitlesOutput subtitlesOutput = new SubtitlesOutput();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("Formats")) {
            subtitlesOutput.setFormats(new ListUnmarshaller<String>(StringJsonUnmarshaller.getInstance()).unmarshall(context));
        } else if (name.equals("SubtitleFileUris")) {
            subtitlesOutput.setSubtitleFileUris(new ListUnmarshaller<String>(StringJsonUnmarshaller.getInstance()).unmarshall(context));
        } else if (name.equals("OutputStartIndex")) {
            subtitlesOutput.setOutputStartIndex(IntegerJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return subtitlesOutput;
}
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