PatchbayCaptureResultWire.fromJson constructor

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

Decodes a strict JSON object at path.

Implementation

factory PatchbayCaptureResultWire.fromJson(
  Map<String, Object?> json, {
  String path = r'$',
}) {
  _wireKeys(json, const <String>{
    'outcome',
    'source',
    'target',
    'targetId',
    'generation',
    'width',
    'height',
    'pixelRatio',
    'pixelFormat',
    'capturedAt',
    'requestedFrames',
    'observedFrames',
    'maxPixels',
    'maxBytes',
    'warnings',
    'blob',
  }, path);
  return PatchbayCaptureResultWire(
    outcome: _wireString(json['outcome'], '$path.outcome'),
    source: PatchbayFactSourceWire.fromJson(
      json['source'],
      path: '$path.source',
    ),
    target: PatchbayCaptureTargetWire.fromJson(
      json['target'],
      path: '$path.target',
    ),
    targetId: json['targetId'] == null
        ? null
        : _wireString(json['targetId'], '$path.targetId'),
    generation: json['generation'] == null
        ? null
        : _wireInt(json['generation'], '$path.generation'),
    width: _wireInt(json['width'], '$path.width'),
    height: _wireInt(json['height'], '$path.height'),
    pixelRatio: _wireNum(json['pixelRatio'], '$path.pixelRatio'),
    pixelFormat: _wireString(json['pixelFormat'], '$path.pixelFormat'),
    capturedAt: _wireString(json['capturedAt'], '$path.capturedAt'),
    requestedFrames: _wireInt(
      json['requestedFrames'],
      '$path.requestedFrames',
    ),
    observedFrames: _wireInt(json['observedFrames'], '$path.observedFrames'),
    maxPixels: _wireInt(json['maxPixels'], '$path.maxPixels'),
    maxBytes: _wireInt(json['maxBytes'], '$path.maxBytes'),
    warnings: _wireList(json['warnings'], '$path.warnings')
        .map(
          (item) => PatchbayCaptureWarningWire.fromJson(
            item,
            path: '$path.warnings[]',
          ),
        )
        .toList(growable: false),
    blob: PatchbayBlobMetadataWire.fromJson(
      _wireMap(json['blob'], '$path.blob'),
      path: '$path.blob',
    ),
  );
}