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

namespace MyTelegram.Schema.Auth;

///<summary>
/// Try logging to an account protected by a <a href="https://corefork.telegram.org/api/srp">2FA password</a>.
/// <para>Possible errors</para>
/// Code Type Description
/// 400 PASSWORD_HASH_INVALID The provided password hash is invalid.
/// 400 SRP_ID_INVALID Invalid SRP ID provided.
/// 400 SRP_PASSWORD_CHANGED Password has changed.
/// See <a href="https://corefork.telegram.org/method/auth.checkPassword" />
///</summary>
[TlObject(0xd18b4d16)]
public sealed class RequestCheckPassword : IRequest<MyTelegram.Schema.Auth.IAuthorization>
{
    public uint ConstructorId => 0xd18b4d16;
    ///<summary>
    /// The account's password (see <a href="https://corefork.telegram.org/api/srp">SRP</a>)
    /// See <a href="https://corefork.telegram.org/type/InputCheckPasswordSRP" />
    ///</summary>
    public MyTelegram.Schema.IInputCheckPasswordSRP Password { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Password = buffer.Read<MyTelegram.Schema.IInputCheckPasswordSRP>();
    }
}
