factory Resource.fromJson(Map<String, dynamic> json) { return Resource( (json['attributes'] as List).map((e) => api.Attribute.fromJson(e)).toList(), ); }