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

namespace MyTelegram.Schema;

///<summary>
/// Event that occurred in the application.
/// See <a href="https://corefork.telegram.org/constructor/inputAppEvent" />
///</summary>
[TlObject(0x1d1b1245)]
public sealed class TInputAppEvent : IInputAppEvent
{
    public uint ConstructorId => 0x1d1b1245;
    ///<summary>
    /// Client's exact timestamp for the event
    ///</summary>
    public double Time { get; set; }

    ///<summary>
    /// Type of event
    ///</summary>
    public string Type { get; set; }

    ///<summary>
    /// Arbitrary numeric value for more convenient selection of certain event types, or events referring to a certain object
    ///</summary>
    public long Peer { get; set; }

    ///<summary>
    /// Details of the event
    /// See <a href="https://corefork.telegram.org/type/JSONValue" />
    ///</summary>
    public MyTelegram.Schema.IJSONValue Data { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Time = buffer.ReadDouble();
        Type = buffer.ReadString();
        Peer = buffer.ReadInt64();
        Data = buffer.Read<MyTelegram.Schema.IJSONValue>();
    }
}