blib/lib/Paws/LexModels/PutIntent.pm untested

filter: Statementstmt 0.0% 0 / 42 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod n/a totaltotal 0.0% 0 / 44 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1  
2 package Paws::LexModels::PutIntent;
3 use Moose;
4 has Checksum => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'checksum');
5 has ConclusionStatement => (is => 'ro', isa => 'Paws::LexModels::Statement', traits => ['NameInRequest'], request_name => 'conclusionStatement');
6 has ConfirmationPrompt => (is => 'ro', isa => 'Paws::LexModels::Prompt', traits => ['NameInRequest'], request_name => 'confirmationPrompt');
7 has CreateVersion => (is => 'ro', isa => 'Bool', traits => ['NameInRequest'], request_name => 'createVersion');
8 has Description => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'description');
9 has DialogCodeHook => (is => 'ro', isa => 'Paws::LexModels::CodeHook', traits => ['NameInRequest'], request_name => 'dialogCodeHook');
10 has FollowUpPrompt => (is => 'ro', isa => 'Paws::LexModels::FollowUpPrompt', traits => ['NameInRequest'], request_name => 'followUpPrompt');
11 has FulfillmentActivity => (is => 'ro', isa => 'Paws::LexModels::FulfillmentActivity', traits => ['NameInRequest'], request_name => 'fulfillmentActivity');
12 has InputContexts => (is => 'ro', isa => 'ArrayRef[Paws::LexModels::InputContext]', traits => ['NameInRequest'], request_name => 'inputContexts');
13 has KendraConfiguration => (is => 'ro', isa => 'Paws::LexModels::KendraConfiguration', traits => ['NameInRequest'], request_name => 'kendraConfiguration');
14 has Name => (is => 'ro', isa => 'Str', traits => ['ParamInURI'], uri_name => 'name', required => 1);
15 has OutputContexts => (is => 'ro', isa => 'ArrayRef[Paws::LexModels::OutputContext]', traits => ['NameInRequest'], request_name => 'outputContexts');
16 has ParentIntentSignature => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'parentIntentSignature');
17 has RejectionStatement => (is => 'ro', isa => 'Paws::LexModels::Statement', traits => ['NameInRequest'], request_name => 'rejectionStatement');
18 has SampleUtterances => (is => 'ro', isa => 'ArrayRef[Str|Undef]', traits => ['NameInRequest'], request_name => 'sampleUtterances');
19 has Slots => (is => 'ro', isa => 'ArrayRef[Paws::LexModels::Slot]', traits => ['NameInRequest'], request_name => 'slots');
20  
21 use MooseX::ClassAttribute;
22  
23 class_has _api_call => (isa => 'Str', is => 'ro', default => 'PutIntent');
24 class_has _api_uri => (isa => 'Str', is => 'ro', default => '/intents/{name}/versions/$LATEST');
25 class_has _api_method => (isa => 'Str', is => 'ro', default => 'PUT');
26 class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::LexModels::PutIntentResponse');
27 1;
28  
29 ### main pod documentation begin ###
30  
31 =head1 NAME
32  
33 Paws::LexModels::PutIntent - Arguments for method PutIntent on L<Paws::LexModels>
34  
35 =head1 DESCRIPTION
36  
37 This class represents the parameters used for calling the method PutIntent on the
38 L<Amazon Lex Model Building Service|Paws::LexModels> service. Use the attributes of this class
39 as arguments to method PutIntent.
40  
41 You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to PutIntent.
42  
43 =head1 SYNOPSIS
44  
45 my $models.lex = Paws->service('LexModels');
46 # To create an intent
47 # This example shows how to create an intent for ordering pizzas.
48 my $PutIntentResponse = $models.lex->PutIntent(
49 'ConclusionStatement' =>
50 {
51 'Messages' =>
52 [
53  
54 {
55 'Content' => 'All right, I ordered you a {Crust} crust {Type} pizza with {Sauce} sauce.',
56 'ContentType' => 'PlainText'
57 },
58  
59 {
60 'Content' => 'OK, your {Crust} crust {Type} pizza with {Sauce} sauce is on the way.',
61 'ContentType' => 'PlainText'
62 }
63 ],
64 'ResponseCard' => 'foo'
65 },
66 'ConfirmationPrompt' =>
67 {
68 'MaxAttempts' => 1,
69 'Messages' =>
70 [
71  
72 {
73 'Content' => 'Should I order your {Crust} crust {Type} pizza with {Sauce} sauce?',
74 'ContentType' => 'PlainText'
75 }
76 ]
77 },
78 'Description' => 'Order a pizza from a local pizzeria.',
79 'FulfillmentActivity' =>
80 {
81 'Type' => 'ReturnIntent'
82 },
83 'Name' => 'DocOrderPizza',
84 'RejectionStatement' =>
85 {
86 'Messages' =>
87 [
88  
89 {
90 'Content' => 'Ok, I'll cancel your order.',
91 'ContentType' => 'PlainText'
92 },
93  
94 {
95 'Content' => 'I cancelled your order.',
96 'ContentType' => 'PlainText'
97 }
98 ]
99 },
100 'SampleUtterances' =>
101 [
102 'Order me a pizza.',
103 'Order me a {Type} pizza.',
104 'I want a {Crust} crust {Type} pizza',
105 'I want a {Crust} crust {Type} pizza with {Sauce} sauce.'
106 ],
107 'Slots' =>
108 [
109  
110 {
111 'Description' => 'The type of pizza to order.',
112 'Name' => 'Type',
113 'Priority' => 1,
114 'SampleUtterances' =>
115 [
116 'Get me a {Type} pizza.',
117 'A {Type} pizza please.',
118 'I'd like a {Type} pizza.'
119 ],
120 'SlotConstraint' => 'Required',
121 'SlotType' => 'DocPizzaType',
122 'SlotTypeVersion' => '$LATEST',
123 'ValueElicitationPrompt' =>
124 {
125 'MaxAttempts' => 1,
126 'Messages' =>
127 [
128  
129 {
130 'Content' => 'What type of pizza would you like?',
131 'ContentType' => 'PlainText'
132 },
133  
134 {
135 'Content' => 'Vegie or cheese pizza?',
136 'ContentType' => 'PlainText'
137 },
138  
139 {
140 'Content' => 'I can get you a vegie or a cheese pizza.',
141 'ContentType' => 'PlainText'
142 }
143 ]
144 }
145 },
146  
147 {
148 'Description' => 'The type of pizza crust to order.',
149 'Name' => 'Crust',
150 'Priority' => 2,
151 'SampleUtterances' =>
152 [
153 'Make it a {Crust} crust.',
154 'I'd like a {Crust} crust.'
155 ],
156 'SlotConstraint' => 'Required',
157 'SlotType' => 'DocPizzaCrustType',
158 'SlotTypeVersion' => '$LATEST',
159 'ValueElicitationPrompt' =>
160 {
161 'MaxAttempts' => 1,
162 'Messages' =>
163 [
164  
165 {
166 'Content' => 'What type of crust would you like?',
167 'ContentType' => 'PlainText'
168 },
169  
170 {
171 'Content' => 'Thick or thin crust?',
172 'ContentType' => 'PlainText'
173 }
174 ]
175 }
176 },
177  
178 {
179 'Description' => 'The type of sauce to use on the pizza.',
180 'Name' => 'Sauce',
181 'Priority' => 3,
182 'SampleUtterances' =>
183 [
184 'Make it {Sauce} sauce.',
185 'I'd like {Sauce} sauce.'
186 ],
187 'SlotConstraint' => 'Required',
188 'SlotType' => 'DocPizzaSauceType',
189 'SlotTypeVersion' => '$LATEST',
190 'ValueElicitationPrompt' =>
191 {
192 'MaxAttempts' => 1,
193 'Messages' =>
194 [
195  
196 {
197 'Content' => 'White or red sauce?',
198 'ContentType' => 'PlainText'
199 },
200  
201 {
202 'Content' => 'Garlic or tomato sauce?',
203 'ContentType' => 'PlainText'
204 }
205 ]
206 }
207 }
208 ]
209 );
210  
211 # Results:
212 my $checksum = $PutIntentResponse->checksum;
213 my $conclusionStatement = $PutIntentResponse->conclusionStatement;
214 my $confirmationPrompt = $PutIntentResponse->confirmationPrompt;
215 my $createdDate = $PutIntentResponse->createdDate;
216 my $description = $PutIntentResponse->description;
217 my $fulfillmentActivity = $PutIntentResponse->fulfillmentActivity;
218 my $lastUpdatedDate = $PutIntentResponse->lastUpdatedDate;
219 my $name = $PutIntentResponse->name;
220 my $rejectionStatement = $PutIntentResponse->rejectionStatement;
221 my $sampleUtterances = $PutIntentResponse->sampleUtterances;
222 my $slots = $PutIntentResponse->slots;
223 my $version = $PutIntentResponse->version;
224  
225 # Returns a L<Paws::LexModels::PutIntentResponse> object.
226  
227 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.
228 For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/models.lex/PutIntent>
229  
230 =head1 ATTRIBUTES
231  
232  
233 =head2 Checksum => Str
234  
235 Identifies a specific revision of the C<$LATEST> version.
236  
237 When you create a new intent, leave the C<checksum> field blank. If you
238 specify a checksum you get a C<BadRequestException> exception.
239  
240 When you want to update a intent, set the C<checksum> field to the
241 checksum of the most recent revision of the C<$LATEST> version. If you
242 don't specify the C< checksum> field, or if the checksum does not match
243 the C<$LATEST> version, you get a C<PreconditionFailedException>
244 exception.
245  
246  
247  
248 =head2 ConclusionStatement => L<Paws::LexModels::Statement>
249  
250 The statement that you want Amazon Lex to convey to the user after the
251 intent is successfully fulfilled by the Lambda function.
252  
253 This element is relevant only if you provide a Lambda function in the
254 C<fulfillmentActivity>. If you return the intent to the client
255 application, you can't specify this element.
256  
257 The C<followUpPrompt> and C<conclusionStatement> are mutually
258 exclusive. You can specify only one.
259  
260  
261  
262 =head2 ConfirmationPrompt => L<Paws::LexModels::Prompt>
263  
264 Prompts the user to confirm the intent. This question should have a yes
265 or no answer.
266  
267 Amazon Lex uses this prompt to ensure that the user acknowledges that
268 the intent is ready for fulfillment. For example, with the
269 C<OrderPizza> intent, you might want to confirm that the order is
270 correct before placing it. For other intents, such as intents that
271 simply respond to user questions, you might not need to ask the user
272 for confirmation before providing the information.
273  
274 You you must provide both the C<rejectionStatement> and the
275 C<confirmationPrompt>, or neither.
276  
277  
278  
279 =head2 CreateVersion => Bool
280  
281 When set to C<true> a new numbered version of the intent is created.
282 This is the same as calling the C<CreateIntentVersion> operation. If
283 you do not specify C<createVersion>, the default is C<false>.
284  
285  
286  
287 =head2 Description => Str
288  
289 A description of the intent.
290  
291  
292  
293 =head2 DialogCodeHook => L<Paws::LexModels::CodeHook>
294  
295 Specifies a Lambda function to invoke for each user input. You can
296 invoke this Lambda function to personalize user interaction.
297  
298 For example, suppose your bot determines that the user is John. Your
299 Lambda function might retrieve John's information from a backend
300 database and prepopulate some of the values. For example, if you find
301 that John is gluten intolerant, you might set the corresponding intent
302 slot, C<GlutenIntolerant>, to true. You might find John's phone number
303 and set the corresponding session attribute.
304  
305  
306  
307 =head2 FollowUpPrompt => L<Paws::LexModels::FollowUpPrompt>
308  
309 Amazon Lex uses this prompt to solicit additional activity after
310 fulfilling an intent. For example, after the C<OrderPizza> intent is
311 fulfilled, you might prompt the user to order a drink.
312  
313 The action that Amazon Lex takes depends on the user's response, as
314 follows:
315  
316 =over
317  
318 =item *
319  
320 If the user says "Yes" it responds with the clarification prompt that
321 is configured for the bot.
322  
323 =item *
324  
325 if the user says "Yes" and continues with an utterance that triggers an
326 intent it starts a conversation for the intent.
327  
328 =item *
329  
330 If the user says "No" it responds with the rejection statement
331 configured for the the follow-up prompt.
332  
333 =item *
334  
335 If it doesn't recognize the utterance it repeats the follow-up prompt
336 again.
337  
338 =back
339  
340 The C<followUpPrompt> field and the C<conclusionStatement> field are
341 mutually exclusive. You can specify only one.
342  
343  
344  
345 =head2 FulfillmentActivity => L<Paws::LexModels::FulfillmentActivity>
346  
347 Required. Describes how the intent is fulfilled. For example, after a
348 user provides all of the information for a pizza order,
349 C<fulfillmentActivity> defines how the bot places an order with a local
350 pizza store.
351  
352 You might configure Amazon Lex to return all of the intent information
353 to the client application, or direct it to invoke a Lambda function
354 that can process the intent (for example, place an order with a
355 pizzeria).
356  
357  
358  
359 =head2 InputContexts => ArrayRef[L<Paws::LexModels::InputContext>]
360  
361 An array of C<InputContext> objects that lists the contexts that must
362 be active for Amazon Lex to choose the intent in a conversation with
363 the user.
364  
365  
366  
367 =head2 KendraConfiguration => L<Paws::LexModels::KendraConfiguration>
368  
369 Configuration information required to use the
370 C<AMAZON.KendraSearchIntent> intent to connect to an Amazon Kendra
371 index. For more information, see AMAZON.KendraSearchIntent
372 (http://docs.aws.amazon.com/lex/latest/dg/built-in-intent-kendra-search.html).
373  
374  
375  
376 =head2 B<REQUIRED> Name => Str
377  
378 The name of the intent. The name is I<not> case sensitive.
379  
380 The name can't match a built-in intent name, or a built-in intent name
381 with "AMAZON." removed. For example, because there is a built-in intent
382 called C<AMAZON.HelpIntent>, you can't create a custom intent called
383 C<HelpIntent>.
384  
385 For a list of built-in intents, see Standard Built-in Intents
386 (https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/standard-intents)
387 in the I<Alexa Skills Kit>.
388  
389  
390  
391 =head2 OutputContexts => ArrayRef[L<Paws::LexModels::OutputContext>]
392  
393 An array of C<OutputContext> objects that lists the contexts that the
394 intent activates when the intent is fulfilled.
395  
396  
397  
398 =head2 ParentIntentSignature => Str
399  
400 A unique identifier for the built-in intent to base this intent on. To
401 find the signature for an intent, see Standard Built-in Intents
402 (https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/standard-intents)
403 in the I<Alexa Skills Kit>.
404  
405  
406  
407 =head2 RejectionStatement => L<Paws::LexModels::Statement>
408  
409 When the user answers "no" to the question defined in
410 C<confirmationPrompt>, Amazon Lex responds with this statement to
411 acknowledge that the intent was canceled.
412  
413 You must provide both the C<rejectionStatement> and the
414 C<confirmationPrompt>, or neither.
415  
416  
417  
418 =head2 SampleUtterances => ArrayRef[Str|Undef]
419  
420 An array of utterances (strings) that a user might say to signal the
421 intent. For example, "I want {PizzaSize} pizza", "Order {Quantity}
422 {PizzaSize} pizzas".
423  
424 In each utterance, a slot name is enclosed in curly braces.
425  
426  
427  
428 =head2 Slots => ArrayRef[L<Paws::LexModels::Slot>]
429  
430 An array of intent slots. At runtime, Amazon Lex elicits required slot
431 values from the user using prompts defined in the slots. For more
432 information, see how-it-works.
433  
434  
435  
436  
437 =head1 SEE ALSO
438  
439 This class forms part of L<Paws>, documenting arguments for method PutIntent in L<Paws::LexModels>
440  
441 =head1 BUGS and CONTRIBUTIONS
442  
443 The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
444  
445 Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
446  
447 =cut
448