AnnotateTextResponse.fromJson constructor

AnnotateTextResponse.fromJson(
  1. Map json_
)

Implementation

AnnotateTextResponse.fromJson(core.Map json_)
    : this(
        categories: json_.containsKey('categories')
            ? (json_['categories'] as core.List)
                .map((value) => ClassificationCategory.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        documentSentiment: json_.containsKey('documentSentiment')
            ? Sentiment.fromJson(json_['documentSentiment']
                as core.Map<core.String, core.dynamic>)
            : null,
        entities: json_.containsKey('entities')
            ? (json_['entities'] as core.List)
                .map((value) => Entity.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        languageCode: json_.containsKey('languageCode')
            ? json_['languageCode'] as core.String
            : null,
        languageSupported: json_.containsKey('languageSupported')
            ? json_['languageSupported'] as core.bool
            : null,
        moderationCategories: json_.containsKey('moderationCategories')
            ? (json_['moderationCategories'] as core.List)
                .map((value) => ClassificationCategory.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        sentences: json_.containsKey('sentences')
            ? (json_['sentences'] as core.List)
                .map((value) => Sentence.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
      );