Map<String, dynamic> toJson() => { 'operation': operation, 'result': result, 'filePath': filePath, if (resultCount != null) 'resultCount': resultCount, if (fileCount != null) 'fileCount': fileCount, };