aws_sdk_lexruntimev2/operation/recognize_text/
_recognize_text_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct RecognizeTextInput {
6    /// <p>The identifier of the bot that processes the request.</p>
7    pub bot_id: ::std::option::Option<::std::string::String>,
8    /// <p>The alias identifier in use for the bot that processes the request.</p>
9    pub bot_alias_id: ::std::option::Option<::std::string::String>,
10    /// <p>The locale where the session is in use.</p>
11    pub locale_id: ::std::option::Option<::std::string::String>,
12    /// <p>The identifier of the user session that is having the conversation.</p>
13    pub session_id: ::std::option::Option<::std::string::String>,
14    /// <p>The text that the user entered. Amazon Lex V2 interprets this text.</p>
15    pub text: ::std::option::Option<::std::string::String>,
16    /// <p>The current state of the dialog between the user and the bot.</p>
17    pub session_state: ::std::option::Option<crate::types::SessionState>,
18    /// <p>Request-specific information passed between the client application and Amazon Lex V2</p>
19    /// <p>The namespace <code>x-amz-lex:</code> is reserved for special attributes. Don't create any request attributes with the prefix <code>x-amz-lex:</code>.</p>
20    pub request_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
21}
22impl RecognizeTextInput {
23    /// <p>The identifier of the bot that processes the request.</p>
24    pub fn bot_id(&self) -> ::std::option::Option<&str> {
25        self.bot_id.as_deref()
26    }
27    /// <p>The alias identifier in use for the bot that processes the request.</p>
28    pub fn bot_alias_id(&self) -> ::std::option::Option<&str> {
29        self.bot_alias_id.as_deref()
30    }
31    /// <p>The locale where the session is in use.</p>
32    pub fn locale_id(&self) -> ::std::option::Option<&str> {
33        self.locale_id.as_deref()
34    }
35    /// <p>The identifier of the user session that is having the conversation.</p>
36    pub fn session_id(&self) -> ::std::option::Option<&str> {
37        self.session_id.as_deref()
38    }
39    /// <p>The text that the user entered. Amazon Lex V2 interprets this text.</p>
40    pub fn text(&self) -> ::std::option::Option<&str> {
41        self.text.as_deref()
42    }
43    /// <p>The current state of the dialog between the user and the bot.</p>
44    pub fn session_state(&self) -> ::std::option::Option<&crate::types::SessionState> {
45        self.session_state.as_ref()
46    }
47    /// <p>Request-specific information passed between the client application and Amazon Lex V2</p>
48    /// <p>The namespace <code>x-amz-lex:</code> is reserved for special attributes. Don't create any request attributes with the prefix <code>x-amz-lex:</code>.</p>
49    pub fn request_attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
50        self.request_attributes.as_ref()
51    }
52}
53impl ::std::fmt::Debug for RecognizeTextInput {
54    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
55        let mut formatter = f.debug_struct("RecognizeTextInput");
56        formatter.field("bot_id", &self.bot_id);
57        formatter.field("bot_alias_id", &self.bot_alias_id);
58        formatter.field("locale_id", &self.locale_id);
59        formatter.field("session_id", &self.session_id);
60        formatter.field("text", &"*** Sensitive Data Redacted ***");
61        formatter.field("session_state", &self.session_state);
62        formatter.field("request_attributes", &self.request_attributes);
63        formatter.finish()
64    }
65}
66impl RecognizeTextInput {
67    /// Creates a new builder-style object to manufacture [`RecognizeTextInput`](crate::operation::recognize_text::RecognizeTextInput).
68    pub fn builder() -> crate::operation::recognize_text::builders::RecognizeTextInputBuilder {
69        crate::operation::recognize_text::builders::RecognizeTextInputBuilder::default()
70    }
71}
72
73/// A builder for [`RecognizeTextInput`](crate::operation::recognize_text::RecognizeTextInput).
74#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
75#[non_exhaustive]
76pub struct RecognizeTextInputBuilder {
77    pub(crate) bot_id: ::std::option::Option<::std::string::String>,
78    pub(crate) bot_alias_id: ::std::option::Option<::std::string::String>,
79    pub(crate) locale_id: ::std::option::Option<::std::string::String>,
80    pub(crate) session_id: ::std::option::Option<::std::string::String>,
81    pub(crate) text: ::std::option::Option<::std::string::String>,
82    pub(crate) session_state: ::std::option::Option<crate::types::SessionState>,
83    pub(crate) request_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
84}
85impl RecognizeTextInputBuilder {
86    /// <p>The identifier of the bot that processes the request.</p>
87    /// This field is required.
88    pub fn bot_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89        self.bot_id = ::std::option::Option::Some(input.into());
90        self
91    }
92    /// <p>The identifier of the bot that processes the request.</p>
93    pub fn set_bot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94        self.bot_id = input;
95        self
96    }
97    /// <p>The identifier of the bot that processes the request.</p>
98    pub fn get_bot_id(&self) -> &::std::option::Option<::std::string::String> {
99        &self.bot_id
100    }
101    /// <p>The alias identifier in use for the bot that processes the request.</p>
102    /// This field is required.
103    pub fn bot_alias_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104        self.bot_alias_id = ::std::option::Option::Some(input.into());
105        self
106    }
107    /// <p>The alias identifier in use for the bot that processes the request.</p>
108    pub fn set_bot_alias_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109        self.bot_alias_id = input;
110        self
111    }
112    /// <p>The alias identifier in use for the bot that processes the request.</p>
113    pub fn get_bot_alias_id(&self) -> &::std::option::Option<::std::string::String> {
114        &self.bot_alias_id
115    }
116    /// <p>The locale where the session is in use.</p>
117    /// This field is required.
118    pub fn locale_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.locale_id = ::std::option::Option::Some(input.into());
120        self
121    }
122    /// <p>The locale where the session is in use.</p>
123    pub fn set_locale_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.locale_id = input;
125        self
126    }
127    /// <p>The locale where the session is in use.</p>
128    pub fn get_locale_id(&self) -> &::std::option::Option<::std::string::String> {
129        &self.locale_id
130    }
131    /// <p>The identifier of the user session that is having the conversation.</p>
132    /// This field is required.
133    pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.session_id = ::std::option::Option::Some(input.into());
135        self
136    }
137    /// <p>The identifier of the user session that is having the conversation.</p>
138    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.session_id = input;
140        self
141    }
142    /// <p>The identifier of the user session that is having the conversation.</p>
143    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
144        &self.session_id
145    }
146    /// <p>The text that the user entered. Amazon Lex V2 interprets this text.</p>
147    /// This field is required.
148    pub fn text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149        self.text = ::std::option::Option::Some(input.into());
150        self
151    }
152    /// <p>The text that the user entered. Amazon Lex V2 interprets this text.</p>
153    pub fn set_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.text = input;
155        self
156    }
157    /// <p>The text that the user entered. Amazon Lex V2 interprets this text.</p>
158    pub fn get_text(&self) -> &::std::option::Option<::std::string::String> {
159        &self.text
160    }
161    /// <p>The current state of the dialog between the user and the bot.</p>
162    pub fn session_state(mut self, input: crate::types::SessionState) -> Self {
163        self.session_state = ::std::option::Option::Some(input);
164        self
165    }
166    /// <p>The current state of the dialog between the user and the bot.</p>
167    pub fn set_session_state(mut self, input: ::std::option::Option<crate::types::SessionState>) -> Self {
168        self.session_state = input;
169        self
170    }
171    /// <p>The current state of the dialog between the user and the bot.</p>
172    pub fn get_session_state(&self) -> &::std::option::Option<crate::types::SessionState> {
173        &self.session_state
174    }
175    /// Adds a key-value pair to `request_attributes`.
176    ///
177    /// To override the contents of this collection use [`set_request_attributes`](Self::set_request_attributes).
178    ///
179    /// <p>Request-specific information passed between the client application and Amazon Lex V2</p>
180    /// <p>The namespace <code>x-amz-lex:</code> is reserved for special attributes. Don't create any request attributes with the prefix <code>x-amz-lex:</code>.</p>
181    pub fn request_attributes(
182        mut self,
183        k: impl ::std::convert::Into<::std::string::String>,
184        v: impl ::std::convert::Into<::std::string::String>,
185    ) -> Self {
186        let mut hash_map = self.request_attributes.unwrap_or_default();
187        hash_map.insert(k.into(), v.into());
188        self.request_attributes = ::std::option::Option::Some(hash_map);
189        self
190    }
191    /// <p>Request-specific information passed between the client application and Amazon Lex V2</p>
192    /// <p>The namespace <code>x-amz-lex:</code> is reserved for special attributes. Don't create any request attributes with the prefix <code>x-amz-lex:</code>.</p>
193    pub fn set_request_attributes(
194        mut self,
195        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
196    ) -> Self {
197        self.request_attributes = input;
198        self
199    }
200    /// <p>Request-specific information passed between the client application and Amazon Lex V2</p>
201    /// <p>The namespace <code>x-amz-lex:</code> is reserved for special attributes. Don't create any request attributes with the prefix <code>x-amz-lex:</code>.</p>
202    pub fn get_request_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
203        &self.request_attributes
204    }
205    /// Consumes the builder and constructs a [`RecognizeTextInput`](crate::operation::recognize_text::RecognizeTextInput).
206    pub fn build(
207        self,
208    ) -> ::std::result::Result<crate::operation::recognize_text::RecognizeTextInput, ::aws_smithy_types::error::operation::BuildError> {
209        ::std::result::Result::Ok(crate::operation::recognize_text::RecognizeTextInput {
210            bot_id: self.bot_id,
211            bot_alias_id: self.bot_alias_id,
212            locale_id: self.locale_id,
213            session_id: self.session_id,
214            text: self.text,
215            session_state: self.session_state,
216            request_attributes: self.request_attributes,
217        })
218    }
219}
220impl ::std::fmt::Debug for RecognizeTextInputBuilder {
221    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
222        let mut formatter = f.debug_struct("RecognizeTextInputBuilder");
223        formatter.field("bot_id", &self.bot_id);
224        formatter.field("bot_alias_id", &self.bot_alias_id);
225        formatter.field("locale_id", &self.locale_id);
226        formatter.field("session_id", &self.session_id);
227        formatter.field("text", &"*** Sensitive Data Redacted ***");
228        formatter.field("session_state", &self.session_state);
229        formatter.field("request_attributes", &self.request_attributes);
230        formatter.finish()
231    }
232}