BatchDetectSentimentItemResult.fromJson constructor

BatchDetectSentimentItemResult.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory BatchDetectSentimentItemResult.fromJson(Map<String, dynamic> json) {
  return BatchDetectSentimentItemResult(
    index: json['Index'] as int?,
    sentiment: (json['Sentiment'] as String?)?.toSentimentType(),
    sentimentScore: json['SentimentScore'] != null
        ? SentimentScore.fromJson(
            json['SentimentScore'] as Map<String, dynamic>)
        : null,
  );
}