TranslateTextRequest.fromJson constructor

TranslateTextRequest.fromJson(
  1. Map json_
)

Implementation

TranslateTextRequest.fromJson(core.Map json_)
    : this(
        contents: json_.containsKey('contents')
            ? (json_['contents'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        glossaryConfig: json_.containsKey('glossaryConfig')
            ? TranslateTextGlossaryConfig.fromJson(json_['glossaryConfig']
                as core.Map<core.String, core.dynamic>)
            : null,
        labels: json_.containsKey('labels')
            ? (json_['labels'] as core.Map<core.String, core.dynamic>).map(
                (key, value) => core.MapEntry(
                  key,
                  value as core.String,
                ),
              )
            : null,
        mimeType: json_.containsKey('mimeType')
            ? json_['mimeType'] as core.String
            : null,
        model:
            json_.containsKey('model') ? json_['model'] as core.String : null,
        sourceLanguageCode: json_.containsKey('sourceLanguageCode')
            ? json_['sourceLanguageCode'] as core.String
            : null,
        targetLanguageCode: json_.containsKey('targetLanguageCode')
            ? json_['targetLanguageCode'] as core.String
            : null,
        transliterationConfig: json_.containsKey('transliterationConfig')
            ? TransliterationConfig.fromJson(json_['transliterationConfig']
                as core.Map<core.String, core.dynamic>)
            : null,
      );