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