using MemoryPack;

namespace Insight.Agent.Messages
{
    [MemoryPackUnion(10, typeof(Event))]
    public partial interface IAgentMessage { }

    [MemoryPackable]
    public partial class Event : IAgentMessage
    {
        [MemoryPackOrder(0)]
        public DateTime? Timestamp { get; set; }

        [MemoryPackOrder(1)]
        public StatusType? Status { get; set; }

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

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

        [MemoryPackOrder(4)]
        public int? EventId { get; set; }

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

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

        public enum StatusType
        {
            Unknown = 0,
            Information = 1,
            Warning = 2,
            Error = 3,
            Critical = 4
        }
    }
}