Search in sources :

Example 11 with AwsJsonReader

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

the class GetTranscriptionJobResultJsonUnmarshaller method unmarshall.

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

Example 12 with AwsJsonReader

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

the class GetVocabularyResultJsonUnmarshaller method unmarshall.

public GetVocabularyResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    GetVocabularyResult getVocabularyResult = new GetVocabularyResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("VocabularyName")) {
            getVocabularyResult.setVocabularyName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("LanguageCode")) {
            getVocabularyResult.setLanguageCode(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("VocabularyState")) {
            getVocabularyResult.setVocabularyState(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("LastModifiedTime")) {
            getVocabularyResult.setLastModifiedTime(DateJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("FailureReason")) {
            getVocabularyResult.setFailureReason(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("DownloadUri")) {
            getVocabularyResult.setDownloadUri(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return getVocabularyResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 13 with AwsJsonReader

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

the class ListTranscriptionJobsResultJsonUnmarshaller method unmarshall.

public ListTranscriptionJobsResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    ListTranscriptionJobsResult listTranscriptionJobsResult = new ListTranscriptionJobsResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("Status")) {
            listTranscriptionJobsResult.setStatus(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("NextToken")) {
            listTranscriptionJobsResult.setNextToken(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("TranscriptionJobSummaries")) {
            listTranscriptionJobsResult.setTranscriptionJobSummaries(new ListUnmarshaller<TranscriptionJobSummary>(TranscriptionJobSummaryJsonUnmarshaller.getInstance()).unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return listTranscriptionJobsResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 14 with AwsJsonReader

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

the class MediaJsonUnmarshaller method unmarshall.

public Media unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    Media media = new Media();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("MediaFileUri")) {
            media.setMediaFileUri(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("RedactedMediaFileUri")) {
            media.setRedactedMediaFileUri(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return media;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 15 with AwsJsonReader

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

the class ListCallAnalyticsCategoriesResultJsonUnmarshaller method unmarshall.

public ListCallAnalyticsCategoriesResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    ListCallAnalyticsCategoriesResult listCallAnalyticsCategoriesResult = new ListCallAnalyticsCategoriesResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("NextToken")) {
            listCallAnalyticsCategoriesResult.setNextToken(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Categories")) {
            listCallAnalyticsCategoriesResult.setCategories(new ListUnmarshaller<CategoryProperties>(CategoryPropertiesJsonUnmarshaller.getInstance()).unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return listCallAnalyticsCategoriesResult;
}
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