#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DetectSyntaxInput {
#[doc(hidden)]
pub text: std::option::Option<std::string::String>,
#[doc(hidden)]
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 Into<std::string::String>) -> Self {
self.text = Some(input.into());
self
}
pub fn set_text(mut self, input: std::option::Option<std::string::String>) -> Self {
self.text = input;
self
}
pub fn language_code(mut self, input: crate::types::SyntaxLanguageCode) -> Self {
self.language_code = 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 build(
self,
) -> Result<
crate::operation::detect_syntax::DetectSyntaxInput,
aws_smithy_http::operation::error::BuildError,
> {
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()
}
}