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

namespace MyTelegram.Schema.Auth;

///<summary>
/// Login using a redirected login token, generated in case of DC mismatch during <a href="https://corefork.telegram.org/api/qr-login">QR code login</a>.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 AUTH_TOKEN_ALREADY_ACCEPTED The specified auth token was already accepted.
/// 400 AUTH_TOKEN_EXPIRED The authorization token has expired.
/// 400 AUTH_TOKEN_INVALID The specified auth token is invalid.
/// 400 AUTH_TOKEN_INVALIDX The specified auth token is invalid.
/// See <a href="https://corefork.telegram.org/method/auth.importLoginToken" />
///</summary>
[TlObject(0x95ac5ce4)]
public sealed class RequestImportLoginToken : IRequest<MyTelegram.Schema.Auth.ILoginToken>
{
    public uint ConstructorId => 0x95ac5ce4;
    ///<summary>
    /// Login token
    ///</summary>
    public ReadOnlyMemory<byte> Token { get; set; }

    public void ComputeFlag()
    {

    }

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

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