fromDynamic static method
Deserializes the command from a Map or a map-like object into the the
proper data model. This will throw an exception if map
is null.
Implementation
static StartLogStreamCommand fromDynamic(
dynamic map,
String id,
DateTime timestamp,
) {
late StartLogStreamCommand result;
if (map == null) {
throw Exception('[StartLogStreamCommand.fromDynamic]: map is null');
} else {
result = StartLogStreamCommand(
id: id,
level: Level.LEVELS.where((level) => level.name == map['level']).first,
timestamp: timestamp,
);
}
return result;
}