// <auto-generated/>
// ReSharper disable All

namespace MyTelegram.Schema;

///<summary>
/// User has clicked on an animated emoji triggering a <a href="https://corefork.telegram.org/api/animated-emojis#emoji-reactions">reaction, click here for more info »</a>.
/// See <a href="https://corefork.telegram.org/constructor/sendMessageEmojiInteraction" />
///</summary>
[TlObject(0x25972bcb)]
public sealed class TSendMessageEmojiInteraction : ISendMessageAction
{
    public uint ConstructorId => 0x25972bcb;
    ///<summary>
    /// Emoji
    ///</summary>
    public string Emoticon { get; set; }

    ///<summary>
    /// Message ID of the animated emoji that was clicked
    ///</summary>
    public int MsgId { get; set; }

    ///<summary>
    /// A JSON object with interaction info, <a href="https://corefork.telegram.org/api/animated-emojis#emoji-reactions">click here for more info »</a>
    /// See <a href="https://corefork.telegram.org/type/DataJSON" />
    ///</summary>
    public MyTelegram.Schema.IDataJSON Interaction { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Emoticon);
        writer.Write(MsgId);
        writer.Write(Interaction);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Emoticon = buffer.ReadString();
        MsgId = buffer.ReadInt32();
        Interaction = buffer.Read<MyTelegram.Schema.IDataJSON>();
    }
}