toJson method

Map<String, dynamic> toJson()

Serializes to a JSON map. The optional fields are omitted when unknown, so the wire shape stays identical for agents that do not report them.

Implementation

Map<String, dynamic> toJson() => {
  'os': os,
  'arch': arch,
  'agentVersion': agentVersion,
  'hostname': hostname,
  if (osVersion != null) 'osVersion': osVersion,
  if (cpuCount != null) 'cpuCount': cpuCount,
  if (runtimeVersion != null) 'runtimeVersion': runtimeVersion,
};