get_all_asset_response.model.dart 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import 'package:flutter/foundation.dart';
  2. import 'package:openapi/api.dart';
  3. class ImmichAssetGroupByDate {
  4. final String date;
  5. List<AssetResponseDto> assets;
  6. ImmichAssetGroupByDate({
  7. required this.date,
  8. required this.assets,
  9. });
  10. ImmichAssetGroupByDate copyWith({
  11. String? date,
  12. List<AssetResponseDto>? assets,
  13. }) {
  14. return ImmichAssetGroupByDate(
  15. date: date ?? this.date,
  16. assets: assets ?? this.assets,
  17. );
  18. }
  19. @override
  20. String toString() => 'ImmichAssetGroupByDate(date: $date, assets: $assets)';
  21. @override
  22. bool operator ==(Object other) {
  23. if (identical(this, other)) return true;
  24. return other is ImmichAssetGroupByDate &&
  25. other.date == date &&
  26. listEquals(other.assets, assets);
  27. }
  28. @override
  29. int get hashCode => date.hashCode ^ assets.hashCode;
  30. }
  31. class GetAllAssetResponse {
  32. final int count;
  33. final List<ImmichAssetGroupByDate> data;
  34. final String nextPageKey;
  35. GetAllAssetResponse({
  36. required this.count,
  37. required this.data,
  38. required this.nextPageKey,
  39. });
  40. GetAllAssetResponse copyWith({
  41. int? count,
  42. List<ImmichAssetGroupByDate>? data,
  43. String? nextPageKey,
  44. }) {
  45. return GetAllAssetResponse(
  46. count: count ?? this.count,
  47. data: data ?? this.data,
  48. nextPageKey: nextPageKey ?? this.nextPageKey,
  49. );
  50. }
  51. @override
  52. String toString() =>
  53. 'GetAllAssetResponse(count: $count, data: $data, nextPageKey: $nextPageKey)';
  54. @override
  55. bool operator ==(Object other) {
  56. if (identical(this, other)) return true;
  57. return other is GetAllAssetResponse &&
  58. other.count == count &&
  59. listEquals(other.data, data) &&
  60. other.nextPageKey == nextPageKey;
  61. }
  62. @override
  63. int get hashCode => count.hashCode ^ data.hashCode ^ nextPageKey.hashCode;
  64. }