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 DetectKeyPhrasesInput {
    /// <p>A UTF-8 text string. The string must contain less than 100 KB of UTF-8 encoded characters.</p>
    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>
    pub language_code: ::std::option::Option<crate::types::LanguageCode>,
}
impl DetectKeyPhrasesInput {
    /// <p>A UTF-8 text string. The string must contain less than 100 KB of UTF-8 encoded characters.</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 DetectKeyPhrasesInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("DetectKeyPhrasesInput");
        formatter.field("text", &"*** Sensitive Data Redacted ***");
        formatter.field("language_code", &self.language_code);
        formatter.finish()
    }
}
impl DetectKeyPhrasesInput {
    /// Creates a new builder-style object to manufacture [`DetectKeyPhrasesInput`](crate::operation::detect_key_phrases::DetectKeyPhrasesInput).
    pub fn builder() -> crate::operation::detect_key_phrases::builders::DetectKeyPhrasesInputBuilder {
        crate::operation::detect_key_phrases::builders::DetectKeyPhrasesInputBuilder::default()
    }
}

/// A builder for [`DetectKeyPhrasesInput`](crate::operation::detect_key_phrases::DetectKeyPhrasesInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct DetectKeyPhrasesInputBuilder {
    pub(crate) text: ::std::option::Option<::std::string::String>,
    pub(crate) language_code: ::std::option::Option<crate::types::LanguageCode>,
}
impl DetectKeyPhrasesInputBuilder {
    /// <p>A UTF-8 text string. The string must contain less than 100 KB of UTF-8 encoded characters.</p>
    /// This field is required.
    pub fn text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.text = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A UTF-8 text string. The string must contain less than 100 KB of UTF-8 encoded characters.</p>
    pub fn set_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.text = input;
        self
    }
    /// <p>A UTF-8 text string. The string must contain less than 100 KB of UTF-8 encoded characters.</p>
    pub fn get_text(&self) -> &::std::option::Option<::std::string::String> {
        &self.text
    }
    /// <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>
    /// This field is required.
    pub fn language_code(mut self, input: crate::types::LanguageCode) -> Self {
        self.language_code = ::std::option::Option::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
    }
    /// <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 get_language_code(&self) -> &::std::option::Option<crate::types::LanguageCode> {
        &self.language_code
    }
    /// Consumes the builder and constructs a [`DetectKeyPhrasesInput`](crate::operation::detect_key_phrases::DetectKeyPhrasesInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::detect_key_phrases::DetectKeyPhrasesInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::detect_key_phrases::DetectKeyPhrasesInput {
            text: self.text,
            language_code: self.language_code,
        })
    }
}
impl ::std::fmt::Debug for DetectKeyPhrasesInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("DetectKeyPhrasesInputBuilder");
        formatter.field("text", &"*** Sensitive Data Redacted ***");
        formatter.field("language_code", &self.language_code);
        formatter.finish()
    }
}