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

60 lines
1.4 KiB
C#

using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LineMessaging
{
// Root myDeserializedClass = JsonConvert.DeserializeObject<Root>(myJsonResponse);
public interface ITemplateObject
{
[JsonProperty("type")]
TemplateType Type { get; }
}
public class ButtonTemplateObject : ITemplateObject
{
public ButtonTemplateObject()
{
Actions = new List<ILineAction>();
ImageSize = "cover";
ImageBackgroundColor = "#FFFFFF";
ImageAspectRatio = "rectangle";
}
[JsonProperty("type")]
public TemplateType Type => TemplateType.Buttons;
[JsonProperty("thumbnailImageUrl")]
public string ThumbnailImageUrl { get; set; }
[JsonProperty("imageAspectRatio")]
public string ImageAspectRatio { get; set; }
[JsonProperty("imageSize")]
public string ImageSize { get; set; }
[JsonProperty("imageBackgroundColor")]
public string ImageBackgroundColor { get; set; }
[JsonProperty("title")]
public string Title { get; set; }
[JsonProperty("text")]
public string Text { get; set; }
[JsonProperty("defaultAction")]
public ILineAction DefaultAction { get; set; }
[JsonProperty("actions")]
public List<ILineAction> Actions { get; set; }
}
}