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

namespace MyTelegram.Schema;

///<summary>
/// A new incoming query; for bots only
/// See <a href="https://corefork.telegram.org/constructor/updateBotWebhookJSONQuery" />
///</summary>
[TlObject(0x9b9240a6)]
public sealed class TUpdateBotWebhookJSONQuery : IUpdate
{
    public uint ConstructorId => 0x9b9240a6;
    ///<summary>
    /// Query identifier
    ///</summary>
    public long QueryId { get; set; }

    ///<summary>
    /// Query data
    /// See <a href="https://corefork.telegram.org/type/DataJSON" />
    ///</summary>
    public MyTelegram.Schema.IDataJSON Data { get; set; }

    ///<summary>
    /// Query timeout
    ///</summary>
    public int Timeout { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(QueryId);
        writer.Write(Data);
        writer.Write(Timeout);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        QueryId = buffer.ReadInt64();
        Data = buffer.Read<MyTelegram.Schema.IDataJSON>();
        Timeout = buffer.ReadInt32();
    }
}