2024-02-24 21:17:37 +00:00
|
|
|
using BotSharp.Abstraction.Messaging.Enums;
|
|
|
|
|
|
2023-11-24 23:26:33 +00:00
|
|
|
namespace BotSharp.Abstraction.Messaging.Models.RichContent.Template;
|
|
|
|
|
|
2024-02-23 18:49:33 +00:00
|
|
|
public class GenericTemplateMessage<T> : IRichMessage, ITemplateMessage
|
2023-11-24 23:26:33 +00:00
|
|
|
{
|
2023-12-18 22:38:12 +00:00
|
|
|
[JsonPropertyName("rich_type")]
|
2024-02-24 21:17:37 +00:00
|
|
|
public string RichType => RichTypeEnum.GenericTemplate;
|
2023-12-18 22:38:12 +00:00
|
|
|
|
|
|
|
|
[JsonIgnore]
|
|
|
|
|
public string Text { get; set; } = string.Empty;
|
|
|
|
|
|
2023-11-24 23:26:33 +00:00
|
|
|
[JsonPropertyName("template_type")]
|
2024-02-24 21:17:37 +00:00
|
|
|
public string TemplateType => TemplateTypeEnum.Generic;
|
2024-02-23 18:49:33 +00:00
|
|
|
|
|
|
|
|
[JsonPropertyName("elements")]
|
|
|
|
|
public List<T> Elements { get; set; } = new List<T>();
|
2024-03-18 00:45:09 +00:00
|
|
|
|
2024-03-21 01:14:05 +00:00
|
|
|
[JsonPropertyName("is_horizontal")]
|
|
|
|
|
public bool IsHorizontal { get; set; }
|
|
|
|
|
|
2024-03-18 00:45:09 +00:00
|
|
|
[JsonPropertyName("element_type")]
|
|
|
|
|
public string ElementType => typeof(T).Name;
|
2023-11-24 23:26:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class GenericElement
|
|
|
|
|
{
|
|
|
|
|
public string Title { get; set; }
|
|
|
|
|
public string Subtitle { get; set; }
|
|
|
|
|
[JsonPropertyName("image_url")]
|
|
|
|
|
public string ImageUrl { get; set; }
|
|
|
|
|
[JsonPropertyName("default_action")]
|
|
|
|
|
public ElementAction DefaultAction { get; set; }
|
|
|
|
|
public ElementButton[] Buttons { get; set; }
|
|
|
|
|
}
|