using MemoryPack;

namespace Insight.Agent.Messages
{
    [MemoryPackUnion(150, typeof(User))]
    [MemoryPackUnion(151, typeof(UserList))]
    public partial interface IAgentMessage { }

    [MemoryPackable]
    public partial class User : IAgentMessage
    {
        [MemoryPackOrder(0)]
        public string? Sid { get; set; }

        [MemoryPackOrder(1)]
        public string? Domain { get; set; }

        [MemoryPackOrder(2)]
        public string? Name { get; set; }

        [MemoryPackOrder(3)]
        public string? FullName { get; set; }

        [MemoryPackOrder(4)]
        public string? Description { get; set; }

        [MemoryPackOrder(5)]
        public string? Status { get; set; }

        [MemoryPackOrder(6)]
        public bool? LocalAccount { get; set; }

        [MemoryPackOrder(7)]
        public bool? Disabled { get; set; }

        [MemoryPackOrder(8)]
        public bool? Lockout { get; set; }

        [MemoryPackOrder(9)]
        public bool? PasswordChangeable { get; set; }

        [MemoryPackOrder(10)]
        public bool? PasswordExpires { get; set; }

        [MemoryPackOrder(11)]
        public bool? PasswordRequired { get; set; }

        [MemoryPackOrder(12)]
        public List<Group>? Groups { get; set; }
    }

    [MemoryPackable(GenerateType.Collection)]
    public partial class UserList : List<User>, IAgentMessage { }

    [MemoryPackable]
    public partial class Group : IAgentMessage
    {
        [MemoryPackOrder(0)]
        public string? Sid { get; set; }

        [MemoryPackOrder(1)]
        public string? Domain { get; set; }

        [MemoryPackOrder(2)]
        public string? Name { get; set; }

        [MemoryPackOrder(3)]
        public string? Description { get; set; }

        [MemoryPackOrder(4)]
        public bool? LocalAccount { get; set; }
    }
}