fromJson static method
Implementation
static RequestResult fromJson(dynamic data) {
dynamic json = data;
if (data.runtimeType == String) {
json = jsonDecode(data);
}
return RequestResult(
json.containsKey('folderId') ? json['folderId'] as String? : null,
json.containsKey('type')
? (json['type'] as String).typeFromString()
: null,
json.containsKey('errorCode') ? json['errorCode'] as int? : null,
json.containsKey('errorMessage') ? json['errorMessage'] as String? : null,
json.containsKey('mode')
? (json['mode'] as String).modeFromString()
: null,
_parseConfidenceScore(json['confidenceScore']),
json.containsKey('resolution')
? (json['resolution'] as String).resolutionFromString()
: null,
json['status'] as bool? ?? false,
);
}