From aa8a8b451376785e260fc7818e872671ed8cd820 Mon Sep 17 00:00:00 2001 From: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> Date: Sat, 17 May 2025 12:20:33 +0530 Subject: [PATCH] update openapi models --- mobile/openapi/lib/api.dart | 1 + .../lib/model/activity_response_dto.dart | 30 +- .../openapi/lib/model/album_response_dto.dart | 24 +- .../lib/model/api_key_response_dto.dart | 4 +- .../lib/model/asset_bulk_update_dto.dart | 14 +- .../lib/model/asset_delta_sync_dto.dart | 2 +- .../lib/model/asset_face_response_dto.dart | 14 +- .../lib/model/asset_full_sync_dto.dart | 2 +- .../openapi/lib/model/asset_response_dto.dart | 78 ++-- .../create_profile_image_response_dto.dart | 2 +- .../openapi/lib/model/exif_response_dto.dart | 328 +++++++++-------- .../lib/model/library_response_dto.dart | 20 +- .../lib/model/license_response_dto.dart | 2 +- .../lib/model/map_marker_response_dto.dart | 42 ++- .../map_reverse_geocode_response_dto.dart | 42 ++- .../openapi/lib/model/memory_create_dto.dart | 4 +- .../lib/model/memory_response_dto.dart | 14 +- .../openapi/lib/model/memory_update_dto.dart | 4 +- .../lib/model/metadata_search_dto.dart | 100 +++--- .../lib/model/notification_create_dto.dart | 30 +- .../openapi/lib/model/notification_dto.dart | 4 +- .../model/notification_update_all_dto.dart | 16 +- .../lib/model/notification_update_dto.dart | 16 +- .../lib/model/partner_response_dto.dart | 2 +- .../openapi/lib/model/people_update_item.dart | 30 +- .../openapi/lib/model/person_create_dto.dart | 30 +- .../lib/model/person_response_dto.dart | 18 +- .../openapi/lib/model/person_update_dto.dart | 30 +- .../model/person_with_faces_response_dto.dart | 18 +- .../openapi/lib/model/random_search_dto.dart | 100 +++--- .../reverse_geocoding_state_response_dto.dart | 28 +- .../lib/model/search_asset_response_dto.dart | 14 +- .../server_version_history_response_dto.dart | 2 +- .../lib/model/shared_link_create_dto.dart | 16 +- .../lib/model/shared_link_edit_dto.dart | 16 +- .../lib/model/shared_link_response_dto.dart | 60 ++-- .../openapi/lib/model/smart_search_dto.dart | 100 +++--- .../openapi/lib/model/sync_asset_exif_v1.dart | 340 ++++++++++-------- mobile/openapi/lib/model/sync_asset_v1.dart | 78 ++-- mobile/openapi/lib/model/sync_user_v1.dart | 16 +- mobile/openapi/lib/model/tag_create_dto.dart | 14 +- .../openapi/lib/model/tag_response_dto.dart | 4 +- mobile/openapi/lib/model/tag_update_dto.dart | 14 +- .../openapi/lib/model/update_asset_dto.dart | 14 +- .../openapi/lib/model/usage_by_user_dto.dart | 14 +- .../lib/model/user_admin_create_dto.dart | 42 ++- .../lib/model/user_admin_response_dto.dart | 78 ++-- .../lib/model/user_admin_update_dto.dart | 56 +-- mobile/openapi/lib/model/user_license.dart | 2 +- .../openapi/lib/model/user_response_dto.dart | 2 +- .../openapi/lib/model/user_update_me_dto.dart | 14 +- 51 files changed, 1098 insertions(+), 847 deletions(-) diff --git a/mobile/openapi/lib/api.dart b/mobile/openapi/lib/api.dart index 8710298d7d..4386e2a4f1 100644 --- a/mobile/openapi/lib/api.dart +++ b/mobile/openapi/lib/api.dart @@ -17,6 +17,7 @@ import 'dart:io'; import 'package:collection/collection.dart'; import 'package:flutter/foundation.dart'; import 'package:immich_mobile/utils/openapi_patching.dart'; +import 'package:immich_mobile/utils/option.dart'; import 'package:http/http.dart'; import 'package:intl/intl.dart'; import 'package:meta/meta.dart'; diff --git a/mobile/openapi/lib/model/activity_response_dto.dart b/mobile/openapi/lib/model/activity_response_dto.dart index 25fb0f53f8..c5d87aca1c 100644 --- a/mobile/openapi/lib/model/activity_response_dto.dart +++ b/mobile/openapi/lib/model/activity_response_dto.dart @@ -13,17 +13,17 @@ part of openapi.api; class ActivityResponseDto { /// Returns a new [ActivityResponseDto] instance. ActivityResponseDto({ - required this.assetId, - this.comment, + this.assetId = const None(), + this.comment = const None(), required this.createdAt, required this.id, required this.type, required this.user, }); - String? assetId; + Option assetId; - String? comment; + Option comment; DateTime createdAt; @@ -45,8 +45,8 @@ class ActivityResponseDto { @override int get hashCode => // ignore: unnecessary_parenthesis - (assetId == null ? 0 : assetId!.hashCode) + - (comment == null ? 0 : comment!.hashCode) + + (assetId.hashCode) + + (comment.hashCode) + (createdAt.hashCode) + (id.hashCode) + (type.hashCode) + @@ -57,15 +57,19 @@ class ActivityResponseDto { Map toJson() { final json = {}; - if (this.assetId != null) { + if (this.assetId.unwrapOrNull() != null) { json[r'assetId'] = this.assetId; } else { - // json[r'assetId'] = null; + if(this.assetId.isSome) { + json[r'assetId'] = null; + } } - if (this.comment != null) { + if (this.comment.unwrapOrNull() != null) { json[r'comment'] = this.comment; } else { - // json[r'comment'] = null; + if(this.comment.isSome) { + json[r'comment'] = null; + } } json[r'createdAt'] = this.createdAt.toUtc().toIso8601String(); json[r'id'] = this.id; @@ -83,9 +87,9 @@ class ActivityResponseDto { final json = value.cast(); return ActivityResponseDto( - assetId: mapValueOfType(json, r'assetId'), - comment: mapValueOfType(json, r'comment'), - createdAt: mapDateTime(json, r'createdAt', r'')!, + assetId: Option.from(mapValueOfType(json, r'assetId')), + comment: Option.from(mapValueOfType(json, r'comment')), + createdAt: mapDateTime(json, r'createdAt', r'')!, id: mapValueOfType(json, r'id')!, type: ReactionType.fromJson(json[r'type'])!, user: UserResponseDto.fromJson(json[r'user'])!, diff --git a/mobile/openapi/lib/model/album_response_dto.dart b/mobile/openapi/lib/model/album_response_dto.dart index 547a6a70fd..98e46810eb 100644 --- a/mobile/openapi/lib/model/album_response_dto.dart +++ b/mobile/openapi/lib/model/album_response_dto.dart @@ -14,7 +14,7 @@ class AlbumResponseDto { /// Returns a new [AlbumResponseDto] instance. AlbumResponseDto({ required this.albumName, - required this.albumThumbnailAssetId, + this.albumThumbnailAssetId = const None(), this.albumUsers = const [], required this.assetCount, this.assets = const [], @@ -35,7 +35,7 @@ class AlbumResponseDto { String albumName; - String? albumThumbnailAssetId; + Option albumThumbnailAssetId; List albumUsers; @@ -118,7 +118,7 @@ class AlbumResponseDto { int get hashCode => // ignore: unnecessary_parenthesis (albumName.hashCode) + - (albumThumbnailAssetId == null ? 0 : albumThumbnailAssetId!.hashCode) + + (albumThumbnailAssetId.hashCode) + (albumUsers.hashCode) + (assetCount.hashCode) + (assets.hashCode) + @@ -142,10 +142,12 @@ class AlbumResponseDto { Map toJson() { final json = {}; json[r'albumName'] = this.albumName; - if (this.albumThumbnailAssetId != null) { + if (this.albumThumbnailAssetId.unwrapOrNull() != null) { json[r'albumThumbnailAssetId'] = this.albumThumbnailAssetId; } else { - // json[r'albumThumbnailAssetId'] = null; + if(this.albumThumbnailAssetId.isSome) { + json[r'albumThumbnailAssetId'] = null; + } } json[r'albumUsers'] = this.albumUsers; json[r'assetCount'] = this.assetCount; @@ -192,23 +194,23 @@ class AlbumResponseDto { return AlbumResponseDto( albumName: mapValueOfType(json, r'albumName')!, - albumThumbnailAssetId: mapValueOfType(json, r'albumThumbnailAssetId'), + albumThumbnailAssetId: Option.from(mapValueOfType(json, r'albumThumbnailAssetId')), albumUsers: AlbumUserResponseDto.listFromJson(json[r'albumUsers']), assetCount: mapValueOfType(json, r'assetCount')!, assets: AssetResponseDto.listFromJson(json[r'assets']), - createdAt: mapDateTime(json, r'createdAt', r'')!, + createdAt: mapDateTime(json, r'createdAt', r'')!, description: mapValueOfType(json, r'description')!, - endDate: mapDateTime(json, r'endDate', r''), + endDate: mapDateTime(json, r'endDate', r''), hasSharedLink: mapValueOfType(json, r'hasSharedLink')!, id: mapValueOfType(json, r'id')!, isActivityEnabled: mapValueOfType(json, r'isActivityEnabled')!, - lastModifiedAssetTimestamp: mapDateTime(json, r'lastModifiedAssetTimestamp', r''), + lastModifiedAssetTimestamp: mapDateTime(json, r'lastModifiedAssetTimestamp', r''), order: AssetOrder.fromJson(json[r'order']), owner: UserResponseDto.fromJson(json[r'owner'])!, ownerId: mapValueOfType(json, r'ownerId')!, shared: mapValueOfType(json, r'shared')!, - startDate: mapDateTime(json, r'startDate', r''), - updatedAt: mapDateTime(json, r'updatedAt', r'')!, + startDate: mapDateTime(json, r'startDate', r''), + updatedAt: mapDateTime(json, r'updatedAt', r'')!, ); } return null; diff --git a/mobile/openapi/lib/model/api_key_response_dto.dart b/mobile/openapi/lib/model/api_key_response_dto.dart index fd0d91f673..75736f000a 100644 --- a/mobile/openapi/lib/model/api_key_response_dto.dart +++ b/mobile/openapi/lib/model/api_key_response_dto.dart @@ -69,11 +69,11 @@ class APIKeyResponseDto { final json = value.cast(); return APIKeyResponseDto( - createdAt: mapDateTime(json, r'createdAt', r'')!, + createdAt: mapDateTime(json, r'createdAt', r'')!, id: mapValueOfType(json, r'id')!, name: mapValueOfType(json, r'name')!, permissions: Permission.listFromJson(json[r'permissions']), - updatedAt: mapDateTime(json, r'updatedAt', r'')!, + updatedAt: mapDateTime(json, r'updatedAt', r'')!, ); } return null; diff --git a/mobile/openapi/lib/model/asset_bulk_update_dto.dart b/mobile/openapi/lib/model/asset_bulk_update_dto.dart index 39d7cd996f..2e3f5e1ad0 100644 --- a/mobile/openapi/lib/model/asset_bulk_update_dto.dart +++ b/mobile/openapi/lib/model/asset_bulk_update_dto.dart @@ -14,7 +14,7 @@ class AssetBulkUpdateDto { /// Returns a new [AssetBulkUpdateDto] instance. AssetBulkUpdateDto({ this.dateTimeOriginal, - this.duplicateId, + this.duplicateId = const None(), this.ids = const [], this.isFavorite, this.latitude, @@ -31,7 +31,7 @@ class AssetBulkUpdateDto { /// String? dateTimeOriginal; - String? duplicateId; + Option duplicateId; List ids; @@ -92,7 +92,7 @@ class AssetBulkUpdateDto { int get hashCode => // ignore: unnecessary_parenthesis (dateTimeOriginal == null ? 0 : dateTimeOriginal!.hashCode) + - (duplicateId == null ? 0 : duplicateId!.hashCode) + + (duplicateId.hashCode) + (ids.hashCode) + (isFavorite == null ? 0 : isFavorite!.hashCode) + (latitude == null ? 0 : latitude!.hashCode) + @@ -110,10 +110,12 @@ class AssetBulkUpdateDto { } else { // json[r'dateTimeOriginal'] = null; } - if (this.duplicateId != null) { + if (this.duplicateId.unwrapOrNull() != null) { json[r'duplicateId'] = this.duplicateId; } else { - // json[r'duplicateId'] = null; + if(this.duplicateId.isSome) { + json[r'duplicateId'] = null; + } } json[r'ids'] = this.ids; if (this.isFavorite != null) { @@ -154,7 +156,7 @@ class AssetBulkUpdateDto { return AssetBulkUpdateDto( dateTimeOriginal: mapValueOfType(json, r'dateTimeOriginal'), - duplicateId: mapValueOfType(json, r'duplicateId'), + duplicateId: Option.from(mapValueOfType(json, r'duplicateId')), ids: json[r'ids'] is Iterable ? (json[r'ids'] as Iterable).cast().toList(growable: false) : const [], diff --git a/mobile/openapi/lib/model/asset_delta_sync_dto.dart b/mobile/openapi/lib/model/asset_delta_sync_dto.dart index 845aadcdcd..3031295c44 100644 --- a/mobile/openapi/lib/model/asset_delta_sync_dto.dart +++ b/mobile/openapi/lib/model/asset_delta_sync_dto.dart @@ -51,7 +51,7 @@ class AssetDeltaSyncDto { final json = value.cast(); return AssetDeltaSyncDto( - updatedAfter: mapDateTime(json, r'updatedAfter', r'')!, + updatedAfter: mapDateTime(json, r'updatedAfter', r'')!, userIds: json[r'userIds'] is Iterable ? (json[r'userIds'] as Iterable).cast().toList(growable: false) : const [], diff --git a/mobile/openapi/lib/model/asset_face_response_dto.dart b/mobile/openapi/lib/model/asset_face_response_dto.dart index c05b511649..6ab0acd973 100644 --- a/mobile/openapi/lib/model/asset_face_response_dto.dart +++ b/mobile/openapi/lib/model/asset_face_response_dto.dart @@ -20,7 +20,7 @@ class AssetFaceResponseDto { required this.id, required this.imageHeight, required this.imageWidth, - required this.person, + this.person = const None(), this.sourceType, }); @@ -38,7 +38,7 @@ class AssetFaceResponseDto { int imageWidth; - PersonResponseDto? person; + Option person; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -70,7 +70,7 @@ class AssetFaceResponseDto { (id.hashCode) + (imageHeight.hashCode) + (imageWidth.hashCode) + - (person == null ? 0 : person!.hashCode) + + (person.hashCode) + (sourceType == null ? 0 : sourceType!.hashCode); @override @@ -85,10 +85,12 @@ class AssetFaceResponseDto { json[r'id'] = this.id; json[r'imageHeight'] = this.imageHeight; json[r'imageWidth'] = this.imageWidth; - if (this.person != null) { + if (this.person.unwrapOrNull() != null) { json[r'person'] = this.person; } else { - // json[r'person'] = null; + if(this.person.isSome) { + json[r'person'] = null; + } } if (this.sourceType != null) { json[r'sourceType'] = this.sourceType; @@ -114,7 +116,7 @@ class AssetFaceResponseDto { id: mapValueOfType(json, r'id')!, imageHeight: mapValueOfType(json, r'imageHeight')!, imageWidth: mapValueOfType(json, r'imageWidth')!, - person: PersonResponseDto.fromJson(json[r'person']), + person: Option.from(PersonResponseDto.fromJson(json[r'person'])), sourceType: SourceType.fromJson(json[r'sourceType']), ); } diff --git a/mobile/openapi/lib/model/asset_full_sync_dto.dart b/mobile/openapi/lib/model/asset_full_sync_dto.dart index 7151094b95..6b72c19b27 100644 --- a/mobile/openapi/lib/model/asset_full_sync_dto.dart +++ b/mobile/openapi/lib/model/asset_full_sync_dto.dart @@ -86,7 +86,7 @@ class AssetFullSyncDto { return AssetFullSyncDto( lastId: mapValueOfType(json, r'lastId'), limit: mapValueOfType(json, r'limit')!, - updatedUntil: mapDateTime(json, r'updatedUntil', r'')!, + updatedUntil: mapDateTime(json, r'updatedUntil', r'')!, userId: mapValueOfType(json, r'userId'), ); } diff --git a/mobile/openapi/lib/model/asset_response_dto.dart b/mobile/openapi/lib/model/asset_response_dto.dart index 74af8bd1eb..5b9f0e6a3a 100644 --- a/mobile/openapi/lib/model/asset_response_dto.dart +++ b/mobile/openapi/lib/model/asset_response_dto.dart @@ -16,7 +16,7 @@ class AssetResponseDto { required this.checksum, required this.deviceAssetId, required this.deviceId, - this.duplicateId, + this.duplicateId = const None(), required this.duration, this.exifInfo, required this.fileCreatedAt, @@ -27,8 +27,8 @@ class AssetResponseDto { required this.isFavorite, required this.isOffline, required this.isTrashed, - this.libraryId, - this.livePhotoVideoId, + this.libraryId = const None(), + this.livePhotoVideoId = const None(), required this.localDateTime, required this.originalFileName, this.originalMimeType, @@ -37,9 +37,9 @@ class AssetResponseDto { required this.ownerId, this.people = const [], this.resized, - this.stack, + this.stack = const None(), this.tags = const [], - required this.thumbhash, + this.thumbhash = const None(), required this.type, this.unassignedFaces = const [], required this.updatedAt, @@ -53,7 +53,7 @@ class AssetResponseDto { String deviceId; - String? duplicateId; + Option duplicateId; String duration; @@ -82,9 +82,9 @@ class AssetResponseDto { bool isTrashed; /// This property was deprecated in v1.106.0 - String? libraryId; + Option libraryId; - String? livePhotoVideoId; + Option livePhotoVideoId; DateTime localDateTime; @@ -121,11 +121,11 @@ class AssetResponseDto { /// bool? resized; - AssetStackResponseDto? stack; + Option stack; List tags; - String? thumbhash; + Option thumbhash; AssetTypeEnum type; @@ -175,7 +175,7 @@ class AssetResponseDto { (checksum.hashCode) + (deviceAssetId.hashCode) + (deviceId.hashCode) + - (duplicateId == null ? 0 : duplicateId!.hashCode) + + (duplicateId.hashCode) + (duration.hashCode) + (exifInfo == null ? 0 : exifInfo!.hashCode) + (fileCreatedAt.hashCode) + @@ -186,8 +186,8 @@ class AssetResponseDto { (isFavorite.hashCode) + (isOffline.hashCode) + (isTrashed.hashCode) + - (libraryId == null ? 0 : libraryId!.hashCode) + - (livePhotoVideoId == null ? 0 : livePhotoVideoId!.hashCode) + + (libraryId.hashCode) + + (livePhotoVideoId.hashCode) + (localDateTime.hashCode) + (originalFileName.hashCode) + (originalMimeType == null ? 0 : originalMimeType!.hashCode) + @@ -196,9 +196,9 @@ class AssetResponseDto { (ownerId.hashCode) + (people.hashCode) + (resized == null ? 0 : resized!.hashCode) + - (stack == null ? 0 : stack!.hashCode) + + (stack.hashCode) + (tags.hashCode) + - (thumbhash == null ? 0 : thumbhash!.hashCode) + + (thumbhash.hashCode) + (type.hashCode) + (unassignedFaces.hashCode) + (updatedAt.hashCode) + @@ -212,10 +212,12 @@ class AssetResponseDto { json[r'checksum'] = this.checksum; json[r'deviceAssetId'] = this.deviceAssetId; json[r'deviceId'] = this.deviceId; - if (this.duplicateId != null) { + if (this.duplicateId.unwrapOrNull() != null) { json[r'duplicateId'] = this.duplicateId; } else { - // json[r'duplicateId'] = null; + if(this.duplicateId.isSome) { + json[r'duplicateId'] = null; + } } json[r'duration'] = this.duration; if (this.exifInfo != null) { @@ -231,15 +233,19 @@ class AssetResponseDto { json[r'isFavorite'] = this.isFavorite; json[r'isOffline'] = this.isOffline; json[r'isTrashed'] = this.isTrashed; - if (this.libraryId != null) { + if (this.libraryId.unwrapOrNull() != null) { json[r'libraryId'] = this.libraryId; } else { - // json[r'libraryId'] = null; + if(this.libraryId.isSome) { + json[r'libraryId'] = null; + } } - if (this.livePhotoVideoId != null) { + if (this.livePhotoVideoId.unwrapOrNull() != null) { json[r'livePhotoVideoId'] = this.livePhotoVideoId; } else { - // json[r'livePhotoVideoId'] = null; + if(this.livePhotoVideoId.isSome) { + json[r'livePhotoVideoId'] = null; + } } json[r'localDateTime'] = this.localDateTime.toUtc().toIso8601String(); json[r'originalFileName'] = this.originalFileName; @@ -261,16 +267,20 @@ class AssetResponseDto { } else { // json[r'resized'] = null; } - if (this.stack != null) { + if (this.stack.unwrapOrNull() != null) { json[r'stack'] = this.stack; } else { - // json[r'stack'] = null; + if(this.stack.isSome) { + json[r'stack'] = null; + } } json[r'tags'] = this.tags; - if (this.thumbhash != null) { + if (this.thumbhash.unwrapOrNull() != null) { json[r'thumbhash'] = this.thumbhash; } else { - // json[r'thumbhash'] = null; + if(this.thumbhash.isSome) { + json[r'thumbhash'] = null; + } } json[r'type'] = this.type; json[r'unassignedFaces'] = this.unassignedFaces; @@ -291,20 +301,20 @@ class AssetResponseDto { checksum: mapValueOfType(json, r'checksum')!, deviceAssetId: mapValueOfType(json, r'deviceAssetId')!, deviceId: mapValueOfType(json, r'deviceId')!, - duplicateId: mapValueOfType(json, r'duplicateId'), + duplicateId: Option.from(mapValueOfType(json, r'duplicateId')), duration: mapValueOfType(json, r'duration')!, exifInfo: ExifResponseDto.fromJson(json[r'exifInfo']), - fileCreatedAt: mapDateTime(json, r'fileCreatedAt', r'')!, - fileModifiedAt: mapDateTime(json, r'fileModifiedAt', r'')!, + fileCreatedAt: mapDateTime(json, r'fileCreatedAt', r'')!, + fileModifiedAt: mapDateTime(json, r'fileModifiedAt', r'')!, hasMetadata: mapValueOfType(json, r'hasMetadata')!, id: mapValueOfType(json, r'id')!, isArchived: mapValueOfType(json, r'isArchived')!, isFavorite: mapValueOfType(json, r'isFavorite')!, isOffline: mapValueOfType(json, r'isOffline')!, isTrashed: mapValueOfType(json, r'isTrashed')!, - libraryId: mapValueOfType(json, r'libraryId'), - livePhotoVideoId: mapValueOfType(json, r'livePhotoVideoId'), - localDateTime: mapDateTime(json, r'localDateTime', r'')!, + libraryId: Option.from(mapValueOfType(json, r'libraryId')), + livePhotoVideoId: Option.from(mapValueOfType(json, r'livePhotoVideoId')), + localDateTime: mapDateTime(json, r'localDateTime', r'')!, originalFileName: mapValueOfType(json, r'originalFileName')!, originalMimeType: mapValueOfType(json, r'originalMimeType'), originalPath: mapValueOfType(json, r'originalPath')!, @@ -312,12 +322,12 @@ class AssetResponseDto { ownerId: mapValueOfType(json, r'ownerId')!, people: PersonWithFacesResponseDto.listFromJson(json[r'people']), resized: mapValueOfType(json, r'resized'), - stack: AssetStackResponseDto.fromJson(json[r'stack']), + stack: Option.from(AssetStackResponseDto.fromJson(json[r'stack'])), tags: TagResponseDto.listFromJson(json[r'tags']), - thumbhash: mapValueOfType(json, r'thumbhash'), + thumbhash: Option.from(mapValueOfType(json, r'thumbhash')), type: AssetTypeEnum.fromJson(json[r'type'])!, unassignedFaces: AssetFaceWithoutPersonResponseDto.listFromJson(json[r'unassignedFaces']), - updatedAt: mapDateTime(json, r'updatedAt', r'')!, + updatedAt: mapDateTime(json, r'updatedAt', r'')!, visibility: AssetResponseDtoVisibilityEnum.fromJson(json[r'visibility'])!, ); } diff --git a/mobile/openapi/lib/model/create_profile_image_response_dto.dart b/mobile/openapi/lib/model/create_profile_image_response_dto.dart index ee98142e86..ef902a5c59 100644 --- a/mobile/openapi/lib/model/create_profile_image_response_dto.dart +++ b/mobile/openapi/lib/model/create_profile_image_response_dto.dart @@ -57,7 +57,7 @@ class CreateProfileImageResponseDto { final json = value.cast(); return CreateProfileImageResponseDto( - profileChangedAt: mapDateTime(json, r'profileChangedAt', r'')!, + profileChangedAt: mapDateTime(json, r'profileChangedAt', r'')!, profileImagePath: mapValueOfType(json, r'profileImagePath')!, userId: mapValueOfType(json, r'userId')!, ); diff --git a/mobile/openapi/lib/model/exif_response_dto.dart b/mobile/openapi/lib/model/exif_response_dto.dart index 17397b2081..d0a429e30e 100644 --- a/mobile/openapi/lib/model/exif_response_dto.dart +++ b/mobile/openapi/lib/model/exif_response_dto.dart @@ -13,73 +13,73 @@ part of openapi.api; class ExifResponseDto { /// Returns a new [ExifResponseDto] instance. ExifResponseDto({ - this.city, - this.country, - this.dateTimeOriginal, - this.description, - this.exifImageHeight, - this.exifImageWidth, - this.exposureTime, - this.fNumber, - this.fileSizeInByte, - this.focalLength, - this.iso, - this.latitude, - this.lensModel, - this.longitude, - this.make, - this.model, - this.modifyDate, - this.orientation, - this.projectionType, - this.rating, - this.state, - this.timeZone, + this.city = const None(), + this.country = const None(), + this.dateTimeOriginal = const None(), + this.description = const None(), + this.exifImageHeight = const None(), + this.exifImageWidth = const None(), + this.exposureTime = const None(), + this.fNumber = const None(), + this.fileSizeInByte = const None(), + this.focalLength = const None(), + this.iso = const None(), + this.latitude = const None(), + this.lensModel = const None(), + this.longitude = const None(), + this.make = const None(), + this.model = const None(), + this.modifyDate = const None(), + this.orientation = const None(), + this.projectionType = const None(), + this.rating = const None(), + this.state = const None(), + this.timeZone = const None(), }); - String? city; + Option city; - String? country; + Option country; - DateTime? dateTimeOriginal; + Option dateTimeOriginal; - String? description; + Option description; - num? exifImageHeight; + Option exifImageHeight; - num? exifImageWidth; + Option exifImageWidth; - String? exposureTime; + Option exposureTime; - num? fNumber; + Option fNumber; - int? fileSizeInByte; + Option fileSizeInByte; - num? focalLength; + Option focalLength; - num? iso; + Option iso; - num? latitude; + Option latitude; - String? lensModel; + Option lensModel; - num? longitude; + Option longitude; - String? make; + Option make; - String? model; + Option model; - DateTime? modifyDate; + Option modifyDate; - String? orientation; + Option orientation; - String? projectionType; + Option projectionType; - num? rating; + Option rating; - String? state; + Option state; - String? timeZone; + Option timeZone; @override bool operator ==(Object other) => identical(this, other) || other is ExifResponseDto && @@ -109,143 +109,187 @@ class ExifResponseDto { @override int get hashCode => // ignore: unnecessary_parenthesis - (city == null ? 0 : city!.hashCode) + - (country == null ? 0 : country!.hashCode) + - (dateTimeOriginal == null ? 0 : dateTimeOriginal!.hashCode) + - (description == null ? 0 : description!.hashCode) + - (exifImageHeight == null ? 0 : exifImageHeight!.hashCode) + - (exifImageWidth == null ? 0 : exifImageWidth!.hashCode) + - (exposureTime == null ? 0 : exposureTime!.hashCode) + - (fNumber == null ? 0 : fNumber!.hashCode) + - (fileSizeInByte == null ? 0 : fileSizeInByte!.hashCode) + - (focalLength == null ? 0 : focalLength!.hashCode) + - (iso == null ? 0 : iso!.hashCode) + - (latitude == null ? 0 : latitude!.hashCode) + - (lensModel == null ? 0 : lensModel!.hashCode) + - (longitude == null ? 0 : longitude!.hashCode) + - (make == null ? 0 : make!.hashCode) + - (model == null ? 0 : model!.hashCode) + - (modifyDate == null ? 0 : modifyDate!.hashCode) + - (orientation == null ? 0 : orientation!.hashCode) + - (projectionType == null ? 0 : projectionType!.hashCode) + - (rating == null ? 0 : rating!.hashCode) + - (state == null ? 0 : state!.hashCode) + - (timeZone == null ? 0 : timeZone!.hashCode); + (city.hashCode) + + (country.hashCode) + + (dateTimeOriginal.hashCode) + + (description.hashCode) + + (exifImageHeight.hashCode) + + (exifImageWidth.hashCode) + + (exposureTime.hashCode) + + (fNumber.hashCode) + + (fileSizeInByte.hashCode) + + (focalLength.hashCode) + + (iso.hashCode) + + (latitude.hashCode) + + (lensModel.hashCode) + + (longitude.hashCode) + + (make.hashCode) + + (model.hashCode) + + (modifyDate.hashCode) + + (orientation.hashCode) + + (projectionType.hashCode) + + (rating.hashCode) + + (state.hashCode) + + (timeZone.hashCode); @override String toString() => 'ExifResponseDto[city=$city, country=$country, dateTimeOriginal=$dateTimeOriginal, description=$description, exifImageHeight=$exifImageHeight, exifImageWidth=$exifImageWidth, exposureTime=$exposureTime, fNumber=$fNumber, fileSizeInByte=$fileSizeInByte, focalLength=$focalLength, iso=$iso, latitude=$latitude, lensModel=$lensModel, longitude=$longitude, make=$make, model=$model, modifyDate=$modifyDate, orientation=$orientation, projectionType=$projectionType, rating=$rating, state=$state, timeZone=$timeZone]'; Map toJson() { final json = {}; - if (this.city != null) { + if (this.city.unwrapOrNull() != null) { json[r'city'] = this.city; } else { - // json[r'city'] = null; + if(this.city.isSome) { + json[r'city'] = null; + } } - if (this.country != null) { + if (this.country.unwrapOrNull() != null) { json[r'country'] = this.country; } else { - // json[r'country'] = null; + if(this.country.isSome) { + json[r'country'] = null; + } } - if (this.dateTimeOriginal != null) { - json[r'dateTimeOriginal'] = this.dateTimeOriginal!.toUtc().toIso8601String(); + if (this.dateTimeOriginal.unwrapOrNull() != null) { + json[r'dateTimeOriginal'] = this.dateTimeOriginal.unwrap().toUtc().toIso8601String(); } else { - // json[r'dateTimeOriginal'] = null; + if(this.dateTimeOriginal.isSome) { + json[r'dateTimeOriginal'] = null; + } } - if (this.description != null) { + if (this.description.unwrapOrNull() != null) { json[r'description'] = this.description; } else { - // json[r'description'] = null; + if(this.description.isSome) { + json[r'description'] = null; + } } - if (this.exifImageHeight != null) { + if (this.exifImageHeight.unwrapOrNull() != null) { json[r'exifImageHeight'] = this.exifImageHeight; } else { - // json[r'exifImageHeight'] = null; + if(this.exifImageHeight.isSome) { + json[r'exifImageHeight'] = null; + } } - if (this.exifImageWidth != null) { + if (this.exifImageWidth.unwrapOrNull() != null) { json[r'exifImageWidth'] = this.exifImageWidth; } else { - // json[r'exifImageWidth'] = null; + if(this.exifImageWidth.isSome) { + json[r'exifImageWidth'] = null; + } } - if (this.exposureTime != null) { + if (this.exposureTime.unwrapOrNull() != null) { json[r'exposureTime'] = this.exposureTime; } else { - // json[r'exposureTime'] = null; + if(this.exposureTime.isSome) { + json[r'exposureTime'] = null; + } } - if (this.fNumber != null) { + if (this.fNumber.unwrapOrNull() != null) { json[r'fNumber'] = this.fNumber; } else { - // json[r'fNumber'] = null; + if(this.fNumber.isSome) { + json[r'fNumber'] = null; + } } - if (this.fileSizeInByte != null) { + if (this.fileSizeInByte.unwrapOrNull() != null) { json[r'fileSizeInByte'] = this.fileSizeInByte; } else { - // json[r'fileSizeInByte'] = null; + if(this.fileSizeInByte.isSome) { + json[r'fileSizeInByte'] = null; + } } - if (this.focalLength != null) { + if (this.focalLength.unwrapOrNull() != null) { json[r'focalLength'] = this.focalLength; } else { - // json[r'focalLength'] = null; + if(this.focalLength.isSome) { + json[r'focalLength'] = null; + } } - if (this.iso != null) { + if (this.iso.unwrapOrNull() != null) { json[r'iso'] = this.iso; } else { - // json[r'iso'] = null; + if(this.iso.isSome) { + json[r'iso'] = null; + } } - if (this.latitude != null) { + if (this.latitude.unwrapOrNull() != null) { json[r'latitude'] = this.latitude; } else { - // json[r'latitude'] = null; + if(this.latitude.isSome) { + json[r'latitude'] = null; + } } - if (this.lensModel != null) { + if (this.lensModel.unwrapOrNull() != null) { json[r'lensModel'] = this.lensModel; } else { - // json[r'lensModel'] = null; + if(this.lensModel.isSome) { + json[r'lensModel'] = null; + } } - if (this.longitude != null) { + if (this.longitude.unwrapOrNull() != null) { json[r'longitude'] = this.longitude; } else { - // json[r'longitude'] = null; + if(this.longitude.isSome) { + json[r'longitude'] = null; + } } - if (this.make != null) { + if (this.make.unwrapOrNull() != null) { json[r'make'] = this.make; } else { - // json[r'make'] = null; + if(this.make.isSome) { + json[r'make'] = null; + } } - if (this.model != null) { + if (this.model.unwrapOrNull() != null) { json[r'model'] = this.model; } else { - // json[r'model'] = null; + if(this.model.isSome) { + json[r'model'] = null; + } } - if (this.modifyDate != null) { - json[r'modifyDate'] = this.modifyDate!.toUtc().toIso8601String(); + if (this.modifyDate.unwrapOrNull() != null) { + json[r'modifyDate'] = this.modifyDate.unwrap().toUtc().toIso8601String(); } else { - // json[r'modifyDate'] = null; + if(this.modifyDate.isSome) { + json[r'modifyDate'] = null; + } } - if (this.orientation != null) { + if (this.orientation.unwrapOrNull() != null) { json[r'orientation'] = this.orientation; } else { - // json[r'orientation'] = null; + if(this.orientation.isSome) { + json[r'orientation'] = null; + } } - if (this.projectionType != null) { + if (this.projectionType.unwrapOrNull() != null) { json[r'projectionType'] = this.projectionType; } else { - // json[r'projectionType'] = null; + if(this.projectionType.isSome) { + json[r'projectionType'] = null; + } } - if (this.rating != null) { + if (this.rating.unwrapOrNull() != null) { json[r'rating'] = this.rating; } else { - // json[r'rating'] = null; + if(this.rating.isSome) { + json[r'rating'] = null; + } } - if (this.state != null) { + if (this.state.unwrapOrNull() != null) { json[r'state'] = this.state; } else { - // json[r'state'] = null; + if(this.state.isSome) { + json[r'state'] = null; + } } - if (this.timeZone != null) { + if (this.timeZone.unwrapOrNull() != null) { json[r'timeZone'] = this.timeZone; } else { - // json[r'timeZone'] = null; + if(this.timeZone.isSome) { + json[r'timeZone'] = null; + } } return json; } @@ -259,44 +303,44 @@ class ExifResponseDto { final json = value.cast(); return ExifResponseDto( - city: mapValueOfType(json, r'city'), - country: mapValueOfType(json, r'country'), - dateTimeOriginal: mapDateTime(json, r'dateTimeOriginal', r''), - description: mapValueOfType(json, r'description'), - exifImageHeight: json[r'exifImageHeight'] == null + city: Option.from(mapValueOfType(json, r'city')), + country: Option.from(mapValueOfType(json, r'country')), + dateTimeOriginal: Option.from(mapDateTime(json, r'dateTimeOriginal', r'')), + description: Option.from(mapValueOfType(json, r'description')), + exifImageHeight: Option.from(json[r'exifImageHeight'] == null ? null - : num.parse('${json[r'exifImageHeight']}'), - exifImageWidth: json[r'exifImageWidth'] == null + : num.parse('${json[r'exifImageHeight']}')), + exifImageWidth: Option.from(json[r'exifImageWidth'] == null ? null - : num.parse('${json[r'exifImageWidth']}'), - exposureTime: mapValueOfType(json, r'exposureTime'), - fNumber: json[r'fNumber'] == null + : num.parse('${json[r'exifImageWidth']}')), + exposureTime: Option.from(mapValueOfType(json, r'exposureTime')), + fNumber: Option.from(json[r'fNumber'] == null ? null - : num.parse('${json[r'fNumber']}'), - fileSizeInByte: mapValueOfType(json, r'fileSizeInByte'), - focalLength: json[r'focalLength'] == null + : num.parse('${json[r'fNumber']}')), + fileSizeInByte: Option.from(mapValueOfType(json, r'fileSizeInByte')), + focalLength: Option.from(json[r'focalLength'] == null ? null - : num.parse('${json[r'focalLength']}'), - iso: json[r'iso'] == null + : num.parse('${json[r'focalLength']}')), + iso: Option.from(json[r'iso'] == null ? null - : num.parse('${json[r'iso']}'), - latitude: json[r'latitude'] == null + : num.parse('${json[r'iso']}')), + latitude: Option.from(json[r'latitude'] == null ? null - : num.parse('${json[r'latitude']}'), - lensModel: mapValueOfType(json, r'lensModel'), - longitude: json[r'longitude'] == null + : num.parse('${json[r'latitude']}')), + lensModel: Option.from(mapValueOfType(json, r'lensModel')), + longitude: Option.from(json[r'longitude'] == null ? null - : num.parse('${json[r'longitude']}'), - make: mapValueOfType(json, r'make'), - model: mapValueOfType(json, r'model'), - modifyDate: mapDateTime(json, r'modifyDate', r''), - orientation: mapValueOfType(json, r'orientation'), - projectionType: mapValueOfType(json, r'projectionType'), - rating: json[r'rating'] == null + : num.parse('${json[r'longitude']}')), + make: Option.from(mapValueOfType(json, r'make')), + model: Option.from(mapValueOfType(json, r'model')), + modifyDate: Option.from(mapDateTime(json, r'modifyDate', r'')), + orientation: Option.from(mapValueOfType(json, r'orientation')), + projectionType: Option.from(mapValueOfType(json, r'projectionType')), + rating: Option.from(json[r'rating'] == null ? null - : num.parse('${json[r'rating']}'), - state: mapValueOfType(json, r'state'), - timeZone: mapValueOfType(json, r'timeZone'), + : num.parse('${json[r'rating']}')), + state: Option.from(mapValueOfType(json, r'state')), + timeZone: Option.from(mapValueOfType(json, r'timeZone')), ); } return null; diff --git a/mobile/openapi/lib/model/library_response_dto.dart b/mobile/openapi/lib/model/library_response_dto.dart index 3cf1248508..93ae9f5a70 100644 --- a/mobile/openapi/lib/model/library_response_dto.dart +++ b/mobile/openapi/lib/model/library_response_dto.dart @@ -20,7 +20,7 @@ class LibraryResponseDto { this.importPaths = const [], required this.name, required this.ownerId, - required this.refreshedAt, + this.refreshedAt = const None(), required this.updatedAt, }); @@ -38,7 +38,7 @@ class LibraryResponseDto { String ownerId; - DateTime? refreshedAt; + Option refreshedAt; DateTime updatedAt; @@ -64,7 +64,7 @@ class LibraryResponseDto { (importPaths.hashCode) + (name.hashCode) + (ownerId.hashCode) + - (refreshedAt == null ? 0 : refreshedAt!.hashCode) + + (refreshedAt.hashCode) + (updatedAt.hashCode); @override @@ -79,10 +79,12 @@ class LibraryResponseDto { json[r'importPaths'] = this.importPaths; json[r'name'] = this.name; json[r'ownerId'] = this.ownerId; - if (this.refreshedAt != null) { - json[r'refreshedAt'] = this.refreshedAt!.toUtc().toIso8601String(); + if (this.refreshedAt.unwrapOrNull() != null) { + json[r'refreshedAt'] = this.refreshedAt.unwrap().toUtc().toIso8601String(); } else { - // json[r'refreshedAt'] = null; + if(this.refreshedAt.isSome) { + json[r'refreshedAt'] = null; + } } json[r'updatedAt'] = this.updatedAt.toUtc().toIso8601String(); return json; @@ -98,7 +100,7 @@ class LibraryResponseDto { return LibraryResponseDto( assetCount: mapValueOfType(json, r'assetCount')!, - createdAt: mapDateTime(json, r'createdAt', r'')!, + createdAt: mapDateTime(json, r'createdAt', r'')!, exclusionPatterns: json[r'exclusionPatterns'] is Iterable ? (json[r'exclusionPatterns'] as Iterable).cast().toList(growable: false) : const [], @@ -108,8 +110,8 @@ class LibraryResponseDto { : const [], name: mapValueOfType(json, r'name')!, ownerId: mapValueOfType(json, r'ownerId')!, - refreshedAt: mapDateTime(json, r'refreshedAt', r''), - updatedAt: mapDateTime(json, r'updatedAt', r'')!, + refreshedAt: Option.from(mapDateTime(json, r'refreshedAt', r'')), + updatedAt: mapDateTime(json, r'updatedAt', r'')!, ); } return null; diff --git a/mobile/openapi/lib/model/license_response_dto.dart b/mobile/openapi/lib/model/license_response_dto.dart index 6d3009433f..bfdeaee767 100644 --- a/mobile/openapi/lib/model/license_response_dto.dart +++ b/mobile/openapi/lib/model/license_response_dto.dart @@ -57,7 +57,7 @@ class LicenseResponseDto { final json = value.cast(); return LicenseResponseDto( - activatedAt: mapDateTime(json, r'activatedAt', r'')!, + activatedAt: mapDateTime(json, r'activatedAt', r'')!, activationKey: mapValueOfType(json, r'activationKey')!, licenseKey: mapValueOfType(json, r'licenseKey')!, ); diff --git a/mobile/openapi/lib/model/map_marker_response_dto.dart b/mobile/openapi/lib/model/map_marker_response_dto.dart index 74ac51a271..2864d0f9a2 100644 --- a/mobile/openapi/lib/model/map_marker_response_dto.dart +++ b/mobile/openapi/lib/model/map_marker_response_dto.dart @@ -13,17 +13,17 @@ part of openapi.api; class MapMarkerResponseDto { /// Returns a new [MapMarkerResponseDto] instance. MapMarkerResponseDto({ - required this.city, - required this.country, + this.city = const None(), + this.country = const None(), required this.id, required this.lat, required this.lon, - required this.state, + this.state = const None(), }); - String? city; + Option city; - String? country; + Option country; String id; @@ -31,7 +31,7 @@ class MapMarkerResponseDto { double lon; - String? state; + Option state; @override bool operator ==(Object other) => identical(this, other) || other is MapMarkerResponseDto && @@ -45,35 +45,41 @@ class MapMarkerResponseDto { @override int get hashCode => // ignore: unnecessary_parenthesis - (city == null ? 0 : city!.hashCode) + - (country == null ? 0 : country!.hashCode) + + (city.hashCode) + + (country.hashCode) + (id.hashCode) + (lat.hashCode) + (lon.hashCode) + - (state == null ? 0 : state!.hashCode); + (state.hashCode); @override String toString() => 'MapMarkerResponseDto[city=$city, country=$country, id=$id, lat=$lat, lon=$lon, state=$state]'; Map toJson() { final json = {}; - if (this.city != null) { + if (this.city.unwrapOrNull() != null) { json[r'city'] = this.city; } else { - // json[r'city'] = null; + if(this.city.isSome) { + json[r'city'] = null; + } } - if (this.country != null) { + if (this.country.unwrapOrNull() != null) { json[r'country'] = this.country; } else { - // json[r'country'] = null; + if(this.country.isSome) { + json[r'country'] = null; + } } json[r'id'] = this.id; json[r'lat'] = this.lat; json[r'lon'] = this.lon; - if (this.state != null) { + if (this.state.unwrapOrNull() != null) { json[r'state'] = this.state; } else { - // json[r'state'] = null; + if(this.state.isSome) { + json[r'state'] = null; + } } return json; } @@ -87,12 +93,12 @@ class MapMarkerResponseDto { final json = value.cast(); return MapMarkerResponseDto( - city: mapValueOfType(json, r'city'), - country: mapValueOfType(json, r'country'), + city: Option.from(mapValueOfType(json, r'city')), + country: Option.from(mapValueOfType(json, r'country')), id: mapValueOfType(json, r'id')!, lat: (mapValueOfType(json, r'lat')!).toDouble(), lon: (mapValueOfType(json, r'lon')!).toDouble(), - state: mapValueOfType(json, r'state'), + state: Option.from(mapValueOfType(json, r'state')), ); } return null; diff --git a/mobile/openapi/lib/model/map_reverse_geocode_response_dto.dart b/mobile/openapi/lib/model/map_reverse_geocode_response_dto.dart index 6d8757d39f..8f583bc07c 100644 --- a/mobile/openapi/lib/model/map_reverse_geocode_response_dto.dart +++ b/mobile/openapi/lib/model/map_reverse_geocode_response_dto.dart @@ -13,16 +13,16 @@ part of openapi.api; class MapReverseGeocodeResponseDto { /// Returns a new [MapReverseGeocodeResponseDto] instance. MapReverseGeocodeResponseDto({ - required this.city, - required this.country, - required this.state, + this.city = const None(), + this.country = const None(), + this.state = const None(), }); - String? city; + Option city; - String? country; + Option country; - String? state; + Option state; @override bool operator ==(Object other) => identical(this, other) || other is MapReverseGeocodeResponseDto && @@ -33,29 +33,35 @@ class MapReverseGeocodeResponseDto { @override int get hashCode => // ignore: unnecessary_parenthesis - (city == null ? 0 : city!.hashCode) + - (country == null ? 0 : country!.hashCode) + - (state == null ? 0 : state!.hashCode); + (city.hashCode) + + (country.hashCode) + + (state.hashCode); @override String toString() => 'MapReverseGeocodeResponseDto[city=$city, country=$country, state=$state]'; Map toJson() { final json = {}; - if (this.city != null) { + if (this.city.unwrapOrNull() != null) { json[r'city'] = this.city; } else { - // json[r'city'] = null; + if(this.city.isSome) { + json[r'city'] = null; + } } - if (this.country != null) { + if (this.country.unwrapOrNull() != null) { json[r'country'] = this.country; } else { - // json[r'country'] = null; + if(this.country.isSome) { + json[r'country'] = null; + } } - if (this.state != null) { + if (this.state.unwrapOrNull() != null) { json[r'state'] = this.state; } else { - // json[r'state'] = null; + if(this.state.isSome) { + json[r'state'] = null; + } } return json; } @@ -69,9 +75,9 @@ class MapReverseGeocodeResponseDto { final json = value.cast(); return MapReverseGeocodeResponseDto( - city: mapValueOfType(json, r'city'), - country: mapValueOfType(json, r'country'), - state: mapValueOfType(json, r'state'), + city: Option.from(mapValueOfType(json, r'city')), + country: Option.from(mapValueOfType(json, r'country')), + state: Option.from(mapValueOfType(json, r'state')), ); } return null; diff --git a/mobile/openapi/lib/model/memory_create_dto.dart b/mobile/openapi/lib/model/memory_create_dto.dart index 15985f2f1c..2411acb9f8 100644 --- a/mobile/openapi/lib/model/memory_create_dto.dart +++ b/mobile/openapi/lib/model/memory_create_dto.dart @@ -100,8 +100,8 @@ class MemoryCreateDto { : const [], data: OnThisDayDto.fromJson(json[r'data'])!, isSaved: mapValueOfType(json, r'isSaved'), - memoryAt: mapDateTime(json, r'memoryAt', r'')!, - seenAt: mapDateTime(json, r'seenAt', r''), + memoryAt: mapDateTime(json, r'memoryAt', r'')!, + seenAt: mapDateTime(json, r'seenAt', r''), type: MemoryType.fromJson(json[r'type'])!, ); } diff --git a/mobile/openapi/lib/model/memory_response_dto.dart b/mobile/openapi/lib/model/memory_response_dto.dart index 7d50259e24..6526572701 100644 --- a/mobile/openapi/lib/model/memory_response_dto.dart +++ b/mobile/openapi/lib/model/memory_response_dto.dart @@ -158,18 +158,18 @@ class MemoryResponseDto { return MemoryResponseDto( assets: AssetResponseDto.listFromJson(json[r'assets']), - createdAt: mapDateTime(json, r'createdAt', r'')!, + createdAt: mapDateTime(json, r'createdAt', r'')!, data: OnThisDayDto.fromJson(json[r'data'])!, - deletedAt: mapDateTime(json, r'deletedAt', r''), - hideAt: mapDateTime(json, r'hideAt', r''), + deletedAt: mapDateTime(json, r'deletedAt', r''), + hideAt: mapDateTime(json, r'hideAt', r''), id: mapValueOfType(json, r'id')!, isSaved: mapValueOfType(json, r'isSaved')!, - memoryAt: mapDateTime(json, r'memoryAt', r'')!, + memoryAt: mapDateTime(json, r'memoryAt', r'')!, ownerId: mapValueOfType(json, r'ownerId')!, - seenAt: mapDateTime(json, r'seenAt', r''), - showAt: mapDateTime(json, r'showAt', r''), + seenAt: mapDateTime(json, r'seenAt', r''), + showAt: mapDateTime(json, r'showAt', r''), type: MemoryType.fromJson(json[r'type'])!, - updatedAt: mapDateTime(json, r'updatedAt', r'')!, + updatedAt: mapDateTime(json, r'updatedAt', r'')!, ); } return null; diff --git a/mobile/openapi/lib/model/memory_update_dto.dart b/mobile/openapi/lib/model/memory_update_dto.dart index e750f9faad..66e4c3e851 100644 --- a/mobile/openapi/lib/model/memory_update_dto.dart +++ b/mobile/openapi/lib/model/memory_update_dto.dart @@ -88,8 +88,8 @@ class MemoryUpdateDto { return MemoryUpdateDto( isSaved: mapValueOfType(json, r'isSaved'), - memoryAt: mapDateTime(json, r'memoryAt', r''), - seenAt: mapDateTime(json, r'seenAt', r''), + memoryAt: mapDateTime(json, r'memoryAt', r''), + seenAt: mapDateTime(json, r'seenAt', r''), ); } return null; diff --git a/mobile/openapi/lib/model/metadata_search_dto.dart b/mobile/openapi/lib/model/metadata_search_dto.dart index 7f1184467b..30159e2cb7 100644 --- a/mobile/openapi/lib/model/metadata_search_dto.dart +++ b/mobile/openapi/lib/model/metadata_search_dto.dart @@ -14,8 +14,8 @@ class MetadataSearchDto { /// Returns a new [MetadataSearchDto] instance. MetadataSearchDto({ this.checksum, - this.city, - this.country, + this.city = const None(), + this.country = const None(), this.createdAfter, this.createdBefore, this.description, @@ -28,10 +28,10 @@ class MetadataSearchDto { this.isMotion, this.isNotInAlbum, this.isOffline, - this.lensModel, - this.libraryId, + this.lensModel = const None(), + this.libraryId = const None(), this.make, - this.model, + this.model = const None(), this.order = AssetOrder.desc, this.originalFileName, this.originalPath, @@ -40,7 +40,7 @@ class MetadataSearchDto { this.previewPath, this.rating, this.size, - this.state, + this.state = const None(), this.tagIds = const [], this.takenAfter, this.takenBefore, @@ -65,9 +65,9 @@ class MetadataSearchDto { /// String? checksum; - String? city; + Option city; - String? country; + Option country; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -165,9 +165,9 @@ class MetadataSearchDto { /// bool? isOffline; - String? lensModel; + Option lensModel; - String? libraryId; + Option libraryId; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -177,7 +177,7 @@ class MetadataSearchDto { /// String? make; - String? model; + Option model; AssetOrder order; @@ -236,7 +236,7 @@ class MetadataSearchDto { /// num? size; - String? state; + Option state; List tagIds; @@ -393,8 +393,8 @@ class MetadataSearchDto { int get hashCode => // ignore: unnecessary_parenthesis (checksum == null ? 0 : checksum!.hashCode) + - (city == null ? 0 : city!.hashCode) + - (country == null ? 0 : country!.hashCode) + + (city.hashCode) + + (country.hashCode) + (createdAfter == null ? 0 : createdAfter!.hashCode) + (createdBefore == null ? 0 : createdBefore!.hashCode) + (description == null ? 0 : description!.hashCode) + @@ -407,10 +407,10 @@ class MetadataSearchDto { (isMotion == null ? 0 : isMotion!.hashCode) + (isNotInAlbum == null ? 0 : isNotInAlbum!.hashCode) + (isOffline == null ? 0 : isOffline!.hashCode) + - (lensModel == null ? 0 : lensModel!.hashCode) + - (libraryId == null ? 0 : libraryId!.hashCode) + + (lensModel.hashCode) + + (libraryId.hashCode) + (make == null ? 0 : make!.hashCode) + - (model == null ? 0 : model!.hashCode) + + (model.hashCode) + (order.hashCode) + (originalFileName == null ? 0 : originalFileName!.hashCode) + (originalPath == null ? 0 : originalPath!.hashCode) + @@ -419,7 +419,7 @@ class MetadataSearchDto { (previewPath == null ? 0 : previewPath!.hashCode) + (rating == null ? 0 : rating!.hashCode) + (size == null ? 0 : size!.hashCode) + - (state == null ? 0 : state!.hashCode) + + (state.hashCode) + (tagIds.hashCode) + (takenAfter == null ? 0 : takenAfter!.hashCode) + (takenBefore == null ? 0 : takenBefore!.hashCode) + @@ -445,15 +445,19 @@ class MetadataSearchDto { } else { // json[r'checksum'] = null; } - if (this.city != null) { + if (this.city.unwrapOrNull() != null) { json[r'city'] = this.city; } else { - // json[r'city'] = null; + if(this.city.isSome) { + json[r'city'] = null; + } } - if (this.country != null) { + if (this.country.unwrapOrNull() != null) { json[r'country'] = this.country; } else { - // json[r'country'] = null; + if(this.country.isSome) { + json[r'country'] = null; + } } if (this.createdAfter != null) { json[r'createdAfter'] = this.createdAfter!.toUtc().toIso8601String(); @@ -515,25 +519,31 @@ class MetadataSearchDto { } else { // json[r'isOffline'] = null; } - if (this.lensModel != null) { + if (this.lensModel.unwrapOrNull() != null) { json[r'lensModel'] = this.lensModel; } else { - // json[r'lensModel'] = null; + if(this.lensModel.isSome) { + json[r'lensModel'] = null; + } } - if (this.libraryId != null) { + if (this.libraryId.unwrapOrNull() != null) { json[r'libraryId'] = this.libraryId; } else { - // json[r'libraryId'] = null; + if(this.libraryId.isSome) { + json[r'libraryId'] = null; + } } if (this.make != null) { json[r'make'] = this.make; } else { // json[r'make'] = null; } - if (this.model != null) { + if (this.model.unwrapOrNull() != null) { json[r'model'] = this.model; } else { - // json[r'model'] = null; + if(this.model.isSome) { + json[r'model'] = null; + } } json[r'order'] = this.order; if (this.originalFileName != null) { @@ -567,10 +577,12 @@ class MetadataSearchDto { } else { // json[r'size'] = null; } - if (this.state != null) { + if (this.state.unwrapOrNull() != null) { json[r'state'] = this.state; } else { - // json[r'state'] = null; + if(this.state.isSome) { + json[r'state'] = null; + } } json[r'tagIds'] = this.tagIds; if (this.takenAfter != null) { @@ -651,10 +663,10 @@ class MetadataSearchDto { return MetadataSearchDto( checksum: mapValueOfType(json, r'checksum'), - city: mapValueOfType(json, r'city'), - country: mapValueOfType(json, r'country'), - createdAfter: mapDateTime(json, r'createdAfter', r''), - createdBefore: mapDateTime(json, r'createdBefore', r''), + city: Option.from(mapValueOfType(json, r'city')), + country: Option.from(mapValueOfType(json, r'country')), + createdAfter: mapDateTime(json, r'createdAfter', r''), + createdBefore: mapDateTime(json, r'createdBefore', r''), description: mapValueOfType(json, r'description'), deviceAssetId: mapValueOfType(json, r'deviceAssetId'), deviceId: mapValueOfType(json, r'deviceId'), @@ -665,10 +677,10 @@ class MetadataSearchDto { isMotion: mapValueOfType(json, r'isMotion'), isNotInAlbum: mapValueOfType(json, r'isNotInAlbum'), isOffline: mapValueOfType(json, r'isOffline'), - lensModel: mapValueOfType(json, r'lensModel'), - libraryId: mapValueOfType(json, r'libraryId'), + lensModel: Option.from(mapValueOfType(json, r'lensModel')), + libraryId: Option.from(mapValueOfType(json, r'libraryId')), make: mapValueOfType(json, r'make'), - model: mapValueOfType(json, r'model'), + model: Option.from(mapValueOfType(json, r'model')), order: AssetOrder.fromJson(json[r'order']) ?? AssetOrder.desc, originalFileName: mapValueOfType(json, r'originalFileName'), originalPath: mapValueOfType(json, r'originalPath'), @@ -679,18 +691,18 @@ class MetadataSearchDto { previewPath: mapValueOfType(json, r'previewPath'), rating: num.parse('${json[r'rating']}'), size: num.parse('${json[r'size']}'), - state: mapValueOfType(json, r'state'), + state: Option.from(mapValueOfType(json, r'state')), tagIds: json[r'tagIds'] is Iterable ? (json[r'tagIds'] as Iterable).cast().toList(growable: false) : const [], - takenAfter: mapDateTime(json, r'takenAfter', r''), - takenBefore: mapDateTime(json, r'takenBefore', r''), + takenAfter: mapDateTime(json, r'takenAfter', r''), + takenBefore: mapDateTime(json, r'takenBefore', r''), thumbnailPath: mapValueOfType(json, r'thumbnailPath'), - trashedAfter: mapDateTime(json, r'trashedAfter', r''), - trashedBefore: mapDateTime(json, r'trashedBefore', r''), + trashedAfter: mapDateTime(json, r'trashedAfter', r''), + trashedBefore: mapDateTime(json, r'trashedBefore', r''), type: AssetTypeEnum.fromJson(json[r'type']), - updatedAfter: mapDateTime(json, r'updatedAfter', r''), - updatedBefore: mapDateTime(json, r'updatedBefore', r''), + updatedAfter: mapDateTime(json, r'updatedAfter', r''), + updatedBefore: mapDateTime(json, r'updatedBefore', r''), visibility: AssetVisibility.fromJson(json[r'visibility']), withDeleted: mapValueOfType(json, r'withDeleted'), withExif: mapValueOfType(json, r'withExif'), diff --git a/mobile/openapi/lib/model/notification_create_dto.dart b/mobile/openapi/lib/model/notification_create_dto.dart index 07985353b2..87b63f898d 100644 --- a/mobile/openapi/lib/model/notification_create_dto.dart +++ b/mobile/openapi/lib/model/notification_create_dto.dart @@ -14,9 +14,9 @@ class NotificationCreateDto { /// Returns a new [NotificationCreateDto] instance. NotificationCreateDto({ this.data, - this.description, + this.description = const None(), this.level, - this.readAt, + this.readAt = const None(), required this.title, this.type, required this.userId, @@ -30,7 +30,7 @@ class NotificationCreateDto { /// Object? data; - String? description; + Option description; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -40,7 +40,7 @@ class NotificationCreateDto { /// NotificationLevel? level; - DateTime? readAt; + Option readAt; String title; @@ -68,9 +68,9 @@ class NotificationCreateDto { int get hashCode => // ignore: unnecessary_parenthesis (data == null ? 0 : data!.hashCode) + - (description == null ? 0 : description!.hashCode) + + (description.hashCode) + (level == null ? 0 : level!.hashCode) + - (readAt == null ? 0 : readAt!.hashCode) + + (readAt.hashCode) + (title.hashCode) + (type == null ? 0 : type!.hashCode) + (userId.hashCode); @@ -85,20 +85,24 @@ class NotificationCreateDto { } else { // json[r'data'] = null; } - if (this.description != null) { + if (this.description.unwrapOrNull() != null) { json[r'description'] = this.description; } else { - // json[r'description'] = null; + if(this.description.isSome) { + json[r'description'] = null; + } } if (this.level != null) { json[r'level'] = this.level; } else { // json[r'level'] = null; } - if (this.readAt != null) { - json[r'readAt'] = this.readAt!.toUtc().toIso8601String(); + if (this.readAt.unwrapOrNull() != null) { + json[r'readAt'] = this.readAt.unwrap().toUtc().toIso8601String(); } else { - // json[r'readAt'] = null; + if(this.readAt.isSome) { + json[r'readAt'] = null; + } } json[r'title'] = this.title; if (this.type != null) { @@ -120,9 +124,9 @@ class NotificationCreateDto { return NotificationCreateDto( data: mapValueOfType(json, r'data'), - description: mapValueOfType(json, r'description'), + description: Option.from(mapValueOfType(json, r'description')), level: NotificationLevel.fromJson(json[r'level']), - readAt: mapDateTime(json, r'readAt', r''), + readAt: Option.from(mapDateTime(json, r'readAt', r'')), title: mapValueOfType(json, r'title')!, type: NotificationType.fromJson(json[r'type']), userId: mapValueOfType(json, r'userId')!, diff --git a/mobile/openapi/lib/model/notification_dto.dart b/mobile/openapi/lib/model/notification_dto.dart index 4f730b4e50..558959259e 100644 --- a/mobile/openapi/lib/model/notification_dto.dart +++ b/mobile/openapi/lib/model/notification_dto.dart @@ -117,12 +117,12 @@ class NotificationDto { final json = value.cast(); return NotificationDto( - createdAt: mapDateTime(json, r'createdAt', r'')!, + createdAt: mapDateTime(json, r'createdAt', r'')!, data: mapValueOfType(json, r'data'), description: mapValueOfType(json, r'description'), id: mapValueOfType(json, r'id')!, level: NotificationLevel.fromJson(json[r'level'])!, - readAt: mapDateTime(json, r'readAt', r''), + readAt: mapDateTime(json, r'readAt', r''), title: mapValueOfType(json, r'title')!, type: NotificationType.fromJson(json[r'type'])!, ); diff --git a/mobile/openapi/lib/model/notification_update_all_dto.dart b/mobile/openapi/lib/model/notification_update_all_dto.dart index a6393b275a..5d28d897cc 100644 --- a/mobile/openapi/lib/model/notification_update_all_dto.dart +++ b/mobile/openapi/lib/model/notification_update_all_dto.dart @@ -14,12 +14,12 @@ class NotificationUpdateAllDto { /// Returns a new [NotificationUpdateAllDto] instance. NotificationUpdateAllDto({ this.ids = const [], - this.readAt, + this.readAt = const None(), }); List ids; - DateTime? readAt; + Option readAt; @override bool operator ==(Object other) => identical(this, other) || other is NotificationUpdateAllDto && @@ -30,7 +30,7 @@ class NotificationUpdateAllDto { int get hashCode => // ignore: unnecessary_parenthesis (ids.hashCode) + - (readAt == null ? 0 : readAt!.hashCode); + (readAt.hashCode); @override String toString() => 'NotificationUpdateAllDto[ids=$ids, readAt=$readAt]'; @@ -38,10 +38,12 @@ class NotificationUpdateAllDto { Map toJson() { final json = {}; json[r'ids'] = this.ids; - if (this.readAt != null) { - json[r'readAt'] = this.readAt!.toUtc().toIso8601String(); + if (this.readAt.unwrapOrNull() != null) { + json[r'readAt'] = this.readAt.unwrap().toUtc().toIso8601String(); } else { - // json[r'readAt'] = null; + if(this.readAt.isSome) { + json[r'readAt'] = null; + } } return json; } @@ -58,7 +60,7 @@ class NotificationUpdateAllDto { ids: json[r'ids'] is Iterable ? (json[r'ids'] as Iterable).cast().toList(growable: false) : const [], - readAt: mapDateTime(json, r'readAt', r''), + readAt: Option.from(mapDateTime(json, r'readAt', r'')), ); } return null; diff --git a/mobile/openapi/lib/model/notification_update_dto.dart b/mobile/openapi/lib/model/notification_update_dto.dart index e76496eb97..5f2377c09e 100644 --- a/mobile/openapi/lib/model/notification_update_dto.dart +++ b/mobile/openapi/lib/model/notification_update_dto.dart @@ -13,10 +13,10 @@ part of openapi.api; class NotificationUpdateDto { /// Returns a new [NotificationUpdateDto] instance. NotificationUpdateDto({ - this.readAt, + this.readAt = const None(), }); - DateTime? readAt; + Option readAt; @override bool operator ==(Object other) => identical(this, other) || other is NotificationUpdateDto && @@ -25,17 +25,19 @@ class NotificationUpdateDto { @override int get hashCode => // ignore: unnecessary_parenthesis - (readAt == null ? 0 : readAt!.hashCode); + (readAt.hashCode); @override String toString() => 'NotificationUpdateDto[readAt=$readAt]'; Map toJson() { final json = {}; - if (this.readAt != null) { - json[r'readAt'] = this.readAt!.toUtc().toIso8601String(); + if (this.readAt.unwrapOrNull() != null) { + json[r'readAt'] = this.readAt.unwrap().toUtc().toIso8601String(); } else { - // json[r'readAt'] = null; + if(this.readAt.isSome) { + json[r'readAt'] = null; + } } return json; } @@ -49,7 +51,7 @@ class NotificationUpdateDto { final json = value.cast(); return NotificationUpdateDto( - readAt: mapDateTime(json, r'readAt', r''), + readAt: Option.from(mapDateTime(json, r'readAt', r'')), ); } return null; diff --git a/mobile/openapi/lib/model/partner_response_dto.dart b/mobile/openapi/lib/model/partner_response_dto.dart index f61df86b42..4d4b2dd5dc 100644 --- a/mobile/openapi/lib/model/partner_response_dto.dart +++ b/mobile/openapi/lib/model/partner_response_dto.dart @@ -96,7 +96,7 @@ class PartnerResponseDto { id: mapValueOfType(json, r'id')!, inTimeline: mapValueOfType(json, r'inTimeline'), name: mapValueOfType(json, r'name')!, - profileChangedAt: mapDateTime(json, r'profileChangedAt', r'')!, + profileChangedAt: mapDateTime(json, r'profileChangedAt', r'')!, profileImagePath: mapValueOfType(json, r'profileImagePath')!, ); } diff --git a/mobile/openapi/lib/model/people_update_item.dart b/mobile/openapi/lib/model/people_update_item.dart index ce324b859e..74da611d59 100644 --- a/mobile/openapi/lib/model/people_update_item.dart +++ b/mobile/openapi/lib/model/people_update_item.dart @@ -13,8 +13,8 @@ part of openapi.api; class PeopleUpdateItem { /// Returns a new [PeopleUpdateItem] instance. PeopleUpdateItem({ - this.birthDate, - this.color, + this.birthDate = const None(), + this.color = const None(), this.featureFaceAssetId, required this.id, this.isFavorite, @@ -23,9 +23,9 @@ class PeopleUpdateItem { }); /// Person date of birth. Note: the mobile app cannot currently set the birth date to null. - DateTime? birthDate; + Option birthDate; - String? color; + Option color; /// Asset is used to get the feature face thumbnail. /// @@ -78,8 +78,8 @@ class PeopleUpdateItem { @override int get hashCode => // ignore: unnecessary_parenthesis - (birthDate == null ? 0 : birthDate!.hashCode) + - (color == null ? 0 : color!.hashCode) + + (birthDate.hashCode) + + (color.hashCode) + (featureFaceAssetId == null ? 0 : featureFaceAssetId!.hashCode) + (id.hashCode) + (isFavorite == null ? 0 : isFavorite!.hashCode) + @@ -91,15 +91,19 @@ class PeopleUpdateItem { Map toJson() { final json = {}; - if (this.birthDate != null) { - json[r'birthDate'] = _dateFormatter.format(this.birthDate!.toUtc()); + if (this.birthDate.unwrapOrNull() != null) { + json[r'birthDate'] = _dateFormatter.format(this.birthDate.unwrap().toUtc()); } else { - // json[r'birthDate'] = null; + if(this.birthDate.isSome) { + json[r'birthDate'] = null; + } } - if (this.color != null) { + if (this.color.unwrapOrNull() != null) { json[r'color'] = this.color; } else { - // json[r'color'] = null; + if(this.color.isSome) { + json[r'color'] = null; + } } if (this.featureFaceAssetId != null) { json[r'featureFaceAssetId'] = this.featureFaceAssetId; @@ -134,8 +138,8 @@ class PeopleUpdateItem { final json = value.cast(); return PeopleUpdateItem( - birthDate: mapDateTime(json, r'birthDate', r''), - color: mapValueOfType(json, r'color'), + birthDate: Option.from(mapDateTime(json, r'birthDate', r'')), + color: Option.from(mapValueOfType(json, r'color')), featureFaceAssetId: mapValueOfType(json, r'featureFaceAssetId'), id: mapValueOfType(json, r'id')!, isFavorite: mapValueOfType(json, r'isFavorite'), diff --git a/mobile/openapi/lib/model/person_create_dto.dart b/mobile/openapi/lib/model/person_create_dto.dart index 87b426eaed..78038b9a9e 100644 --- a/mobile/openapi/lib/model/person_create_dto.dart +++ b/mobile/openapi/lib/model/person_create_dto.dart @@ -13,17 +13,17 @@ part of openapi.api; class PersonCreateDto { /// Returns a new [PersonCreateDto] instance. PersonCreateDto({ - this.birthDate, - this.color, + this.birthDate = const None(), + this.color = const None(), this.isFavorite, this.isHidden, this.name, }); /// Person date of birth. Note: the mobile app cannot currently set the birth date to null. - DateTime? birthDate; + Option birthDate; - String? color; + Option color; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -62,8 +62,8 @@ class PersonCreateDto { @override int get hashCode => // ignore: unnecessary_parenthesis - (birthDate == null ? 0 : birthDate!.hashCode) + - (color == null ? 0 : color!.hashCode) + + (birthDate.hashCode) + + (color.hashCode) + (isFavorite == null ? 0 : isFavorite!.hashCode) + (isHidden == null ? 0 : isHidden!.hashCode) + (name == null ? 0 : name!.hashCode); @@ -73,15 +73,19 @@ class PersonCreateDto { Map toJson() { final json = {}; - if (this.birthDate != null) { - json[r'birthDate'] = _dateFormatter.format(this.birthDate!.toUtc()); + if (this.birthDate.unwrapOrNull() != null) { + json[r'birthDate'] = _dateFormatter.format(this.birthDate.unwrap().toUtc()); } else { - // json[r'birthDate'] = null; + if(this.birthDate.isSome) { + json[r'birthDate'] = null; + } } - if (this.color != null) { + if (this.color.unwrapOrNull() != null) { json[r'color'] = this.color; } else { - // json[r'color'] = null; + if(this.color.isSome) { + json[r'color'] = null; + } } if (this.isFavorite != null) { json[r'isFavorite'] = this.isFavorite; @@ -110,8 +114,8 @@ class PersonCreateDto { final json = value.cast(); return PersonCreateDto( - birthDate: mapDateTime(json, r'birthDate', r''), - color: mapValueOfType(json, r'color'), + birthDate: Option.from(mapDateTime(json, r'birthDate', r'')), + color: Option.from(mapValueOfType(json, r'color')), isFavorite: mapValueOfType(json, r'isFavorite'), isHidden: mapValueOfType(json, r'isHidden'), name: mapValueOfType(json, r'name'), diff --git a/mobile/openapi/lib/model/person_response_dto.dart b/mobile/openapi/lib/model/person_response_dto.dart index c9ebb14c72..ada5d61cc4 100644 --- a/mobile/openapi/lib/model/person_response_dto.dart +++ b/mobile/openapi/lib/model/person_response_dto.dart @@ -13,7 +13,7 @@ part of openapi.api; class PersonResponseDto { /// Returns a new [PersonResponseDto] instance. PersonResponseDto({ - required this.birthDate, + this.birthDate = const None(), this.color, required this.id, this.isFavorite, @@ -23,7 +23,7 @@ class PersonResponseDto { this.updatedAt, }); - DateTime? birthDate; + Option birthDate; /// This property was added in v1.126.0 /// @@ -74,7 +74,7 @@ class PersonResponseDto { @override int get hashCode => // ignore: unnecessary_parenthesis - (birthDate == null ? 0 : birthDate!.hashCode) + + (birthDate.hashCode) + (color == null ? 0 : color!.hashCode) + (id.hashCode) + (isFavorite == null ? 0 : isFavorite!.hashCode) + @@ -88,10 +88,12 @@ class PersonResponseDto { Map toJson() { final json = {}; - if (this.birthDate != null) { - json[r'birthDate'] = _dateFormatter.format(this.birthDate!.toUtc()); + if (this.birthDate.unwrapOrNull() != null) { + json[r'birthDate'] = _dateFormatter.format(this.birthDate.unwrap().toUtc()); } else { - // json[r'birthDate'] = null; + if(this.birthDate.isSome) { + json[r'birthDate'] = null; + } } if (this.color != null) { json[r'color'] = this.color; @@ -124,14 +126,14 @@ class PersonResponseDto { final json = value.cast(); return PersonResponseDto( - birthDate: mapDateTime(json, r'birthDate', r''), + birthDate: Option.from(mapDateTime(json, r'birthDate', r'')), color: mapValueOfType(json, r'color'), id: mapValueOfType(json, r'id')!, isFavorite: mapValueOfType(json, r'isFavorite'), isHidden: mapValueOfType(json, r'isHidden')!, name: mapValueOfType(json, r'name')!, thumbnailPath: mapValueOfType(json, r'thumbnailPath')!, - updatedAt: mapDateTime(json, r'updatedAt', r''), + updatedAt: mapDateTime(json, r'updatedAt', r''), ); } return null; diff --git a/mobile/openapi/lib/model/person_update_dto.dart b/mobile/openapi/lib/model/person_update_dto.dart index 6736b4e177..2e55d0c4e8 100644 --- a/mobile/openapi/lib/model/person_update_dto.dart +++ b/mobile/openapi/lib/model/person_update_dto.dart @@ -13,8 +13,8 @@ part of openapi.api; class PersonUpdateDto { /// Returns a new [PersonUpdateDto] instance. PersonUpdateDto({ - this.birthDate, - this.color, + this.birthDate = const None(), + this.color = const None(), this.featureFaceAssetId, this.isFavorite, this.isHidden, @@ -22,9 +22,9 @@ class PersonUpdateDto { }); /// Person date of birth. Note: the mobile app cannot currently set the birth date to null. - DateTime? birthDate; + Option birthDate; - String? color; + Option color; /// Asset is used to get the feature face thumbnail. /// @@ -73,8 +73,8 @@ class PersonUpdateDto { @override int get hashCode => // ignore: unnecessary_parenthesis - (birthDate == null ? 0 : birthDate!.hashCode) + - (color == null ? 0 : color!.hashCode) + + (birthDate.hashCode) + + (color.hashCode) + (featureFaceAssetId == null ? 0 : featureFaceAssetId!.hashCode) + (isFavorite == null ? 0 : isFavorite!.hashCode) + (isHidden == null ? 0 : isHidden!.hashCode) + @@ -85,15 +85,19 @@ class PersonUpdateDto { Map toJson() { final json = {}; - if (this.birthDate != null) { - json[r'birthDate'] = _dateFormatter.format(this.birthDate!.toUtc()); + if (this.birthDate.unwrapOrNull() != null) { + json[r'birthDate'] = _dateFormatter.format(this.birthDate.unwrap().toUtc()); } else { - // json[r'birthDate'] = null; + if(this.birthDate.isSome) { + json[r'birthDate'] = null; + } } - if (this.color != null) { + if (this.color.unwrapOrNull() != null) { json[r'color'] = this.color; } else { - // json[r'color'] = null; + if(this.color.isSome) { + json[r'color'] = null; + } } if (this.featureFaceAssetId != null) { json[r'featureFaceAssetId'] = this.featureFaceAssetId; @@ -127,8 +131,8 @@ class PersonUpdateDto { final json = value.cast(); return PersonUpdateDto( - birthDate: mapDateTime(json, r'birthDate', r''), - color: mapValueOfType(json, r'color'), + birthDate: Option.from(mapDateTime(json, r'birthDate', r'')), + color: Option.from(mapValueOfType(json, r'color')), featureFaceAssetId: mapValueOfType(json, r'featureFaceAssetId'), isFavorite: mapValueOfType(json, r'isFavorite'), isHidden: mapValueOfType(json, r'isHidden'), diff --git a/mobile/openapi/lib/model/person_with_faces_response_dto.dart b/mobile/openapi/lib/model/person_with_faces_response_dto.dart index 0bd38b0870..4db1fc9467 100644 --- a/mobile/openapi/lib/model/person_with_faces_response_dto.dart +++ b/mobile/openapi/lib/model/person_with_faces_response_dto.dart @@ -13,7 +13,7 @@ part of openapi.api; class PersonWithFacesResponseDto { /// Returns a new [PersonWithFacesResponseDto] instance. PersonWithFacesResponseDto({ - required this.birthDate, + this.birthDate = const None(), this.color, this.faces = const [], required this.id, @@ -24,7 +24,7 @@ class PersonWithFacesResponseDto { this.updatedAt, }); - DateTime? birthDate; + Option birthDate; /// This property was added in v1.126.0 /// @@ -78,7 +78,7 @@ class PersonWithFacesResponseDto { @override int get hashCode => // ignore: unnecessary_parenthesis - (birthDate == null ? 0 : birthDate!.hashCode) + + (birthDate.hashCode) + (color == null ? 0 : color!.hashCode) + (faces.hashCode) + (id.hashCode) + @@ -93,10 +93,12 @@ class PersonWithFacesResponseDto { Map toJson() { final json = {}; - if (this.birthDate != null) { - json[r'birthDate'] = _dateFormatter.format(this.birthDate!.toUtc()); + if (this.birthDate.unwrapOrNull() != null) { + json[r'birthDate'] = _dateFormatter.format(this.birthDate.unwrap().toUtc()); } else { - // json[r'birthDate'] = null; + if(this.birthDate.isSome) { + json[r'birthDate'] = null; + } } if (this.color != null) { json[r'color'] = this.color; @@ -130,7 +132,7 @@ class PersonWithFacesResponseDto { final json = value.cast(); return PersonWithFacesResponseDto( - birthDate: mapDateTime(json, r'birthDate', r''), + birthDate: Option.from(mapDateTime(json, r'birthDate', r'')), color: mapValueOfType(json, r'color'), faces: AssetFaceWithoutPersonResponseDto.listFromJson(json[r'faces']), id: mapValueOfType(json, r'id')!, @@ -138,7 +140,7 @@ class PersonWithFacesResponseDto { isHidden: mapValueOfType(json, r'isHidden')!, name: mapValueOfType(json, r'name')!, thumbnailPath: mapValueOfType(json, r'thumbnailPath')!, - updatedAt: mapDateTime(json, r'updatedAt', r''), + updatedAt: mapDateTime(json, r'updatedAt', r''), ); } return null; diff --git a/mobile/openapi/lib/model/random_search_dto.dart b/mobile/openapi/lib/model/random_search_dto.dart index 0284212efc..4df1cf83bb 100644 --- a/mobile/openapi/lib/model/random_search_dto.dart +++ b/mobile/openapi/lib/model/random_search_dto.dart @@ -13,8 +13,8 @@ part of openapi.api; class RandomSearchDto { /// Returns a new [RandomSearchDto] instance. RandomSearchDto({ - this.city, - this.country, + this.city = const None(), + this.country = const None(), this.createdAfter, this.createdBefore, this.deviceId, @@ -23,14 +23,14 @@ class RandomSearchDto { this.isMotion, this.isNotInAlbum, this.isOffline, - this.lensModel, - this.libraryId, + this.lensModel = const None(), + this.libraryId = const None(), this.make, - this.model, + this.model = const None(), this.personIds = const [], this.rating, this.size, - this.state, + this.state = const None(), this.tagIds = const [], this.takenAfter, this.takenBefore, @@ -46,9 +46,9 @@ class RandomSearchDto { this.withStacked, }); - String? city; + Option city; - String? country; + Option country; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -114,9 +114,9 @@ class RandomSearchDto { /// bool? isOffline; - String? lensModel; + Option lensModel; - String? libraryId; + Option libraryId; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -126,7 +126,7 @@ class RandomSearchDto { /// String? make; - String? model; + Option model; List personIds; @@ -150,7 +150,7 @@ class RandomSearchDto { /// num? size; - String? state; + Option state; List tagIds; @@ -287,8 +287,8 @@ class RandomSearchDto { @override int get hashCode => // ignore: unnecessary_parenthesis - (city == null ? 0 : city!.hashCode) + - (country == null ? 0 : country!.hashCode) + + (city.hashCode) + + (country.hashCode) + (createdAfter == null ? 0 : createdAfter!.hashCode) + (createdBefore == null ? 0 : createdBefore!.hashCode) + (deviceId == null ? 0 : deviceId!.hashCode) + @@ -297,14 +297,14 @@ class RandomSearchDto { (isMotion == null ? 0 : isMotion!.hashCode) + (isNotInAlbum == null ? 0 : isNotInAlbum!.hashCode) + (isOffline == null ? 0 : isOffline!.hashCode) + - (lensModel == null ? 0 : lensModel!.hashCode) + - (libraryId == null ? 0 : libraryId!.hashCode) + + (lensModel.hashCode) + + (libraryId.hashCode) + (make == null ? 0 : make!.hashCode) + - (model == null ? 0 : model!.hashCode) + + (model.hashCode) + (personIds.hashCode) + (rating == null ? 0 : rating!.hashCode) + (size == null ? 0 : size!.hashCode) + - (state == null ? 0 : state!.hashCode) + + (state.hashCode) + (tagIds.hashCode) + (takenAfter == null ? 0 : takenAfter!.hashCode) + (takenBefore == null ? 0 : takenBefore!.hashCode) + @@ -324,15 +324,19 @@ class RandomSearchDto { Map toJson() { final json = {}; - if (this.city != null) { + if (this.city.unwrapOrNull() != null) { json[r'city'] = this.city; } else { - // json[r'city'] = null; + if(this.city.isSome) { + json[r'city'] = null; + } } - if (this.country != null) { + if (this.country.unwrapOrNull() != null) { json[r'country'] = this.country; } else { - // json[r'country'] = null; + if(this.country.isSome) { + json[r'country'] = null; + } } if (this.createdAfter != null) { json[r'createdAfter'] = this.createdAfter!.toUtc().toIso8601String(); @@ -374,25 +378,31 @@ class RandomSearchDto { } else { // json[r'isOffline'] = null; } - if (this.lensModel != null) { + if (this.lensModel.unwrapOrNull() != null) { json[r'lensModel'] = this.lensModel; } else { - // json[r'lensModel'] = null; + if(this.lensModel.isSome) { + json[r'lensModel'] = null; + } } - if (this.libraryId != null) { + if (this.libraryId.unwrapOrNull() != null) { json[r'libraryId'] = this.libraryId; } else { - // json[r'libraryId'] = null; + if(this.libraryId.isSome) { + json[r'libraryId'] = null; + } } if (this.make != null) { json[r'make'] = this.make; } else { // json[r'make'] = null; } - if (this.model != null) { + if (this.model.unwrapOrNull() != null) { json[r'model'] = this.model; } else { - // json[r'model'] = null; + if(this.model.isSome) { + json[r'model'] = null; + } } json[r'personIds'] = this.personIds; if (this.rating != null) { @@ -405,10 +415,12 @@ class RandomSearchDto { } else { // json[r'size'] = null; } - if (this.state != null) { + if (this.state.unwrapOrNull() != null) { json[r'state'] = this.state; } else { - // json[r'state'] = null; + if(this.state.isSome) { + json[r'state'] = null; + } } json[r'tagIds'] = this.tagIds; if (this.takenAfter != null) { @@ -483,36 +495,36 @@ class RandomSearchDto { final json = value.cast(); return RandomSearchDto( - city: mapValueOfType(json, r'city'), - country: mapValueOfType(json, r'country'), - createdAfter: mapDateTime(json, r'createdAfter', r''), - createdBefore: mapDateTime(json, r'createdBefore', r''), + city: Option.from(mapValueOfType(json, r'city')), + country: Option.from(mapValueOfType(json, r'country')), + createdAfter: mapDateTime(json, r'createdAfter', r''), + createdBefore: mapDateTime(json, r'createdBefore', r''), deviceId: mapValueOfType(json, r'deviceId'), isEncoded: mapValueOfType(json, r'isEncoded'), isFavorite: mapValueOfType(json, r'isFavorite'), isMotion: mapValueOfType(json, r'isMotion'), isNotInAlbum: mapValueOfType(json, r'isNotInAlbum'), isOffline: mapValueOfType(json, r'isOffline'), - lensModel: mapValueOfType(json, r'lensModel'), - libraryId: mapValueOfType(json, r'libraryId'), + lensModel: Option.from(mapValueOfType(json, r'lensModel')), + libraryId: Option.from(mapValueOfType(json, r'libraryId')), make: mapValueOfType(json, r'make'), - model: mapValueOfType(json, r'model'), + model: Option.from(mapValueOfType(json, r'model')), personIds: json[r'personIds'] is Iterable ? (json[r'personIds'] as Iterable).cast().toList(growable: false) : const [], rating: num.parse('${json[r'rating']}'), size: num.parse('${json[r'size']}'), - state: mapValueOfType(json, r'state'), + state: Option.from(mapValueOfType(json, r'state')), tagIds: json[r'tagIds'] is Iterable ? (json[r'tagIds'] as Iterable).cast().toList(growable: false) : const [], - takenAfter: mapDateTime(json, r'takenAfter', r''), - takenBefore: mapDateTime(json, r'takenBefore', r''), - trashedAfter: mapDateTime(json, r'trashedAfter', r''), - trashedBefore: mapDateTime(json, r'trashedBefore', r''), + takenAfter: mapDateTime(json, r'takenAfter', r''), + takenBefore: mapDateTime(json, r'takenBefore', r''), + trashedAfter: mapDateTime(json, r'trashedAfter', r''), + trashedBefore: mapDateTime(json, r'trashedBefore', r''), type: AssetTypeEnum.fromJson(json[r'type']), - updatedAfter: mapDateTime(json, r'updatedAfter', r''), - updatedBefore: mapDateTime(json, r'updatedBefore', r''), + updatedAfter: mapDateTime(json, r'updatedAfter', r''), + updatedBefore: mapDateTime(json, r'updatedBefore', r''), visibility: AssetVisibility.fromJson(json[r'visibility']), withDeleted: mapValueOfType(json, r'withDeleted'), withExif: mapValueOfType(json, r'withExif'), diff --git a/mobile/openapi/lib/model/reverse_geocoding_state_response_dto.dart b/mobile/openapi/lib/model/reverse_geocoding_state_response_dto.dart index 5b3648b46b..a97a0c38ee 100644 --- a/mobile/openapi/lib/model/reverse_geocoding_state_response_dto.dart +++ b/mobile/openapi/lib/model/reverse_geocoding_state_response_dto.dart @@ -13,13 +13,13 @@ part of openapi.api; class ReverseGeocodingStateResponseDto { /// Returns a new [ReverseGeocodingStateResponseDto] instance. ReverseGeocodingStateResponseDto({ - required this.lastImportFileName, - required this.lastUpdate, + this.lastImportFileName = const None(), + this.lastUpdate = const None(), }); - String? lastImportFileName; + Option lastImportFileName; - String? lastUpdate; + Option lastUpdate; @override bool operator ==(Object other) => identical(this, other) || other is ReverseGeocodingStateResponseDto && @@ -29,23 +29,27 @@ class ReverseGeocodingStateResponseDto { @override int get hashCode => // ignore: unnecessary_parenthesis - (lastImportFileName == null ? 0 : lastImportFileName!.hashCode) + - (lastUpdate == null ? 0 : lastUpdate!.hashCode); + (lastImportFileName.hashCode) + + (lastUpdate.hashCode); @override String toString() => 'ReverseGeocodingStateResponseDto[lastImportFileName=$lastImportFileName, lastUpdate=$lastUpdate]'; Map toJson() { final json = {}; - if (this.lastImportFileName != null) { + if (this.lastImportFileName.unwrapOrNull() != null) { json[r'lastImportFileName'] = this.lastImportFileName; } else { - // json[r'lastImportFileName'] = null; + if(this.lastImportFileName.isSome) { + json[r'lastImportFileName'] = null; + } } - if (this.lastUpdate != null) { + if (this.lastUpdate.unwrapOrNull() != null) { json[r'lastUpdate'] = this.lastUpdate; } else { - // json[r'lastUpdate'] = null; + if(this.lastUpdate.isSome) { + json[r'lastUpdate'] = null; + } } return json; } @@ -59,8 +63,8 @@ class ReverseGeocodingStateResponseDto { final json = value.cast(); return ReverseGeocodingStateResponseDto( - lastImportFileName: mapValueOfType(json, r'lastImportFileName'), - lastUpdate: mapValueOfType(json, r'lastUpdate'), + lastImportFileName: Option.from(mapValueOfType(json, r'lastImportFileName')), + lastUpdate: Option.from(mapValueOfType(json, r'lastUpdate')), ); } return null; diff --git a/mobile/openapi/lib/model/search_asset_response_dto.dart b/mobile/openapi/lib/model/search_asset_response_dto.dart index 3d214e61d9..86e44a4f76 100644 --- a/mobile/openapi/lib/model/search_asset_response_dto.dart +++ b/mobile/openapi/lib/model/search_asset_response_dto.dart @@ -16,7 +16,7 @@ class SearchAssetResponseDto { required this.count, this.facets = const [], this.items = const [], - required this.nextPage, + this.nextPage = const None(), required this.total, }); @@ -26,7 +26,7 @@ class SearchAssetResponseDto { List items; - String? nextPage; + Option nextPage; int total; @@ -44,7 +44,7 @@ class SearchAssetResponseDto { (count.hashCode) + (facets.hashCode) + (items.hashCode) + - (nextPage == null ? 0 : nextPage!.hashCode) + + (nextPage.hashCode) + (total.hashCode); @override @@ -55,10 +55,12 @@ class SearchAssetResponseDto { json[r'count'] = this.count; json[r'facets'] = this.facets; json[r'items'] = this.items; - if (this.nextPage != null) { + if (this.nextPage.unwrapOrNull() != null) { json[r'nextPage'] = this.nextPage; } else { - // json[r'nextPage'] = null; + if(this.nextPage.isSome) { + json[r'nextPage'] = null; + } } json[r'total'] = this.total; return json; @@ -76,7 +78,7 @@ class SearchAssetResponseDto { count: mapValueOfType(json, r'count')!, facets: SearchFacetResponseDto.listFromJson(json[r'facets']), items: AssetResponseDto.listFromJson(json[r'items']), - nextPage: mapValueOfType(json, r'nextPage'), + nextPage: Option.from(mapValueOfType(json, r'nextPage')), total: mapValueOfType(json, r'total')!, ); } diff --git a/mobile/openapi/lib/model/server_version_history_response_dto.dart b/mobile/openapi/lib/model/server_version_history_response_dto.dart index c81cb0e8b9..f0ac82ea11 100644 --- a/mobile/openapi/lib/model/server_version_history_response_dto.dart +++ b/mobile/openapi/lib/model/server_version_history_response_dto.dart @@ -57,7 +57,7 @@ class ServerVersionHistoryResponseDto { final json = value.cast(); return ServerVersionHistoryResponseDto( - createdAt: mapDateTime(json, r'createdAt', r'')!, + createdAt: mapDateTime(json, r'createdAt', r'')!, id: mapValueOfType(json, r'id')!, version: mapValueOfType(json, r'version')!, ); diff --git a/mobile/openapi/lib/model/shared_link_create_dto.dart b/mobile/openapi/lib/model/shared_link_create_dto.dart index bc96b31fd2..f9102444bb 100644 --- a/mobile/openapi/lib/model/shared_link_create_dto.dart +++ b/mobile/openapi/lib/model/shared_link_create_dto.dart @@ -18,7 +18,7 @@ class SharedLinkCreateDto { this.allowUpload, this.assetIds = const [], this.description, - this.expiresAt, + this.expiresAt = const None(), this.password, this.showMetadata = true, required this.type, @@ -52,7 +52,7 @@ class SharedLinkCreateDto { /// String? description; - DateTime? expiresAt; + Option expiresAt; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -86,7 +86,7 @@ class SharedLinkCreateDto { (allowUpload == null ? 0 : allowUpload!.hashCode) + (assetIds.hashCode) + (description == null ? 0 : description!.hashCode) + - (expiresAt == null ? 0 : expiresAt!.hashCode) + + (expiresAt.hashCode) + (password == null ? 0 : password!.hashCode) + (showMetadata.hashCode) + (type.hashCode); @@ -113,10 +113,12 @@ class SharedLinkCreateDto { } else { // json[r'description'] = null; } - if (this.expiresAt != null) { - json[r'expiresAt'] = this.expiresAt!.toUtc().toIso8601String(); + if (this.expiresAt.unwrapOrNull() != null) { + json[r'expiresAt'] = this.expiresAt.unwrap().toUtc().toIso8601String(); } else { - // json[r'expiresAt'] = null; + if(this.expiresAt.isSome) { + json[r'expiresAt'] = null; + } } if (this.password != null) { json[r'password'] = this.password; @@ -144,7 +146,7 @@ class SharedLinkCreateDto { ? (json[r'assetIds'] as Iterable).cast().toList(growable: false) : const [], description: mapValueOfType(json, r'description'), - expiresAt: mapDateTime(json, r'expiresAt', r''), + expiresAt: Option.from(mapDateTime(json, r'expiresAt', r'')), password: mapValueOfType(json, r'password'), showMetadata: mapValueOfType(json, r'showMetadata') ?? true, type: SharedLinkType.fromJson(json[r'type'])!, diff --git a/mobile/openapi/lib/model/shared_link_edit_dto.dart b/mobile/openapi/lib/model/shared_link_edit_dto.dart index a394ba9b3b..8e874b9792 100644 --- a/mobile/openapi/lib/model/shared_link_edit_dto.dart +++ b/mobile/openapi/lib/model/shared_link_edit_dto.dart @@ -17,7 +17,7 @@ class SharedLinkEditDto { this.allowUpload, this.changeExpiryTime, this.description, - this.expiresAt, + this.expiresAt = const None(), this.password, this.showMetadata, }); @@ -55,7 +55,7 @@ class SharedLinkEditDto { /// String? description; - DateTime? expiresAt; + Option expiresAt; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -90,7 +90,7 @@ class SharedLinkEditDto { (allowUpload == null ? 0 : allowUpload!.hashCode) + (changeExpiryTime == null ? 0 : changeExpiryTime!.hashCode) + (description == null ? 0 : description!.hashCode) + - (expiresAt == null ? 0 : expiresAt!.hashCode) + + (expiresAt.hashCode) + (password == null ? 0 : password!.hashCode) + (showMetadata == null ? 0 : showMetadata!.hashCode); @@ -119,10 +119,12 @@ class SharedLinkEditDto { } else { // json[r'description'] = null; } - if (this.expiresAt != null) { - json[r'expiresAt'] = this.expiresAt!.toUtc().toIso8601String(); + if (this.expiresAt.unwrapOrNull() != null) { + json[r'expiresAt'] = this.expiresAt.unwrap().toUtc().toIso8601String(); } else { - // json[r'expiresAt'] = null; + if(this.expiresAt.isSome) { + json[r'expiresAt'] = null; + } } if (this.password != null) { json[r'password'] = this.password; @@ -150,7 +152,7 @@ class SharedLinkEditDto { allowUpload: mapValueOfType(json, r'allowUpload'), changeExpiryTime: mapValueOfType(json, r'changeExpiryTime'), description: mapValueOfType(json, r'description'), - expiresAt: mapDateTime(json, r'expiresAt', r''), + expiresAt: Option.from(mapDateTime(json, r'expiresAt', r'')), password: mapValueOfType(json, r'password'), showMetadata: mapValueOfType(json, r'showMetadata'), ); diff --git a/mobile/openapi/lib/model/shared_link_response_dto.dart b/mobile/openapi/lib/model/shared_link_response_dto.dart index 9cc8b3ac80..9f4c30a975 100644 --- a/mobile/openapi/lib/model/shared_link_response_dto.dart +++ b/mobile/openapi/lib/model/shared_link_response_dto.dart @@ -18,13 +18,13 @@ class SharedLinkResponseDto { required this.allowUpload, this.assets = const [], required this.createdAt, - required this.description, - required this.expiresAt, + this.description = const None(), + this.expiresAt = const None(), required this.id, required this.key, - required this.password, + this.password = const None(), required this.showMetadata, - this.token, + this.token = const None(), required this.type, required this.userId, }); @@ -45,19 +45,19 @@ class SharedLinkResponseDto { DateTime createdAt; - String? description; + Option description; - DateTime? expiresAt; + Option expiresAt; String id; String key; - String? password; + Option password; bool showMetadata; - String? token; + Option token; SharedLinkType type; @@ -88,13 +88,13 @@ class SharedLinkResponseDto { (allowUpload.hashCode) + (assets.hashCode) + (createdAt.hashCode) + - (description == null ? 0 : description!.hashCode) + - (expiresAt == null ? 0 : expiresAt!.hashCode) + + (description.hashCode) + + (expiresAt.hashCode) + (id.hashCode) + (key.hashCode) + - (password == null ? 0 : password!.hashCode) + + (password.hashCode) + (showMetadata.hashCode) + - (token == null ? 0 : token!.hashCode) + + (token.hashCode) + (type.hashCode) + (userId.hashCode); @@ -112,28 +112,36 @@ class SharedLinkResponseDto { json[r'allowUpload'] = this.allowUpload; json[r'assets'] = this.assets; json[r'createdAt'] = this.createdAt.toUtc().toIso8601String(); - if (this.description != null) { + if (this.description.unwrapOrNull() != null) { json[r'description'] = this.description; } else { - // json[r'description'] = null; + if(this.description.isSome) { + json[r'description'] = null; + } } - if (this.expiresAt != null) { - json[r'expiresAt'] = this.expiresAt!.toUtc().toIso8601String(); + if (this.expiresAt.unwrapOrNull() != null) { + json[r'expiresAt'] = this.expiresAt.unwrap().toUtc().toIso8601String(); } else { - // json[r'expiresAt'] = null; + if(this.expiresAt.isSome) { + json[r'expiresAt'] = null; + } } json[r'id'] = this.id; json[r'key'] = this.key; - if (this.password != null) { + if (this.password.unwrapOrNull() != null) { json[r'password'] = this.password; } else { - // json[r'password'] = null; + if(this.password.isSome) { + json[r'password'] = null; + } } json[r'showMetadata'] = this.showMetadata; - if (this.token != null) { + if (this.token.unwrapOrNull() != null) { json[r'token'] = this.token; } else { - // json[r'token'] = null; + if(this.token.isSome) { + json[r'token'] = null; + } } json[r'type'] = this.type; json[r'userId'] = this.userId; @@ -153,14 +161,14 @@ class SharedLinkResponseDto { allowDownload: mapValueOfType(json, r'allowDownload')!, allowUpload: mapValueOfType(json, r'allowUpload')!, assets: AssetResponseDto.listFromJson(json[r'assets']), - createdAt: mapDateTime(json, r'createdAt', r'')!, - description: mapValueOfType(json, r'description'), - expiresAt: mapDateTime(json, r'expiresAt', r''), + createdAt: mapDateTime(json, r'createdAt', r'')!, + description: Option.from(mapValueOfType(json, r'description')), + expiresAt: Option.from(mapDateTime(json, r'expiresAt', r'')), id: mapValueOfType(json, r'id')!, key: mapValueOfType(json, r'key')!, - password: mapValueOfType(json, r'password'), + password: Option.from(mapValueOfType(json, r'password')), showMetadata: mapValueOfType(json, r'showMetadata')!, - token: mapValueOfType(json, r'token'), + token: Option.from(mapValueOfType(json, r'token')), type: SharedLinkType.fromJson(json[r'type'])!, userId: mapValueOfType(json, r'userId')!, ); diff --git a/mobile/openapi/lib/model/smart_search_dto.dart b/mobile/openapi/lib/model/smart_search_dto.dart index a915d97b31..03f5871df4 100644 --- a/mobile/openapi/lib/model/smart_search_dto.dart +++ b/mobile/openapi/lib/model/smart_search_dto.dart @@ -13,8 +13,8 @@ part of openapi.api; class SmartSearchDto { /// Returns a new [SmartSearchDto] instance. SmartSearchDto({ - this.city, - this.country, + this.city = const None(), + this.country = const None(), this.createdAfter, this.createdBefore, this.deviceId, @@ -24,16 +24,16 @@ class SmartSearchDto { this.isNotInAlbum, this.isOffline, this.language, - this.lensModel, - this.libraryId, + this.lensModel = const None(), + this.libraryId = const None(), this.make, - this.model, + this.model = const None(), this.page, this.personIds = const [], required this.query, this.rating, this.size, - this.state, + this.state = const None(), this.tagIds = const [], this.takenAfter, this.takenBefore, @@ -47,9 +47,9 @@ class SmartSearchDto { this.withExif, }); - String? city; + Option city; - String? country; + Option country; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -123,9 +123,9 @@ class SmartSearchDto { /// String? language; - String? lensModel; + Option lensModel; - String? libraryId; + Option libraryId; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -135,7 +135,7 @@ class SmartSearchDto { /// String? make; - String? model; + Option model; /// Minimum value: 1 /// @@ -170,7 +170,7 @@ class SmartSearchDto { /// num? size; - String? state; + Option state; List tagIds; @@ -292,8 +292,8 @@ class SmartSearchDto { @override int get hashCode => // ignore: unnecessary_parenthesis - (city == null ? 0 : city!.hashCode) + - (country == null ? 0 : country!.hashCode) + + (city.hashCode) + + (country.hashCode) + (createdAfter == null ? 0 : createdAfter!.hashCode) + (createdBefore == null ? 0 : createdBefore!.hashCode) + (deviceId == null ? 0 : deviceId!.hashCode) + @@ -303,16 +303,16 @@ class SmartSearchDto { (isNotInAlbum == null ? 0 : isNotInAlbum!.hashCode) + (isOffline == null ? 0 : isOffline!.hashCode) + (language == null ? 0 : language!.hashCode) + - (lensModel == null ? 0 : lensModel!.hashCode) + - (libraryId == null ? 0 : libraryId!.hashCode) + + (lensModel.hashCode) + + (libraryId.hashCode) + (make == null ? 0 : make!.hashCode) + - (model == null ? 0 : model!.hashCode) + + (model.hashCode) + (page == null ? 0 : page!.hashCode) + (personIds.hashCode) + (query.hashCode) + (rating == null ? 0 : rating!.hashCode) + (size == null ? 0 : size!.hashCode) + - (state == null ? 0 : state!.hashCode) + + (state.hashCode) + (tagIds.hashCode) + (takenAfter == null ? 0 : takenAfter!.hashCode) + (takenBefore == null ? 0 : takenBefore!.hashCode) + @@ -330,15 +330,19 @@ class SmartSearchDto { Map toJson() { final json = {}; - if (this.city != null) { + if (this.city.unwrapOrNull() != null) { json[r'city'] = this.city; } else { - // json[r'city'] = null; + if(this.city.isSome) { + json[r'city'] = null; + } } - if (this.country != null) { + if (this.country.unwrapOrNull() != null) { json[r'country'] = this.country; } else { - // json[r'country'] = null; + if(this.country.isSome) { + json[r'country'] = null; + } } if (this.createdAfter != null) { json[r'createdAfter'] = this.createdAfter!.toUtc().toIso8601String(); @@ -385,25 +389,31 @@ class SmartSearchDto { } else { // json[r'language'] = null; } - if (this.lensModel != null) { + if (this.lensModel.unwrapOrNull() != null) { json[r'lensModel'] = this.lensModel; } else { - // json[r'lensModel'] = null; + if(this.lensModel.isSome) { + json[r'lensModel'] = null; + } } - if (this.libraryId != null) { + if (this.libraryId.unwrapOrNull() != null) { json[r'libraryId'] = this.libraryId; } else { - // json[r'libraryId'] = null; + if(this.libraryId.isSome) { + json[r'libraryId'] = null; + } } if (this.make != null) { json[r'make'] = this.make; } else { // json[r'make'] = null; } - if (this.model != null) { + if (this.model.unwrapOrNull() != null) { json[r'model'] = this.model; } else { - // json[r'model'] = null; + if(this.model.isSome) { + json[r'model'] = null; + } } if (this.page != null) { json[r'page'] = this.page; @@ -422,10 +432,12 @@ class SmartSearchDto { } else { // json[r'size'] = null; } - if (this.state != null) { + if (this.state.unwrapOrNull() != null) { json[r'state'] = this.state; } else { - // json[r'state'] = null; + if(this.state.isSome) { + json[r'state'] = null; + } } json[r'tagIds'] = this.tagIds; if (this.takenAfter != null) { @@ -490,10 +502,10 @@ class SmartSearchDto { final json = value.cast(); return SmartSearchDto( - city: mapValueOfType(json, r'city'), - country: mapValueOfType(json, r'country'), - createdAfter: mapDateTime(json, r'createdAfter', r''), - createdBefore: mapDateTime(json, r'createdBefore', r''), + city: Option.from(mapValueOfType(json, r'city')), + country: Option.from(mapValueOfType(json, r'country')), + createdAfter: mapDateTime(json, r'createdAfter', r''), + createdBefore: mapDateTime(json, r'createdBefore', r''), deviceId: mapValueOfType(json, r'deviceId'), isEncoded: mapValueOfType(json, r'isEncoded'), isFavorite: mapValueOfType(json, r'isFavorite'), @@ -501,10 +513,10 @@ class SmartSearchDto { isNotInAlbum: mapValueOfType(json, r'isNotInAlbum'), isOffline: mapValueOfType(json, r'isOffline'), language: mapValueOfType(json, r'language'), - lensModel: mapValueOfType(json, r'lensModel'), - libraryId: mapValueOfType(json, r'libraryId'), + lensModel: Option.from(mapValueOfType(json, r'lensModel')), + libraryId: Option.from(mapValueOfType(json, r'libraryId')), make: mapValueOfType(json, r'make'), - model: mapValueOfType(json, r'model'), + model: Option.from(mapValueOfType(json, r'model')), page: num.parse('${json[r'page']}'), personIds: json[r'personIds'] is Iterable ? (json[r'personIds'] as Iterable).cast().toList(growable: false) @@ -512,17 +524,17 @@ class SmartSearchDto { query: mapValueOfType(json, r'query')!, rating: num.parse('${json[r'rating']}'), size: num.parse('${json[r'size']}'), - state: mapValueOfType(json, r'state'), + state: Option.from(mapValueOfType(json, r'state')), tagIds: json[r'tagIds'] is Iterable ? (json[r'tagIds'] as Iterable).cast().toList(growable: false) : const [], - takenAfter: mapDateTime(json, r'takenAfter', r''), - takenBefore: mapDateTime(json, r'takenBefore', r''), - trashedAfter: mapDateTime(json, r'trashedAfter', r''), - trashedBefore: mapDateTime(json, r'trashedBefore', r''), + takenAfter: mapDateTime(json, r'takenAfter', r''), + takenBefore: mapDateTime(json, r'takenBefore', r''), + trashedAfter: mapDateTime(json, r'trashedAfter', r''), + trashedBefore: mapDateTime(json, r'trashedBefore', r''), type: AssetTypeEnum.fromJson(json[r'type']), - updatedAfter: mapDateTime(json, r'updatedAfter', r''), - updatedBefore: mapDateTime(json, r'updatedBefore', r''), + updatedAfter: mapDateTime(json, r'updatedAfter', r''), + updatedBefore: mapDateTime(json, r'updatedBefore', r''), visibility: AssetVisibility.fromJson(json[r'visibility']), withDeleted: mapValueOfType(json, r'withDeleted'), withExif: mapValueOfType(json, r'withExif'), diff --git a/mobile/openapi/lib/model/sync_asset_exif_v1.dart b/mobile/openapi/lib/model/sync_asset_exif_v1.dart index b0fef28b76..4edb89a3f4 100644 --- a/mobile/openapi/lib/model/sync_asset_exif_v1.dart +++ b/mobile/openapi/lib/model/sync_asset_exif_v1.dart @@ -14,81 +14,81 @@ class SyncAssetExifV1 { /// Returns a new [SyncAssetExifV1] instance. SyncAssetExifV1({ required this.assetId, - required this.city, - required this.country, - required this.dateTimeOriginal, - required this.description, - required this.exifImageHeight, - required this.exifImageWidth, - required this.exposureTime, - required this.fNumber, - required this.fileSizeInByte, - required this.focalLength, - required this.fps, - required this.iso, - required this.latitude, - required this.lensModel, - required this.longitude, - required this.make, - required this.model, - required this.modifyDate, - required this.orientation, - required this.profileDescription, - required this.projectionType, - required this.rating, - required this.state, - required this.timeZone, + this.city = const None(), + this.country = const None(), + this.dateTimeOriginal = const None(), + this.description = const None(), + this.exifImageHeight = const None(), + this.exifImageWidth = const None(), + this.exposureTime = const None(), + this.fNumber = const None(), + this.fileSizeInByte = const None(), + this.focalLength = const None(), + this.fps = const None(), + this.iso = const None(), + this.latitude = const None(), + this.lensModel = const None(), + this.longitude = const None(), + this.make = const None(), + this.model = const None(), + this.modifyDate = const None(), + this.orientation = const None(), + this.profileDescription = const None(), + this.projectionType = const None(), + this.rating = const None(), + this.state = const None(), + this.timeZone = const None(), }); String assetId; - String? city; + Option city; - String? country; + Option country; - DateTime? dateTimeOriginal; + Option dateTimeOriginal; - String? description; + Option description; - int? exifImageHeight; + Option exifImageHeight; - int? exifImageWidth; + Option exifImageWidth; - String? exposureTime; + Option exposureTime; - int? fNumber; + Option fNumber; - int? fileSizeInByte; + Option fileSizeInByte; - int? focalLength; + Option focalLength; - int? fps; + Option fps; - int? iso; + Option iso; - int? latitude; + Option latitude; - String? lensModel; + Option lensModel; - int? longitude; + Option longitude; - String? make; + Option make; - String? model; + Option model; - DateTime? modifyDate; + Option modifyDate; - String? orientation; + Option orientation; - String? profileDescription; + Option profileDescription; - String? projectionType; + Option projectionType; - int? rating; + Option rating; - String? state; + Option state; - String? timeZone; + Option timeZone; @override bool operator ==(Object other) => identical(this, other) || other is SyncAssetExifV1 && @@ -122,30 +122,30 @@ class SyncAssetExifV1 { int get hashCode => // ignore: unnecessary_parenthesis (assetId.hashCode) + - (city == null ? 0 : city!.hashCode) + - (country == null ? 0 : country!.hashCode) + - (dateTimeOriginal == null ? 0 : dateTimeOriginal!.hashCode) + - (description == null ? 0 : description!.hashCode) + - (exifImageHeight == null ? 0 : exifImageHeight!.hashCode) + - (exifImageWidth == null ? 0 : exifImageWidth!.hashCode) + - (exposureTime == null ? 0 : exposureTime!.hashCode) + - (fNumber == null ? 0 : fNumber!.hashCode) + - (fileSizeInByte == null ? 0 : fileSizeInByte!.hashCode) + - (focalLength == null ? 0 : focalLength!.hashCode) + - (fps == null ? 0 : fps!.hashCode) + - (iso == null ? 0 : iso!.hashCode) + - (latitude == null ? 0 : latitude!.hashCode) + - (lensModel == null ? 0 : lensModel!.hashCode) + - (longitude == null ? 0 : longitude!.hashCode) + - (make == null ? 0 : make!.hashCode) + - (model == null ? 0 : model!.hashCode) + - (modifyDate == null ? 0 : modifyDate!.hashCode) + - (orientation == null ? 0 : orientation!.hashCode) + - (profileDescription == null ? 0 : profileDescription!.hashCode) + - (projectionType == null ? 0 : projectionType!.hashCode) + - (rating == null ? 0 : rating!.hashCode) + - (state == null ? 0 : state!.hashCode) + - (timeZone == null ? 0 : timeZone!.hashCode); + (city.hashCode) + + (country.hashCode) + + (dateTimeOriginal.hashCode) + + (description.hashCode) + + (exifImageHeight.hashCode) + + (exifImageWidth.hashCode) + + (exposureTime.hashCode) + + (fNumber.hashCode) + + (fileSizeInByte.hashCode) + + (focalLength.hashCode) + + (fps.hashCode) + + (iso.hashCode) + + (latitude.hashCode) + + (lensModel.hashCode) + + (longitude.hashCode) + + (make.hashCode) + + (model.hashCode) + + (modifyDate.hashCode) + + (orientation.hashCode) + + (profileDescription.hashCode) + + (projectionType.hashCode) + + (rating.hashCode) + + (state.hashCode) + + (timeZone.hashCode); @override String toString() => 'SyncAssetExifV1[assetId=$assetId, city=$city, country=$country, dateTimeOriginal=$dateTimeOriginal, description=$description, exifImageHeight=$exifImageHeight, exifImageWidth=$exifImageWidth, exposureTime=$exposureTime, fNumber=$fNumber, fileSizeInByte=$fileSizeInByte, focalLength=$focalLength, fps=$fps, iso=$iso, latitude=$latitude, lensModel=$lensModel, longitude=$longitude, make=$make, model=$model, modifyDate=$modifyDate, orientation=$orientation, profileDescription=$profileDescription, projectionType=$projectionType, rating=$rating, state=$state, timeZone=$timeZone]'; @@ -153,125 +153,173 @@ class SyncAssetExifV1 { Map toJson() { final json = {}; json[r'assetId'] = this.assetId; - if (this.city != null) { + if (this.city.unwrapOrNull() != null) { json[r'city'] = this.city; } else { - // json[r'city'] = null; + if(this.city.isSome) { + json[r'city'] = null; + } } - if (this.country != null) { + if (this.country.unwrapOrNull() != null) { json[r'country'] = this.country; } else { - // json[r'country'] = null; + if(this.country.isSome) { + json[r'country'] = null; + } } - if (this.dateTimeOriginal != null) { - json[r'dateTimeOriginal'] = this.dateTimeOriginal!.toUtc().toIso8601String(); + if (this.dateTimeOriginal.unwrapOrNull() != null) { + json[r'dateTimeOriginal'] = this.dateTimeOriginal.unwrap().toUtc().toIso8601String(); } else { - // json[r'dateTimeOriginal'] = null; + if(this.dateTimeOriginal.isSome) { + json[r'dateTimeOriginal'] = null; + } } - if (this.description != null) { + if (this.description.unwrapOrNull() != null) { json[r'description'] = this.description; } else { - // json[r'description'] = null; + if(this.description.isSome) { + json[r'description'] = null; + } } - if (this.exifImageHeight != null) { + if (this.exifImageHeight.unwrapOrNull() != null) { json[r'exifImageHeight'] = this.exifImageHeight; } else { - // json[r'exifImageHeight'] = null; + if(this.exifImageHeight.isSome) { + json[r'exifImageHeight'] = null; + } } - if (this.exifImageWidth != null) { + if (this.exifImageWidth.unwrapOrNull() != null) { json[r'exifImageWidth'] = this.exifImageWidth; } else { - // json[r'exifImageWidth'] = null; + if(this.exifImageWidth.isSome) { + json[r'exifImageWidth'] = null; + } } - if (this.exposureTime != null) { + if (this.exposureTime.unwrapOrNull() != null) { json[r'exposureTime'] = this.exposureTime; } else { - // json[r'exposureTime'] = null; + if(this.exposureTime.isSome) { + json[r'exposureTime'] = null; + } } - if (this.fNumber != null) { + if (this.fNumber.unwrapOrNull() != null) { json[r'fNumber'] = this.fNumber; } else { - // json[r'fNumber'] = null; + if(this.fNumber.isSome) { + json[r'fNumber'] = null; + } } - if (this.fileSizeInByte != null) { + if (this.fileSizeInByte.unwrapOrNull() != null) { json[r'fileSizeInByte'] = this.fileSizeInByte; } else { - // json[r'fileSizeInByte'] = null; + if(this.fileSizeInByte.isSome) { + json[r'fileSizeInByte'] = null; + } } - if (this.focalLength != null) { + if (this.focalLength.unwrapOrNull() != null) { json[r'focalLength'] = this.focalLength; } else { - // json[r'focalLength'] = null; + if(this.focalLength.isSome) { + json[r'focalLength'] = null; + } } - if (this.fps != null) { + if (this.fps.unwrapOrNull() != null) { json[r'fps'] = this.fps; } else { - // json[r'fps'] = null; + if(this.fps.isSome) { + json[r'fps'] = null; + } } - if (this.iso != null) { + if (this.iso.unwrapOrNull() != null) { json[r'iso'] = this.iso; } else { - // json[r'iso'] = null; + if(this.iso.isSome) { + json[r'iso'] = null; + } } - if (this.latitude != null) { + if (this.latitude.unwrapOrNull() != null) { json[r'latitude'] = this.latitude; } else { - // json[r'latitude'] = null; + if(this.latitude.isSome) { + json[r'latitude'] = null; + } } - if (this.lensModel != null) { + if (this.lensModel.unwrapOrNull() != null) { json[r'lensModel'] = this.lensModel; } else { - // json[r'lensModel'] = null; + if(this.lensModel.isSome) { + json[r'lensModel'] = null; + } } - if (this.longitude != null) { + if (this.longitude.unwrapOrNull() != null) { json[r'longitude'] = this.longitude; } else { - // json[r'longitude'] = null; + if(this.longitude.isSome) { + json[r'longitude'] = null; + } } - if (this.make != null) { + if (this.make.unwrapOrNull() != null) { json[r'make'] = this.make; } else { - // json[r'make'] = null; + if(this.make.isSome) { + json[r'make'] = null; + } } - if (this.model != null) { + if (this.model.unwrapOrNull() != null) { json[r'model'] = this.model; } else { - // json[r'model'] = null; + if(this.model.isSome) { + json[r'model'] = null; + } } - if (this.modifyDate != null) { - json[r'modifyDate'] = this.modifyDate!.toUtc().toIso8601String(); + if (this.modifyDate.unwrapOrNull() != null) { + json[r'modifyDate'] = this.modifyDate.unwrap().toUtc().toIso8601String(); } else { - // json[r'modifyDate'] = null; + if(this.modifyDate.isSome) { + json[r'modifyDate'] = null; + } } - if (this.orientation != null) { + if (this.orientation.unwrapOrNull() != null) { json[r'orientation'] = this.orientation; } else { - // json[r'orientation'] = null; + if(this.orientation.isSome) { + json[r'orientation'] = null; + } } - if (this.profileDescription != null) { + if (this.profileDescription.unwrapOrNull() != null) { json[r'profileDescription'] = this.profileDescription; } else { - // json[r'profileDescription'] = null; + if(this.profileDescription.isSome) { + json[r'profileDescription'] = null; + } } - if (this.projectionType != null) { + if (this.projectionType.unwrapOrNull() != null) { json[r'projectionType'] = this.projectionType; } else { - // json[r'projectionType'] = null; + if(this.projectionType.isSome) { + json[r'projectionType'] = null; + } } - if (this.rating != null) { + if (this.rating.unwrapOrNull() != null) { json[r'rating'] = this.rating; } else { - // json[r'rating'] = null; + if(this.rating.isSome) { + json[r'rating'] = null; + } } - if (this.state != null) { + if (this.state.unwrapOrNull() != null) { json[r'state'] = this.state; } else { - // json[r'state'] = null; + if(this.state.isSome) { + json[r'state'] = null; + } } - if (this.timeZone != null) { + if (this.timeZone.unwrapOrNull() != null) { json[r'timeZone'] = this.timeZone; } else { - // json[r'timeZone'] = null; + if(this.timeZone.isSome) { + json[r'timeZone'] = null; + } } return json; } @@ -286,30 +334,30 @@ class SyncAssetExifV1 { return SyncAssetExifV1( assetId: mapValueOfType(json, r'assetId')!, - city: mapValueOfType(json, r'city'), - country: mapValueOfType(json, r'country'), - dateTimeOriginal: mapDateTime(json, r'dateTimeOriginal', r''), - description: mapValueOfType(json, r'description'), - exifImageHeight: mapValueOfType(json, r'exifImageHeight'), - exifImageWidth: mapValueOfType(json, r'exifImageWidth'), - exposureTime: mapValueOfType(json, r'exposureTime'), - fNumber: mapValueOfType(json, r'fNumber'), - fileSizeInByte: mapValueOfType(json, r'fileSizeInByte'), - focalLength: mapValueOfType(json, r'focalLength'), - fps: mapValueOfType(json, r'fps'), - iso: mapValueOfType(json, r'iso'), - latitude: mapValueOfType(json, r'latitude'), - lensModel: mapValueOfType(json, r'lensModel'), - longitude: mapValueOfType(json, r'longitude'), - make: mapValueOfType(json, r'make'), - model: mapValueOfType(json, r'model'), - modifyDate: mapDateTime(json, r'modifyDate', r''), - orientation: mapValueOfType(json, r'orientation'), - profileDescription: mapValueOfType(json, r'profileDescription'), - projectionType: mapValueOfType(json, r'projectionType'), - rating: mapValueOfType(json, r'rating'), - state: mapValueOfType(json, r'state'), - timeZone: mapValueOfType(json, r'timeZone'), + city: Option.from(mapValueOfType(json, r'city')), + country: Option.from(mapValueOfType(json, r'country')), + dateTimeOriginal: Option.from(mapDateTime(json, r'dateTimeOriginal', r'')), + description: Option.from(mapValueOfType(json, r'description')), + exifImageHeight: Option.from(mapValueOfType(json, r'exifImageHeight')), + exifImageWidth: Option.from(mapValueOfType(json, r'exifImageWidth')), + exposureTime: Option.from(mapValueOfType(json, r'exposureTime')), + fNumber: Option.from(mapValueOfType(json, r'fNumber')), + fileSizeInByte: Option.from(mapValueOfType(json, r'fileSizeInByte')), + focalLength: Option.from(mapValueOfType(json, r'focalLength')), + fps: Option.from(mapValueOfType(json, r'fps')), + iso: Option.from(mapValueOfType(json, r'iso')), + latitude: Option.from(mapValueOfType(json, r'latitude')), + lensModel: Option.from(mapValueOfType(json, r'lensModel')), + longitude: Option.from(mapValueOfType(json, r'longitude')), + make: Option.from(mapValueOfType(json, r'make')), + model: Option.from(mapValueOfType(json, r'model')), + modifyDate: Option.from(mapDateTime(json, r'modifyDate', r'')), + orientation: Option.from(mapValueOfType(json, r'orientation')), + profileDescription: Option.from(mapValueOfType(json, r'profileDescription')), + projectionType: Option.from(mapValueOfType(json, r'projectionType')), + rating: Option.from(mapValueOfType(json, r'rating')), + state: Option.from(mapValueOfType(json, r'state')), + timeZone: Option.from(mapValueOfType(json, r'timeZone')), ); } return null; diff --git a/mobile/openapi/lib/model/sync_asset_v1.dart b/mobile/openapi/lib/model/sync_asset_v1.dart index f5d59b6ae9..71dd5d7bed 100644 --- a/mobile/openapi/lib/model/sync_asset_v1.dart +++ b/mobile/openapi/lib/model/sync_asset_v1.dart @@ -14,35 +14,35 @@ class SyncAssetV1 { /// Returns a new [SyncAssetV1] instance. SyncAssetV1({ required this.checksum, - required this.deletedAt, - required this.fileCreatedAt, - required this.fileModifiedAt, + this.deletedAt = const None(), + this.fileCreatedAt = const None(), + this.fileModifiedAt = const None(), required this.id, required this.isFavorite, - required this.localDateTime, + this.localDateTime = const None(), required this.ownerId, - required this.thumbhash, + this.thumbhash = const None(), required this.type, required this.visibility, }); String checksum; - DateTime? deletedAt; + Option deletedAt; - DateTime? fileCreatedAt; + Option fileCreatedAt; - DateTime? fileModifiedAt; + Option fileModifiedAt; String id; bool isFavorite; - DateTime? localDateTime; + Option localDateTime; String ownerId; - String? thumbhash; + Option thumbhash; SyncAssetV1TypeEnum type; @@ -66,14 +66,14 @@ class SyncAssetV1 { int get hashCode => // ignore: unnecessary_parenthesis (checksum.hashCode) + - (deletedAt == null ? 0 : deletedAt!.hashCode) + - (fileCreatedAt == null ? 0 : fileCreatedAt!.hashCode) + - (fileModifiedAt == null ? 0 : fileModifiedAt!.hashCode) + + (deletedAt.hashCode) + + (fileCreatedAt.hashCode) + + (fileModifiedAt.hashCode) + (id.hashCode) + (isFavorite.hashCode) + - (localDateTime == null ? 0 : localDateTime!.hashCode) + + (localDateTime.hashCode) + (ownerId.hashCode) + - (thumbhash == null ? 0 : thumbhash!.hashCode) + + (thumbhash.hashCode) + (type.hashCode) + (visibility.hashCode); @@ -83,33 +83,43 @@ class SyncAssetV1 { Map toJson() { final json = {}; json[r'checksum'] = this.checksum; - if (this.deletedAt != null) { - json[r'deletedAt'] = this.deletedAt!.toUtc().toIso8601String(); + if (this.deletedAt.unwrapOrNull() != null) { + json[r'deletedAt'] = this.deletedAt.unwrap().toUtc().toIso8601String(); } else { - // json[r'deletedAt'] = null; + if(this.deletedAt.isSome) { + json[r'deletedAt'] = null; + } } - if (this.fileCreatedAt != null) { - json[r'fileCreatedAt'] = this.fileCreatedAt!.toUtc().toIso8601String(); + if (this.fileCreatedAt.unwrapOrNull() != null) { + json[r'fileCreatedAt'] = this.fileCreatedAt.unwrap().toUtc().toIso8601String(); } else { - // json[r'fileCreatedAt'] = null; + if(this.fileCreatedAt.isSome) { + json[r'fileCreatedAt'] = null; + } } - if (this.fileModifiedAt != null) { - json[r'fileModifiedAt'] = this.fileModifiedAt!.toUtc().toIso8601String(); + if (this.fileModifiedAt.unwrapOrNull() != null) { + json[r'fileModifiedAt'] = this.fileModifiedAt.unwrap().toUtc().toIso8601String(); } else { - // json[r'fileModifiedAt'] = null; + if(this.fileModifiedAt.isSome) { + json[r'fileModifiedAt'] = null; + } } json[r'id'] = this.id; json[r'isFavorite'] = this.isFavorite; - if (this.localDateTime != null) { - json[r'localDateTime'] = this.localDateTime!.toUtc().toIso8601String(); + if (this.localDateTime.unwrapOrNull() != null) { + json[r'localDateTime'] = this.localDateTime.unwrap().toUtc().toIso8601String(); } else { - // json[r'localDateTime'] = null; + if(this.localDateTime.isSome) { + json[r'localDateTime'] = null; + } } json[r'ownerId'] = this.ownerId; - if (this.thumbhash != null) { + if (this.thumbhash.unwrapOrNull() != null) { json[r'thumbhash'] = this.thumbhash; } else { - // json[r'thumbhash'] = null; + if(this.thumbhash.isSome) { + json[r'thumbhash'] = null; + } } json[r'type'] = this.type; json[r'visibility'] = this.visibility; @@ -126,14 +136,14 @@ class SyncAssetV1 { return SyncAssetV1( checksum: mapValueOfType(json, r'checksum')!, - deletedAt: mapDateTime(json, r'deletedAt', r''), - fileCreatedAt: mapDateTime(json, r'fileCreatedAt', r''), - fileModifiedAt: mapDateTime(json, r'fileModifiedAt', r''), + deletedAt: Option.from(mapDateTime(json, r'deletedAt', r'')), + fileCreatedAt: Option.from(mapDateTime(json, r'fileCreatedAt', r'')), + fileModifiedAt: Option.from(mapDateTime(json, r'fileModifiedAt', r'')), id: mapValueOfType(json, r'id')!, isFavorite: mapValueOfType(json, r'isFavorite')!, - localDateTime: mapDateTime(json, r'localDateTime', r''), + localDateTime: Option.from(mapDateTime(json, r'localDateTime', r'')), ownerId: mapValueOfType(json, r'ownerId')!, - thumbhash: mapValueOfType(json, r'thumbhash'), + thumbhash: Option.from(mapValueOfType(json, r'thumbhash')), type: SyncAssetV1TypeEnum.fromJson(json[r'type'])!, visibility: SyncAssetV1VisibilityEnum.fromJson(json[r'visibility'])!, ); diff --git a/mobile/openapi/lib/model/sync_user_v1.dart b/mobile/openapi/lib/model/sync_user_v1.dart index b9b41bb723..4623246590 100644 --- a/mobile/openapi/lib/model/sync_user_v1.dart +++ b/mobile/openapi/lib/model/sync_user_v1.dart @@ -13,13 +13,13 @@ part of openapi.api; class SyncUserV1 { /// Returns a new [SyncUserV1] instance. SyncUserV1({ - required this.deletedAt, + this.deletedAt = const None(), required this.email, required this.id, required this.name, }); - DateTime? deletedAt; + Option deletedAt; String email; @@ -37,7 +37,7 @@ class SyncUserV1 { @override int get hashCode => // ignore: unnecessary_parenthesis - (deletedAt == null ? 0 : deletedAt!.hashCode) + + (deletedAt.hashCode) + (email.hashCode) + (id.hashCode) + (name.hashCode); @@ -47,10 +47,12 @@ class SyncUserV1 { Map toJson() { final json = {}; - if (this.deletedAt != null) { - json[r'deletedAt'] = this.deletedAt!.toUtc().toIso8601String(); + if (this.deletedAt.unwrapOrNull() != null) { + json[r'deletedAt'] = this.deletedAt.unwrap().toUtc().toIso8601String(); } else { - // json[r'deletedAt'] = null; + if(this.deletedAt.isSome) { + json[r'deletedAt'] = null; + } } json[r'email'] = this.email; json[r'id'] = this.id; @@ -67,7 +69,7 @@ class SyncUserV1 { final json = value.cast(); return SyncUserV1( - deletedAt: mapDateTime(json, r'deletedAt', r''), + deletedAt: Option.from(mapDateTime(json, r'deletedAt', r'')), email: mapValueOfType(json, r'email')!, id: mapValueOfType(json, r'id')!, name: mapValueOfType(json, r'name')!, diff --git a/mobile/openapi/lib/model/tag_create_dto.dart b/mobile/openapi/lib/model/tag_create_dto.dart index 9a5171074d..b99b2f01ad 100644 --- a/mobile/openapi/lib/model/tag_create_dto.dart +++ b/mobile/openapi/lib/model/tag_create_dto.dart @@ -15,7 +15,7 @@ class TagCreateDto { TagCreateDto({ this.color, required this.name, - this.parentId, + this.parentId = const None(), }); /// @@ -28,7 +28,7 @@ class TagCreateDto { String name; - String? parentId; + Option parentId; @override bool operator ==(Object other) => identical(this, other) || other is TagCreateDto && @@ -41,7 +41,7 @@ class TagCreateDto { // ignore: unnecessary_parenthesis (color == null ? 0 : color!.hashCode) + (name.hashCode) + - (parentId == null ? 0 : parentId!.hashCode); + (parentId.hashCode); @override String toString() => 'TagCreateDto[color=$color, name=$name, parentId=$parentId]'; @@ -54,10 +54,12 @@ class TagCreateDto { // json[r'color'] = null; } json[r'name'] = this.name; - if (this.parentId != null) { + if (this.parentId.unwrapOrNull() != null) { json[r'parentId'] = this.parentId; } else { - // json[r'parentId'] = null; + if(this.parentId.isSome) { + json[r'parentId'] = null; + } } return json; } @@ -73,7 +75,7 @@ class TagCreateDto { return TagCreateDto( color: mapValueOfType(json, r'color'), name: mapValueOfType(json, r'name')!, - parentId: mapValueOfType(json, r'parentId'), + parentId: Option.from(mapValueOfType(json, r'parentId')), ); } return null; diff --git a/mobile/openapi/lib/model/tag_response_dto.dart b/mobile/openapi/lib/model/tag_response_dto.dart index cd684b163a..b55a9103fc 100644 --- a/mobile/openapi/lib/model/tag_response_dto.dart +++ b/mobile/openapi/lib/model/tag_response_dto.dart @@ -102,11 +102,11 @@ class TagResponseDto { return TagResponseDto( color: mapValueOfType(json, r'color'), - createdAt: mapDateTime(json, r'createdAt', r'')!, + createdAt: mapDateTime(json, r'createdAt', r'')!, id: mapValueOfType(json, r'id')!, name: mapValueOfType(json, r'name')!, parentId: mapValueOfType(json, r'parentId'), - updatedAt: mapDateTime(json, r'updatedAt', r'')!, + updatedAt: mapDateTime(json, r'updatedAt', r'')!, value: mapValueOfType(json, r'value')!, ); } diff --git a/mobile/openapi/lib/model/tag_update_dto.dart b/mobile/openapi/lib/model/tag_update_dto.dart index ab1adb127b..93df8ab703 100644 --- a/mobile/openapi/lib/model/tag_update_dto.dart +++ b/mobile/openapi/lib/model/tag_update_dto.dart @@ -13,10 +13,10 @@ part of openapi.api; class TagUpdateDto { /// Returns a new [TagUpdateDto] instance. TagUpdateDto({ - this.color, + this.color = const None(), }); - String? color; + Option color; @override bool operator ==(Object other) => identical(this, other) || other is TagUpdateDto && @@ -25,17 +25,19 @@ class TagUpdateDto { @override int get hashCode => // ignore: unnecessary_parenthesis - (color == null ? 0 : color!.hashCode); + (color.hashCode); @override String toString() => 'TagUpdateDto[color=$color]'; Map toJson() { final json = {}; - if (this.color != null) { + if (this.color.unwrapOrNull() != null) { json[r'color'] = this.color; } else { - // json[r'color'] = null; + if(this.color.isSome) { + json[r'color'] = null; + } } return json; } @@ -49,7 +51,7 @@ class TagUpdateDto { final json = value.cast(); return TagUpdateDto( - color: mapValueOfType(json, r'color'), + color: Option.from(mapValueOfType(json, r'color')), ); } return null; diff --git a/mobile/openapi/lib/model/update_asset_dto.dart b/mobile/openapi/lib/model/update_asset_dto.dart index 7b364f1387..e3a1237205 100644 --- a/mobile/openapi/lib/model/update_asset_dto.dart +++ b/mobile/openapi/lib/model/update_asset_dto.dart @@ -17,7 +17,7 @@ class UpdateAssetDto { this.description, this.isFavorite, this.latitude, - this.livePhotoVideoId, + this.livePhotoVideoId = const None(), this.longitude, this.rating, this.visibility, @@ -55,7 +55,7 @@ class UpdateAssetDto { /// num? latitude; - String? livePhotoVideoId; + Option livePhotoVideoId; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -101,7 +101,7 @@ class UpdateAssetDto { (description == null ? 0 : description!.hashCode) + (isFavorite == null ? 0 : isFavorite!.hashCode) + (latitude == null ? 0 : latitude!.hashCode) + - (livePhotoVideoId == null ? 0 : livePhotoVideoId!.hashCode) + + (livePhotoVideoId.hashCode) + (longitude == null ? 0 : longitude!.hashCode) + (rating == null ? 0 : rating!.hashCode) + (visibility == null ? 0 : visibility!.hashCode); @@ -131,10 +131,12 @@ class UpdateAssetDto { } else { // json[r'latitude'] = null; } - if (this.livePhotoVideoId != null) { + if (this.livePhotoVideoId.unwrapOrNull() != null) { json[r'livePhotoVideoId'] = this.livePhotoVideoId; } else { - // json[r'livePhotoVideoId'] = null; + if(this.livePhotoVideoId.isSome) { + json[r'livePhotoVideoId'] = null; + } } if (this.longitude != null) { json[r'longitude'] = this.longitude; @@ -167,7 +169,7 @@ class UpdateAssetDto { description: mapValueOfType(json, r'description'), isFavorite: mapValueOfType(json, r'isFavorite'), latitude: num.parse('${json[r'latitude']}'), - livePhotoVideoId: mapValueOfType(json, r'livePhotoVideoId'), + livePhotoVideoId: Option.from(mapValueOfType(json, r'livePhotoVideoId')), longitude: num.parse('${json[r'longitude']}'), rating: num.parse('${json[r'rating']}'), visibility: AssetVisibility.fromJson(json[r'visibility']), diff --git a/mobile/openapi/lib/model/usage_by_user_dto.dart b/mobile/openapi/lib/model/usage_by_user_dto.dart index 80235915fe..371081c440 100644 --- a/mobile/openapi/lib/model/usage_by_user_dto.dart +++ b/mobile/openapi/lib/model/usage_by_user_dto.dart @@ -14,7 +14,7 @@ class UsageByUserDto { /// Returns a new [UsageByUserDto] instance. UsageByUserDto({ required this.photos, - required this.quotaSizeInBytes, + this.quotaSizeInBytes = const None(), required this.usage, required this.usagePhotos, required this.usageVideos, @@ -25,7 +25,7 @@ class UsageByUserDto { int photos; - int? quotaSizeInBytes; + Option quotaSizeInBytes; int usage; @@ -54,7 +54,7 @@ class UsageByUserDto { int get hashCode => // ignore: unnecessary_parenthesis (photos.hashCode) + - (quotaSizeInBytes == null ? 0 : quotaSizeInBytes!.hashCode) + + (quotaSizeInBytes.hashCode) + (usage.hashCode) + (usagePhotos.hashCode) + (usageVideos.hashCode) + @@ -68,10 +68,12 @@ class UsageByUserDto { Map toJson() { final json = {}; json[r'photos'] = this.photos; - if (this.quotaSizeInBytes != null) { + if (this.quotaSizeInBytes.unwrapOrNull() != null) { json[r'quotaSizeInBytes'] = this.quotaSizeInBytes; } else { - // json[r'quotaSizeInBytes'] = null; + if(this.quotaSizeInBytes.isSome) { + json[r'quotaSizeInBytes'] = null; + } } json[r'usage'] = this.usage; json[r'usagePhotos'] = this.usagePhotos; @@ -92,7 +94,7 @@ class UsageByUserDto { return UsageByUserDto( photos: mapValueOfType(json, r'photos')!, - quotaSizeInBytes: mapValueOfType(json, r'quotaSizeInBytes'), + quotaSizeInBytes: Option.from(mapValueOfType(json, r'quotaSizeInBytes')), usage: mapValueOfType(json, r'usage')!, usagePhotos: mapValueOfType(json, r'usagePhotos')!, usageVideos: mapValueOfType(json, r'usageVideos')!, diff --git a/mobile/openapi/lib/model/user_admin_create_dto.dart b/mobile/openapi/lib/model/user_admin_create_dto.dart index 1477c82ca1..9ade1798c4 100644 --- a/mobile/openapi/lib/model/user_admin_create_dto.dart +++ b/mobile/openapi/lib/model/user_admin_create_dto.dart @@ -13,17 +13,17 @@ part of openapi.api; class UserAdminCreateDto { /// Returns a new [UserAdminCreateDto] instance. UserAdminCreateDto({ - this.avatarColor, + this.avatarColor = const None(), required this.email, required this.name, this.notify, required this.password, - this.quotaSizeInBytes, + this.quotaSizeInBytes = const None(), this.shouldChangePassword, - this.storageLabel, + this.storageLabel = const None(), }); - UserAvatarColor? avatarColor; + Option avatarColor; String email; @@ -40,7 +40,7 @@ class UserAdminCreateDto { String password; /// Minimum value: 0 - int? quotaSizeInBytes; + Option quotaSizeInBytes; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -50,7 +50,7 @@ class UserAdminCreateDto { /// bool? shouldChangePassword; - String? storageLabel; + Option storageLabel; @override bool operator ==(Object other) => identical(this, other) || other is UserAdminCreateDto && @@ -66,24 +66,26 @@ class UserAdminCreateDto { @override int get hashCode => // ignore: unnecessary_parenthesis - (avatarColor == null ? 0 : avatarColor!.hashCode) + + (avatarColor.hashCode) + (email.hashCode) + (name.hashCode) + (notify == null ? 0 : notify!.hashCode) + (password.hashCode) + - (quotaSizeInBytes == null ? 0 : quotaSizeInBytes!.hashCode) + + (quotaSizeInBytes.hashCode) + (shouldChangePassword == null ? 0 : shouldChangePassword!.hashCode) + - (storageLabel == null ? 0 : storageLabel!.hashCode); + (storageLabel.hashCode); @override String toString() => 'UserAdminCreateDto[avatarColor=$avatarColor, email=$email, name=$name, notify=$notify, password=$password, quotaSizeInBytes=$quotaSizeInBytes, shouldChangePassword=$shouldChangePassword, storageLabel=$storageLabel]'; Map toJson() { final json = {}; - if (this.avatarColor != null) { + if (this.avatarColor.unwrapOrNull() != null) { json[r'avatarColor'] = this.avatarColor; } else { - // json[r'avatarColor'] = null; + if(this.avatarColor.isSome) { + json[r'avatarColor'] = null; + } } json[r'email'] = this.email; json[r'name'] = this.name; @@ -93,20 +95,24 @@ class UserAdminCreateDto { // json[r'notify'] = null; } json[r'password'] = this.password; - if (this.quotaSizeInBytes != null) { + if (this.quotaSizeInBytes.unwrapOrNull() != null) { json[r'quotaSizeInBytes'] = this.quotaSizeInBytes; } else { - // json[r'quotaSizeInBytes'] = null; + if(this.quotaSizeInBytes.isSome) { + json[r'quotaSizeInBytes'] = null; + } } if (this.shouldChangePassword != null) { json[r'shouldChangePassword'] = this.shouldChangePassword; } else { // json[r'shouldChangePassword'] = null; } - if (this.storageLabel != null) { + if (this.storageLabel.unwrapOrNull() != null) { json[r'storageLabel'] = this.storageLabel; } else { - // json[r'storageLabel'] = null; + if(this.storageLabel.isSome) { + json[r'storageLabel'] = null; + } } return json; } @@ -120,14 +126,14 @@ class UserAdminCreateDto { final json = value.cast(); return UserAdminCreateDto( - avatarColor: UserAvatarColor.fromJson(json[r'avatarColor']), + avatarColor: Option.from(UserAvatarColor.fromJson(json[r'avatarColor'])), email: mapValueOfType(json, r'email')!, name: mapValueOfType(json, r'name')!, notify: mapValueOfType(json, r'notify'), password: mapValueOfType(json, r'password')!, - quotaSizeInBytes: mapValueOfType(json, r'quotaSizeInBytes'), + quotaSizeInBytes: Option.from(mapValueOfType(json, r'quotaSizeInBytes')), shouldChangePassword: mapValueOfType(json, r'shouldChangePassword'), - storageLabel: mapValueOfType(json, r'storageLabel'), + storageLabel: Option.from(mapValueOfType(json, r'storageLabel')), ); } return null; diff --git a/mobile/openapi/lib/model/user_admin_response_dto.dart b/mobile/openapi/lib/model/user_admin_response_dto.dart index e5ae8e1d4e..d3e9bfc2e1 100644 --- a/mobile/openapi/lib/model/user_admin_response_dto.dart +++ b/mobile/openapi/lib/model/user_admin_response_dto.dart @@ -15,20 +15,20 @@ class UserAdminResponseDto { UserAdminResponseDto({ required this.avatarColor, required this.createdAt, - required this.deletedAt, + this.deletedAt = const None(), required this.email, required this.id, required this.isAdmin, - required this.license, + this.license = const None(), required this.name, required this.oauthId, required this.profileChangedAt, required this.profileImagePath, - required this.quotaSizeInBytes, - required this.quotaUsageInBytes, + this.quotaSizeInBytes = const None(), + this.quotaUsageInBytes = const None(), required this.shouldChangePassword, required this.status, - required this.storageLabel, + this.storageLabel = const None(), required this.updatedAt, }); @@ -36,7 +36,7 @@ class UserAdminResponseDto { DateTime createdAt; - DateTime? deletedAt; + Option deletedAt; String email; @@ -44,7 +44,7 @@ class UserAdminResponseDto { bool isAdmin; - UserLicense? license; + Option license; String name; @@ -54,15 +54,15 @@ class UserAdminResponseDto { String profileImagePath; - int? quotaSizeInBytes; + Option quotaSizeInBytes; - int? quotaUsageInBytes; + Option quotaUsageInBytes; bool shouldChangePassword; UserStatus status; - String? storageLabel; + Option storageLabel; DateTime updatedAt; @@ -91,20 +91,20 @@ class UserAdminResponseDto { // ignore: unnecessary_parenthesis (avatarColor.hashCode) + (createdAt.hashCode) + - (deletedAt == null ? 0 : deletedAt!.hashCode) + + (deletedAt.hashCode) + (email.hashCode) + (id.hashCode) + (isAdmin.hashCode) + - (license == null ? 0 : license!.hashCode) + + (license.hashCode) + (name.hashCode) + (oauthId.hashCode) + (profileChangedAt.hashCode) + (profileImagePath.hashCode) + - (quotaSizeInBytes == null ? 0 : quotaSizeInBytes!.hashCode) + - (quotaUsageInBytes == null ? 0 : quotaUsageInBytes!.hashCode) + + (quotaSizeInBytes.hashCode) + + (quotaUsageInBytes.hashCode) + (shouldChangePassword.hashCode) + (status.hashCode) + - (storageLabel == null ? 0 : storageLabel!.hashCode) + + (storageLabel.hashCode) + (updatedAt.hashCode); @override @@ -114,39 +114,49 @@ class UserAdminResponseDto { final json = {}; json[r'avatarColor'] = this.avatarColor; json[r'createdAt'] = this.createdAt.toUtc().toIso8601String(); - if (this.deletedAt != null) { - json[r'deletedAt'] = this.deletedAt!.toUtc().toIso8601String(); + if (this.deletedAt.unwrapOrNull() != null) { + json[r'deletedAt'] = this.deletedAt.unwrap().toUtc().toIso8601String(); } else { - // json[r'deletedAt'] = null; + if(this.deletedAt.isSome) { + json[r'deletedAt'] = null; + } } json[r'email'] = this.email; json[r'id'] = this.id; json[r'isAdmin'] = this.isAdmin; - if (this.license != null) { + if (this.license.unwrapOrNull() != null) { json[r'license'] = this.license; } else { - // json[r'license'] = null; + if(this.license.isSome) { + json[r'license'] = null; + } } json[r'name'] = this.name; json[r'oauthId'] = this.oauthId; json[r'profileChangedAt'] = this.profileChangedAt.toUtc().toIso8601String(); json[r'profileImagePath'] = this.profileImagePath; - if (this.quotaSizeInBytes != null) { + if (this.quotaSizeInBytes.unwrapOrNull() != null) { json[r'quotaSizeInBytes'] = this.quotaSizeInBytes; } else { - // json[r'quotaSizeInBytes'] = null; + if(this.quotaSizeInBytes.isSome) { + json[r'quotaSizeInBytes'] = null; + } } - if (this.quotaUsageInBytes != null) { + if (this.quotaUsageInBytes.unwrapOrNull() != null) { json[r'quotaUsageInBytes'] = this.quotaUsageInBytes; } else { - // json[r'quotaUsageInBytes'] = null; + if(this.quotaUsageInBytes.isSome) { + json[r'quotaUsageInBytes'] = null; + } } json[r'shouldChangePassword'] = this.shouldChangePassword; json[r'status'] = this.status; - if (this.storageLabel != null) { + if (this.storageLabel.unwrapOrNull() != null) { json[r'storageLabel'] = this.storageLabel; } else { - // json[r'storageLabel'] = null; + if(this.storageLabel.isSome) { + json[r'storageLabel'] = null; + } } json[r'updatedAt'] = this.updatedAt.toUtc().toIso8601String(); return json; @@ -162,22 +172,22 @@ class UserAdminResponseDto { return UserAdminResponseDto( avatarColor: UserAvatarColor.fromJson(json[r'avatarColor'])!, - createdAt: mapDateTime(json, r'createdAt', r'')!, - deletedAt: mapDateTime(json, r'deletedAt', r''), + createdAt: mapDateTime(json, r'createdAt', r'')!, + deletedAt: Option.from(mapDateTime(json, r'deletedAt', r'')), email: mapValueOfType(json, r'email')!, id: mapValueOfType(json, r'id')!, isAdmin: mapValueOfType(json, r'isAdmin')!, - license: UserLicense.fromJson(json[r'license']), + license: Option.from(UserLicense.fromJson(json[r'license'])), name: mapValueOfType(json, r'name')!, oauthId: mapValueOfType(json, r'oauthId')!, - profileChangedAt: mapDateTime(json, r'profileChangedAt', r'')!, + profileChangedAt: mapDateTime(json, r'profileChangedAt', r'')!, profileImagePath: mapValueOfType(json, r'profileImagePath')!, - quotaSizeInBytes: mapValueOfType(json, r'quotaSizeInBytes'), - quotaUsageInBytes: mapValueOfType(json, r'quotaUsageInBytes'), + quotaSizeInBytes: Option.from(mapValueOfType(json, r'quotaSizeInBytes')), + quotaUsageInBytes: Option.from(mapValueOfType(json, r'quotaUsageInBytes')), shouldChangePassword: mapValueOfType(json, r'shouldChangePassword')!, status: UserStatus.fromJson(json[r'status'])!, - storageLabel: mapValueOfType(json, r'storageLabel'), - updatedAt: mapDateTime(json, r'updatedAt', r'')!, + storageLabel: Option.from(mapValueOfType(json, r'storageLabel')), + updatedAt: mapDateTime(json, r'updatedAt', r'')!, ); } return null; diff --git a/mobile/openapi/lib/model/user_admin_update_dto.dart b/mobile/openapi/lib/model/user_admin_update_dto.dart index ee5c006840..efe0ac25b4 100644 --- a/mobile/openapi/lib/model/user_admin_update_dto.dart +++ b/mobile/openapi/lib/model/user_admin_update_dto.dart @@ -13,17 +13,17 @@ part of openapi.api; class UserAdminUpdateDto { /// Returns a new [UserAdminUpdateDto] instance. UserAdminUpdateDto({ - this.avatarColor, + this.avatarColor = const None(), this.email, this.name, this.password, - this.pinCode, - this.quotaSizeInBytes, + this.pinCode = const None(), + this.quotaSizeInBytes = const None(), this.shouldChangePassword, - this.storageLabel, + this.storageLabel = const None(), }); - UserAvatarColor? avatarColor; + Option avatarColor; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -49,10 +49,10 @@ class UserAdminUpdateDto { /// String? password; - String? pinCode; + Option pinCode; /// Minimum value: 0 - int? quotaSizeInBytes; + Option quotaSizeInBytes; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -62,7 +62,7 @@ class UserAdminUpdateDto { /// bool? shouldChangePassword; - String? storageLabel; + Option storageLabel; @override bool operator ==(Object other) => identical(this, other) || other is UserAdminUpdateDto && @@ -78,24 +78,26 @@ class UserAdminUpdateDto { @override int get hashCode => // ignore: unnecessary_parenthesis - (avatarColor == null ? 0 : avatarColor!.hashCode) + + (avatarColor.hashCode) + (email == null ? 0 : email!.hashCode) + (name == null ? 0 : name!.hashCode) + (password == null ? 0 : password!.hashCode) + - (pinCode == null ? 0 : pinCode!.hashCode) + - (quotaSizeInBytes == null ? 0 : quotaSizeInBytes!.hashCode) + + (pinCode.hashCode) + + (quotaSizeInBytes.hashCode) + (shouldChangePassword == null ? 0 : shouldChangePassword!.hashCode) + - (storageLabel == null ? 0 : storageLabel!.hashCode); + (storageLabel.hashCode); @override String toString() => 'UserAdminUpdateDto[avatarColor=$avatarColor, email=$email, name=$name, password=$password, pinCode=$pinCode, quotaSizeInBytes=$quotaSizeInBytes, shouldChangePassword=$shouldChangePassword, storageLabel=$storageLabel]'; Map toJson() { final json = {}; - if (this.avatarColor != null) { + if (this.avatarColor.unwrapOrNull() != null) { json[r'avatarColor'] = this.avatarColor; } else { - // json[r'avatarColor'] = null; + if(this.avatarColor.isSome) { + json[r'avatarColor'] = null; + } } if (this.email != null) { json[r'email'] = this.email; @@ -112,25 +114,31 @@ class UserAdminUpdateDto { } else { // json[r'password'] = null; } - if (this.pinCode != null) { + if (this.pinCode.unwrapOrNull() != null) { json[r'pinCode'] = this.pinCode; } else { - // json[r'pinCode'] = null; + if(this.pinCode.isSome) { + json[r'pinCode'] = null; + } } - if (this.quotaSizeInBytes != null) { + if (this.quotaSizeInBytes.unwrapOrNull() != null) { json[r'quotaSizeInBytes'] = this.quotaSizeInBytes; } else { - // json[r'quotaSizeInBytes'] = null; + if(this.quotaSizeInBytes.isSome) { + json[r'quotaSizeInBytes'] = null; + } } if (this.shouldChangePassword != null) { json[r'shouldChangePassword'] = this.shouldChangePassword; } else { // json[r'shouldChangePassword'] = null; } - if (this.storageLabel != null) { + if (this.storageLabel.unwrapOrNull() != null) { json[r'storageLabel'] = this.storageLabel; } else { - // json[r'storageLabel'] = null; + if(this.storageLabel.isSome) { + json[r'storageLabel'] = null; + } } return json; } @@ -144,14 +152,14 @@ class UserAdminUpdateDto { final json = value.cast(); return UserAdminUpdateDto( - avatarColor: UserAvatarColor.fromJson(json[r'avatarColor']), + avatarColor: Option.from(UserAvatarColor.fromJson(json[r'avatarColor'])), email: mapValueOfType(json, r'email'), name: mapValueOfType(json, r'name'), password: mapValueOfType(json, r'password'), - pinCode: mapValueOfType(json, r'pinCode'), - quotaSizeInBytes: mapValueOfType(json, r'quotaSizeInBytes'), + pinCode: Option.from(mapValueOfType(json, r'pinCode')), + quotaSizeInBytes: Option.from(mapValueOfType(json, r'quotaSizeInBytes')), shouldChangePassword: mapValueOfType(json, r'shouldChangePassword'), - storageLabel: mapValueOfType(json, r'storageLabel'), + storageLabel: Option.from(mapValueOfType(json, r'storageLabel')), ); } return null; diff --git a/mobile/openapi/lib/model/user_license.dart b/mobile/openapi/lib/model/user_license.dart index 9bed8d5c43..a4a73753e0 100644 --- a/mobile/openapi/lib/model/user_license.dart +++ b/mobile/openapi/lib/model/user_license.dart @@ -57,7 +57,7 @@ class UserLicense { final json = value.cast(); return UserLicense( - activatedAt: mapDateTime(json, r'activatedAt', r'')!, + activatedAt: mapDateTime(json, r'activatedAt', r'')!, activationKey: mapValueOfType(json, r'activationKey')!, licenseKey: mapValueOfType(json, r'licenseKey')!, ); diff --git a/mobile/openapi/lib/model/user_response_dto.dart b/mobile/openapi/lib/model/user_response_dto.dart index a02da29948..0d6a70e31f 100644 --- a/mobile/openapi/lib/model/user_response_dto.dart +++ b/mobile/openapi/lib/model/user_response_dto.dart @@ -79,7 +79,7 @@ class UserResponseDto { email: mapValueOfType(json, r'email')!, id: mapValueOfType(json, r'id')!, name: mapValueOfType(json, r'name')!, - profileChangedAt: mapDateTime(json, r'profileChangedAt', r'')!, + profileChangedAt: mapDateTime(json, r'profileChangedAt', r'')!, profileImagePath: mapValueOfType(json, r'profileImagePath')!, ); } diff --git a/mobile/openapi/lib/model/user_update_me_dto.dart b/mobile/openapi/lib/model/user_update_me_dto.dart index 779e07ffa6..bc1247fbd2 100644 --- a/mobile/openapi/lib/model/user_update_me_dto.dart +++ b/mobile/openapi/lib/model/user_update_me_dto.dart @@ -13,13 +13,13 @@ part of openapi.api; class UserUpdateMeDto { /// Returns a new [UserUpdateMeDto] instance. UserUpdateMeDto({ - this.avatarColor, + this.avatarColor = const None(), this.email, this.name, this.password, }); - UserAvatarColor? avatarColor; + Option avatarColor; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -55,7 +55,7 @@ class UserUpdateMeDto { @override int get hashCode => // ignore: unnecessary_parenthesis - (avatarColor == null ? 0 : avatarColor!.hashCode) + + (avatarColor.hashCode) + (email == null ? 0 : email!.hashCode) + (name == null ? 0 : name!.hashCode) + (password == null ? 0 : password!.hashCode); @@ -65,10 +65,12 @@ class UserUpdateMeDto { Map toJson() { final json = {}; - if (this.avatarColor != null) { + if (this.avatarColor.unwrapOrNull() != null) { json[r'avatarColor'] = this.avatarColor; } else { - // json[r'avatarColor'] = null; + if(this.avatarColor.isSome) { + json[r'avatarColor'] = null; + } } if (this.email != null) { json[r'email'] = this.email; @@ -97,7 +99,7 @@ class UserUpdateMeDto { final json = value.cast(); return UserUpdateMeDto( - avatarColor: UserAvatarColor.fromJson(json[r'avatarColor']), + avatarColor: Option.from(UserAvatarColor.fromJson(json[r'avatarColor'])), email: mapValueOfType(json, r'email'), name: mapValueOfType(json, r'name'), password: mapValueOfType(json, r'password'),