PatchbayLogExportRequestWire.fromJson constructor

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

Decodes a strict JSON object at path.

Implementation

factory PatchbayLogExportRequestWire.fromJson(
  Map<String, Object?> json, {
  String path = r'$',
}) {
  _wireKeys(json, const <String>{
    'cursor',
    'direction',
    'limit',
    'levels',
    'categories',
    'since',
    'until',
    'ttlMs',
  }, path);
  return PatchbayLogExportRequestWire(
    cursor: json['cursor'] == null
        ? null
        : _wireString(json['cursor'], '$path.cursor'),
    direction: json['direction'] == null
        ? null
        : PatchbayLogDirectionWire.fromJson(
            json['direction'],
            path: '$path.direction',
          ),
    limit: json['limit'] == null
        ? null
        : _wireInt(json['limit'], '$path.limit'),
    levels: json['levels'] == null
        ? const <PatchbayLogLevelWire>[]
        : _wireList(json['levels'], '$path.levels')
              .map(
                (item) => PatchbayLogLevelWire.fromJson(
                  item,
                  path: '$path.levels[]',
                ),
              )
              .toList(growable: false),
    categories: json['categories'] == null
        ? const <String>[]
        : _wireList(json['categories'], '$path.categories')
              .map((item) => _wireString(item, '$path.categories[]'))
              .toList(growable: false),
    since: json['since'] == null
        ? null
        : _wireString(json['since'], '$path.since'),
    until: json['until'] == null
        ? null
        : _wireString(json['until'], '$path.until'),
    ttlMs: json['ttlMs'] == null
        ? null
        : _wireInt(json['ttlMs'], '$path.ttlMs'),
  );
}