using MessagePack;

namespace ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Shared.Contracts;

[MessagePackObject]
public sealed class SubscribeRequest
{
    [Key(0)] public long SessionId { get; set; }
    [Key(1)] public string[] TagReferences { get; set; } = System.Array.Empty<string>();
    [Key(2)] public int RequestedIntervalMs { get; set; } = 1000;
}

[MessagePackObject]
public sealed class SubscribeResponse
{
    [Key(0)] public bool Success { get; set; }
    [Key(1)] public string? Error { get; set; }
    [Key(2)] public long SubscriptionId { get; set; }
    [Key(3)] public int ActualIntervalMs { get; set; }
}

[MessagePackObject]
public sealed class UnsubscribeRequest
{
    [Key(0)] public long SessionId { get; set; }
    [Key(1)] public long SubscriptionId { get; set; }
}

[MessagePackObject]
public sealed class OnDataChangeNotification
{
    [Key(0)] public long SubscriptionId { get; set; }
    [Key(1)] public GalaxyDataValue[] Values { get; set; } = System.Array.Empty<GalaxyDataValue>();
}
