alertDtoToTimelineItem function
Implementation
TimelineItem alertDtoToTimelineItem(AlertDTO alert) {
return TimelineItem(
type: switch (alert.type) {
AlertTypeDTO.shutdown => TimelineItemType.shutdown,
AlertTypeDTO.warning => TimelineItemType.warning,
AlertTypeDTO.runningnotice => TimelineItemType.runningNotice,
AlertTypeDTO.notice => TimelineItemType.notice,
AlertTypeDTO.swaggerGeneratedUnknown || null => TimelineItemType.notice,
},
event: TimelineItemEvent.fromString(alert.event),
isCriticalFault: alert.isCriticalFault ?? false,
canRemoteResetFault: alert.canRemoteResetFault,
date: alert.timestamp,
name: alert.name,
);
}