aws-sdk-comprehend 1.98.0

AWS SDK for Amazon Comprehend
Documentation
// 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 BatchDetectSyntaxInput {
    /// <p>A list containing the UTF-8 encoded text of the input documents. The list can contain a maximum of 25 documents. The maximum size for each document is 5 KB.</p>
    pub text_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>The language of the input documents. You can specify any of the following languages supported by Amazon Comprehend: German ("de"), English ("en"), Spanish ("es"), French ("fr"), Italian ("it"), or Portuguese ("pt"). All documents must be in the same language.</p>
    pub language_code: ::std::option::Option<crate::types::SyntaxLanguageCode>,
}
impl BatchDetectSyntaxInput {
    /// <p>A list containing the UTF-8 encoded text of the input documents. The list can contain a maximum of 25 documents. The maximum size for each document is 5 KB.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.text_list.is_none()`.
    pub fn text_list(&self) -> &[::std::string::String] {
        self.text_list.as_deref().unwrap_or_default()
    }
    /// <p>The language of the input documents. You can specify any of the following languages supported by Amazon Comprehend: German ("de"), English ("en"), Spanish ("es"), French ("fr"), Italian ("it"), or Portuguese ("pt"). All documents must be in the same language.</p>
    pub fn language_code(&self) -> ::std::option::Option<&crate::types::SyntaxLanguageCode> {
        self.language_code.as_ref()
    }
}
impl ::std::fmt::Debug for BatchDetectSyntaxInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("BatchDetectSyntaxInput");
        formatter.field("text_list", &"*** Sensitive Data Redacted ***");
        formatter.field("language_code", &self.language_code);
        formatter.finish()
    }
}
impl BatchDetectSyntaxInput {
    /// Creates a new builder-style object to manufacture [`BatchDetectSyntaxInput`](crate::operation::batch_detect_syntax::BatchDetectSyntaxInput).
    pub fn builder() -> crate::operation::batch_detect_syntax::builders::BatchDetectSyntaxInputBuilder {
        crate::operation::batch_detect_syntax::builders::BatchDetectSyntaxInputBuilder::default()
    }
}

/// A builder for [`BatchDetectSyntaxInput`](crate::operation::batch_detect_syntax::BatchDetectSyntaxInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct BatchDetectSyntaxInputBuilder {
    pub(crate) text_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) language_code: ::std::option::Option<crate::types::SyntaxLanguageCode>,
}
impl BatchDetectSyntaxInputBuilder {
    /// Appends an item to `text_list`.
    ///
    /// To override the contents of this collection use [`set_text_list`](Self::set_text_list).
    ///
    /// <p>A list containing the UTF-8 encoded text of the input documents. The list can contain a maximum of 25 documents. The maximum size for each document is 5 KB.</p>
    pub fn text_list(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.text_list.unwrap_or_default();
        v.push(input.into());
        self.text_list = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list containing the UTF-8 encoded text of the input documents. The list can contain a maximum of 25 documents. The maximum size for each document is 5 KB.</p>
    pub fn set_text_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.text_list = input;
        self
    }
    /// <p>A list containing the UTF-8 encoded text of the input documents. The list can contain a maximum of 25 documents. The maximum size for each document is 5 KB.</p>
    pub fn get_text_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.text_list
    }
    /// <p>The language of the input documents. You can specify any of the following languages supported by Amazon Comprehend: German ("de"), English ("en"), Spanish ("es"), French ("fr"), Italian ("it"), or Portuguese ("pt"). All documents must be in the same language.</p>
    /// This field is required.
    pub fn language_code(mut self, input: crate::types::SyntaxLanguageCode) -> Self {
        self.language_code = ::std::option::Option::Some(input);
        self
    }
    /// <p>The language of the input documents. You can specify any of the following languages supported by Amazon Comprehend: German ("de"), English ("en"), Spanish ("es"), French ("fr"), Italian ("it"), or Portuguese ("pt"). All documents must be in the same language.</p>
    pub fn set_language_code(mut self, input: ::std::option::Option<crate::types::SyntaxLanguageCode>) -> Self {
        self.language_code = input;
        self
    }
    /// <p>The language of the input documents. You can specify any of the following languages supported by Amazon Comprehend: German ("de"), English ("en"), Spanish ("es"), French ("fr"), Italian ("it"), or Portuguese ("pt"). All documents must be in the same language.</p>
    pub fn get_language_code(&self) -> &::std::option::Option<crate::types::SyntaxLanguageCode> {
        &self.language_code
    }
    /// Consumes the builder and constructs a [`BatchDetectSyntaxInput`](crate::operation::batch_detect_syntax::BatchDetectSyntaxInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::batch_detect_syntax::BatchDetectSyntaxInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::batch_detect_syntax::BatchDetectSyntaxInput {
            text_list: self.text_list,
            language_code: self.language_code,
        })
    }
}
impl ::std::fmt::Debug for BatchDetectSyntaxInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("BatchDetectSyntaxInputBuilder");
        formatter.field("text_list", &"*** Sensitive Data Redacted ***");
        formatter.field("language_code", &self.language_code);
        formatter.finish()
    }
}