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

namespace MyTelegram.Schema.Messages;

///<summary>
/// Send one or more chosen peers, as requested by a <a href="https://corefork.telegram.org/constructor/keyboardButtonRequestPeer">keyboardButtonRequestPeer</a> button.
/// <para>Possible errors</para>
/// Code Type Description
/// 400 PEER_ID_INVALID The provided peer id is invalid.
/// See <a href="https://corefork.telegram.org/method/messages.sendBotRequestedPeer" />
///</summary>
[TlObject(0x91b2d060)]
public sealed class RequestSendBotRequestedPeer : IRequest<MyTelegram.Schema.IUpdates>
{
    public uint ConstructorId => 0x91b2d060;
    ///<summary>
    /// The bot that sent the <a href="https://corefork.telegram.org/constructor/keyboardButtonRequestPeer">keyboardButtonRequestPeer</a> button.
    /// See <a href="https://corefork.telegram.org/type/InputPeer" />
    ///</summary>
    public MyTelegram.Schema.IInputPeer Peer { get; set; }

    ///<summary>
    /// ID of the message that contained the reply keyboard with the <a href="https://corefork.telegram.org/constructor/keyboardButtonRequestPeer">keyboardButtonRequestPeer</a> button.
    ///</summary>
    public int MsgId { get; set; }

    ///<summary>
    /// The <code>button_id</code> field from the <a href="https://corefork.telegram.org/constructor/keyboardButtonRequestPeer">keyboardButtonRequestPeer</a> constructor.
    ///</summary>
    public int ButtonId { get; set; }

    ///<summary>
    /// The chosen peers.
    ///</summary>
    public TVector<MyTelegram.Schema.IInputPeer> RequestedPeers { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Peer);
        writer.Write(MsgId);
        writer.Write(ButtonId);
        writer.Write(RequestedPeers);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Peer = buffer.Read<MyTelegram.Schema.IInputPeer>();
        MsgId = buffer.ReadInt32();
        ButtonId = buffer.ReadInt32();
        RequestedPeers = buffer.Read<TVector<MyTelegram.Schema.IInputPeer>>();
    }
}
