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

namespace MyTelegram.Schema;

///<summary>
/// Information about a message in a specific position
/// See <a href="https://corefork.telegram.org/constructor/searchResultPosition" />
///</summary>
[TlObject(0x7f648b67)]
public sealed class TSearchResultPosition : ISearchResultsPosition
{
    public uint ConstructorId => 0x7f648b67;
    ///<summary>
    /// Message ID
    ///</summary>
    public int MsgId { get; set; }

    ///<summary>
    /// When was the message sent
    ///</summary>
    public int Date { get; set; }

    ///<summary>
    /// 0-based message position in the full list of suitable messages
    ///</summary>
    public int Offset { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(MsgId);
        writer.Write(Date);
        writer.Write(Offset);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        MsgId = buffer.ReadInt32();
        Date = buffer.ReadInt32();
        Offset = buffer.ReadInt32();
    }
}