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

namespace MyTelegram.Schema;

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

    ///<summary>
    /// Result type (see <a href="https://corefork.telegram.org/bots/api#inlinequeryresult">bot API docs</a>)
    ///</summary>
    public string Type { get; set; }

    ///<summary>
    /// Photo to send
    /// See <a href="https://corefork.telegram.org/type/InputPhoto" />
    ///</summary>
    public MyTelegram.Schema.IInputPhoto Photo { 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(Type);
        writer.Write(Photo);
        writer.Write(SendMessage);
    }

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