Search in sources :

Example 26 with AwsJsonReader

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

the class LanguageModelJsonUnmarshaller method unmarshall.

public LanguageModel unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    LanguageModel languageModel = new LanguageModel();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("ModelName")) {
            languageModel.setModelName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("CreateTime")) {
            languageModel.setCreateTime(DateJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("LastModifiedTime")) {
            languageModel.setLastModifiedTime(DateJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("LanguageCode")) {
            languageModel.setLanguageCode(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("BaseModelName")) {
            languageModel.setBaseModelName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("ModelStatus")) {
            languageModel.setModelStatus(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("UpgradeAvailability")) {
            languageModel.setUpgradeAvailability(BooleanJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("FailureReason")) {
            languageModel.setFailureReason(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("InputDataConfig")) {
            languageModel.setInputDataConfig(InputDataConfigJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return languageModel;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 27 with AwsJsonReader

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

the class MedicalTranscriptionJobJsonUnmarshaller method unmarshall.

public MedicalTranscriptionJob unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    MedicalTranscriptionJob medicalTranscriptionJob = new MedicalTranscriptionJob();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("MedicalTranscriptionJobName")) {
            medicalTranscriptionJob.setMedicalTranscriptionJobName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("TranscriptionJobStatus")) {
            medicalTranscriptionJob.setTranscriptionJobStatus(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("LanguageCode")) {
            medicalTranscriptionJob.setLanguageCode(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("MediaSampleRateHertz")) {
            medicalTranscriptionJob.setMediaSampleRateHertz(IntegerJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("MediaFormat")) {
            medicalTranscriptionJob.setMediaFormat(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Media")) {
            medicalTranscriptionJob.setMedia(MediaJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Transcript")) {
            medicalTranscriptionJob.setTranscript(MedicalTranscriptJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("StartTime")) {
            medicalTranscriptionJob.setStartTime(DateJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("CreationTime")) {
            medicalTranscriptionJob.setCreationTime(DateJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("CompletionTime")) {
            medicalTranscriptionJob.setCompletionTime(DateJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("FailureReason")) {
            medicalTranscriptionJob.setFailureReason(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Settings")) {
            medicalTranscriptionJob.setSettings(MedicalTranscriptionSettingJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("ContentIdentificationType")) {
            medicalTranscriptionJob.setContentIdentificationType(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Specialty")) {
            medicalTranscriptionJob.setSpecialty(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Type")) {
            medicalTranscriptionJob.setType(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Tags")) {
            medicalTranscriptionJob.setTags(new ListUnmarshaller<Tag>(TagJsonUnmarshaller.getInstance()).unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return medicalTranscriptionJob;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 28 with AwsJsonReader

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

the class MedicalTranscriptionSettingJsonUnmarshaller method unmarshall.

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

Example 29 with AwsJsonReader

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

the class NonTalkTimeFilterJsonUnmarshaller method unmarshall.

public NonTalkTimeFilter unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    NonTalkTimeFilter nonTalkTimeFilter = new NonTalkTimeFilter();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("Threshold")) {
            nonTalkTimeFilter.setThreshold(LongJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("AbsoluteTimeRange")) {
            nonTalkTimeFilter.setAbsoluteTimeRange(AbsoluteTimeRangeJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("RelativeTimeRange")) {
            nonTalkTimeFilter.setRelativeTimeRange(RelativeTimeRangeJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Negate")) {
            nonTalkTimeFilter.setNegate(BooleanJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return nonTalkTimeFilter;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 30 with AwsJsonReader

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

the class TranslateTextResultJsonUnmarshaller method unmarshall.

public TranslateTextResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    TranslateTextResult translateTextResult = new TranslateTextResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("TranslatedText")) {
            translateTextResult.setTranslatedText(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("SourceLanguageCode")) {
            translateTextResult.setSourceLanguageCode(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("TargetLanguageCode")) {
            translateTextResult.setTargetLanguageCode(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("AppliedTerminologies")) {
            translateTextResult.setAppliedTerminologies(new ListUnmarshaller<AppliedTerminology>(AppliedTerminologyJsonUnmarshaller.getInstance()).unmarshall(context));
        } else if (name.equals("AppliedSettings")) {
            translateTextResult.setAppliedSettings(TranslationSettingsJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return translateTextResult;
}
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