#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct DetectToxicContentInput {
pub text_segments: ::std::option::Option<::std::vec::Vec<crate::types::TextSegment>>,
pub language_code: ::std::option::Option<crate::types::LanguageCode>,
}
impl DetectToxicContentInput {
pub fn text_segments(&self) -> &[crate::types::TextSegment] {
self.text_segments.as_deref().unwrap_or_default()
}
pub fn language_code(&self) -> ::std::option::Option<&crate::types::LanguageCode> {
self.language_code.as_ref()
}
}
impl ::std::fmt::Debug for DetectToxicContentInput {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("DetectToxicContentInput");
formatter.field("text_segments", &"*** Sensitive Data Redacted ***");
formatter.field("language_code", &self.language_code);
formatter.finish()
}
}
impl DetectToxicContentInput {
pub fn builder() -> crate::operation::detect_toxic_content::builders::DetectToxicContentInputBuilder {
crate::operation::detect_toxic_content::builders::DetectToxicContentInputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct DetectToxicContentInputBuilder {
pub(crate) text_segments: ::std::option::Option<::std::vec::Vec<crate::types::TextSegment>>,
pub(crate) language_code: ::std::option::Option<crate::types::LanguageCode>,
}
impl DetectToxicContentInputBuilder {
pub fn text_segments(mut self, input: crate::types::TextSegment) -> Self {
let mut v = self.text_segments.unwrap_or_default();
v.push(input);
self.text_segments = ::std::option::Option::Some(v);
self
}
pub fn set_text_segments(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TextSegment>>) -> Self {
self.text_segments = input;
self
}
pub fn get_text_segments(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TextSegment>> {
&self.text_segments
}
pub fn language_code(mut self, input: crate::types::LanguageCode) -> Self {
self.language_code = ::std::option::Option::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 get_language_code(&self) -> &::std::option::Option<crate::types::LanguageCode> {
&self.language_code
}
pub fn build(
self,
) -> ::std::result::Result<crate::operation::detect_toxic_content::DetectToxicContentInput, ::aws_smithy_types::error::operation::BuildError>
{
::std::result::Result::Ok(crate::operation::detect_toxic_content::DetectToxicContentInput {
text_segments: self.text_segments,
language_code: self.language_code,
})
}
}
impl ::std::fmt::Debug for DetectToxicContentInputBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("DetectToxicContentInputBuilder");
formatter.field("text_segments", &"*** Sensitive Data Redacted ***");
formatter.field("language_code", &self.language_code);
formatter.finish()
}
}