2022-09-08 08:04:32 -07:00

77 lines
1.9 KiB
C#

using Newtonsoft.Json;
namespace LineMessaging
{
public interface ILineAction
{
[JsonProperty("type")]
ActionType Type { get; }
}
public class PostbackAction : ILineAction
{
[JsonProperty("type")]
public ActionType Type => ActionType.Postback;
[JsonProperty("label")]
public string Label { get; set; }
[JsonProperty("data")]
public string Data { get; set; }
[JsonProperty("displayText")]
public string DisplayText { get; set; }
[JsonProperty("inputOption")]
public string InputOption { get; set; }
[JsonProperty("fillInText")]
public string FillInText { get; set; }
}
public class MessageAction : ILineAction
{
[JsonProperty("type")]
public ActionType Type => ActionType.Message;
[JsonProperty("label")]
public string Label { get; set; }
[JsonProperty("text")]
public string Text { get; set; }
}
public class UriAction : ILineAction
{
[JsonProperty("type")]
public ActionType Type => ActionType.Uri;
[JsonProperty("label")]
public string Label { get; set; }
[JsonProperty("uri")]
public string Uri { get; set; }
}
public class DatetimepickerAction : ILineAction
{
[JsonProperty("type")]
public ActionType Type => ActionType.Datetimepicker;
[JsonProperty("label")]
public string Label { get; set; }
[JsonProperty("data")]
public string Data { get; set; }
[JsonProperty("mode")]
public string Mode { get; set; }
[JsonProperty("initial")]
public string Initial { get; set; }
[JsonProperty("max")]
public string Max { get; set; }
[JsonProperty("min")]
public string Min { get; set; }
}
}