From ac70d0369311a6dffc1428b30bb90d362c681223 Mon Sep 17 00:00:00 2001 From: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> Date: Sat, 17 May 2025 14:24:20 +0530 Subject: [PATCH] fix gen code --- mobile/lib/entities/album.entity.dart | 5 +- mobile/lib/entities/asset.entity.dart | 16 +- .../infrastructure/utils/exif.converter.dart | 36 +-- .../infrastructure/utils/user.converter.dart | 4 +- .../models/shared_link/shared_link.model.dart | 8 +- .../search/search_page_state.provider.dart | 2 +- .../repositories/activity_api.repository.dart | 4 +- .../repositories/album_api.repository.dart | 2 +- .../repositories/asset_api.repository.dart | 2 +- .../repositories/person_api.repository.dart | 2 +- mobile/lib/services/search.service.dart | 2 +- .../detail_panel/people_info.dart | 6 +- .../lib/model/activity_response_dto.dart | 20 +- .../openapi/lib/model/album_response_dto.dart | 10 +- .../lib/model/asset_bulk_update_dto.dart | 10 +- .../lib/model/asset_face_response_dto.dart | 10 +- .../openapi/lib/model/asset_response_dto.dart | 50 ++-- .../openapi/lib/model/exif_response_dto.dart | 224 ++++++++-------- .../lib/model/library_response_dto.dart | 12 +- .../lib/model/map_marker_response_dto.dart | 30 +-- .../map_reverse_geocode_response_dto.dart | 30 +-- .../lib/model/metadata_search_dto.dart | 60 ++--- .../lib/model/notification_create_dto.dart | 22 +- .../model/notification_update_all_dto.dart | 12 +- .../lib/model/notification_update_dto.dart | 12 +- .../openapi/lib/model/people_update_item.dart | 22 +- .../openapi/lib/model/person_create_dto.dart | 22 +- .../lib/model/person_response_dto.dart | 12 +- .../openapi/lib/model/person_update_dto.dart | 22 +- .../model/person_with_faces_response_dto.dart | 12 +- .../openapi/lib/model/random_search_dto.dart | 60 ++--- .../reverse_geocoding_state_response_dto.dart | 20 +- .../lib/model/search_asset_response_dto.dart | 10 +- .../lib/model/shared_link_create_dto.dart | 12 +- .../lib/model/shared_link_edit_dto.dart | 12 +- .../lib/model/shared_link_response_dto.dart | 42 +-- .../openapi/lib/model/smart_search_dto.dart | 60 ++--- .../openapi/lib/model/sync_asset_exif_v1.dart | 244 +++++++++--------- mobile/openapi/lib/model/sync_asset_v1.dart | 58 ++--- mobile/openapi/lib/model/sync_user_v1.dart | 12 +- mobile/openapi/lib/model/tag_create_dto.dart | 10 +- mobile/openapi/lib/model/tag_update_dto.dart | 10 +- .../openapi/lib/model/update_asset_dto.dart | 10 +- .../openapi/lib/model/usage_by_user_dto.dart | 10 +- .../lib/model/user_admin_create_dto.dart | 30 +-- .../lib/model/user_admin_response_dto.dart | 52 ++-- .../lib/model/user_admin_update_dto.dart | 40 +-- .../openapi/lib/model/user_update_me_dto.dart | 10 +- open-api/bin/generate-open-api.sh | 3 - .../mobile/dart_constructor.mustache | 10 - .../mobile/dart_constructor.mustache.patch | 12 - .../native/native_class.mustache | 22 +- .../native/native_class.mustache.patch | 31 +-- 53 files changed, 714 insertions(+), 747 deletions(-) delete mode 100644 open-api/templates/mobile/dart_constructor.mustache delete mode 100644 open-api/templates/mobile/dart_constructor.mustache.patch diff --git a/mobile/lib/entities/album.entity.dart b/mobile/lib/entities/album.entity.dart index 17e8e10a1a..791aca182b 100644 --- a/mobile/lib/entities/album.entity.dart +++ b/mobile/lib/entities/album.entity.dart @@ -163,10 +163,11 @@ class Album { dto.order == AssetOrder.asc ? SortOrder.asc : SortOrder.desc; } - if (dto.albumThumbnailAssetId.unwrapOrNull() != null) { + if (dto.albumThumbnailAssetId != null && + dto.albumThumbnailAssetId!.isSome) { a.thumbnail.value = await db.assets .where() - .remoteIdEqualTo(dto.albumThumbnailAssetId.unwrap()) + .remoteIdEqualTo(dto.albumThumbnailAssetId!.unwrap()) .findFirst(); } if (dto.albumUsers.isNotEmpty) { diff --git a/mobile/lib/entities/asset.entity.dart b/mobile/lib/entities/asset.entity.dart index b3b77f3c29..904b6155d8 100644 --- a/mobile/lib/entities/asset.entity.dart +++ b/mobile/lib/entities/asset.entity.dart @@ -27,9 +27,9 @@ class Asset { durationInSeconds = remote.duration.toDuration()?.inSeconds ?? 0, type = remote.type.toAssetType(), fileName = remote.originalFileName, - height = remote.exifInfo?.exifImageHeight.unwrapOrNull()?.toInt(), - width = remote.exifInfo?.exifImageWidth.unwrapOrNull()?.toInt(), - livePhotoVideoId = remote.livePhotoVideoId.unwrapOrNull(), + height = remote.exifInfo?.exifImageHeight?.unwrapOrNull()?.toInt(), + width = remote.exifInfo?.exifImageWidth?.unwrapOrNull()?.toInt(), + livePhotoVideoId = remote.livePhotoVideoId?.unwrapOrNull(), ownerId = fastHash(remote.ownerId), exifInfo = remote.exifInfo == null ? null @@ -41,12 +41,12 @@ class Asset { // workaround to nullify stackPrimaryAssetId for the parent asset until we refactor the mobile app // stack handling to properly handle it stackPrimaryAssetId = - remote.stack.unwrapOrNull()?.primaryAssetId == remote.id + remote.stack?.unwrapOrNull()?.primaryAssetId == remote.id ? null - : remote.stack.unwrapOrNull()?.primaryAssetId, - stackCount = remote.stack.unwrapOrNull()?.assetCount ?? 0, - stackId = remote.stack.unwrapOrNull()?.id, - thumbhash = remote.thumbhash.unwrapOrNull(); + : remote.stack?.unwrapOrNull()?.primaryAssetId, + stackCount = remote.stack?.unwrapOrNull()?.assetCount ?? 0, + stackId = remote.stack?.unwrapOrNull()?.id, + thumbhash = remote.thumbhash?.unwrapOrNull(); Asset({ this.id = Isar.autoIncrement, diff --git a/mobile/lib/infrastructure/utils/exif.converter.dart b/mobile/lib/infrastructure/utils/exif.converter.dart index 204c44399a..fc9baa40e0 100644 --- a/mobile/lib/infrastructure/utils/exif.converter.dart +++ b/mobile/lib/infrastructure/utils/exif.converter.dart @@ -5,24 +5,24 @@ import 'package:openapi/api.dart'; abstract final class ExifDtoConverter { static ExifInfo fromDto(ExifResponseDto dto) { return ExifInfo( - fileSize: dto.fileSizeInByte.unwrapOrNull(), - description: dto.description.unwrapOrNull(), - orientation: dto.orientation.unwrapOrNull(), - timeZone: dto.timeZone.unwrapOrNull(), - dateTimeOriginal: dto.dateTimeOriginal.unwrapOrNull(), - isFlipped: isOrientationFlipped(dto.orientation.unwrapOrNull()), - latitude: dto.latitude.unwrapOrNull()?.toDouble(), - longitude: dto.longitude.unwrapOrNull()?.toDouble(), - city: dto.city.unwrapOrNull(), - state: dto.state.unwrapOrNull(), - country: dto.country.unwrapOrNull(), - make: dto.make.unwrapOrNull(), - model: dto.model.unwrapOrNull(), - lens: dto.lensModel.unwrapOrNull(), - f: dto.fNumber.unwrapOrNull()?.toDouble(), - mm: dto.focalLength.unwrapOrNull()?.toDouble(), - iso: dto.iso.unwrapOrNull()?.toInt(), - exposureSeconds: _exposureTimeToSeconds(dto.exposureTime.unwrapOrNull()), + fileSize: dto.fileSizeInByte?.unwrapOrNull(), + description: dto.description?.unwrapOrNull(), + orientation: dto.orientation?.unwrapOrNull(), + timeZone: dto.timeZone?.unwrapOrNull(), + dateTimeOriginal: dto.dateTimeOriginal?.unwrapOrNull(), + isFlipped: isOrientationFlipped(dto.orientation?.unwrapOrNull()), + latitude: dto.latitude?.unwrapOrNull()?.toDouble(), + longitude: dto.longitude?.unwrapOrNull()?.toDouble(), + city: dto.city?.unwrapOrNull(), + state: dto.state?.unwrapOrNull(), + country: dto.country?.unwrapOrNull(), + make: dto.make?.unwrapOrNull(), + model: dto.model?.unwrapOrNull(), + lens: dto.lensModel?.unwrapOrNull(), + f: dto.fNumber?.unwrapOrNull()?.toDouble(), + mm: dto.focalLength?.unwrapOrNull()?.toDouble(), + iso: dto.iso?.unwrapOrNull()?.toInt(), + exposureSeconds: _exposureTimeToSeconds(dto.exposureTime?.unwrapOrNull()), ); } diff --git a/mobile/lib/infrastructure/utils/user.converter.dart b/mobile/lib/infrastructure/utils/user.converter.dart index fa51c34968..8a6127e3d2 100644 --- a/mobile/lib/infrastructure/utils/user.converter.dart +++ b/mobile/lib/infrastructure/utils/user.converter.dart @@ -31,8 +31,8 @@ abstract final class UserConverter { inTimeline: false, isPartnerSharedBy: false, isPartnerSharedWith: false, - quotaUsageInBytes: adminDto.quotaUsageInBytes.unwrapOrNull() ?? 0, - quotaSizeInBytes: adminDto.quotaSizeInBytes.unwrapOrNull() ?? 0, + quotaUsageInBytes: adminDto.quotaUsageInBytes?.unwrapOrNull() ?? 0, + quotaSizeInBytes: adminDto.quotaSizeInBytes?.unwrapOrNull() ?? 0, ); static UserDto fromPartnerDto(PartnerResponseDto dto) => UserDto( diff --git a/mobile/lib/models/shared_link/shared_link.model.dart b/mobile/lib/models/shared_link/shared_link.model.dart index f8d95e4003..a0bd3a0bd0 100644 --- a/mobile/lib/models/shared_link/shared_link.model.dart +++ b/mobile/lib/models/shared_link/shared_link.model.dart @@ -61,9 +61,9 @@ class SharedLink { : id = dto.id, allowDownload = dto.allowDownload, allowUpload = dto.allowUpload, - description = dto.description.unwrapOrNull(), - password = dto.password.unwrapOrNull(), - expiresAt = dto.expiresAt.unwrapOrNull(), + description = dto.description?.unwrapOrNull(), + password = dto.password?.unwrapOrNull(), + expiresAt = dto.expiresAt?.unwrapOrNull(), key = dto.key, showMetadata = dto.showMetadata, type = dto.type == SharedLinkType.ALBUM @@ -73,7 +73,7 @@ class SharedLink { ? dto.album?.albumName.toUpperCase() ?? "UNKNOWN SHARE" : "INDIVIDUAL SHARE", thumbAssetId = dto.type == SharedLinkType.ALBUM - ? dto.album?.albumThumbnailAssetId.unwrapOrNull() + ? dto.album?.albumThumbnailAssetId?.unwrapOrNull() : dto.assets.isNotEmpty ? dto.assets[0].id : null; diff --git a/mobile/lib/providers/search/search_page_state.provider.dart b/mobile/lib/providers/search/search_page_state.provider.dart index bd472e2865..b65b6672e5 100644 --- a/mobile/lib/providers/search/search_page_state.provider.dart +++ b/mobile/lib/providers/search/search_page_state.provider.dart @@ -40,7 +40,7 @@ final getAllPlacesProvider = final curatedContent = assetPlaces .map( (data) => SearchCuratedContent( - label: data.exifInfo!.city.unwrap(), + label: data.exifInfo!.city!.unwrap(), id: data.id, ), ) diff --git a/mobile/lib/repositories/activity_api.repository.dart b/mobile/lib/repositories/activity_api.repository.dart index 8896165718..b545a0548a 100644 --- a/mobile/lib/repositories/activity_api.repository.dart +++ b/mobile/lib/repositories/activity_api.repository.dart @@ -61,7 +61,7 @@ class ActivityApiRepository extends ApiRepository ? ActivityType.comment : ActivityType.like, user: UserConverter.fromSimpleUserDto(dto.user), - assetId: dto.assetId.unwrapOrNull(), - comment: dto.comment.unwrapOrNull(), + assetId: dto.assetId?.unwrapOrNull(), + comment: dto.comment?.unwrapOrNull(), ); } diff --git a/mobile/lib/repositories/album_api.repository.dart b/mobile/lib/repositories/album_api.repository.dart index fa31e44695..a0c71bf834 100644 --- a/mobile/lib/repositories/album_api.repository.dart +++ b/mobile/lib/repositories/album_api.repository.dart @@ -168,7 +168,7 @@ class AlbumApiRepository extends ApiRepository implements IAlbumApiRepository { album.remoteAssetCount = dto.assetCount; album.owner.value = entity.User.fromDto(UserConverter.fromSimpleUserDto(dto.owner)); - album.remoteThumbnailAssetId = dto.albumThumbnailAssetId.unwrapOrNull(); + album.remoteThumbnailAssetId = dto.albumThumbnailAssetId?.unwrapOrNull(); final users = dto.albumUsers .map((albumUser) => UserConverter.fromSimpleUserDto(albumUser.user)); album.sharedUsers.addAll(users.map(entity.User.fromDto)); diff --git a/mobile/lib/repositories/asset_api.repository.dart b/mobile/lib/repositories/asset_api.repository.dart index 2c138ccdc7..e9e19d5ae2 100644 --- a/mobile/lib/repositories/asset_api.repository.dart +++ b/mobile/lib/repositories/asset_api.repository.dart @@ -43,7 +43,7 @@ class AssetApiRepository extends ApiRepository implements IAssetApiRepository { ), ); result.addAll(response.assets.items.map(Asset.remote)); - hasNext = response.assets.nextPage.unwrapOrNull() != null; + hasNext = response.assets.nextPage?.unwrapOrNull() != null; currentPage++; } return result; diff --git a/mobile/lib/repositories/person_api.repository.dart b/mobile/lib/repositories/person_api.repository.dart index a8ed6d7da7..a0868b562f 100644 --- a/mobile/lib/repositories/person_api.repository.dart +++ b/mobile/lib/repositories/person_api.repository.dart @@ -29,7 +29,7 @@ class PersonApiRepository extends ApiRepository } static Person _toPerson(PersonResponseDto dto) => Person( - birthDate: dto.birthDate.unwrapOrNull(), + birthDate: dto.birthDate?.unwrapOrNull(), id: dto.id, isHidden: dto.isHidden, name: dto.name, diff --git a/mobile/lib/services/search.service.dart b/mobile/lib/services/search.service.dart index 4575702cc5..2a20ac8c0c 100644 --- a/mobile/lib/services/search.service.dart +++ b/mobile/lib/services/search.service.dart @@ -119,7 +119,7 @@ class SearchService { assets: await _assetRepository.getAllByRemoteId( response.assets.items.map((e) => e.id), ), - nextPage: response.assets.nextPage.unwrapOrNull()?.toInt(), + nextPage: response.assets.nextPage?.unwrapOrNull()?.toInt(), ); } catch (error, stackTrace) { _log.severe("Failed to search for assets", error, stackTrace); diff --git a/mobile/lib/widgets/asset_viewer/detail_panel/people_info.dart b/mobile/lib/widgets/asset_viewer/detail_panel/people_info.dart index 793d63053b..bd75e8298b 100644 --- a/mobile/lib/widgets/asset_viewer/detail_panel/people_info.dart +++ b/mobile/lib/widgets/asset_viewer/detail_panel/people_info.dart @@ -45,9 +45,9 @@ class PeopleInfo extends ConsumerWidget { (p) => SearchCuratedContent( id: p.id, label: p.name, - subtitle: p.birthDate.unwrapOrNull() != null && - p.birthDate.unwrap().isBefore(asset.fileCreatedAt) - ? _formatAge(p.birthDate.unwrap(), asset.fileCreatedAt) + subtitle: p.birthDate?.unwrapOrNull() != null && + p.birthDate!.unwrap().isBefore(asset.fileCreatedAt) + ? _formatAge(p.birthDate!.unwrap(), asset.fileCreatedAt) : null, ), ) diff --git a/mobile/openapi/lib/model/activity_response_dto.dart b/mobile/openapi/lib/model/activity_response_dto.dart index c5d87aca1c..da6f0bc87a 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({ - this.assetId = const None(), - this.comment = const None(), + required this.assetId, + this.comment, required this.createdAt, required this.id, required this.type, required this.user, }); - Option assetId; + Option? assetId; - Option comment; + Option? comment; DateTime createdAt; @@ -45,8 +45,8 @@ class ActivityResponseDto { @override int get hashCode => // ignore: unnecessary_parenthesis - (assetId.hashCode) + - (comment.hashCode) + + (assetId == null ? 0 : assetId!.hashCode) + + (comment == null ? 0 : comment!.hashCode) + (createdAt.hashCode) + (id.hashCode) + (type.hashCode) + @@ -57,17 +57,17 @@ class ActivityResponseDto { Map toJson() { final json = {}; - if (this.assetId.unwrapOrNull() != null) { + if (this.assetId?.isSome ?? false) { json[r'assetId'] = this.assetId; } else { - if(this.assetId.isSome) { + if(this.assetId?.isNone ?? false) { json[r'assetId'] = null; } } - if (this.comment.unwrapOrNull() != null) { + if (this.comment?.isSome ?? false) { json[r'comment'] = this.comment; } else { - if(this.comment.isSome) { + if(this.comment?.isNone ?? false) { json[r'comment'] = null; } } diff --git a/mobile/openapi/lib/model/album_response_dto.dart b/mobile/openapi/lib/model/album_response_dto.dart index 98e46810eb..5f03c3f09f 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, - this.albumThumbnailAssetId = const None(), + required this.albumThumbnailAssetId, this.albumUsers = const [], required this.assetCount, this.assets = const [], @@ -35,7 +35,7 @@ class AlbumResponseDto { String albumName; - Option albumThumbnailAssetId; + Option? albumThumbnailAssetId; List albumUsers; @@ -118,7 +118,7 @@ class AlbumResponseDto { int get hashCode => // ignore: unnecessary_parenthesis (albumName.hashCode) + - (albumThumbnailAssetId.hashCode) + + (albumThumbnailAssetId == null ? 0 : albumThumbnailAssetId!.hashCode) + (albumUsers.hashCode) + (assetCount.hashCode) + (assets.hashCode) + @@ -142,10 +142,10 @@ class AlbumResponseDto { Map toJson() { final json = {}; json[r'albumName'] = this.albumName; - if (this.albumThumbnailAssetId.unwrapOrNull() != null) { + if (this.albumThumbnailAssetId?.isSome ?? false) { json[r'albumThumbnailAssetId'] = this.albumThumbnailAssetId; } else { - if(this.albumThumbnailAssetId.isSome) { + if(this.albumThumbnailAssetId?.isNone ?? false) { json[r'albumThumbnailAssetId'] = null; } } diff --git a/mobile/openapi/lib/model/asset_bulk_update_dto.dart b/mobile/openapi/lib/model/asset_bulk_update_dto.dart index 2e3f5e1ad0..2fb0d05e2f 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 = const None(), + this.duplicateId, this.ids = const [], this.isFavorite, this.latitude, @@ -31,7 +31,7 @@ class AssetBulkUpdateDto { /// String? dateTimeOriginal; - Option duplicateId; + Option? duplicateId; List ids; @@ -92,7 +92,7 @@ class AssetBulkUpdateDto { int get hashCode => // ignore: unnecessary_parenthesis (dateTimeOriginal == null ? 0 : dateTimeOriginal!.hashCode) + - (duplicateId.hashCode) + + (duplicateId == null ? 0 : duplicateId!.hashCode) + (ids.hashCode) + (isFavorite == null ? 0 : isFavorite!.hashCode) + (latitude == null ? 0 : latitude!.hashCode) + @@ -110,10 +110,10 @@ class AssetBulkUpdateDto { } else { // json[r'dateTimeOriginal'] = null; } - if (this.duplicateId.unwrapOrNull() != null) { + if (this.duplicateId?.isSome ?? false) { json[r'duplicateId'] = this.duplicateId; } else { - if(this.duplicateId.isSome) { + if(this.duplicateId?.isNone ?? false) { json[r'duplicateId'] = null; } } diff --git a/mobile/openapi/lib/model/asset_face_response_dto.dart b/mobile/openapi/lib/model/asset_face_response_dto.dart index 6ab0acd973..3ef83f80e3 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, - this.person = const None(), + required this.person, this.sourceType, }); @@ -38,7 +38,7 @@ class AssetFaceResponseDto { int imageWidth; - Option 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.hashCode) + + (person == null ? 0 : person!.hashCode) + (sourceType == null ? 0 : sourceType!.hashCode); @override @@ -85,10 +85,10 @@ class AssetFaceResponseDto { json[r'id'] = this.id; json[r'imageHeight'] = this.imageHeight; json[r'imageWidth'] = this.imageWidth; - if (this.person.unwrapOrNull() != null) { + if (this.person?.isSome ?? false) { json[r'person'] = this.person; } else { - if(this.person.isSome) { + if(this.person?.isNone ?? false) { json[r'person'] = null; } } diff --git a/mobile/openapi/lib/model/asset_response_dto.dart b/mobile/openapi/lib/model/asset_response_dto.dart index 5b9f0e6a3a..0a2a4f1464 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 = const None(), + this.duplicateId, 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 = const None(), - this.livePhotoVideoId = const None(), + this.libraryId, + this.livePhotoVideoId, required this.localDateTime, required this.originalFileName, this.originalMimeType, @@ -37,9 +37,9 @@ class AssetResponseDto { required this.ownerId, this.people = const [], this.resized, - this.stack = const None(), + this.stack, this.tags = const [], - this.thumbhash = const None(), + required this.thumbhash, required this.type, this.unassignedFaces = const [], required this.updatedAt, @@ -53,7 +53,7 @@ class AssetResponseDto { String deviceId; - Option duplicateId; + Option? duplicateId; String duration; @@ -82,9 +82,9 @@ class AssetResponseDto { bool isTrashed; /// This property was deprecated in v1.106.0 - Option libraryId; + Option? libraryId; - Option livePhotoVideoId; + Option? livePhotoVideoId; DateTime localDateTime; @@ -121,11 +121,11 @@ class AssetResponseDto { /// bool? resized; - Option stack; + Option? stack; List tags; - Option thumbhash; + Option? thumbhash; AssetTypeEnum type; @@ -175,7 +175,7 @@ class AssetResponseDto { (checksum.hashCode) + (deviceAssetId.hashCode) + (deviceId.hashCode) + - (duplicateId.hashCode) + + (duplicateId == null ? 0 : duplicateId!.hashCode) + (duration.hashCode) + (exifInfo == null ? 0 : exifInfo!.hashCode) + (fileCreatedAt.hashCode) + @@ -186,8 +186,8 @@ class AssetResponseDto { (isFavorite.hashCode) + (isOffline.hashCode) + (isTrashed.hashCode) + - (libraryId.hashCode) + - (livePhotoVideoId.hashCode) + + (libraryId == null ? 0 : libraryId!.hashCode) + + (livePhotoVideoId == null ? 0 : 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.hashCode) + + (stack == null ? 0 : stack!.hashCode) + (tags.hashCode) + - (thumbhash.hashCode) + + (thumbhash == null ? 0 : thumbhash!.hashCode) + (type.hashCode) + (unassignedFaces.hashCode) + (updatedAt.hashCode) + @@ -212,10 +212,10 @@ class AssetResponseDto { json[r'checksum'] = this.checksum; json[r'deviceAssetId'] = this.deviceAssetId; json[r'deviceId'] = this.deviceId; - if (this.duplicateId.unwrapOrNull() != null) { + if (this.duplicateId?.isSome ?? false) { json[r'duplicateId'] = this.duplicateId; } else { - if(this.duplicateId.isSome) { + if(this.duplicateId?.isNone ?? false) { json[r'duplicateId'] = null; } } @@ -233,17 +233,17 @@ class AssetResponseDto { json[r'isFavorite'] = this.isFavorite; json[r'isOffline'] = this.isOffline; json[r'isTrashed'] = this.isTrashed; - if (this.libraryId.unwrapOrNull() != null) { + if (this.libraryId?.isSome ?? false) { json[r'libraryId'] = this.libraryId; } else { - if(this.libraryId.isSome) { + if(this.libraryId?.isNone ?? false) { json[r'libraryId'] = null; } } - if (this.livePhotoVideoId.unwrapOrNull() != null) { + if (this.livePhotoVideoId?.isSome ?? false) { json[r'livePhotoVideoId'] = this.livePhotoVideoId; } else { - if(this.livePhotoVideoId.isSome) { + if(this.livePhotoVideoId?.isNone ?? false) { json[r'livePhotoVideoId'] = null; } } @@ -267,18 +267,18 @@ class AssetResponseDto { } else { // json[r'resized'] = null; } - if (this.stack.unwrapOrNull() != null) { + if (this.stack?.isSome ?? false) { json[r'stack'] = this.stack; } else { - if(this.stack.isSome) { + if(this.stack?.isNone ?? false) { json[r'stack'] = null; } } json[r'tags'] = this.tags; - if (this.thumbhash.unwrapOrNull() != null) { + if (this.thumbhash?.isSome ?? false) { json[r'thumbhash'] = this.thumbhash; } else { - if(this.thumbhash.isSome) { + if(this.thumbhash?.isNone ?? false) { json[r'thumbhash'] = null; } } diff --git a/mobile/openapi/lib/model/exif_response_dto.dart b/mobile/openapi/lib/model/exif_response_dto.dart index d0a429e30e..d6449e40ef 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 = 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(), + 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, }); - Option city; + Option? city; - Option country; + Option? country; - Option dateTimeOriginal; + Option? dateTimeOriginal; - Option description; + Option? description; - Option exifImageHeight; + Option? exifImageHeight; - Option exifImageWidth; + Option? exifImageWidth; - Option exposureTime; + Option? exposureTime; - Option fNumber; + Option? fNumber; - Option fileSizeInByte; + Option? fileSizeInByte; - Option focalLength; + Option? focalLength; - Option iso; + Option? iso; - Option latitude; + Option? latitude; - Option lensModel; + Option? lensModel; - Option longitude; + Option? longitude; - Option make; + Option? make; - Option model; + Option? model; - Option modifyDate; + Option? modifyDate; - Option orientation; + Option? orientation; - Option projectionType; + Option? projectionType; - Option rating; + Option? rating; - Option state; + Option? state; - Option timeZone; + Option? timeZone; @override bool operator ==(Object other) => identical(this, other) || other is ExifResponseDto && @@ -109,185 +109,185 @@ class ExifResponseDto { @override int get hashCode => // ignore: unnecessary_parenthesis - (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); + (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); @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.unwrapOrNull() != null) { + if (this.city?.isSome ?? false) { json[r'city'] = this.city; } else { - if(this.city.isSome) { + if(this.city?.isNone ?? false) { json[r'city'] = null; } } - if (this.country.unwrapOrNull() != null) { + if (this.country?.isSome ?? false) { json[r'country'] = this.country; } else { - if(this.country.isSome) { + if(this.country?.isNone ?? false) { json[r'country'] = null; } } - if (this.dateTimeOriginal.unwrapOrNull() != null) { - json[r'dateTimeOriginal'] = this.dateTimeOriginal.unwrap().toUtc().toIso8601String(); + if (this.dateTimeOriginal?.isSome ?? false) { + json[r'dateTimeOriginal'] = this.dateTimeOriginal!.unwrap().toUtc().toIso8601String(); } else { - if(this.dateTimeOriginal.isSome) { + if(this.dateTimeOriginal?.isNone ?? false) { json[r'dateTimeOriginal'] = null; } } - if (this.description.unwrapOrNull() != null) { + if (this.description?.isSome ?? false) { json[r'description'] = this.description; } else { - if(this.description.isSome) { + if(this.description?.isNone ?? false) { json[r'description'] = null; } } - if (this.exifImageHeight.unwrapOrNull() != null) { + if (this.exifImageHeight?.isSome ?? false) { json[r'exifImageHeight'] = this.exifImageHeight; } else { - if(this.exifImageHeight.isSome) { + if(this.exifImageHeight?.isNone ?? false) { json[r'exifImageHeight'] = null; } } - if (this.exifImageWidth.unwrapOrNull() != null) { + if (this.exifImageWidth?.isSome ?? false) { json[r'exifImageWidth'] = this.exifImageWidth; } else { - if(this.exifImageWidth.isSome) { + if(this.exifImageWidth?.isNone ?? false) { json[r'exifImageWidth'] = null; } } - if (this.exposureTime.unwrapOrNull() != null) { + if (this.exposureTime?.isSome ?? false) { json[r'exposureTime'] = this.exposureTime; } else { - if(this.exposureTime.isSome) { + if(this.exposureTime?.isNone ?? false) { json[r'exposureTime'] = null; } } - if (this.fNumber.unwrapOrNull() != null) { + if (this.fNumber?.isSome ?? false) { json[r'fNumber'] = this.fNumber; } else { - if(this.fNumber.isSome) { + if(this.fNumber?.isNone ?? false) { json[r'fNumber'] = null; } } - if (this.fileSizeInByte.unwrapOrNull() != null) { + if (this.fileSizeInByte?.isSome ?? false) { json[r'fileSizeInByte'] = this.fileSizeInByte; } else { - if(this.fileSizeInByte.isSome) { + if(this.fileSizeInByte?.isNone ?? false) { json[r'fileSizeInByte'] = null; } } - if (this.focalLength.unwrapOrNull() != null) { + if (this.focalLength?.isSome ?? false) { json[r'focalLength'] = this.focalLength; } else { - if(this.focalLength.isSome) { + if(this.focalLength?.isNone ?? false) { json[r'focalLength'] = null; } } - if (this.iso.unwrapOrNull() != null) { + if (this.iso?.isSome ?? false) { json[r'iso'] = this.iso; } else { - if(this.iso.isSome) { + if(this.iso?.isNone ?? false) { json[r'iso'] = null; } } - if (this.latitude.unwrapOrNull() != null) { + if (this.latitude?.isSome ?? false) { json[r'latitude'] = this.latitude; } else { - if(this.latitude.isSome) { + if(this.latitude?.isNone ?? false) { json[r'latitude'] = null; } } - if (this.lensModel.unwrapOrNull() != null) { + if (this.lensModel?.isSome ?? false) { json[r'lensModel'] = this.lensModel; } else { - if(this.lensModel.isSome) { + if(this.lensModel?.isNone ?? false) { json[r'lensModel'] = null; } } - if (this.longitude.unwrapOrNull() != null) { + if (this.longitude?.isSome ?? false) { json[r'longitude'] = this.longitude; } else { - if(this.longitude.isSome) { + if(this.longitude?.isNone ?? false) { json[r'longitude'] = null; } } - if (this.make.unwrapOrNull() != null) { + if (this.make?.isSome ?? false) { json[r'make'] = this.make; } else { - if(this.make.isSome) { + if(this.make?.isNone ?? false) { json[r'make'] = null; } } - if (this.model.unwrapOrNull() != null) { + if (this.model?.isSome ?? false) { json[r'model'] = this.model; } else { - if(this.model.isSome) { + if(this.model?.isNone ?? false) { json[r'model'] = null; } } - if (this.modifyDate.unwrapOrNull() != null) { - json[r'modifyDate'] = this.modifyDate.unwrap().toUtc().toIso8601String(); + if (this.modifyDate?.isSome ?? false) { + json[r'modifyDate'] = this.modifyDate!.unwrap().toUtc().toIso8601String(); } else { - if(this.modifyDate.isSome) { + if(this.modifyDate?.isNone ?? false) { json[r'modifyDate'] = null; } } - if (this.orientation.unwrapOrNull() != null) { + if (this.orientation?.isSome ?? false) { json[r'orientation'] = this.orientation; } else { - if(this.orientation.isSome) { + if(this.orientation?.isNone ?? false) { json[r'orientation'] = null; } } - if (this.projectionType.unwrapOrNull() != null) { + if (this.projectionType?.isSome ?? false) { json[r'projectionType'] = this.projectionType; } else { - if(this.projectionType.isSome) { + if(this.projectionType?.isNone ?? false) { json[r'projectionType'] = null; } } - if (this.rating.unwrapOrNull() != null) { + if (this.rating?.isSome ?? false) { json[r'rating'] = this.rating; } else { - if(this.rating.isSome) { + if(this.rating?.isNone ?? false) { json[r'rating'] = null; } } - if (this.state.unwrapOrNull() != null) { + if (this.state?.isSome ?? false) { json[r'state'] = this.state; } else { - if(this.state.isSome) { + if(this.state?.isNone ?? false) { json[r'state'] = null; } } - if (this.timeZone.unwrapOrNull() != null) { + if (this.timeZone?.isSome ?? false) { json[r'timeZone'] = this.timeZone; } else { - if(this.timeZone.isSome) { + if(this.timeZone?.isNone ?? false) { json[r'timeZone'] = null; } } diff --git a/mobile/openapi/lib/model/library_response_dto.dart b/mobile/openapi/lib/model/library_response_dto.dart index 93ae9f5a70..daf679fa84 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, - this.refreshedAt = const None(), + required this.refreshedAt, required this.updatedAt, }); @@ -38,7 +38,7 @@ class LibraryResponseDto { String ownerId; - Option refreshedAt; + Option? refreshedAt; DateTime updatedAt; @@ -64,7 +64,7 @@ class LibraryResponseDto { (importPaths.hashCode) + (name.hashCode) + (ownerId.hashCode) + - (refreshedAt.hashCode) + + (refreshedAt == null ? 0 : refreshedAt!.hashCode) + (updatedAt.hashCode); @override @@ -79,10 +79,10 @@ class LibraryResponseDto { json[r'importPaths'] = this.importPaths; json[r'name'] = this.name; json[r'ownerId'] = this.ownerId; - if (this.refreshedAt.unwrapOrNull() != null) { - json[r'refreshedAt'] = this.refreshedAt.unwrap().toUtc().toIso8601String(); + if (this.refreshedAt?.isSome ?? false) { + json[r'refreshedAt'] = this.refreshedAt!.unwrap().toUtc().toIso8601String(); } else { - if(this.refreshedAt.isSome) { + if(this.refreshedAt?.isNone ?? false) { json[r'refreshedAt'] = null; } } diff --git a/mobile/openapi/lib/model/map_marker_response_dto.dart b/mobile/openapi/lib/model/map_marker_response_dto.dart index 2864d0f9a2..6fc6f4a163 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({ - this.city = const None(), - this.country = const None(), + required this.city, + required this.country, required this.id, required this.lat, required this.lon, - this.state = const None(), + required this.state, }); - Option city; + Option? city; - Option country; + Option? country; String id; @@ -31,7 +31,7 @@ class MapMarkerResponseDto { double lon; - Option state; + Option? state; @override bool operator ==(Object other) => identical(this, other) || other is MapMarkerResponseDto && @@ -45,39 +45,39 @@ class MapMarkerResponseDto { @override int get hashCode => // ignore: unnecessary_parenthesis - (city.hashCode) + - (country.hashCode) + + (city == null ? 0 : city!.hashCode) + + (country == null ? 0 : country!.hashCode) + (id.hashCode) + (lat.hashCode) + (lon.hashCode) + - (state.hashCode); + (state == null ? 0 : 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.unwrapOrNull() != null) { + if (this.city?.isSome ?? false) { json[r'city'] = this.city; } else { - if(this.city.isSome) { + if(this.city?.isNone ?? false) { json[r'city'] = null; } } - if (this.country.unwrapOrNull() != null) { + if (this.country?.isSome ?? false) { json[r'country'] = this.country; } else { - if(this.country.isSome) { + if(this.country?.isNone ?? false) { json[r'country'] = null; } } json[r'id'] = this.id; json[r'lat'] = this.lat; json[r'lon'] = this.lon; - if (this.state.unwrapOrNull() != null) { + if (this.state?.isSome ?? false) { json[r'state'] = this.state; } else { - if(this.state.isSome) { + if(this.state?.isNone ?? false) { json[r'state'] = 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 8f583bc07c..824b667c6e 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({ - this.city = const None(), - this.country = const None(), - this.state = const None(), + required this.city, + required this.country, + required this.state, }); - Option city; + Option? city; - Option country; + Option? country; - Option state; + Option? state; @override bool operator ==(Object other) => identical(this, other) || other is MapReverseGeocodeResponseDto && @@ -33,33 +33,33 @@ class MapReverseGeocodeResponseDto { @override int get hashCode => // ignore: unnecessary_parenthesis - (city.hashCode) + - (country.hashCode) + - (state.hashCode); + (city == null ? 0 : city!.hashCode) + + (country == null ? 0 : country!.hashCode) + + (state == null ? 0 : state!.hashCode); @override String toString() => 'MapReverseGeocodeResponseDto[city=$city, country=$country, state=$state]'; Map toJson() { final json = {}; - if (this.city.unwrapOrNull() != null) { + if (this.city?.isSome ?? false) { json[r'city'] = this.city; } else { - if(this.city.isSome) { + if(this.city?.isNone ?? false) { json[r'city'] = null; } } - if (this.country.unwrapOrNull() != null) { + if (this.country?.isSome ?? false) { json[r'country'] = this.country; } else { - if(this.country.isSome) { + if(this.country?.isNone ?? false) { json[r'country'] = null; } } - if (this.state.unwrapOrNull() != null) { + if (this.state?.isSome ?? false) { json[r'state'] = this.state; } else { - if(this.state.isSome) { + if(this.state?.isNone ?? false) { json[r'state'] = null; } } diff --git a/mobile/openapi/lib/model/metadata_search_dto.dart b/mobile/openapi/lib/model/metadata_search_dto.dart index 30159e2cb7..60871e9f10 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 = const None(), - this.country = const None(), + this.city, + this.country, this.createdAfter, this.createdBefore, this.description, @@ -28,10 +28,10 @@ class MetadataSearchDto { this.isMotion, this.isNotInAlbum, this.isOffline, - this.lensModel = const None(), - this.libraryId = const None(), + this.lensModel, + this.libraryId, this.make, - this.model = const None(), + this.model, this.order = AssetOrder.desc, this.originalFileName, this.originalPath, @@ -40,7 +40,7 @@ class MetadataSearchDto { this.previewPath, this.rating, this.size, - this.state = const None(), + this.state, this.tagIds = const [], this.takenAfter, this.takenBefore, @@ -65,9 +65,9 @@ class MetadataSearchDto { /// String? checksum; - Option city; + Option? city; - Option country; + Option? country; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -165,9 +165,9 @@ class MetadataSearchDto { /// bool? isOffline; - Option lensModel; + Option? lensModel; - Option libraryId; + Option? libraryId; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -177,7 +177,7 @@ class MetadataSearchDto { /// String? make; - Option model; + Option? model; AssetOrder order; @@ -236,7 +236,7 @@ class MetadataSearchDto { /// num? size; - Option state; + Option? state; List tagIds; @@ -393,8 +393,8 @@ class MetadataSearchDto { int get hashCode => // ignore: unnecessary_parenthesis (checksum == null ? 0 : checksum!.hashCode) + - (city.hashCode) + - (country.hashCode) + + (city == null ? 0 : city!.hashCode) + + (country == null ? 0 : 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.hashCode) + - (libraryId.hashCode) + + (lensModel == null ? 0 : lensModel!.hashCode) + + (libraryId == null ? 0 : libraryId!.hashCode) + (make == null ? 0 : make!.hashCode) + - (model.hashCode) + + (model == null ? 0 : 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.hashCode) + + (state == null ? 0 : state!.hashCode) + (tagIds.hashCode) + (takenAfter == null ? 0 : takenAfter!.hashCode) + (takenBefore == null ? 0 : takenBefore!.hashCode) + @@ -445,17 +445,17 @@ class MetadataSearchDto { } else { // json[r'checksum'] = null; } - if (this.city.unwrapOrNull() != null) { + if (this.city?.isSome ?? false) { json[r'city'] = this.city; } else { - if(this.city.isSome) { + if(this.city?.isNone ?? false) { json[r'city'] = null; } } - if (this.country.unwrapOrNull() != null) { + if (this.country?.isSome ?? false) { json[r'country'] = this.country; } else { - if(this.country.isSome) { + if(this.country?.isNone ?? false) { json[r'country'] = null; } } @@ -519,17 +519,17 @@ class MetadataSearchDto { } else { // json[r'isOffline'] = null; } - if (this.lensModel.unwrapOrNull() != null) { + if (this.lensModel?.isSome ?? false) { json[r'lensModel'] = this.lensModel; } else { - if(this.lensModel.isSome) { + if(this.lensModel?.isNone ?? false) { json[r'lensModel'] = null; } } - if (this.libraryId.unwrapOrNull() != null) { + if (this.libraryId?.isSome ?? false) { json[r'libraryId'] = this.libraryId; } else { - if(this.libraryId.isSome) { + if(this.libraryId?.isNone ?? false) { json[r'libraryId'] = null; } } @@ -538,10 +538,10 @@ class MetadataSearchDto { } else { // json[r'make'] = null; } - if (this.model.unwrapOrNull() != null) { + if (this.model?.isSome ?? false) { json[r'model'] = this.model; } else { - if(this.model.isSome) { + if(this.model?.isNone ?? false) { json[r'model'] = null; } } @@ -577,10 +577,10 @@ class MetadataSearchDto { } else { // json[r'size'] = null; } - if (this.state.unwrapOrNull() != null) { + if (this.state?.isSome ?? false) { json[r'state'] = this.state; } else { - if(this.state.isSome) { + if(this.state?.isNone ?? false) { json[r'state'] = null; } } diff --git a/mobile/openapi/lib/model/notification_create_dto.dart b/mobile/openapi/lib/model/notification_create_dto.dart index 87b63f898d..a9a03fea3d 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 = const None(), + this.description, this.level, - this.readAt = const None(), + this.readAt, required this.title, this.type, required this.userId, @@ -30,7 +30,7 @@ class NotificationCreateDto { /// Object? data; - Option description; + Option? description; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -40,7 +40,7 @@ class NotificationCreateDto { /// NotificationLevel? level; - Option readAt; + Option? readAt; String title; @@ -68,9 +68,9 @@ class NotificationCreateDto { int get hashCode => // ignore: unnecessary_parenthesis (data == null ? 0 : data!.hashCode) + - (description.hashCode) + + (description == null ? 0 : description!.hashCode) + (level == null ? 0 : level!.hashCode) + - (readAt.hashCode) + + (readAt == null ? 0 : readAt!.hashCode) + (title.hashCode) + (type == null ? 0 : type!.hashCode) + (userId.hashCode); @@ -85,10 +85,10 @@ class NotificationCreateDto { } else { // json[r'data'] = null; } - if (this.description.unwrapOrNull() != null) { + if (this.description?.isSome ?? false) { json[r'description'] = this.description; } else { - if(this.description.isSome) { + if(this.description?.isNone ?? false) { json[r'description'] = null; } } @@ -97,10 +97,10 @@ class NotificationCreateDto { } else { // json[r'level'] = null; } - if (this.readAt.unwrapOrNull() != null) { - json[r'readAt'] = this.readAt.unwrap().toUtc().toIso8601String(); + if (this.readAt?.isSome ?? false) { + json[r'readAt'] = this.readAt!.unwrap().toUtc().toIso8601String(); } else { - if(this.readAt.isSome) { + if(this.readAt?.isNone ?? false) { json[r'readAt'] = null; } } diff --git a/mobile/openapi/lib/model/notification_update_all_dto.dart b/mobile/openapi/lib/model/notification_update_all_dto.dart index 5d28d897cc..2228f22806 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 = const None(), + this.readAt, }); List ids; - Option 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.hashCode); + (readAt == null ? 0 : readAt!.hashCode); @override String toString() => 'NotificationUpdateAllDto[ids=$ids, readAt=$readAt]'; @@ -38,10 +38,10 @@ class NotificationUpdateAllDto { Map toJson() { final json = {}; json[r'ids'] = this.ids; - if (this.readAt.unwrapOrNull() != null) { - json[r'readAt'] = this.readAt.unwrap().toUtc().toIso8601String(); + if (this.readAt?.isSome ?? false) { + json[r'readAt'] = this.readAt!.unwrap().toUtc().toIso8601String(); } else { - if(this.readAt.isSome) { + if(this.readAt?.isNone ?? false) { json[r'readAt'] = null; } } diff --git a/mobile/openapi/lib/model/notification_update_dto.dart b/mobile/openapi/lib/model/notification_update_dto.dart index 5f2377c09e..74e922c7f6 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 = const None(), + this.readAt, }); - Option readAt; + Option? readAt; @override bool operator ==(Object other) => identical(this, other) || other is NotificationUpdateDto && @@ -25,17 +25,17 @@ class NotificationUpdateDto { @override int get hashCode => // ignore: unnecessary_parenthesis - (readAt.hashCode); + (readAt == null ? 0 : readAt!.hashCode); @override String toString() => 'NotificationUpdateDto[readAt=$readAt]'; Map toJson() { final json = {}; - if (this.readAt.unwrapOrNull() != null) { - json[r'readAt'] = this.readAt.unwrap().toUtc().toIso8601String(); + if (this.readAt?.isSome ?? false) { + json[r'readAt'] = this.readAt!.unwrap().toUtc().toIso8601String(); } else { - if(this.readAt.isSome) { + if(this.readAt?.isNone ?? false) { json[r'readAt'] = null; } } diff --git a/mobile/openapi/lib/model/people_update_item.dart b/mobile/openapi/lib/model/people_update_item.dart index 74da611d59..43071e622a 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 = const None(), - this.color = const None(), + this.birthDate, + this.color, 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. - Option birthDate; + Option? birthDate; - Option 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.hashCode) + - (color.hashCode) + + (birthDate == null ? 0 : birthDate!.hashCode) + + (color == null ? 0 : color!.hashCode) + (featureFaceAssetId == null ? 0 : featureFaceAssetId!.hashCode) + (id.hashCode) + (isFavorite == null ? 0 : isFavorite!.hashCode) + @@ -91,17 +91,17 @@ class PeopleUpdateItem { Map toJson() { final json = {}; - if (this.birthDate.unwrapOrNull() != null) { - json[r'birthDate'] = _dateFormatter.format(this.birthDate.unwrap().toUtc()); + if (this.birthDate?.isSome ?? false) { + json[r'birthDate'] = _dateFormatter.format(this.birthDate!.unwrap().toUtc()); } else { - if(this.birthDate.isSome) { + if(this.birthDate?.isNone ?? false) { json[r'birthDate'] = null; } } - if (this.color.unwrapOrNull() != null) { + if (this.color?.isSome ?? false) { json[r'color'] = this.color; } else { - if(this.color.isSome) { + if(this.color?.isNone ?? false) { json[r'color'] = null; } } diff --git a/mobile/openapi/lib/model/person_create_dto.dart b/mobile/openapi/lib/model/person_create_dto.dart index 78038b9a9e..1b2a65bd95 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 = const None(), - this.color = const None(), + this.birthDate, + this.color, this.isFavorite, this.isHidden, this.name, }); /// Person date of birth. Note: the mobile app cannot currently set the birth date to null. - Option birthDate; + Option? birthDate; - Option 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.hashCode) + - (color.hashCode) + + (birthDate == null ? 0 : birthDate!.hashCode) + + (color == null ? 0 : color!.hashCode) + (isFavorite == null ? 0 : isFavorite!.hashCode) + (isHidden == null ? 0 : isHidden!.hashCode) + (name == null ? 0 : name!.hashCode); @@ -73,17 +73,17 @@ class PersonCreateDto { Map toJson() { final json = {}; - if (this.birthDate.unwrapOrNull() != null) { - json[r'birthDate'] = _dateFormatter.format(this.birthDate.unwrap().toUtc()); + if (this.birthDate?.isSome ?? false) { + json[r'birthDate'] = _dateFormatter.format(this.birthDate!.unwrap().toUtc()); } else { - if(this.birthDate.isSome) { + if(this.birthDate?.isNone ?? false) { json[r'birthDate'] = null; } } - if (this.color.unwrapOrNull() != null) { + if (this.color?.isSome ?? false) { json[r'color'] = this.color; } else { - if(this.color.isSome) { + if(this.color?.isNone ?? false) { json[r'color'] = null; } } diff --git a/mobile/openapi/lib/model/person_response_dto.dart b/mobile/openapi/lib/model/person_response_dto.dart index ada5d61cc4..8e3cf419fc 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({ - this.birthDate = const None(), + required this.birthDate, this.color, required this.id, this.isFavorite, @@ -23,7 +23,7 @@ class PersonResponseDto { this.updatedAt, }); - Option 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.hashCode) + + (birthDate == null ? 0 : birthDate!.hashCode) + (color == null ? 0 : color!.hashCode) + (id.hashCode) + (isFavorite == null ? 0 : isFavorite!.hashCode) + @@ -88,10 +88,10 @@ class PersonResponseDto { Map toJson() { final json = {}; - if (this.birthDate.unwrapOrNull() != null) { - json[r'birthDate'] = _dateFormatter.format(this.birthDate.unwrap().toUtc()); + if (this.birthDate?.isSome ?? false) { + json[r'birthDate'] = _dateFormatter.format(this.birthDate!.unwrap().toUtc()); } else { - if(this.birthDate.isSome) { + if(this.birthDate?.isNone ?? false) { json[r'birthDate'] = null; } } diff --git a/mobile/openapi/lib/model/person_update_dto.dart b/mobile/openapi/lib/model/person_update_dto.dart index 2e55d0c4e8..92d9e88daf 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 = const None(), - this.color = const None(), + this.birthDate, + this.color, 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. - Option birthDate; + Option? birthDate; - Option 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.hashCode) + - (color.hashCode) + + (birthDate == null ? 0 : birthDate!.hashCode) + + (color == null ? 0 : color!.hashCode) + (featureFaceAssetId == null ? 0 : featureFaceAssetId!.hashCode) + (isFavorite == null ? 0 : isFavorite!.hashCode) + (isHidden == null ? 0 : isHidden!.hashCode) + @@ -85,17 +85,17 @@ class PersonUpdateDto { Map toJson() { final json = {}; - if (this.birthDate.unwrapOrNull() != null) { - json[r'birthDate'] = _dateFormatter.format(this.birthDate.unwrap().toUtc()); + if (this.birthDate?.isSome ?? false) { + json[r'birthDate'] = _dateFormatter.format(this.birthDate!.unwrap().toUtc()); } else { - if(this.birthDate.isSome) { + if(this.birthDate?.isNone ?? false) { json[r'birthDate'] = null; } } - if (this.color.unwrapOrNull() != null) { + if (this.color?.isSome ?? false) { json[r'color'] = this.color; } else { - if(this.color.isSome) { + if(this.color?.isNone ?? false) { json[r'color'] = null; } } 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 4db1fc9467..963c102a69 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({ - this.birthDate = const None(), + required this.birthDate, this.color, this.faces = const [], required this.id, @@ -24,7 +24,7 @@ class PersonWithFacesResponseDto { this.updatedAt, }); - Option 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.hashCode) + + (birthDate == null ? 0 : birthDate!.hashCode) + (color == null ? 0 : color!.hashCode) + (faces.hashCode) + (id.hashCode) + @@ -93,10 +93,10 @@ class PersonWithFacesResponseDto { Map toJson() { final json = {}; - if (this.birthDate.unwrapOrNull() != null) { - json[r'birthDate'] = _dateFormatter.format(this.birthDate.unwrap().toUtc()); + if (this.birthDate?.isSome ?? false) { + json[r'birthDate'] = _dateFormatter.format(this.birthDate!.unwrap().toUtc()); } else { - if(this.birthDate.isSome) { + if(this.birthDate?.isNone ?? false) { json[r'birthDate'] = null; } } diff --git a/mobile/openapi/lib/model/random_search_dto.dart b/mobile/openapi/lib/model/random_search_dto.dart index 4df1cf83bb..1263c8a2b4 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 = const None(), - this.country = const None(), + this.city, + this.country, this.createdAfter, this.createdBefore, this.deviceId, @@ -23,14 +23,14 @@ class RandomSearchDto { this.isMotion, this.isNotInAlbum, this.isOffline, - this.lensModel = const None(), - this.libraryId = const None(), + this.lensModel, + this.libraryId, this.make, - this.model = const None(), + this.model, this.personIds = const [], this.rating, this.size, - this.state = const None(), + this.state, this.tagIds = const [], this.takenAfter, this.takenBefore, @@ -46,9 +46,9 @@ class RandomSearchDto { this.withStacked, }); - Option city; + Option? city; - Option country; + Option? country; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -114,9 +114,9 @@ class RandomSearchDto { /// bool? isOffline; - Option lensModel; + Option? lensModel; - Option libraryId; + Option? libraryId; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -126,7 +126,7 @@ class RandomSearchDto { /// String? make; - Option model; + Option? model; List personIds; @@ -150,7 +150,7 @@ class RandomSearchDto { /// num? size; - Option state; + Option? state; List tagIds; @@ -287,8 +287,8 @@ class RandomSearchDto { @override int get hashCode => // ignore: unnecessary_parenthesis - (city.hashCode) + - (country.hashCode) + + (city == null ? 0 : city!.hashCode) + + (country == null ? 0 : 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.hashCode) + - (libraryId.hashCode) + + (lensModel == null ? 0 : lensModel!.hashCode) + + (libraryId == null ? 0 : libraryId!.hashCode) + (make == null ? 0 : make!.hashCode) + - (model.hashCode) + + (model == null ? 0 : model!.hashCode) + (personIds.hashCode) + (rating == null ? 0 : rating!.hashCode) + (size == null ? 0 : size!.hashCode) + - (state.hashCode) + + (state == null ? 0 : state!.hashCode) + (tagIds.hashCode) + (takenAfter == null ? 0 : takenAfter!.hashCode) + (takenBefore == null ? 0 : takenBefore!.hashCode) + @@ -324,17 +324,17 @@ class RandomSearchDto { Map toJson() { final json = {}; - if (this.city.unwrapOrNull() != null) { + if (this.city?.isSome ?? false) { json[r'city'] = this.city; } else { - if(this.city.isSome) { + if(this.city?.isNone ?? false) { json[r'city'] = null; } } - if (this.country.unwrapOrNull() != null) { + if (this.country?.isSome ?? false) { json[r'country'] = this.country; } else { - if(this.country.isSome) { + if(this.country?.isNone ?? false) { json[r'country'] = null; } } @@ -378,17 +378,17 @@ class RandomSearchDto { } else { // json[r'isOffline'] = null; } - if (this.lensModel.unwrapOrNull() != null) { + if (this.lensModel?.isSome ?? false) { json[r'lensModel'] = this.lensModel; } else { - if(this.lensModel.isSome) { + if(this.lensModel?.isNone ?? false) { json[r'lensModel'] = null; } } - if (this.libraryId.unwrapOrNull() != null) { + if (this.libraryId?.isSome ?? false) { json[r'libraryId'] = this.libraryId; } else { - if(this.libraryId.isSome) { + if(this.libraryId?.isNone ?? false) { json[r'libraryId'] = null; } } @@ -397,10 +397,10 @@ class RandomSearchDto { } else { // json[r'make'] = null; } - if (this.model.unwrapOrNull() != null) { + if (this.model?.isSome ?? false) { json[r'model'] = this.model; } else { - if(this.model.isSome) { + if(this.model?.isNone ?? false) { json[r'model'] = null; } } @@ -415,10 +415,10 @@ class RandomSearchDto { } else { // json[r'size'] = null; } - if (this.state.unwrapOrNull() != null) { + if (this.state?.isSome ?? false) { json[r'state'] = this.state; } else { - if(this.state.isSome) { + if(this.state?.isNone ?? false) { json[r'state'] = null; } } 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 a97a0c38ee..132ce2ea12 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({ - this.lastImportFileName = const None(), - this.lastUpdate = const None(), + required this.lastImportFileName, + required this.lastUpdate, }); - Option lastImportFileName; + Option? lastImportFileName; - Option lastUpdate; + Option? lastUpdate; @override bool operator ==(Object other) => identical(this, other) || other is ReverseGeocodingStateResponseDto && @@ -29,25 +29,25 @@ class ReverseGeocodingStateResponseDto { @override int get hashCode => // ignore: unnecessary_parenthesis - (lastImportFileName.hashCode) + - (lastUpdate.hashCode); + (lastImportFileName == null ? 0 : lastImportFileName!.hashCode) + + (lastUpdate == null ? 0 : lastUpdate!.hashCode); @override String toString() => 'ReverseGeocodingStateResponseDto[lastImportFileName=$lastImportFileName, lastUpdate=$lastUpdate]'; Map toJson() { final json = {}; - if (this.lastImportFileName.unwrapOrNull() != null) { + if (this.lastImportFileName?.isSome ?? false) { json[r'lastImportFileName'] = this.lastImportFileName; } else { - if(this.lastImportFileName.isSome) { + if(this.lastImportFileName?.isNone ?? false) { json[r'lastImportFileName'] = null; } } - if (this.lastUpdate.unwrapOrNull() != null) { + if (this.lastUpdate?.isSome ?? false) { json[r'lastUpdate'] = this.lastUpdate; } else { - if(this.lastUpdate.isSome) { + if(this.lastUpdate?.isNone ?? false) { json[r'lastUpdate'] = null; } } diff --git a/mobile/openapi/lib/model/search_asset_response_dto.dart b/mobile/openapi/lib/model/search_asset_response_dto.dart index 86e44a4f76..7ad48d0064 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 [], - this.nextPage = const None(), + required this.nextPage, required this.total, }); @@ -26,7 +26,7 @@ class SearchAssetResponseDto { List items; - Option nextPage; + Option? nextPage; int total; @@ -44,7 +44,7 @@ class SearchAssetResponseDto { (count.hashCode) + (facets.hashCode) + (items.hashCode) + - (nextPage.hashCode) + + (nextPage == null ? 0 : nextPage!.hashCode) + (total.hashCode); @override @@ -55,10 +55,10 @@ class SearchAssetResponseDto { json[r'count'] = this.count; json[r'facets'] = this.facets; json[r'items'] = this.items; - if (this.nextPage.unwrapOrNull() != null) { + if (this.nextPage?.isSome ?? false) { json[r'nextPage'] = this.nextPage; } else { - if(this.nextPage.isSome) { + if(this.nextPage?.isNone ?? false) { json[r'nextPage'] = null; } } diff --git a/mobile/openapi/lib/model/shared_link_create_dto.dart b/mobile/openapi/lib/model/shared_link_create_dto.dart index f9102444bb..18da5742f1 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 = const None(), + this.expiresAt, this.password, this.showMetadata = true, required this.type, @@ -52,7 +52,7 @@ class SharedLinkCreateDto { /// String? description; - Option 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.hashCode) + + (expiresAt == null ? 0 : expiresAt!.hashCode) + (password == null ? 0 : password!.hashCode) + (showMetadata.hashCode) + (type.hashCode); @@ -113,10 +113,10 @@ class SharedLinkCreateDto { } else { // json[r'description'] = null; } - if (this.expiresAt.unwrapOrNull() != null) { - json[r'expiresAt'] = this.expiresAt.unwrap().toUtc().toIso8601String(); + if (this.expiresAt?.isSome ?? false) { + json[r'expiresAt'] = this.expiresAt!.unwrap().toUtc().toIso8601String(); } else { - if(this.expiresAt.isSome) { + if(this.expiresAt?.isNone ?? false) { json[r'expiresAt'] = null; } } diff --git a/mobile/openapi/lib/model/shared_link_edit_dto.dart b/mobile/openapi/lib/model/shared_link_edit_dto.dart index 8e874b9792..2d28861e51 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 = const None(), + this.expiresAt, this.password, this.showMetadata, }); @@ -55,7 +55,7 @@ class SharedLinkEditDto { /// String? description; - Option 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.hashCode) + + (expiresAt == null ? 0 : expiresAt!.hashCode) + (password == null ? 0 : password!.hashCode) + (showMetadata == null ? 0 : showMetadata!.hashCode); @@ -119,10 +119,10 @@ class SharedLinkEditDto { } else { // json[r'description'] = null; } - if (this.expiresAt.unwrapOrNull() != null) { - json[r'expiresAt'] = this.expiresAt.unwrap().toUtc().toIso8601String(); + if (this.expiresAt?.isSome ?? false) { + json[r'expiresAt'] = this.expiresAt!.unwrap().toUtc().toIso8601String(); } else { - if(this.expiresAt.isSome) { + if(this.expiresAt?.isNone ?? false) { json[r'expiresAt'] = null; } } diff --git a/mobile/openapi/lib/model/shared_link_response_dto.dart b/mobile/openapi/lib/model/shared_link_response_dto.dart index 9f4c30a975..c68895997a 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, - this.description = const None(), - this.expiresAt = const None(), + required this.description, + required this.expiresAt, required this.id, required this.key, - this.password = const None(), + required this.password, required this.showMetadata, - this.token = const None(), + this.token, required this.type, required this.userId, }); @@ -45,19 +45,19 @@ class SharedLinkResponseDto { DateTime createdAt; - Option description; + Option? description; - Option expiresAt; + Option? expiresAt; String id; String key; - Option password; + Option? password; bool showMetadata; - Option token; + Option? token; SharedLinkType type; @@ -88,13 +88,13 @@ class SharedLinkResponseDto { (allowUpload.hashCode) + (assets.hashCode) + (createdAt.hashCode) + - (description.hashCode) + - (expiresAt.hashCode) + + (description == null ? 0 : description!.hashCode) + + (expiresAt == null ? 0 : expiresAt!.hashCode) + (id.hashCode) + (key.hashCode) + - (password.hashCode) + + (password == null ? 0 : password!.hashCode) + (showMetadata.hashCode) + - (token.hashCode) + + (token == null ? 0 : token!.hashCode) + (type.hashCode) + (userId.hashCode); @@ -112,34 +112,34 @@ class SharedLinkResponseDto { json[r'allowUpload'] = this.allowUpload; json[r'assets'] = this.assets; json[r'createdAt'] = this.createdAt.toUtc().toIso8601String(); - if (this.description.unwrapOrNull() != null) { + if (this.description?.isSome ?? false) { json[r'description'] = this.description; } else { - if(this.description.isSome) { + if(this.description?.isNone ?? false) { json[r'description'] = null; } } - if (this.expiresAt.unwrapOrNull() != null) { - json[r'expiresAt'] = this.expiresAt.unwrap().toUtc().toIso8601String(); + if (this.expiresAt?.isSome ?? false) { + json[r'expiresAt'] = this.expiresAt!.unwrap().toUtc().toIso8601String(); } else { - if(this.expiresAt.isSome) { + if(this.expiresAt?.isNone ?? false) { json[r'expiresAt'] = null; } } json[r'id'] = this.id; json[r'key'] = this.key; - if (this.password.unwrapOrNull() != null) { + if (this.password?.isSome ?? false) { json[r'password'] = this.password; } else { - if(this.password.isSome) { + if(this.password?.isNone ?? false) { json[r'password'] = null; } } json[r'showMetadata'] = this.showMetadata; - if (this.token.unwrapOrNull() != null) { + if (this.token?.isSome ?? false) { json[r'token'] = this.token; } else { - if(this.token.isSome) { + if(this.token?.isNone ?? false) { json[r'token'] = null; } } diff --git a/mobile/openapi/lib/model/smart_search_dto.dart b/mobile/openapi/lib/model/smart_search_dto.dart index 03f5871df4..9463deb449 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 = const None(), - this.country = const None(), + this.city, + this.country, this.createdAfter, this.createdBefore, this.deviceId, @@ -24,16 +24,16 @@ class SmartSearchDto { this.isNotInAlbum, this.isOffline, this.language, - this.lensModel = const None(), - this.libraryId = const None(), + this.lensModel, + this.libraryId, this.make, - this.model = const None(), + this.model, this.page, this.personIds = const [], required this.query, this.rating, this.size, - this.state = const None(), + this.state, this.tagIds = const [], this.takenAfter, this.takenBefore, @@ -47,9 +47,9 @@ class SmartSearchDto { this.withExif, }); - Option city; + Option? city; - Option country; + Option? country; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -123,9 +123,9 @@ class SmartSearchDto { /// String? language; - Option lensModel; + Option? lensModel; - Option libraryId; + Option? libraryId; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -135,7 +135,7 @@ class SmartSearchDto { /// String? make; - Option model; + Option? model; /// Minimum value: 1 /// @@ -170,7 +170,7 @@ class SmartSearchDto { /// num? size; - Option state; + Option? state; List tagIds; @@ -292,8 +292,8 @@ class SmartSearchDto { @override int get hashCode => // ignore: unnecessary_parenthesis - (city.hashCode) + - (country.hashCode) + + (city == null ? 0 : city!.hashCode) + + (country == null ? 0 : 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.hashCode) + - (libraryId.hashCode) + + (lensModel == null ? 0 : lensModel!.hashCode) + + (libraryId == null ? 0 : libraryId!.hashCode) + (make == null ? 0 : make!.hashCode) + - (model.hashCode) + + (model == null ? 0 : model!.hashCode) + (page == null ? 0 : page!.hashCode) + (personIds.hashCode) + (query.hashCode) + (rating == null ? 0 : rating!.hashCode) + (size == null ? 0 : size!.hashCode) + - (state.hashCode) + + (state == null ? 0 : state!.hashCode) + (tagIds.hashCode) + (takenAfter == null ? 0 : takenAfter!.hashCode) + (takenBefore == null ? 0 : takenBefore!.hashCode) + @@ -330,17 +330,17 @@ class SmartSearchDto { Map toJson() { final json = {}; - if (this.city.unwrapOrNull() != null) { + if (this.city?.isSome ?? false) { json[r'city'] = this.city; } else { - if(this.city.isSome) { + if(this.city?.isNone ?? false) { json[r'city'] = null; } } - if (this.country.unwrapOrNull() != null) { + if (this.country?.isSome ?? false) { json[r'country'] = this.country; } else { - if(this.country.isSome) { + if(this.country?.isNone ?? false) { json[r'country'] = null; } } @@ -389,17 +389,17 @@ class SmartSearchDto { } else { // json[r'language'] = null; } - if (this.lensModel.unwrapOrNull() != null) { + if (this.lensModel?.isSome ?? false) { json[r'lensModel'] = this.lensModel; } else { - if(this.lensModel.isSome) { + if(this.lensModel?.isNone ?? false) { json[r'lensModel'] = null; } } - if (this.libraryId.unwrapOrNull() != null) { + if (this.libraryId?.isSome ?? false) { json[r'libraryId'] = this.libraryId; } else { - if(this.libraryId.isSome) { + if(this.libraryId?.isNone ?? false) { json[r'libraryId'] = null; } } @@ -408,10 +408,10 @@ class SmartSearchDto { } else { // json[r'make'] = null; } - if (this.model.unwrapOrNull() != null) { + if (this.model?.isSome ?? false) { json[r'model'] = this.model; } else { - if(this.model.isSome) { + if(this.model?.isNone ?? false) { json[r'model'] = null; } } @@ -432,10 +432,10 @@ class SmartSearchDto { } else { // json[r'size'] = null; } - if (this.state.unwrapOrNull() != null) { + if (this.state?.isSome ?? false) { json[r'state'] = this.state; } else { - if(this.state.isSome) { + if(this.state?.isNone ?? false) { json[r'state'] = null; } } diff --git a/mobile/openapi/lib/model/sync_asset_exif_v1.dart b/mobile/openapi/lib/model/sync_asset_exif_v1.dart index 4edb89a3f4..b26ab4ca7c 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, - 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(), + 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, }); String assetId; - Option city; + Option? city; - Option country; + Option? country; - Option dateTimeOriginal; + Option? dateTimeOriginal; - Option description; + Option? description; - Option exifImageHeight; + Option? exifImageHeight; - Option exifImageWidth; + Option? exifImageWidth; - Option exposureTime; + Option? exposureTime; - Option fNumber; + Option? fNumber; - Option fileSizeInByte; + Option? fileSizeInByte; - Option focalLength; + Option? focalLength; - Option fps; + Option? fps; - Option iso; + Option? iso; - Option latitude; + Option? latitude; - Option lensModel; + Option? lensModel; - Option longitude; + Option? longitude; - Option make; + Option? make; - Option model; + Option? model; - Option modifyDate; + Option? modifyDate; - Option orientation; + Option? orientation; - Option profileDescription; + Option? profileDescription; - Option projectionType; + Option? projectionType; - Option rating; + Option? rating; - Option state; + Option? state; - Option 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.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); + (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); @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,171 +153,171 @@ class SyncAssetExifV1 { Map toJson() { final json = {}; json[r'assetId'] = this.assetId; - if (this.city.unwrapOrNull() != null) { + if (this.city?.isSome ?? false) { json[r'city'] = this.city; } else { - if(this.city.isSome) { + if(this.city?.isNone ?? false) { json[r'city'] = null; } } - if (this.country.unwrapOrNull() != null) { + if (this.country?.isSome ?? false) { json[r'country'] = this.country; } else { - if(this.country.isSome) { + if(this.country?.isNone ?? false) { json[r'country'] = null; } } - if (this.dateTimeOriginal.unwrapOrNull() != null) { - json[r'dateTimeOriginal'] = this.dateTimeOriginal.unwrap().toUtc().toIso8601String(); + if (this.dateTimeOriginal?.isSome ?? false) { + json[r'dateTimeOriginal'] = this.dateTimeOriginal!.unwrap().toUtc().toIso8601String(); } else { - if(this.dateTimeOriginal.isSome) { + if(this.dateTimeOriginal?.isNone ?? false) { json[r'dateTimeOriginal'] = null; } } - if (this.description.unwrapOrNull() != null) { + if (this.description?.isSome ?? false) { json[r'description'] = this.description; } else { - if(this.description.isSome) { + if(this.description?.isNone ?? false) { json[r'description'] = null; } } - if (this.exifImageHeight.unwrapOrNull() != null) { + if (this.exifImageHeight?.isSome ?? false) { json[r'exifImageHeight'] = this.exifImageHeight; } else { - if(this.exifImageHeight.isSome) { + if(this.exifImageHeight?.isNone ?? false) { json[r'exifImageHeight'] = null; } } - if (this.exifImageWidth.unwrapOrNull() != null) { + if (this.exifImageWidth?.isSome ?? false) { json[r'exifImageWidth'] = this.exifImageWidth; } else { - if(this.exifImageWidth.isSome) { + if(this.exifImageWidth?.isNone ?? false) { json[r'exifImageWidth'] = null; } } - if (this.exposureTime.unwrapOrNull() != null) { + if (this.exposureTime?.isSome ?? false) { json[r'exposureTime'] = this.exposureTime; } else { - if(this.exposureTime.isSome) { + if(this.exposureTime?.isNone ?? false) { json[r'exposureTime'] = null; } } - if (this.fNumber.unwrapOrNull() != null) { + if (this.fNumber?.isSome ?? false) { json[r'fNumber'] = this.fNumber; } else { - if(this.fNumber.isSome) { + if(this.fNumber?.isNone ?? false) { json[r'fNumber'] = null; } } - if (this.fileSizeInByte.unwrapOrNull() != null) { + if (this.fileSizeInByte?.isSome ?? false) { json[r'fileSizeInByte'] = this.fileSizeInByte; } else { - if(this.fileSizeInByte.isSome) { + if(this.fileSizeInByte?.isNone ?? false) { json[r'fileSizeInByte'] = null; } } - if (this.focalLength.unwrapOrNull() != null) { + if (this.focalLength?.isSome ?? false) { json[r'focalLength'] = this.focalLength; } else { - if(this.focalLength.isSome) { + if(this.focalLength?.isNone ?? false) { json[r'focalLength'] = null; } } - if (this.fps.unwrapOrNull() != null) { + if (this.fps?.isSome ?? false) { json[r'fps'] = this.fps; } else { - if(this.fps.isSome) { + if(this.fps?.isNone ?? false) { json[r'fps'] = null; } } - if (this.iso.unwrapOrNull() != null) { + if (this.iso?.isSome ?? false) { json[r'iso'] = this.iso; } else { - if(this.iso.isSome) { + if(this.iso?.isNone ?? false) { json[r'iso'] = null; } } - if (this.latitude.unwrapOrNull() != null) { + if (this.latitude?.isSome ?? false) { json[r'latitude'] = this.latitude; } else { - if(this.latitude.isSome) { + if(this.latitude?.isNone ?? false) { json[r'latitude'] = null; } } - if (this.lensModel.unwrapOrNull() != null) { + if (this.lensModel?.isSome ?? false) { json[r'lensModel'] = this.lensModel; } else { - if(this.lensModel.isSome) { + if(this.lensModel?.isNone ?? false) { json[r'lensModel'] = null; } } - if (this.longitude.unwrapOrNull() != null) { + if (this.longitude?.isSome ?? false) { json[r'longitude'] = this.longitude; } else { - if(this.longitude.isSome) { + if(this.longitude?.isNone ?? false) { json[r'longitude'] = null; } } - if (this.make.unwrapOrNull() != null) { + if (this.make?.isSome ?? false) { json[r'make'] = this.make; } else { - if(this.make.isSome) { + if(this.make?.isNone ?? false) { json[r'make'] = null; } } - if (this.model.unwrapOrNull() != null) { + if (this.model?.isSome ?? false) { json[r'model'] = this.model; } else { - if(this.model.isSome) { + if(this.model?.isNone ?? false) { json[r'model'] = null; } } - if (this.modifyDate.unwrapOrNull() != null) { - json[r'modifyDate'] = this.modifyDate.unwrap().toUtc().toIso8601String(); + if (this.modifyDate?.isSome ?? false) { + json[r'modifyDate'] = this.modifyDate!.unwrap().toUtc().toIso8601String(); } else { - if(this.modifyDate.isSome) { + if(this.modifyDate?.isNone ?? false) { json[r'modifyDate'] = null; } } - if (this.orientation.unwrapOrNull() != null) { + if (this.orientation?.isSome ?? false) { json[r'orientation'] = this.orientation; } else { - if(this.orientation.isSome) { + if(this.orientation?.isNone ?? false) { json[r'orientation'] = null; } } - if (this.profileDescription.unwrapOrNull() != null) { + if (this.profileDescription?.isSome ?? false) { json[r'profileDescription'] = this.profileDescription; } else { - if(this.profileDescription.isSome) { + if(this.profileDescription?.isNone ?? false) { json[r'profileDescription'] = null; } } - if (this.projectionType.unwrapOrNull() != null) { + if (this.projectionType?.isSome ?? false) { json[r'projectionType'] = this.projectionType; } else { - if(this.projectionType.isSome) { + if(this.projectionType?.isNone ?? false) { json[r'projectionType'] = null; } } - if (this.rating.unwrapOrNull() != null) { + if (this.rating?.isSome ?? false) { json[r'rating'] = this.rating; } else { - if(this.rating.isSome) { + if(this.rating?.isNone ?? false) { json[r'rating'] = null; } } - if (this.state.unwrapOrNull() != null) { + if (this.state?.isSome ?? false) { json[r'state'] = this.state; } else { - if(this.state.isSome) { + if(this.state?.isNone ?? false) { json[r'state'] = null; } } - if (this.timeZone.unwrapOrNull() != null) { + if (this.timeZone?.isSome ?? false) { json[r'timeZone'] = this.timeZone; } else { - if(this.timeZone.isSome) { + if(this.timeZone?.isNone ?? false) { json[r'timeZone'] = null; } } diff --git a/mobile/openapi/lib/model/sync_asset_v1.dart b/mobile/openapi/lib/model/sync_asset_v1.dart index 71dd5d7bed..a5d5dd36b1 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, - this.deletedAt = const None(), - this.fileCreatedAt = const None(), - this.fileModifiedAt = const None(), + required this.deletedAt, + required this.fileCreatedAt, + required this.fileModifiedAt, required this.id, required this.isFavorite, - this.localDateTime = const None(), + required this.localDateTime, required this.ownerId, - this.thumbhash = const None(), + required this.thumbhash, required this.type, required this.visibility, }); String checksum; - Option deletedAt; + Option? deletedAt; - Option fileCreatedAt; + Option? fileCreatedAt; - Option fileModifiedAt; + Option? fileModifiedAt; String id; bool isFavorite; - Option localDateTime; + Option? localDateTime; String ownerId; - Option thumbhash; + Option? thumbhash; SyncAssetV1TypeEnum type; @@ -66,14 +66,14 @@ class SyncAssetV1 { int get hashCode => // ignore: unnecessary_parenthesis (checksum.hashCode) + - (deletedAt.hashCode) + - (fileCreatedAt.hashCode) + - (fileModifiedAt.hashCode) + + (deletedAt == null ? 0 : deletedAt!.hashCode) + + (fileCreatedAt == null ? 0 : fileCreatedAt!.hashCode) + + (fileModifiedAt == null ? 0 : fileModifiedAt!.hashCode) + (id.hashCode) + (isFavorite.hashCode) + - (localDateTime.hashCode) + + (localDateTime == null ? 0 : localDateTime!.hashCode) + (ownerId.hashCode) + - (thumbhash.hashCode) + + (thumbhash == null ? 0 : thumbhash!.hashCode) + (type.hashCode) + (visibility.hashCode); @@ -83,41 +83,41 @@ class SyncAssetV1 { Map toJson() { final json = {}; json[r'checksum'] = this.checksum; - if (this.deletedAt.unwrapOrNull() != null) { - json[r'deletedAt'] = this.deletedAt.unwrap().toUtc().toIso8601String(); + if (this.deletedAt?.isSome ?? false) { + json[r'deletedAt'] = this.deletedAt!.unwrap().toUtc().toIso8601String(); } else { - if(this.deletedAt.isSome) { + if(this.deletedAt?.isNone ?? false) { json[r'deletedAt'] = null; } } - if (this.fileCreatedAt.unwrapOrNull() != null) { - json[r'fileCreatedAt'] = this.fileCreatedAt.unwrap().toUtc().toIso8601String(); + if (this.fileCreatedAt?.isSome ?? false) { + json[r'fileCreatedAt'] = this.fileCreatedAt!.unwrap().toUtc().toIso8601String(); } else { - if(this.fileCreatedAt.isSome) { + if(this.fileCreatedAt?.isNone ?? false) { json[r'fileCreatedAt'] = null; } } - if (this.fileModifiedAt.unwrapOrNull() != null) { - json[r'fileModifiedAt'] = this.fileModifiedAt.unwrap().toUtc().toIso8601String(); + if (this.fileModifiedAt?.isSome ?? false) { + json[r'fileModifiedAt'] = this.fileModifiedAt!.unwrap().toUtc().toIso8601String(); } else { - if(this.fileModifiedAt.isSome) { + if(this.fileModifiedAt?.isNone ?? false) { json[r'fileModifiedAt'] = null; } } json[r'id'] = this.id; json[r'isFavorite'] = this.isFavorite; - if (this.localDateTime.unwrapOrNull() != null) { - json[r'localDateTime'] = this.localDateTime.unwrap().toUtc().toIso8601String(); + if (this.localDateTime?.isSome ?? false) { + json[r'localDateTime'] = this.localDateTime!.unwrap().toUtc().toIso8601String(); } else { - if(this.localDateTime.isSome) { + if(this.localDateTime?.isNone ?? false) { json[r'localDateTime'] = null; } } json[r'ownerId'] = this.ownerId; - if (this.thumbhash.unwrapOrNull() != null) { + if (this.thumbhash?.isSome ?? false) { json[r'thumbhash'] = this.thumbhash; } else { - if(this.thumbhash.isSome) { + if(this.thumbhash?.isNone ?? false) { json[r'thumbhash'] = null; } } diff --git a/mobile/openapi/lib/model/sync_user_v1.dart b/mobile/openapi/lib/model/sync_user_v1.dart index 4623246590..1c3d4f7c2e 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({ - this.deletedAt = const None(), + required this.deletedAt, required this.email, required this.id, required this.name, }); - Option deletedAt; + Option? deletedAt; String email; @@ -37,7 +37,7 @@ class SyncUserV1 { @override int get hashCode => // ignore: unnecessary_parenthesis - (deletedAt.hashCode) + + (deletedAt == null ? 0 : deletedAt!.hashCode) + (email.hashCode) + (id.hashCode) + (name.hashCode); @@ -47,10 +47,10 @@ class SyncUserV1 { Map toJson() { final json = {}; - if (this.deletedAt.unwrapOrNull() != null) { - json[r'deletedAt'] = this.deletedAt.unwrap().toUtc().toIso8601String(); + if (this.deletedAt?.isSome ?? false) { + json[r'deletedAt'] = this.deletedAt!.unwrap().toUtc().toIso8601String(); } else { - if(this.deletedAt.isSome) { + if(this.deletedAt?.isNone ?? false) { json[r'deletedAt'] = null; } } diff --git a/mobile/openapi/lib/model/tag_create_dto.dart b/mobile/openapi/lib/model/tag_create_dto.dart index b99b2f01ad..fb31670f6a 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 = const None(), + this.parentId, }); /// @@ -28,7 +28,7 @@ class TagCreateDto { String name; - Option 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.hashCode); + (parentId == null ? 0 : parentId!.hashCode); @override String toString() => 'TagCreateDto[color=$color, name=$name, parentId=$parentId]'; @@ -54,10 +54,10 @@ class TagCreateDto { // json[r'color'] = null; } json[r'name'] = this.name; - if (this.parentId.unwrapOrNull() != null) { + if (this.parentId?.isSome ?? false) { json[r'parentId'] = this.parentId; } else { - if(this.parentId.isSome) { + if(this.parentId?.isNone ?? false) { json[r'parentId'] = null; } } diff --git a/mobile/openapi/lib/model/tag_update_dto.dart b/mobile/openapi/lib/model/tag_update_dto.dart index 93df8ab703..57ec3ca498 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 = const None(), + this.color, }); - Option color; + Option? color; @override bool operator ==(Object other) => identical(this, other) || other is TagUpdateDto && @@ -25,17 +25,17 @@ class TagUpdateDto { @override int get hashCode => // ignore: unnecessary_parenthesis - (color.hashCode); + (color == null ? 0 : color!.hashCode); @override String toString() => 'TagUpdateDto[color=$color]'; Map toJson() { final json = {}; - if (this.color.unwrapOrNull() != null) { + if (this.color?.isSome ?? false) { json[r'color'] = this.color; } else { - if(this.color.isSome) { + if(this.color?.isNone ?? false) { json[r'color'] = null; } } diff --git a/mobile/openapi/lib/model/update_asset_dto.dart b/mobile/openapi/lib/model/update_asset_dto.dart index e3a1237205..a4ef9fb0c5 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 = const None(), + this.livePhotoVideoId, this.longitude, this.rating, this.visibility, @@ -55,7 +55,7 @@ class UpdateAssetDto { /// num? latitude; - Option 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.hashCode) + + (livePhotoVideoId == null ? 0 : livePhotoVideoId!.hashCode) + (longitude == null ? 0 : longitude!.hashCode) + (rating == null ? 0 : rating!.hashCode) + (visibility == null ? 0 : visibility!.hashCode); @@ -131,10 +131,10 @@ class UpdateAssetDto { } else { // json[r'latitude'] = null; } - if (this.livePhotoVideoId.unwrapOrNull() != null) { + if (this.livePhotoVideoId?.isSome ?? false) { json[r'livePhotoVideoId'] = this.livePhotoVideoId; } else { - if(this.livePhotoVideoId.isSome) { + if(this.livePhotoVideoId?.isNone ?? false) { json[r'livePhotoVideoId'] = null; } } diff --git a/mobile/openapi/lib/model/usage_by_user_dto.dart b/mobile/openapi/lib/model/usage_by_user_dto.dart index 371081c440..af5e1a4aee 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, - this.quotaSizeInBytes = const None(), + required this.quotaSizeInBytes, required this.usage, required this.usagePhotos, required this.usageVideos, @@ -25,7 +25,7 @@ class UsageByUserDto { int photos; - Option quotaSizeInBytes; + Option? quotaSizeInBytes; int usage; @@ -54,7 +54,7 @@ class UsageByUserDto { int get hashCode => // ignore: unnecessary_parenthesis (photos.hashCode) + - (quotaSizeInBytes.hashCode) + + (quotaSizeInBytes == null ? 0 : quotaSizeInBytes!.hashCode) + (usage.hashCode) + (usagePhotos.hashCode) + (usageVideos.hashCode) + @@ -68,10 +68,10 @@ class UsageByUserDto { Map toJson() { final json = {}; json[r'photos'] = this.photos; - if (this.quotaSizeInBytes.unwrapOrNull() != null) { + if (this.quotaSizeInBytes?.isSome ?? false) { json[r'quotaSizeInBytes'] = this.quotaSizeInBytes; } else { - if(this.quotaSizeInBytes.isSome) { + if(this.quotaSizeInBytes?.isNone ?? false) { json[r'quotaSizeInBytes'] = null; } } diff --git a/mobile/openapi/lib/model/user_admin_create_dto.dart b/mobile/openapi/lib/model/user_admin_create_dto.dart index 9ade1798c4..3ff06347d0 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 = const None(), + this.avatarColor, required this.email, required this.name, this.notify, required this.password, - this.quotaSizeInBytes = const None(), + this.quotaSizeInBytes, this.shouldChangePassword, - this.storageLabel = const None(), + this.storageLabel, }); - Option avatarColor; + Option? avatarColor; String email; @@ -40,7 +40,7 @@ class UserAdminCreateDto { String password; /// Minimum value: 0 - Option quotaSizeInBytes; + Option? quotaSizeInBytes; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -50,7 +50,7 @@ class UserAdminCreateDto { /// bool? shouldChangePassword; - Option storageLabel; + Option? storageLabel; @override bool operator ==(Object other) => identical(this, other) || other is UserAdminCreateDto && @@ -66,24 +66,24 @@ class UserAdminCreateDto { @override int get hashCode => // ignore: unnecessary_parenthesis - (avatarColor.hashCode) + + (avatarColor == null ? 0 : avatarColor!.hashCode) + (email.hashCode) + (name.hashCode) + (notify == null ? 0 : notify!.hashCode) + (password.hashCode) + - (quotaSizeInBytes.hashCode) + + (quotaSizeInBytes == null ? 0 : quotaSizeInBytes!.hashCode) + (shouldChangePassword == null ? 0 : shouldChangePassword!.hashCode) + - (storageLabel.hashCode); + (storageLabel == null ? 0 : 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.unwrapOrNull() != null) { + if (this.avatarColor?.isSome ?? false) { json[r'avatarColor'] = this.avatarColor; } else { - if(this.avatarColor.isSome) { + if(this.avatarColor?.isNone ?? false) { json[r'avatarColor'] = null; } } @@ -95,10 +95,10 @@ class UserAdminCreateDto { // json[r'notify'] = null; } json[r'password'] = this.password; - if (this.quotaSizeInBytes.unwrapOrNull() != null) { + if (this.quotaSizeInBytes?.isSome ?? false) { json[r'quotaSizeInBytes'] = this.quotaSizeInBytes; } else { - if(this.quotaSizeInBytes.isSome) { + if(this.quotaSizeInBytes?.isNone ?? false) { json[r'quotaSizeInBytes'] = null; } } @@ -107,10 +107,10 @@ class UserAdminCreateDto { } else { // json[r'shouldChangePassword'] = null; } - if (this.storageLabel.unwrapOrNull() != null) { + if (this.storageLabel?.isSome ?? false) { json[r'storageLabel'] = this.storageLabel; } else { - if(this.storageLabel.isSome) { + if(this.storageLabel?.isNone ?? false) { json[r'storageLabel'] = null; } } diff --git a/mobile/openapi/lib/model/user_admin_response_dto.dart b/mobile/openapi/lib/model/user_admin_response_dto.dart index d3e9bfc2e1..01faf2a2ff 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, - this.deletedAt = const None(), + required this.deletedAt, required this.email, required this.id, required this.isAdmin, - this.license = const None(), + required this.license, required this.name, required this.oauthId, required this.profileChangedAt, required this.profileImagePath, - this.quotaSizeInBytes = const None(), - this.quotaUsageInBytes = const None(), + required this.quotaSizeInBytes, + required this.quotaUsageInBytes, required this.shouldChangePassword, required this.status, - this.storageLabel = const None(), + required this.storageLabel, required this.updatedAt, }); @@ -36,7 +36,7 @@ class UserAdminResponseDto { DateTime createdAt; - Option deletedAt; + Option? deletedAt; String email; @@ -44,7 +44,7 @@ class UserAdminResponseDto { bool isAdmin; - Option license; + Option? license; String name; @@ -54,15 +54,15 @@ class UserAdminResponseDto { String profileImagePath; - Option quotaSizeInBytes; + Option? quotaSizeInBytes; - Option quotaUsageInBytes; + Option? quotaUsageInBytes; bool shouldChangePassword; UserStatus status; - Option storageLabel; + Option? storageLabel; DateTime updatedAt; @@ -91,20 +91,20 @@ class UserAdminResponseDto { // ignore: unnecessary_parenthesis (avatarColor.hashCode) + (createdAt.hashCode) + - (deletedAt.hashCode) + + (deletedAt == null ? 0 : deletedAt!.hashCode) + (email.hashCode) + (id.hashCode) + (isAdmin.hashCode) + - (license.hashCode) + + (license == null ? 0 : license!.hashCode) + (name.hashCode) + (oauthId.hashCode) + (profileChangedAt.hashCode) + (profileImagePath.hashCode) + - (quotaSizeInBytes.hashCode) + - (quotaUsageInBytes.hashCode) + + (quotaSizeInBytes == null ? 0 : quotaSizeInBytes!.hashCode) + + (quotaUsageInBytes == null ? 0 : quotaUsageInBytes!.hashCode) + (shouldChangePassword.hashCode) + (status.hashCode) + - (storageLabel.hashCode) + + (storageLabel == null ? 0 : storageLabel!.hashCode) + (updatedAt.hashCode); @override @@ -114,20 +114,20 @@ class UserAdminResponseDto { final json = {}; json[r'avatarColor'] = this.avatarColor; json[r'createdAt'] = this.createdAt.toUtc().toIso8601String(); - if (this.deletedAt.unwrapOrNull() != null) { - json[r'deletedAt'] = this.deletedAt.unwrap().toUtc().toIso8601String(); + if (this.deletedAt?.isSome ?? false) { + json[r'deletedAt'] = this.deletedAt!.unwrap().toUtc().toIso8601String(); } else { - if(this.deletedAt.isSome) { + if(this.deletedAt?.isNone ?? false) { json[r'deletedAt'] = null; } } json[r'email'] = this.email; json[r'id'] = this.id; json[r'isAdmin'] = this.isAdmin; - if (this.license.unwrapOrNull() != null) { + if (this.license?.isSome ?? false) { json[r'license'] = this.license; } else { - if(this.license.isSome) { + if(this.license?.isNone ?? false) { json[r'license'] = null; } } @@ -135,26 +135,26 @@ class UserAdminResponseDto { json[r'oauthId'] = this.oauthId; json[r'profileChangedAt'] = this.profileChangedAt.toUtc().toIso8601String(); json[r'profileImagePath'] = this.profileImagePath; - if (this.quotaSizeInBytes.unwrapOrNull() != null) { + if (this.quotaSizeInBytes?.isSome ?? false) { json[r'quotaSizeInBytes'] = this.quotaSizeInBytes; } else { - if(this.quotaSizeInBytes.isSome) { + if(this.quotaSizeInBytes?.isNone ?? false) { json[r'quotaSizeInBytes'] = null; } } - if (this.quotaUsageInBytes.unwrapOrNull() != null) { + if (this.quotaUsageInBytes?.isSome ?? false) { json[r'quotaUsageInBytes'] = this.quotaUsageInBytes; } else { - if(this.quotaUsageInBytes.isSome) { + if(this.quotaUsageInBytes?.isNone ?? false) { json[r'quotaUsageInBytes'] = null; } } json[r'shouldChangePassword'] = this.shouldChangePassword; json[r'status'] = this.status; - if (this.storageLabel.unwrapOrNull() != null) { + if (this.storageLabel?.isSome ?? false) { json[r'storageLabel'] = this.storageLabel; } else { - if(this.storageLabel.isSome) { + if(this.storageLabel?.isNone ?? false) { json[r'storageLabel'] = null; } } diff --git a/mobile/openapi/lib/model/user_admin_update_dto.dart b/mobile/openapi/lib/model/user_admin_update_dto.dart index efe0ac25b4..66e1901b35 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 = const None(), + this.avatarColor, this.email, this.name, this.password, - this.pinCode = const None(), - this.quotaSizeInBytes = const None(), + this.pinCode, + this.quotaSizeInBytes, this.shouldChangePassword, - this.storageLabel = const None(), + this.storageLabel, }); - Option avatarColor; + Option? avatarColor; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -49,10 +49,10 @@ class UserAdminUpdateDto { /// String? password; - Option pinCode; + Option? pinCode; /// Minimum value: 0 - Option quotaSizeInBytes; + Option? quotaSizeInBytes; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -62,7 +62,7 @@ class UserAdminUpdateDto { /// bool? shouldChangePassword; - Option storageLabel; + Option? storageLabel; @override bool operator ==(Object other) => identical(this, other) || other is UserAdminUpdateDto && @@ -78,24 +78,24 @@ class UserAdminUpdateDto { @override int get hashCode => // ignore: unnecessary_parenthesis - (avatarColor.hashCode) + + (avatarColor == null ? 0 : avatarColor!.hashCode) + (email == null ? 0 : email!.hashCode) + (name == null ? 0 : name!.hashCode) + (password == null ? 0 : password!.hashCode) + - (pinCode.hashCode) + - (quotaSizeInBytes.hashCode) + + (pinCode == null ? 0 : pinCode!.hashCode) + + (quotaSizeInBytes == null ? 0 : quotaSizeInBytes!.hashCode) + (shouldChangePassword == null ? 0 : shouldChangePassword!.hashCode) + - (storageLabel.hashCode); + (storageLabel == null ? 0 : 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.unwrapOrNull() != null) { + if (this.avatarColor?.isSome ?? false) { json[r'avatarColor'] = this.avatarColor; } else { - if(this.avatarColor.isSome) { + if(this.avatarColor?.isNone ?? false) { json[r'avatarColor'] = null; } } @@ -114,17 +114,17 @@ class UserAdminUpdateDto { } else { // json[r'password'] = null; } - if (this.pinCode.unwrapOrNull() != null) { + if (this.pinCode?.isSome ?? false) { json[r'pinCode'] = this.pinCode; } else { - if(this.pinCode.isSome) { + if(this.pinCode?.isNone ?? false) { json[r'pinCode'] = null; } } - if (this.quotaSizeInBytes.unwrapOrNull() != null) { + if (this.quotaSizeInBytes?.isSome ?? false) { json[r'quotaSizeInBytes'] = this.quotaSizeInBytes; } else { - if(this.quotaSizeInBytes.isSome) { + if(this.quotaSizeInBytes?.isNone ?? false) { json[r'quotaSizeInBytes'] = null; } } @@ -133,10 +133,10 @@ class UserAdminUpdateDto { } else { // json[r'shouldChangePassword'] = null; } - if (this.storageLabel.unwrapOrNull() != null) { + if (this.storageLabel?.isSome ?? false) { json[r'storageLabel'] = this.storageLabel; } else { - if(this.storageLabel.isSome) { + if(this.storageLabel?.isNone ?? false) { json[r'storageLabel'] = null; } } diff --git a/mobile/openapi/lib/model/user_update_me_dto.dart b/mobile/openapi/lib/model/user_update_me_dto.dart index bc1247fbd2..b9d5135925 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 = const None(), + this.avatarColor, this.email, this.name, this.password, }); - Option 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.hashCode) + + (avatarColor == null ? 0 : avatarColor!.hashCode) + (email == null ? 0 : email!.hashCode) + (name == null ? 0 : name!.hashCode) + (password == null ? 0 : password!.hashCode); @@ -65,10 +65,10 @@ class UserUpdateMeDto { Map toJson() { final json = {}; - if (this.avatarColor.unwrapOrNull() != null) { + if (this.avatarColor?.isSome ?? false) { json[r'avatarColor'] = this.avatarColor; } else { - if(this.avatarColor.isSome) { + if(this.avatarColor?.isNone ?? false) { json[r'avatarColor'] = null; } } diff --git a/open-api/bin/generate-open-api.sh b/open-api/bin/generate-open-api.sh index 5daf252a84..e2badc6dff 100755 --- a/open-api/bin/generate-open-api.sh +++ b/open-api/bin/generate-open-api.sh @@ -13,9 +13,6 @@ function dart { wget -O api.mustache https://raw.githubusercontent.com/OpenAPITools/openapi-generator/$OPENAPI_GENERATOR_VERSION/modules/openapi-generator/src/main/resources/dart2/api.mustache patch --no-backup-if-mismatch -u api.mustache {{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}?{{/defaultValue}}{{/required}}{{/isNullable}} {{{name}}}; + {{#isNullable}}Option<{{/isNullable}}{{{datatypeWithEnum}}}{{#isNullable}}>?{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}?{{/defaultValue}}{{/required}}{{/isNullable}} {{{name}}}; {{/vars}} @override @@ -45,7 +45,7 @@ class {{{classname}}} { int get hashCode => // ignore: unnecessary_parenthesis {{#vars}} - ({{^isNullable}}{{^required}}{{^defaultValue}}{{{name}}} == null ? 0 : {{/defaultValue}}{{/required}}{{/isNullable}}{{{name}}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.hashCode){{^-last}} +{{/-last}}{{#-last}};{{/-last}} + ({{#isNullable}}{{{name}}} == null ? 0 : {{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}{{{name}}} == null ? 0 : {{/defaultValue}}{{/required}}{{/isNullable}}{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.hashCode){{^-last}} +{{/-last}}{{#-last}};{{/-last}} {{/vars}} @override @@ -55,7 +55,7 @@ class {{{classname}}} { final json = {}; {{#vars}} {{#isNullable}} - if (this.{{{name}}}.unwrapOrNull() != null) { + if (this.{{{name}}}?.isSome ?? false) { {{/isNullable}} {{^isNullable}} {{^required}} @@ -67,31 +67,31 @@ class {{{classname}}} { {{#isDateTime}} {{#pattern}} json[r'{{{baseName}}}'] = _isEpochMarker(r'{{{pattern}}}') - ? this.{{{name}}}{{#isNullable}}.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.millisecondsSinceEpoch - : this.{{{name}}}{{#isNullable}}.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc().toIso8601String(); + ? this.{{{name}}}{{#isNullable}}!.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.millisecondsSinceEpoch + : this.{{{name}}}{{#isNullable}}!.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc().toIso8601String(); {{/pattern}} {{^pattern}} - json[r'{{{baseName}}}'] = this.{{{name}}}{{#isNullable}}.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc().toIso8601String(); + json[r'{{{baseName}}}'] = this.{{{name}}}{{#isNullable}}!.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc().toIso8601String(); {{/pattern}} {{/isDateTime}} {{#isDate}} {{#pattern}} json[r'{{{baseName}}}'] = _isEpochMarker(r'{{{pattern}}}') - ? this.{{{name}}}{{#isNullable}}.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.millisecondsSinceEpoch - : _dateFormatter.format(this.{{{name}}}{{#isNullable}}.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc()); + ? this.{{{name}}}{{#isNullable}}!.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.millisecondsSinceEpoch + : _dateFormatter.format(this.{{{name}}}{{#isNullable}}!.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc()); {{/pattern}} {{^pattern}} - json[r'{{{baseName}}}'] = _dateFormatter.format(this.{{{name}}}{{#isNullable}}.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc()); + json[r'{{{baseName}}}'] = _dateFormatter.format(this.{{{name}}}{{#isNullable}}!.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc()); {{/pattern}} {{/isDate}} {{^isDateTime}} {{^isDate}} - json[r'{{{baseName}}}'] = this.{{{name}}}{{#isArray}}{{#uniqueItems}}{{#isNullable}}.unwrap(){{/isNullable}}.toList(growable: false){{/uniqueItems}}{{/isArray}}; + json[r'{{{baseName}}}'] = this.{{{name}}}{{#isArray}}{{#uniqueItems}}{{#isNullable}}!.unwrap(){{/isNullable}}.toList(growable: false){{/uniqueItems}}{{/isArray}}; {{/isDate}} {{/isDateTime}} {{#isNullable}} } else { - if(this.{{{name}}}.isSome) { + if(this.{{{name}}}?.isNone ?? false) { json[r'{{{baseName}}}'] = null; } } diff --git a/open-api/templates/mobile/serialization/native/native_class.mustache.patch b/open-api/templates/mobile/serialization/native/native_class.mustache.patch index be6cbba45a..4ba338eeb1 100644 --- a/open-api/templates/mobile/serialization/native/native_class.mustache.patch +++ b/open-api/templates/mobile/serialization/native/native_class.mustache.patch @@ -1,5 +1,5 @@ diff --git a/native_class.mustache b/native_class.mustache -index 3a6c457..e321056 100644 +index 3a6c457..b1c8c5b 100644 --- a/native_class.mustache +++ b/native_class.mustache @@ -32,7 +32,7 @@ class {{{classname}}} { @@ -7,25 +7,16 @@ index 3a6c457..e321056 100644 {{/isNullable}} {{/isEnum}} - {{{datatypeWithEnum}}}{{#isNullable}}?{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}?{{/defaultValue}}{{/required}}{{/isNullable}} {{{name}}}; -+ {{#isNullable}}Option<{{/isNullable}}{{{datatypeWithEnum}}}{{#isNullable}}>{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}?{{/defaultValue}}{{/required}}{{/isNullable}} {{{name}}}; ++ {{#isNullable}}Option<{{/isNullable}}{{{datatypeWithEnum}}}{{#isNullable}}>?{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}?{{/defaultValue}}{{/required}}{{/isNullable}} {{{name}}}; {{/vars}} - @override -@@ -45,7 +45,7 @@ class {{{classname}}} { - int get hashCode => - // ignore: unnecessary_parenthesis - {{#vars}} -- ({{#isNullable}}{{{name}}} == null ? 0 : {{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}{{{name}}} == null ? 0 : {{/defaultValue}}{{/required}}{{/isNullable}}{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.hashCode){{^-last}} +{{/-last}}{{#-last}};{{/-last}} -+ ({{^isNullable}}{{^required}}{{^defaultValue}}{{{name}}} == null ? 0 : {{/defaultValue}}{{/required}}{{/isNullable}}{{{name}}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.hashCode){{^-last}} +{{/-last}}{{#-last}};{{/-last}} - {{/vars}} - @override @@ -55,7 +55,7 @@ class {{{classname}}} { final json = {}; {{#vars}} {{#isNullable}} - if (this.{{{name}}} != null) { -+ if (this.{{{name}}}.unwrapOrNull() != null) { ++ if (this.{{{name}}}?.isSome ?? false) { {{/isNullable}} {{^isNullable}} {{^required}} @@ -35,12 +26,12 @@ index 3a6c457..e321056 100644 json[r'{{{baseName}}}'] = _isEpochMarker(r'{{{pattern}}}') - ? this.{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.millisecondsSinceEpoch - : this.{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc().toIso8601String(); -+ ? this.{{{name}}}{{#isNullable}}.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.millisecondsSinceEpoch -+ : this.{{{name}}}{{#isNullable}}.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc().toIso8601String(); ++ ? this.{{{name}}}{{#isNullable}}!.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.millisecondsSinceEpoch ++ : this.{{{name}}}{{#isNullable}}!.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc().toIso8601String(); {{/pattern}} {{^pattern}} - json[r'{{{baseName}}}'] = this.{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc().toIso8601String(); -+ json[r'{{{baseName}}}'] = this.{{{name}}}{{#isNullable}}.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc().toIso8601String(); ++ json[r'{{{baseName}}}'] = this.{{{name}}}{{#isNullable}}!.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc().toIso8601String(); {{/pattern}} {{/isDateTime}} {{#isDate}} @@ -48,24 +39,24 @@ index 3a6c457..e321056 100644 json[r'{{{baseName}}}'] = _isEpochMarker(r'{{{pattern}}}') - ? this.{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.millisecondsSinceEpoch - : _dateFormatter.format(this.{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc()); -+ ? this.{{{name}}}{{#isNullable}}.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.millisecondsSinceEpoch -+ : _dateFormatter.format(this.{{{name}}}{{#isNullable}}.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc()); ++ ? this.{{{name}}}{{#isNullable}}!.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.millisecondsSinceEpoch ++ : _dateFormatter.format(this.{{{name}}}{{#isNullable}}!.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc()); {{/pattern}} {{^pattern}} - json[r'{{{baseName}}}'] = _dateFormatter.format(this.{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc()); -+ json[r'{{{baseName}}}'] = _dateFormatter.format(this.{{{name}}}{{#isNullable}}.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc()); ++ json[r'{{{baseName}}}'] = _dateFormatter.format(this.{{{name}}}{{#isNullable}}!.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc()); {{/pattern}} {{/isDate}} {{^isDateTime}} {{^isDate}} - json[r'{{{baseName}}}'] = this.{{{name}}}{{#isArray}}{{#uniqueItems}}{{#isNullable}}!{{/isNullable}}.toList(growable: false){{/uniqueItems}}{{/isArray}}; -+ json[r'{{{baseName}}}'] = this.{{{name}}}{{#isArray}}{{#uniqueItems}}{{#isNullable}}.unwrap(){{/isNullable}}.toList(growable: false){{/uniqueItems}}{{/isArray}}; ++ json[r'{{{baseName}}}'] = this.{{{name}}}{{#isArray}}{{#uniqueItems}}{{#isNullable}}!.unwrap(){{/isNullable}}.toList(growable: false){{/uniqueItems}}{{/isArray}}; {{/isDate}} {{/isDateTime}} {{#isNullable}} } else { - json[r'{{{baseName}}}'] = null; -+ if(this.{{{name}}}.isSome) { ++ if(this.{{{name}}}?.isNone ?? false) { + json[r'{{{baseName}}}'] = null; + } }