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
// 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 DetectSentimentInput {
    /// <p>A UTF-8 text string. The maximum string size is 5 KB.</p>
    #[doc(hidden)]
    pub text: std::option::Option<std::string::String>,
    /// <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>
    #[doc(hidden)]
    pub language_code: std::option::Option<crate::types::LanguageCode>,
}
impl DetectSentimentInput {
    /// <p>A UTF-8 text string. The maximum string size is 5 KB.</p>
    pub fn text(&self) -> std::option::Option<&str> {
        self.text.as_deref()
    }
    /// <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>
    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 {
    /// Creates a new builder-style object to manufacture [`DetectSentimentInput`](crate::operation::detect_sentiment::DetectSentimentInput).
    pub fn builder() -> crate::operation::detect_sentiment::builders::DetectSentimentInputBuilder {
        crate::operation::detect_sentiment::builders::DetectSentimentInputBuilder::default()
    }
}

/// A builder for [`DetectSentimentInput`](crate::operation::detect_sentiment::DetectSentimentInput).
#[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 {
    /// <p>A UTF-8 text string. The maximum string size is 5 KB.</p>
    pub fn text(mut self, input: impl Into<std::string::String>) -> Self {
        self.text = Some(input.into());
        self
    }
    /// <p>A UTF-8 text string. The maximum string size is 5 KB.</p>
    pub fn set_text(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.text = input;
        self
    }
    /// <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>
    pub fn language_code(mut self, input: crate::types::LanguageCode) -> Self {
        self.language_code = Some(input);
        self
    }
    /// <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>
    pub fn set_language_code(
        mut self,
        input: std::option::Option<crate::types::LanguageCode>,
    ) -> Self {
        self.language_code = input;
        self
    }
    /// Consumes the builder and constructs a [`DetectSentimentInput`](crate::operation::detect_sentiment::DetectSentimentInput).
    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()
    }
}