Search in sources :

Example 21 with AwsJsonReader

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

the class RuleJsonUnmarshaller method unmarshall.

public Rule unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    Rule rule = new Rule();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("NonTalkTimeFilter")) {
            rule.setNonTalkTimeFilter(NonTalkTimeFilterJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("InterruptionFilter")) {
            rule.setInterruptionFilter(InterruptionFilterJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("TranscriptFilter")) {
            rule.setTranscriptFilter(TranscriptFilterJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("SentimentFilter")) {
            rule.setSentimentFilter(SentimentFilterJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return rule;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 22 with AwsJsonReader

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

the class SentimentFilterJsonUnmarshaller method unmarshall.

public SentimentFilter unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    SentimentFilter sentimentFilter = new SentimentFilter();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("Sentiments")) {
            sentimentFilter.setSentiments(new ListUnmarshaller<String>(StringJsonUnmarshaller.getInstance()).unmarshall(context));
        } else if (name.equals("AbsoluteTimeRange")) {
            sentimentFilter.setAbsoluteTimeRange(AbsoluteTimeRangeJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("RelativeTimeRange")) {
            sentimentFilter.setRelativeTimeRange(RelativeTimeRangeJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("ParticipantRole")) {
            sentimentFilter.setParticipantRole(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Negate")) {
            sentimentFilter.setNegate(BooleanJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return sentimentFilter;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 23 with AwsJsonReader

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

the class SettingsJsonUnmarshaller method unmarshall.

public Settings unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    Settings settings = new Settings();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("VocabularyName")) {
            settings.setVocabularyName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("ShowSpeakerLabels")) {
            settings.setShowSpeakerLabels(BooleanJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("MaxSpeakerLabels")) {
            settings.setMaxSpeakerLabels(IntegerJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("ChannelIdentification")) {
            settings.setChannelIdentification(BooleanJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("ShowAlternatives")) {
            settings.setShowAlternatives(BooleanJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("MaxAlternatives")) {
            settings.setMaxAlternatives(IntegerJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("VocabularyFilterName")) {
            settings.setVocabularyFilterName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("VocabularyFilterMethod")) {
            settings.setVocabularyFilterMethod(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return settings;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 24 with AwsJsonReader

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

the class JobExecutionSettingsJsonUnmarshaller method unmarshall.

public JobExecutionSettings unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    JobExecutionSettings jobExecutionSettings = new JobExecutionSettings();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("AllowDeferredExecution")) {
            jobExecutionSettings.setAllowDeferredExecution(BooleanJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("DataAccessRoleArn")) {
            jobExecutionSettings.setDataAccessRoleArn(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return jobExecutionSettings;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 25 with AwsJsonReader

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

the class LanguageIdSettingsJsonUnmarshaller method unmarshall.

public LanguageIdSettings unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    LanguageIdSettings languageIdSettings = new LanguageIdSettings();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("VocabularyName")) {
            languageIdSettings.setVocabularyName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("VocabularyFilterName")) {
            languageIdSettings.setVocabularyFilterName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("LanguageModelName")) {
            languageIdSettings.setLanguageModelName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return languageIdSettings;
}
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