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

namespace MyTelegram.Schema.Account;

///<summary>
/// Verify an email address.
/// <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_VERIFY_EXPIRED The verification email has expired.
/// 400 PHONE_NUMBER_INVALID The phone number is invalid.
/// See <a href="https://corefork.telegram.org/method/account.verifyEmail" />
///</summary>
[TlObject(0x32da4cf)]
public sealed class RequestVerifyEmail : IRequest<MyTelegram.Schema.Account.IEmailVerified>
{
    public uint ConstructorId => 0x32da4cf;
    ///<summary>
    /// Verification purpose
    /// See <a href="https://corefork.telegram.org/type/EmailVerifyPurpose" />
    ///</summary>
    public MyTelegram.Schema.IEmailVerifyPurpose Purpose { get; set; }

    ///<summary>
    /// Email verification code or token
    /// See <a href="https://corefork.telegram.org/type/EmailVerification" />
    ///</summary>
    public MyTelegram.Schema.IEmailVerification Verification { get; set; }

    public void ComputeFlag()
    {

    }

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

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