Map<String, dynamic> toJson() { return { 'type': type, 'options': options?.map((option) => option.toJson()).toList(), 'params': params.toJson(), }; }