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

namespace MyTelegram.Schema.Bots;

///<summary>
/// Reorder a <a href="https://corefork.telegram.org/api/bots/webapps#main-mini-app-previews">main mini app previews, see here »</a> for more info.Only owners of bots with a configured Main Mini App can use this method, see <a href="https://corefork.telegram.org/api/bots/webapps#main-mini-app-previews">see here »</a> for more info on how to check if you can invoke this method.
/// <para>Possible errors</para>
/// Code Type Description
/// 400 BOT_INVALID This is not a valid bot.
/// See <a href="https://corefork.telegram.org/method/bots.reorderPreviewMedias" />
///</summary>
[TlObject(0xb627f3aa)]
public sealed class RequestReorderPreviewMedias : IRequest<IBool>
{
    public uint ConstructorId => 0xb627f3aa;
    ///<summary>
    /// The bot that owns the Main Mini App.
    /// See <a href="https://corefork.telegram.org/type/InputUser" />
    ///</summary>
    public MyTelegram.Schema.IInputUser Bot { get; set; }

    ///<summary>
    /// ISO 639-1 language code, indicating the localization of the previews to reorder.
    ///</summary>
    public string LangCode { get; set; }

    ///<summary>
    /// New order of the previews.
    ///</summary>
    public TVector<MyTelegram.Schema.IInputMedia> Order { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Bot = buffer.Read<MyTelegram.Schema.IInputUser>();
        LangCode = buffer.ReadString();
        Order = buffer.Read<TVector<MyTelegram.Schema.IInputMedia>>();
    }
}
