// Copyright Epic Games, Inc. All Rights Reserved.
using System.Text.Json.Serialization;
namespace EpicGames.Slack.Elements
{
///
/// A text object
///
public class TextObject : Element
{
///
/// Text to render
///
[JsonPropertyName("text"), JsonPropertyOrder(1)]
public string Text { get; set; }
///
/// Whether to show emojis in the text
///
[JsonPropertyName("emoji"), JsonPropertyOrder(2)]
public bool? Emoji { get; set; }
///
/// Constructor
///
///
public TextObject(string text) : this("mrkdwn", text, null)
{
}
///
/// Constructor
///
protected TextObject(string type, string text, bool? emoji) : base(type)
{
Text = text;
Emoji = emoji;
}
///
/// Implicit conversion from a regular string
///
public static implicit operator TextObject(string text) => new TextObject(text);
}
///
/// Plain text object
///
public class PlainTextObject : TextObject
{
///
/// Constructor
///
public PlainTextObject(string text, bool? emoji = null) : base("plain_text", text, emoji)
{
}
///
/// Implicit conversion from a regular string
///
public static implicit operator PlainTextObject(string text) => new PlainTextObject(text);
}
}