toJson method

Map<String, dynamic> toJson()

Converts this model file to a JSON map.

Implementation

Map<String, dynamic> toJson() {
  return {
    'id': id,
    'name': name,
    'sizeKB': sizeKB,
    'type': type.toJson(),
    if (hashes != null) 'hashes': hashes,
    if (downloadUrl != null) 'downloadUrl': downloadUrl,
    if (primary != null) 'primary': primary,
    if (metadata != null) 'metadata': metadata,
  };
}