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

namespace MyTelegram.Schema.Messages;

///<summary>
/// Marks message history within a secret chat as read.
/// <para>Possible errors</para>
/// Code Type Description
/// 400 CHAT_ID_INVALID The provided chat id is invalid.
/// 400 MAX_DATE_INVALID The specified maximum date is invalid.
/// 400 MSG_WAIT_FAILED A waiting call returned an error.
/// See <a href="https://corefork.telegram.org/method/messages.readEncryptedHistory" />
///</summary>
[TlObject(0x7f4b690a)]
public sealed class RequestReadEncryptedHistory : IRequest<IBool>
{
    public uint ConstructorId => 0x7f4b690a;
    ///<summary>
    /// Secret chat ID
    /// See <a href="https://corefork.telegram.org/type/InputEncryptedChat" />
    ///</summary>
    public MyTelegram.Schema.IInputEncryptedChat Peer { get; set; }

    ///<summary>
    /// Maximum date value for received messages in history
    ///</summary>
    public int MaxDate { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Peer = buffer.Read<MyTelegram.Schema.IInputEncryptedChat>();
        MaxDate = buffer.ReadInt32();
    }
}
