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

namespace MyTelegram.Schema.Account;

///<summary>
/// Confirm a phone number to cancel account deletion, for more info <a href="https://corefork.telegram.org/api/account-deletion">click here »</a>
/// <para>Possible errors</para>
/// Code Type Description
/// 400 CODE_HASH_INVALID Code hash invalid.
/// 400 PHONE_CODE_EMPTY phone_code is missing.
/// See <a href="https://corefork.telegram.org/method/account.confirmPhone" />
///</summary>
[TlObject(0x5f2178c3)]
public sealed class RequestConfirmPhone : IRequest<IBool>
{
    public uint ConstructorId => 0x5f2178c3;
    ///<summary>
    /// Phone code hash, for more info <a href="https://corefork.telegram.org/api/account-deletion">click here »</a>
    ///</summary>
    public string PhoneCodeHash { get; set; }

    ///<summary>
    /// SMS code, for more info <a href="https://corefork.telegram.org/api/account-deletion">click here »</a>
    ///</summary>
    public string PhoneCode { get; set; }

    public void ComputeFlag()
    {

    }

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

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