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

namespace MyTelegram.Schema.Auth;

///<summary>
/// Login token (for <a href="https://corefork.telegram.org/api/qr-login">QR code login</a>)
/// See <a href="https://corefork.telegram.org/constructor/auth.loginToken" />
///</summary>
[TlObject(0x629f1980)]
public sealed class TLoginToken : ILoginToken
{
    public uint ConstructorId => 0x629f1980;
    ///<summary>
    /// Expiration date of QR code
    ///</summary>
    public int Expires { get; set; }

    ///<summary>
    /// Token to render in QR code
    ///</summary>
    public ReadOnlyMemory<byte> Token { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Expires = buffer.ReadInt32();
        Token = buffer.ReadBytes();
    }
}