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

namespace MyTelegram.Schema.Auth;

///<summary>
/// Generate a login token, for <a href="https://corefork.telegram.org/api/qr-login">login via QR code</a>.<br>
/// The generated login token should be encoded using base64url, then shown as a <code>tg://login?token=base64encodedtoken</code> <a href="https://corefork.telegram.org/api/links#qr-code-login-links">deep link »</a> in the QR code.For more info, see <a href="https://corefork.telegram.org/api/qr-login">login via QR code</a>.
/// <para>Possible errors</para>
/// Code Type Description
/// 400 API_ID_INVALID API ID invalid.
/// 400 API_ID_PUBLISHED_FLOOD This API id was published somewhere, you can't use it now.
/// See <a href="https://corefork.telegram.org/method/auth.exportLoginToken" />
///</summary>
[TlObject(0xb7e085fe)]
public sealed class RequestExportLoginToken : IRequest<MyTelegram.Schema.Auth.ILoginToken>
{
    public uint ConstructorId => 0xb7e085fe;
    ///<summary>
    /// Application identifier (see. <a href="https://corefork.telegram.org/myapp">App configuration</a>)
    ///</summary>
    public int ApiId { get; set; }

    ///<summary>
    /// Application identifier hash (see. <a href="https://corefork.telegram.org/myapp">App configuration</a>)
    ///</summary>
    public string ApiHash { get; set; }

    ///<summary>
    /// List of already logged-in user IDs, to prevent logging in twice with the same user
    ///</summary>
    public TVector<long> ExceptIds { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        ApiId = buffer.ReadInt32();
        ApiHash = buffer.ReadString();
        ExceptIds = buffer.Read<TVector<long>>();
    }
}
