AnnotateTextResponse.fromJson constructor

AnnotateTextResponse.fromJson(
  1. Map json_
)

Implementation

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