aws_sdk_lexruntimev2/operation/recognize_utterance/_recognize_utterance_output.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::fmt::Debug)]
5pub struct RecognizeUtteranceOutput {
6 /// <p>Indicates whether the input mode to the operation was text, speech, or from a touch-tone keypad.</p>
7 pub input_mode: ::std::option::Option<::std::string::String>,
8 /// <p>Content type as specified in the <code>responseContentType</code> in the request.</p>
9 pub content_type: ::std::option::Option<::std::string::String>,
10 /// <p>A list of messages that were last sent to the user. The messages are ordered based on the order that you returned the messages from your Lambda function or the order that the messages are defined in the bot.</p>
11 /// <p>The <code>messages</code> field is compressed with gzip and then base64 encoded. Before you can use the contents of the field, you must decode and decompress the contents. See the example for a simple function to decode and decompress the contents.</p>
12 pub messages: ::std::option::Option<::std::string::String>,
13 /// <p>A list of intents that Amazon Lex V2 determined might satisfy the user's utterance.</p>
14 /// <p>Each interpretation includes the intent, a score that indicates how confident Amazon Lex V2 is that the interpretation is the correct one, and an optional sentiment response that indicates the sentiment expressed in the utterance.</p>
15 /// <p>The <code>interpretations</code> field is compressed with gzip and then base64 encoded. Before you can use the contents of the field, you must decode and decompress the contents. See the example for a simple function to decode and decompress the contents.</p>
16 pub interpretations: ::std::option::Option<::std::string::String>,
17 /// <p>Represents the current state of the dialog between the user and the bot.</p>
18 /// <p>Use this to determine the progress of the conversation and what the next action might be.</p>
19 /// <p>The <code>sessionState</code> field is compressed with gzip and then base64 encoded. Before you can use the contents of the field, you must decode and decompress the contents. See the example for a simple function to decode and decompress the contents.</p>
20 pub session_state: ::std::option::Option<::std::string::String>,
21 /// <p>The attributes sent in the request.</p>
22 /// <p>The <code>requestAttributes</code> field is compressed with gzip and then base64 encoded. Before you can use the contents of the field, you must decode and decompress the contents.</p>
23 pub request_attributes: ::std::option::Option<::std::string::String>,
24 /// <p>The identifier of the session in use.</p>
25 pub session_id: ::std::option::Option<::std::string::String>,
26 /// <p>The text used to process the request.</p>
27 /// <p>If the input was an audio stream, the <code>inputTranscript</code> field contains the text extracted from the audio stream. This is the text that is actually processed to recognize intents and slot values. You can use this information to determine if Amazon Lex V2 is correctly processing the audio that you send.</p>
28 /// <p>The <code>inputTranscript</code> field is compressed with gzip and then base64 encoded. Before you can use the contents of the field, you must decode and decompress the contents. See the example for a simple function to decode and decompress the contents.</p>
29 pub input_transcript: ::std::option::Option<::std::string::String>,
30 /// <p>The prompt or statement to send to the user. This is based on the bot configuration and context. For example, if Amazon Lex V2 did not understand the user intent, it sends the <code>clarificationPrompt</code> configured for the bot. If the intent requires confirmation before taking the fulfillment action, it sends the <code>confirmationPrompt</code>. Another example: Suppose that the Lambda function successfully fulfilled the intent, and sent a message to convey to the user. Then Amazon Lex V2 sends that message in the response.</p>
31 pub audio_stream: ::aws_smithy_types::byte_stream::ByteStream,
32 /// <p>The bot member that recognized the utterance.</p>
33 pub recognized_bot_member: ::std::option::Option<::std::string::String>,
34 _request_id: Option<String>,
35}
36impl RecognizeUtteranceOutput {
37 /// <p>Indicates whether the input mode to the operation was text, speech, or from a touch-tone keypad.</p>
38 pub fn input_mode(&self) -> ::std::option::Option<&str> {
39 self.input_mode.as_deref()
40 }
41 /// <p>Content type as specified in the <code>responseContentType</code> in the request.</p>
42 pub fn content_type(&self) -> ::std::option::Option<&str> {
43 self.content_type.as_deref()
44 }
45 /// <p>A list of messages that were last sent to the user. The messages are ordered based on the order that you returned the messages from your Lambda function or the order that the messages are defined in the bot.</p>
46 /// <p>The <code>messages</code> field is compressed with gzip and then base64 encoded. Before you can use the contents of the field, you must decode and decompress the contents. See the example for a simple function to decode and decompress the contents.</p>
47 pub fn messages(&self) -> ::std::option::Option<&str> {
48 self.messages.as_deref()
49 }
50 /// <p>A list of intents that Amazon Lex V2 determined might satisfy the user's utterance.</p>
51 /// <p>Each interpretation includes the intent, a score that indicates how confident Amazon Lex V2 is that the interpretation is the correct one, and an optional sentiment response that indicates the sentiment expressed in the utterance.</p>
52 /// <p>The <code>interpretations</code> field is compressed with gzip and then base64 encoded. Before you can use the contents of the field, you must decode and decompress the contents. See the example for a simple function to decode and decompress the contents.</p>
53 pub fn interpretations(&self) -> ::std::option::Option<&str> {
54 self.interpretations.as_deref()
55 }
56 /// <p>Represents the current state of the dialog between the user and the bot.</p>
57 /// <p>Use this to determine the progress of the conversation and what the next action might be.</p>
58 /// <p>The <code>sessionState</code> field is compressed with gzip and then base64 encoded. Before you can use the contents of the field, you must decode and decompress the contents. See the example for a simple function to decode and decompress the contents.</p>
59 pub fn session_state(&self) -> ::std::option::Option<&str> {
60 self.session_state.as_deref()
61 }
62 /// <p>The attributes sent in the request.</p>
63 /// <p>The <code>requestAttributes</code> field is compressed with gzip and then base64 encoded. Before you can use the contents of the field, you must decode and decompress the contents.</p>
64 pub fn request_attributes(&self) -> ::std::option::Option<&str> {
65 self.request_attributes.as_deref()
66 }
67 /// <p>The identifier of the session in use.</p>
68 pub fn session_id(&self) -> ::std::option::Option<&str> {
69 self.session_id.as_deref()
70 }
71 /// <p>The text used to process the request.</p>
72 /// <p>If the input was an audio stream, the <code>inputTranscript</code> field contains the text extracted from the audio stream. This is the text that is actually processed to recognize intents and slot values. You can use this information to determine if Amazon Lex V2 is correctly processing the audio that you send.</p>
73 /// <p>The <code>inputTranscript</code> field is compressed with gzip and then base64 encoded. Before you can use the contents of the field, you must decode and decompress the contents. See the example for a simple function to decode and decompress the contents.</p>
74 pub fn input_transcript(&self) -> ::std::option::Option<&str> {
75 self.input_transcript.as_deref()
76 }
77 /// <p>The prompt or statement to send to the user. This is based on the bot configuration and context. For example, if Amazon Lex V2 did not understand the user intent, it sends the <code>clarificationPrompt</code> configured for the bot. If the intent requires confirmation before taking the fulfillment action, it sends the <code>confirmationPrompt</code>. Another example: Suppose that the Lambda function successfully fulfilled the intent, and sent a message to convey to the user. Then Amazon Lex V2 sends that message in the response.</p>
78 pub fn audio_stream(&self) -> &::aws_smithy_types::byte_stream::ByteStream {
79 &self.audio_stream
80 }
81 /// <p>The bot member that recognized the utterance.</p>
82 pub fn recognized_bot_member(&self) -> ::std::option::Option<&str> {
83 self.recognized_bot_member.as_deref()
84 }
85}
86impl ::aws_types::request_id::RequestId for RecognizeUtteranceOutput {
87 fn request_id(&self) -> Option<&str> {
88 self._request_id.as_deref()
89 }
90}
91impl RecognizeUtteranceOutput {
92 /// Creates a new builder-style object to manufacture [`RecognizeUtteranceOutput`](crate::operation::recognize_utterance::RecognizeUtteranceOutput).
93 pub fn builder() -> crate::operation::recognize_utterance::builders::RecognizeUtteranceOutputBuilder {
94 crate::operation::recognize_utterance::builders::RecognizeUtteranceOutputBuilder::default()
95 }
96}
97
98/// A builder for [`RecognizeUtteranceOutput`](crate::operation::recognize_utterance::RecognizeUtteranceOutput).
99#[derive(::std::default::Default, ::std::fmt::Debug)]
100#[non_exhaustive]
101pub struct RecognizeUtteranceOutputBuilder {
102 pub(crate) input_mode: ::std::option::Option<::std::string::String>,
103 pub(crate) content_type: ::std::option::Option<::std::string::String>,
104 pub(crate) messages: ::std::option::Option<::std::string::String>,
105 pub(crate) interpretations: ::std::option::Option<::std::string::String>,
106 pub(crate) session_state: ::std::option::Option<::std::string::String>,
107 pub(crate) request_attributes: ::std::option::Option<::std::string::String>,
108 pub(crate) session_id: ::std::option::Option<::std::string::String>,
109 pub(crate) input_transcript: ::std::option::Option<::std::string::String>,
110 pub(crate) audio_stream: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>,
111 pub(crate) recognized_bot_member: ::std::option::Option<::std::string::String>,
112 _request_id: Option<String>,
113}
114impl RecognizeUtteranceOutputBuilder {
115 /// <p>Indicates whether the input mode to the operation was text, speech, or from a touch-tone keypad.</p>
116 pub fn input_mode(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117 self.input_mode = ::std::option::Option::Some(input.into());
118 self
119 }
120 /// <p>Indicates whether the input mode to the operation was text, speech, or from a touch-tone keypad.</p>
121 pub fn set_input_mode(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122 self.input_mode = input;
123 self
124 }
125 /// <p>Indicates whether the input mode to the operation was text, speech, or from a touch-tone keypad.</p>
126 pub fn get_input_mode(&self) -> &::std::option::Option<::std::string::String> {
127 &self.input_mode
128 }
129 /// <p>Content type as specified in the <code>responseContentType</code> in the request.</p>
130 pub fn content_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131 self.content_type = ::std::option::Option::Some(input.into());
132 self
133 }
134 /// <p>Content type as specified in the <code>responseContentType</code> in the request.</p>
135 pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136 self.content_type = input;
137 self
138 }
139 /// <p>Content type as specified in the <code>responseContentType</code> in the request.</p>
140 pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
141 &self.content_type
142 }
143 /// <p>A list of messages that were last sent to the user. The messages are ordered based on the order that you returned the messages from your Lambda function or the order that the messages are defined in the bot.</p>
144 /// <p>The <code>messages</code> field is compressed with gzip and then base64 encoded. Before you can use the contents of the field, you must decode and decompress the contents. See the example for a simple function to decode and decompress the contents.</p>
145 pub fn messages(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146 self.messages = ::std::option::Option::Some(input.into());
147 self
148 }
149 /// <p>A list of messages that were last sent to the user. The messages are ordered based on the order that you returned the messages from your Lambda function or the order that the messages are defined in the bot.</p>
150 /// <p>The <code>messages</code> field is compressed with gzip and then base64 encoded. Before you can use the contents of the field, you must decode and decompress the contents. See the example for a simple function to decode and decompress the contents.</p>
151 pub fn set_messages(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152 self.messages = input;
153 self
154 }
155 /// <p>A list of messages that were last sent to the user. The messages are ordered based on the order that you returned the messages from your Lambda function or the order that the messages are defined in the bot.</p>
156 /// <p>The <code>messages</code> field is compressed with gzip and then base64 encoded. Before you can use the contents of the field, you must decode and decompress the contents. See the example for a simple function to decode and decompress the contents.</p>
157 pub fn get_messages(&self) -> &::std::option::Option<::std::string::String> {
158 &self.messages
159 }
160 /// <p>A list of intents that Amazon Lex V2 determined might satisfy the user's utterance.</p>
161 /// <p>Each interpretation includes the intent, a score that indicates how confident Amazon Lex V2 is that the interpretation is the correct one, and an optional sentiment response that indicates the sentiment expressed in the utterance.</p>
162 /// <p>The <code>interpretations</code> field is compressed with gzip and then base64 encoded. Before you can use the contents of the field, you must decode and decompress the contents. See the example for a simple function to decode and decompress the contents.</p>
163 pub fn interpretations(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
164 self.interpretations = ::std::option::Option::Some(input.into());
165 self
166 }
167 /// <p>A list of intents that Amazon Lex V2 determined might satisfy the user's utterance.</p>
168 /// <p>Each interpretation includes the intent, a score that indicates how confident Amazon Lex V2 is that the interpretation is the correct one, and an optional sentiment response that indicates the sentiment expressed in the utterance.</p>
169 /// <p>The <code>interpretations</code> field is compressed with gzip and then base64 encoded. Before you can use the contents of the field, you must decode and decompress the contents. See the example for a simple function to decode and decompress the contents.</p>
170 pub fn set_interpretations(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
171 self.interpretations = input;
172 self
173 }
174 /// <p>A list of intents that Amazon Lex V2 determined might satisfy the user's utterance.</p>
175 /// <p>Each interpretation includes the intent, a score that indicates how confident Amazon Lex V2 is that the interpretation is the correct one, and an optional sentiment response that indicates the sentiment expressed in the utterance.</p>
176 /// <p>The <code>interpretations</code> field is compressed with gzip and then base64 encoded. Before you can use the contents of the field, you must decode and decompress the contents. See the example for a simple function to decode and decompress the contents.</p>
177 pub fn get_interpretations(&self) -> &::std::option::Option<::std::string::String> {
178 &self.interpretations
179 }
180 /// <p>Represents the current state of the dialog between the user and the bot.</p>
181 /// <p>Use this to determine the progress of the conversation and what the next action might be.</p>
182 /// <p>The <code>sessionState</code> field is compressed with gzip and then base64 encoded. Before you can use the contents of the field, you must decode and decompress the contents. See the example for a simple function to decode and decompress the contents.</p>
183 pub fn session_state(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
184 self.session_state = ::std::option::Option::Some(input.into());
185 self
186 }
187 /// <p>Represents the current state of the dialog between the user and the bot.</p>
188 /// <p>Use this to determine the progress of the conversation and what the next action might be.</p>
189 /// <p>The <code>sessionState</code> field is compressed with gzip and then base64 encoded. Before you can use the contents of the field, you must decode and decompress the contents. See the example for a simple function to decode and decompress the contents.</p>
190 pub fn set_session_state(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
191 self.session_state = input;
192 self
193 }
194 /// <p>Represents the current state of the dialog between the user and the bot.</p>
195 /// <p>Use this to determine the progress of the conversation and what the next action might be.</p>
196 /// <p>The <code>sessionState</code> field is compressed with gzip and then base64 encoded. Before you can use the contents of the field, you must decode and decompress the contents. See the example for a simple function to decode and decompress the contents.</p>
197 pub fn get_session_state(&self) -> &::std::option::Option<::std::string::String> {
198 &self.session_state
199 }
200 /// <p>The attributes sent in the request.</p>
201 /// <p>The <code>requestAttributes</code> field is compressed with gzip and then base64 encoded. Before you can use the contents of the field, you must decode and decompress the contents.</p>
202 pub fn request_attributes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
203 self.request_attributes = ::std::option::Option::Some(input.into());
204 self
205 }
206 /// <p>The attributes sent in the request.</p>
207 /// <p>The <code>requestAttributes</code> field is compressed with gzip and then base64 encoded. Before you can use the contents of the field, you must decode and decompress the contents.</p>
208 pub fn set_request_attributes(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
209 self.request_attributes = input;
210 self
211 }
212 /// <p>The attributes sent in the request.</p>
213 /// <p>The <code>requestAttributes</code> field is compressed with gzip and then base64 encoded. Before you can use the contents of the field, you must decode and decompress the contents.</p>
214 pub fn get_request_attributes(&self) -> &::std::option::Option<::std::string::String> {
215 &self.request_attributes
216 }
217 /// <p>The identifier of the session in use.</p>
218 pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
219 self.session_id = ::std::option::Option::Some(input.into());
220 self
221 }
222 /// <p>The identifier of the session in use.</p>
223 pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
224 self.session_id = input;
225 self
226 }
227 /// <p>The identifier of the session in use.</p>
228 pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
229 &self.session_id
230 }
231 /// <p>The text used to process the request.</p>
232 /// <p>If the input was an audio stream, the <code>inputTranscript</code> field contains the text extracted from the audio stream. This is the text that is actually processed to recognize intents and slot values. You can use this information to determine if Amazon Lex V2 is correctly processing the audio that you send.</p>
233 /// <p>The <code>inputTranscript</code> field is compressed with gzip and then base64 encoded. Before you can use the contents of the field, you must decode and decompress the contents. See the example for a simple function to decode and decompress the contents.</p>
234 pub fn input_transcript(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
235 self.input_transcript = ::std::option::Option::Some(input.into());
236 self
237 }
238 /// <p>The text used to process the request.</p>
239 /// <p>If the input was an audio stream, the <code>inputTranscript</code> field contains the text extracted from the audio stream. This is the text that is actually processed to recognize intents and slot values. You can use this information to determine if Amazon Lex V2 is correctly processing the audio that you send.</p>
240 /// <p>The <code>inputTranscript</code> field is compressed with gzip and then base64 encoded. Before you can use the contents of the field, you must decode and decompress the contents. See the example for a simple function to decode and decompress the contents.</p>
241 pub fn set_input_transcript(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
242 self.input_transcript = input;
243 self
244 }
245 /// <p>The text used to process the request.</p>
246 /// <p>If the input was an audio stream, the <code>inputTranscript</code> field contains the text extracted from the audio stream. This is the text that is actually processed to recognize intents and slot values. You can use this information to determine if Amazon Lex V2 is correctly processing the audio that you send.</p>
247 /// <p>The <code>inputTranscript</code> field is compressed with gzip and then base64 encoded. Before you can use the contents of the field, you must decode and decompress the contents. See the example for a simple function to decode and decompress the contents.</p>
248 pub fn get_input_transcript(&self) -> &::std::option::Option<::std::string::String> {
249 &self.input_transcript
250 }
251 /// <p>The prompt or statement to send to the user. This is based on the bot configuration and context. For example, if Amazon Lex V2 did not understand the user intent, it sends the <code>clarificationPrompt</code> configured for the bot. If the intent requires confirmation before taking the fulfillment action, it sends the <code>confirmationPrompt</code>. Another example: Suppose that the Lambda function successfully fulfilled the intent, and sent a message to convey to the user. Then Amazon Lex V2 sends that message in the response.</p>
252 pub fn audio_stream(mut self, input: ::aws_smithy_types::byte_stream::ByteStream) -> Self {
253 self.audio_stream = ::std::option::Option::Some(input);
254 self
255 }
256 /// <p>The prompt or statement to send to the user. This is based on the bot configuration and context. For example, if Amazon Lex V2 did not understand the user intent, it sends the <code>clarificationPrompt</code> configured for the bot. If the intent requires confirmation before taking the fulfillment action, it sends the <code>confirmationPrompt</code>. Another example: Suppose that the Lambda function successfully fulfilled the intent, and sent a message to convey to the user. Then Amazon Lex V2 sends that message in the response.</p>
257 pub fn set_audio_stream(mut self, input: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>) -> Self {
258 self.audio_stream = input;
259 self
260 }
261 /// <p>The prompt or statement to send to the user. This is based on the bot configuration and context. For example, if Amazon Lex V2 did not understand the user intent, it sends the <code>clarificationPrompt</code> configured for the bot. If the intent requires confirmation before taking the fulfillment action, it sends the <code>confirmationPrompt</code>. Another example: Suppose that the Lambda function successfully fulfilled the intent, and sent a message to convey to the user. Then Amazon Lex V2 sends that message in the response.</p>
262 pub fn get_audio_stream(&self) -> &::std::option::Option<::aws_smithy_types::byte_stream::ByteStream> {
263 &self.audio_stream
264 }
265 /// <p>The bot member that recognized the utterance.</p>
266 pub fn recognized_bot_member(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
267 self.recognized_bot_member = ::std::option::Option::Some(input.into());
268 self
269 }
270 /// <p>The bot member that recognized the utterance.</p>
271 pub fn set_recognized_bot_member(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
272 self.recognized_bot_member = input;
273 self
274 }
275 /// <p>The bot member that recognized the utterance.</p>
276 pub fn get_recognized_bot_member(&self) -> &::std::option::Option<::std::string::String> {
277 &self.recognized_bot_member
278 }
279 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
280 self._request_id = Some(request_id.into());
281 self
282 }
283
284 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
285 self._request_id = request_id;
286 self
287 }
288 /// Consumes the builder and constructs a [`RecognizeUtteranceOutput`](crate::operation::recognize_utterance::RecognizeUtteranceOutput).
289 pub fn build(self) -> crate::operation::recognize_utterance::RecognizeUtteranceOutput {
290 crate::operation::recognize_utterance::RecognizeUtteranceOutput {
291 input_mode: self.input_mode,
292 content_type: self.content_type,
293 messages: self.messages,
294 interpretations: self.interpretations,
295 session_state: self.session_state,
296 request_attributes: self.request_attributes,
297 session_id: self.session_id,
298 input_transcript: self.input_transcript,
299 audio_stream: self.audio_stream.unwrap_or_default(),
300 recognized_bot_member: self.recognized_bot_member,
301 _request_id: self._request_id,
302 }
303 }
304}