@override Object toJson() { return { if (memory != null) 'memory': memory!.toJson(), if (action.isNotDefault) 'action': action.toJson(), }; }