aws_sdk_comprehend/operation/detect_syntax/
_detect_syntax_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct DetectSyntaxInput {
6 pub text: ::std::option::Option<::std::string::String>,
8 pub language_code: ::std::option::Option<crate::types::SyntaxLanguageCode>,
10}
11impl DetectSyntaxInput {
12 pub fn text(&self) -> ::std::option::Option<&str> {
14 self.text.as_deref()
15 }
16 pub fn language_code(&self) -> ::std::option::Option<&crate::types::SyntaxLanguageCode> {
18 self.language_code.as_ref()
19 }
20}
21impl ::std::fmt::Debug for DetectSyntaxInput {
22 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
23 let mut formatter = f.debug_struct("DetectSyntaxInput");
24 formatter.field("text", &"*** Sensitive Data Redacted ***");
25 formatter.field("language_code", &self.language_code);
26 formatter.finish()
27 }
28}
29impl DetectSyntaxInput {
30 pub fn builder() -> crate::operation::detect_syntax::builders::DetectSyntaxInputBuilder {
32 crate::operation::detect_syntax::builders::DetectSyntaxInputBuilder::default()
33 }
34}
35
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
38#[non_exhaustive]
39pub struct DetectSyntaxInputBuilder {
40 pub(crate) text: ::std::option::Option<::std::string::String>,
41 pub(crate) language_code: ::std::option::Option<crate::types::SyntaxLanguageCode>,
42}
43impl DetectSyntaxInputBuilder {
44 pub fn text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
47 self.text = ::std::option::Option::Some(input.into());
48 self
49 }
50 pub fn set_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
52 self.text = input;
53 self
54 }
55 pub fn get_text(&self) -> &::std::option::Option<::std::string::String> {
57 &self.text
58 }
59 pub fn language_code(mut self, input: crate::types::SyntaxLanguageCode) -> Self {
62 self.language_code = ::std::option::Option::Some(input);
63 self
64 }
65 pub fn set_language_code(mut self, input: ::std::option::Option<crate::types::SyntaxLanguageCode>) -> Self {
67 self.language_code = input;
68 self
69 }
70 pub fn get_language_code(&self) -> &::std::option::Option<crate::types::SyntaxLanguageCode> {
72 &self.language_code
73 }
74 pub fn build(
76 self,
77 ) -> ::std::result::Result<crate::operation::detect_syntax::DetectSyntaxInput, ::aws_smithy_types::error::operation::BuildError> {
78 ::std::result::Result::Ok(crate::operation::detect_syntax::DetectSyntaxInput {
79 text: self.text,
80 language_code: self.language_code,
81 })
82 }
83}
84impl ::std::fmt::Debug for DetectSyntaxInputBuilder {
85 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
86 let mut formatter = f.debug_struct("DetectSyntaxInputBuilder");
87 formatter.field("text", &"*** Sensitive Data Redacted ***");
88 formatter.field("language_code", &self.language_code);
89 formatter.finish()
90 }
91}