PatchbaySemanticsSnapshotWire.fromJson constructor

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

Decodes a strict JSON object at path.

Implementation

factory PatchbaySemanticsSnapshotWire.fromJson(
  Map<String, Object?> json, {
  String path = r'$',
}) {
  _wireKeys(json, const <String>{
    'outcome',
    'source',
    'treeRevision',
    'rootNodeId',
    'truncated',
    'nodeCount',
    'nodes',
  }, path);
  return PatchbaySemanticsSnapshotWire(
    outcome: _wireString(json['outcome'], '$path.outcome'),
    source: PatchbayFactSourceWire.fromJson(
      json['source'],
      path: '$path.source',
    ),
    treeRevision: _wireInt(json['treeRevision'], '$path.treeRevision'),
    rootNodeId: _wireInt(json['rootNodeId'], '$path.rootNodeId'),
    truncated: _wireBool(json['truncated'], '$path.truncated'),
    nodeCount: _wireInt(json['nodeCount'], '$path.nodeCount'),
    nodes: _wireList(json['nodes'], '$path.nodes')
        .map(
          (item) => PatchbaySemanticsNodeWire.fromJson(
            _wireMap(item, '$path.nodes[]'),
            path: '$path.nodes[]',
          ),
        )
        .toList(growable: false),
  );
}