Resource constructor

Resource(String type, String id, { Map<String, dynamic> attributes, Link self, Map<String, dynamic> meta, Map<String, Relationship> relationships: const {} })

Implementation

Resource(String this.type, String this.id,
    {Map<String, dynamic> attributes,
    Link this.self,
    Map<String, dynamic> meta,
    Map<String, Relationship> relationships = const {}})
    : meta = Meta.fromJson(meta),
      attributes = Attributes.fromJson(attributes),
      _relationships = relationships {
  if (id != null && id.isEmpty) throw ArgumentError();
  (const Naming()).enforce(type);
}