PatchbayLogQueryRequestWire.fromJson constructor
Decodes a strict JSON object at path.
Implementation
factory PatchbayLogQueryRequestWire.fromJson(
Map<String, Object?> json, {
String path = r'$',
}) {
_wireKeys(json, const <String>{
'cursor',
'direction',
'limit',
'levels',
'categories',
'since',
'until',
}, path);
return PatchbayLogQueryRequestWire(
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'),
);
}