« blib/lib/Paws/LexRuntime/IntentSummary.pm
↑ Summary
blib/lib/Paws/LexRuntime/PostContentResponse.pm »
| 1 | |||
| 2 | package Paws::LexRuntime::PostContent; | ||
| 3 | use Moose; | ||
| 4 | has Accept => (is => 'ro', isa => 'Str', traits => ['ParamInHeader'], header_name => 'Accept'); | ||
| 5 | has ActiveContexts => (is => 'ro', isa => 'Str', traits => ['ParamInHeader'], header_name => 'x-amz-lex-active-contexts'); | ||
| 6 | has BotAlias => (is => 'ro', isa => 'Str', traits => ['ParamInURI'], uri_name => 'botAlias', required => 1); | ||
| 7 | has BotName => (is => 'ro', isa => 'Str', traits => ['ParamInURI'], uri_name => 'botName', required => 1); | ||
| 8 | has ContentType => (is => 'ro', isa => 'Str', traits => ['ParamInHeader'], header_name => 'Content-Type', required => 1); | ||
| 9 | has InputStream => (is => 'ro', isa => 'Str', traits => ['ParamInBody'], required => 1); | ||
| 10 | has RequestAttributes => (is => 'ro', isa => 'Str', traits => ['ParamInHeader'], header_name => 'x-amz-lex-request-attributes'); | ||
| 11 | has SessionAttributes => (is => 'ro', isa => 'Str', traits => ['ParamInHeader'], header_name => 'x-amz-lex-session-attributes'); | ||
| 12 | has UserId => (is => 'ro', isa => 'Str', traits => ['ParamInURI'], uri_name => 'userId', required => 1); | ||
| 13 | |||
| 14 | use MooseX::ClassAttribute; | ||
| 15 | class_has _stream_param => (is => 'ro', default => 'InputStream'); | ||
| 16 | class_has _api_call => (isa => 'Str', is => 'ro', default => 'PostContent'); | ||
| 17 | class_has _api_uri => (isa => 'Str', is => 'ro', default => '/bot/{botName}/alias/{botAlias}/user/{userId}/content'); | ||
| 18 | class_has _api_method => (isa => 'Str', is => 'ro', default => 'POST'); | ||
| 19 | class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::LexRuntime::PostContentResponse'); | ||
| 20 | 1; | ||
| 21 | |||
| 22 | ### main pod documentation begin ### | ||
| 23 | |||
| 24 | =head1 NAME | ||
| 25 | |||
| 26 | Paws::LexRuntime::PostContent - Arguments for method PostContent on L<Paws::LexRuntime> | ||
| 27 | |||
| 28 | =head1 DESCRIPTION | ||
| 29 | |||
| 30 | This class represents the parameters used for calling the method PostContent on the | ||
| 31 | L<Amazon Lex Runtime Service|Paws::LexRuntime> 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 | =head1 SYNOPSIS | ||
| 37 | |||
| 38 | my $runtime.lex = Paws->service('LexRuntime'); | ||
| 39 | my $PostContentResponse = $runtime . lex->PostContent( | ||
| 40 | BotAlias => 'MyBotAlias', | ||
| 41 | BotName => 'MyBotName', | ||
| 42 | ContentType => 'MyHttpContentType', | ||
| 43 | InputStream => 'BlobBlobStream', | ||
| 44 | UserId => 'MyUserId', | ||
| 45 | Accept => 'MyAccept', # OPTIONAL | ||
| 46 | ActiveContexts => 'MyActiveContextsString', # OPTIONAL | ||
| 47 | RequestAttributes => 'MyAttributesString', # OPTIONAL | ||
| 48 | SessionAttributes => 'MyAttributesString', # OPTIONAL | ||
| 49 | ); | ||
| 50 | |||
| 51 | # Results: | ||
| 52 | my $ActiveContexts = $PostContentResponse->ActiveContexts; | ||
| 53 | my $AlternativeIntents = $PostContentResponse->AlternativeIntents; | ||
| 54 | my $AudioStream = $PostContentResponse->AudioStream; | ||
| 55 | my $BotVersion = $PostContentResponse->BotVersion; | ||
| 56 | my $ContentType = $PostContentResponse->ContentType; | ||
| 57 | my $DialogState = $PostContentResponse->DialogState; | ||
| 58 | my $EncodedInputTranscript = $PostContentResponse->EncodedInputTranscript; | ||
| 59 | my $EncodedMessage = $PostContentResponse->EncodedMessage; | ||
| 60 | my $InputTranscript = $PostContentResponse->InputTranscript; | ||
| 61 | my $IntentName = $PostContentResponse->IntentName; | ||
| 62 | my $Message = $PostContentResponse->Message; | ||
| 63 | my $MessageFormat = $PostContentResponse->MessageFormat; | ||
| 64 | my $NluIntentConfidence = $PostContentResponse->NluIntentConfidence; | ||
| 65 | my $SentimentResponse = $PostContentResponse->SentimentResponse; | ||
| 66 | my $SessionAttributes = $PostContentResponse->SessionAttributes; | ||
| 67 | my $SessionId = $PostContentResponse->SessionId; | ||
| 68 | my $SlotToElicit = $PostContentResponse->SlotToElicit; | ||
| 69 | my $Slots = $PostContentResponse->Slots; | ||
| 70 | |||
| 71 | # Returns a L<Paws::LexRuntime::PostContentResponse> object. | ||
| 72 | |||
| 73 | 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. | ||
| 74 | For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/runtime.lex/PostContent> | ||
| 75 | |||
| 76 | =head1 ATTRIBUTES | ||
| 77 | |||
| 78 | |||
| 79 | =head2 Accept => Str | ||
| 80 | |||
| 81 | You pass this value as the C<Accept> HTTP header. | ||
| 82 | |||
| 83 | The message Amazon Lex returns in the response can be either text or | ||
| 84 | speech based on the C<Accept> HTTP header value in the request. | ||
| 85 | |||
| 86 | =over | ||
| 87 | |||
| 88 | =item * | ||
| 89 | |||
| 90 | If the value is C<text/plain; charset=utf-8>, Amazon Lex returns text | ||
| 91 | in the response. | ||
| 92 | |||
| 93 | =item * | ||
| 94 | |||
| 95 | If the value begins with C<audio/>, Amazon Lex returns speech in the | ||
| 96 | response. Amazon Lex uses Amazon Polly to generate the speech (using | ||
| 97 | the configuration you specified in the C<Accept> header). For example, | ||
| 98 | if you specify C<audio/mpeg> as the value, Amazon Lex returns speech in | ||
| 99 | the MPEG format. | ||
| 100 | |||
| 101 | =item * | ||
| 102 | |||
| 103 | If the value is C<audio/pcm>, the speech returned is C<audio/pcm> in | ||
| 104 | 16-bit, little endian format. | ||
| 105 | |||
| 106 | =item * | ||
| 107 | |||
| 108 | The following are the accepted values: | ||
| 109 | |||
| 110 | =over | ||
| 111 | |||
| 112 | =item * | ||
| 113 | |||
| 114 | audio/mpeg | ||
| 115 | |||
| 116 | =item * | ||
| 117 | |||
| 118 | audio/ogg | ||
| 119 | |||
| 120 | =item * | ||
| 121 | |||
| 122 | audio/pcm | ||
| 123 | |||
| 124 | =item * | ||
| 125 | |||
| 126 | text/plain; charset=utf-8 | ||
| 127 | |||
| 128 | =item * | ||
| 129 | |||
| 130 | audio/* (defaults to mpeg) | ||
| 131 | |||
| 132 | =back | ||
| 133 | |||
| 134 | =back | ||
| 135 | |||
| 136 | |||
| 137 | |||
| 138 | |||
| 139 | =head2 ActiveContexts => Str | ||
| 140 | |||
| 141 | A list of contexts active for the request. A context can be activated | ||
| 142 | when a previous intent is fulfilled, or by including the context in the | ||
| 143 | request, | ||
| 144 | |||
| 145 | If you don't specify a list of contexts, Amazon Lex will use the | ||
| 146 | current list of contexts for the session. If you specify an empty list, | ||
| 147 | all contexts for the session are cleared. | ||
| 148 | |||
| 149 | |||
| 150 | |||
| 151 | =head2 B<REQUIRED> BotAlias => Str | ||
| 152 | |||
| 153 | Alias of the Amazon Lex bot. | ||
| 154 | |||
| 155 | |||
| 156 | |||
| 157 | =head2 B<REQUIRED> BotName => Str | ||
| 158 | |||
| 159 | Name of the Amazon Lex bot. | ||
| 160 | |||
| 161 | |||
| 162 | |||
| 163 | =head2 B<REQUIRED> ContentType => Str | ||
| 164 | |||
| 165 | You pass this value as the C<Content-Type> HTTP header. | ||
| 166 | |||
| 167 | Indicates the audio format or text. The header value must start with | ||
| 168 | one of the following prefixes: | ||
| 169 | |||
| 170 | =over | ||
| 171 | |||
| 172 | =item * | ||
| 173 | |||
| 174 | PCM format, audio data must be in little-endian byte order. | ||
| 175 | |||
| 176 | =over | ||
| 177 | |||
| 178 | =item * | ||
| 179 | |||
| 180 | audio/l16; rate=16000; channels=1 | ||
| 181 | |||
| 182 | =item * | ||
| 183 | |||
| 184 | audio/x-l16; sample-rate=16000; channel-count=1 | ||
| 185 | |||
| 186 | =item * | ||
| 187 | |||
| 188 | audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1; | ||
| 189 | is-big-endian=false | ||
| 190 | |||
| 191 | =back | ||
| 192 | |||
| 193 | =item * | ||
| 194 | |||
| 195 | Opus format | ||
| 196 | |||
| 197 | =over | ||
| 198 | |||
| 199 | =item * | ||
| 200 | |||
| 201 | audio/x-cbr-opus-with-preamble; preamble-size=0; bit-rate=256000; | ||
| 202 | frame-size-milliseconds=4 | ||
| 203 | |||
| 204 | =back | ||
| 205 | |||
| 206 | =item * | ||
| 207 | |||
| 208 | Text format | ||
| 209 | |||
| 210 | =over | ||
| 211 | |||
| 212 | =item * | ||
| 213 | |||
| 214 | text/plain; charset=utf-8 | ||
| 215 | |||
| 216 | =back | ||
| 217 | |||
| 218 | =back | ||
| 219 | |||
| 220 | |||
| 221 | |||
| 222 | |||
| 223 | =head2 B<REQUIRED> InputStream => Str | ||
| 224 | |||
| 225 | User input in PCM or Opus audio format or text format as described in | ||
| 226 | the C<Content-Type> HTTP header. | ||
| 227 | |||
| 228 | You can stream audio data to Amazon Lex or you can create a local | ||
| 229 | buffer that captures all of the audio data before sending. In general, | ||
| 230 | you get better performance if you stream audio data rather than | ||
| 231 | buffering the data locally. | ||
| 232 | |||
| 233 | |||
| 234 | |||
| 235 | =head2 RequestAttributes => Str | ||
| 236 | |||
| 237 | You pass this value as the C<x-amz-lex-request-attributes> HTTP header. | ||
| 238 | |||
| 239 | Request-specific information passed between Amazon Lex and a client | ||
| 240 | application. The value must be a JSON serialized and base64 encoded map | ||
| 241 | with string keys and values. The total size of the C<requestAttributes> | ||
| 242 | and C<sessionAttributes> headers is limited to 12 KB. | ||
| 243 | |||
| 244 | The namespace C<x-amz-lex:> is reserved for special attributes. Don't | ||
| 245 | create any request attributes with the prefix C<x-amz-lex:>. | ||
| 246 | |||
| 247 | For more information, see Setting Request Attributes | ||
| 248 | (https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-request-attribs). | ||
| 249 | |||
| 250 | |||
| 251 | |||
| 252 | =head2 SessionAttributes => Str | ||
| 253 | |||
| 254 | You pass this value as the C<x-amz-lex-session-attributes> HTTP header. | ||
| 255 | |||
| 256 | Application-specific information passed between Amazon Lex and a client | ||
| 257 | application. The value must be a JSON serialized and base64 encoded map | ||
| 258 | with string keys and values. The total size of the C<sessionAttributes> | ||
| 259 | and C<requestAttributes> headers is limited to 12 KB. | ||
| 260 | |||
| 261 | For more information, see Setting Session Attributes | ||
| 262 | (https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-session-attribs). | ||
| 263 | |||
| 264 | |||
| 265 | |||
| 266 | =head2 B<REQUIRED> UserId => Str | ||
| 267 | |||
| 268 | The ID of the client application user. Amazon Lex uses this to identify | ||
| 269 | a user's conversation with your bot. At runtime, each request must | ||
| 270 | contain the C<userID> field. | ||
| 271 | |||
| 272 | To decide the user ID to use for your application, consider the | ||
| 273 | following factors. | ||
| 274 | |||
| 275 | =over | ||
| 276 | |||
| 277 | =item * | ||
| 278 | |||
| 279 | The C<userID> field must not contain any personally identifiable | ||
| 280 | information of the user, for example, name, personal identification | ||
| 281 | numbers, or other end user personal information. | ||
| 282 | |||
| 283 | =item * | ||
| 284 | |||
| 285 | If you want a user to start a conversation on one device and continue | ||
| 286 | on another device, use a user-specific identifier. | ||
| 287 | |||
| 288 | =item * | ||
| 289 | |||
| 290 | If you want the same user to be able to have two independent | ||
| 291 | conversations on two different devices, choose a device-specific | ||
| 292 | identifier. | ||
| 293 | |||
| 294 | =item * | ||
| 295 | |||
| 296 | A user can't have two independent conversations with two different | ||
| 297 | versions of the same bot. For example, a user can't have a conversation | ||
| 298 | with the PROD and BETA versions of the same bot. If you anticipate that | ||
| 299 | a user will need to have conversation with two different versions, for | ||
| 300 | example, while testing, include the bot alias in the user ID to | ||
| 301 | separate the two conversations. | ||
| 302 | |||
| 303 | =back | ||
| 304 | |||
| 305 | |||
| 306 | |||
| 307 | |||
| 308 | |||
| 309 | =head1 SEE ALSO | ||
| 310 | |||
| 311 | This class forms part of L<Paws>, documenting arguments for method PostContent in L<Paws::LexRuntime> | ||
| 312 | |||
| 313 | =head1 BUGS and CONTRIBUTIONS | ||
| 314 | |||
| 315 | The source code is located here: L<https://github.com/pplu/aws-sdk-perl> | ||
| 316 | |||
| 317 | Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> | ||
| 318 | |||
| 319 | =cut | ||
| 320 |