BatchTranslateTextRequest.fromJson constructor Null safety

BatchTranslateTextRequest.fromJson(
  1. Map _json
)

Implementation

BatchTranslateTextRequest.fromJson(core.Map _json)
    : this(
        glossaries: _json.containsKey('glossaries')
            ? (_json['glossaries'] as core.Map<core.String, core.dynamic>)
                .map(
                (key, item) => core.MapEntry(
                  key,
                  TranslateTextGlossaryConfig.fromJson(
                      item as core.Map<core.String, core.dynamic>),
                ),
              )
            : null,
        inputConfigs: _json.containsKey('inputConfigs')
            ? (_json['inputConfigs'] as core.List)
                .map((value) => InputConfig.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        labels: _json.containsKey('labels')
            ? (_json['labels'] as core.Map<core.String, core.dynamic>).map(
                (key, item) => core.MapEntry(
                  key,
                  item as core.String,
                ),
              )
            : null,
        models: _json.containsKey('models')
            ? (_json['models'] as core.Map<core.String, core.dynamic>).map(
                (key, item) => core.MapEntry(
                  key,
                  item as core.String,
                ),
              )
            : null,
        outputConfig: _json.containsKey('outputConfig')
            ? OutputConfig.fromJson(
                _json['outputConfig'] as core.Map<core.String, core.dynamic>)
            : null,
        sourceLanguageCode: _json.containsKey('sourceLanguageCode')
            ? _json['sourceLanguageCode'] as core.String
            : null,
        targetLanguageCodes: _json.containsKey('targetLanguageCodes')
            ? (_json['targetLanguageCodes'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
      );