Map<String, Object?> toJson() => { 'collection': collection, 'name': name, 'contentType': contentType, 'sizeBytes': sizeBytes, if (metadata != null) 'metadata': metadata, };