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

namespace MyTelegram.Schema.Messages;

///<summary>
/// Partial list of chats, more would have to be fetched with <a href="https://corefork.telegram.org/api/offsets">pagination</a>
/// See <a href="https://corefork.telegram.org/constructor/messages.chatsSlice" />
///</summary>
[TlObject(0x9cd81144)]
public sealed class TChatsSlice : IChats
{
    public uint ConstructorId => 0x9cd81144;
    ///<summary>
    /// Total number of results that were found server-side (not all are included in <code>chats</code>)
    ///</summary>
    public int Count { get; set; }

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

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Count = buffer.ReadInt32();
        Chats = buffer.Read<TVector<MyTelegram.Schema.IChat>>();
    }
}