aws_sdk_comprehend/client/
detect_sentiment.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3    /// Constructs a fluent builder for the [`DetectSentiment`](crate::operation::detect_sentiment::builders::DetectSentimentFluentBuilder) operation.
4    ///
5    /// - The fluent builder is configurable:
6    ///   - [`text(impl Into<String>)`](crate::operation::detect_sentiment::builders::DetectSentimentFluentBuilder::text) / [`set_text(Option<String>)`](crate::operation::detect_sentiment::builders::DetectSentimentFluentBuilder::set_text):<br>required: **true**<br><p>A UTF-8 text string. The maximum string size is 5 KB.</p><br>
7    ///   - [`language_code(LanguageCode)`](crate::operation::detect_sentiment::builders::DetectSentimentFluentBuilder::language_code) / [`set_language_code(Option<LanguageCode>)`](crate::operation::detect_sentiment::builders::DetectSentimentFluentBuilder::set_language_code):<br>required: **true**<br><p>The language of the input documents. You can specify any of the primary languages supported by Amazon Comprehend. All documents must be in the same language.</p><br>
8    /// - On success, responds with [`DetectSentimentOutput`](crate::operation::detect_sentiment::DetectSentimentOutput) with field(s):
9    ///   - [`sentiment(Option<SentimentType>)`](crate::operation::detect_sentiment::DetectSentimentOutput::sentiment): <p>The inferred sentiment that Amazon Comprehend has the highest level of confidence in.</p>
10    ///   - [`sentiment_score(Option<SentimentScore>)`](crate::operation::detect_sentiment::DetectSentimentOutput::sentiment_score): <p>An object that lists the sentiments, and their corresponding confidence levels.</p>
11    /// - On failure, responds with [`SdkError<DetectSentimentError>`](crate::operation::detect_sentiment::DetectSentimentError)
12    pub fn detect_sentiment(&self) -> crate::operation::detect_sentiment::builders::DetectSentimentFluentBuilder {
13        crate::operation::detect_sentiment::builders::DetectSentimentFluentBuilder::new(self.handle.clone())
14    }
15}