aws_sdk_lexruntime/operation/post_text/_post_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 PostTextInput {
6 /// <p>The name of the Amazon Lex bot.</p>
7 pub bot_name: ::std::option::Option<::std::string::String>,
8 /// <p>The alias of the Amazon Lex bot.</p>
9 pub bot_alias: ::std::option::Option<::std::string::String>,
10 /// <p>The ID of the client application user. Amazon Lex uses this to identify a user's conversation with your bot. At runtime, each request must contain the <code>userID</code> field.</p>
11 /// <p>To decide the user ID to use for your application, consider the following factors.</p>
12 /// <ul>
13 /// <li>
14 /// <p>The <code>userID</code> field must not contain any personally identifiable information of the user, for example, name, personal identification numbers, or other end user personal information.</p></li>
15 /// <li>
16 /// <p>If you want a user to start a conversation on one device and continue on another device, use a user-specific identifier.</p></li>
17 /// <li>
18 /// <p>If you want the same user to be able to have two independent conversations on two different devices, choose a device-specific identifier.</p></li>
19 /// <li>
20 /// <p>A user can't have two independent conversations with two different versions of the same bot. For example, a user can't have a conversation with the PROD and BETA versions of the same bot. If you anticipate that a user will need to have conversation with two different versions, for example, while testing, include the bot alias in the user ID to separate the two conversations.</p></li>
21 /// </ul>
22 pub user_id: ::std::option::Option<::std::string::String>,
23 /// <p>Application-specific information passed between Amazon Lex and a client application.</p>
24 /// <p>For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-session-attribs">Setting Session Attributes</a>.</p>
25 pub session_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
26 /// <p>Request-specific information passed between Amazon Lex and a client application.</p>
27 /// <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>
28 /// <p>For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-request-attribs">Setting Request Attributes</a>.</p>
29 pub request_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
30 /// <p>The text that the user entered (Amazon Lex interprets this text).</p>
31 pub input_text: ::std::option::Option<::std::string::String>,
32 /// <p>A list of contexts active for the request. A context can be activated when a previous intent is fulfilled, or by including the context in the request,</p>
33 /// <p>If you don't specify a list of contexts, Amazon Lex will use the current list of contexts for the session. If you specify an empty list, all contexts for the session are cleared.</p>
34 pub active_contexts: ::std::option::Option<::std::vec::Vec<crate::types::ActiveContext>>,
35}
36impl PostTextInput {
37 /// <p>The name of the Amazon Lex bot.</p>
38 pub fn bot_name(&self) -> ::std::option::Option<&str> {
39 self.bot_name.as_deref()
40 }
41 /// <p>The alias of the Amazon Lex bot.</p>
42 pub fn bot_alias(&self) -> ::std::option::Option<&str> {
43 self.bot_alias.as_deref()
44 }
45 /// <p>The ID of the client application user. Amazon Lex uses this to identify a user's conversation with your bot. At runtime, each request must contain the <code>userID</code> field.</p>
46 /// <p>To decide the user ID to use for your application, consider the following factors.</p>
47 /// <ul>
48 /// <li>
49 /// <p>The <code>userID</code> field must not contain any personally identifiable information of the user, for example, name, personal identification numbers, or other end user personal information.</p></li>
50 /// <li>
51 /// <p>If you want a user to start a conversation on one device and continue on another device, use a user-specific identifier.</p></li>
52 /// <li>
53 /// <p>If you want the same user to be able to have two independent conversations on two different devices, choose a device-specific identifier.</p></li>
54 /// <li>
55 /// <p>A user can't have two independent conversations with two different versions of the same bot. For example, a user can't have a conversation with the PROD and BETA versions of the same bot. If you anticipate that a user will need to have conversation with two different versions, for example, while testing, include the bot alias in the user ID to separate the two conversations.</p></li>
56 /// </ul>
57 pub fn user_id(&self) -> ::std::option::Option<&str> {
58 self.user_id.as_deref()
59 }
60 /// <p>Application-specific information passed between Amazon Lex and a client application.</p>
61 /// <p>For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-session-attribs">Setting Session Attributes</a>.</p>
62 pub fn session_attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
63 self.session_attributes.as_ref()
64 }
65 /// <p>Request-specific information passed between Amazon Lex and a client application.</p>
66 /// <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>
67 /// <p>For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-request-attribs">Setting Request Attributes</a>.</p>
68 pub fn request_attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
69 self.request_attributes.as_ref()
70 }
71 /// <p>The text that the user entered (Amazon Lex interprets this text).</p>
72 pub fn input_text(&self) -> ::std::option::Option<&str> {
73 self.input_text.as_deref()
74 }
75 /// <p>A list of contexts active for the request. A context can be activated when a previous intent is fulfilled, or by including the context in the request,</p>
76 /// <p>If you don't specify a list of contexts, Amazon Lex will use the current list of contexts for the session. If you specify an empty list, all contexts for the session are cleared.</p>
77 ///
78 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.active_contexts.is_none()`.
79 pub fn active_contexts(&self) -> &[crate::types::ActiveContext] {
80 self.active_contexts.as_deref().unwrap_or_default()
81 }
82}
83impl ::std::fmt::Debug for PostTextInput {
84 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
85 let mut formatter = f.debug_struct("PostTextInput");
86 formatter.field("bot_name", &self.bot_name);
87 formatter.field("bot_alias", &self.bot_alias);
88 formatter.field("user_id", &self.user_id);
89 formatter.field("session_attributes", &"*** Sensitive Data Redacted ***");
90 formatter.field("request_attributes", &"*** Sensitive Data Redacted ***");
91 formatter.field("input_text", &"*** Sensitive Data Redacted ***");
92 formatter.field("active_contexts", &"*** Sensitive Data Redacted ***");
93 formatter.finish()
94 }
95}
96impl PostTextInput {
97 /// Creates a new builder-style object to manufacture [`PostTextInput`](crate::operation::post_text::PostTextInput).
98 pub fn builder() -> crate::operation::post_text::builders::PostTextInputBuilder {
99 crate::operation::post_text::builders::PostTextInputBuilder::default()
100 }
101}
102
103/// A builder for [`PostTextInput`](crate::operation::post_text::PostTextInput).
104#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
105#[non_exhaustive]
106pub struct PostTextInputBuilder {
107 pub(crate) bot_name: ::std::option::Option<::std::string::String>,
108 pub(crate) bot_alias: ::std::option::Option<::std::string::String>,
109 pub(crate) user_id: ::std::option::Option<::std::string::String>,
110 pub(crate) session_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
111 pub(crate) request_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
112 pub(crate) input_text: ::std::option::Option<::std::string::String>,
113 pub(crate) active_contexts: ::std::option::Option<::std::vec::Vec<crate::types::ActiveContext>>,
114}
115impl PostTextInputBuilder {
116 /// <p>The name of the Amazon Lex bot.</p>
117 /// This field is required.
118 pub fn bot_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119 self.bot_name = ::std::option::Option::Some(input.into());
120 self
121 }
122 /// <p>The name of the Amazon Lex bot.</p>
123 pub fn set_bot_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124 self.bot_name = input;
125 self
126 }
127 /// <p>The name of the Amazon Lex bot.</p>
128 pub fn get_bot_name(&self) -> &::std::option::Option<::std::string::String> {
129 &self.bot_name
130 }
131 /// <p>The alias of the Amazon Lex bot.</p>
132 /// This field is required.
133 pub fn bot_alias(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134 self.bot_alias = ::std::option::Option::Some(input.into());
135 self
136 }
137 /// <p>The alias of the Amazon Lex bot.</p>
138 pub fn set_bot_alias(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139 self.bot_alias = input;
140 self
141 }
142 /// <p>The alias of the Amazon Lex bot.</p>
143 pub fn get_bot_alias(&self) -> &::std::option::Option<::std::string::String> {
144 &self.bot_alias
145 }
146 /// <p>The ID of the client application user. Amazon Lex uses this to identify a user's conversation with your bot. At runtime, each request must contain the <code>userID</code> field.</p>
147 /// <p>To decide the user ID to use for your application, consider the following factors.</p>
148 /// <ul>
149 /// <li>
150 /// <p>The <code>userID</code> field must not contain any personally identifiable information of the user, for example, name, personal identification numbers, or other end user personal information.</p></li>
151 /// <li>
152 /// <p>If you want a user to start a conversation on one device and continue on another device, use a user-specific identifier.</p></li>
153 /// <li>
154 /// <p>If you want the same user to be able to have two independent conversations on two different devices, choose a device-specific identifier.</p></li>
155 /// <li>
156 /// <p>A user can't have two independent conversations with two different versions of the same bot. For example, a user can't have a conversation with the PROD and BETA versions of the same bot. If you anticipate that a user will need to have conversation with two different versions, for example, while testing, include the bot alias in the user ID to separate the two conversations.</p></li>
157 /// </ul>
158 /// This field is required.
159 pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160 self.user_id = ::std::option::Option::Some(input.into());
161 self
162 }
163 /// <p>The ID of the client application user. Amazon Lex uses this to identify a user's conversation with your bot. At runtime, each request must contain the <code>userID</code> field.</p>
164 /// <p>To decide the user ID to use for your application, consider the following factors.</p>
165 /// <ul>
166 /// <li>
167 /// <p>The <code>userID</code> field must not contain any personally identifiable information of the user, for example, name, personal identification numbers, or other end user personal information.</p></li>
168 /// <li>
169 /// <p>If you want a user to start a conversation on one device and continue on another device, use a user-specific identifier.</p></li>
170 /// <li>
171 /// <p>If you want the same user to be able to have two independent conversations on two different devices, choose a device-specific identifier.</p></li>
172 /// <li>
173 /// <p>A user can't have two independent conversations with two different versions of the same bot. For example, a user can't have a conversation with the PROD and BETA versions of the same bot. If you anticipate that a user will need to have conversation with two different versions, for example, while testing, include the bot alias in the user ID to separate the two conversations.</p></li>
174 /// </ul>
175 pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
176 self.user_id = input;
177 self
178 }
179 /// <p>The ID of the client application user. Amazon Lex uses this to identify a user's conversation with your bot. At runtime, each request must contain the <code>userID</code> field.</p>
180 /// <p>To decide the user ID to use for your application, consider the following factors.</p>
181 /// <ul>
182 /// <li>
183 /// <p>The <code>userID</code> field must not contain any personally identifiable information of the user, for example, name, personal identification numbers, or other end user personal information.</p></li>
184 /// <li>
185 /// <p>If you want a user to start a conversation on one device and continue on another device, use a user-specific identifier.</p></li>
186 /// <li>
187 /// <p>If you want the same user to be able to have two independent conversations on two different devices, choose a device-specific identifier.</p></li>
188 /// <li>
189 /// <p>A user can't have two independent conversations with two different versions of the same bot. For example, a user can't have a conversation with the PROD and BETA versions of the same bot. If you anticipate that a user will need to have conversation with two different versions, for example, while testing, include the bot alias in the user ID to separate the two conversations.</p></li>
190 /// </ul>
191 pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
192 &self.user_id
193 }
194 /// Adds a key-value pair to `session_attributes`.
195 ///
196 /// To override the contents of this collection use [`set_session_attributes`](Self::set_session_attributes).
197 ///
198 /// <p>Application-specific information passed between Amazon Lex and a client application.</p>
199 /// <p>For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-session-attribs">Setting Session Attributes</a>.</p>
200 pub fn session_attributes(
201 mut self,
202 k: impl ::std::convert::Into<::std::string::String>,
203 v: impl ::std::convert::Into<::std::string::String>,
204 ) -> Self {
205 let mut hash_map = self.session_attributes.unwrap_or_default();
206 hash_map.insert(k.into(), v.into());
207 self.session_attributes = ::std::option::Option::Some(hash_map);
208 self
209 }
210 /// <p>Application-specific information passed between Amazon Lex and a client application.</p>
211 /// <p>For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-session-attribs">Setting Session Attributes</a>.</p>
212 pub fn set_session_attributes(
213 mut self,
214 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
215 ) -> Self {
216 self.session_attributes = input;
217 self
218 }
219 /// <p>Application-specific information passed between Amazon Lex and a client application.</p>
220 /// <p>For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-session-attribs">Setting Session Attributes</a>.</p>
221 pub fn get_session_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
222 &self.session_attributes
223 }
224 /// Adds a key-value pair to `request_attributes`.
225 ///
226 /// To override the contents of this collection use [`set_request_attributes`](Self::set_request_attributes).
227 ///
228 /// <p>Request-specific information passed between Amazon Lex and a client application.</p>
229 /// <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>
230 /// <p>For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-request-attribs">Setting Request Attributes</a>.</p>
231 pub fn request_attributes(
232 mut self,
233 k: impl ::std::convert::Into<::std::string::String>,
234 v: impl ::std::convert::Into<::std::string::String>,
235 ) -> Self {
236 let mut hash_map = self.request_attributes.unwrap_or_default();
237 hash_map.insert(k.into(), v.into());
238 self.request_attributes = ::std::option::Option::Some(hash_map);
239 self
240 }
241 /// <p>Request-specific information passed between Amazon Lex and a client application.</p>
242 /// <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>
243 /// <p>For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-request-attribs">Setting Request Attributes</a>.</p>
244 pub fn set_request_attributes(
245 mut self,
246 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
247 ) -> Self {
248 self.request_attributes = input;
249 self
250 }
251 /// <p>Request-specific information passed between Amazon Lex and a client application.</p>
252 /// <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>
253 /// <p>For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-request-attribs">Setting Request Attributes</a>.</p>
254 pub fn get_request_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
255 &self.request_attributes
256 }
257 /// <p>The text that the user entered (Amazon Lex interprets this text).</p>
258 /// This field is required.
259 pub fn input_text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
260 self.input_text = ::std::option::Option::Some(input.into());
261 self
262 }
263 /// <p>The text that the user entered (Amazon Lex interprets this text).</p>
264 pub fn set_input_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
265 self.input_text = input;
266 self
267 }
268 /// <p>The text that the user entered (Amazon Lex interprets this text).</p>
269 pub fn get_input_text(&self) -> &::std::option::Option<::std::string::String> {
270 &self.input_text
271 }
272 /// Appends an item to `active_contexts`.
273 ///
274 /// To override the contents of this collection use [`set_active_contexts`](Self::set_active_contexts).
275 ///
276 /// <p>A list of contexts active for the request. A context can be activated when a previous intent is fulfilled, or by including the context in the request,</p>
277 /// <p>If you don't specify a list of contexts, Amazon Lex will use the current list of contexts for the session. If you specify an empty list, all contexts for the session are cleared.</p>
278 pub fn active_contexts(mut self, input: crate::types::ActiveContext) -> Self {
279 let mut v = self.active_contexts.unwrap_or_default();
280 v.push(input);
281 self.active_contexts = ::std::option::Option::Some(v);
282 self
283 }
284 /// <p>A list of contexts active for the request. A context can be activated when a previous intent is fulfilled, or by including the context in the request,</p>
285 /// <p>If you don't specify a list of contexts, Amazon Lex will use the current list of contexts for the session. If you specify an empty list, all contexts for the session are cleared.</p>
286 pub fn set_active_contexts(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ActiveContext>>) -> Self {
287 self.active_contexts = input;
288 self
289 }
290 /// <p>A list of contexts active for the request. A context can be activated when a previous intent is fulfilled, or by including the context in the request,</p>
291 /// <p>If you don't specify a list of contexts, Amazon Lex will use the current list of contexts for the session. If you specify an empty list, all contexts for the session are cleared.</p>
292 pub fn get_active_contexts(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ActiveContext>> {
293 &self.active_contexts
294 }
295 /// Consumes the builder and constructs a [`PostTextInput`](crate::operation::post_text::PostTextInput).
296 pub fn build(self) -> ::std::result::Result<crate::operation::post_text::PostTextInput, ::aws_smithy_types::error::operation::BuildError> {
297 ::std::result::Result::Ok(crate::operation::post_text::PostTextInput {
298 bot_name: self.bot_name,
299 bot_alias: self.bot_alias,
300 user_id: self.user_id,
301 session_attributes: self.session_attributes,
302 request_attributes: self.request_attributes,
303 input_text: self.input_text,
304 active_contexts: self.active_contexts,
305 })
306 }
307}
308impl ::std::fmt::Debug for PostTextInputBuilder {
309 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
310 let mut formatter = f.debug_struct("PostTextInputBuilder");
311 formatter.field("bot_name", &self.bot_name);
312 formatter.field("bot_alias", &self.bot_alias);
313 formatter.field("user_id", &self.user_id);
314 formatter.field("session_attributes", &"*** Sensitive Data Redacted ***");
315 formatter.field("request_attributes", &"*** Sensitive Data Redacted ***");
316 formatter.field("input_text", &"*** Sensitive Data Redacted ***");
317 formatter.field("active_contexts", &"*** Sensitive Data Redacted ***");
318 formatter.finish()
319 }
320}