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

namespace MyTelegram.Schema;

///<summary>
/// Information about an active user in a supergroup
/// See <a href="https://corefork.telegram.org/constructor/statsGroupTopPoster" />
///</summary>
[TlObject(0x9d04af9b)]
public sealed class TStatsGroupTopPoster : IStatsGroupTopPoster
{
    public uint ConstructorId => 0x9d04af9b;
    ///<summary>
    /// User ID
    ///</summary>
    public long UserId { get; set; }

    ///<summary>
    /// Number of messages for <a href="https://corefork.telegram.org/api/stats">statistics</a> period in consideration
    ///</summary>
    public int Messages { get; set; }

    ///<summary>
    /// Average number of characters per message
    ///</summary>
    public int AvgChars { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(UserId);
        writer.Write(Messages);
        writer.Write(AvgChars);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        UserId = buffer.ReadInt64();
        Messages = buffer.ReadInt32();
        AvgChars = buffer.ReadInt32();
    }
}