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