PatchbayCommandDescriptorWire.fromJson constructor
Decodes a strict JSON object at path.
Implementation
factory PatchbayCommandDescriptorWire.fromJson(
Map<String, Object?> json, {
String path = r'$',
}) {
_wireKeys(json, const <String>{
'name',
'summary',
'plane',
'mode',
'sideEffect',
'factSources',
'gates',
'parameters',
}, path);
return PatchbayCommandDescriptorWire(
name: _wireString(json['name'], '$path.name'),
summary: _wireString(json['summary'], '$path.summary'),
plane: PatchbayPlaneWire.fromJson(json['plane'], path: '$path.plane'),
mode: PatchbayCommandModeWire.fromJson(json['mode'], path: '$path.mode'),
sideEffect: PatchbaySideEffectWire.fromJson(
json['sideEffect'],
path: '$path.sideEffect',
),
factSources: _wireList(json['factSources'], '$path.factSources')
.map(
(item) => PatchbayFactSourceWire.fromJson(
item,
path: '$path.factSources[]',
),
)
.toList(growable: false),
gates: _wireList(json['gates'], '$path.gates')
.map((item) => _wireString(item, '$path.gates[]'))
.toList(growable: false),
parameters: _wireList(json['parameters'], '$path.parameters')
.map(
(item) => PatchbayParameterDescriptorWire.fromJson(
_wireMap(item, '$path.parameters[]'),
path: '$path.parameters[]',
),
)
.toList(growable: false),
);
}