toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  final data = <String, Object?>{
    'id': id,
    'kind': kind,
    'label': label,
    'type': type,
    'owner': owner,
    'scope': scope,
    'updatedAt': updatedAt,
    'note': note,
  };
  if (status != null) data['status'] = status;
  if (value != null) data['value'] = value;
  if (listeners != null) data['listeners'] = listeners;
  if (dependencies != null) data['dependencies'] = dependencies;
  if (writes != null) data['writes'] = writes;
  if (runs != null) data['runs'] = runs;
  if (lastDurationUs != null) data['lastDurationUs'] = lastDurationUs;
  if (operation != null) data['operation'] = operation;
  if (deltas != null) {
    data['deltas'] = deltas!.map((delta) => delta.toJson()).toList();
  }
  if (mutations != null) data['mutations'] = mutations;
  return data;
}