using MemoryPack;

namespace Insight.Web.Messages
{
    [MemoryPackUnion(1, typeof(ConsoleQueryProxy))]
    [MemoryPackUnion(2, typeof(ConsoleQueryProxyRequest))]
    public partial interface IWebMessage { }

    [MemoryPackable]
    public partial class ConsoleQueryProxy : IWebMessage
    {
        [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(7)]
        public bool HadErrors { get; set; }
    }

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

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

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