toJson method

Map<String, Object> toJson()

Implementation

Map<String, Object> toJson() => {
      'type': type,
      'id': id,
      if (attributes.isNotEmpty) 'attributes': attributes,
      if (relationships.isNotEmpty) 'relationships': relationships,
      if (links.isNotEmpty) 'links': links,
      if (meta.isNotEmpty) 'meta': meta,
    };