Map<String, dynamic> toJson() { final name = this.name; final version = this.version; return { if (name != null) 'name': name.toValue(), if (version != null) 'version': version, }; }