aws_sdk_lexruntime/operation/post_content/_post_content_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]
4pub struct PostContentInput {
5 /// <p>Name of the Amazon Lex bot.</p>
6 pub bot_name: ::std::option::Option<::std::string::String>,
7 /// <p>Alias of the Amazon Lex bot.</p>
8 pub bot_alias: ::std::option::Option<::std::string::String>,
9 /// <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>
10 /// <p>To decide the user ID to use for your application, consider the following factors.</p>
11 /// <ul>
12 /// <li>
13 /// <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>
14 /// <li>
15 /// <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>
16 /// <li>
17 /// <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>
18 /// <li>
19 /// <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>
20 /// </ul>
21 pub user_id: ::std::option::Option<::std::string::String>,
22 /// <p>You pass this value as the <code>x-amz-lex-session-attributes</code> HTTP header.</p>
23 /// <p>Application-specific information passed between Amazon Lex and a client application. The value must be a JSON serialized and base64 encoded map with string keys and values. The total size of the <code>sessionAttributes</code> and <code>requestAttributes</code> headers is limited to 12 KB.</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::string::String>,
26 /// <p>You pass this value as the <code>x-amz-lex-request-attributes</code> HTTP header.</p>
27 /// <p>Request-specific information passed between Amazon Lex and a client application. The value must be a JSON serialized and base64 encoded map with string keys and values. The total size of the <code>requestAttributes</code> and <code>sessionAttributes</code> headers is limited to 12 KB.</p>
28 /// <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>
29 /// <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>
30 pub request_attributes: ::std::option::Option<::std::string::String>,
31 /// <p>You pass this value as the <code>Content-Type</code> HTTP header.</p>
32 /// <p>Indicates the audio format or text. The header value must start with one of the following prefixes:</p>
33 /// <ul>
34 /// <li>
35 /// <p>PCM format, audio data must be in little-endian byte order.</p>
36 /// <ul>
37 /// <li>
38 /// <p>audio/l16; rate=16000; channels=1</p></li>
39 /// <li>
40 /// <p>audio/x-l16; sample-rate=16000; channel-count=1</p></li>
41 /// <li>
42 /// <p>audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1; is-big-endian=false</p></li>
43 /// </ul></li>
44 /// <li>
45 /// <p>Opus format</p>
46 /// <ul>
47 /// <li>
48 /// <p>audio/x-cbr-opus-with-preamble; preamble-size=0; bit-rate=256000; frame-size-milliseconds=4</p></li>
49 /// </ul></li>
50 /// <li>
51 /// <p>Text format</p>
52 /// <ul>
53 /// <li>
54 /// <p>text/plain; charset=utf-8</p></li>
55 /// </ul></li>
56 /// </ul>
57 pub content_type: ::std::option::Option<::std::string::String>,
58 /// <p>You pass this value as the <code>Accept</code> HTTP header.</p>
59 /// <p>The message Amazon Lex returns in the response can be either text or speech based on the <code>Accept</code> HTTP header value in the request.</p>
60 /// <ul>
61 /// <li>
62 /// <p>If the value is <code>text/plain; charset=utf-8</code>, Amazon Lex returns text in the response.</p></li>
63 /// <li>
64 /// <p>If the value begins with <code>audio/</code>, Amazon Lex returns speech in the response. Amazon Lex uses Amazon Polly to generate the speech (using the configuration you specified in the <code>Accept</code> header). For example, if you specify <code>audio/mpeg</code> as the value, Amazon Lex returns speech in the MPEG format.</p></li>
65 /// <li>
66 /// <p>If the value is <code>audio/pcm</code>, the speech returned is <code>audio/pcm</code> in 16-bit, little endian format.</p></li>
67 /// <li>
68 /// <p>The following are the accepted values:</p>
69 /// <ul>
70 /// <li>
71 /// <p>audio/mpeg</p></li>
72 /// <li>
73 /// <p>audio/ogg</p></li>
74 /// <li>
75 /// <p>audio/pcm</p></li>
76 /// <li>
77 /// <p>text/plain; charset=utf-8</p></li>
78 /// <li>
79 /// <p>audio/* (defaults to mpeg)</p></li>
80 /// </ul></li>
81 /// </ul>
82 pub accept: ::std::option::Option<::std::string::String>,
83 /// <p>User input in PCM or Opus audio format or text format as described in the <code>Content-Type</code> HTTP header.</p>
84 /// <p>You can stream audio data to Amazon Lex or you can create a local buffer that captures all of the audio data before sending. In general, you get better performance if you stream audio data rather than buffering the data locally.</p>
85 pub input_stream: ::aws_smithy_types::byte_stream::ByteStream,
86 /// <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>
87 /// <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>
88 pub active_contexts: ::std::option::Option<::std::string::String>,
89}
90impl PostContentInput {
91 /// <p>Name of the Amazon Lex bot.</p>
92 pub fn bot_name(&self) -> ::std::option::Option<&str> {
93 self.bot_name.as_deref()
94 }
95 /// <p>Alias of the Amazon Lex bot.</p>
96 pub fn bot_alias(&self) -> ::std::option::Option<&str> {
97 self.bot_alias.as_deref()
98 }
99 /// <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>
100 /// <p>To decide the user ID to use for your application, consider the following factors.</p>
101 /// <ul>
102 /// <li>
103 /// <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>
104 /// <li>
105 /// <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>
106 /// <li>
107 /// <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>
108 /// <li>
109 /// <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>
110 /// </ul>
111 pub fn user_id(&self) -> ::std::option::Option<&str> {
112 self.user_id.as_deref()
113 }
114 /// <p>You pass this value as the <code>x-amz-lex-session-attributes</code> HTTP header.</p>
115 /// <p>Application-specific information passed between Amazon Lex and a client application. The value must be a JSON serialized and base64 encoded map with string keys and values. The total size of the <code>sessionAttributes</code> and <code>requestAttributes</code> headers is limited to 12 KB.</p>
116 /// <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>
117 pub fn session_attributes(&self) -> ::std::option::Option<&str> {
118 self.session_attributes.as_deref()
119 }
120 /// <p>You pass this value as the <code>x-amz-lex-request-attributes</code> HTTP header.</p>
121 /// <p>Request-specific information passed between Amazon Lex and a client application. The value must be a JSON serialized and base64 encoded map with string keys and values. The total size of the <code>requestAttributes</code> and <code>sessionAttributes</code> headers is limited to 12 KB.</p>
122 /// <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>
123 /// <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>
124 pub fn request_attributes(&self) -> ::std::option::Option<&str> {
125 self.request_attributes.as_deref()
126 }
127 /// <p>You pass this value as the <code>Content-Type</code> HTTP header.</p>
128 /// <p>Indicates the audio format or text. The header value must start with one of the following prefixes:</p>
129 /// <ul>
130 /// <li>
131 /// <p>PCM format, audio data must be in little-endian byte order.</p>
132 /// <ul>
133 /// <li>
134 /// <p>audio/l16; rate=16000; channels=1</p></li>
135 /// <li>
136 /// <p>audio/x-l16; sample-rate=16000; channel-count=1</p></li>
137 /// <li>
138 /// <p>audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1; is-big-endian=false</p></li>
139 /// </ul></li>
140 /// <li>
141 /// <p>Opus format</p>
142 /// <ul>
143 /// <li>
144 /// <p>audio/x-cbr-opus-with-preamble; preamble-size=0; bit-rate=256000; frame-size-milliseconds=4</p></li>
145 /// </ul></li>
146 /// <li>
147 /// <p>Text format</p>
148 /// <ul>
149 /// <li>
150 /// <p>text/plain; charset=utf-8</p></li>
151 /// </ul></li>
152 /// </ul>
153 pub fn content_type(&self) -> ::std::option::Option<&str> {
154 self.content_type.as_deref()
155 }
156 /// <p>You pass this value as the <code>Accept</code> HTTP header.</p>
157 /// <p>The message Amazon Lex returns in the response can be either text or speech based on the <code>Accept</code> HTTP header value in the request.</p>
158 /// <ul>
159 /// <li>
160 /// <p>If the value is <code>text/plain; charset=utf-8</code>, Amazon Lex returns text in the response.</p></li>
161 /// <li>
162 /// <p>If the value begins with <code>audio/</code>, Amazon Lex returns speech in the response. Amazon Lex uses Amazon Polly to generate the speech (using the configuration you specified in the <code>Accept</code> header). For example, if you specify <code>audio/mpeg</code> as the value, Amazon Lex returns speech in the MPEG format.</p></li>
163 /// <li>
164 /// <p>If the value is <code>audio/pcm</code>, the speech returned is <code>audio/pcm</code> in 16-bit, little endian format.</p></li>
165 /// <li>
166 /// <p>The following are the accepted values:</p>
167 /// <ul>
168 /// <li>
169 /// <p>audio/mpeg</p></li>
170 /// <li>
171 /// <p>audio/ogg</p></li>
172 /// <li>
173 /// <p>audio/pcm</p></li>
174 /// <li>
175 /// <p>text/plain; charset=utf-8</p></li>
176 /// <li>
177 /// <p>audio/* (defaults to mpeg)</p></li>
178 /// </ul></li>
179 /// </ul>
180 pub fn accept(&self) -> ::std::option::Option<&str> {
181 self.accept.as_deref()
182 }
183 /// <p>User input in PCM or Opus audio format or text format as described in the <code>Content-Type</code> HTTP header.</p>
184 /// <p>You can stream audio data to Amazon Lex or you can create a local buffer that captures all of the audio data before sending. In general, you get better performance if you stream audio data rather than buffering the data locally.</p>
185 pub fn input_stream(&self) -> &::aws_smithy_types::byte_stream::ByteStream {
186 &self.input_stream
187 }
188 /// <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>
189 /// <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>
190 pub fn active_contexts(&self) -> ::std::option::Option<&str> {
191 self.active_contexts.as_deref()
192 }
193}
194impl ::std::fmt::Debug for PostContentInput {
195 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
196 let mut formatter = f.debug_struct("PostContentInput");
197 formatter.field("bot_name", &self.bot_name);
198 formatter.field("bot_alias", &self.bot_alias);
199 formatter.field("user_id", &self.user_id);
200 formatter.field("session_attributes", &"*** Sensitive Data Redacted ***");
201 formatter.field("request_attributes", &"*** Sensitive Data Redacted ***");
202 formatter.field("content_type", &self.content_type);
203 formatter.field("accept", &self.accept);
204 formatter.field("input_stream", &self.input_stream);
205 formatter.field("active_contexts", &"*** Sensitive Data Redacted ***");
206 formatter.finish()
207 }
208}
209impl PostContentInput {
210 /// Creates a new builder-style object to manufacture [`PostContentInput`](crate::operation::post_content::PostContentInput).
211 pub fn builder() -> crate::operation::post_content::builders::PostContentInputBuilder {
212 crate::operation::post_content::builders::PostContentInputBuilder::default()
213 }
214}
215
216/// A builder for [`PostContentInput`](crate::operation::post_content::PostContentInput).
217#[derive(::std::default::Default)]
218#[non_exhaustive]
219pub struct PostContentInputBuilder {
220 pub(crate) bot_name: ::std::option::Option<::std::string::String>,
221 pub(crate) bot_alias: ::std::option::Option<::std::string::String>,
222 pub(crate) user_id: ::std::option::Option<::std::string::String>,
223 pub(crate) session_attributes: ::std::option::Option<::std::string::String>,
224 pub(crate) request_attributes: ::std::option::Option<::std::string::String>,
225 pub(crate) content_type: ::std::option::Option<::std::string::String>,
226 pub(crate) accept: ::std::option::Option<::std::string::String>,
227 pub(crate) input_stream: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>,
228 pub(crate) active_contexts: ::std::option::Option<::std::string::String>,
229}
230impl PostContentInputBuilder {
231 /// <p>Name of the Amazon Lex bot.</p>
232 /// This field is required.
233 pub fn bot_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
234 self.bot_name = ::std::option::Option::Some(input.into());
235 self
236 }
237 /// <p>Name of the Amazon Lex bot.</p>
238 pub fn set_bot_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
239 self.bot_name = input;
240 self
241 }
242 /// <p>Name of the Amazon Lex bot.</p>
243 pub fn get_bot_name(&self) -> &::std::option::Option<::std::string::String> {
244 &self.bot_name
245 }
246 /// <p>Alias of the Amazon Lex bot.</p>
247 /// This field is required.
248 pub fn bot_alias(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
249 self.bot_alias = ::std::option::Option::Some(input.into());
250 self
251 }
252 /// <p>Alias of the Amazon Lex bot.</p>
253 pub fn set_bot_alias(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
254 self.bot_alias = input;
255 self
256 }
257 /// <p>Alias of the Amazon Lex bot.</p>
258 pub fn get_bot_alias(&self) -> &::std::option::Option<::std::string::String> {
259 &self.bot_alias
260 }
261 /// <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>
262 /// <p>To decide the user ID to use for your application, consider the following factors.</p>
263 /// <ul>
264 /// <li>
265 /// <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>
266 /// <li>
267 /// <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>
268 /// <li>
269 /// <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>
270 /// <li>
271 /// <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>
272 /// </ul>
273 /// This field is required.
274 pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
275 self.user_id = ::std::option::Option::Some(input.into());
276 self
277 }
278 /// <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>
279 /// <p>To decide the user ID to use for your application, consider the following factors.</p>
280 /// <ul>
281 /// <li>
282 /// <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>
283 /// <li>
284 /// <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>
285 /// <li>
286 /// <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>
287 /// <li>
288 /// <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>
289 /// </ul>
290 pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
291 self.user_id = input;
292 self
293 }
294 /// <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>
295 /// <p>To decide the user ID to use for your application, consider the following factors.</p>
296 /// <ul>
297 /// <li>
298 /// <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>
299 /// <li>
300 /// <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>
301 /// <li>
302 /// <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>
303 /// <li>
304 /// <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>
305 /// </ul>
306 pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
307 &self.user_id
308 }
309 /// <p>You pass this value as the <code>x-amz-lex-session-attributes</code> HTTP header.</p>
310 /// <p>Application-specific information passed between Amazon Lex and a client application. The value must be a JSON serialized and base64 encoded map with string keys and values. The total size of the <code>sessionAttributes</code> and <code>requestAttributes</code> headers is limited to 12 KB.</p>
311 /// <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>
312 pub fn session_attributes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
313 self.session_attributes = ::std::option::Option::Some(input.into());
314 self
315 }
316 /// <p>You pass this value as the <code>x-amz-lex-session-attributes</code> HTTP header.</p>
317 /// <p>Application-specific information passed between Amazon Lex and a client application. The value must be a JSON serialized and base64 encoded map with string keys and values. The total size of the <code>sessionAttributes</code> and <code>requestAttributes</code> headers is limited to 12 KB.</p>
318 /// <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>
319 pub fn set_session_attributes(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
320 self.session_attributes = input;
321 self
322 }
323 /// <p>You pass this value as the <code>x-amz-lex-session-attributes</code> HTTP header.</p>
324 /// <p>Application-specific information passed between Amazon Lex and a client application. The value must be a JSON serialized and base64 encoded map with string keys and values. The total size of the <code>sessionAttributes</code> and <code>requestAttributes</code> headers is limited to 12 KB.</p>
325 /// <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>
326 pub fn get_session_attributes(&self) -> &::std::option::Option<::std::string::String> {
327 &self.session_attributes
328 }
329 /// <p>You pass this value as the <code>x-amz-lex-request-attributes</code> HTTP header.</p>
330 /// <p>Request-specific information passed between Amazon Lex and a client application. The value must be a JSON serialized and base64 encoded map with string keys and values. The total size of the <code>requestAttributes</code> and <code>sessionAttributes</code> headers is limited to 12 KB.</p>
331 /// <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>
332 /// <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>
333 pub fn request_attributes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
334 self.request_attributes = ::std::option::Option::Some(input.into());
335 self
336 }
337 /// <p>You pass this value as the <code>x-amz-lex-request-attributes</code> HTTP header.</p>
338 /// <p>Request-specific information passed between Amazon Lex and a client application. The value must be a JSON serialized and base64 encoded map with string keys and values. The total size of the <code>requestAttributes</code> and <code>sessionAttributes</code> headers is limited to 12 KB.</p>
339 /// <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>
340 /// <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>
341 pub fn set_request_attributes(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
342 self.request_attributes = input;
343 self
344 }
345 /// <p>You pass this value as the <code>x-amz-lex-request-attributes</code> HTTP header.</p>
346 /// <p>Request-specific information passed between Amazon Lex and a client application. The value must be a JSON serialized and base64 encoded map with string keys and values. The total size of the <code>requestAttributes</code> and <code>sessionAttributes</code> headers is limited to 12 KB.</p>
347 /// <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>
348 /// <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>
349 pub fn get_request_attributes(&self) -> &::std::option::Option<::std::string::String> {
350 &self.request_attributes
351 }
352 /// <p>You pass this value as the <code>Content-Type</code> HTTP header.</p>
353 /// <p>Indicates the audio format or text. The header value must start with one of the following prefixes:</p>
354 /// <ul>
355 /// <li>
356 /// <p>PCM format, audio data must be in little-endian byte order.</p>
357 /// <ul>
358 /// <li>
359 /// <p>audio/l16; rate=16000; channels=1</p></li>
360 /// <li>
361 /// <p>audio/x-l16; sample-rate=16000; channel-count=1</p></li>
362 /// <li>
363 /// <p>audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1; is-big-endian=false</p></li>
364 /// </ul></li>
365 /// <li>
366 /// <p>Opus format</p>
367 /// <ul>
368 /// <li>
369 /// <p>audio/x-cbr-opus-with-preamble; preamble-size=0; bit-rate=256000; frame-size-milliseconds=4</p></li>
370 /// </ul></li>
371 /// <li>
372 /// <p>Text format</p>
373 /// <ul>
374 /// <li>
375 /// <p>text/plain; charset=utf-8</p></li>
376 /// </ul></li>
377 /// </ul>
378 /// This field is required.
379 pub fn content_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
380 self.content_type = ::std::option::Option::Some(input.into());
381 self
382 }
383 /// <p>You pass this value as the <code>Content-Type</code> HTTP header.</p>
384 /// <p>Indicates the audio format or text. The header value must start with one of the following prefixes:</p>
385 /// <ul>
386 /// <li>
387 /// <p>PCM format, audio data must be in little-endian byte order.</p>
388 /// <ul>
389 /// <li>
390 /// <p>audio/l16; rate=16000; channels=1</p></li>
391 /// <li>
392 /// <p>audio/x-l16; sample-rate=16000; channel-count=1</p></li>
393 /// <li>
394 /// <p>audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1; is-big-endian=false</p></li>
395 /// </ul></li>
396 /// <li>
397 /// <p>Opus format</p>
398 /// <ul>
399 /// <li>
400 /// <p>audio/x-cbr-opus-with-preamble; preamble-size=0; bit-rate=256000; frame-size-milliseconds=4</p></li>
401 /// </ul></li>
402 /// <li>
403 /// <p>Text format</p>
404 /// <ul>
405 /// <li>
406 /// <p>text/plain; charset=utf-8</p></li>
407 /// </ul></li>
408 /// </ul>
409 pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
410 self.content_type = input;
411 self
412 }
413 /// <p>You pass this value as the <code>Content-Type</code> HTTP header.</p>
414 /// <p>Indicates the audio format or text. The header value must start with one of the following prefixes:</p>
415 /// <ul>
416 /// <li>
417 /// <p>PCM format, audio data must be in little-endian byte order.</p>
418 /// <ul>
419 /// <li>
420 /// <p>audio/l16; rate=16000; channels=1</p></li>
421 /// <li>
422 /// <p>audio/x-l16; sample-rate=16000; channel-count=1</p></li>
423 /// <li>
424 /// <p>audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1; is-big-endian=false</p></li>
425 /// </ul></li>
426 /// <li>
427 /// <p>Opus format</p>
428 /// <ul>
429 /// <li>
430 /// <p>audio/x-cbr-opus-with-preamble; preamble-size=0; bit-rate=256000; frame-size-milliseconds=4</p></li>
431 /// </ul></li>
432 /// <li>
433 /// <p>Text format</p>
434 /// <ul>
435 /// <li>
436 /// <p>text/plain; charset=utf-8</p></li>
437 /// </ul></li>
438 /// </ul>
439 pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
440 &self.content_type
441 }
442 /// <p>You pass this value as the <code>Accept</code> HTTP header.</p>
443 /// <p>The message Amazon Lex returns in the response can be either text or speech based on the <code>Accept</code> HTTP header value in the request.</p>
444 /// <ul>
445 /// <li>
446 /// <p>If the value is <code>text/plain; charset=utf-8</code>, Amazon Lex returns text in the response.</p></li>
447 /// <li>
448 /// <p>If the value begins with <code>audio/</code>, Amazon Lex returns speech in the response. Amazon Lex uses Amazon Polly to generate the speech (using the configuration you specified in the <code>Accept</code> header). For example, if you specify <code>audio/mpeg</code> as the value, Amazon Lex returns speech in the MPEG format.</p></li>
449 /// <li>
450 /// <p>If the value is <code>audio/pcm</code>, the speech returned is <code>audio/pcm</code> in 16-bit, little endian format.</p></li>
451 /// <li>
452 /// <p>The following are the accepted values:</p>
453 /// <ul>
454 /// <li>
455 /// <p>audio/mpeg</p></li>
456 /// <li>
457 /// <p>audio/ogg</p></li>
458 /// <li>
459 /// <p>audio/pcm</p></li>
460 /// <li>
461 /// <p>text/plain; charset=utf-8</p></li>
462 /// <li>
463 /// <p>audio/* (defaults to mpeg)</p></li>
464 /// </ul></li>
465 /// </ul>
466 pub fn accept(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
467 self.accept = ::std::option::Option::Some(input.into());
468 self
469 }
470 /// <p>You pass this value as the <code>Accept</code> HTTP header.</p>
471 /// <p>The message Amazon Lex returns in the response can be either text or speech based on the <code>Accept</code> HTTP header value in the request.</p>
472 /// <ul>
473 /// <li>
474 /// <p>If the value is <code>text/plain; charset=utf-8</code>, Amazon Lex returns text in the response.</p></li>
475 /// <li>
476 /// <p>If the value begins with <code>audio/</code>, Amazon Lex returns speech in the response. Amazon Lex uses Amazon Polly to generate the speech (using the configuration you specified in the <code>Accept</code> header). For example, if you specify <code>audio/mpeg</code> as the value, Amazon Lex returns speech in the MPEG format.</p></li>
477 /// <li>
478 /// <p>If the value is <code>audio/pcm</code>, the speech returned is <code>audio/pcm</code> in 16-bit, little endian format.</p></li>
479 /// <li>
480 /// <p>The following are the accepted values:</p>
481 /// <ul>
482 /// <li>
483 /// <p>audio/mpeg</p></li>
484 /// <li>
485 /// <p>audio/ogg</p></li>
486 /// <li>
487 /// <p>audio/pcm</p></li>
488 /// <li>
489 /// <p>text/plain; charset=utf-8</p></li>
490 /// <li>
491 /// <p>audio/* (defaults to mpeg)</p></li>
492 /// </ul></li>
493 /// </ul>
494 pub fn set_accept(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
495 self.accept = input;
496 self
497 }
498 /// <p>You pass this value as the <code>Accept</code> HTTP header.</p>
499 /// <p>The message Amazon Lex returns in the response can be either text or speech based on the <code>Accept</code> HTTP header value in the request.</p>
500 /// <ul>
501 /// <li>
502 /// <p>If the value is <code>text/plain; charset=utf-8</code>, Amazon Lex returns text in the response.</p></li>
503 /// <li>
504 /// <p>If the value begins with <code>audio/</code>, Amazon Lex returns speech in the response. Amazon Lex uses Amazon Polly to generate the speech (using the configuration you specified in the <code>Accept</code> header). For example, if you specify <code>audio/mpeg</code> as the value, Amazon Lex returns speech in the MPEG format.</p></li>
505 /// <li>
506 /// <p>If the value is <code>audio/pcm</code>, the speech returned is <code>audio/pcm</code> in 16-bit, little endian format.</p></li>
507 /// <li>
508 /// <p>The following are the accepted values:</p>
509 /// <ul>
510 /// <li>
511 /// <p>audio/mpeg</p></li>
512 /// <li>
513 /// <p>audio/ogg</p></li>
514 /// <li>
515 /// <p>audio/pcm</p></li>
516 /// <li>
517 /// <p>text/plain; charset=utf-8</p></li>
518 /// <li>
519 /// <p>audio/* (defaults to mpeg)</p></li>
520 /// </ul></li>
521 /// </ul>
522 pub fn get_accept(&self) -> &::std::option::Option<::std::string::String> {
523 &self.accept
524 }
525 /// <p>User input in PCM or Opus audio format or text format as described in the <code>Content-Type</code> HTTP header.</p>
526 /// <p>You can stream audio data to Amazon Lex or you can create a local buffer that captures all of the audio data before sending. In general, you get better performance if you stream audio data rather than buffering the data locally.</p>
527 /// This field is required.
528 pub fn input_stream(mut self, input: ::aws_smithy_types::byte_stream::ByteStream) -> Self {
529 self.input_stream = ::std::option::Option::Some(input);
530 self
531 }
532 /// <p>User input in PCM or Opus audio format or text format as described in the <code>Content-Type</code> HTTP header.</p>
533 /// <p>You can stream audio data to Amazon Lex or you can create a local buffer that captures all of the audio data before sending. In general, you get better performance if you stream audio data rather than buffering the data locally.</p>
534 pub fn set_input_stream(mut self, input: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>) -> Self {
535 self.input_stream = input;
536 self
537 }
538 /// <p>User input in PCM or Opus audio format or text format as described in the <code>Content-Type</code> HTTP header.</p>
539 /// <p>You can stream audio data to Amazon Lex or you can create a local buffer that captures all of the audio data before sending. In general, you get better performance if you stream audio data rather than buffering the data locally.</p>
540 pub fn get_input_stream(&self) -> &::std::option::Option<::aws_smithy_types::byte_stream::ByteStream> {
541 &self.input_stream
542 }
543 /// <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>
544 /// <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>
545 pub fn active_contexts(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
546 self.active_contexts = ::std::option::Option::Some(input.into());
547 self
548 }
549 /// <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>
550 /// <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>
551 pub fn set_active_contexts(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
552 self.active_contexts = input;
553 self
554 }
555 /// <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>
556 /// <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>
557 pub fn get_active_contexts(&self) -> &::std::option::Option<::std::string::String> {
558 &self.active_contexts
559 }
560 /// Consumes the builder and constructs a [`PostContentInput`](crate::operation::post_content::PostContentInput).
561 pub fn build(self) -> ::std::result::Result<crate::operation::post_content::PostContentInput, ::aws_smithy_types::error::operation::BuildError> {
562 ::std::result::Result::Ok(crate::operation::post_content::PostContentInput {
563 bot_name: self.bot_name,
564 bot_alias: self.bot_alias,
565 user_id: self.user_id,
566 session_attributes: self.session_attributes,
567 request_attributes: self.request_attributes,
568 content_type: self.content_type,
569 accept: self.accept,
570 input_stream: self.input_stream.unwrap_or_default(),
571 active_contexts: self.active_contexts,
572 })
573 }
574}
575impl ::std::fmt::Debug for PostContentInputBuilder {
576 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
577 let mut formatter = f.debug_struct("PostContentInputBuilder");
578 formatter.field("bot_name", &self.bot_name);
579 formatter.field("bot_alias", &self.bot_alias);
580 formatter.field("user_id", &self.user_id);
581 formatter.field("session_attributes", &"*** Sensitive Data Redacted ***");
582 formatter.field("request_attributes", &"*** Sensitive Data Redacted ***");
583 formatter.field("content_type", &self.content_type);
584 formatter.field("accept", &self.accept);
585 formatter.field("input_stream", &self.input_stream);
586 formatter.field("active_contexts", &"*** Sensitive Data Redacted ***");
587 formatter.finish()
588 }
589}