using MemoryPack;

namespace Insight.Agent.Messages
{
    [MemoryPackUnion(50, typeof(Drive))]
    [MemoryPackUnion(51, typeof(DriveList))]
    public partial interface IAgentMessage { }

    [MemoryPackable]
    public partial class Drive : IAgentMessage
    {
        [MemoryPackOrder(0)]
        public uint? Index { get; set; }

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

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

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

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

        [MemoryPackOrder(5)]
        public ulong? Size { get; set; }

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

        [MemoryPackOrder(7)]
        public string? InterfaceType { get; set; }

        [MemoryPackOrder(8)]
        public string? FirmwareRevision { get; set; }

        [MemoryPackOrder(9)]
        public string? PNPDeviceID { get; set; }

        [MemoryPackOrder(10)]
        public List<Volume>? Volumes { get; set; }
    }

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

    [MemoryPackable]
    public partial class Volume : IAgentMessage
    {
        [MemoryPackOrder(0)]
        public uint? Index { get; set; }

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

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

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

        [MemoryPackOrder(4)]
        public ulong? Size { get; set; }

        [MemoryPackOrder(5)]
        public ulong? FreeSpace { get; set; }

        [MemoryPackOrder(6)]
        public string? Type { get; set; }

        [MemoryPackOrder(7)]
        public string? FileSystem { get; set; }

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

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

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

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

        [MemoryPackOrder(12)]
        public ulong? BlockSize { get; set; }

        [MemoryPackOrder(13)]
        public ulong? NumberOfBlocks { get; set; }

        [MemoryPackOrder(14)]
        public ulong? StartingOffset { get; set; }

        [MemoryPackOrder(15)]
        public DriveType? DriveType { get; set; }

        [MemoryPackOrder(16)]
        public string? ProviderName { get; set; }
    }
}