SynthesisTask.fromJson constructor

SynthesisTask.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory SynthesisTask.fromJson(Map<String, dynamic> json) {
  return SynthesisTask(
    creationTime: timeStampFromJson(json['CreationTime']),
    engine: (json['Engine'] as String?)?.toEngine(),
    languageCode: (json['LanguageCode'] as String?)?.toLanguageCode(),
    lexiconNames: (json['LexiconNames'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    outputFormat: (json['OutputFormat'] as String?)?.toOutputFormat(),
    outputUri: json['OutputUri'] as String?,
    requestCharacters: json['RequestCharacters'] as int?,
    sampleRate: json['SampleRate'] as String?,
    snsTopicArn: json['SnsTopicArn'] as String?,
    speechMarkTypes: (json['SpeechMarkTypes'] as List?)
        ?.whereNotNull()
        .map((e) => (e as String).toSpeechMarkType())
        .toList(),
    taskId: json['TaskId'] as String?,
    taskStatus: (json['TaskStatus'] as String?)?.toTaskStatus(),
    taskStatusReason: json['TaskStatusReason'] as String?,
    textType: (json['TextType'] as String?)?.toTextType(),
    voiceId: (json['VoiceId'] as String?)?.toVoiceId(),
  );
}