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

namespace MyTelegram.Schema.Messages;

///<summary>
/// Full list of chats with messages and auxiliary data.
/// See <a href="https://corefork.telegram.org/constructor/messages.dialogs" />
///</summary>
[TlObject(0x15ba6c40)]
public sealed class TDialogs : IDialogs
{
    public uint ConstructorId => 0x15ba6c40;
    ///<summary>
    /// List of chats
    ///</summary>
    public TVector<MyTelegram.Schema.IDialog> Dialogs { get; set; }

    ///<summary>
    /// List of last messages from each chat
    ///</summary>
    public TVector<MyTelegram.Schema.IMessage> Messages { get; set; }

    ///<summary>
    /// List of groups mentioned in the chats
    ///</summary>
    public TVector<MyTelegram.Schema.IChat> Chats { get; set; }

    ///<summary>
    /// List of users mentioned in messages and groups
    ///</summary>
    public TVector<MyTelegram.Schema.IUser> Users { get; set; }

    public void ComputeFlag()
    {

    }

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

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