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

namespace MyTelegram.Schema.Account;

///<summary>
/// Get temporary payment password
/// <para>Possible errors</para>
/// Code Type Description
/// 400 PASSWORD_HASH_INVALID The provided password hash is invalid.
/// 400 TMP_PASSWORD_DISABLED The temporary password is disabled.
/// See <a href="https://corefork.telegram.org/method/account.getTmpPassword" />
///</summary>
[TlObject(0x449e0b51)]
public sealed class RequestGetTmpPassword : IRequest<MyTelegram.Schema.Account.ITmpPassword>
{
    public uint ConstructorId => 0x449e0b51;
    ///<summary>
    /// SRP password parameters
    /// See <a href="https://corefork.telegram.org/type/InputCheckPasswordSRP" />
    ///</summary>
    public MyTelegram.Schema.IInputCheckPasswordSRP Password { get; set; }

    ///<summary>
    /// Time during which the temporary password will be valid, in seconds; should be between 60 and 86400
    ///</summary>
    public int Period { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Password = buffer.Read<MyTelegram.Schema.IInputCheckPasswordSRP>();
        Period = buffer.ReadInt32();
    }
}
