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

namespace MyTelegram.Schema.Account;

///<summary>
/// The sent email code
/// See <a href="https://corefork.telegram.org/constructor/account.sentEmailCode" />
///</summary>
[TlObject(0x811f854f)]
public sealed class TSentEmailCode : ISentEmailCode
{
    public uint ConstructorId => 0x811f854f;
    ///<summary>
    /// The email (to which the code was sent) must match this <a href="https://corefork.telegram.org/api/pattern">pattern</a>
    ///</summary>
    public string EmailPattern { get; set; }

    ///<summary>
    /// The length of the verification code
    ///</summary>
    public int Length { get; set; }

    public void ComputeFlag()
    {

    }

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

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