fromCode static method
Deserialize from the single-character code in the endpoint name.
Implementation
static NodeRole fromCode(String code) {
return NodeRole.values.firstWhere(
(r) => r.code == code,
orElse: () => NodeRole.group, // Safe default
);
}