AnalysisHandleWatchEventsParams.fromJson constructor
AnalysisHandleWatchEventsParams.fromJson(
- JsonDecoder jsonDecoder,
- String jsonPath,
- Object? json
)
Implementation
factory AnalysisHandleWatchEventsParams.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
List<WatchEvent> events;
if (json.containsKey('events')) {
events = jsonDecoder.decodeList(
'$jsonPath.events',
json['events'],
(String jsonPath, Object? json) =>
WatchEvent.fromJson(jsonDecoder, jsonPath, json));
} else {
throw jsonDecoder.mismatch(jsonPath, 'events');
}
return AnalysisHandleWatchEventsParams(events);
} else {
throw jsonDecoder.mismatch(
jsonPath, 'analysis.handleWatchEvents params', json);
}
}