Map<String, dynamic> toJson() { return { 'id': id, 'type': type, 'attributes': attributes?.toJson(), }; }