namespace Amazon.Lambda.LexEvents
{
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
///
/// This class is used as the return for AWS Lambda functions that are invoked by Lex to handle Bot interactions.
/// http://docs.aws.amazon.com/lex/latest/dg/lambda-input-response-format.html
///
[DataContract]
public class LexResponse
{
///
/// Application-specific session attributes. This is an optional field.
///
[DataMember(Name = "sessionAttributes", EmitDefaultValue=false)]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("sessionAttributes")]
#endif
public IDictionary SessionAttributes { get; set; }
///
/// This is the only field that is required. The value of DialogAction.Type directs
/// Amazon Lex to the next course of action, and describes what to expect from the user
/// after Amazon Lex returns a response to the client.
/// \
[DataMember(Name = "dialogAction", EmitDefaultValue=false)]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("dialogAction")]
#endif
public LexDialogAction DialogAction { get; set; }
///
/// If included, sets the value for one or more contexts. This is an optional field
/// For example, you can include a context to make one or more intents that have that context as an input eligible for recognition in the next turn of the conversation.
///
[DataMember(Name = "activeContexts", EmitDefaultValue=false)]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("activeContexts")]
#endif
public IList ActiveContexts { get; set; }
///
/// If included, sets values for one or more recent intents. You can include information for up to three intents.
///
[DataMember(Name = "recentIntentSummaryView", EmitDefaultValue = false)]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("recentIntentSummaryView")]
#endif
public IList RecentIntentSummaryView { get; set; }
///
/// The class representing the dialog action.
///
[DataContract]
public class LexDialogAction
{
///
/// The type of action for Lex to take with the response from the Lambda function.
///
[DataMember(Name = "type", EmitDefaultValue=false)]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("type")]
#endif
public string Type { get; set; }
///
/// The state of the fullfillment. "Fulfilled" or "Failed"
///
[DataMember(Name = "fulfillmentState", EmitDefaultValue=false)]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("fulfillmentState")]
#endif
public string FulfillmentState { get; set; }
///
/// The message to be sent to the user.
///
[DataMember(Name = "message", EmitDefaultValue=false)]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("message")]
#endif
public LexMessage Message { get; set; }
///
/// The intent name you want to confirm or elicit.
///
[DataMember(Name = "intentName", EmitDefaultValue=false)]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("intentName")]
#endif
public string IntentName { get; set; }
///
/// The values for all of the slots when response is of type "Delegate".
///
[DataMember(Name = "slots", EmitDefaultValue=false)]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("slots")]
#endif
public IDictionary Slots { get; set; }
///
/// The slot to elicit when the Type is "ElicitSlot"
///
[DataMember(Name = "slotToElicit", EmitDefaultValue=false)]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("slotToElicit")]
#endif
public string SlotToElicit { get; set; }
///
/// The response card provides information back to the bot to display for the user.
///
[DataMember(Name = "responseCard", EmitDefaultValue=false)]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("responseCard")]
#endif
public LexResponseCard ResponseCard { get; set; }
}
///
/// The class represents the message that the bot will use.
///
[DataContract]
public class LexMessage
{
///
/// The content type of the message. PlainText or SSML
///
[DataMember(Name = "contentType", EmitDefaultValue=false)]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("contentType")]
#endif
public string ContentType { get; set; }
///
/// The message to be asked to the user by the bot.
///
[DataMember(Name = "content", EmitDefaultValue=false)]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("content")]
#endif
public string Content { get; set; }
}
///
/// The class representing the response card sent back to the user.
///
[DataContract]
public class LexResponseCard
{
///
/// The version of the response card.
///
[DataMember(Name = "version", EmitDefaultValue=false)]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("version")]
#endif
public int? Version { get; set; }
///
/// The content type of the response card. The default is "application/vnd.amazonaws.card.generic".
///
[DataMember(Name = "contentType", EmitDefaultValue=false)]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("contentType")]
#endif
public string ContentType { get; set; } = "application/vnd.amazonaws.card.generic";
///
/// The list of attachments sent back with the response card.
///
[DataMember(Name = "genericAttachments", EmitDefaultValue=false)]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("genericAttachments")]
#endif
public IList GenericAttachments { get; set; }
}
///
/// The class representing generic attachments.
///
[DataContract]
public class LexGenericAttachments
{
///
/// The card's title.
///
[DataMember(Name = "title", EmitDefaultValue=false)]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("title")]
#endif
public string Title { get; set; }
///
/// The card's sub title.
///
[DataMember(Name = "subTitle", EmitDefaultValue=false)]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("subTitle")]
#endif
public string SubTitle { get; set; }
///
/// URL to an image to be shown.
///
[DataMember(Name = "imageUrl", EmitDefaultValue=false)]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("imageUrl")]
#endif
public string ImageUrl { get; set; }
///
/// URL of the attachment to be associated with the card.
///
[DataMember(Name = "attachmentLinkUrl", EmitDefaultValue=false)]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("attachmentLinkUrl")]
#endif
public string AttachmentLinkUrl { get; set; }
///
/// The list of buttons to be displayed with the response card.
///
[DataMember(Name = "buttons", EmitDefaultValue=false)]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("buttons")]
#endif
public IList Buttons { get; set; }
}
///
/// The class representing a button in the response card.
///
[DataContract]
public class LexButton
{
///
/// The text for the button.
///
[DataMember(Name = "text", EmitDefaultValue=false)]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("text")]
#endif
public string Text { get; set; }
///
/// The value of the button sent back to the server.
///
[DataMember(Name = "value", EmitDefaultValue=false)]
#if NETCOREAPP3_1
[System.Text.Json.Serialization.JsonPropertyName("value")]
#endif
public string Value { get; set; }
}
}
}