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

namespace MyTelegram.Schema.Bots;

///<summary>
/// Set bot command list
/// <para>Possible errors</para>
/// Code Type Description
/// 400 BOT_COMMAND_DESCRIPTION_INVALID The specified command description is invalid.
/// 400 BOT_COMMAND_INVALID The specified command is invalid.
/// 400 LANG_CODE_INVALID The specified language code is invalid.
/// 400 PEER_ID_INVALID The provided peer id is invalid.
/// 400 USER_BOT_REQUIRED This method can only be called by a bot.
/// 400 USER_ID_INVALID The provided user ID is invalid.
/// See <a href="https://corefork.telegram.org/method/bots.setBotCommands" />
///</summary>
[TlObject(0x517165a)]
public sealed class RequestSetBotCommands : IRequest<IBool>
{
    public uint ConstructorId => 0x517165a;
    ///<summary>
    /// Command scope
    /// See <a href="https://corefork.telegram.org/type/BotCommandScope" />
    ///</summary>
    public MyTelegram.Schema.IBotCommandScope Scope { get; set; }

    ///<summary>
    /// Language code
    ///</summary>
    public string LangCode { get; set; }

    ///<summary>
    /// Bot commands
    ///</summary>
    public TVector<MyTelegram.Schema.IBotCommand> Commands { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Scope);
        writer.Write(LangCode);
        writer.Write(Commands);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Scope = buffer.Read<MyTelegram.Schema.IBotCommandScope>();
        LangCode = buffer.ReadString();
        Commands = buffer.Read<TVector<MyTelegram.Schema.IBotCommand>>();
    }
}
