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

namespace MyTelegram.Schema.Account;

///<summary>
/// Verify an email to use as <a href="https://corefork.telegram.org/api/srp">2FA recovery method</a>.
/// <para>Possible errors</para>
/// Code Type Description
/// 400 CODE_INVALID Code invalid.
/// 400 EMAIL_HASH_EXPIRED Email hash expired.
/// See <a href="https://corefork.telegram.org/method/account.confirmPasswordEmail" />
///</summary>
[TlObject(0x8fdf1920)]
public sealed class RequestConfirmPasswordEmail : IRequest<IBool>
{
    public uint ConstructorId => 0x8fdf1920;
    ///<summary>
    /// The phone code that was received after <a href="https://corefork.telegram.org/api/srp#email-verification">setting a recovery email</a>
    ///</summary>
    public string Code { get; set; }

    public void ComputeFlag()
    {

    }

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

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