PatchbayKeepAwakeStateWire.fromJson constructor

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

Decodes a strict JSON object at path.

Implementation

factory PatchbayKeepAwakeStateWire.fromJson(
  Map<String, Object?> json, {
  String path = r'$',
}) {
  _wireKeys(json, const <String>{
    'outcome',
    'source',
    'wired',
    'enabled',
    'leaseMs',
    'leaseRemainingMs',
    'lastRelease',
    'lastReleaseFailure',
  }, path);
  return PatchbayKeepAwakeStateWire(
    outcome: _wireString(json['outcome'], '$path.outcome'),
    source: PatchbayFactSourceWire.fromJson(
      json['source'],
      path: '$path.source',
    ),
    wired: _wireBool(json['wired'], '$path.wired'),
    enabled: _wireBool(json['enabled'], '$path.enabled'),
    leaseMs: json['leaseMs'] == null
        ? null
        : _wireInt(json['leaseMs'], '$path.leaseMs'),
    leaseRemainingMs: json['leaseRemainingMs'] == null
        ? null
        : _wireInt(json['leaseRemainingMs'], '$path.leaseRemainingMs'),
    lastRelease: json['lastRelease'] == null
        ? null
        : PatchbayKeepAwakeReleaseWire.fromJson(
            json['lastRelease'],
            path: '$path.lastRelease',
          ),
    lastReleaseFailure: json['lastReleaseFailure'] == null
        ? null
        : _wireString(json['lastReleaseFailure'], '$path.lastReleaseFailure'),
  );
}