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

namespace MyTelegram.Schema.Messages;

///<summary>
/// Messages found and affected by changes
/// See <a href="https://corefork.telegram.org/constructor/messages.affectedFoundMessages" />
///</summary>
[TlObject(0xef8d3e6c)]
public sealed class TAffectedFoundMessages : IAffectedFoundMessages
{
    public uint ConstructorId => 0xef8d3e6c;
    ///<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; }

    ///<summary>
    /// If bigger than zero, the request must be repeated to remove more messages
    ///</summary>
    public int Offset { get; set; }

    ///<summary>
    /// Affected message IDs
    ///</summary>
    public TVector<int> Messages { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Pts = buffer.ReadInt32();
        PtsCount = buffer.ReadInt32();
        Offset = buffer.ReadInt32();
        Messages = buffer.Read<TVector<int>>();
    }
}