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

namespace MyTelegram.Schema.Payments;

///<summary>
/// Convert a <a href="https://corefork.telegram.org/api/gifts">received gift »</a> into Telegram Stars: this will permanently destroy the gift, converting it into <a href="https://corefork.telegram.org/constructor/starGift">starGift</a>.<code>convert_stars</code> <a href="https://corefork.telegram.org/api/stars">Telegram Stars</a>, added to the user's balance.Note that <a href="https://corefork.telegram.org/constructor/starGift">starGift</a>.<code>convert_stars</code> will be less than the buying price (<a href="https://corefork.telegram.org/constructor/starGift">starGift</a>.<code>stars</code>) of the gift if it was originally bought using Telegram Stars bought a long time ago.
/// See <a href="https://corefork.telegram.org/method/payments.convertStarGift" />
///</summary>
[TlObject(0x74bf076b)]
public sealed class RequestConvertStarGift : IRequest<IBool>
{
    public uint ConstructorId => 0x74bf076b;
    public MyTelegram.Schema.IInputSavedStarGift Stargift { get; set; }

    public void ComputeFlag()
    {

    }

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

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