PatchbayJobSnapshotWire.fromJson constructor

PatchbayJobSnapshotWire.fromJson(
  1. Map<String, Object?> json, {
  2. String path = r'$',
})

Decodes a strict JSON object at path.

Implementation

factory PatchbayJobSnapshotWire.fromJson(
  Map<String, Object?> json, {
  String path = r'$',
}) {
  _wireKeys(json, const <String>{'jobId', 'terminal', 'events'}, path);
  return PatchbayJobSnapshotWire(
    jobId: _wireString(json['jobId'], '$path.jobId'),
    terminal: _wireBool(json['terminal'], '$path.terminal'),
    events: _wireList(json['events'], '$path.events')
        .map(
          (item) => PatchbayJobEventWire.fromJson(
            _wireMap(item, '$path.events[]'),
            path: '$path.events[]',
          ),
        )
        .toList(growable: false),
  );
}