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

namespace MyTelegram.Schema.Account;

///<summary>
/// Send an email verification code.
/// <para>Possible errors</para>
/// Code Type Description
/// 400 EMAIL_INVALID The specified email is invalid.
/// 400 EMAIL_NOT_ALLOWED The specified email cannot be used to complete the operation.
/// 400 EMAIL_NOT_SETUP In order to change the login email with emailVerifyPurposeLoginChange, an existing login email must already be set using emailVerifyPurposeLoginSetup.
/// 400 PHONE_HASH_EXPIRED An invalid or expired <code>phone_code_hash</code> was provided.
/// 400 PHONE_NUMBER_INVALID The phone number is invalid.
/// See <a href="https://corefork.telegram.org/method/account.sendVerifyEmailCode" />
///</summary>
[TlObject(0x98e037bb)]
public sealed class RequestSendVerifyEmailCode : IRequest<MyTelegram.Schema.Account.ISentEmailCode>
{
    public uint ConstructorId => 0x98e037bb;
    ///<summary>
    /// Verification purpose.
    /// See <a href="https://corefork.telegram.org/type/EmailVerifyPurpose" />
    ///</summary>
    public MyTelegram.Schema.IEmailVerifyPurpose Purpose { get; set; }

    ///<summary>
    /// The email where to send the code.
    ///</summary>
    public string Email { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Purpose = buffer.Read<MyTelegram.Schema.IEmailVerifyPurpose>();
        Email = buffer.ReadString();
    }
}
