Search in sources :

Example 46 with AwsJsonReader

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

the class TranscriptionJobSummaryJsonUnmarshaller method unmarshall.

public TranscriptionJobSummary unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    TranscriptionJobSummary transcriptionJobSummary = new TranscriptionJobSummary();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("TranscriptionJobName")) {
            transcriptionJobSummary.setTranscriptionJobName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("CreationTime")) {
            transcriptionJobSummary.setCreationTime(DateJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("StartTime")) {
            transcriptionJobSummary.setStartTime(DateJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("CompletionTime")) {
            transcriptionJobSummary.setCompletionTime(DateJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("LanguageCode")) {
            transcriptionJobSummary.setLanguageCode(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("TranscriptionJobStatus")) {
            transcriptionJobSummary.setTranscriptionJobStatus(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("FailureReason")) {
            transcriptionJobSummary.setFailureReason(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("OutputLocationType")) {
            transcriptionJobSummary.setOutputLocationType(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("ContentRedaction")) {
            transcriptionJobSummary.setContentRedaction(ContentRedactionJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("ModelSettings")) {
            transcriptionJobSummary.setModelSettings(ModelSettingsJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("IdentifyLanguage")) {
            transcriptionJobSummary.setIdentifyLanguage(BooleanJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("IdentifyMultipleLanguages")) {
            transcriptionJobSummary.setIdentifyMultipleLanguages(BooleanJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("IdentifiedLanguageScore")) {
            transcriptionJobSummary.setIdentifiedLanguageScore(FloatJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("LanguageCodes")) {
            transcriptionJobSummary.setLanguageCodes(new ListUnmarshaller<LanguageCodeItem>(LanguageCodeItemJsonUnmarshaller.getInstance()).unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return transcriptionJobSummary;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 47 with AwsJsonReader

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

the class StopTextTranslationJobResultJsonUnmarshaller method unmarshall.

public StopTextTranslationJobResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    StopTextTranslationJobResult stopTextTranslationJobResult = new StopTextTranslationJobResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("JobId")) {
            stopTextTranslationJobResult.setJobId(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("JobStatus")) {
            stopTextTranslationJobResult.setJobStatus(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return stopTextTranslationJobResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 48 with AwsJsonReader

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

the class TermJsonUnmarshaller method unmarshall.

public Term unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    Term term = new Term();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("SourceText")) {
            term.setSourceText(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("TargetText")) {
            term.setTargetText(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return term;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 49 with AwsJsonReader

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

the class TerminologyDataLocationJsonUnmarshaller method unmarshall.

public TerminologyDataLocation unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    TerminologyDataLocation terminologyDataLocation = new TerminologyDataLocation();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("RepositoryType")) {
            terminologyDataLocation.setRepositoryType(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Location")) {
            terminologyDataLocation.setLocation(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return terminologyDataLocation;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 50 with AwsJsonReader

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

the class VocabularyInfoJsonUnmarshaller method unmarshall.

public VocabularyInfo unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    VocabularyInfo vocabularyInfo = new VocabularyInfo();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("VocabularyName")) {
            vocabularyInfo.setVocabularyName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("LanguageCode")) {
            vocabularyInfo.setLanguageCode(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("LastModifiedTime")) {
            vocabularyInfo.setLastModifiedTime(DateJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("VocabularyState")) {
            vocabularyInfo.setVocabularyState(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return vocabularyInfo;
}
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