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

namespace MyTelegram.Schema;

///<summary>
/// Game
/// See <a href="https://corefork.telegram.org/constructor/inputBotInlineResultGame" />
///</summary>
[TlObject(0x4fa417f2)]
public sealed class TInputBotInlineResultGame : IInputBotInlineResult
{
    public uint ConstructorId => 0x4fa417f2;
    ///<summary>
    /// Result ID
    ///</summary>
    public string Id { get; set; }

    ///<summary>
    /// Game short name
    ///</summary>
    public string ShortName { get; set; }

    ///<summary>
    /// Message to send when the result is selected
    /// See <a href="https://corefork.telegram.org/type/InputBotInlineMessage" />
    ///</summary>
    public MyTelegram.Schema.IInputBotInlineMessage SendMessage { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Id);
        writer.Write(ShortName);
        writer.Write(SendMessage);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Id = buffer.ReadString();
        ShortName = buffer.ReadString();
        SendMessage = buffer.Read<MyTelegram.Schema.IInputBotInlineMessage>();
    }
}