#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct DetectSentimentOutput {
pub sentiment: ::std::option::Option<crate::types::SentimentType>,
pub sentiment_score: ::std::option::Option<crate::types::SentimentScore>,
_request_id: Option<String>,
}
impl DetectSentimentOutput {
pub fn sentiment(&self) -> ::std::option::Option<&crate::types::SentimentType> {
self.sentiment.as_ref()
}
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_types::request_id::RequestId for DetectSentimentOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl DetectSentimentOutput {
pub fn builder() -> crate::operation::detect_sentiment::builders::DetectSentimentOutputBuilder {
crate::operation::detect_sentiment::builders::DetectSentimentOutputBuilder::default()
}
}
#[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 {
pub fn sentiment(mut self, input: crate::types::SentimentType) -> Self {
self.sentiment = ::std::option::Option::Some(input);
self
}
pub fn set_sentiment(mut self, input: ::std::option::Option<crate::types::SentimentType>) -> Self {
self.sentiment = input;
self
}
pub fn get_sentiment(&self) -> &::std::option::Option<crate::types::SentimentType> {
&self.sentiment
}
pub fn sentiment_score(mut self, input: crate::types::SentimentScore) -> Self {
self.sentiment_score = ::std::option::Option::Some(input);
self
}
pub fn set_sentiment_score(mut self, input: ::std::option::Option<crate::types::SentimentScore>) -> Self {
self.sentiment_score = input;
self
}
pub fn get_sentiment_score(&self) -> &::std::option::Option<crate::types::SentimentScore> {
&self.sentiment_score
}
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
}
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()
}
}