line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package Paws::LexRuntime::PostContent; |
3
|
1
|
|
|
1
|
|
479
|
use Moose; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
4
|
|
|
|
|
|
|
has Accept => (is => 'ro', isa => 'Str', traits => ['ParamInHeader'], header_name => 'accept'); |
5
|
|
|
|
|
|
|
has BotAlias => (is => 'ro', isa => 'Str', traits => ['ParamInURI'], uri_name => 'botAlias', required => 1); |
6
|
|
|
|
|
|
|
has BotName => (is => 'ro', isa => 'Str', traits => ['ParamInURI'], uri_name => 'botName', required => 1); |
7
|
|
|
|
|
|
|
has ContentType => (is => 'ro', isa => 'Str', traits => ['ParamInHeader'], header_name => 'contentType', required => 1); |
8
|
|
|
|
|
|
|
has InputStream => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'inputStream', required => 1); |
9
|
|
|
|
|
|
|
has RequestAttributes => (is => 'ro', isa => 'Str', traits => ['ParamInHeader'], header_name => 'requestAttributes'); |
10
|
|
|
|
|
|
|
has SessionAttributes => (is => 'ro', isa => 'Str', traits => ['ParamInHeader'], header_name => 'sessionAttributes'); |
11
|
|
|
|
|
|
|
has UserId => (is => 'ro', isa => 'Str', traits => ['ParamInURI'], uri_name => 'userId', required => 1); |
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
7133
|
use MooseX::ClassAttribute; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
17
|
|
14
|
|
|
|
|
|
|
class_has _stream_param => (is => 'ro', default => 'InputStream'); |
15
|
|
|
|
|
|
|
class_has _api_call => (isa => 'Str', is => 'ro', default => 'PostContent'); |
16
|
|
|
|
|
|
|
class_has _api_uri => (isa => 'Str', is => 'ro', default => '/bot/{botName}/alias/{botAlias}/user/{userId}/content'); |
17
|
|
|
|
|
|
|
class_has _api_method => (isa => 'Str', is => 'ro', default => 'POST'); |
18
|
|
|
|
|
|
|
class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::LexRuntime::PostContentResponse'); |
19
|
|
|
|
|
|
|
class_has _result_key => (isa => 'Str', is => 'ro'); |
20
|
|
|
|
|
|
|
1; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
### main pod documentation begin ### |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 NAME |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Paws::LexRuntime::PostContent - Arguments for method PostContent on Paws::LexRuntime |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 DESCRIPTION |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
This class represents the parameters used for calling the method PostContent on the |
31
|
|
|
|
|
|
|
Amazon Lex Runtime Service service. Use the attributes of this class |
32
|
|
|
|
|
|
|
as arguments to method PostContent. |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to PostContent. |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
As an example: |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
$service_obj->PostContent(Att1 => $value1, Att2 => $value2, ...); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object. |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head2 Accept => Str |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
You pass this value as the C<Accept> HTTP header. |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
The message Amazon Lex returns in the response can be either text or |
50
|
|
|
|
|
|
|
speech based on the C<Accept> HTTP header value in the request. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=over |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=item * |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
If the value is C<text/plain; charset=utf-8>, Amazon Lex returns text |
57
|
|
|
|
|
|
|
in the response. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=item * |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
If the value begins with C<audio/>, Amazon Lex returns speech in the |
62
|
|
|
|
|
|
|
response. Amazon Lex uses Amazon Polly to generate the speech (using |
63
|
|
|
|
|
|
|
the configuration you specified in the C<Accept> header). For example, |
64
|
|
|
|
|
|
|
if you specify C<audio/mpeg> as the value, Amazon Lex returns speech in |
65
|
|
|
|
|
|
|
the MPEG format. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
The following are the accepted values: |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=over |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=item * |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
audio/mpeg |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=item * |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
audio/ogg |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=item * |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
audio/pcm |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=item * |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
text/plain; charset=utf-8 |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=item * |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
audio/* (defaults to mpeg) |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=back |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=back |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head2 B<REQUIRED> BotAlias => Str |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
Alias of the Amazon Lex bot. |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=head2 B<REQUIRED> BotName => Str |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
Name of the Amazon Lex bot. |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=head2 B<REQUIRED> ContentType => Str |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
You pass this value as the C<Content-Type> HTTP header. |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
Indicates the audio format or text. The header value must start with |
115
|
|
|
|
|
|
|
one of the following prefixes: |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=over |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=item * |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
PCM format, audio data must be in little-endian byte order. |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=over |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=item * |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
audio/l16; rate=16000; channels=1 |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=item * |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
audio/x-l16; sample-rate=16000; channel-count=1 |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=item * |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1; |
136
|
|
|
|
|
|
|
is-big-endian=false |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=back |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=item * |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
Opus format |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=over |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=item * |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
audio/x-cbr-opus-with-preamble; preamble-size=0; bit-rate=256000; |
149
|
|
|
|
|
|
|
frame-size-milliseconds=4 |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=back |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=item * |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
Text format |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=over |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=item * |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
text/plain; charset=utf-8 |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
=back |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
=back |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
=head2 B<REQUIRED> InputStream => Str |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
User input in PCM or Opus audio format or text format as described in |
173
|
|
|
|
|
|
|
the C<Content-Type> HTTP header. |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
You can stream audio data to Amazon Lex or you can create a local |
176
|
|
|
|
|
|
|
buffer that captures all of the audio data before sending. In general, |
177
|
|
|
|
|
|
|
you get better performance if you stream audio data rather than |
178
|
|
|
|
|
|
|
buffering the data locally. |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
=head2 RequestAttributes => Str |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
You pass this value as the C<x-amz-lex-request-attributes> HTTP header. |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
Request-specific information passed between Amazon Lex and a client |
187
|
|
|
|
|
|
|
application. The value must be a JSON serialized and base64 encoded map |
188
|
|
|
|
|
|
|
with string keys and values. The total size of the C<requestAttributes> |
189
|
|
|
|
|
|
|
and C<sessionAttributes> headers is limited to 12 KB. |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
The namespace C<x-amz-lex:> is reserved for special attributes. Don't |
192
|
|
|
|
|
|
|
create any request attributes with the prefix C<x-amz-lex:>. |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
For more information, see Setting Request Attributes. |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
=head2 SessionAttributes => Str |
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
You pass this value as the C<x-amz-lex-session-attributes> HTTP header. |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
Application-specific information passed between Amazon Lex and a client |
203
|
|
|
|
|
|
|
application. The value must be a JSON serialized and base64 encoded map |
204
|
|
|
|
|
|
|
with string keys and values. The total size of the C<sessionAttributes> |
205
|
|
|
|
|
|
|
and C<requestAttributes> headers is limited to 12 KB. |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
For more information, see Setting Session Attributes. |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
=head2 B<REQUIRED> UserId => Str |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
The ID of the client application user. Amazon Lex uses this to identify |
214
|
|
|
|
|
|
|
a user's conversation with your bot. At runtime, each request must |
215
|
|
|
|
|
|
|
contain the C<userID> field. |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
To decide the user ID to use for your application, consider the |
218
|
|
|
|
|
|
|
following factors. |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
=over |
221
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
=item * |
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
The C<userID> field must not contain any personally identifiable |
225
|
|
|
|
|
|
|
information of the user, for example, name, personal identification |
226
|
|
|
|
|
|
|
numbers, or other end user personal information. |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
=item * |
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
If you want a user to start a conversation on one device and continue |
231
|
|
|
|
|
|
|
on another device, use a user-specific identifier. |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
=item * |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
If you want the same user to be able to have two independent |
236
|
|
|
|
|
|
|
conversations on two different devices, choose a device-specific |
237
|
|
|
|
|
|
|
identifier. |
238
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
=item * |
240
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
A user can't have two independent conversations with two different |
242
|
|
|
|
|
|
|
versions of the same bot. For example, a user can't have a conversation |
243
|
|
|
|
|
|
|
with the PROD and BETA versions of the same bot. If you anticipate that |
244
|
|
|
|
|
|
|
a user will need to have conversation with two different versions, for |
245
|
|
|
|
|
|
|
example, while testing, include the bot alias in the user ID to |
246
|
|
|
|
|
|
|
separate the two conversations. |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
=back |
249
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
=head1 SEE ALSO |
255
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
This class forms part of L<Paws>, documenting arguments for method PostContent in L<Paws::LexRuntime> |
257
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
=head1 BUGS and CONTRIBUTIONS |
259
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
The source code is located here: https://github.com/pplu/aws-sdk-perl |
261
|
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
Please report bugs to: https://github.com/pplu/aws-sdk-perl/issues |
263
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
=cut |
265
|
|
|
|
|
|
|
|