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

namespace MyTelegram.Schema.Payments;

///<summary>
/// Generate an <a href="https://corefork.telegram.org/api/links#invoice-links">invoice deep link</a>
/// <para>Possible errors</para>
/// Code Type Description
/// 400 CURRENCY_TOTAL_AMOUNT_INVALID The total amount of all prices is invalid.
/// 400 INVOICE_PAYLOAD_INVALID The specified invoice payload is invalid.
/// 400 MEDIA_INVALID Media invalid.
/// 400 PAYMENT_PROVIDER_INVALID The specified payment provider is invalid.
/// See <a href="https://corefork.telegram.org/method/payments.exportInvoice" />
///</summary>
[TlObject(0xf91b065)]
public sealed class RequestExportInvoice : IRequest<MyTelegram.Schema.Payments.IExportedInvoice>
{
    public uint ConstructorId => 0xf91b065;
    ///<summary>
    /// Invoice
    /// See <a href="https://corefork.telegram.org/type/InputMedia" />
    ///</summary>
    public MyTelegram.Schema.IInputMedia InvoiceMedia { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        InvoiceMedia = buffer.Read<MyTelegram.Schema.IInputMedia>();
    }
}
