Search in sources :

Example 61 with AwsJsonReader

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

the class CreateCallAnalyticsCategoryResultJsonUnmarshaller method unmarshall.

public CreateCallAnalyticsCategoryResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    CreateCallAnalyticsCategoryResult createCallAnalyticsCategoryResult = new CreateCallAnalyticsCategoryResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("CategoryProperties")) {
            createCallAnalyticsCategoryResult.setCategoryProperties(CategoryPropertiesJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return createCallAnalyticsCategoryResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 62 with AwsJsonReader

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

the class CreateLanguageModelResultJsonUnmarshaller method unmarshall.

public CreateLanguageModelResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    CreateLanguageModelResult createLanguageModelResult = new CreateLanguageModelResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("LanguageCode")) {
            createLanguageModelResult.setLanguageCode(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("BaseModelName")) {
            createLanguageModelResult.setBaseModelName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("ModelName")) {
            createLanguageModelResult.setModelName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("InputDataConfig")) {
            createLanguageModelResult.setInputDataConfig(InputDataConfigJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("ModelStatus")) {
            createLanguageModelResult.setModelStatus(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return createLanguageModelResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 63 with AwsJsonReader

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

the class CreateVocabularyFilterResultJsonUnmarshaller method unmarshall.

public CreateVocabularyFilterResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    CreateVocabularyFilterResult createVocabularyFilterResult = new CreateVocabularyFilterResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("VocabularyFilterName")) {
            createVocabularyFilterResult.setVocabularyFilterName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("LanguageCode")) {
            createVocabularyFilterResult.setLanguageCode(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("LastModifiedTime")) {
            createVocabularyFilterResult.setLastModifiedTime(DateJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return createVocabularyFilterResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 64 with AwsJsonReader

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

the class RelationshipJsonUnmarshaller method unmarshall.

public Relationship unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    Relationship relationship = new Relationship();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("Type")) {
            relationship.setType(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Ids")) {
            relationship.setIds(new ListUnmarshaller<String>(StringJsonUnmarshaller.getInstance()).unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return relationship;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 65 with AwsJsonReader

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

the class S3ObjectJsonUnmarshaller method unmarshall.

public S3Object unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    S3Object s3Object = new S3Object();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("Bucket")) {
            s3Object.setBucket(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Name")) {
            s3Object.setName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Version")) {
            s3Object.setVersion(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return s3Object;
}
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