aws_sdk_comprehend/types/
_mention_sentiment.rs1#[non_exhaustive]
6#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
7pub struct MentionSentiment {
8 pub sentiment: ::std::option::Option<crate::types::SentimentType>,
10 pub sentiment_score: ::std::option::Option<crate::types::SentimentScore>,
12}
13impl MentionSentiment {
14 pub fn sentiment(&self) -> ::std::option::Option<&crate::types::SentimentType> {
16 self.sentiment.as_ref()
17 }
18 pub fn sentiment_score(&self) -> ::std::option::Option<&crate::types::SentimentScore> {
20 self.sentiment_score.as_ref()
21 }
22}
23impl MentionSentiment {
24 pub fn builder() -> crate::types::builders::MentionSentimentBuilder {
26 crate::types::builders::MentionSentimentBuilder::default()
27 }
28}
29
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct MentionSentimentBuilder {
34 pub(crate) sentiment: ::std::option::Option<crate::types::SentimentType>,
35 pub(crate) sentiment_score: ::std::option::Option<crate::types::SentimentScore>,
36}
37impl MentionSentimentBuilder {
38 pub fn sentiment(mut self, input: crate::types::SentimentType) -> Self {
40 self.sentiment = ::std::option::Option::Some(input);
41 self
42 }
43 pub fn set_sentiment(mut self, input: ::std::option::Option<crate::types::SentimentType>) -> Self {
45 self.sentiment = input;
46 self
47 }
48 pub fn get_sentiment(&self) -> &::std::option::Option<crate::types::SentimentType> {
50 &self.sentiment
51 }
52 pub fn sentiment_score(mut self, input: crate::types::SentimentScore) -> Self {
54 self.sentiment_score = ::std::option::Option::Some(input);
55 self
56 }
57 pub fn set_sentiment_score(mut self, input: ::std::option::Option<crate::types::SentimentScore>) -> Self {
59 self.sentiment_score = input;
60 self
61 }
62 pub fn get_sentiment_score(&self) -> &::std::option::Option<crate::types::SentimentScore> {
64 &self.sentiment_score
65 }
66 pub fn build(self) -> crate::types::MentionSentiment {
68 crate::types::MentionSentiment {
69 sentiment: self.sentiment,
70 sentiment_score: self.sentiment_score,
71 }
72 }
73}