From ef9245487c8147ed8db338928f16d8320c957336 Mon Sep 17 00:00:00 2001 From: mertalev <101130780+mertalev@users.noreply.github.com> Date: Sun, 4 May 2025 20:12:29 -0400 Subject: [PATCH] openapi --- mobile/openapi/README.md | 1 + mobile/openapi/lib/api.dart | 1 + mobile/openapi/lib/api_client.dart | 2 + .../model/time_bucket_asset_response_dto.dart | 30 +++--- ..._asset_response_dto_stack_inner_inner.dart | 91 +++++++++++++++++++ open-api/immich-openapi-specs.json | 23 +++-- open-api/typescript-sdk/src/fetch-client.ts | 4 +- 7 files changed, 124 insertions(+), 28 deletions(-) create mode 100644 mobile/openapi/lib/model/time_bucket_asset_response_dto_stack_inner_inner.dart diff --git a/mobile/openapi/README.md b/mobile/openapi/README.md index 452a302db1..a2b3e35ba8 100644 --- a/mobile/openapi/README.md +++ b/mobile/openapi/README.md @@ -478,6 +478,7 @@ Class | Method | HTTP request | Description - [TemplateResponseDto](doc//TemplateResponseDto.md) - [TestEmailResponseDto](doc//TestEmailResponseDto.md) - [TimeBucketAssetResponseDto](doc//TimeBucketAssetResponseDto.md) + - [TimeBucketAssetResponseDtoStackInnerInner](doc//TimeBucketAssetResponseDtoStackInnerInner.md) - [TimeBucketsResponseDto](doc//TimeBucketsResponseDto.md) - [ToneMapping](doc//ToneMapping.md) - [TranscodeHWAccel](doc//TranscodeHWAccel.md) diff --git a/mobile/openapi/lib/api.dart b/mobile/openapi/lib/api.dart index 06086a5749..72c2c51d4d 100644 --- a/mobile/openapi/lib/api.dart +++ b/mobile/openapi/lib/api.dart @@ -282,6 +282,7 @@ part 'model/template_dto.dart'; part 'model/template_response_dto.dart'; part 'model/test_email_response_dto.dart'; part 'model/time_bucket_asset_response_dto.dart'; +part 'model/time_bucket_asset_response_dto_stack_inner_inner.dart'; part 'model/time_buckets_response_dto.dart'; part 'model/tone_mapping.dart'; part 'model/transcode_hw_accel.dart'; diff --git a/mobile/openapi/lib/api_client.dart b/mobile/openapi/lib/api_client.dart index f9ae2c9d07..2b96c15f9e 100644 --- a/mobile/openapi/lib/api_client.dart +++ b/mobile/openapi/lib/api_client.dart @@ -620,6 +620,8 @@ class ApiClient { return TestEmailResponseDto.fromJson(value); case 'TimeBucketAssetResponseDto': return TimeBucketAssetResponseDto.fromJson(value); + case 'TimeBucketAssetResponseDtoStackInnerInner': + return TimeBucketAssetResponseDtoStackInnerInner.fromJson(value); case 'TimeBucketsResponseDto': return TimeBucketsResponseDto.fromJson(value); case 'ToneMapping': diff --git a/mobile/openapi/lib/model/time_bucket_asset_response_dto.dart b/mobile/openapi/lib/model/time_bucket_asset_response_dto.dart index e3241d8a4b..529d560fbc 100644 --- a/mobile/openapi/lib/model/time_bucket_asset_response_dto.dart +++ b/mobile/openapi/lib/model/time_bucket_asset_response_dto.dart @@ -26,8 +26,7 @@ class TimeBucketAssetResponseDto { this.ownerId = const [], this.projectionType = const [], this.ratio = const [], - this.stackCount = const [], - this.stackId = const [], + this.stack = const [], this.thumbhash = const [], }); @@ -57,9 +56,8 @@ class TimeBucketAssetResponseDto { List ratio; - List stackCount; - - List stackId; + /// The stack ID and stack asset count as a tuple + List> stack; List thumbhash; @@ -78,8 +76,7 @@ class TimeBucketAssetResponseDto { _deepEquality.equals(other.ownerId, ownerId) && _deepEquality.equals(other.projectionType, projectionType) && _deepEquality.equals(other.ratio, ratio) && - _deepEquality.equals(other.stackCount, stackCount) && - _deepEquality.equals(other.stackId, stackId) && + _deepEquality.equals(other.stack, stack) && _deepEquality.equals(other.thumbhash, thumbhash); @override @@ -98,12 +95,11 @@ class TimeBucketAssetResponseDto { (ownerId.hashCode) + (projectionType.hashCode) + (ratio.hashCode) + - (stackCount.hashCode) + - (stackId.hashCode) + + (stack.hashCode) + (thumbhash.hashCode); @override - String toString() => 'TimeBucketAssetResponseDto[city=$city, country=$country, duration=$duration, id=$id, isArchived=$isArchived, isFavorite=$isFavorite, isImage=$isImage, isTrashed=$isTrashed, livePhotoVideoId=$livePhotoVideoId, localDateTime=$localDateTime, ownerId=$ownerId, projectionType=$projectionType, ratio=$ratio, stackCount=$stackCount, stackId=$stackId, thumbhash=$thumbhash]'; + String toString() => 'TimeBucketAssetResponseDto[city=$city, country=$country, duration=$duration, id=$id, isArchived=$isArchived, isFavorite=$isFavorite, isImage=$isImage, isTrashed=$isTrashed, livePhotoVideoId=$livePhotoVideoId, localDateTime=$localDateTime, ownerId=$ownerId, projectionType=$projectionType, ratio=$ratio, stack=$stack, thumbhash=$thumbhash]'; Map toJson() { final json = {}; @@ -120,8 +116,7 @@ class TimeBucketAssetResponseDto { json[r'ownerId'] = this.ownerId; json[r'projectionType'] = this.projectionType; json[r'ratio'] = this.ratio; - json[r'stackCount'] = this.stackCount; - json[r'stackId'] = this.stackId; + json[r'stack'] = this.stack; json[r'thumbhash'] = this.thumbhash; return json; } @@ -174,12 +169,11 @@ class TimeBucketAssetResponseDto { ratio: json[r'ratio'] is Iterable ? (json[r'ratio'] as Iterable).cast().toList(growable: false) : const [], - stackCount: json[r'stackCount'] is Iterable - ? (json[r'stackCount'] as Iterable).cast().toList(growable: false) - : const [], - stackId: json[r'stackId'] is Iterable - ? (json[r'stackId'] as Iterable).cast().toList(growable: false) - : const [], + stack: json[r'stack'] is List + ? (json[r'stack'] as List).map((e) => + TimeBucketAssetResponseDtoStackInnerInner.listFromJson(json[r'stack']) + ).toList() + : const [], thumbhash: json[r'thumbhash'] is Iterable ? (json[r'thumbhash'] as Iterable).cast().toList(growable: false) : const [], diff --git a/mobile/openapi/lib/model/time_bucket_asset_response_dto_stack_inner_inner.dart b/mobile/openapi/lib/model/time_bucket_asset_response_dto_stack_inner_inner.dart new file mode 100644 index 0000000000..bc594176cd --- /dev/null +++ b/mobile/openapi/lib/model/time_bucket_asset_response_dto_stack_inner_inner.dart @@ -0,0 +1,91 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class TimeBucketAssetResponseDtoStackInnerInner { + /// Returns a new [TimeBucketAssetResponseDtoStackInnerInner] instance. + TimeBucketAssetResponseDtoStackInnerInner({ + }); + + @override + bool operator ==(Object other) => identical(this, other) || other is TimeBucketAssetResponseDtoStackInnerInner && + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + + @override + String toString() => 'TimeBucketAssetResponseDtoStackInnerInner[]'; + + Map toJson() { + final json = {}; + return json; + } + + /// Returns a new [TimeBucketAssetResponseDtoStackInnerInner] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static TimeBucketAssetResponseDtoStackInnerInner? fromJson(dynamic value) { + upgradeDto(value, "TimeBucketAssetResponseDtoStackInnerInner"); + if (value is Map) { + final json = value.cast(); + + return TimeBucketAssetResponseDtoStackInnerInner( + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = TimeBucketAssetResponseDtoStackInnerInner.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = TimeBucketAssetResponseDtoStackInnerInner.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of TimeBucketAssetResponseDtoStackInnerInner-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = TimeBucketAssetResponseDtoStackInnerInner.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} + diff --git a/open-api/immich-openapi-specs.json b/open-api/immich-openapi-specs.json index ce7fa946e9..7741586ee2 100644 --- a/open-api/immich-openapi-specs.json +++ b/open-api/immich-openapi-specs.json @@ -13645,16 +13645,23 @@ }, "type": "array" }, - "stackCount": { - "items": { - "type": "number" - }, - "type": "array" - }, - "stackId": { + "stack": { + "description": "The stack ID and stack asset count as a tuple", "items": { + "items": { + "maxItems": 2, + "minItems": 2, + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, "nullable": true, - "type": "string" + "type": "array" }, "type": "array" }, diff --git a/open-api/typescript-sdk/src/fetch-client.ts b/open-api/typescript-sdk/src/fetch-client.ts index 8680eccf83..fbf6eb423a 100644 --- a/open-api/typescript-sdk/src/fetch-client.ts +++ b/open-api/typescript-sdk/src/fetch-client.ts @@ -1398,8 +1398,8 @@ export type TimeBucketAssetResponseDto = { ownerId: string[]; projectionType: (string | null)[]; ratio: number[]; - stackCount?: number[]; - stackId?: (string | null)[]; + /** The stack ID and stack asset count as a tuple */ + stack?: ((string | number)[] | null)[]; thumbhash: (string | null)[]; }; export type TimeBucketsResponseDto = {