Map<String, Object?> toJson() { var id = this.id; var name = this.name; final json = <String, Object?>{}; if (id != null) { json[r'id'] = id; } json[r'name'] = name; return json; }