1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DetectSentimentOutput {
    /// <p>The inferred sentiment that Amazon Comprehend has the highest level of confidence in.</p>
    #[doc(hidden)]
    pub sentiment: std::option::Option<crate::types::SentimentType>,
    /// <p>An object that lists the sentiments, and their corresponding confidence levels.</p>
    #[doc(hidden)]
    pub sentiment_score: std::option::Option<crate::types::SentimentScore>,
    _request_id: Option<String>,
}
impl DetectSentimentOutput {
    /// <p>The inferred sentiment that Amazon Comprehend has the highest level of confidence in.</p>
    pub fn sentiment(&self) -> std::option::Option<&crate::types::SentimentType> {
        self.sentiment.as_ref()
    }
    /// <p>An object that lists the sentiments, and their corresponding confidence levels.</p>
    pub fn sentiment_score(&self) -> std::option::Option<&crate::types::SentimentScore> {
        self.sentiment_score.as_ref()
    }
}
impl std::fmt::Debug for DetectSentimentOutput {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut formatter = f.debug_struct("DetectSentimentOutput");
        formatter.field("sentiment", &"*** Sensitive Data Redacted ***");
        formatter.field("sentiment_score", &"*** Sensitive Data Redacted ***");
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}
impl aws_http::request_id::RequestId for DetectSentimentOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl DetectSentimentOutput {
    /// Creates a new builder-style object to manufacture [`DetectSentimentOutput`](crate::operation::detect_sentiment::DetectSentimentOutput).
    pub fn builder() -> crate::operation::detect_sentiment::builders::DetectSentimentOutputBuilder {
        crate::operation::detect_sentiment::builders::DetectSentimentOutputBuilder::default()
    }
}

/// A builder for [`DetectSentimentOutput`](crate::operation::detect_sentiment::DetectSentimentOutput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
pub struct DetectSentimentOutputBuilder {
    pub(crate) sentiment: std::option::Option<crate::types::SentimentType>,
    pub(crate) sentiment_score: std::option::Option<crate::types::SentimentScore>,
    _request_id: Option<String>,
}
impl DetectSentimentOutputBuilder {
    /// <p>The inferred sentiment that Amazon Comprehend has the highest level of confidence in.</p>
    pub fn sentiment(mut self, input: crate::types::SentimentType) -> Self {
        self.sentiment = Some(input);
        self
    }
    /// <p>The inferred sentiment that Amazon Comprehend has the highest level of confidence in.</p>
    pub fn set_sentiment(
        mut self,
        input: std::option::Option<crate::types::SentimentType>,
    ) -> Self {
        self.sentiment = input;
        self
    }
    /// <p>An object that lists the sentiments, and their corresponding confidence levels.</p>
    pub fn sentiment_score(mut self, input: crate::types::SentimentScore) -> Self {
        self.sentiment_score = Some(input);
        self
    }
    /// <p>An object that lists the sentiments, and their corresponding confidence levels.</p>
    pub fn set_sentiment_score(
        mut self,
        input: std::option::Option<crate::types::SentimentScore>,
    ) -> Self {
        self.sentiment_score = input;
        self
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`DetectSentimentOutput`](crate::operation::detect_sentiment::DetectSentimentOutput).
    pub fn build(self) -> crate::operation::detect_sentiment::DetectSentimentOutput {
        crate::operation::detect_sentiment::DetectSentimentOutput {
            sentiment: self.sentiment,
            sentiment_score: self.sentiment_score,
            _request_id: self._request_id,
        }
    }
}
impl std::fmt::Debug for DetectSentimentOutputBuilder {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let mut formatter = f.debug_struct("DetectSentimentOutputBuilder");
        formatter.field("sentiment", &"*** Sensitive Data Redacted ***");
        formatter.field("sentiment_score", &"*** Sensitive Data Redacted ***");
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}