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

namespace MyTelegram.Schema.Messages;

///<summary>
/// Terminate webview interaction started with <a href="https://corefork.telegram.org/method/messages.requestWebView">messages.requestWebView</a>, sending the specified message to the chat on behalf of the user.
/// <para>Possible errors</para>
/// Code Type Description
/// 400 QUERY_ID_INVALID The query ID is invalid.
/// 400 USER_BOT_REQUIRED This method can only be called by a bot.
/// See <a href="https://corefork.telegram.org/method/messages.sendWebViewResultMessage" />
///</summary>
[TlObject(0xa4314f5)]
public sealed class RequestSendWebViewResultMessage : IRequest<MyTelegram.Schema.IWebViewMessageSent>
{
    public uint ConstructorId => 0xa4314f5;
    ///<summary>
    /// Webview interaction ID obtained from <a href="https://corefork.telegram.org/method/messages.requestWebView">messages.requestWebView</a>
    ///</summary>
    public string BotQueryId { get; set; }

    ///<summary>
    /// Message to send
    /// See <a href="https://corefork.telegram.org/type/InputBotInlineResult" />
    ///</summary>
    public MyTelegram.Schema.IInputBotInlineResult Result { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        BotQueryId = buffer.ReadString();
        Result = buffer.Read<MyTelegram.Schema.IInputBotInlineResult>();
    }
}
