#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DetectSentimentInput {
#[doc(hidden)]
pub text: std::option::Option<std::string::String>,
#[doc(hidden)]
pub language_code: std::option::Option<crate::types::LanguageCode>,
}
impl DetectSentimentInput {
pub fn text(&self) -> std::option::Option<&str> {
self.text.as_deref()
}
pub fn language_code(&self) -> std::option::Option<&crate::types::LanguageCode> {
self.language_code.as_ref()
}
}
impl std::fmt::Debug for DetectSentimentInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DetectSentimentInput");
formatter.field("text", &"*** Sensitive Data Redacted ***");
formatter.field("language_code", &self.language_code);
formatter.finish()
}
}
impl DetectSentimentInput {
pub fn builder() -> crate::operation::detect_sentiment::builders::DetectSentimentInputBuilder {
crate::operation::detect_sentiment::builders::DetectSentimentInputBuilder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
pub struct DetectSentimentInputBuilder {
pub(crate) text: std::option::Option<std::string::String>,
pub(crate) language_code: std::option::Option<crate::types::LanguageCode>,
}
impl DetectSentimentInputBuilder {
pub fn text(mut self, input: impl Into<std::string::String>) -> Self {
self.text = Some(input.into());
self
}
pub fn set_text(mut self, input: std::option::Option<std::string::String>) -> Self {
self.text = input;
self
}
pub fn language_code(mut self, input: crate::types::LanguageCode) -> Self {
self.language_code = Some(input);
self
}
pub fn set_language_code(
mut self,
input: std::option::Option<crate::types::LanguageCode>,
) -> Self {
self.language_code = input;
self
}
pub fn build(
self,
) -> Result<
crate::operation::detect_sentiment::DetectSentimentInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::operation::detect_sentiment::DetectSentimentInput {
text: self.text,
language_code: self.language_code,
})
}
}
impl std::fmt::Debug for DetectSentimentInputBuilder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DetectSentimentInputBuilder");
formatter.field("text", &"*** Sensitive Data Redacted ***");
formatter.field("language_code", &self.language_code);
formatter.finish()
}
}