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

namespace MyTelegram.Schema;

///<summary>
/// Information about found messages sent on a specific day, used to split the <code>messages</code> in <a href="https://corefork.telegram.org/constructor/messages.searchResultsCalendar">messages.searchResultsCalendar</a> constructors by days.Multiple searchResultsCalendarPeriod constructors are returned in <a href="https://corefork.telegram.org/constructor/messages.searchResultsCalendar">messages.searchResultsCalendar</a>, each containing information about the first, last and total number of messages matching the filter that were sent on a specific day.
/// See <a href="https://corefork.telegram.org/constructor/searchResultsCalendarPeriod" />
///</summary>
[TlObject(0xc9b0539f)]
public sealed class TSearchResultsCalendarPeriod : ISearchResultsCalendarPeriod
{
    public uint ConstructorId => 0xc9b0539f;
    ///<summary>
    /// The day this object is referring to.
    ///</summary>
    public int Date { get; set; }

    ///<summary>
    /// First message ID that was sent on this day.
    ///</summary>
    public int MinMsgId { get; set; }

    ///<summary>
    /// Last message ID that was sent on this day.
    ///</summary>
    public int MaxMsgId { get; set; }

    ///<summary>
    /// All messages that were sent on this day.
    ///</summary>
    public int Count { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Date);
        writer.Write(MinMsgId);
        writer.Write(MaxMsgId);
        writer.Write(Count);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Date = buffer.ReadInt32();
        MinMsgId = buffer.ReadInt32();
        MaxMsgId = buffer.ReadInt32();
        Count = buffer.ReadInt32();
    }
}