toJson method
Implementation
Map<String, dynamic> toJson() {
final enabled = this.enabled;
final events = this.events;
return {
if (enabled != null) 'enabled': enabled,
if (events != null) 'events': events.map((e) => e.toValue()).toList(),
};
}