DetectSentimentResponse.fromJson constructor

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

Implementation

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