using MemoryPack;
using System.Runtime.InteropServices;

namespace Insight.Agent.Messages
{
    [MemoryPackUnion(120, typeof(Application))]
    [MemoryPackUnion(121, typeof(ApplicationList))]
    public partial interface IAgentMessage { }

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

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

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

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

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

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

        [MemoryPackOrder(6)]
        public DateTime? InstallDate { get; set; }

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

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

}