using MemoryPack;

namespace Insight.Agent.Messages
{
    [MemoryPackUnion(1000, typeof(ConsoleQuery))]
    [MemoryPackUnion(1001, typeof(ConsoleQueryRequest))]
    public partial interface IAgentMessage { }

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

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

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

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

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

        [MemoryPackOrder(5)]
        public bool IsString { get; set; }

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

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

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

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

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