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

namespace MyTelegram.Schema.Contacts;

///<summary>
/// Top peers
/// See <a href="https://corefork.telegram.org/constructor/contacts.topPeers" />
///</summary>
[TlObject(0x70b772a8)]
public sealed class TTopPeers : ITopPeers
{
    public uint ConstructorId => 0x70b772a8;
    ///<summary>
    /// Top peers by top peer category
    ///</summary>
    public TVector<MyTelegram.Schema.ITopPeerCategoryPeers> Categories { get; set; }

    ///<summary>
    /// Chats
    ///</summary>
    public TVector<MyTelegram.Schema.IChat> Chats { get; set; }

    ///<summary>
    /// Users
    ///</summary>
    public TVector<MyTelegram.Schema.IUser> Users { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Categories);
        writer.Write(Chats);
        writer.Write(Users);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Categories = buffer.Read<TVector<MyTelegram.Schema.ITopPeerCategoryPeers>>();
        Chats = buffer.Read<TVector<MyTelegram.Schema.IChat>>();
        Users = buffer.Read<TVector<MyTelegram.Schema.IUser>>();
    }
}