mirror of
https://github.com/immich-app/immich.git
synced 2025-10-24 23:39:03 -04:00
41 lines
833 B
Dart
41 lines
833 B
Dart
enum RemoteAssetMetadataKey {
|
|
mobileApp("mobile-app");
|
|
|
|
final String key;
|
|
|
|
const RemoteAssetMetadataKey(this.key);
|
|
}
|
|
|
|
abstract class RemoteAssetMetadataValue {
|
|
const RemoteAssetMetadataValue();
|
|
|
|
Map<String, dynamic> toJson();
|
|
}
|
|
|
|
class RemoteAssetMetadataItem {
|
|
final RemoteAssetMetadataKey key;
|
|
final RemoteAssetMetadataValue value;
|
|
|
|
const RemoteAssetMetadataItem({required this.key, required this.value});
|
|
|
|
Map<String, Object?> toJson() {
|
|
return {'key': key.key, 'value': value};
|
|
}
|
|
}
|
|
|
|
class RemoteAssetMobileAppMetadata extends RemoteAssetMetadataValue {
|
|
final String? cloudId;
|
|
|
|
const RemoteAssetMobileAppMetadata({this.cloudId});
|
|
|
|
@override
|
|
Map<String, dynamic> toJson() {
|
|
final map = <String, Object?>{};
|
|
if (cloudId != null) {
|
|
map["iCloudId"] = cloudId;
|
|
}
|
|
|
|
return map;
|
|
}
|
|
}
|