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

namespace MyTelegram.Schema;

///<summary>
/// Interaction counters for a message.
/// See <a href="https://corefork.telegram.org/constructor/postInteractionCountersMessage" />
///</summary>
[TlObject(0xe7058e7f)]
public sealed class TPostInteractionCountersMessage : IPostInteractionCounters
{
    public uint ConstructorId => 0xe7058e7f;
    ///<summary>
    /// Message ID
    ///</summary>
    public int MsgId { get; set; }

    ///<summary>
    /// Number of views
    ///</summary>
    public int Views { get; set; }

    ///<summary>
    /// Number of forwards to public channels
    ///</summary>
    public int Forwards { get; set; }

    ///<summary>
    /// Number of reactions
    ///</summary>
    public int Reactions { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(MsgId);
        writer.Write(Views);
        writer.Write(Forwards);
        writer.Write(Reactions);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        MsgId = buffer.ReadInt32();
        Views = buffer.ReadInt32();
        Forwards = buffer.ReadInt32();
        Reactions = buffer.ReadInt32();
    }
}