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

namespace MyTelegram.Schema.Account;

///<summary>
/// Set time-to-live of current session
/// <para>Possible errors</para>
/// Code Type Description
/// 406 FRESH_RESET_AUTHORISATION_FORBIDDEN You can't logout other sessions if less than 24 hours have passed since you logged on the current session.
/// 400 TTL_DAYS_INVALID The provided TTL is invalid.
/// See <a href="https://corefork.telegram.org/method/account.setAuthorizationTTL" />
///</summary>
[TlObject(0xbf899aa0)]
public sealed class RequestSetAuthorizationTTL : IRequest<IBool>
{
    public uint ConstructorId => 0xbf899aa0;
    ///<summary>
    /// Time-to-live of current session in days
    ///</summary>
    public int AuthorizationTtlDays { get; set; }

    public void ComputeFlag()
    {

    }

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

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