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

namespace MyTelegram.Schema.Account;

///<summary>
/// Logged-in sessions
/// See <a href="https://corefork.telegram.org/constructor/account.authorizations" />
///</summary>
[TlObject(0x4bff8ea0)]
public sealed class TAuthorizations : IAuthorizations
{
    public uint ConstructorId => 0x4bff8ea0;
    ///<summary>
    /// Time-to-live of session
    ///</summary>
    public int AuthorizationTtlDays { get; set; }

    ///<summary>
    /// Logged-in sessions
    ///</summary>
    public TVector<MyTelegram.Schema.IAuthorization> Authorizations { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        AuthorizationTtlDays = buffer.ReadInt32();
        Authorizations = buffer.Read<TVector<MyTelegram.Schema.IAuthorization>>();
    }
}