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

namespace MyTelegram.Schema.Payments;

///<summary>
/// Apply a <a href="https://corefork.telegram.org/api/giveaways">Telegram Premium giftcode »</a>
/// <para>Possible errors</para>
/// Code Type Description
/// 400 GIFT_SLUG_EXPIRED The specified gift slug has expired.
/// 400 GIFT_SLUG_INVALID The specified slug is invalid.
/// 420 PREMIUM_SUB_ACTIVE_UNTIL_%d You already have a premium subscription active until unixtime %d .
/// See <a href="https://corefork.telegram.org/method/payments.applyGiftCode" />
///</summary>
[TlObject(0xf6e26854)]
public sealed class RequestApplyGiftCode : IRequest<MyTelegram.Schema.IUpdates>
{
    public uint ConstructorId => 0xf6e26854;
    ///<summary>
    /// The code to apply
    ///</summary>
    public string Slug { get; set; }

    public void ComputeFlag()
    {

    }

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

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