File Coverage

blib/lib/Paws/LexRuntime/PostText.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1              
2             package Paws::LexRuntime::PostText;
3 1     1   578 use Moose;
  1         2  
  1         8  
4             has BotAlias => (is => 'ro', isa => 'Str', traits => ['ParamInURI'], uri_name => 'botAlias' , required => 1);
5             has BotName => (is => 'ro', isa => 'Str', traits => ['ParamInURI'], uri_name => 'botName' , required => 1);
6             has InputText => (is => 'ro', isa => 'Str', required => 1);
7             has SessionAttributes => (is => 'ro', isa => 'Paws::LexRuntime::StringMap');
8             has UserId => (is => 'ro', isa => 'Str', traits => ['ParamInURI'], uri_name => 'userId' , required => 1);
9              
10 1     1   6495 use MooseX::ClassAttribute;
  1         3  
  1         8  
11              
12             class_has _api_call => (isa => 'Str', is => 'ro', default => 'PostText');
13             class_has _api_uri => (isa => 'Str', is => 'ro', default => '/bot/{botName}/alias/{botAlias}/user/{userId}/text');
14             class_has _api_method => (isa => 'Str', is => 'ro', default => 'POST');
15             class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::LexRuntime::PostTextResponse');
16             class_has _result_key => (isa => 'Str', is => 'ro');
17             1;
18              
19             ### main pod documentation begin ###
20              
21             =head1 NAME
22              
23             Paws::LexRuntime::PostText - Arguments for method PostText on Paws::LexRuntime
24              
25             =head1 DESCRIPTION
26              
27             This class represents the parameters used for calling the method PostText on the
28             Amazon Lex Runtime Service service. Use the attributes of this class
29             as arguments to method PostText.
30              
31             You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to PostText.
32              
33             As an example:
34              
35             $service_obj->PostText(Att1 => $value1, Att2 => $value2, ...);
36              
37             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.
38              
39             =head1 ATTRIBUTES
40              
41              
42             =head2 B<REQUIRED> BotAlias => Str
43              
44             The alias of the Amazon Lex bot.
45              
46              
47              
48             =head2 B<REQUIRED> BotName => Str
49              
50             The name of the Amazon Lex bot.
51              
52              
53              
54             =head2 B<REQUIRED> InputText => Str
55              
56             The text that the user entered (Amazon Lex interprets this text).
57              
58              
59              
60             =head2 SessionAttributes => L<Paws::LexRuntime::StringMap>
61              
62             By using session attributes, a client application can pass contextual
63             information in the request to Amazon Lex For example,
64              
65             =over
66              
67             =item *
68              
69             In Getting Started Exercise 1, the example bot uses the C<price>
70             session attribute to maintain the price of the flowers ordered (for
71             example, "Price":25). The code hook (the Lambda function) sets this
72             attribute based on the type of flowers ordered. For more information,
73             see Review the Details of Information Flow.
74              
75             =item *
76              
77             In the BookTrip bot exercise, the bot uses the C<currentReservation>
78             session attribute to maintain slot data during the in-progress
79             conversation to book a hotel or book a car. For more information, see
80             Details of Information Flow.
81              
82             =item *
83              
84             You might use the session attributes (key, value pairs) to track the
85             requestID of user requests.
86              
87             =back
88              
89             Amazon Lex simply passes these session attributes to the Lambda
90             functions configured for the intent.
91              
92             In your Lambda function, you can also use the session attributes for
93             initialization and customization (prompts and response cards). Some
94             examples are:
95              
96             =over
97              
98             =item *
99              
100             Initialization - In a pizza ordering bot, if you can pass the user
101             location as a session attribute (for example, C<"Location" : "111 Maple
102             street">), then your Lambda function might use this information to
103             determine the closest pizzeria to place the order (perhaps to set the
104             storeAddress slot value).
105              
106             =item *
107              
108             Personalize prompts - For example, you can configure prompts to refer
109             to the user name. (For example, "Hey [FirstName], what toppings would
110             you like?"). You can pass the user name as a session attribute
111             (C<"FirstName" : "Joe">) so that Amazon Lex can substitute the
112             placeholder to provide a personalize prompt to the user ("Hey Joe, what
113             toppings would you like?").
114              
115             =back
116              
117             Amazon Lex does not persist session attributes.
118              
119             If you configure a code hook for the intent, Amazon Lex passes the
120             incoming session attributes to the Lambda function. If you want Amazon
121             Lex to return these session attributes back to the client, the Lambda
122             function must return them.
123              
124             If there is no code hook configured for the intent, Amazon Lex simply
125             returns the session attributes back to the client application.
126              
127              
128              
129             =head2 B<REQUIRED> UserId => Str
130              
131             The ID of the client application user. The application developer
132             decides the user IDs. At runtime, each request must include the user
133             ID. Typically, each of your application users should have a unique ID.
134             Note the following considerations:
135              
136             =over
137              
138             =item *
139              
140             If you want a user to start a conversation on one device and continue
141             the conversation on another device, you might choose a user-specific
142             identifier, such as a login or Amazon Cognito user ID (assuming your
143             application is using Amazon Cognito).
144              
145             =item *
146              
147             If you want the same user to be able to have two independent
148             conversations on two different devices, you might choose a
149             device-specific identifier, such as device ID, or some globally unique
150             identifier.
151              
152             =back
153              
154              
155              
156              
157              
158             =head1 SEE ALSO
159              
160             This class forms part of L<Paws>, documenting arguments for method PostText in L<Paws::LexRuntime>
161              
162             =head1 BUGS and CONTRIBUTIONS
163              
164             The source code is located here: https://github.com/pplu/aws-sdk-perl
165              
166             Please report bugs to: https://github.com/pplu/aws-sdk-perl/issues
167              
168             =cut
169