Search in sources :

Example 56 with AwsJsonReader

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

the class HumanLoopConfigJsonUnmarshaller method unmarshall.

public HumanLoopConfig unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    HumanLoopConfig humanLoopConfig = new HumanLoopConfig();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("HumanLoopName")) {
            humanLoopConfig.setHumanLoopName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("FlowDefinitionArn")) {
            humanLoopConfig.setFlowDefinitionArn(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("DataAttributes")) {
            humanLoopConfig.setDataAttributes(HumanLoopDataAttributesJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return humanLoopConfig;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 57 with AwsJsonReader

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

the class HumanLoopDataAttributesJsonUnmarshaller method unmarshall.

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

Example 58 with AwsJsonReader

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

the class CallAnalyticsJobSettingsJsonUnmarshaller method unmarshall.

public CallAnalyticsJobSettings unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    CallAnalyticsJobSettings callAnalyticsJobSettings = new CallAnalyticsJobSettings();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("VocabularyName")) {
            callAnalyticsJobSettings.setVocabularyName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("VocabularyFilterName")) {
            callAnalyticsJobSettings.setVocabularyFilterName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("VocabularyFilterMethod")) {
            callAnalyticsJobSettings.setVocabularyFilterMethod(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("LanguageModelName")) {
            callAnalyticsJobSettings.setLanguageModelName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("ContentRedaction")) {
            callAnalyticsJobSettings.setContentRedaction(ContentRedactionJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("LanguageOptions")) {
            callAnalyticsJobSettings.setLanguageOptions(new ListUnmarshaller<String>(StringJsonUnmarshaller.getInstance()).unmarshall(context));
        } else if (name.equals("LanguageIdSettings")) {
            callAnalyticsJobSettings.setLanguageIdSettings(new MapUnmarshaller<LanguageIdSettings>(LanguageIdSettingsJsonUnmarshaller.getInstance()).unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return callAnalyticsJobSettings;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 59 with AwsJsonReader

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

the class CategoryPropertiesJsonUnmarshaller method unmarshall.

public CategoryProperties unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    CategoryProperties categoryProperties = new CategoryProperties();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("CategoryName")) {
            categoryProperties.setCategoryName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Rules")) {
            categoryProperties.setRules(new ListUnmarshaller<Rule>(RuleJsonUnmarshaller.getInstance()).unmarshall(context));
        } else if (name.equals("CreateTime")) {
            categoryProperties.setCreateTime(DateJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("LastUpdateTime")) {
            categoryProperties.setLastUpdateTime(DateJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return categoryProperties;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 60 with AwsJsonReader

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

the class ChannelDefinitionJsonUnmarshaller method unmarshall.

public ChannelDefinition unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    ChannelDefinition channelDefinition = new ChannelDefinition();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("ChannelId")) {
            channelDefinition.setChannelId(IntegerJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("ParticipantRole")) {
            channelDefinition.setParticipantRole(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return channelDefinition;
}
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