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

namespace MyTelegram.Schema.Messages;

///<summary>
/// Send typing event by the current user to a secret chat.
/// <para>Possible errors</para>
/// Code Type Description
/// 400 CHAT_ID_INVALID The provided chat id is invalid.
/// See <a href="https://corefork.telegram.org/method/messages.setEncryptedTyping" />
///</summary>
[TlObject(0x791451ed)]
public sealed class RequestSetEncryptedTyping : IRequest<IBool>
{
    public uint ConstructorId => 0x791451ed;
    ///<summary>
    /// Secret chat ID
    /// See <a href="https://corefork.telegram.org/type/InputEncryptedChat" />
    ///</summary>
    public MyTelegram.Schema.IInputEncryptedChat Peer { get; set; }

    ///<summary>
    /// Typing.<br><strong>Possible values</strong>:<br><a href="https://corefork.telegram.org/constructor/boolTrue">(boolTrue)</a>, if the user started typing and more than <strong>5 seconds</strong> have passed since the last request<br><a href="https://corefork.telegram.org/constructor/boolFalse">(boolFalse)</a>, if the user stopped typing
    /// See <a href="https://corefork.telegram.org/type/Bool" />
    ///</summary>
    public bool Typing { get; set; }

    public void ComputeFlag()
    {

    }

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

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