enum RemoteAssetMetadataKey { mobileApp("mobile-app"); final String key; const RemoteAssetMetadataKey(this.key); } abstract class RemoteAssetMetadataValue { const RemoteAssetMetadataValue(); Map toJson(); } class RemoteAssetMetadataItem { final RemoteAssetMetadataKey key; final RemoteAssetMetadataValue value; const RemoteAssetMetadataItem({required this.key, required this.value}); Map toJson() { return {'key': key.key, 'value': value}; } } class RemoteAssetMobileAppMetadata extends RemoteAssetMetadataValue { final String? cloudId; const RemoteAssetMobileAppMetadata({this.cloudId}); @override Map toJson() { final map = {}; if (cloudId != null) { map["iCloudId"] = cloudId; } return map; } }