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

namespace MyTelegram.Schema;

///<summary>
/// Constructor for a group of updates.
/// See <a href="https://corefork.telegram.org/constructor/updatesCombined" />
///</summary>
[TlObject(0x725b04c3)]
public sealed class TUpdatesCombined : IUpdates
{
    public uint ConstructorId => 0x725b04c3;
    ///<summary>
    /// List of updates
    ///</summary>
    public TVector<MyTelegram.Schema.IUpdate> Updates { get; set; }

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

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

    ///<summary>
    /// Current date
    ///</summary>
    public int Date { get; set; }

    ///<summary>
    /// Value <strong>seq</strong> for the earliest update in a group
    ///</summary>
    public int SeqStart { get; set; }

    ///<summary>
    /// Value <strong>seq</strong> for the latest update in a group
    ///</summary>
    public int Seq { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Updates);
        writer.Write(Users);
        writer.Write(Chats);
        writer.Write(Date);
        writer.Write(SeqStart);
        writer.Write(Seq);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Updates = buffer.Read<TVector<MyTelegram.Schema.IUpdate>>();
        Users = buffer.Read<TVector<MyTelegram.Schema.IUser>>();
        Chats = buffer.Read<TVector<MyTelegram.Schema.IChat>>();
        Date = buffer.ReadInt32();
        SeqStart = buffer.ReadInt32();
        Seq = buffer.ReadInt32();
    }
}