namespace NATS.Server.Protocol;

public sealed record MessageTraceContext(
    string? ClientName,
    string? ClientLang,
    string? ClientVersion,
    bool HeadersEnabled)
{
    public static MessageTraceContext Empty { get; } = new(null, null, null, false);

    public static MessageTraceContext CreateFromConnect(ClientOptions? connectOpts)
    {
        if (connectOpts == null)
            return Empty;

        return new MessageTraceContext(
            connectOpts.Name,
            connectOpts.Lang,
            connectOpts.Version,
            connectOpts.Headers);
    }
}
