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

namespace MyTelegram.Schema.Account;

///<summary>
/// Send the verification phone code for telegram <a href="https://corefork.telegram.org/passport">passport</a>.
/// <para>Possible errors</para>
/// Code Type Description
/// 400 PHONE_NUMBER_INVALID The phone number is invalid.
/// See <a href="https://corefork.telegram.org/method/account.sendVerifyPhoneCode" />
///</summary>
[TlObject(0xa5a356f9)]
public sealed class RequestSendVerifyPhoneCode : IRequest<MyTelegram.Schema.Auth.ISentCode>
{
    public uint ConstructorId => 0xa5a356f9;
    ///<summary>
    /// The phone number to verify
    ///</summary>
    public string PhoneNumber { get; set; }

    ///<summary>
    /// Phone code settings
    /// See <a href="https://corefork.telegram.org/type/CodeSettings" />
    ///</summary>
    public MyTelegram.Schema.ICodeSettings Settings { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        PhoneNumber = buffer.ReadString();
        Settings = buffer.Read<MyTelegram.Schema.ICodeSettings>();
    }
}
