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

namespace MyTelegram.Schema;

///<summary>
/// This object represents a portion of the price for goods or services.
/// See <a href="https://corefork.telegram.org/constructor/labeledPrice" />
///</summary>
[TlObject(0xcb296bf8)]
public sealed class TLabeledPrice : ILabeledPrice
{
    public uint ConstructorId => 0xcb296bf8;
    ///<summary>
    /// Portion label
    ///</summary>
    public string Label { get; set; }

    ///<summary>
    /// Price of the product 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(Label);
        writer.Write(Amount);
    }

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