PatchbayLogBatchWire.fromJson constructor

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

Decodes a strict JSON object at path.

Implementation

factory PatchbayLogBatchWire.fromJson(
  Map<String, Object?> json, {
  String path = r'$',
}) {
  _wireKeys(json, const <String>{
    'outcome',
    'source',
    'records',
    'nextCursor',
    'currentCursor',
    'truncated',
    'truncation',
    'elapsedMs',
  }, path);
  return PatchbayLogBatchWire(
    outcome: PatchbayLogBatchOutcomeWire.fromJson(
      json['outcome'],
      path: '$path.outcome',
    ),
    source: PatchbayFactSourceWire.fromJson(
      json['source'],
      path: '$path.source',
    ),
    records: _wireList(json['records'], '$path.records')
        .map(
          (item) => PatchbayLogRecordWire.fromJson(
            _wireMap(item, '$path.records[]'),
            path: '$path.records[]',
          ),
        )
        .toList(growable: false),
    nextCursor: json['nextCursor'] == null
        ? null
        : _wireString(json['nextCursor'], '$path.nextCursor'),
    currentCursor: json['currentCursor'] == null
        ? null
        : _wireString(json['currentCursor'], '$path.currentCursor'),
    truncated: _wireBool(json['truncated'], '$path.truncated'),
    truncation: json['truncation'] == null
        ? null
        : PatchbayLogTruncationWire.fromJson(
            json['truncation'],
            path: '$path.truncation',
          ),
    elapsedMs: _wireInt(json['elapsedMs'], '$path.elapsedMs'),
  );
}