You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
692 B
29 lines
692 B
/// Response from Immich upload API.
|
|
class UploadResponse {
|
|
/// The unique identifier of the uploaded asset.
|
|
final String id;
|
|
|
|
/// Whether the upload was a duplicate (already existed).
|
|
final bool duplicate;
|
|
|
|
/// Creates an [UploadResponse] instance.
|
|
UploadResponse({
|
|
required this.id,
|
|
required this.duplicate,
|
|
});
|
|
|
|
/// Creates an [UploadResponse] from Immich API JSON response.
|
|
factory UploadResponse.fromJson(Map<String, dynamic> json) {
|
|
return UploadResponse(
|
|
id: json['id'] as String,
|
|
duplicate: json['duplicate'] as bool? ?? false,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return 'UploadResponse(id: $id, duplicate: $duplicate)';
|
|
}
|
|
}
|
|
|