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

namespace MyTelegram.Schema;

///<summary>
/// Communication history in an encrypted chat was marked as read.
/// See <a href="https://corefork.telegram.org/constructor/updateEncryptedMessagesRead" />
///</summary>
[TlObject(0x38fe25b7)]
public sealed class TUpdateEncryptedMessagesRead : IUpdate
{
    public uint ConstructorId => 0x38fe25b7;
    ///<summary>
    /// Chat ID
    ///</summary>
    public int ChatId { get; set; }

    ///<summary>
    /// Maximum value of data for read messages
    ///</summary>
    public int MaxDate { get; set; }

    ///<summary>
    /// Time when messages were read
    ///</summary>
    public int Date { get; set; }

    public void ComputeFlag()
    {

    }

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

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