forked from aws/aws-lambda-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLexEvent.cs
129 lines (111 loc) · 4.89 KB
/
LexEvent.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
using System;
using System.Collections.Generic;
namespace Amazon.Lambda.LexEvents
{
/// <summary>
/// This class represents the input event from Amazon Lex. It used as the input parameter
/// for Lambda functions.
/// http://docs.aws.amazon.com/lex/latest/dg/lambda-input-response-format.html
/// </summary>
public class LexEvent
{
/// <summary>
/// The version of the message that identifies the format of the event data going into the
/// Lambda function and the expected format of the response from a Lambda function.
/// </summary>
public string MessageVersion { get; set; }
/// <summary>
/// To indicate why Amazon Lex is invoking the Lambda function
/// </summary>
public string InvocationSource { get; set; }
/// <summary>
/// This value is provided by the client application. Amazon Lex passes it to the Lambda function.
/// </summary>
public string UserId { get; set; }
/// <summary>
/// The text used to process the request.
/// </summary>
public string InputTranscript { get; set; }
/// <summary>
/// Application-specific session attributes that the client sent in the request. If you want
/// Amazon Lex to include them in the response to the client, your Lambda function should
/// send these back to Amazon Lex in response.
/// </summary>
public IDictionary<string, string> SessionAttributes { get; set; }
/// <summary>
/// Request-specific attributes that the client sends in the request. Use request attributes to
/// pass information that doesn't need to persist for the entire session.
/// </summary>
public IDictionary<string, string> RequestAttributes { get; set; }
/// <summary>
/// The Lex bot invoking the Lambda function
/// </summary>
public LexBot Bot { get; set; }
/// <summary>
/// For each user input, the client sends the request to Amazon Lex using one of the runtime API operations,
/// PostContent or PostText. From the API request parameters, Amazon Lex determines whether the response
/// to the client (user) is text or voice, and sets this field accordingly.
/// <para>
/// The Lambda function can use this information to generate an appropriate message.
/// For example, if the client expects a voice response, your Lambda function could return
/// Speech Synthesis Markup LanguageSpeech Synthesis Markup Language (SSML) instead of text.
/// </para>
/// </summary>
public string OutputDialogMode { get; set; }
/// <summary>
/// Provides the intent name, slots, and confirmationStatus fields.
/// </summary>
public LexCurrentIntent CurrentIntent { get; set; }
/// <summary>
/// The class representing the current intent for the Lambda function to process.
/// </summary>
public class LexCurrentIntent
{
/// <summary>
/// The intent's name
/// </summary>
public string Name { get; set; }
/// <summary>
/// List of slots that are configured for the intent and values that are recognized by
/// Amazon Lex in the user conversation from the beginning. Otherwise, the values are null.
/// </summary>
public IDictionary<string, string> Slots { get; set; }
/// <summary>
/// Provides additional information about a slot value.
/// </summary>
public IDictionary<string, SlotDetail> SlotDetails { get; set; }
/// <summary>
/// The ConfirmationStatus provides the user response to a confirmation prompt, if there is one.
/// </summary>
public string ConfirmationStatus { get; set; }
}
/// <summary>
/// The class representing the information for a SlotDetail
/// </summary>
public class SlotDetail
{
/// <summary>
/// The resolutions array contains a list of additional values recognized for the slot.
/// </summary>
public IList<Dictionary<string, string>> Resolutions { get; set; }
}
/// <summary>
/// The class identifies the Lex bot that is invoking the Lambda function.
/// </summary>
public class LexBot
{
/// <summary>
/// The name of the Lex bot
/// </summary>
public string Name { get; set; }
/// <summary>
/// The alias of the Lex bot
/// </summary>
public string Alias { get; set; }
/// <summary>
/// The version of the Lex bot
/// </summary>
public string Version { get; set; }
}
}
}