Map<String, Map<String, dynamic>> toMap() { return {"trigger": trigger.toMap(), "action": action.toMap()}; }