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

namespace MyTelegram.Schema.Auth;

///<summary>
/// Login by importing an authorization token
/// <para>Possible errors</para>
/// Code Type Description
/// 400 API_ID_INVALID API ID invalid.
/// See <a href="https://corefork.telegram.org/method/auth.importWebTokenAuthorization" />
///</summary>
[TlObject(0x2db873a9)]
public sealed class RequestImportWebTokenAuthorization : IRequest<MyTelegram.Schema.Auth.IAuthorization>
{
    public uint ConstructorId => 0x2db873a9;
    ///<summary>
    /// <a href="https://corefork.telegram.org/api/obtaining_api_id">API ID</a>
    ///</summary>
    public int ApiId { get; set; }

    ///<summary>
    /// <a href="https://corefork.telegram.org/api/obtaining_api_id">API hash</a>
    ///</summary>
    public string ApiHash { get; set; }

    ///<summary>
    /// The authorization token
    ///</summary>
    public string WebAuthToken { get; set; }

    public void ComputeFlag()
    {

    }

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

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