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,
        language: json_.containsKey('language')
            ? json_['language'] as core.String
            : 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,
        tokens: json_.containsKey('tokens')
            ? (json_['tokens'] as core.List)
                .map((value) => Token.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
      );