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

namespace MyTelegram.Schema;

///<summary>
/// Outgoing messages were read
/// See <a href="https://corefork.telegram.org/constructor/updateReadHistoryOutbox" />
///</summary>
[TlObject(0x2f2f21bf)]
public sealed class TUpdateReadHistoryOutbox : IUpdate
{
    public uint ConstructorId => 0x2f2f21bf;
    ///<summary>
    /// Peer
    /// See <a href="https://corefork.telegram.org/type/Peer" />
    ///</summary>
    public MyTelegram.Schema.IPeer Peer { get; set; }

    ///<summary>
    /// Maximum ID of read outgoing messages
    ///</summary>
    public int MaxId { get; set; }

    ///<summary>
    /// <a href="https://corefork.telegram.org/api/updates">Event count after generation</a>
    ///</summary>
    public int Pts { get; set; }

    ///<summary>
    /// <a href="https://corefork.telegram.org/api/updates">Number of events that were generated</a>
    ///</summary>
    public int PtsCount { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Peer);
        writer.Write(MaxId);
        writer.Write(Pts);
        writer.Write(PtsCount);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Peer = buffer.Read<MyTelegram.Schema.IPeer>();
        MaxId = buffer.ReadInt32();
        Pts = buffer.ReadInt32();
        PtsCount = buffer.ReadInt32();
    }
}