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

namespace MyTelegram.Schema;

///<summary>
/// Used to top up the <a href="https://corefork.telegram.org/api/stars">Telegram Stars balance</a> of the current account.
/// See <a href="https://corefork.telegram.org/constructor/inputStorePaymentStarsTopup" />
///</summary>
[TlObject(0xdddd0f56)]
public sealed class TInputStorePaymentStarsTopup : IInputStorePaymentPurpose
{
    public uint ConstructorId => 0xdddd0f56;
    ///<summary>
    /// Amount of stars to topup
    ///</summary>
    public long Stars { get; set; }

    ///<summary>
    /// Three-letter ISO 4217 <a href="https://corefork.telegram.org/bots/payments#supported-currencies">currency</a> code
    ///</summary>
    public string Currency { get; set; }

    ///<summary>
    /// Total price in the smallest units of the currency (integer, not float/double). For example, for a price of <code>US$ 1.45</code> pass <code>amount = 145</code>. See the exp parameter in <a href="https://corefork.telegram.org/bots/payments/currencies.json">currencies.json</a>, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
    ///</summary>
    public long Amount { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Stars = buffer.ReadInt64();
        Currency = buffer.ReadString();
        Amount = buffer.ReadInt64();
    }
}