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