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

namespace MyTelegram.Schema.Account;

///<summary>
/// Verify a phone number for telegram <a href="https://corefork.telegram.org/passport">passport</a>.
/// <para>Possible errors</para>
/// Code Type Description
/// 400 PHONE_CODE_EMPTY phone_code is missing.
/// 400 PHONE_CODE_EXPIRED The phone code you provided has expired.
/// 400 PHONE_NUMBER_INVALID The phone number is invalid.
/// See <a href="https://corefork.telegram.org/method/account.verifyPhone" />
///</summary>
[TlObject(0x4dd3a7f6)]
public sealed class RequestVerifyPhone : IRequest<IBool>
{
    public uint ConstructorId => 0x4dd3a7f6;
    ///<summary>
    /// Phone number
    ///</summary>
    public string PhoneNumber { get; set; }

    ///<summary>
    /// Phone code hash received from the call to <a href="https://corefork.telegram.org/method/account.sendVerifyPhoneCode">account.sendVerifyPhoneCode</a>
    ///</summary>
    public string PhoneCodeHash { get; set; }

    ///<summary>
    /// Code received after the call to <a href="https://corefork.telegram.org/method/account.sendVerifyPhoneCode">account.sendVerifyPhoneCode</a>
    ///</summary>
    public string PhoneCode { get; set; }

    public void ComputeFlag()
    {

    }

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

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