Map<String, Object?> toJson() => { if (condition != null) 'condition': condition, 'filterId': filterId, if (mode != null) 'mode': mode, };