RecognitionConfig.fromJson constructor

RecognitionConfig.fromJson(
  1. Map json_
)

Implementation

RecognitionConfig.fromJson(core.Map json_)
    : this(
        adaptation: json_.containsKey('adaptation')
            ? SpeechAdaptation.fromJson(
                json_['adaptation'] as core.Map<core.String, core.dynamic>)
            : null,
        alternativeLanguageCodes:
            json_.containsKey('alternativeLanguageCodes')
                ? (json_['alternativeLanguageCodes'] as core.List)
                    .map((value) => value as core.String)
                    .toList()
                : null,
        audioChannelCount: json_.containsKey('audioChannelCount')
            ? json_['audioChannelCount'] as core.int
            : null,
        diarizationConfig: json_.containsKey('diarizationConfig')
            ? SpeakerDiarizationConfig.fromJson(json_['diarizationConfig']
                as core.Map<core.String, core.dynamic>)
            : null,
        enableAutomaticPunctuation:
            json_.containsKey('enableAutomaticPunctuation')
                ? json_['enableAutomaticPunctuation'] as core.bool
                : null,
        enableSeparateRecognitionPerChannel:
            json_.containsKey('enableSeparateRecognitionPerChannel')
                ? json_['enableSeparateRecognitionPerChannel'] as core.bool
                : null,
        enableSpokenEmojis: json_.containsKey('enableSpokenEmojis')
            ? json_['enableSpokenEmojis'] as core.bool
            : null,
        enableSpokenPunctuation: json_.containsKey('enableSpokenPunctuation')
            ? json_['enableSpokenPunctuation'] as core.bool
            : null,
        enableWordConfidence: json_.containsKey('enableWordConfidence')
            ? json_['enableWordConfidence'] as core.bool
            : null,
        enableWordTimeOffsets: json_.containsKey('enableWordTimeOffsets')
            ? json_['enableWordTimeOffsets'] as core.bool
            : null,
        encoding: json_.containsKey('encoding')
            ? json_['encoding'] as core.String
            : null,
        languageCode: json_.containsKey('languageCode')
            ? json_['languageCode'] as core.String
            : null,
        maxAlternatives: json_.containsKey('maxAlternatives')
            ? json_['maxAlternatives'] as core.int
            : null,
        metadata: json_.containsKey('metadata')
            ? RecognitionMetadata.fromJson(
                json_['metadata'] as core.Map<core.String, core.dynamic>)
            : null,
        model:
            json_.containsKey('model') ? json_['model'] as core.String : null,
        profanityFilter: json_.containsKey('profanityFilter')
            ? json_['profanityFilter'] as core.bool
            : null,
        sampleRateHertz: json_.containsKey('sampleRateHertz')
            ? json_['sampleRateHertz'] as core.int
            : null,
        speechContexts: json_.containsKey('speechContexts')
            ? (json_['speechContexts'] as core.List)
                .map((value) => SpeechContext.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        transcriptNormalization: json_.containsKey('transcriptNormalization')
            ? TranscriptNormalization.fromJson(
                json_['transcriptNormalization']
                    as core.Map<core.String, core.dynamic>)
            : null,
        useEnhanced: json_.containsKey('useEnhanced')
            ? json_['useEnhanced'] as core.bool
            : null,
      );