from method

Given a String, will return the correct SonarrHistoryEventType object.

Implementation

SonarrHistoryEventType? from(String? type) {
    switch(type) {
        case 'episodeFileRenamed': return SonarrHistoryEventType.EPISODE_FILE_RENAMED;
        case 'episodeFileDeleted': return SonarrHistoryEventType.EPISODE_FILE_DELETED;
        case 'downloadFolderImported': return SonarrHistoryEventType.DOWNLOAD_FOLDER_IMPORTED;
        case 'downloadFailed': return SonarrHistoryEventType.DOWNLOAD_FAILED;
        case 'grabbed': return SonarrHistoryEventType.GRABBED;
        default: return null;
    }
}