com.amazonaws.services.polly.model.transform.SynthesisTaskJsonUnmarshaller Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws-java-sdk-polly Show documentation
Show all versions of aws-java-sdk-polly Show documentation
The AWS Java SDK for Amazon Polly module holds the client classes that are used for communicating with Amazon Polly.
/*
* Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.polly.model.transform;
import java.math.*;
import javax.annotation.Generated;
import com.amazonaws.services.polly.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;
import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;
/**
* SynthesisTask JSON Unmarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class SynthesisTaskJsonUnmarshaller implements Unmarshaller {
public SynthesisTask unmarshall(JsonUnmarshallerContext context) throws Exception {
SynthesisTask synthesisTask = new SynthesisTask();
int originalDepth = context.getCurrentDepth();
String currentParentElement = context.getCurrentParentElement();
int targetDepth = originalDepth + 1;
JsonToken token = context.getCurrentToken();
if (token == null)
token = context.nextToken();
if (token == VALUE_NULL) {
return null;
}
while (true) {
if (token == null)
break;
if (token == FIELD_NAME || token == START_OBJECT) {
if (context.testExpression("Engine", targetDepth)) {
context.nextToken();
synthesisTask.setEngine(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("TaskId", targetDepth)) {
context.nextToken();
synthesisTask.setTaskId(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("TaskStatus", targetDepth)) {
context.nextToken();
synthesisTask.setTaskStatus(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("TaskStatusReason", targetDepth)) {
context.nextToken();
synthesisTask.setTaskStatusReason(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("OutputUri", targetDepth)) {
context.nextToken();
synthesisTask.setOutputUri(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("CreationTime", targetDepth)) {
context.nextToken();
synthesisTask.setCreationTime(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context));
}
if (context.testExpression("RequestCharacters", targetDepth)) {
context.nextToken();
synthesisTask.setRequestCharacters(context.getUnmarshaller(Integer.class).unmarshall(context));
}
if (context.testExpression("SnsTopicArn", targetDepth)) {
context.nextToken();
synthesisTask.setSnsTopicArn(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("LexiconNames", targetDepth)) {
context.nextToken();
synthesisTask.setLexiconNames(new ListUnmarshaller(context.getUnmarshaller(String.class))
.unmarshall(context));
}
if (context.testExpression("OutputFormat", targetDepth)) {
context.nextToken();
synthesisTask.setOutputFormat(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("SampleRate", targetDepth)) {
context.nextToken();
synthesisTask.setSampleRate(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("SpeechMarkTypes", targetDepth)) {
context.nextToken();
synthesisTask.setSpeechMarkTypes(new ListUnmarshaller(context.getUnmarshaller(String.class))
.unmarshall(context));
}
if (context.testExpression("TextType", targetDepth)) {
context.nextToken();
synthesisTask.setTextType(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("VoiceId", targetDepth)) {
context.nextToken();
synthesisTask.setVoiceId(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("LanguageCode", targetDepth)) {
context.nextToken();
synthesisTask.setLanguageCode(context.getUnmarshaller(String.class).unmarshall(context));
}
} else if (token == END_ARRAY || token == END_OBJECT) {
if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
if (context.getCurrentDepth() <= originalDepth)
break;
}
}
token = context.nextToken();
}
return synthesisTask;
}
private static SynthesisTaskJsonUnmarshaller instance;
public static SynthesisTaskJsonUnmarshaller getInstance() {
if (instance == null)
instance = new SynthesisTaskJsonUnmarshaller();
return instance;
}
}