using Org.Eclipse.Tahu.Protobuf;
namespace ZB.MOM.WW.OtOpcUa.Driver.Mqtt.SparkplugSimulator;
///
/// One metric in a simulated edge node's (or device's) catalog: the name a birth certificate
/// declares, the alias it binds that name to for the life of the birth, the Sparkplug datatype, and
/// the value the birth publishes.
///
/// The stable metric name โ what an authored tag binds to.
///
/// The per-birth alias. Mutable across rebirths by design: reassigning an alias to a
/// different metric on a rebirth is legal Sparkplug and is ยง3.6 matrix case (i), the one that
/// silently mis-routes data in a driver that binds by alias.
///
/// The Sparkplug datatype the birth declares for this metric.
///
/// The value the birth publishes. is encoded as an explicit
/// is_null metric rather than as an omitted value โ those mean different things on the wire.
///
public sealed record SparkplugMetricSeed(string Name, ulong Alias, DataType DataType, object? Value)
{
/// Returns this seed with a different value, leaving name/alias/type alone.
/// The new value.
/// The updated seed.
public SparkplugMetricSeed WithValue(object? value) => this with { Value = value };
/// Returns this seed with a different alias โ the alias-reuse case.
/// The new alias.
/// The updated seed.
public SparkplugMetricSeed WithAlias(ulong alias) => this with { Alias = alias };
}