TranscriptionJob.fromJson constructor

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

Implementation

factory TranscriptionJob.fromJson(Map<String, dynamic> json) {
  return TranscriptionJob(
    completionTime: timeStampFromJson(json['CompletionTime']),
    contentRedaction: json['ContentRedaction'] != null
        ? ContentRedaction.fromJson(
            json['ContentRedaction'] as Map<String, dynamic>)
        : null,
    creationTime: timeStampFromJson(json['CreationTime']),
    failureReason: json['FailureReason'] as String?,
    identifiedLanguageScore: json['IdentifiedLanguageScore'] as double?,
    identifyLanguage: json['IdentifyLanguage'] as bool?,
    jobExecutionSettings: json['JobExecutionSettings'] != null
        ? JobExecutionSettings.fromJson(
            json['JobExecutionSettings'] as Map<String, dynamic>)
        : null,
    languageCode: (json['LanguageCode'] as String?)?.toLanguageCode(),
    languageOptions: (json['LanguageOptions'] as List?)
        ?.whereNotNull()
        .map((e) => (e as String).toLanguageCode())
        .toList(),
    media: json['Media'] != null
        ? Media.fromJson(json['Media'] as Map<String, dynamic>)
        : null,
    mediaFormat: (json['MediaFormat'] as String?)?.toMediaFormat(),
    mediaSampleRateHertz: json['MediaSampleRateHertz'] as int?,
    modelSettings: json['ModelSettings'] != null
        ? ModelSettings.fromJson(
            json['ModelSettings'] as Map<String, dynamic>)
        : null,
    settings: json['Settings'] != null
        ? Settings.fromJson(json['Settings'] as Map<String, dynamic>)
        : null,
    startTime: timeStampFromJson(json['StartTime']),
    transcript: json['Transcript'] != null
        ? Transcript.fromJson(json['Transcript'] as Map<String, dynamic>)
        : null,
    transcriptionJobName: json['TranscriptionJobName'] as String?,
    transcriptionJobStatus: (json['TranscriptionJobStatus'] as String?)
        ?.toTranscriptionJobStatus(),
  );
}