feat(mobile): add three-state field serialization (#27231)

* bump to v7.22.0 and update patching

* gen client

* migrate mobile call sites
pull/28696/merge
Timon 2026-06-03 14:13:17 +02:00 committed by GitHub
parent 1bb7517da0
commit 96d521e149
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
161 changed files with 3531 additions and 3369 deletions

View File

@ -18,11 +18,11 @@ extension DTOToAsset on api.AssetResponseDto {
height: height?.toInt(), height: height?.toInt(),
width: width?.toInt(), width: width?.toInt(),
isFavorite: isFavorite, isFavorite: isFavorite,
livePhotoVideoId: livePhotoVideoId, livePhotoVideoId: livePhotoVideoId.orElse(null),
thumbHash: thumbhash, thumbHash: thumbhash,
localId: null, localId: null,
type: type.toAssetType(), type: type.toAssetType(),
stackId: stack?.id, stackId: stack.orElse(null)?.id,
isEdited: isEdited, isEdited: isEdited,
); );
} }
@ -41,13 +41,13 @@ extension DTOToAsset on api.AssetResponseDto {
height: height?.toInt(), height: height?.toInt(),
width: width?.toInt(), width: width?.toInt(),
isFavorite: isFavorite, isFavorite: isFavorite,
livePhotoVideoId: livePhotoVideoId, livePhotoVideoId: livePhotoVideoId.orElse(null),
thumbHash: thumbhash, thumbHash: thumbhash,
localId: null, localId: null,
type: type.toAssetType(), type: type.toAssetType(),
stackId: stack?.id, stackId: stack.orElse(null)?.id,
isEdited: isEdited, isEdited: isEdited,
exifInfo: exifInfo != null ? ExifDtoConverter.fromDto(exifInfo!) : const ExifInfo(), exifInfo: exifInfo.orElse(null) != null ? ExifDtoConverter.fromDto(exifInfo.orElse(null)!) : const ExifInfo(),
); );
} }
} }

View File

@ -20,50 +20,64 @@ class SearchApiRepository extends ApiRepository {
(filter.assetId != null && filter.assetId!.isNotEmpty)) { (filter.assetId != null && filter.assetId!.isNotEmpty)) {
return _api.searchSmart( return _api.searchSmart(
SmartSearchDto( SmartSearchDto(
query: filter.context, query: filter.context == null ? const Optional.absent() : Optional.present(filter.context!),
queryAssetId: filter.assetId, queryAssetId: filter.assetId == null ? const Optional.absent() : Optional.present(filter.assetId!),
language: filter.language, language: filter.language == null ? const Optional.absent() : Optional.present(filter.language!),
country: filter.location.country, country: filter.location.country == null
state: filter.location.state, ? const Optional.absent()
city: filter.location.city, : Optional.present(filter.location.country!),
make: filter.camera.make, state: filter.location.state == null ? const Optional.absent() : Optional.present(filter.location.state!),
model: filter.camera.model, city: filter.location.city == null ? const Optional.absent() : Optional.present(filter.location.city!),
takenAfter: filter.date.takenAfter, make: filter.camera.make == null ? const Optional.absent() : Optional.present(filter.camera.make!),
takenBefore: filter.date.takenBefore, model: filter.camera.model == null ? const Optional.absent() : Optional.present(filter.camera.model!),
visibility: filter.display.isArchive ? AssetVisibility.archive : AssetVisibility.timeline, takenAfter: filter.date.takenAfter == null
rating: filter.rating.rating, ? const Optional.absent()
isFavorite: filter.display.isFavorite ? true : null, : Optional.present(filter.date.takenAfter!),
isNotInAlbum: filter.display.isNotInAlbum ? true : null, takenBefore: filter.date.takenBefore == null
personIds: filter.people.map((e) => e.id).toList(), ? const Optional.absent()
tagIds: filter.tagIds, : Optional.present(filter.date.takenBefore!),
type: type, visibility: Optional.present(filter.display.isArchive ? AssetVisibility.archive : AssetVisibility.timeline),
page: page, rating: filter.rating.rating == null ? const Optional.absent() : Optional.present(filter.rating.rating!),
size: 100, isFavorite: filter.display.isFavorite ? const Optional.present(true) : const Optional.absent(),
isNotInAlbum: filter.display.isNotInAlbum ? const Optional.present(true) : const Optional.absent(),
personIds: Optional.present(filter.people.map((e) => e.id).toList()),
tagIds: filter.tagIds == null ? const Optional.absent() : Optional.present(filter.tagIds!),
type: type == null ? const Optional.absent() : Optional.present(type),
page: Optional.present(page),
size: const Optional.present(100),
), ),
); );
} }
return _api.searchAssets( return _api.searchAssets(
MetadataSearchDto( MetadataSearchDto(
originalFileName: filter.filename != null && filter.filename!.isNotEmpty ? filter.filename : null, originalFileName: filter.filename != null && filter.filename!.isNotEmpty
country: filter.location.country, ? Optional.present(filter.filename!)
description: filter.description != null && filter.description!.isNotEmpty ? filter.description : null, : const Optional.absent(),
ocr: filter.ocr != null && filter.ocr!.isNotEmpty ? filter.ocr : null, country: filter.location.country == null ? const Optional.absent() : Optional.present(filter.location.country!),
state: filter.location.state, description: filter.description != null && filter.description!.isNotEmpty
city: filter.location.city, ? Optional.present(filter.description!)
make: filter.camera.make, : const Optional.absent(),
model: filter.camera.model, ocr: filter.ocr != null && filter.ocr!.isNotEmpty ? Optional.present(filter.ocr!) : const Optional.absent(),
takenAfter: filter.date.takenAfter, state: filter.location.state == null ? const Optional.absent() : Optional.present(filter.location.state!),
takenBefore: filter.date.takenBefore, city: filter.location.city == null ? const Optional.absent() : Optional.present(filter.location.city!),
visibility: filter.display.isArchive ? AssetVisibility.archive : AssetVisibility.timeline, make: filter.camera.make == null ? const Optional.absent() : Optional.present(filter.camera.make!),
rating: filter.rating.rating, model: filter.camera.model == null ? const Optional.absent() : Optional.present(filter.camera.model!),
isFavorite: filter.display.isFavorite ? true : null, takenAfter: filter.date.takenAfter == null
isNotInAlbum: filter.display.isNotInAlbum ? true : null, ? const Optional.absent()
personIds: filter.people.map((e) => e.id).toList(), : Optional.present(filter.date.takenAfter!),
tagIds: filter.tagIds, takenBefore: filter.date.takenBefore == null
type: type, ? const Optional.absent()
page: page, : Optional.present(filter.date.takenBefore!),
size: 1000, visibility: Optional.present(filter.display.isArchive ? AssetVisibility.archive : AssetVisibility.timeline),
rating: filter.rating.rating == null ? const Optional.absent() : Optional.present(filter.rating.rating!),
isFavorite: filter.display.isFavorite ? const Optional.present(true) : const Optional.absent(),
isNotInAlbum: filter.display.isNotInAlbum ? const Optional.present(true) : const Optional.absent(),
personIds: Optional.present(filter.people.map((e) => e.id).toList()),
tagIds: filter.tagIds == null ? const Optional.absent() : Optional.present(filter.tagIds!),
type: type == null ? const Optional.absent() : Optional.present(type),
page: Optional.present(page),
size: const Optional.present(1000),
), ),
); );
} }

View File

@ -20,7 +20,7 @@ class SyncApiRepository {
} }
Future<void> deleteSyncAck(List<SyncEntityType> types) { Future<void> deleteSyncAck(List<SyncEntityType> types) {
return _api.syncApi.deleteSyncAck(SyncAckDeleteDto(types: types)); return _api.syncApi.deleteSyncAck(SyncAckDeleteDto(types: Optional.present(types)));
} }
Future<void> streamChanges( Future<void> streamChanges(

View File

@ -91,7 +91,7 @@ class SyncStreamRepository extends DriftDatabaseRepository {
email: Value(user.email), email: Value(user.email),
hasProfileImage: Value(user.hasProfileImage), hasProfileImage: Value(user.hasProfileImage),
profileChangedAt: Value(user.profileChangedAt), profileChangedAt: Value(user.profileChangedAt),
avatarColor: Value(user.avatarColor?.toAvatarColor() ?? AvatarColor.primary), avatarColor: Value(user.avatarColor.orElse(null)?.toAvatarColor() ?? AvatarColor.primary),
isAdmin: Value(user.isAdmin), isAdmin: Value(user.isAdmin),
pinCode: Value(user.pinCode), pinCode: Value(user.pinCode),
quotaSizeInBytes: Value(user.quotaSizeInBytes ?? 0), quotaSizeInBytes: Value(user.quotaSizeInBytes ?? 0),
@ -133,7 +133,7 @@ class SyncStreamRepository extends DriftDatabaseRepository {
email: Value(user.email), email: Value(user.email),
hasProfileImage: Value(user.hasProfileImage), hasProfileImage: Value(user.hasProfileImage),
profileChangedAt: Value(user.profileChangedAt), profileChangedAt: Value(user.profileChangedAt),
avatarColor: Value(user.avatarColor?.toAvatarColor() ?? AvatarColor.primary), avatarColor: Value(user.avatarColor.orElse(null)?.toAvatarColor() ?? AvatarColor.primary),
); );
batch.insert(_db.userEntity, companion.copyWith(id: Value(user.id)), onConflict: DoUpdate((_) => companion)); batch.insert(_db.userEntity, companion.copyWith(id: Value(user.id)), onConflict: DoUpdate((_) => companion));

View File

@ -5,24 +5,24 @@ import 'package:openapi/api.dart';
abstract final class ExifDtoConverter { abstract final class ExifDtoConverter {
static ExifInfo fromDto(ExifResponseDto dto) { static ExifInfo fromDto(ExifResponseDto dto) {
return ExifInfo( return ExifInfo(
fileSize: dto.fileSizeInByte, fileSize: dto.fileSizeInByte.orElse(null),
description: dto.description, description: dto.description.orElse(null),
orientation: dto.orientation, orientation: dto.orientation.orElse(null),
timeZone: dto.timeZone, timeZone: dto.timeZone.orElse(null),
dateTimeOriginal: dto.dateTimeOriginal, dateTimeOriginal: dto.dateTimeOriginal.orElse(null),
isFlipped: isOrientationFlipped(dto.orientation), isFlipped: isOrientationFlipped(dto.orientation.orElse(null)),
latitude: dto.latitude?.toDouble(), latitude: dto.latitude.orElse(null)?.toDouble(),
longitude: dto.longitude?.toDouble(), longitude: dto.longitude.orElse(null)?.toDouble(),
city: dto.city, city: dto.city.orElse(null),
state: dto.state, state: dto.state.orElse(null),
country: dto.country, country: dto.country.orElse(null),
make: dto.make, make: dto.make.orElse(null),
model: dto.model, model: dto.model.orElse(null),
lens: dto.lensModel, lens: dto.lensModel.orElse(null),
f: dto.fNumber?.toDouble(), f: dto.fNumber.orElse(null)?.toDouble(),
mm: dto.focalLength?.toDouble(), mm: dto.focalLength.orElse(null)?.toDouble(),
iso: dto.iso?.toInt(), iso: dto.iso.orElse(null)?.toInt(),
exposureSeconds: exposureTimeToSeconds(dto.exposureTime), exposureSeconds: exposureTimeToSeconds(dto.exposureTime.orElse(null)),
); );
} }

View File

@ -40,7 +40,7 @@ abstract final class UserConverter {
updatedAt: DateTime.now(), updatedAt: DateTime.now(),
avatarColor: dto.avatarColor.toAvatarColor(), avatarColor: dto.avatarColor.toAvatarColor(),
memoryEnabled: false, memoryEnabled: false,
inTimeline: dto.inTimeline ?? false, inTimeline: dto.inTimeline.orElse(null) ?? false,
isPartnerSharedBy: false, isPartnerSharedBy: false,
isPartnerSharedWith: false, isPartnerSharedWith: false,
profileChangedAt: dto.profileChangedAt, profileChangedAt: dto.profileChangedAt,

View File

@ -73,10 +73,10 @@ class SharedLink {
slug = dto.slug, slug = dto.slug,
type = dto.type == SharedLinkType.ALBUM ? SharedLinkSource.album : SharedLinkSource.individual, type = dto.type == SharedLinkType.ALBUM ? SharedLinkSource.album : SharedLinkSource.individual,
title = dto.type == SharedLinkType.ALBUM title = dto.type == SharedLinkType.ALBUM
? dto.album?.albumName.toUpperCase() ?? "UNKNOWN SHARE" ? dto.album.orElse(null)?.albumName.toUpperCase() ?? "UNKNOWN SHARE"
: "INDIVIDUAL SHARE", : "INDIVIDUAL SHARE",
thumbAssetId = dto.type == SharedLinkType.ALBUM thumbAssetId = dto.type == SharedLinkType.ALBUM
? dto.album?.albumThumbnailAssetId ? dto.album.orElse(null)?.albumThumbnailAssetId
: dto.assets.isNotEmpty : dto.assets.isNotEmpty
? dto.assets[0].id ? dto.assets[0].id
: null; : null;

View File

@ -29,7 +29,7 @@ final getAllPlacesProvider = FutureProvider.autoDispose<List<SearchCuratedConten
} }
final curatedContent = assetPlaces final curatedContent = assetPlaces
.map((data) => SearchCuratedContent(label: data.exifInfo!.city!, id: data.id)) .map((data) => SearchCuratedContent(label: data.exifInfo.orElse(null)!.city.orElse(null)!, id: data.id))
.toList(); .toList();
return curatedContent; return curatedContent;

View File

@ -23,8 +23,8 @@ class ActivityApiRepository extends ApiRepository {
final dto = ActivityCreateDto( final dto = ActivityCreateDto(
albumId: albumId, albumId: albumId,
type: type == ActivityType.comment ? ReactionType.comment : ReactionType.like, type: type == ActivityType.comment ? ReactionType.comment : ReactionType.like,
assetId: assetId, assetId: assetId == null ? const Optional.absent() : Optional.present(assetId),
comment: comment, comment: comment == null ? const Optional.absent() : Optional.present(comment),
); );
final response = await checkNull(_api.createActivity(dto)); final response = await checkNull(_api.createActivity(dto));
return _toActivity(response); return _toActivity(response);
@ -45,6 +45,6 @@ class ActivityApiRepository extends ApiRepository {
type: dto.type == ReactionType.comment ? ActivityType.comment : ActivityType.like, type: dto.type == ReactionType.comment ? ActivityType.comment : ActivityType.like,
user: UserConverter.fromSimpleUserDto(dto.user), user: UserConverter.fromSimpleUserDto(dto.user),
assetId: dto.assetId, assetId: dto.assetId,
comment: dto.comment, comment: dto.comment.orElse(null),
); );
} }

View File

@ -24,7 +24,7 @@ class AssetApiRepository extends ApiRepository {
AssetApiRepository(this._api, this._stacksApi, this._trashApi); AssetApiRepository(this._api, this._stacksApi, this._trashApi);
Future<void> delete(List<String> ids, bool force) async { Future<void> delete(List<String> ids, bool force) async {
return _api.deleteAssets(AssetBulkDeleteDto(ids: ids, force: force)); return _api.deleteAssets(AssetBulkDeleteDto(ids: ids, force: Optional.present(force)));
} }
Future<void> restoreTrash(List<String> ids) async { Future<void> restoreTrash(List<String> ids) async {
@ -42,19 +42,27 @@ class AssetApiRepository extends ApiRepository {
} }
Future<void> updateVisibility(List<String> ids, AssetVisibilityEnum visibility) async { Future<void> updateVisibility(List<String> ids, AssetVisibilityEnum visibility) async {
return _api.updateAssets(AssetBulkUpdateDto(ids: ids, visibility: _mapVisibility(visibility))); return _api.updateAssets(AssetBulkUpdateDto(ids: ids, visibility: Optional.present(_mapVisibility(visibility))));
} }
Future<void> updateFavorite(List<String> ids, bool isFavorite) async { Future<void> updateFavorite(List<String> ids, bool isFavorite) async {
return _api.updateAssets(AssetBulkUpdateDto(ids: ids, isFavorite: isFavorite)); return _api.updateAssets(AssetBulkUpdateDto(ids: ids, isFavorite: Optional.present(isFavorite)));
} }
Future<void> updateLocation(List<String> ids, LatLng location) async { Future<void> updateLocation(List<String> ids, LatLng location) async {
return _api.updateAssets(AssetBulkUpdateDto(ids: ids, latitude: location.latitude, longitude: location.longitude)); return _api.updateAssets(
AssetBulkUpdateDto(
ids: ids,
latitude: Optional.present(location.latitude),
longitude: Optional.present(location.longitude),
),
);
} }
Future<void> updateDateTime(List<String> ids, DateTime dateTime) async { Future<void> updateDateTime(List<String> ids, DateTime dateTime) async {
return _api.updateAssets(AssetBulkUpdateDto(ids: ids, dateTimeOriginal: dateTime.toIso8601String())); return _api.updateAssets(
AssetBulkUpdateDto(ids: ids, dateTimeOriginal: Optional.present(dateTime.toIso8601String())),
);
} }
Future<StackResponse> stack(List<String> ids) async { Future<StackResponse> stack(List<String> ids) async {
@ -82,15 +90,15 @@ class AssetApiRepository extends ApiRepository {
final response = await checkNull(_api.getAssetInfo(assetId)); final response = await checkNull(_api.getAssetInfo(assetId));
// we need to get the MIME of the thumbnail once that gets added to the API // we need to get the MIME of the thumbnail once that gets added to the API
return response.originalMimeType; return response.originalMimeType.orElse(null);
} }
Future<void> updateDescription(String assetId, String description) { Future<void> updateDescription(String assetId, String description) {
return _api.updateAsset(assetId, UpdateAssetDto(description: description)); return _api.updateAsset(assetId, UpdateAssetDto(description: Optional.present(description)));
} }
Future<void> updateRating(String assetId, int rating) { Future<void> updateRating(String assetId, int rating) {
return _api.updateAsset(assetId, UpdateAssetDto(rating: rating)); return _api.updateAsset(assetId, UpdateAssetDto(rating: Optional.present(rating)));
} }
Future<AssetEditsResponseDto?> editAsset(String assetId, List<AssetEdit> edits) { Future<AssetEditsResponseDto?> editAsset(String assetId, List<AssetEdit> edits) {

View File

@ -13,7 +13,7 @@ class AuthApiRepository extends ApiRepository {
AuthApiRepository(this._apiService); AuthApiRepository(this._apiService);
Future<void> changePassword(String newPassword) async { Future<void> changePassword(String newPassword) async {
await _apiService.usersApi.updateMyUser(UserUpdateMeDto(password: newPassword)); await _apiService.usersApi.updateMyUser(UserUpdateMeDto(password: Optional.present(newPassword)));
} }
Future<LoginResponse> login(String email, String password) async { Future<LoginResponse> login(String email, String password) async {
@ -46,7 +46,7 @@ class AuthApiRepository extends ApiRepository {
Future<bool> unlockPinCode(String pinCode) async { Future<bool> unlockPinCode(String pinCode) async {
try { try {
await _apiService.authenticationApi.unlockAuthSession(SessionUnlockDto(pinCode: pinCode)); await _apiService.authenticationApi.unlockAuthSession(SessionUnlockDto(pinCode: Optional.present(pinCode)));
return true; return true;
} catch (_) { } catch (_) {
return false; return false;

View File

@ -22,7 +22,13 @@ class DriftAlbumApiRepository extends ApiRepository {
String? description, String? description,
}) async { }) async {
final responseDto = await checkNull( final responseDto = await checkNull(
_api.createAlbum(CreateAlbumDto(albumName: name, description: description, assetIds: assetIds.toList())), _api.createAlbum(
CreateAlbumDto(
albumName: name,
description: description == null ? const Optional.absent() : Optional.present(description),
assetIds: Optional.present(assetIds.toList()),
),
),
); );
return responseDto.toRemoteAlbum(owner); return responseDto.toRemoteAlbum(owner);
@ -73,11 +79,13 @@ class DriftAlbumApiRepository extends ApiRepository {
_api.updateAlbumInfo( _api.updateAlbumInfo(
albumId, albumId,
UpdateAlbumDto( UpdateAlbumDto(
albumName: name, albumName: name == null ? const Optional.absent() : Optional.present(name),
description: description, description: description == null ? const Optional.absent() : Optional.present(description),
albumThumbnailAssetId: thumbnailAssetId, albumThumbnailAssetId: thumbnailAssetId == null
isActivityEnabled: isActivityEnabled, ? const Optional.absent()
order: apiOrder, : Optional.present(thumbnailAssetId),
isActivityEnabled: isActivityEnabled == null ? const Optional.absent() : Optional.present(isActivityEnabled),
order: apiOrder == null ? const Optional.absent() : Optional.present(apiOrder),
), ),
), ),
); );
@ -99,7 +107,9 @@ class DriftAlbumApiRepository extends ApiRepository {
} }
Future<bool> setActivityStatus(String albumId, bool isEnabled) async { Future<bool> setActivityStatus(String albumId, bool isEnabled) async {
final response = await checkNull(_api.updateAlbumInfo(albumId, UpdateAlbumDto(isActivityEnabled: isEnabled))); final response = await checkNull(
_api.updateAlbumInfo(albumId, UpdateAlbumDto(isActivityEnabled: Optional.present(isEnabled))),
);
return response.isActivityEnabled; return response.isActivityEnabled;
} }
} }
@ -116,7 +126,7 @@ extension on AlbumResponseDto {
updatedAt: updatedAt, updatedAt: updatedAt,
thumbnailAssetId: albumThumbnailAssetId, thumbnailAssetId: albumThumbnailAssetId,
isActivityEnabled: isActivityEnabled, isActivityEnabled: isActivityEnabled,
order: order == AssetOrder.asc ? AlbumAssetOrder.asc : AlbumAssetOrder.desc, order: order.orElse(null) == AssetOrder.asc ? AlbumAssetOrder.asc : AlbumAssetOrder.desc,
assetCount: assetCount, assetCount: assetCount,
isShared: albumUsers.length > 2, isShared: albumUsers.length > 2,
); );

View File

@ -16,7 +16,7 @@ class PartnerApiRepository extends ApiRepository {
Future<List<UserDto>> getAll(Direction direction) async { Future<List<UserDto>> getAll(Direction direction) async {
final response = await checkNull( final response = await checkNull(
_api.getPartners(direction == Direction.sharedByMe ? PartnerDirection.by : PartnerDirection.with_), _api.getPartners(direction == Direction.sharedByMe ? PartnerDirection.sharedBy : PartnerDirection.sharedWith),
); );
return response.map(UserConverter.fromPartnerDto).toList(); return response.map(UserConverter.fromPartnerDto).toList();
} }

View File

@ -18,7 +18,10 @@ class PersonApiRepository extends ApiRepository {
Future<PersonDto> update(String id, {String? name, DateTime? birthday}) async { Future<PersonDto> update(String id, {String? name, DateTime? birthday}) async {
final birthdayUtc = birthday == null ? null : DateTime.utc(birthday.year, birthday.month, birthday.day); final birthdayUtc = birthday == null ? null : DateTime.utc(birthday.year, birthday.month, birthday.day);
final dto = PersonUpdateDto(name: name, birthDate: birthdayUtc); final dto = PersonUpdateDto(
name: name == null ? const Optional.absent() : Optional.present(name),
birthDate: birthdayUtc == null ? const Optional.absent() : Optional.present(birthdayUtc),
);
final response = await checkNull(_api.updatePerson(id, dto)); final response = await checkNull(_api.updatePerson(id, dto));
return _toPerson(response); return _toPerson(response);
} }

View File

@ -15,7 +15,13 @@ class SessionsAPIRepository extends ApiRepository {
Future<SessionCreateResponse> createSession(String deviceType, String deviceOS, {int? duration}) async { Future<SessionCreateResponse> createSession(String deviceType, String deviceOS, {int? duration}) async {
final dto = await checkNull( final dto = await checkNull(
_api.createSession(SessionCreateDto(deviceType: deviceType, deviceOS: deviceOS, duration: duration)), _api.createSession(
SessionCreateDto(
deviceType: Optional.present(deviceType),
deviceOS: Optional.present(deviceOS),
duration: duration == null ? const Optional.absent() : Optional.present(duration),
),
),
); );
return SessionCreateResponse( return SessionCreateResponse(
@ -23,7 +29,7 @@ class SessionsAPIRepository extends ApiRepository {
current: dto.current, current: dto.current,
deviceType: deviceType, deviceType: deviceType,
deviceOS: deviceOS, deviceOS: deviceOS,
expiresAt: dto.expiresAt, expiresAt: dto.expiresAt.orElse(null),
createdAt: dto.createdAt, createdAt: dto.createdAt,
updatedAt: dto.updatedAt, updatedAt: dto.updatedAt,
token: dto.token, token: dto.token,

View File

@ -55,7 +55,7 @@ class LockedGuard extends AutoRouteGuard {
return; return;
} }
await _apiService.authenticationApi.unlockAuthSession(SessionUnlockDto(pinCode: securePinCode)); await _apiService.authenticationApi.unlockAuthSession(SessionUnlockDto(pinCode: Optional.present(securePinCode)));
resolver.next(true); resolver.next(true);
} on PlatformException catch (error) { } on PlatformException catch (error) {

View File

@ -18,7 +18,11 @@ class OAuthService {
log.info("Starting OAuth flow with redirect URI: $redirectUri"); log.info("Starting OAuth flow with redirect URI: $redirectUri");
final dto = await _apiService.oAuthApi.startOAuth( final dto = await _apiService.oAuthApi.startOAuth(
OAuthConfigDto(redirectUri: redirectUri, state: state, codeChallenge: codeChallenge), OAuthConfigDto(
redirectUri: redirectUri,
state: Optional.present(state),
codeChallenge: Optional.present(codeChallenge),
),
); );
final authUrl = dto?.url; final authUrl = dto?.url;
@ -37,7 +41,7 @@ class OAuthService {
} }
return await _apiService.oAuthApi.finishOAuth( return await _apiService.oAuthApi.finishOAuth(
OAuthCallbackDto(url: result, state: state, codeVerifier: codeVerifier), OAuthCallbackDto(url: result, state: Optional.present(state), codeVerifier: Optional.present(codeVerifier)),
); );
} }
} }

View File

@ -48,26 +48,26 @@ class SharedLinkService {
if (type == SharedLinkType.ALBUM) { if (type == SharedLinkType.ALBUM) {
dto = SharedLinkCreateDto( dto = SharedLinkCreateDto(
type: type, type: type,
albumId: albumId, albumId: albumId == null ? const Optional.absent() : Optional.present(albumId),
showMetadata: showMeta, showMetadata: Optional.present(showMeta),
allowDownload: allowDownload, allowDownload: Optional.present(allowDownload),
allowUpload: allowUpload, allowUpload: Optional.present(allowUpload),
expiresAt: expiresAt, expiresAt: expiresAt == null ? const Optional.absent() : Optional.present(expiresAt),
description: description, description: description == null ? const Optional.absent() : Optional.present(description),
password: password, password: password == null ? const Optional.absent() : Optional.present(password),
slug: slug, slug: slug == null ? const Optional.absent() : Optional.present(slug),
); );
} else if (assetIds != null) { } else if (assetIds != null) {
dto = SharedLinkCreateDto( dto = SharedLinkCreateDto(
type: type, type: type,
showMetadata: showMeta, showMetadata: Optional.present(showMeta),
allowDownload: allowDownload, allowDownload: Optional.present(allowDownload),
allowUpload: allowUpload, allowUpload: Optional.present(allowUpload),
expiresAt: expiresAt, expiresAt: expiresAt == null ? const Optional.absent() : Optional.present(expiresAt),
description: description, description: description == null ? const Optional.absent() : Optional.present(description),
password: password, password: password == null ? const Optional.absent() : Optional.present(password),
slug: slug, slug: slug == null ? const Optional.absent() : Optional.present(slug),
assetIds: assetIds, assetIds: Optional.present(assetIds),
); );
} }
@ -98,14 +98,14 @@ class SharedLinkService {
final responseDto = await _apiService.sharedLinksApi.updateSharedLink( final responseDto = await _apiService.sharedLinksApi.updateSharedLink(
id, id,
SharedLinkEditDto( SharedLinkEditDto(
showMetadata: showMeta, showMetadata: showMeta == null ? const Optional.absent() : Optional.present(showMeta),
allowDownload: allowDownload, allowDownload: allowDownload == null ? const Optional.absent() : Optional.present(allowDownload),
allowUpload: allowUpload, allowUpload: allowUpload == null ? const Optional.absent() : Optional.present(allowUpload),
expiresAt: expiresAt, expiresAt: expiresAt == null ? const Optional.absent() : Optional.present(expiresAt),
description: description, description: description == null ? const Optional.absent() : Optional.present(description),
password: password, password: password == null ? const Optional.absent() : Optional.present(password),
slug: slug, slug: slug == null ? const Optional.absent() : Optional.present(slug),
changeExpiryTime: changeExpiry, changeExpiryTime: changeExpiry == null ? const Optional.absent() : Optional.present(changeExpiry),
), ),
); );
if (responseDto != null) { if (responseDto != null) {

View File

@ -1 +1 @@
7.8.0 7.22.0

View File

@ -4,7 +4,7 @@ Immich API
This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
- API version: 3.0.0 - API version: 3.0.0
- Generator version: 7.8.0 - Generator version: 7.22.0
- Build package: org.openapitools.codegen.languages.DartClientCodegen - Build package: org.openapitools.codegen.languages.DartClientCodegen
## Requirements ## Requirements

View File

@ -29,6 +29,7 @@ part 'auth/api_key_auth.dart';
part 'auth/oauth.dart'; part 'auth/oauth.dart';
part 'auth/http_basic_auth.dart'; part 'auth/http_basic_auth.dart';
part 'auth/http_bearer_auth.dart'; part 'auth/http_bearer_auth.dart';
part 'optional.dart';
part 'api/api_keys_api.dart'; part 'api/api_keys_api.dart';
part 'api/activities_api.dart'; part 'api/activities_api.dart';

View File

@ -226,6 +226,9 @@ Future<String> _decodeBodyBytes(Response response) async {
/// Returns a valid [T] value found at the specified Map [key], null otherwise. /// Returns a valid [T] value found at the specified Map [key], null otherwise.
T? mapValueOfType<T>(dynamic map, String key) { T? mapValueOfType<T>(dynamic map, String key) {
final dynamic value = map is Map ? map[key] : null; final dynamic value = map is Map ? map[key] : null;
if (T == double && value is int) {
return value.toDouble() as T;
}
return value is T ? value : null; return value is T ? value : null;
} }

View File

@ -14,8 +14,8 @@ class ActivityCreateDto {
/// Returns a new [ActivityCreateDto] instance. /// Returns a new [ActivityCreateDto] instance.
ActivityCreateDto({ ActivityCreateDto({
required this.albumId, required this.albumId,
this.assetId, this.assetId = const Optional.absent(),
this.comment, this.comment = const Optional.absent(),
required this.type, required this.type,
}); });
@ -29,7 +29,7 @@ class ActivityCreateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? assetId; Optional<String?> assetId;
/// Comment text (required if type is comment) /// Comment text (required if type is comment)
/// ///
@ -38,7 +38,7 @@ class ActivityCreateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? comment; Optional<String?> comment;
ReactionType type; ReactionType type;
@ -63,15 +63,13 @@ class ActivityCreateDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
json[r'albumId'] = this.albumId; json[r'albumId'] = this.albumId;
if (this.assetId != null) { if (this.assetId.isPresent) {
json[r'assetId'] = this.assetId; final value = this.assetId.value;
} else { json[r'assetId'] = value;
// json[r'assetId'] = null;
} }
if (this.comment != null) { if (this.comment.isPresent) {
json[r'comment'] = this.comment; final value = this.comment.value;
} else { json[r'comment'] = value;
// json[r'comment'] = null;
} }
json[r'type'] = this.type; json[r'type'] = this.type;
return json; return json;
@ -87,8 +85,8 @@ class ActivityCreateDto {
return ActivityCreateDto( return ActivityCreateDto(
albumId: mapValueOfType<String>(json, r'albumId')!, albumId: mapValueOfType<String>(json, r'albumId')!,
assetId: mapValueOfType<String>(json, r'assetId'), assetId: json.containsKey(r'assetId') ? Optional.present(mapValueOfType<String>(json, r'assetId')) : const Optional.absent(),
comment: mapValueOfType<String>(json, r'comment'), comment: json.containsKey(r'comment') ? Optional.present(mapValueOfType<String>(json, r'comment')) : const Optional.absent(),
type: ReactionType.fromJson(json[r'type'])!, type: ReactionType.fromJson(json[r'type'])!,
); );
} }

View File

@ -14,7 +14,7 @@ class ActivityResponseDto {
/// Returns a new [ActivityResponseDto] instance. /// Returns a new [ActivityResponseDto] instance.
ActivityResponseDto({ ActivityResponseDto({
required this.assetId, required this.assetId,
this.comment, this.comment = const Optional.absent(),
required this.createdAt, required this.createdAt,
required this.id, required this.id,
required this.type, required this.type,
@ -25,7 +25,7 @@ class ActivityResponseDto {
String? assetId; String? assetId;
/// Comment text (for comment activities) /// Comment text (for comment activities)
String? comment; Optional<String?> comment;
/// Creation date /// Creation date
DateTime createdAt; DateTime createdAt;
@ -64,12 +64,11 @@ class ActivityResponseDto {
if (this.assetId != null) { if (this.assetId != null) {
json[r'assetId'] = this.assetId; json[r'assetId'] = this.assetId;
} else { } else {
// json[r'assetId'] = null; json[r'assetId'] = null;
} }
if (this.comment != null) { if (this.comment.isPresent) {
json[r'comment'] = this.comment; final value = this.comment.value;
} else { json[r'comment'] = value;
// json[r'comment'] = null;
} }
json[r'createdAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') json[r'createdAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
? this.createdAt.millisecondsSinceEpoch ? this.createdAt.millisecondsSinceEpoch
@ -90,7 +89,7 @@ class ActivityResponseDto {
return ActivityResponseDto( return ActivityResponseDto(
assetId: mapValueOfType<String>(json, r'assetId'), assetId: mapValueOfType<String>(json, r'assetId'),
comment: mapValueOfType<String>(json, r'comment'), comment: json.containsKey(r'comment') ? Optional.present(mapValueOfType<String>(json, r'comment')) : const Optional.absent(),
createdAt: mapDateTime(json, r'createdAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')!, createdAt: mapDateTime(json, r'createdAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')!,
id: mapValueOfType<String>(json, r'id')!, id: mapValueOfType<String>(json, r'id')!,
type: ReactionType.fromJson(json[r'type'])!, type: ReactionType.fromJson(json[r'type'])!,

View File

@ -17,17 +17,17 @@ class AlbumResponseDto {
required this.albumThumbnailAssetId, required this.albumThumbnailAssetId,
this.albumUsers = const [], this.albumUsers = const [],
required this.assetCount, required this.assetCount,
this.contributorCounts = const [], this.contributorCounts = const Optional.present(const []),
required this.createdAt, required this.createdAt,
required this.description, required this.description,
this.endDate, this.endDate = const Optional.absent(),
required this.hasSharedLink, required this.hasSharedLink,
required this.id, required this.id,
required this.isActivityEnabled, required this.isActivityEnabled,
this.lastModifiedAssetTimestamp, this.lastModifiedAssetTimestamp = const Optional.absent(),
this.order, this.order = const Optional.absent(),
required this.shared, required this.shared,
this.startDate, this.startDate = const Optional.absent(),
required this.updatedAt, required this.updatedAt,
}); });
@ -46,7 +46,7 @@ class AlbumResponseDto {
/// Maximum value: 9007199254740991 /// Maximum value: 9007199254740991
int assetCount; int assetCount;
List<ContributorCountResponseDto> contributorCounts; Optional<List<ContributorCountResponseDto>?> contributorCounts;
/// Creation date /// Creation date
DateTime createdAt; DateTime createdAt;
@ -61,7 +61,7 @@ class AlbumResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? endDate; Optional<DateTime?> endDate;
/// Has shared link /// Has shared link
bool hasSharedLink; bool hasSharedLink;
@ -79,7 +79,7 @@ class AlbumResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? lastModifiedAssetTimestamp; Optional<DateTime?> lastModifiedAssetTimestamp;
/// ///
/// Please note: This property should have been non-nullable! Since the specification file /// Please note: This property should have been non-nullable! Since the specification file
@ -87,7 +87,7 @@ class AlbumResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
AssetOrder? order; Optional<AssetOrder?> order;
/// Is shared album /// Is shared album
bool shared; bool shared;
@ -99,7 +99,7 @@ class AlbumResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? startDate; Optional<DateTime?> startDate;
/// Last update date /// Last update date
DateTime updatedAt; DateTime updatedAt;
@ -152,36 +152,35 @@ class AlbumResponseDto {
if (this.albumThumbnailAssetId != null) { if (this.albumThumbnailAssetId != null) {
json[r'albumThumbnailAssetId'] = this.albumThumbnailAssetId; json[r'albumThumbnailAssetId'] = this.albumThumbnailAssetId;
} else { } else {
// json[r'albumThumbnailAssetId'] = null; json[r'albumThumbnailAssetId'] = null;
} }
json[r'albumUsers'] = this.albumUsers; json[r'albumUsers'] = this.albumUsers;
json[r'assetCount'] = this.assetCount; json[r'assetCount'] = this.assetCount;
json[r'contributorCounts'] = this.contributorCounts; if (this.contributorCounts.isPresent) {
final value = this.contributorCounts.value;
json[r'contributorCounts'] = value;
}
json[r'createdAt'] = this.createdAt.toUtc().toIso8601String(); json[r'createdAt'] = this.createdAt.toUtc().toIso8601String();
json[r'description'] = this.description; json[r'description'] = this.description;
if (this.endDate != null) { if (this.endDate.isPresent) {
json[r'endDate'] = this.endDate!.toUtc().toIso8601String(); final value = this.endDate.value;
} else { json[r'endDate'] = value == null ? null : value.toUtc().toIso8601String();
// json[r'endDate'] = null;
} }
json[r'hasSharedLink'] = this.hasSharedLink; json[r'hasSharedLink'] = this.hasSharedLink;
json[r'id'] = this.id; json[r'id'] = this.id;
json[r'isActivityEnabled'] = this.isActivityEnabled; json[r'isActivityEnabled'] = this.isActivityEnabled;
if (this.lastModifiedAssetTimestamp != null) { if (this.lastModifiedAssetTimestamp.isPresent) {
json[r'lastModifiedAssetTimestamp'] = this.lastModifiedAssetTimestamp!.toUtc().toIso8601String(); final value = this.lastModifiedAssetTimestamp.value;
} else { json[r'lastModifiedAssetTimestamp'] = value == null ? null : value.toUtc().toIso8601String();
// json[r'lastModifiedAssetTimestamp'] = null;
} }
if (this.order != null) { if (this.order.isPresent) {
json[r'order'] = this.order; final value = this.order.value;
} else { json[r'order'] = value;
// json[r'order'] = null;
} }
json[r'shared'] = this.shared; json[r'shared'] = this.shared;
if (this.startDate != null) { if (this.startDate.isPresent) {
json[r'startDate'] = this.startDate!.toUtc().toIso8601String(); final value = this.startDate.value;
} else { json[r'startDate'] = value == null ? null : value.toUtc().toIso8601String();
// json[r'startDate'] = null;
} }
json[r'updatedAt'] = this.updatedAt.toUtc().toIso8601String(); json[r'updatedAt'] = this.updatedAt.toUtc().toIso8601String();
return json; return json;
@ -200,17 +199,17 @@ class AlbumResponseDto {
albumThumbnailAssetId: mapValueOfType<String>(json, r'albumThumbnailAssetId'), albumThumbnailAssetId: mapValueOfType<String>(json, r'albumThumbnailAssetId'),
albumUsers: AlbumUserResponseDto.listFromJson(json[r'albumUsers']), albumUsers: AlbumUserResponseDto.listFromJson(json[r'albumUsers']),
assetCount: mapValueOfType<int>(json, r'assetCount')!, assetCount: mapValueOfType<int>(json, r'assetCount')!,
contributorCounts: ContributorCountResponseDto.listFromJson(json[r'contributorCounts']), contributorCounts: json.containsKey(r'contributorCounts') ? Optional.present(ContributorCountResponseDto.listFromJson(json[r'contributorCounts'])) : const Optional.absent(),
createdAt: mapDateTime(json, r'createdAt', r'')!, createdAt: mapDateTime(json, r'createdAt', r'')!,
description: mapValueOfType<String>(json, r'description')!, description: mapValueOfType<String>(json, r'description')!,
endDate: mapDateTime(json, r'endDate', r''), endDate: json.containsKey(r'endDate') ? Optional.present(mapDateTime(json, r'endDate', r'')) : const Optional.absent(),
hasSharedLink: mapValueOfType<bool>(json, r'hasSharedLink')!, hasSharedLink: mapValueOfType<bool>(json, r'hasSharedLink')!,
id: mapValueOfType<String>(json, r'id')!, id: mapValueOfType<String>(json, r'id')!,
isActivityEnabled: mapValueOfType<bool>(json, r'isActivityEnabled')!, isActivityEnabled: mapValueOfType<bool>(json, r'isActivityEnabled')!,
lastModifiedAssetTimestamp: mapDateTime(json, r'lastModifiedAssetTimestamp', r''), lastModifiedAssetTimestamp: json.containsKey(r'lastModifiedAssetTimestamp') ? Optional.present(mapDateTime(json, r'lastModifiedAssetTimestamp', r'')) : const Optional.absent(),
order: AssetOrder.fromJson(json[r'order']), order: json.containsKey(r'order') ? Optional.present(AssetOrder.fromJson(json[r'order'])) : const Optional.absent(),
shared: mapValueOfType<bool>(json, r'shared')!, shared: mapValueOfType<bool>(json, r'shared')!,
startDate: mapDateTime(json, r'startDate', r''), startDate: json.containsKey(r'startDate') ? Optional.present(mapDateTime(json, r'startDate', r'')) : const Optional.absent(),
updatedAt: mapDateTime(json, r'updatedAt', r'')!, updatedAt: mapDateTime(json, r'updatedAt', r'')!,
); );
} }

View File

@ -13,7 +13,7 @@ part of openapi.api;
class AlbumUserAddDto { class AlbumUserAddDto {
/// Returns a new [AlbumUserAddDto] instance. /// Returns a new [AlbumUserAddDto] instance.
AlbumUserAddDto({ AlbumUserAddDto({
this.role, this.role = const Optional.absent(),
required this.userId, required this.userId,
}); });
@ -23,7 +23,7 @@ class AlbumUserAddDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
AlbumUserRole? role; Optional<AlbumUserRole?> role;
/// User ID /// User ID
String userId; String userId;
@ -44,10 +44,9 @@ class AlbumUserAddDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.role != null) { if (this.role.isPresent) {
json[r'role'] = this.role; final value = this.role.value;
} else { json[r'role'] = value;
// json[r'role'] = null;
} }
json[r'userId'] = this.userId; json[r'userId'] = this.userId;
return json; return json;
@ -62,7 +61,7 @@ class AlbumUserAddDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return AlbumUserAddDto( return AlbumUserAddDto(
role: AlbumUserRole.fromJson(json[r'role']), role: json.containsKey(r'role') ? Optional.present(AlbumUserRole.fromJson(json[r'role'])) : const Optional.absent(),
userId: mapValueOfType<String>(json, r'userId')!, userId: mapValueOfType<String>(json, r'userId')!,
); );
} }

View File

@ -13,7 +13,7 @@ part of openapi.api;
class AlbumsAddAssetsResponseDto { class AlbumsAddAssetsResponseDto {
/// Returns a new [AlbumsAddAssetsResponseDto] instance. /// Returns a new [AlbumsAddAssetsResponseDto] instance.
AlbumsAddAssetsResponseDto({ AlbumsAddAssetsResponseDto({
this.error, this.error = const Optional.absent(),
required this.success, required this.success,
}); });
@ -23,7 +23,7 @@ class AlbumsAddAssetsResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
BulkIdErrorReason? error; Optional<BulkIdErrorReason?> error;
/// Operation success /// Operation success
bool success; bool success;
@ -44,10 +44,9 @@ class AlbumsAddAssetsResponseDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.error != null) { if (this.error.isPresent) {
json[r'error'] = this.error; final value = this.error.value;
} else { json[r'error'] = value;
// json[r'error'] = null;
} }
json[r'success'] = this.success; json[r'success'] = this.success;
return json; return json;
@ -62,7 +61,7 @@ class AlbumsAddAssetsResponseDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return AlbumsAddAssetsResponseDto( return AlbumsAddAssetsResponseDto(
error: BulkIdErrorReason.fromJson(json[r'error']), error: json.containsKey(r'error') ? Optional.present(BulkIdErrorReason.fromJson(json[r'error'])) : const Optional.absent(),
success: mapValueOfType<bool>(json, r'success')!, success: mapValueOfType<bool>(json, r'success')!,
); );
} }

View File

@ -13,7 +13,7 @@ part of openapi.api;
class AlbumsUpdate { class AlbumsUpdate {
/// Returns a new [AlbumsUpdate] instance. /// Returns a new [AlbumsUpdate] instance.
AlbumsUpdate({ AlbumsUpdate({
this.defaultAssetOrder, this.defaultAssetOrder = const Optional.absent(),
}); });
/// ///
@ -22,7 +22,7 @@ class AlbumsUpdate {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
AssetOrder? defaultAssetOrder; Optional<AssetOrder?> defaultAssetOrder;
@override @override
bool operator ==(Object other) => identical(this, other) || other is AlbumsUpdate && bool operator ==(Object other) => identical(this, other) || other is AlbumsUpdate &&
@ -38,10 +38,9 @@ class AlbumsUpdate {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.defaultAssetOrder != null) { if (this.defaultAssetOrder.isPresent) {
json[r'defaultAssetOrder'] = this.defaultAssetOrder; final value = this.defaultAssetOrder.value;
} else { json[r'defaultAssetOrder'] = value;
// json[r'defaultAssetOrder'] = null;
} }
return json; return json;
} }
@ -55,7 +54,7 @@ class AlbumsUpdate {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return AlbumsUpdate( return AlbumsUpdate(
defaultAssetOrder: AssetOrder.fromJson(json[r'defaultAssetOrder']), defaultAssetOrder: json.containsKey(r'defaultAssetOrder') ? Optional.present(AssetOrder.fromJson(json[r'defaultAssetOrder'])) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -13,7 +13,7 @@ part of openapi.api;
class ApiKeyCreateDto { class ApiKeyCreateDto {
/// Returns a new [ApiKeyCreateDto] instance. /// Returns a new [ApiKeyCreateDto] instance.
ApiKeyCreateDto({ ApiKeyCreateDto({
this.name, this.name = const Optional.absent(),
this.permissions = const [], this.permissions = const [],
}); });
@ -24,7 +24,7 @@ class ApiKeyCreateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? name; Optional<String?> name;
/// List of permissions /// List of permissions
List<Permission> permissions; List<Permission> permissions;
@ -45,10 +45,9 @@ class ApiKeyCreateDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.name != null) { if (this.name.isPresent) {
json[r'name'] = this.name; final value = this.name.value;
} else { json[r'name'] = value;
// json[r'name'] = null;
} }
json[r'permissions'] = this.permissions; json[r'permissions'] = this.permissions;
return json; return json;
@ -63,7 +62,7 @@ class ApiKeyCreateDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return ApiKeyCreateDto( return ApiKeyCreateDto(
name: mapValueOfType<String>(json, r'name'), name: json.containsKey(r'name') ? Optional.present(mapValueOfType<String>(json, r'name')) : const Optional.absent(),
permissions: Permission.listFromJson(json[r'permissions']), permissions: Permission.listFromJson(json[r'permissions']),
); );
} }

View File

@ -13,8 +13,8 @@ part of openapi.api;
class ApiKeyUpdateDto { class ApiKeyUpdateDto {
/// Returns a new [ApiKeyUpdateDto] instance. /// Returns a new [ApiKeyUpdateDto] instance.
ApiKeyUpdateDto({ ApiKeyUpdateDto({
this.name, this.name = const Optional.absent(),
this.permissions = const [], this.permissions = const Optional.present(const []),
}); });
/// API key name /// API key name
@ -24,10 +24,10 @@ class ApiKeyUpdateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? name; Optional<String?> name;
/// List of permissions /// List of permissions
List<Permission> permissions; Optional<List<Permission>?> permissions;
@override @override
bool operator ==(Object other) => identical(this, other) || other is ApiKeyUpdateDto && bool operator ==(Object other) => identical(this, other) || other is ApiKeyUpdateDto &&
@ -45,12 +45,14 @@ class ApiKeyUpdateDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.name != null) { if (this.name.isPresent) {
json[r'name'] = this.name; final value = this.name.value;
} else { json[r'name'] = value;
// json[r'name'] = null; }
if (this.permissions.isPresent) {
final value = this.permissions.value;
json[r'permissions'] = value;
} }
json[r'permissions'] = this.permissions;
return json; return json;
} }
@ -63,8 +65,8 @@ class ApiKeyUpdateDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return ApiKeyUpdateDto( return ApiKeyUpdateDto(
name: mapValueOfType<String>(json, r'name'), name: json.containsKey(r'name') ? Optional.present(mapValueOfType<String>(json, r'name')) : const Optional.absent(),
permissions: Permission.listFromJson(json[r'permissions']), permissions: json.containsKey(r'permissions') ? Optional.present(Permission.listFromJson(json[r'permissions'])) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -13,7 +13,7 @@ part of openapi.api;
class AssetBulkDeleteDto { class AssetBulkDeleteDto {
/// Returns a new [AssetBulkDeleteDto] instance. /// Returns a new [AssetBulkDeleteDto] instance.
AssetBulkDeleteDto({ AssetBulkDeleteDto({
this.force, this.force = const Optional.absent(),
this.ids = const [], this.ids = const [],
}); });
@ -24,7 +24,7 @@ class AssetBulkDeleteDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? force; Optional<bool?> force;
/// IDs to process /// IDs to process
List<String> ids; List<String> ids;
@ -45,10 +45,9 @@ class AssetBulkDeleteDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.force != null) { if (this.force.isPresent) {
json[r'force'] = this.force; final value = this.force.value;
} else { json[r'force'] = value;
// json[r'force'] = null;
} }
json[r'ids'] = this.ids; json[r'ids'] = this.ids;
return json; return json;
@ -63,7 +62,7 @@ class AssetBulkDeleteDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return AssetBulkDeleteDto( return AssetBulkDeleteDto(
force: mapValueOfType<bool>(json, r'force'), force: json.containsKey(r'force') ? Optional.present(mapValueOfType<bool>(json, r'force')) : const Optional.absent(),
ids: json[r'ids'] is Iterable ids: json[r'ids'] is Iterable
? (json[r'ids'] as Iterable).cast<String>().toList(growable: false) ? (json[r'ids'] as Iterable).cast<String>().toList(growable: false)
: const [], : const [],

View File

@ -13,17 +13,17 @@ part of openapi.api;
class AssetBulkUpdateDto { class AssetBulkUpdateDto {
/// Returns a new [AssetBulkUpdateDto] instance. /// Returns a new [AssetBulkUpdateDto] instance.
AssetBulkUpdateDto({ AssetBulkUpdateDto({
this.dateTimeOriginal, this.dateTimeOriginal = const Optional.absent(),
this.dateTimeRelative, this.dateTimeRelative = const Optional.absent(),
this.description, this.description = const Optional.absent(),
this.duplicateId, this.duplicateId = const Optional.absent(),
this.ids = const [], this.ids = const [],
this.isFavorite, this.isFavorite = const Optional.absent(),
this.latitude, this.latitude = const Optional.absent(),
this.longitude, this.longitude = const Optional.absent(),
this.rating, this.rating = const Optional.absent(),
this.timeZone, this.timeZone = const Optional.absent(),
this.visibility, this.visibility = const Optional.absent(),
}); });
/// Original date and time /// Original date and time
@ -33,7 +33,7 @@ class AssetBulkUpdateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? dateTimeOriginal; Optional<String?> dateTimeOriginal;
/// Relative time offset in seconds /// Relative time offset in seconds
/// ///
@ -45,7 +45,7 @@ class AssetBulkUpdateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
int? dateTimeRelative; Optional<int?> dateTimeRelative;
/// Asset description /// Asset description
/// ///
@ -54,10 +54,10 @@ class AssetBulkUpdateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? description; Optional<String?> description;
/// Duplicate ID /// Duplicate ID
String? duplicateId; Optional<String?> duplicateId;
/// Asset IDs to update /// Asset IDs to update
List<String> ids; List<String> ids;
@ -69,7 +69,7 @@ class AssetBulkUpdateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? isFavorite; Optional<bool?> isFavorite;
/// Latitude coordinate /// Latitude coordinate
/// ///
@ -81,7 +81,7 @@ class AssetBulkUpdateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
num? latitude; Optional<num?> latitude;
/// Longitude coordinate /// Longitude coordinate
/// ///
@ -93,13 +93,13 @@ class AssetBulkUpdateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
num? longitude; Optional<num?> longitude;
/// Rating in range [1-5], or null for unrated /// Rating in range [1-5], or null for unrated
/// ///
/// Minimum value: -1 /// Minimum value: -1
/// Maximum value: 5 /// Maximum value: 5
int? rating; Optional<int?> rating;
/// Time zone (IANA timezone) /// Time zone (IANA timezone)
/// ///
@ -108,7 +108,7 @@ class AssetBulkUpdateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? timeZone; Optional<String?> timeZone;
/// ///
/// Please note: This property should have been non-nullable! Since the specification file /// Please note: This property should have been non-nullable! Since the specification file
@ -116,7 +116,7 @@ class AssetBulkUpdateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
AssetVisibility? visibility; Optional<AssetVisibility?> visibility;
@override @override
bool operator ==(Object other) => identical(this, other) || other is AssetBulkUpdateDto && bool operator ==(Object other) => identical(this, other) || other is AssetBulkUpdateDto &&
@ -152,56 +152,46 @@ class AssetBulkUpdateDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.dateTimeOriginal != null) { if (this.dateTimeOriginal.isPresent) {
json[r'dateTimeOriginal'] = this.dateTimeOriginal; final value = this.dateTimeOriginal.value;
} else { json[r'dateTimeOriginal'] = value;
// json[r'dateTimeOriginal'] = null;
} }
if (this.dateTimeRelative != null) { if (this.dateTimeRelative.isPresent) {
json[r'dateTimeRelative'] = this.dateTimeRelative; final value = this.dateTimeRelative.value;
} else { json[r'dateTimeRelative'] = value;
// json[r'dateTimeRelative'] = null;
} }
if (this.description != null) { if (this.description.isPresent) {
json[r'description'] = this.description; final value = this.description.value;
} else { json[r'description'] = value;
// json[r'description'] = null;
} }
if (this.duplicateId != null) { if (this.duplicateId.isPresent) {
json[r'duplicateId'] = this.duplicateId; final value = this.duplicateId.value;
} else { json[r'duplicateId'] = value;
// json[r'duplicateId'] = null;
} }
json[r'ids'] = this.ids; json[r'ids'] = this.ids;
if (this.isFavorite != null) { if (this.isFavorite.isPresent) {
json[r'isFavorite'] = this.isFavorite; final value = this.isFavorite.value;
} else { json[r'isFavorite'] = value;
// json[r'isFavorite'] = null;
} }
if (this.latitude != null) { if (this.latitude.isPresent) {
json[r'latitude'] = this.latitude; final value = this.latitude.value;
} else { json[r'latitude'] = value;
// json[r'latitude'] = null;
} }
if (this.longitude != null) { if (this.longitude.isPresent) {
json[r'longitude'] = this.longitude; final value = this.longitude.value;
} else { json[r'longitude'] = value;
// json[r'longitude'] = null;
} }
if (this.rating != null) { if (this.rating.isPresent) {
json[r'rating'] = this.rating; final value = this.rating.value;
} else { json[r'rating'] = value;
// json[r'rating'] = null;
} }
if (this.timeZone != null) { if (this.timeZone.isPresent) {
json[r'timeZone'] = this.timeZone; final value = this.timeZone.value;
} else { json[r'timeZone'] = value;
// json[r'timeZone'] = null;
} }
if (this.visibility != null) { if (this.visibility.isPresent) {
json[r'visibility'] = this.visibility; final value = this.visibility.value;
} else { json[r'visibility'] = value;
// json[r'visibility'] = null;
} }
return json; return json;
} }
@ -215,19 +205,19 @@ class AssetBulkUpdateDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return AssetBulkUpdateDto( return AssetBulkUpdateDto(
dateTimeOriginal: mapValueOfType<String>(json, r'dateTimeOriginal'), dateTimeOriginal: json.containsKey(r'dateTimeOriginal') ? Optional.present(mapValueOfType<String>(json, r'dateTimeOriginal')) : const Optional.absent(),
dateTimeRelative: mapValueOfType<int>(json, r'dateTimeRelative'), dateTimeRelative: json.containsKey(r'dateTimeRelative') ? Optional.present(json[r'dateTimeRelative'] == null ? null : int.parse('${json[r'dateTimeRelative']}')) : const Optional.absent(),
description: mapValueOfType<String>(json, r'description'), description: json.containsKey(r'description') ? Optional.present(mapValueOfType<String>(json, r'description')) : const Optional.absent(),
duplicateId: mapValueOfType<String>(json, r'duplicateId'), duplicateId: json.containsKey(r'duplicateId') ? Optional.present(mapValueOfType<String>(json, r'duplicateId')) : const Optional.absent(),
ids: json[r'ids'] is Iterable ids: json[r'ids'] is Iterable
? (json[r'ids'] as Iterable).cast<String>().toList(growable: false) ? (json[r'ids'] as Iterable).cast<String>().toList(growable: false)
: const [], : const [],
isFavorite: mapValueOfType<bool>(json, r'isFavorite'), isFavorite: json.containsKey(r'isFavorite') ? Optional.present(mapValueOfType<bool>(json, r'isFavorite')) : const Optional.absent(),
latitude: num.parse('${json[r'latitude']}'), latitude: json.containsKey(r'latitude') ? Optional.present(json[r'latitude'] == null ? null : num.parse('${json[r'latitude']}')) : const Optional.absent(),
longitude: num.parse('${json[r'longitude']}'), longitude: json.containsKey(r'longitude') ? Optional.present(json[r'longitude'] == null ? null : num.parse('${json[r'longitude']}')) : const Optional.absent(),
rating: mapValueOfType<int>(json, r'rating'), rating: json.containsKey(r'rating') ? Optional.present(json[r'rating'] == null ? null : int.parse('${json[r'rating']}')) : const Optional.absent(),
timeZone: mapValueOfType<String>(json, r'timeZone'), timeZone: json.containsKey(r'timeZone') ? Optional.present(mapValueOfType<String>(json, r'timeZone')) : const Optional.absent(),
visibility: AssetVisibility.fromJson(json[r'visibility']), visibility: json.containsKey(r'visibility') ? Optional.present(AssetVisibility.fromJson(json[r'visibility'])) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -14,10 +14,10 @@ class AssetBulkUploadCheckResult {
/// Returns a new [AssetBulkUploadCheckResult] instance. /// Returns a new [AssetBulkUploadCheckResult] instance.
AssetBulkUploadCheckResult({ AssetBulkUploadCheckResult({
required this.action, required this.action,
this.assetId, this.assetId = const Optional.absent(),
required this.id, required this.id,
this.isTrashed, this.isTrashed = const Optional.absent(),
this.reason, this.reason = const Optional.absent(),
}); });
AssetUploadAction action; AssetUploadAction action;
@ -29,7 +29,7 @@ class AssetBulkUploadCheckResult {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? assetId; Optional<String?> assetId;
/// Asset ID /// Asset ID
String id; String id;
@ -41,7 +41,7 @@ class AssetBulkUploadCheckResult {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? isTrashed; Optional<bool?> isTrashed;
/// ///
/// Please note: This property should have been non-nullable! Since the specification file /// Please note: This property should have been non-nullable! Since the specification file
@ -49,7 +49,7 @@ class AssetBulkUploadCheckResult {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
AssetRejectReason? reason; Optional<AssetRejectReason?> reason;
@override @override
bool operator ==(Object other) => identical(this, other) || other is AssetBulkUploadCheckResult && bool operator ==(Object other) => identical(this, other) || other is AssetBulkUploadCheckResult &&
@ -74,21 +74,18 @@ class AssetBulkUploadCheckResult {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
json[r'action'] = this.action; json[r'action'] = this.action;
if (this.assetId != null) { if (this.assetId.isPresent) {
json[r'assetId'] = this.assetId; final value = this.assetId.value;
} else { json[r'assetId'] = value;
// json[r'assetId'] = null;
} }
json[r'id'] = this.id; json[r'id'] = this.id;
if (this.isTrashed != null) { if (this.isTrashed.isPresent) {
json[r'isTrashed'] = this.isTrashed; final value = this.isTrashed.value;
} else { json[r'isTrashed'] = value;
// json[r'isTrashed'] = null;
} }
if (this.reason != null) { if (this.reason.isPresent) {
json[r'reason'] = this.reason; final value = this.reason.value;
} else { json[r'reason'] = value;
// json[r'reason'] = null;
} }
return json; return json;
} }
@ -103,10 +100,10 @@ class AssetBulkUploadCheckResult {
return AssetBulkUploadCheckResult( return AssetBulkUploadCheckResult(
action: AssetUploadAction.fromJson(json[r'action'])!, action: AssetUploadAction.fromJson(json[r'action'])!,
assetId: mapValueOfType<String>(json, r'assetId'), assetId: json.containsKey(r'assetId') ? Optional.present(mapValueOfType<String>(json, r'assetId')) : const Optional.absent(),
id: mapValueOfType<String>(json, r'id')!, id: mapValueOfType<String>(json, r'id')!,
isTrashed: mapValueOfType<bool>(json, r'isTrashed'), isTrashed: json.containsKey(r'isTrashed') ? Optional.present(mapValueOfType<bool>(json, r'isTrashed')) : const Optional.absent(),
reason: AssetRejectReason.fromJson(json[r'reason']), reason: json.containsKey(r'reason') ? Optional.present(AssetRejectReason.fromJson(json[r'reason'])) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -13,32 +13,32 @@ part of openapi.api;
class AssetCopyDto { class AssetCopyDto {
/// Returns a new [AssetCopyDto] instance. /// Returns a new [AssetCopyDto] instance.
AssetCopyDto({ AssetCopyDto({
this.albums = true, this.albums = const Optional.present(true),
this.favorite = true, this.favorite = const Optional.present(true),
this.sharedLinks = true, this.sharedLinks = const Optional.present(true),
this.sidecar = true, this.sidecar = const Optional.present(true),
required this.sourceId, required this.sourceId,
this.stack = true, this.stack = const Optional.present(true),
required this.targetId, required this.targetId,
}); });
/// Copy album associations /// Copy album associations
bool albums; Optional<bool?> albums;
/// Copy favorite status /// Copy favorite status
bool favorite; Optional<bool?> favorite;
/// Copy shared links /// Copy shared links
bool sharedLinks; Optional<bool?> sharedLinks;
/// Copy sidecar file /// Copy sidecar file
bool sidecar; Optional<bool?> sidecar;
/// Source asset ID /// Source asset ID
String sourceId; String sourceId;
/// Copy stack association /// Copy stack association
bool stack; Optional<bool?> stack;
/// Target asset ID /// Target asset ID
String targetId; String targetId;
@ -69,12 +69,27 @@ class AssetCopyDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
json[r'albums'] = this.albums; if (this.albums.isPresent) {
json[r'favorite'] = this.favorite; final value = this.albums.value;
json[r'sharedLinks'] = this.sharedLinks; json[r'albums'] = value;
json[r'sidecar'] = this.sidecar; }
if (this.favorite.isPresent) {
final value = this.favorite.value;
json[r'favorite'] = value;
}
if (this.sharedLinks.isPresent) {
final value = this.sharedLinks.value;
json[r'sharedLinks'] = value;
}
if (this.sidecar.isPresent) {
final value = this.sidecar.value;
json[r'sidecar'] = value;
}
json[r'sourceId'] = this.sourceId; json[r'sourceId'] = this.sourceId;
json[r'stack'] = this.stack; if (this.stack.isPresent) {
final value = this.stack.value;
json[r'stack'] = value;
}
json[r'targetId'] = this.targetId; json[r'targetId'] = this.targetId;
return json; return json;
} }
@ -88,12 +103,12 @@ class AssetCopyDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return AssetCopyDto( return AssetCopyDto(
albums: mapValueOfType<bool>(json, r'albums') ?? true, albums: json.containsKey(r'albums') ? Optional.present(mapValueOfType<bool>(json, r'albums')) : const Optional.absent(),
favorite: mapValueOfType<bool>(json, r'favorite') ?? true, favorite: json.containsKey(r'favorite') ? Optional.present(mapValueOfType<bool>(json, r'favorite')) : const Optional.absent(),
sharedLinks: mapValueOfType<bool>(json, r'sharedLinks') ?? true, sharedLinks: json.containsKey(r'sharedLinks') ? Optional.present(mapValueOfType<bool>(json, r'sharedLinks')) : const Optional.absent(),
sidecar: mapValueOfType<bool>(json, r'sidecar') ?? true, sidecar: json.containsKey(r'sidecar') ? Optional.present(mapValueOfType<bool>(json, r'sidecar')) : const Optional.absent(),
sourceId: mapValueOfType<String>(json, r'sourceId')!, sourceId: mapValueOfType<String>(json, r'sourceId')!,
stack: mapValueOfType<bool>(json, r'stack') ?? true, stack: json.containsKey(r'stack') ? Optional.present(mapValueOfType<bool>(json, r'stack')) : const Optional.absent(),
targetId: mapValueOfType<String>(json, r'targetId')!, targetId: mapValueOfType<String>(json, r'targetId')!,
); );
} }

View File

@ -21,7 +21,7 @@ class AssetFaceResponseDto {
required this.imageHeight, required this.imageHeight,
required this.imageWidth, required this.imageWidth,
required this.person, required this.person,
this.sourceType, this.sourceType = const Optional.absent(),
}); });
/// Bounding box X1 coordinate /// Bounding box X1 coordinate
@ -71,7 +71,7 @@ class AssetFaceResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
SourceType? sourceType; Optional<SourceType?> sourceType;
@override @override
bool operator ==(Object other) => identical(this, other) || other is AssetFaceResponseDto && bool operator ==(Object other) => identical(this, other) || other is AssetFaceResponseDto &&
@ -113,12 +113,11 @@ class AssetFaceResponseDto {
if (this.person != null) { if (this.person != null) {
json[r'person'] = this.person; json[r'person'] = this.person;
} else { } else {
// json[r'person'] = null; json[r'person'] = null;
} }
if (this.sourceType != null) { if (this.sourceType.isPresent) {
json[r'sourceType'] = this.sourceType; final value = this.sourceType.value;
} else { json[r'sourceType'] = value;
// json[r'sourceType'] = null;
} }
return json; return json;
} }
@ -140,7 +139,7 @@ class AssetFaceResponseDto {
imageHeight: mapValueOfType<int>(json, r'imageHeight')!, imageHeight: mapValueOfType<int>(json, r'imageHeight')!,
imageWidth: mapValueOfType<int>(json, r'imageWidth')!, imageWidth: mapValueOfType<int>(json, r'imageWidth')!,
person: PersonResponseDto.fromJson(json[r'person']), person: PersonResponseDto.fromJson(json[r'person']),
sourceType: SourceType.fromJson(json[r'sourceType']), sourceType: json.containsKey(r'sourceType') ? Optional.present(SourceType.fromJson(json[r'sourceType'])) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -14,7 +14,7 @@ class AssetIdsResponseDto {
/// Returns a new [AssetIdsResponseDto] instance. /// Returns a new [AssetIdsResponseDto] instance.
AssetIdsResponseDto({ AssetIdsResponseDto({
required this.assetId, required this.assetId,
this.error, this.error = const Optional.absent(),
required this.success, required this.success,
}); });
@ -27,7 +27,7 @@ class AssetIdsResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
AssetIdErrorReason? error; Optional<AssetIdErrorReason?> error;
/// Whether operation succeeded /// Whether operation succeeded
bool success; bool success;
@ -51,10 +51,9 @@ class AssetIdsResponseDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
json[r'assetId'] = this.assetId; json[r'assetId'] = this.assetId;
if (this.error != null) { if (this.error.isPresent) {
json[r'error'] = this.error; final value = this.error.value;
} else { json[r'error'] = value;
// json[r'error'] = null;
} }
json[r'success'] = this.success; json[r'success'] = this.success;
return json; return json;
@ -70,7 +69,7 @@ class AssetIdsResponseDto {
return AssetIdsResponseDto( return AssetIdsResponseDto(
assetId: mapValueOfType<String>(json, r'assetId')!, assetId: mapValueOfType<String>(json, r'assetId')!,
error: AssetIdErrorReason.fromJson(json[r'error']), error: json.containsKey(r'error') ? Optional.present(AssetIdErrorReason.fromJson(json[r'error'])) : const Optional.absent(),
success: mapValueOfType<bool>(json, r'success')!, success: mapValueOfType<bool>(json, r'success')!,
); );
} }

View File

@ -129,18 +129,18 @@ class AssetOcrResponseDto {
return AssetOcrResponseDto( return AssetOcrResponseDto(
assetId: mapValueOfType<String>(json, r'assetId')!, assetId: mapValueOfType<String>(json, r'assetId')!,
boxScore: (mapValueOfType<num>(json, r'boxScore')!).toDouble(), boxScore: mapValueOfType<double>(json, r'boxScore')!,
id: mapValueOfType<String>(json, r'id')!, id: mapValueOfType<String>(json, r'id')!,
text: mapValueOfType<String>(json, r'text')!, text: mapValueOfType<String>(json, r'text')!,
textScore: (mapValueOfType<num>(json, r'textScore')!).toDouble(), textScore: mapValueOfType<double>(json, r'textScore')!,
x1: (mapValueOfType<num>(json, r'x1')!).toDouble(), x1: mapValueOfType<double>(json, r'x1')!,
x2: (mapValueOfType<num>(json, r'x2')!).toDouble(), x2: mapValueOfType<double>(json, r'x2')!,
x3: (mapValueOfType<num>(json, r'x3')!).toDouble(), x3: mapValueOfType<double>(json, r'x3')!,
x4: (mapValueOfType<num>(json, r'x4')!).toDouble(), x4: mapValueOfType<double>(json, r'x4')!,
y1: (mapValueOfType<num>(json, r'y1')!).toDouble(), y1: mapValueOfType<double>(json, r'y1')!,
y2: (mapValueOfType<num>(json, r'y2')!).toDouble(), y2: mapValueOfType<double>(json, r'y2')!,
y3: (mapValueOfType<num>(json, r'y3')!).toDouble(), y3: mapValueOfType<double>(json, r'y3')!,
y4: (mapValueOfType<num>(json, r'y4')!).toDouble(), y4: mapValueOfType<double>(json, r'y4')!,
); );
} }
return null; return null;

View File

@ -15,9 +15,9 @@ class AssetResponseDto {
AssetResponseDto({ AssetResponseDto({
required this.checksum, required this.checksum,
required this.createdAt, required this.createdAt,
this.duplicateId, this.duplicateId = const Optional.absent(),
required this.duration, required this.duration,
this.exifInfo, this.exifInfo = const Optional.absent(),
required this.fileCreatedAt, required this.fileCreatedAt,
required this.fileModifiedAt, required this.fileModifiedAt,
required this.hasMetadata, required this.hasMetadata,
@ -28,18 +28,18 @@ class AssetResponseDto {
required this.isFavorite, required this.isFavorite,
required this.isOffline, required this.isOffline,
required this.isTrashed, required this.isTrashed,
this.libraryId, this.libraryId = const Optional.absent(),
this.livePhotoVideoId, this.livePhotoVideoId = const Optional.absent(),
required this.localDateTime, required this.localDateTime,
required this.originalFileName, required this.originalFileName,
this.originalMimeType, this.originalMimeType = const Optional.absent(),
required this.originalPath, required this.originalPath,
this.owner, this.owner = const Optional.absent(),
required this.ownerId, required this.ownerId,
this.people = const [], this.people = const Optional.present(const []),
this.resized, this.resized = const Optional.absent(),
this.stack, this.stack = const Optional.absent(),
this.tags = const [], this.tags = const Optional.present(const []),
required this.thumbhash, required this.thumbhash,
required this.type, required this.type,
required this.updatedAt, required this.updatedAt,
@ -54,7 +54,7 @@ class AssetResponseDto {
DateTime createdAt; DateTime createdAt;
/// Duplicate group ID /// Duplicate group ID
String? duplicateId; Optional<String?> duplicateId;
/// Video/gif duration in milliseconds (null for static images) /// Video/gif duration in milliseconds (null for static images)
/// ///
@ -68,7 +68,7 @@ class AssetResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
ExifResponseDto? exifInfo; Optional<ExifResponseDto?> exifInfo;
/// The actual UTC timestamp when the file was created/captured, preserving timezone information. This is the authoritative timestamp for chronological sorting within timeline groups. Combined with timezone data, this can be used to determine the exact moment the photo was taken. /// The actual UTC timestamp when the file was created/captured, preserving timezone information. This is the authoritative timestamp for chronological sorting within timeline groups. Combined with timezone data, this can be used to determine the exact moment the photo was taken.
DateTime fileCreatedAt; DateTime fileCreatedAt;
@ -104,10 +104,10 @@ class AssetResponseDto {
bool isTrashed; bool isTrashed;
/// Library ID /// Library ID
String? libraryId; Optional<String?> libraryId;
/// Live photo video ID /// Live photo video ID
String? livePhotoVideoId; Optional<String?> livePhotoVideoId;
/// The local date and time when the photo/video was taken, derived from EXIF metadata. This represents the photographer's local time regardless of timezone, stored as a timezone-agnostic timestamp. Used for timeline grouping by \"local\" days and months. /// The local date and time when the photo/video was taken, derived from EXIF metadata. This represents the photographer's local time regardless of timezone, stored as a timezone-agnostic timestamp. Used for timeline grouping by \"local\" days and months.
DateTime localDateTime; DateTime localDateTime;
@ -122,7 +122,7 @@ class AssetResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? originalMimeType; Optional<String?> originalMimeType;
/// Original file path /// Original file path
String originalPath; String originalPath;
@ -133,12 +133,12 @@ class AssetResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
UserResponseDto? owner; Optional<UserResponseDto?> owner;
/// Owner user ID /// Owner user ID
String ownerId; String ownerId;
List<PersonResponseDto> people; Optional<List<PersonResponseDto>?> people;
/// Is resized /// Is resized
/// ///
@ -147,11 +147,11 @@ class AssetResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? resized; Optional<bool?> resized;
AssetStackResponseDto? stack; Optional<AssetStackResponseDto?> stack;
List<TagResponseDto> tags; Optional<List<TagResponseDto>?> tags;
/// Thumbhash for thumbnail generation (base64) also used as the c query param for thumbnail cache busting. /// Thumbhash for thumbnail generation (base64) also used as the c query param for thumbnail cache busting.
String? thumbhash; String? thumbhash;
@ -247,20 +247,18 @@ class AssetResponseDto {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
json[r'checksum'] = this.checksum; json[r'checksum'] = this.checksum;
json[r'createdAt'] = this.createdAt.toUtc().toIso8601String(); json[r'createdAt'] = this.createdAt.toUtc().toIso8601String();
if (this.duplicateId != null) { if (this.duplicateId.isPresent) {
json[r'duplicateId'] = this.duplicateId; final value = this.duplicateId.value;
} else { json[r'duplicateId'] = value;
// json[r'duplicateId'] = null;
} }
if (this.duration != null) { if (this.duration != null) {
json[r'duration'] = this.duration; json[r'duration'] = this.duration;
} else { } else {
// json[r'duration'] = null; json[r'duration'] = null;
} }
if (this.exifInfo != null) { if (this.exifInfo.isPresent) {
json[r'exifInfo'] = this.exifInfo; final value = this.exifInfo.value;
} else { json[r'exifInfo'] = value;
// json[r'exifInfo'] = null;
} }
json[r'fileCreatedAt'] = this.fileCreatedAt.toUtc().toIso8601String(); json[r'fileCreatedAt'] = this.fileCreatedAt.toUtc().toIso8601String();
json[r'fileModifiedAt'] = this.fileModifiedAt.toUtc().toIso8601String(); json[r'fileModifiedAt'] = this.fileModifiedAt.toUtc().toIso8601String();
@ -268,7 +266,7 @@ class AssetResponseDto {
if (this.height != null) { if (this.height != null) {
json[r'height'] = this.height; json[r'height'] = this.height;
} else { } else {
// json[r'height'] = null; json[r'height'] = null;
} }
json[r'id'] = this.id; json[r'id'] = this.id;
json[r'isArchived'] = this.isArchived; json[r'isArchived'] = this.isArchived;
@ -276,46 +274,46 @@ class AssetResponseDto {
json[r'isFavorite'] = this.isFavorite; json[r'isFavorite'] = this.isFavorite;
json[r'isOffline'] = this.isOffline; json[r'isOffline'] = this.isOffline;
json[r'isTrashed'] = this.isTrashed; json[r'isTrashed'] = this.isTrashed;
if (this.libraryId != null) { if (this.libraryId.isPresent) {
json[r'libraryId'] = this.libraryId; final value = this.libraryId.value;
} else { json[r'libraryId'] = value;
// json[r'libraryId'] = null;
} }
if (this.livePhotoVideoId != null) { if (this.livePhotoVideoId.isPresent) {
json[r'livePhotoVideoId'] = this.livePhotoVideoId; final value = this.livePhotoVideoId.value;
} else { json[r'livePhotoVideoId'] = value;
// json[r'livePhotoVideoId'] = null;
} }
json[r'localDateTime'] = this.localDateTime.toUtc().toIso8601String(); json[r'localDateTime'] = this.localDateTime.toUtc().toIso8601String();
json[r'originalFileName'] = this.originalFileName; json[r'originalFileName'] = this.originalFileName;
if (this.originalMimeType != null) { if (this.originalMimeType.isPresent) {
json[r'originalMimeType'] = this.originalMimeType; final value = this.originalMimeType.value;
} else { json[r'originalMimeType'] = value;
// json[r'originalMimeType'] = null;
} }
json[r'originalPath'] = this.originalPath; json[r'originalPath'] = this.originalPath;
if (this.owner != null) { if (this.owner.isPresent) {
json[r'owner'] = this.owner; final value = this.owner.value;
} else { json[r'owner'] = value;
// json[r'owner'] = null;
} }
json[r'ownerId'] = this.ownerId; json[r'ownerId'] = this.ownerId;
json[r'people'] = this.people; if (this.people.isPresent) {
if (this.resized != null) { final value = this.people.value;
json[r'resized'] = this.resized; json[r'people'] = value;
} else {
// json[r'resized'] = null;
} }
if (this.stack != null) { if (this.resized.isPresent) {
json[r'stack'] = this.stack; final value = this.resized.value;
} else { json[r'resized'] = value;
// json[r'stack'] = null; }
if (this.stack.isPresent) {
final value = this.stack.value;
json[r'stack'] = value;
}
if (this.tags.isPresent) {
final value = this.tags.value;
json[r'tags'] = value;
} }
json[r'tags'] = this.tags;
if (this.thumbhash != null) { if (this.thumbhash != null) {
json[r'thumbhash'] = this.thumbhash; json[r'thumbhash'] = this.thumbhash;
} else { } else {
// json[r'thumbhash'] = null; json[r'thumbhash'] = null;
} }
json[r'type'] = this.type; json[r'type'] = this.type;
json[r'updatedAt'] = this.updatedAt.toUtc().toIso8601String(); json[r'updatedAt'] = this.updatedAt.toUtc().toIso8601String();
@ -323,7 +321,7 @@ class AssetResponseDto {
if (this.width != null) { if (this.width != null) {
json[r'width'] = this.width; json[r'width'] = this.width;
} else { } else {
// json[r'width'] = null; json[r'width'] = null;
} }
return json; return json;
} }
@ -339,9 +337,9 @@ class AssetResponseDto {
return AssetResponseDto( return AssetResponseDto(
checksum: mapValueOfType<String>(json, r'checksum')!, checksum: mapValueOfType<String>(json, r'checksum')!,
createdAt: mapDateTime(json, r'createdAt', r'')!, createdAt: mapDateTime(json, r'createdAt', r'')!,
duplicateId: mapValueOfType<String>(json, r'duplicateId'), duplicateId: json.containsKey(r'duplicateId') ? Optional.present(mapValueOfType<String>(json, r'duplicateId')) : const Optional.absent(),
duration: mapValueOfType<int>(json, r'duration'), duration: mapValueOfType<int>(json, r'duration'),
exifInfo: ExifResponseDto.fromJson(json[r'exifInfo']), exifInfo: json.containsKey(r'exifInfo') ? Optional.present(ExifResponseDto.fromJson(json[r'exifInfo'])) : const Optional.absent(),
fileCreatedAt: mapDateTime(json, r'fileCreatedAt', r'')!, fileCreatedAt: mapDateTime(json, r'fileCreatedAt', r'')!,
fileModifiedAt: mapDateTime(json, r'fileModifiedAt', r'')!, fileModifiedAt: mapDateTime(json, r'fileModifiedAt', r'')!,
hasMetadata: mapValueOfType<bool>(json, r'hasMetadata')!, hasMetadata: mapValueOfType<bool>(json, r'hasMetadata')!,
@ -352,18 +350,18 @@ class AssetResponseDto {
isFavorite: mapValueOfType<bool>(json, r'isFavorite')!, isFavorite: mapValueOfType<bool>(json, r'isFavorite')!,
isOffline: mapValueOfType<bool>(json, r'isOffline')!, isOffline: mapValueOfType<bool>(json, r'isOffline')!,
isTrashed: mapValueOfType<bool>(json, r'isTrashed')!, isTrashed: mapValueOfType<bool>(json, r'isTrashed')!,
libraryId: mapValueOfType<String>(json, r'libraryId'), libraryId: json.containsKey(r'libraryId') ? Optional.present(mapValueOfType<String>(json, r'libraryId')) : const Optional.absent(),
livePhotoVideoId: mapValueOfType<String>(json, r'livePhotoVideoId'), livePhotoVideoId: json.containsKey(r'livePhotoVideoId') ? Optional.present(mapValueOfType<String>(json, r'livePhotoVideoId')) : const Optional.absent(),
localDateTime: mapDateTime(json, r'localDateTime', r'')!, localDateTime: mapDateTime(json, r'localDateTime', r'')!,
originalFileName: mapValueOfType<String>(json, r'originalFileName')!, originalFileName: mapValueOfType<String>(json, r'originalFileName')!,
originalMimeType: mapValueOfType<String>(json, r'originalMimeType'), originalMimeType: json.containsKey(r'originalMimeType') ? Optional.present(mapValueOfType<String>(json, r'originalMimeType')) : const Optional.absent(),
originalPath: mapValueOfType<String>(json, r'originalPath')!, originalPath: mapValueOfType<String>(json, r'originalPath')!,
owner: UserResponseDto.fromJson(json[r'owner']), owner: json.containsKey(r'owner') ? Optional.present(UserResponseDto.fromJson(json[r'owner'])) : const Optional.absent(),
ownerId: mapValueOfType<String>(json, r'ownerId')!, ownerId: mapValueOfType<String>(json, r'ownerId')!,
people: PersonResponseDto.listFromJson(json[r'people']), people: json.containsKey(r'people') ? Optional.present(PersonResponseDto.listFromJson(json[r'people'])) : const Optional.absent(),
resized: mapValueOfType<bool>(json, r'resized'), resized: json.containsKey(r'resized') ? Optional.present(mapValueOfType<bool>(json, r'resized')) : const Optional.absent(),
stack: AssetStackResponseDto.fromJson(json[r'stack']), stack: json.containsKey(r'stack') ? Optional.present(AssetStackResponseDto.fromJson(json[r'stack'])) : const Optional.absent(),
tags: TagResponseDto.listFromJson(json[r'tags']), tags: json.containsKey(r'tags') ? Optional.present(TagResponseDto.listFromJson(json[r'tags'])) : const Optional.absent(),
thumbhash: mapValueOfType<String>(json, r'thumbhash'), thumbhash: mapValueOfType<String>(json, r'thumbhash'),
type: AssetTypeEnum.fromJson(json[r'type'])!, type: AssetTypeEnum.fromJson(json[r'type'])!,
updatedAt: mapDateTime(json, r'updatedAt', r'')!, updatedAt: mapDateTime(json, r'updatedAt', r'')!,

View File

@ -13,11 +13,11 @@ part of openapi.api;
class AuthStatusResponseDto { class AuthStatusResponseDto {
/// Returns a new [AuthStatusResponseDto] instance. /// Returns a new [AuthStatusResponseDto] instance.
AuthStatusResponseDto({ AuthStatusResponseDto({
this.expiresAt, this.expiresAt = const Optional.absent(),
required this.isElevated, required this.isElevated,
required this.password, required this.password,
required this.pinCode, required this.pinCode,
this.pinExpiresAt, this.pinExpiresAt = const Optional.absent(),
}); });
/// Session expiration date /// Session expiration date
@ -27,7 +27,7 @@ class AuthStatusResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? expiresAt; Optional<String?> expiresAt;
/// Is elevated session /// Is elevated session
bool isElevated; bool isElevated;
@ -45,7 +45,7 @@ class AuthStatusResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? pinExpiresAt; Optional<String?> pinExpiresAt;
@override @override
bool operator ==(Object other) => identical(this, other) || other is AuthStatusResponseDto && bool operator ==(Object other) => identical(this, other) || other is AuthStatusResponseDto &&
@ -69,18 +69,16 @@ class AuthStatusResponseDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.expiresAt != null) { if (this.expiresAt.isPresent) {
json[r'expiresAt'] = this.expiresAt; final value = this.expiresAt.value;
} else { json[r'expiresAt'] = value;
// json[r'expiresAt'] = null;
} }
json[r'isElevated'] = this.isElevated; json[r'isElevated'] = this.isElevated;
json[r'password'] = this.password; json[r'password'] = this.password;
json[r'pinCode'] = this.pinCode; json[r'pinCode'] = this.pinCode;
if (this.pinExpiresAt != null) { if (this.pinExpiresAt.isPresent) {
json[r'pinExpiresAt'] = this.pinExpiresAt; final value = this.pinExpiresAt.value;
} else { json[r'pinExpiresAt'] = value;
// json[r'pinExpiresAt'] = null;
} }
return json; return json;
} }
@ -94,11 +92,11 @@ class AuthStatusResponseDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return AuthStatusResponseDto( return AuthStatusResponseDto(
expiresAt: mapValueOfType<String>(json, r'expiresAt'), expiresAt: json.containsKey(r'expiresAt') ? Optional.present(mapValueOfType<String>(json, r'expiresAt')) : const Optional.absent(),
isElevated: mapValueOfType<bool>(json, r'isElevated')!, isElevated: mapValueOfType<bool>(json, r'isElevated')!,
password: mapValueOfType<bool>(json, r'password')!, password: mapValueOfType<bool>(json, r'password')!,
pinCode: mapValueOfType<bool>(json, r'pinCode')!, pinCode: mapValueOfType<bool>(json, r'pinCode')!,
pinExpiresAt: mapValueOfType<String>(json, r'pinExpiresAt'), pinExpiresAt: json.containsKey(r'pinExpiresAt') ? Optional.present(mapValueOfType<String>(json, r'pinExpiresAt')) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -13,7 +13,7 @@ part of openapi.api;
class AvatarUpdate { class AvatarUpdate {
/// Returns a new [AvatarUpdate] instance. /// Returns a new [AvatarUpdate] instance.
AvatarUpdate({ AvatarUpdate({
this.color, this.color = const Optional.absent(),
}); });
/// ///
@ -22,7 +22,7 @@ class AvatarUpdate {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
UserAvatarColor? color; Optional<UserAvatarColor?> color;
@override @override
bool operator ==(Object other) => identical(this, other) || other is AvatarUpdate && bool operator ==(Object other) => identical(this, other) || other is AvatarUpdate &&
@ -38,10 +38,9 @@ class AvatarUpdate {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.color != null) { if (this.color.isPresent) {
json[r'color'] = this.color; final value = this.color.value;
} else { json[r'color'] = value;
// json[r'color'] = null;
} }
return json; return json;
} }
@ -55,7 +54,7 @@ class AvatarUpdate {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return AvatarUpdate( return AvatarUpdate(
color: UserAvatarColor.fromJson(json[r'color']), color: json.containsKey(r'color') ? Optional.present(UserAvatarColor.fromJson(json[r'color'])) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -13,8 +13,8 @@ part of openapi.api;
class BulkIdResponseDto { class BulkIdResponseDto {
/// Returns a new [BulkIdResponseDto] instance. /// Returns a new [BulkIdResponseDto] instance.
BulkIdResponseDto({ BulkIdResponseDto({
this.error, this.error = const Optional.absent(),
this.errorMessage, this.errorMessage = const Optional.absent(),
required this.id, required this.id,
required this.success, required this.success,
}); });
@ -25,7 +25,7 @@ class BulkIdResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
BulkIdErrorReason? error; Optional<BulkIdErrorReason?> error;
/// ///
/// Please note: This property should have been non-nullable! Since the specification file /// Please note: This property should have been non-nullable! Since the specification file
@ -33,7 +33,7 @@ class BulkIdResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? errorMessage; Optional<String?> errorMessage;
/// ID /// ID
String id; String id;
@ -61,15 +61,13 @@ class BulkIdResponseDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.error != null) { if (this.error.isPresent) {
json[r'error'] = this.error; final value = this.error.value;
} else { json[r'error'] = value;
// json[r'error'] = null;
} }
if (this.errorMessage != null) { if (this.errorMessage.isPresent) {
json[r'errorMessage'] = this.errorMessage; final value = this.errorMessage.value;
} else { json[r'errorMessage'] = value;
// json[r'errorMessage'] = null;
} }
json[r'id'] = this.id; json[r'id'] = this.id;
json[r'success'] = this.success; json[r'success'] = this.success;
@ -85,8 +83,8 @@ class BulkIdResponseDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return BulkIdResponseDto( return BulkIdResponseDto(
error: BulkIdErrorReason.fromJson(json[r'error']), error: json.containsKey(r'error') ? Optional.present(BulkIdErrorReason.fromJson(json[r'error'])) : const Optional.absent(),
errorMessage: mapValueOfType<String>(json, r'errorMessage'), errorMessage: json.containsKey(r'errorMessage') ? Optional.present(mapValueOfType<String>(json, r'errorMessage')) : const Optional.absent(),
id: mapValueOfType<String>(json, r'id')!, id: mapValueOfType<String>(json, r'id')!,
success: mapValueOfType<bool>(json, r'success')!, success: mapValueOfType<bool>(json, r'success')!,
); );

View File

@ -13,7 +13,7 @@ part of openapi.api;
class CastUpdate { class CastUpdate {
/// Returns a new [CastUpdate] instance. /// Returns a new [CastUpdate] instance.
CastUpdate({ CastUpdate({
this.gCastEnabled, this.gCastEnabled = const Optional.absent(),
}); });
/// Whether Google Cast is enabled /// Whether Google Cast is enabled
@ -23,7 +23,7 @@ class CastUpdate {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? gCastEnabled; Optional<bool?> gCastEnabled;
@override @override
bool operator ==(Object other) => identical(this, other) || other is CastUpdate && bool operator ==(Object other) => identical(this, other) || other is CastUpdate &&
@ -39,10 +39,9 @@ class CastUpdate {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.gCastEnabled != null) { if (this.gCastEnabled.isPresent) {
json[r'gCastEnabled'] = this.gCastEnabled; final value = this.gCastEnabled.value;
} else { json[r'gCastEnabled'] = value;
// json[r'gCastEnabled'] = null;
} }
return json; return json;
} }
@ -56,7 +55,7 @@ class CastUpdate {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return CastUpdate( return CastUpdate(
gCastEnabled: mapValueOfType<bool>(json, r'gCastEnabled'), gCastEnabled: json.containsKey(r'gCastEnabled') ? Optional.present(mapValueOfType<bool>(json, r'gCastEnabled')) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -13,13 +13,13 @@ part of openapi.api;
class ChangePasswordDto { class ChangePasswordDto {
/// Returns a new [ChangePasswordDto] instance. /// Returns a new [ChangePasswordDto] instance.
ChangePasswordDto({ ChangePasswordDto({
this.invalidateSessions = false, this.invalidateSessions = const Optional.present(false),
required this.newPassword, required this.newPassword,
required this.password, required this.password,
}); });
/// Invalidate all other sessions /// Invalidate all other sessions
bool invalidateSessions; Optional<bool?> invalidateSessions;
/// New password (min 8 characters) /// New password (min 8 characters)
String newPassword; String newPassword;
@ -45,7 +45,10 @@ class ChangePasswordDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
json[r'invalidateSessions'] = this.invalidateSessions; if (this.invalidateSessions.isPresent) {
final value = this.invalidateSessions.value;
json[r'invalidateSessions'] = value;
}
json[r'newPassword'] = this.newPassword; json[r'newPassword'] = this.newPassword;
json[r'password'] = this.password; json[r'password'] = this.password;
return json; return json;
@ -60,7 +63,7 @@ class ChangePasswordDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return ChangePasswordDto( return ChangePasswordDto(
invalidateSessions: mapValueOfType<bool>(json, r'invalidateSessions') ?? false, invalidateSessions: json.containsKey(r'invalidateSessions') ? Optional.present(mapValueOfType<bool>(json, r'invalidateSessions')) : const Optional.absent(),
newPassword: mapValueOfType<String>(json, r'newPassword')!, newPassword: mapValueOfType<String>(json, r'newPassword')!,
password: mapValueOfType<String>(json, r'password')!, password: mapValueOfType<String>(json, r'password')!,
); );

View File

@ -14,19 +14,19 @@ class CreateAlbumDto {
/// Returns a new [CreateAlbumDto] instance. /// Returns a new [CreateAlbumDto] instance.
CreateAlbumDto({ CreateAlbumDto({
required this.albumName, required this.albumName,
this.albumUsers = const [], this.albumUsers = const Optional.present(const []),
this.assetIds = const [], this.assetIds = const Optional.present(const []),
this.description, this.description = const Optional.absent(),
}); });
/// Album name /// Album name
String albumName; String albumName;
/// Album users /// Album users
List<AlbumUserCreateDto> albumUsers; Optional<List<AlbumUserCreateDto>?> albumUsers;
/// Initial asset IDs /// Initial asset IDs
List<String> assetIds; Optional<List<String>?> assetIds;
/// Album description /// Album description
/// ///
@ -35,7 +35,7 @@ class CreateAlbumDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? description; Optional<String?> description;
@override @override
bool operator ==(Object other) => identical(this, other) || other is CreateAlbumDto && bool operator ==(Object other) => identical(this, other) || other is CreateAlbumDto &&
@ -58,12 +58,17 @@ class CreateAlbumDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
json[r'albumName'] = this.albumName; json[r'albumName'] = this.albumName;
json[r'albumUsers'] = this.albumUsers; if (this.albumUsers.isPresent) {
json[r'assetIds'] = this.assetIds; final value = this.albumUsers.value;
if (this.description != null) { json[r'albumUsers'] = value;
json[r'description'] = this.description; }
} else { if (this.assetIds.isPresent) {
// json[r'description'] = null; final value = this.assetIds.value;
json[r'assetIds'] = value;
}
if (this.description.isPresent) {
final value = this.description.value;
json[r'description'] = value;
} }
return json; return json;
} }
@ -78,11 +83,11 @@ class CreateAlbumDto {
return CreateAlbumDto( return CreateAlbumDto(
albumName: mapValueOfType<String>(json, r'albumName')!, albumName: mapValueOfType<String>(json, r'albumName')!,
albumUsers: AlbumUserCreateDto.listFromJson(json[r'albumUsers']), albumUsers: json.containsKey(r'albumUsers') ? Optional.present(AlbumUserCreateDto.listFromJson(json[r'albumUsers'])) : const Optional.absent(),
assetIds: json[r'assetIds'] is Iterable assetIds: json.containsKey(r'assetIds') ? Optional.present(json[r'assetIds'] is Iterable
? (json[r'assetIds'] as Iterable).cast<String>().toList(growable: false) ? (json[r'assetIds'] as Iterable).cast<String>().toList(growable: false)
: const [], : const []) : const Optional.absent(),
description: mapValueOfType<String>(json, r'description'), description: json.containsKey(r'description') ? Optional.present(mapValueOfType<String>(json, r'description')) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -13,17 +13,17 @@ part of openapi.api;
class CreateLibraryDto { class CreateLibraryDto {
/// Returns a new [CreateLibraryDto] instance. /// Returns a new [CreateLibraryDto] instance.
CreateLibraryDto({ CreateLibraryDto({
this.exclusionPatterns = const [], this.exclusionPatterns = const Optional.present(const []),
this.importPaths = const [], this.importPaths = const Optional.present(const []),
this.name, this.name = const Optional.absent(),
required this.ownerId, required this.ownerId,
}); });
/// Exclusion patterns (max 128) /// Exclusion patterns (max 128)
List<String> exclusionPatterns; Optional<List<String>?> exclusionPatterns;
/// Import paths (max 128) /// Import paths (max 128)
List<String> importPaths; Optional<List<String>?> importPaths;
/// Library name /// Library name
/// ///
@ -32,7 +32,7 @@ class CreateLibraryDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? name; Optional<String?> name;
/// Owner user ID /// Owner user ID
String ownerId; String ownerId;
@ -57,12 +57,17 @@ class CreateLibraryDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
json[r'exclusionPatterns'] = this.exclusionPatterns; if (this.exclusionPatterns.isPresent) {
json[r'importPaths'] = this.importPaths; final value = this.exclusionPatterns.value;
if (this.name != null) { json[r'exclusionPatterns'] = value;
json[r'name'] = this.name; }
} else { if (this.importPaths.isPresent) {
// json[r'name'] = null; final value = this.importPaths.value;
json[r'importPaths'] = value;
}
if (this.name.isPresent) {
final value = this.name.value;
json[r'name'] = value;
} }
json[r'ownerId'] = this.ownerId; json[r'ownerId'] = this.ownerId;
return json; return json;
@ -77,13 +82,13 @@ class CreateLibraryDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return CreateLibraryDto( return CreateLibraryDto(
exclusionPatterns: json[r'exclusionPatterns'] is Iterable exclusionPatterns: json.containsKey(r'exclusionPatterns') ? Optional.present(json[r'exclusionPatterns'] is Iterable
? (json[r'exclusionPatterns'] as Iterable).cast<String>().toList(growable: false) ? (json[r'exclusionPatterns'] as Iterable).cast<String>().toList(growable: false)
: const [], : const []) : const Optional.absent(),
importPaths: json[r'importPaths'] is Iterable importPaths: json.containsKey(r'importPaths') ? Optional.present(json[r'importPaths'] is Iterable
? (json[r'importPaths'] as Iterable).cast<String>().toList(growable: false) ? (json[r'importPaths'] as Iterable).cast<String>().toList(growable: false)
: const [], : const []) : const Optional.absent(),
name: mapValueOfType<String>(json, r'name'), name: json.containsKey(r'name') ? Optional.present(mapValueOfType<String>(json, r'name')) : const Optional.absent(),
ownerId: mapValueOfType<String>(json, r'ownerId')!, ownerId: mapValueOfType<String>(json, r'ownerId')!,
); );
} }

View File

@ -14,7 +14,7 @@ class DownloadArchiveDto {
/// Returns a new [DownloadArchiveDto] instance. /// Returns a new [DownloadArchiveDto] instance.
DownloadArchiveDto({ DownloadArchiveDto({
this.assetIds = const [], this.assetIds = const [],
this.edited, this.edited = const Optional.absent(),
}); });
/// Asset IDs /// Asset IDs
@ -27,7 +27,7 @@ class DownloadArchiveDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? edited; Optional<bool?> edited;
@override @override
bool operator ==(Object other) => identical(this, other) || other is DownloadArchiveDto && bool operator ==(Object other) => identical(this, other) || other is DownloadArchiveDto &&
@ -46,10 +46,9 @@ class DownloadArchiveDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
json[r'assetIds'] = this.assetIds; json[r'assetIds'] = this.assetIds;
if (this.edited != null) { if (this.edited.isPresent) {
json[r'edited'] = this.edited; final value = this.edited.value;
} else { json[r'edited'] = value;
// json[r'edited'] = null;
} }
return json; return json;
} }
@ -66,7 +65,7 @@ class DownloadArchiveDto {
assetIds: json[r'assetIds'] is Iterable assetIds: json[r'assetIds'] is Iterable
? (json[r'assetIds'] as Iterable).cast<String>().toList(growable: false) ? (json[r'assetIds'] as Iterable).cast<String>().toList(growable: false)
: const [], : const [],
edited: mapValueOfType<bool>(json, r'edited'), edited: json.containsKey(r'edited') ? Optional.present(mapValueOfType<bool>(json, r'edited')) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -13,10 +13,10 @@ part of openapi.api;
class DownloadInfoDto { class DownloadInfoDto {
/// Returns a new [DownloadInfoDto] instance. /// Returns a new [DownloadInfoDto] instance.
DownloadInfoDto({ DownloadInfoDto({
this.albumId, this.albumId = const Optional.absent(),
this.archiveSize, this.archiveSize = const Optional.absent(),
this.assetIds = const [], this.assetIds = const Optional.present(const []),
this.userId, this.userId = const Optional.absent(),
}); });
/// Album ID to download /// Album ID to download
@ -26,7 +26,7 @@ class DownloadInfoDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? albumId; Optional<String?> albumId;
/// Archive size limit in bytes /// Archive size limit in bytes
/// ///
@ -38,10 +38,10 @@ class DownloadInfoDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
int? archiveSize; Optional<int?> archiveSize;
/// Asset IDs to download /// Asset IDs to download
List<String> assetIds; Optional<List<String>?> assetIds;
/// User ID to download assets from /// User ID to download assets from
/// ///
@ -50,7 +50,7 @@ class DownloadInfoDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? userId; Optional<String?> userId;
@override @override
bool operator ==(Object other) => identical(this, other) || other is DownloadInfoDto && bool operator ==(Object other) => identical(this, other) || other is DownloadInfoDto &&
@ -72,21 +72,21 @@ class DownloadInfoDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.albumId != null) { if (this.albumId.isPresent) {
json[r'albumId'] = this.albumId; final value = this.albumId.value;
} else { json[r'albumId'] = value;
// json[r'albumId'] = null;
} }
if (this.archiveSize != null) { if (this.archiveSize.isPresent) {
json[r'archiveSize'] = this.archiveSize; final value = this.archiveSize.value;
} else { json[r'archiveSize'] = value;
// json[r'archiveSize'] = null;
} }
json[r'assetIds'] = this.assetIds; if (this.assetIds.isPresent) {
if (this.userId != null) { final value = this.assetIds.value;
json[r'userId'] = this.userId; json[r'assetIds'] = value;
} else { }
// json[r'userId'] = null; if (this.userId.isPresent) {
final value = this.userId.value;
json[r'userId'] = value;
} }
return json; return json;
} }
@ -100,12 +100,12 @@ class DownloadInfoDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return DownloadInfoDto( return DownloadInfoDto(
albumId: mapValueOfType<String>(json, r'albumId'), albumId: json.containsKey(r'albumId') ? Optional.present(mapValueOfType<String>(json, r'albumId')) : const Optional.absent(),
archiveSize: mapValueOfType<int>(json, r'archiveSize'), archiveSize: json.containsKey(r'archiveSize') ? Optional.present(json[r'archiveSize'] == null ? null : int.parse('${json[r'archiveSize']}')) : const Optional.absent(),
assetIds: json[r'assetIds'] is Iterable assetIds: json.containsKey(r'assetIds') ? Optional.present(json[r'assetIds'] is Iterable
? (json[r'assetIds'] as Iterable).cast<String>().toList(growable: false) ? (json[r'assetIds'] as Iterable).cast<String>().toList(growable: false)
: const [], : const []) : const Optional.absent(),
userId: mapValueOfType<String>(json, r'userId'), userId: json.containsKey(r'userId') ? Optional.present(mapValueOfType<String>(json, r'userId')) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -13,8 +13,8 @@ part of openapi.api;
class DownloadUpdate { class DownloadUpdate {
/// Returns a new [DownloadUpdate] instance. /// Returns a new [DownloadUpdate] instance.
DownloadUpdate({ DownloadUpdate({
this.archiveSize, this.archiveSize = const Optional.absent(),
this.includeEmbeddedVideos, this.includeEmbeddedVideos = const Optional.absent(),
}); });
/// Maximum archive size in bytes /// Maximum archive size in bytes
@ -27,7 +27,7 @@ class DownloadUpdate {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
int? archiveSize; Optional<int?> archiveSize;
/// Whether to include embedded videos in downloads /// Whether to include embedded videos in downloads
/// ///
@ -36,7 +36,7 @@ class DownloadUpdate {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? includeEmbeddedVideos; Optional<bool?> includeEmbeddedVideos;
@override @override
bool operator ==(Object other) => identical(this, other) || other is DownloadUpdate && bool operator ==(Object other) => identical(this, other) || other is DownloadUpdate &&
@ -54,15 +54,13 @@ class DownloadUpdate {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.archiveSize != null) { if (this.archiveSize.isPresent) {
json[r'archiveSize'] = this.archiveSize; final value = this.archiveSize.value;
} else { json[r'archiveSize'] = value;
// json[r'archiveSize'] = null;
} }
if (this.includeEmbeddedVideos != null) { if (this.includeEmbeddedVideos.isPresent) {
json[r'includeEmbeddedVideos'] = this.includeEmbeddedVideos; final value = this.includeEmbeddedVideos.value;
} else { json[r'includeEmbeddedVideos'] = value;
// json[r'includeEmbeddedVideos'] = null;
} }
return json; return json;
} }
@ -76,8 +74,8 @@ class DownloadUpdate {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return DownloadUpdate( return DownloadUpdate(
archiveSize: mapValueOfType<int>(json, r'archiveSize'), archiveSize: json.containsKey(r'archiveSize') ? Optional.present(json[r'archiveSize'] == null ? null : int.parse('${json[r'archiveSize']}')) : const Optional.absent(),
includeEmbeddedVideos: mapValueOfType<bool>(json, r'includeEmbeddedVideos'), includeEmbeddedVideos: json.containsKey(r'includeEmbeddedVideos') ? Optional.present(mapValueOfType<bool>(json, r'includeEmbeddedVideos')) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -57,7 +57,7 @@ class DuplicateDetectionConfig {
return DuplicateDetectionConfig( return DuplicateDetectionConfig(
enabled: mapValueOfType<bool>(json, r'enabled')!, enabled: mapValueOfType<bool>(json, r'enabled')!,
maxDistance: (mapValueOfType<num>(json, r'maxDistance')!).toDouble(), maxDistance: mapValueOfType<double>(json, r'maxDistance')!,
); );
} }
return null; return null;

View File

@ -13,9 +13,9 @@ part of openapi.api;
class EmailNotificationsUpdate { class EmailNotificationsUpdate {
/// Returns a new [EmailNotificationsUpdate] instance. /// Returns a new [EmailNotificationsUpdate] instance.
EmailNotificationsUpdate({ EmailNotificationsUpdate({
this.albumInvite, this.albumInvite = const Optional.absent(),
this.albumUpdate, this.albumUpdate = const Optional.absent(),
this.enabled, this.enabled = const Optional.absent(),
}); });
/// Whether to receive email notifications for album invites /// Whether to receive email notifications for album invites
@ -25,7 +25,7 @@ class EmailNotificationsUpdate {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? albumInvite; Optional<bool?> albumInvite;
/// Whether to receive email notifications for album updates /// Whether to receive email notifications for album updates
/// ///
@ -34,7 +34,7 @@ class EmailNotificationsUpdate {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? albumUpdate; Optional<bool?> albumUpdate;
/// Whether email notifications are enabled /// Whether email notifications are enabled
/// ///
@ -43,7 +43,7 @@ class EmailNotificationsUpdate {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? enabled; Optional<bool?> enabled;
@override @override
bool operator ==(Object other) => identical(this, other) || other is EmailNotificationsUpdate && bool operator ==(Object other) => identical(this, other) || other is EmailNotificationsUpdate &&
@ -63,20 +63,17 @@ class EmailNotificationsUpdate {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.albumInvite != null) { if (this.albumInvite.isPresent) {
json[r'albumInvite'] = this.albumInvite; final value = this.albumInvite.value;
} else { json[r'albumInvite'] = value;
// json[r'albumInvite'] = null;
} }
if (this.albumUpdate != null) { if (this.albumUpdate.isPresent) {
json[r'albumUpdate'] = this.albumUpdate; final value = this.albumUpdate.value;
} else { json[r'albumUpdate'] = value;
// json[r'albumUpdate'] = null;
} }
if (this.enabled != null) { if (this.enabled.isPresent) {
json[r'enabled'] = this.enabled; final value = this.enabled.value;
} else { json[r'enabled'] = value;
// json[r'enabled'] = null;
} }
return json; return json;
} }
@ -90,9 +87,9 @@ class EmailNotificationsUpdate {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return EmailNotificationsUpdate( return EmailNotificationsUpdate(
albumInvite: mapValueOfType<bool>(json, r'albumInvite'), albumInvite: json.containsKey(r'albumInvite') ? Optional.present(mapValueOfType<bool>(json, r'albumInvite')) : const Optional.absent(),
albumUpdate: mapValueOfType<bool>(json, r'albumUpdate'), albumUpdate: json.containsKey(r'albumUpdate') ? Optional.present(mapValueOfType<bool>(json, r'albumUpdate')) : const Optional.absent(),
enabled: mapValueOfType<bool>(json, r'enabled'), enabled: json.containsKey(r'enabled') ? Optional.present(mapValueOfType<bool>(json, r'enabled')) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -13,110 +13,110 @@ part of openapi.api;
class ExifResponseDto { class ExifResponseDto {
/// Returns a new [ExifResponseDto] instance. /// Returns a new [ExifResponseDto] instance.
ExifResponseDto({ ExifResponseDto({
this.city, this.city = const Optional.absent(),
this.country, this.country = const Optional.absent(),
this.dateTimeOriginal, this.dateTimeOriginal = const Optional.absent(),
this.description, this.description = const Optional.absent(),
this.exifImageHeight, this.exifImageHeight = const Optional.absent(),
this.exifImageWidth, this.exifImageWidth = const Optional.absent(),
this.exposureTime, this.exposureTime = const Optional.absent(),
this.fNumber, this.fNumber = const Optional.absent(),
this.fileSizeInByte, this.fileSizeInByte = const Optional.absent(),
this.focalLength, this.focalLength = const Optional.absent(),
this.iso, this.iso = const Optional.absent(),
this.latitude, this.latitude = const Optional.absent(),
this.lensModel, this.lensModel = const Optional.absent(),
this.longitude, this.longitude = const Optional.absent(),
this.make, this.make = const Optional.absent(),
this.model, this.model = const Optional.absent(),
this.modifyDate, this.modifyDate = const Optional.absent(),
this.orientation, this.orientation = const Optional.absent(),
this.projectionType, this.projectionType = const Optional.absent(),
this.rating, this.rating = const Optional.absent(),
this.state, this.state = const Optional.absent(),
this.timeZone, this.timeZone = const Optional.absent(),
}); });
/// City name /// City name
String? city; Optional<String?> city;
/// Country name /// Country name
String? country; Optional<String?> country;
/// Original date/time /// Original date/time
DateTime? dateTimeOriginal; Optional<DateTime?> dateTimeOriginal;
/// Image description /// Image description
String? description; Optional<String?> description;
/// Image height in pixels /// Image height in pixels
/// ///
/// Minimum value: 0 /// Minimum value: 0
/// Maximum value: 9007199254740991 /// Maximum value: 9007199254740991
int? exifImageHeight; Optional<int?> exifImageHeight;
/// Image width in pixels /// Image width in pixels
/// ///
/// Minimum value: 0 /// Minimum value: 0
/// Maximum value: 9007199254740991 /// Maximum value: 9007199254740991
int? exifImageWidth; Optional<int?> exifImageWidth;
/// Exposure time /// Exposure time
String? exposureTime; Optional<String?> exposureTime;
/// F-number (aperture) /// F-number (aperture)
num? fNumber; Optional<num?> fNumber;
/// File size in bytes /// File size in bytes
/// ///
/// Minimum value: 0 /// Minimum value: 0
/// Maximum value: 9007199254740991 /// Maximum value: 9007199254740991
int? fileSizeInByte; Optional<int?> fileSizeInByte;
/// Focal length in mm /// Focal length in mm
num? focalLength; Optional<num?> focalLength;
/// ISO sensitivity /// ISO sensitivity
/// ///
/// Minimum value: -9007199254740991 /// Minimum value: -9007199254740991
/// Maximum value: 9007199254740991 /// Maximum value: 9007199254740991
int? iso; Optional<int?> iso;
/// GPS latitude /// GPS latitude
num? latitude; Optional<num?> latitude;
/// Lens model /// Lens model
String? lensModel; Optional<String?> lensModel;
/// GPS longitude /// GPS longitude
num? longitude; Optional<num?> longitude;
/// Camera make /// Camera make
String? make; Optional<String?> make;
/// Camera model /// Camera model
String? model; Optional<String?> model;
/// Modification date/time /// Modification date/time
DateTime? modifyDate; Optional<DateTime?> modifyDate;
/// Image orientation /// Image orientation
String? orientation; Optional<String?> orientation;
/// Projection type /// Projection type
String? projectionType; Optional<String?> projectionType;
/// Rating /// Rating
/// ///
/// Minimum value: -9007199254740991 /// Minimum value: -9007199254740991
/// Maximum value: 9007199254740991 /// Maximum value: 9007199254740991
int? rating; Optional<int?> rating;
/// State/province name /// State/province name
String? state; Optional<String?> state;
/// Time zone /// Time zone
String? timeZone; Optional<String?> timeZone;
@override @override
bool operator ==(Object other) => identical(this, other) || other is ExifResponseDto && bool operator ==(Object other) => identical(this, other) || other is ExifResponseDto &&
@ -174,115 +174,93 @@ class ExifResponseDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.city != null) { if (this.city.isPresent) {
json[r'city'] = this.city; final value = this.city.value;
} else { json[r'city'] = value;
// json[r'city'] = null;
} }
if (this.country != null) { if (this.country.isPresent) {
json[r'country'] = this.country; final value = this.country.value;
} else { json[r'country'] = value;
// json[r'country'] = null;
} }
if (this.dateTimeOriginal != null) { if (this.dateTimeOriginal.isPresent) {
json[r'dateTimeOriginal'] = this.dateTimeOriginal!.toUtc().toIso8601String(); final value = this.dateTimeOriginal.value;
} else { json[r'dateTimeOriginal'] = value == null ? null : value.toUtc().toIso8601String();
// json[r'dateTimeOriginal'] = null;
} }
if (this.description != null) { if (this.description.isPresent) {
json[r'description'] = this.description; final value = this.description.value;
} else { json[r'description'] = value;
// json[r'description'] = null;
} }
if (this.exifImageHeight != null) { if (this.exifImageHeight.isPresent) {
json[r'exifImageHeight'] = this.exifImageHeight; final value = this.exifImageHeight.value;
} else { json[r'exifImageHeight'] = value;
// json[r'exifImageHeight'] = null;
} }
if (this.exifImageWidth != null) { if (this.exifImageWidth.isPresent) {
json[r'exifImageWidth'] = this.exifImageWidth; final value = this.exifImageWidth.value;
} else { json[r'exifImageWidth'] = value;
// json[r'exifImageWidth'] = null;
} }
if (this.exposureTime != null) { if (this.exposureTime.isPresent) {
json[r'exposureTime'] = this.exposureTime; final value = this.exposureTime.value;
} else { json[r'exposureTime'] = value;
// json[r'exposureTime'] = null;
} }
if (this.fNumber != null) { if (this.fNumber.isPresent) {
json[r'fNumber'] = this.fNumber; final value = this.fNumber.value;
} else { json[r'fNumber'] = value;
// json[r'fNumber'] = null;
} }
if (this.fileSizeInByte != null) { if (this.fileSizeInByte.isPresent) {
json[r'fileSizeInByte'] = this.fileSizeInByte; final value = this.fileSizeInByte.value;
} else { json[r'fileSizeInByte'] = value;
// json[r'fileSizeInByte'] = null;
} }
if (this.focalLength != null) { if (this.focalLength.isPresent) {
json[r'focalLength'] = this.focalLength; final value = this.focalLength.value;
} else { json[r'focalLength'] = value;
// json[r'focalLength'] = null;
} }
if (this.iso != null) { if (this.iso.isPresent) {
json[r'iso'] = this.iso; final value = this.iso.value;
} else { json[r'iso'] = value;
// json[r'iso'] = null;
} }
if (this.latitude != null) { if (this.latitude.isPresent) {
json[r'latitude'] = this.latitude; final value = this.latitude.value;
} else { json[r'latitude'] = value;
// json[r'latitude'] = null;
} }
if (this.lensModel != null) { if (this.lensModel.isPresent) {
json[r'lensModel'] = this.lensModel; final value = this.lensModel.value;
} else { json[r'lensModel'] = value;
// json[r'lensModel'] = null;
} }
if (this.longitude != null) { if (this.longitude.isPresent) {
json[r'longitude'] = this.longitude; final value = this.longitude.value;
} else { json[r'longitude'] = value;
// json[r'longitude'] = null;
} }
if (this.make != null) { if (this.make.isPresent) {
json[r'make'] = this.make; final value = this.make.value;
} else { json[r'make'] = value;
// json[r'make'] = null;
} }
if (this.model != null) { if (this.model.isPresent) {
json[r'model'] = this.model; final value = this.model.value;
} else { json[r'model'] = value;
// json[r'model'] = null;
} }
if (this.modifyDate != null) { if (this.modifyDate.isPresent) {
json[r'modifyDate'] = this.modifyDate!.toUtc().toIso8601String(); final value = this.modifyDate.value;
} else { json[r'modifyDate'] = value == null ? null : value.toUtc().toIso8601String();
// json[r'modifyDate'] = null;
} }
if (this.orientation != null) { if (this.orientation.isPresent) {
json[r'orientation'] = this.orientation; final value = this.orientation.value;
} else { json[r'orientation'] = value;
// json[r'orientation'] = null;
} }
if (this.projectionType != null) { if (this.projectionType.isPresent) {
json[r'projectionType'] = this.projectionType; final value = this.projectionType.value;
} else { json[r'projectionType'] = value;
// json[r'projectionType'] = null;
} }
if (this.rating != null) { if (this.rating.isPresent) {
json[r'rating'] = this.rating; final value = this.rating.value;
} else { json[r'rating'] = value;
// json[r'rating'] = null;
} }
if (this.state != null) { if (this.state.isPresent) {
json[r'state'] = this.state; final value = this.state.value;
} else { json[r'state'] = value;
// json[r'state'] = null;
} }
if (this.timeZone != null) { if (this.timeZone.isPresent) {
json[r'timeZone'] = this.timeZone; final value = this.timeZone.value;
} else { json[r'timeZone'] = value;
// json[r'timeZone'] = null;
} }
return json; return json;
} }
@ -296,36 +274,28 @@ class ExifResponseDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return ExifResponseDto( return ExifResponseDto(
city: mapValueOfType<String>(json, r'city'), city: json.containsKey(r'city') ? Optional.present(mapValueOfType<String>(json, r'city')) : const Optional.absent(),
country: mapValueOfType<String>(json, r'country'), country: json.containsKey(r'country') ? Optional.present(mapValueOfType<String>(json, r'country')) : const Optional.absent(),
dateTimeOriginal: mapDateTime(json, r'dateTimeOriginal', r''), dateTimeOriginal: json.containsKey(r'dateTimeOriginal') ? Optional.present(mapDateTime(json, r'dateTimeOriginal', r'')) : const Optional.absent(),
description: mapValueOfType<String>(json, r'description'), description: json.containsKey(r'description') ? Optional.present(mapValueOfType<String>(json, r'description')) : const Optional.absent(),
exifImageHeight: mapValueOfType<int>(json, r'exifImageHeight'), exifImageHeight: json.containsKey(r'exifImageHeight') ? Optional.present(json[r'exifImageHeight'] == null ? null : int.parse('${json[r'exifImageHeight']}')) : const Optional.absent(),
exifImageWidth: mapValueOfType<int>(json, r'exifImageWidth'), exifImageWidth: json.containsKey(r'exifImageWidth') ? Optional.present(json[r'exifImageWidth'] == null ? null : int.parse('${json[r'exifImageWidth']}')) : const Optional.absent(),
exposureTime: mapValueOfType<String>(json, r'exposureTime'), exposureTime: json.containsKey(r'exposureTime') ? Optional.present(mapValueOfType<String>(json, r'exposureTime')) : const Optional.absent(),
fNumber: json[r'fNumber'] == null fNumber: json.containsKey(r'fNumber') ? Optional.present(json[r'fNumber'] == null ? null : num.parse('${json[r'fNumber']}')) : const Optional.absent(),
? null fileSizeInByte: json.containsKey(r'fileSizeInByte') ? Optional.present(json[r'fileSizeInByte'] == null ? null : int.parse('${json[r'fileSizeInByte']}')) : const Optional.absent(),
: num.parse('${json[r'fNumber']}'), focalLength: json.containsKey(r'focalLength') ? Optional.present(json[r'focalLength'] == null ? null : num.parse('${json[r'focalLength']}')) : const Optional.absent(),
fileSizeInByte: mapValueOfType<int>(json, r'fileSizeInByte'), iso: json.containsKey(r'iso') ? Optional.present(json[r'iso'] == null ? null : int.parse('${json[r'iso']}')) : const Optional.absent(),
focalLength: json[r'focalLength'] == null latitude: json.containsKey(r'latitude') ? Optional.present(json[r'latitude'] == null ? null : num.parse('${json[r'latitude']}')) : const Optional.absent(),
? null lensModel: json.containsKey(r'lensModel') ? Optional.present(mapValueOfType<String>(json, r'lensModel')) : const Optional.absent(),
: num.parse('${json[r'focalLength']}'), longitude: json.containsKey(r'longitude') ? Optional.present(json[r'longitude'] == null ? null : num.parse('${json[r'longitude']}')) : const Optional.absent(),
iso: mapValueOfType<int>(json, r'iso'), make: json.containsKey(r'make') ? Optional.present(mapValueOfType<String>(json, r'make')) : const Optional.absent(),
latitude: json[r'latitude'] == null model: json.containsKey(r'model') ? Optional.present(mapValueOfType<String>(json, r'model')) : const Optional.absent(),
? null modifyDate: json.containsKey(r'modifyDate') ? Optional.present(mapDateTime(json, r'modifyDate', r'')) : const Optional.absent(),
: num.parse('${json[r'latitude']}'), orientation: json.containsKey(r'orientation') ? Optional.present(mapValueOfType<String>(json, r'orientation')) : const Optional.absent(),
lensModel: mapValueOfType<String>(json, r'lensModel'), projectionType: json.containsKey(r'projectionType') ? Optional.present(mapValueOfType<String>(json, r'projectionType')) : const Optional.absent(),
longitude: json[r'longitude'] == null rating: json.containsKey(r'rating') ? Optional.present(json[r'rating'] == null ? null : int.parse('${json[r'rating']}')) : const Optional.absent(),
? null state: json.containsKey(r'state') ? Optional.present(mapValueOfType<String>(json, r'state')) : const Optional.absent(),
: num.parse('${json[r'longitude']}'), timeZone: json.containsKey(r'timeZone') ? Optional.present(mapValueOfType<String>(json, r'timeZone')) : const Optional.absent(),
make: mapValueOfType<String>(json, r'make'),
model: mapValueOfType<String>(json, r'model'),
modifyDate: mapDateTime(json, r'modifyDate', r''),
orientation: mapValueOfType<String>(json, r'orientation'),
projectionType: mapValueOfType<String>(json, r'projectionType'),
rating: mapValueOfType<int>(json, r'rating'),
state: mapValueOfType<String>(json, r'state'),
timeZone: mapValueOfType<String>(json, r'timeZone'),
); );
} }
return null; return null;

View File

@ -84,9 +84,9 @@ class FacialRecognitionConfig {
return FacialRecognitionConfig( return FacialRecognitionConfig(
enabled: mapValueOfType<bool>(json, r'enabled')!, enabled: mapValueOfType<bool>(json, r'enabled')!,
maxDistance: (mapValueOfType<num>(json, r'maxDistance')!).toDouble(), maxDistance: mapValueOfType<double>(json, r'maxDistance')!,
minFaces: mapValueOfType<int>(json, r'minFaces')!, minFaces: mapValueOfType<int>(json, r'minFaces')!,
minScore: (mapValueOfType<num>(json, r'minScore')!).toDouble(), minScore: mapValueOfType<double>(json, r'minScore')!,
modelName: mapValueOfType<String>(json, r'modelName')!, modelName: mapValueOfType<String>(json, r'modelName')!,
); );
} }

View File

@ -13,8 +13,8 @@ part of openapi.api;
class FoldersUpdate { class FoldersUpdate {
/// Returns a new [FoldersUpdate] instance. /// Returns a new [FoldersUpdate] instance.
FoldersUpdate({ FoldersUpdate({
this.enabled, this.enabled = const Optional.absent(),
this.sidebarWeb, this.sidebarWeb = const Optional.absent(),
}); });
/// Whether folders are enabled /// Whether folders are enabled
@ -24,7 +24,7 @@ class FoldersUpdate {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? enabled; Optional<bool?> enabled;
/// Whether folders appear in web sidebar /// Whether folders appear in web sidebar
/// ///
@ -33,7 +33,7 @@ class FoldersUpdate {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? sidebarWeb; Optional<bool?> sidebarWeb;
@override @override
bool operator ==(Object other) => identical(this, other) || other is FoldersUpdate && bool operator ==(Object other) => identical(this, other) || other is FoldersUpdate &&
@ -51,15 +51,13 @@ class FoldersUpdate {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.enabled != null) { if (this.enabled.isPresent) {
json[r'enabled'] = this.enabled; final value = this.enabled.value;
} else { json[r'enabled'] = value;
// json[r'enabled'] = null;
} }
if (this.sidebarWeb != null) { if (this.sidebarWeb.isPresent) {
json[r'sidebarWeb'] = this.sidebarWeb; final value = this.sidebarWeb.value;
} else { json[r'sidebarWeb'] = value;
// json[r'sidebarWeb'] = null;
} }
return json; return json;
} }
@ -73,8 +71,8 @@ class FoldersUpdate {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return FoldersUpdate( return FoldersUpdate(
enabled: mapValueOfType<bool>(json, r'enabled'), enabled: json.containsKey(r'enabled') ? Optional.present(mapValueOfType<bool>(json, r'enabled')) : const Optional.absent(),
sidebarWeb: mapValueOfType<bool>(json, r'sidebarWeb'), sidebarWeb: json.containsKey(r'sidebarWeb') ? Optional.present(mapValueOfType<bool>(json, r'sidebarWeb')) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -98,7 +98,7 @@ class LibraryResponseDto {
? this.refreshedAt!.millisecondsSinceEpoch ? this.refreshedAt!.millisecondsSinceEpoch
: this.refreshedAt!.toUtc().toIso8601String(); : this.refreshedAt!.toUtc().toIso8601String();
} else { } else {
// json[r'refreshedAt'] = null; json[r'refreshedAt'] = null;
} }
json[r'updatedAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') json[r'updatedAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
? this.updatedAt.millisecondsSinceEpoch ? this.updatedAt.millisecondsSinceEpoch

View File

@ -13,7 +13,7 @@ part of openapi.api;
class MaintenanceLoginDto { class MaintenanceLoginDto {
/// Returns a new [MaintenanceLoginDto] instance. /// Returns a new [MaintenanceLoginDto] instance.
MaintenanceLoginDto({ MaintenanceLoginDto({
this.token, this.token = const Optional.absent(),
}); });
/// Maintenance token /// Maintenance token
@ -23,7 +23,7 @@ class MaintenanceLoginDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? token; Optional<String?> token;
@override @override
bool operator ==(Object other) => identical(this, other) || other is MaintenanceLoginDto && bool operator ==(Object other) => identical(this, other) || other is MaintenanceLoginDto &&
@ -39,10 +39,9 @@ class MaintenanceLoginDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.token != null) { if (this.token.isPresent) {
json[r'token'] = this.token; final value = this.token.value;
} else { json[r'token'] = value;
// json[r'token'] = null;
} }
return json; return json;
} }
@ -56,7 +55,7 @@ class MaintenanceLoginDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return MaintenanceLoginDto( return MaintenanceLoginDto(
token: mapValueOfType<String>(json, r'token'), token: json.containsKey(r'token') ? Optional.present(mapValueOfType<String>(json, r'token')) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -15,9 +15,9 @@ class MaintenanceStatusResponseDto {
MaintenanceStatusResponseDto({ MaintenanceStatusResponseDto({
required this.action, required this.action,
required this.active, required this.active,
this.error, this.error = const Optional.absent(),
this.progress, this.progress = const Optional.absent(),
this.task, this.task = const Optional.absent(),
}); });
MaintenanceAction action; MaintenanceAction action;
@ -30,7 +30,7 @@ class MaintenanceStatusResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? error; Optional<String?> error;
/// Minimum value: -9007199254740991 /// Minimum value: -9007199254740991
/// Maximum value: 9007199254740991 /// Maximum value: 9007199254740991
@ -40,7 +40,7 @@ class MaintenanceStatusResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
int? progress; Optional<int?> progress;
/// ///
/// Please note: This property should have been non-nullable! Since the specification file /// Please note: This property should have been non-nullable! Since the specification file
@ -48,7 +48,7 @@ class MaintenanceStatusResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? task; Optional<String?> task;
@override @override
bool operator ==(Object other) => identical(this, other) || other is MaintenanceStatusResponseDto && bool operator ==(Object other) => identical(this, other) || other is MaintenanceStatusResponseDto &&
@ -74,20 +74,17 @@ class MaintenanceStatusResponseDto {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
json[r'action'] = this.action; json[r'action'] = this.action;
json[r'active'] = this.active; json[r'active'] = this.active;
if (this.error != null) { if (this.error.isPresent) {
json[r'error'] = this.error; final value = this.error.value;
} else { json[r'error'] = value;
// json[r'error'] = null;
} }
if (this.progress != null) { if (this.progress.isPresent) {
json[r'progress'] = this.progress; final value = this.progress.value;
} else { json[r'progress'] = value;
// json[r'progress'] = null;
} }
if (this.task != null) { if (this.task.isPresent) {
json[r'task'] = this.task; final value = this.task.value;
} else { json[r'task'] = value;
// json[r'task'] = null;
} }
return json; return json;
} }
@ -103,9 +100,9 @@ class MaintenanceStatusResponseDto {
return MaintenanceStatusResponseDto( return MaintenanceStatusResponseDto(
action: MaintenanceAction.fromJson(json[r'action'])!, action: MaintenanceAction.fromJson(json[r'action'])!,
active: mapValueOfType<bool>(json, r'active')!, active: mapValueOfType<bool>(json, r'active')!,
error: mapValueOfType<String>(json, r'error'), error: json.containsKey(r'error') ? Optional.present(mapValueOfType<String>(json, r'error')) : const Optional.absent(),
progress: mapValueOfType<int>(json, r'progress'), progress: json.containsKey(r'progress') ? Optional.present(json[r'progress'] == null ? null : int.parse('${json[r'progress']}')) : const Optional.absent(),
task: mapValueOfType<String>(json, r'task'), task: json.containsKey(r'task') ? Optional.present(mapValueOfType<String>(json, r'task')) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -66,12 +66,12 @@ class MapMarkerResponseDto {
if (this.city != null) { if (this.city != null) {
json[r'city'] = this.city; json[r'city'] = this.city;
} else { } else {
// json[r'city'] = null; json[r'city'] = null;
} }
if (this.country != null) { if (this.country != null) {
json[r'country'] = this.country; json[r'country'] = this.country;
} else { } else {
// json[r'country'] = null; json[r'country'] = null;
} }
json[r'id'] = this.id; json[r'id'] = this.id;
json[r'lat'] = this.lat; json[r'lat'] = this.lat;
@ -79,7 +79,7 @@ class MapMarkerResponseDto {
if (this.state != null) { if (this.state != null) {
json[r'state'] = this.state; json[r'state'] = this.state;
} else { } else {
// json[r'state'] = null; json[r'state'] = null;
} }
return json; return json;
} }
@ -96,8 +96,8 @@ class MapMarkerResponseDto {
city: mapValueOfType<String>(json, r'city'), city: mapValueOfType<String>(json, r'city'),
country: mapValueOfType<String>(json, r'country'), country: mapValueOfType<String>(json, r'country'),
id: mapValueOfType<String>(json, r'id')!, id: mapValueOfType<String>(json, r'id')!,
lat: (mapValueOfType<num>(json, r'lat')!).toDouble(), lat: mapValueOfType<double>(json, r'lat')!,
lon: (mapValueOfType<num>(json, r'lon')!).toDouble(), lon: mapValueOfType<double>(json, r'lon')!,
state: mapValueOfType<String>(json, r'state'), state: mapValueOfType<String>(json, r'state'),
); );
} }

View File

@ -48,17 +48,17 @@ class MapReverseGeocodeResponseDto {
if (this.city != null) { if (this.city != null) {
json[r'city'] = this.city; json[r'city'] = this.city;
} else { } else {
// json[r'city'] = null; json[r'city'] = null;
} }
if (this.country != null) { if (this.country != null) {
json[r'country'] = this.country; json[r'country'] = this.country;
} else { } else {
// json[r'country'] = null; json[r'country'] = null;
} }
if (this.state != null) { if (this.state != null) {
json[r'state'] = this.state; json[r'state'] = this.state;
} else { } else {
// json[r'state'] = null; json[r'state'] = null;
} }
return json; return json;
} }

View File

@ -13,8 +13,8 @@ part of openapi.api;
class MemoriesUpdate { class MemoriesUpdate {
/// Returns a new [MemoriesUpdate] instance. /// Returns a new [MemoriesUpdate] instance.
MemoriesUpdate({ MemoriesUpdate({
this.duration, this.duration = const Optional.absent(),
this.enabled, this.enabled = const Optional.absent(),
}); });
/// Memory duration in seconds /// Memory duration in seconds
@ -27,7 +27,7 @@ class MemoriesUpdate {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
int? duration; Optional<int?> duration;
/// Whether memories are enabled /// Whether memories are enabled
/// ///
@ -36,7 +36,7 @@ class MemoriesUpdate {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? enabled; Optional<bool?> enabled;
@override @override
bool operator ==(Object other) => identical(this, other) || other is MemoriesUpdate && bool operator ==(Object other) => identical(this, other) || other is MemoriesUpdate &&
@ -54,15 +54,13 @@ class MemoriesUpdate {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.duration != null) { if (this.duration.isPresent) {
json[r'duration'] = this.duration; final value = this.duration.value;
} else { json[r'duration'] = value;
// json[r'duration'] = null;
} }
if (this.enabled != null) { if (this.enabled.isPresent) {
json[r'enabled'] = this.enabled; final value = this.enabled.value;
} else { json[r'enabled'] = value;
// json[r'enabled'] = null;
} }
return json; return json;
} }
@ -76,8 +74,8 @@ class MemoriesUpdate {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return MemoriesUpdate( return MemoriesUpdate(
duration: mapValueOfType<int>(json, r'duration'), duration: json.containsKey(r'duration') ? Optional.present(json[r'duration'] == null ? null : int.parse('${json[r'duration']}')) : const Optional.absent(),
enabled: mapValueOfType<bool>(json, r'enabled'), enabled: json.containsKey(r'enabled') ? Optional.present(mapValueOfType<bool>(json, r'enabled')) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -13,18 +13,18 @@ part of openapi.api;
class MemoryCreateDto { class MemoryCreateDto {
/// Returns a new [MemoryCreateDto] instance. /// Returns a new [MemoryCreateDto] instance.
MemoryCreateDto({ MemoryCreateDto({
this.assetIds = const [], this.assetIds = const Optional.present(const []),
required this.data, required this.data,
this.hideAt, this.hideAt = const Optional.absent(),
this.isSaved, this.isSaved = const Optional.absent(),
required this.memoryAt, required this.memoryAt,
this.seenAt, this.seenAt = const Optional.absent(),
this.showAt, this.showAt = const Optional.absent(),
required this.type, required this.type,
}); });
/// Asset IDs to associate with memory /// Asset IDs to associate with memory
List<String> assetIds; Optional<List<String>?> assetIds;
OnThisDayDto data; OnThisDayDto data;
@ -35,7 +35,7 @@ class MemoryCreateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? hideAt; Optional<DateTime?> hideAt;
/// Is memory saved /// Is memory saved
/// ///
@ -44,7 +44,7 @@ class MemoryCreateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? isSaved; Optional<bool?> isSaved;
/// Memory date /// Memory date
DateTime memoryAt; DateTime memoryAt;
@ -56,7 +56,7 @@ class MemoryCreateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? seenAt; Optional<DateTime?> seenAt;
/// Date when memory should be shown /// Date when memory should be shown
/// ///
@ -65,7 +65,7 @@ class MemoryCreateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? showAt; Optional<DateTime?> showAt;
MemoryType type; MemoryType type;
@ -97,36 +97,35 @@ class MemoryCreateDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
json[r'assetIds'] = this.assetIds; if (this.assetIds.isPresent) {
json[r'data'] = this.data; final value = this.assetIds.value;
if (this.hideAt != null) { json[r'assetIds'] = value;
json[r'hideAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
? this.hideAt!.millisecondsSinceEpoch
: this.hideAt!.toUtc().toIso8601String();
} else {
// json[r'hideAt'] = null;
} }
if (this.isSaved != null) { json[r'data'] = this.data;
json[r'isSaved'] = this.isSaved; if (this.hideAt.isPresent) {
} else { final value = this.hideAt.value;
// json[r'isSaved'] = null; json[r'hideAt'] = value == null ? null : (_isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
? value.millisecondsSinceEpoch
: value.toUtc().toIso8601String());
}
if (this.isSaved.isPresent) {
final value = this.isSaved.value;
json[r'isSaved'] = value;
} }
json[r'memoryAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') json[r'memoryAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
? this.memoryAt.millisecondsSinceEpoch ? this.memoryAt.millisecondsSinceEpoch
: this.memoryAt.toUtc().toIso8601String(); : this.memoryAt.toUtc().toIso8601String();
if (this.seenAt != null) { if (this.seenAt.isPresent) {
json[r'seenAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') final value = this.seenAt.value;
? this.seenAt!.millisecondsSinceEpoch json[r'seenAt'] = value == null ? null : (_isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
: this.seenAt!.toUtc().toIso8601String(); ? value.millisecondsSinceEpoch
} else { : value.toUtc().toIso8601String());
// json[r'seenAt'] = null;
} }
if (this.showAt != null) { if (this.showAt.isPresent) {
json[r'showAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') final value = this.showAt.value;
? this.showAt!.millisecondsSinceEpoch json[r'showAt'] = value == null ? null : (_isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
: this.showAt!.toUtc().toIso8601String(); ? value.millisecondsSinceEpoch
} else { : value.toUtc().toIso8601String());
// json[r'showAt'] = null;
} }
json[r'type'] = this.type; json[r'type'] = this.type;
return json; return json;
@ -141,15 +140,15 @@ class MemoryCreateDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return MemoryCreateDto( return MemoryCreateDto(
assetIds: json[r'assetIds'] is Iterable assetIds: json.containsKey(r'assetIds') ? Optional.present(json[r'assetIds'] is Iterable
? (json[r'assetIds'] as Iterable).cast<String>().toList(growable: false) ? (json[r'assetIds'] as Iterable).cast<String>().toList(growable: false)
: const [], : const []) : const Optional.absent(),
data: OnThisDayDto.fromJson(json[r'data'])!, data: OnThisDayDto.fromJson(json[r'data'])!,
hideAt: mapDateTime(json, r'hideAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), hideAt: json.containsKey(r'hideAt') ? Optional.present(mapDateTime(json, r'hideAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(),
isSaved: mapValueOfType<bool>(json, r'isSaved'), isSaved: json.containsKey(r'isSaved') ? Optional.present(mapValueOfType<bool>(json, r'isSaved')) : const Optional.absent(),
memoryAt: mapDateTime(json, r'memoryAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')!, memoryAt: mapDateTime(json, r'memoryAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')!,
seenAt: mapDateTime(json, r'seenAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), seenAt: json.containsKey(r'seenAt') ? Optional.present(mapDateTime(json, r'seenAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(),
showAt: mapDateTime(json, r'showAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), showAt: json.containsKey(r'showAt') ? Optional.present(mapDateTime(json, r'showAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(),
type: MemoryType.fromJson(json[r'type'])!, type: MemoryType.fromJson(json[r'type'])!,
); );
} }

View File

@ -16,14 +16,14 @@ class MemoryResponseDto {
this.assets = const [], this.assets = const [],
required this.createdAt, required this.createdAt,
required this.data, required this.data,
this.deletedAt, this.deletedAt = const Optional.absent(),
this.hideAt, this.hideAt = const Optional.absent(),
required this.id, required this.id,
required this.isSaved, required this.isSaved,
required this.memoryAt, required this.memoryAt,
required this.ownerId, required this.ownerId,
this.seenAt, this.seenAt = const Optional.absent(),
this.showAt, this.showAt = const Optional.absent(),
required this.type, required this.type,
required this.updatedAt, required this.updatedAt,
}); });
@ -42,7 +42,7 @@ class MemoryResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? deletedAt; Optional<DateTime?> deletedAt;
/// Date when memory should be hidden /// Date when memory should be hidden
/// ///
@ -51,7 +51,7 @@ class MemoryResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? hideAt; Optional<DateTime?> hideAt;
/// Memory ID /// Memory ID
String id; String id;
@ -72,7 +72,7 @@ class MemoryResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? seenAt; Optional<DateTime?> seenAt;
/// Date when memory should be shown /// Date when memory should be shown
/// ///
@ -81,7 +81,7 @@ class MemoryResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? showAt; Optional<DateTime?> showAt;
MemoryType type; MemoryType type;
@ -131,19 +131,17 @@ class MemoryResponseDto {
? this.createdAt.millisecondsSinceEpoch ? this.createdAt.millisecondsSinceEpoch
: this.createdAt.toUtc().toIso8601String(); : this.createdAt.toUtc().toIso8601String();
json[r'data'] = this.data; json[r'data'] = this.data;
if (this.deletedAt != null) { if (this.deletedAt.isPresent) {
json[r'deletedAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') final value = this.deletedAt.value;
? this.deletedAt!.millisecondsSinceEpoch json[r'deletedAt'] = value == null ? null : (_isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
: this.deletedAt!.toUtc().toIso8601String(); ? value.millisecondsSinceEpoch
} else { : value.toUtc().toIso8601String());
// json[r'deletedAt'] = null;
} }
if (this.hideAt != null) { if (this.hideAt.isPresent) {
json[r'hideAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') final value = this.hideAt.value;
? this.hideAt!.millisecondsSinceEpoch json[r'hideAt'] = value == null ? null : (_isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
: this.hideAt!.toUtc().toIso8601String(); ? value.millisecondsSinceEpoch
} else { : value.toUtc().toIso8601String());
// json[r'hideAt'] = null;
} }
json[r'id'] = this.id; json[r'id'] = this.id;
json[r'isSaved'] = this.isSaved; json[r'isSaved'] = this.isSaved;
@ -151,19 +149,17 @@ class MemoryResponseDto {
? this.memoryAt.millisecondsSinceEpoch ? this.memoryAt.millisecondsSinceEpoch
: this.memoryAt.toUtc().toIso8601String(); : this.memoryAt.toUtc().toIso8601String();
json[r'ownerId'] = this.ownerId; json[r'ownerId'] = this.ownerId;
if (this.seenAt != null) { if (this.seenAt.isPresent) {
json[r'seenAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') final value = this.seenAt.value;
? this.seenAt!.millisecondsSinceEpoch json[r'seenAt'] = value == null ? null : (_isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
: this.seenAt!.toUtc().toIso8601String(); ? value.millisecondsSinceEpoch
} else { : value.toUtc().toIso8601String());
// json[r'seenAt'] = null;
} }
if (this.showAt != null) { if (this.showAt.isPresent) {
json[r'showAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') final value = this.showAt.value;
? this.showAt!.millisecondsSinceEpoch json[r'showAt'] = value == null ? null : (_isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
: this.showAt!.toUtc().toIso8601String(); ? value.millisecondsSinceEpoch
} else { : value.toUtc().toIso8601String());
// json[r'showAt'] = null;
} }
json[r'type'] = this.type; json[r'type'] = this.type;
json[r'updatedAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') json[r'updatedAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
@ -184,14 +180,14 @@ class MemoryResponseDto {
assets: AssetResponseDto.listFromJson(json[r'assets']), assets: AssetResponseDto.listFromJson(json[r'assets']),
createdAt: mapDateTime(json, r'createdAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')!, createdAt: mapDateTime(json, r'createdAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')!,
data: OnThisDayDto.fromJson(json[r'data'])!, data: OnThisDayDto.fromJson(json[r'data'])!,
deletedAt: mapDateTime(json, r'deletedAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), deletedAt: json.containsKey(r'deletedAt') ? Optional.present(mapDateTime(json, r'deletedAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(),
hideAt: mapDateTime(json, r'hideAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), hideAt: json.containsKey(r'hideAt') ? Optional.present(mapDateTime(json, r'hideAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(),
id: mapValueOfType<String>(json, r'id')!, id: mapValueOfType<String>(json, r'id')!,
isSaved: mapValueOfType<bool>(json, r'isSaved')!, isSaved: mapValueOfType<bool>(json, r'isSaved')!,
memoryAt: mapDateTime(json, r'memoryAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')!, memoryAt: mapDateTime(json, r'memoryAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')!,
ownerId: mapValueOfType<String>(json, r'ownerId')!, ownerId: mapValueOfType<String>(json, r'ownerId')!,
seenAt: mapDateTime(json, r'seenAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), seenAt: json.containsKey(r'seenAt') ? Optional.present(mapDateTime(json, r'seenAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(),
showAt: mapDateTime(json, r'showAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), showAt: json.containsKey(r'showAt') ? Optional.present(mapDateTime(json, r'showAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(),
type: MemoryType.fromJson(json[r'type'])!, type: MemoryType.fromJson(json[r'type'])!,
updatedAt: mapDateTime(json, r'updatedAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')!, updatedAt: mapDateTime(json, r'updatedAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')!,
); );

View File

@ -13,9 +13,9 @@ part of openapi.api;
class MemoryUpdateDto { class MemoryUpdateDto {
/// Returns a new [MemoryUpdateDto] instance. /// Returns a new [MemoryUpdateDto] instance.
MemoryUpdateDto({ MemoryUpdateDto({
this.isSaved, this.isSaved = const Optional.absent(),
this.memoryAt, this.memoryAt = const Optional.absent(),
this.seenAt, this.seenAt = const Optional.absent(),
}); });
/// Is memory saved /// Is memory saved
@ -25,7 +25,7 @@ class MemoryUpdateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? isSaved; Optional<bool?> isSaved;
/// Memory date /// Memory date
/// ///
@ -34,7 +34,7 @@ class MemoryUpdateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? memoryAt; Optional<DateTime?> memoryAt;
/// Date when memory was seen /// Date when memory was seen
/// ///
@ -43,7 +43,7 @@ class MemoryUpdateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? seenAt; Optional<DateTime?> seenAt;
@override @override
bool operator ==(Object other) => identical(this, other) || other is MemoryUpdateDto && bool operator ==(Object other) => identical(this, other) || other is MemoryUpdateDto &&
@ -63,24 +63,21 @@ class MemoryUpdateDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.isSaved != null) { if (this.isSaved.isPresent) {
json[r'isSaved'] = this.isSaved; final value = this.isSaved.value;
} else { json[r'isSaved'] = value;
// json[r'isSaved'] = null;
} }
if (this.memoryAt != null) { if (this.memoryAt.isPresent) {
json[r'memoryAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') final value = this.memoryAt.value;
? this.memoryAt!.millisecondsSinceEpoch json[r'memoryAt'] = value == null ? null : (_isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
: this.memoryAt!.toUtc().toIso8601String(); ? value.millisecondsSinceEpoch
} else { : value.toUtc().toIso8601String());
// json[r'memoryAt'] = null;
} }
if (this.seenAt != null) { if (this.seenAt.isPresent) {
json[r'seenAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') final value = this.seenAt.value;
? this.seenAt!.millisecondsSinceEpoch json[r'seenAt'] = value == null ? null : (_isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
: this.seenAt!.toUtc().toIso8601String(); ? value.millisecondsSinceEpoch
} else { : value.toUtc().toIso8601String());
// json[r'seenAt'] = null;
} }
return json; return json;
} }
@ -94,9 +91,9 @@ class MemoryUpdateDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return MemoryUpdateDto( return MemoryUpdateDto(
isSaved: mapValueOfType<bool>(json, r'isSaved'), isSaved: json.containsKey(r'isSaved') ? Optional.present(mapValueOfType<bool>(json, r'isSaved')) : const Optional.absent(),
memoryAt: mapDateTime(json, r'memoryAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), memoryAt: json.containsKey(r'memoryAt') ? Optional.present(mapDateTime(json, r'memoryAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(),
seenAt: mapDateTime(json, r'seenAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), seenAt: json.containsKey(r'seenAt') ? Optional.present(mapDateTime(json, r'seenAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -13,52 +13,52 @@ part of openapi.api;
class MetadataSearchDto { class MetadataSearchDto {
/// Returns a new [MetadataSearchDto] instance. /// Returns a new [MetadataSearchDto] instance.
MetadataSearchDto({ MetadataSearchDto({
this.albumIds = const [], this.albumIds = const Optional.present(const []),
this.checksum, this.checksum = const Optional.absent(),
this.city, this.city = const Optional.absent(),
this.country, this.country = const Optional.absent(),
this.createdAfter, this.createdAfter = const Optional.absent(),
this.createdBefore, this.createdBefore = const Optional.absent(),
this.description, this.description = const Optional.absent(),
this.encodedVideoPath, this.encodedVideoPath = const Optional.absent(),
this.id, this.id = const Optional.absent(),
this.isEncoded, this.isEncoded = const Optional.absent(),
this.isFavorite, this.isFavorite = const Optional.absent(),
this.isMotion, this.isMotion = const Optional.absent(),
this.isNotInAlbum, this.isNotInAlbum = const Optional.absent(),
this.isOffline, this.isOffline = const Optional.absent(),
this.lensModel, this.lensModel = const Optional.absent(),
this.libraryId, this.libraryId = const Optional.absent(),
this.make, this.make = const Optional.absent(),
this.model, this.model = const Optional.absent(),
this.ocr, this.ocr = const Optional.absent(),
this.order, this.order = const Optional.absent(),
this.originalFileName, this.originalFileName = const Optional.absent(),
this.originalPath, this.originalPath = const Optional.absent(),
this.page, this.page = const Optional.absent(),
this.personIds = const [], this.personIds = const Optional.present(const []),
this.previewPath, this.previewPath = const Optional.absent(),
this.rating, this.rating = const Optional.absent(),
this.size, this.size = const Optional.absent(),
this.state, this.state = const Optional.absent(),
this.tagIds = const [], this.tagIds = const Optional.present(const []),
this.takenAfter, this.takenAfter = const Optional.absent(),
this.takenBefore, this.takenBefore = const Optional.absent(),
this.thumbnailPath, this.thumbnailPath = const Optional.absent(),
this.trashedAfter, this.trashedAfter = const Optional.absent(),
this.trashedBefore, this.trashedBefore = const Optional.absent(),
this.type, this.type = const Optional.absent(),
this.updatedAfter, this.updatedAfter = const Optional.absent(),
this.updatedBefore, this.updatedBefore = const Optional.absent(),
this.visibility, this.visibility = const Optional.absent(),
this.withDeleted, this.withDeleted = const Optional.absent(),
this.withExif, this.withExif = const Optional.absent(),
this.withPeople, this.withPeople = const Optional.absent(),
this.withStacked, this.withStacked = const Optional.absent(),
}); });
/// Filter by album IDs /// Filter by album IDs
List<String> albumIds; Optional<List<String>?> albumIds;
/// Filter by file checksum /// Filter by file checksum
/// ///
@ -67,13 +67,13 @@ class MetadataSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? checksum; Optional<String?> checksum;
/// Filter by city name /// Filter by city name
String? city; Optional<String?> city;
/// Filter by country name /// Filter by country name
String? country; Optional<String?> country;
/// Filter by creation date (after) /// Filter by creation date (after)
/// ///
@ -82,7 +82,7 @@ class MetadataSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? createdAfter; Optional<DateTime?> createdAfter;
/// Filter by creation date (before) /// Filter by creation date (before)
/// ///
@ -91,7 +91,7 @@ class MetadataSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? createdBefore; Optional<DateTime?> createdBefore;
/// Filter by description text /// Filter by description text
/// ///
@ -100,7 +100,7 @@ class MetadataSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? description; Optional<String?> description;
/// Filter by encoded video file path /// Filter by encoded video file path
/// ///
@ -109,7 +109,7 @@ class MetadataSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? encodedVideoPath; Optional<String?> encodedVideoPath;
/// Filter by asset ID /// Filter by asset ID
/// ///
@ -118,7 +118,7 @@ class MetadataSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? id; Optional<String?> id;
/// Filter by encoded status /// Filter by encoded status
/// ///
@ -127,7 +127,7 @@ class MetadataSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? isEncoded; Optional<bool?> isEncoded;
/// Filter by favorite status /// Filter by favorite status
/// ///
@ -136,7 +136,7 @@ class MetadataSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? isFavorite; Optional<bool?> isFavorite;
/// Filter by motion photo status /// Filter by motion photo status
/// ///
@ -145,7 +145,7 @@ class MetadataSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? isMotion; Optional<bool?> isMotion;
/// Filter assets not in any album /// Filter assets not in any album
/// ///
@ -154,7 +154,7 @@ class MetadataSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? isNotInAlbum; Optional<bool?> isNotInAlbum;
/// Filter by offline status /// Filter by offline status
/// ///
@ -163,19 +163,19 @@ class MetadataSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? isOffline; Optional<bool?> isOffline;
/// Filter by lens model /// Filter by lens model
String? lensModel; Optional<String?> lensModel;
/// Library ID to filter by /// Library ID to filter by
String? libraryId; Optional<String?> libraryId;
/// Filter by camera make /// Filter by camera make
String? make; Optional<String?> make;
/// Filter by camera model /// Filter by camera model
String? model; Optional<String?> model;
/// Filter by OCR text content /// Filter by OCR text content
/// ///
@ -184,7 +184,7 @@ class MetadataSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? ocr; Optional<String?> ocr;
/// ///
/// Please note: This property should have been non-nullable! Since the specification file /// Please note: This property should have been non-nullable! Since the specification file
@ -192,7 +192,7 @@ class MetadataSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
AssetOrder? order; Optional<AssetOrder?> order;
/// Filter by original file name /// Filter by original file name
/// ///
@ -201,7 +201,7 @@ class MetadataSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? originalFileName; Optional<String?> originalFileName;
/// Filter by original file path /// Filter by original file path
/// ///
@ -210,7 +210,7 @@ class MetadataSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? originalPath; Optional<String?> originalPath;
/// Page number /// Page number
/// ///
@ -222,10 +222,10 @@ class MetadataSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
int? page; Optional<int?> page;
/// Filter by person IDs /// Filter by person IDs
List<String> personIds; Optional<List<String>?> personIds;
/// Filter by preview file path /// Filter by preview file path
/// ///
@ -234,13 +234,13 @@ class MetadataSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? previewPath; Optional<String?> previewPath;
/// Filter by rating [1-5], or null for unrated /// Filter by rating [1-5], or null for unrated
/// ///
/// Minimum value: -1 /// Minimum value: -1
/// Maximum value: 5 /// Maximum value: 5
int? rating; Optional<int?> rating;
/// Number of results to return /// Number of results to return
/// ///
@ -252,13 +252,13 @@ class MetadataSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
int? size; Optional<int?> size;
/// Filter by state/province name /// Filter by state/province name
String? state; Optional<String?> state;
/// Filter by tag IDs /// Filter by tag IDs
List<String>? tagIds; Optional<List<String>?> tagIds;
/// Filter by taken date (after) /// Filter by taken date (after)
/// ///
@ -267,7 +267,7 @@ class MetadataSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? takenAfter; Optional<DateTime?> takenAfter;
/// Filter by taken date (before) /// Filter by taken date (before)
/// ///
@ -276,7 +276,7 @@ class MetadataSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? takenBefore; Optional<DateTime?> takenBefore;
/// Filter by thumbnail file path /// Filter by thumbnail file path
/// ///
@ -285,7 +285,7 @@ class MetadataSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? thumbnailPath; Optional<String?> thumbnailPath;
/// Filter by trash date (after) /// Filter by trash date (after)
/// ///
@ -294,7 +294,7 @@ class MetadataSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? trashedAfter; Optional<DateTime?> trashedAfter;
/// Filter by trash date (before) /// Filter by trash date (before)
/// ///
@ -303,7 +303,7 @@ class MetadataSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? trashedBefore; Optional<DateTime?> trashedBefore;
/// ///
/// Please note: This property should have been non-nullable! Since the specification file /// Please note: This property should have been non-nullable! Since the specification file
@ -311,7 +311,7 @@ class MetadataSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
AssetTypeEnum? type; Optional<AssetTypeEnum?> type;
/// Filter by update date (after) /// Filter by update date (after)
/// ///
@ -320,7 +320,7 @@ class MetadataSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? updatedAfter; Optional<DateTime?> updatedAfter;
/// Filter by update date (before) /// Filter by update date (before)
/// ///
@ -329,7 +329,7 @@ class MetadataSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? updatedBefore; Optional<DateTime?> updatedBefore;
/// ///
/// Please note: This property should have been non-nullable! Since the specification file /// Please note: This property should have been non-nullable! Since the specification file
@ -337,7 +337,7 @@ class MetadataSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
AssetVisibility? visibility; Optional<AssetVisibility?> visibility;
/// Include deleted assets /// Include deleted assets
/// ///
@ -346,7 +346,7 @@ class MetadataSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? withDeleted; Optional<bool?> withDeleted;
/// Include EXIF data in response /// Include EXIF data in response
/// ///
@ -355,7 +355,7 @@ class MetadataSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? withExif; Optional<bool?> withExif;
/// Include people data in response /// Include people data in response
/// ///
@ -364,7 +364,7 @@ class MetadataSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? withPeople; Optional<bool?> withPeople;
/// Include stacked assets /// Include stacked assets
/// ///
@ -373,7 +373,7 @@ class MetadataSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? withStacked; Optional<bool?> withStacked;
@override @override
bool operator ==(Object other) => identical(this, other) || other is MetadataSearchDto && bool operator ==(Object other) => identical(this, other) || other is MetadataSearchDto &&
@ -471,223 +471,189 @@ class MetadataSearchDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
json[r'albumIds'] = this.albumIds; if (this.albumIds.isPresent) {
if (this.checksum != null) { final value = this.albumIds.value;
json[r'checksum'] = this.checksum; json[r'albumIds'] = value;
} else {
// json[r'checksum'] = null;
} }
if (this.city != null) { if (this.checksum.isPresent) {
json[r'city'] = this.city; final value = this.checksum.value;
} else { json[r'checksum'] = value;
// json[r'city'] = null;
} }
if (this.country != null) { if (this.city.isPresent) {
json[r'country'] = this.country; final value = this.city.value;
} else { json[r'city'] = value;
// json[r'country'] = null;
} }
if (this.createdAfter != null) { if (this.country.isPresent) {
json[r'createdAfter'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') final value = this.country.value;
? this.createdAfter!.millisecondsSinceEpoch json[r'country'] = value;
: this.createdAfter!.toUtc().toIso8601String();
} else {
// json[r'createdAfter'] = null;
} }
if (this.createdBefore != null) { if (this.createdAfter.isPresent) {
json[r'createdBefore'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') final value = this.createdAfter.value;
? this.createdBefore!.millisecondsSinceEpoch json[r'createdAfter'] = value == null ? null : (_isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
: this.createdBefore!.toUtc().toIso8601String(); ? value.millisecondsSinceEpoch
} else { : value.toUtc().toIso8601String());
// json[r'createdBefore'] = null;
} }
if (this.description != null) { if (this.createdBefore.isPresent) {
json[r'description'] = this.description; final value = this.createdBefore.value;
} else { json[r'createdBefore'] = value == null ? null : (_isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
// json[r'description'] = null; ? value.millisecondsSinceEpoch
: value.toUtc().toIso8601String());
} }
if (this.encodedVideoPath != null) { if (this.description.isPresent) {
json[r'encodedVideoPath'] = this.encodedVideoPath; final value = this.description.value;
} else { json[r'description'] = value;
// json[r'encodedVideoPath'] = null;
} }
if (this.id != null) { if (this.encodedVideoPath.isPresent) {
json[r'id'] = this.id; final value = this.encodedVideoPath.value;
} else { json[r'encodedVideoPath'] = value;
// json[r'id'] = null;
} }
if (this.isEncoded != null) { if (this.id.isPresent) {
json[r'isEncoded'] = this.isEncoded; final value = this.id.value;
} else { json[r'id'] = value;
// json[r'isEncoded'] = null;
} }
if (this.isFavorite != null) { if (this.isEncoded.isPresent) {
json[r'isFavorite'] = this.isFavorite; final value = this.isEncoded.value;
} else { json[r'isEncoded'] = value;
// json[r'isFavorite'] = null;
} }
if (this.isMotion != null) { if (this.isFavorite.isPresent) {
json[r'isMotion'] = this.isMotion; final value = this.isFavorite.value;
} else { json[r'isFavorite'] = value;
// json[r'isMotion'] = null;
} }
if (this.isNotInAlbum != null) { if (this.isMotion.isPresent) {
json[r'isNotInAlbum'] = this.isNotInAlbum; final value = this.isMotion.value;
} else { json[r'isMotion'] = value;
// json[r'isNotInAlbum'] = null;
} }
if (this.isOffline != null) { if (this.isNotInAlbum.isPresent) {
json[r'isOffline'] = this.isOffline; final value = this.isNotInAlbum.value;
} else { json[r'isNotInAlbum'] = value;
// json[r'isOffline'] = null;
} }
if (this.lensModel != null) { if (this.isOffline.isPresent) {
json[r'lensModel'] = this.lensModel; final value = this.isOffline.value;
} else { json[r'isOffline'] = value;
// json[r'lensModel'] = null;
} }
if (this.libraryId != null) { if (this.lensModel.isPresent) {
json[r'libraryId'] = this.libraryId; final value = this.lensModel.value;
} else { json[r'lensModel'] = value;
// json[r'libraryId'] = null;
} }
if (this.make != null) { if (this.libraryId.isPresent) {
json[r'make'] = this.make; final value = this.libraryId.value;
} else { json[r'libraryId'] = value;
// json[r'make'] = null;
} }
if (this.model != null) { if (this.make.isPresent) {
json[r'model'] = this.model; final value = this.make.value;
} else { json[r'make'] = value;
// json[r'model'] = null;
} }
if (this.ocr != null) { if (this.model.isPresent) {
json[r'ocr'] = this.ocr; final value = this.model.value;
} else { json[r'model'] = value;
// json[r'ocr'] = null;
} }
if (this.order != null) { if (this.ocr.isPresent) {
json[r'order'] = this.order; final value = this.ocr.value;
} else { json[r'ocr'] = value;
// json[r'order'] = null;
} }
if (this.originalFileName != null) { if (this.order.isPresent) {
json[r'originalFileName'] = this.originalFileName; final value = this.order.value;
} else { json[r'order'] = value;
// json[r'originalFileName'] = null;
} }
if (this.originalPath != null) { if (this.originalFileName.isPresent) {
json[r'originalPath'] = this.originalPath; final value = this.originalFileName.value;
} else { json[r'originalFileName'] = value;
// json[r'originalPath'] = null;
} }
if (this.page != null) { if (this.originalPath.isPresent) {
json[r'page'] = this.page; final value = this.originalPath.value;
} else { json[r'originalPath'] = value;
// json[r'page'] = null;
} }
json[r'personIds'] = this.personIds; if (this.page.isPresent) {
if (this.previewPath != null) { final value = this.page.value;
json[r'previewPath'] = this.previewPath; json[r'page'] = value;
} else {
// json[r'previewPath'] = null;
} }
if (this.rating != null) { if (this.personIds.isPresent) {
json[r'rating'] = this.rating; final value = this.personIds.value;
} else { json[r'personIds'] = value;
// json[r'rating'] = null;
} }
if (this.size != null) { if (this.previewPath.isPresent) {
json[r'size'] = this.size; final value = this.previewPath.value;
} else { json[r'previewPath'] = value;
// json[r'size'] = null;
} }
if (this.state != null) { if (this.rating.isPresent) {
json[r'state'] = this.state; final value = this.rating.value;
} else { json[r'rating'] = value;
// json[r'state'] = null;
} }
if (this.tagIds != null) { if (this.size.isPresent) {
json[r'tagIds'] = this.tagIds; final value = this.size.value;
} else { json[r'size'] = value;
// json[r'tagIds'] = null;
} }
if (this.takenAfter != null) { if (this.state.isPresent) {
json[r'takenAfter'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') final value = this.state.value;
? this.takenAfter!.millisecondsSinceEpoch json[r'state'] = value;
: this.takenAfter!.toUtc().toIso8601String();
} else {
// json[r'takenAfter'] = null;
} }
if (this.takenBefore != null) { if (this.tagIds.isPresent) {
json[r'takenBefore'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') final value = this.tagIds.value;
? this.takenBefore!.millisecondsSinceEpoch json[r'tagIds'] = value;
: this.takenBefore!.toUtc().toIso8601String();
} else {
// json[r'takenBefore'] = null;
} }
if (this.thumbnailPath != null) { if (this.takenAfter.isPresent) {
json[r'thumbnailPath'] = this.thumbnailPath; final value = this.takenAfter.value;
} else { json[r'takenAfter'] = value == null ? null : (_isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
// json[r'thumbnailPath'] = null; ? value.millisecondsSinceEpoch
: value.toUtc().toIso8601String());
} }
if (this.trashedAfter != null) { if (this.takenBefore.isPresent) {
json[r'trashedAfter'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') final value = this.takenBefore.value;
? this.trashedAfter!.millisecondsSinceEpoch json[r'takenBefore'] = value == null ? null : (_isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
: this.trashedAfter!.toUtc().toIso8601String(); ? value.millisecondsSinceEpoch
} else { : value.toUtc().toIso8601String());
// json[r'trashedAfter'] = null;
} }
if (this.trashedBefore != null) { if (this.thumbnailPath.isPresent) {
json[r'trashedBefore'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') final value = this.thumbnailPath.value;
? this.trashedBefore!.millisecondsSinceEpoch json[r'thumbnailPath'] = value;
: this.trashedBefore!.toUtc().toIso8601String();
} else {
// json[r'trashedBefore'] = null;
} }
if (this.type != null) { if (this.trashedAfter.isPresent) {
json[r'type'] = this.type; final value = this.trashedAfter.value;
} else { json[r'trashedAfter'] = value == null ? null : (_isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
// json[r'type'] = null; ? value.millisecondsSinceEpoch
: value.toUtc().toIso8601String());
} }
if (this.updatedAfter != null) { if (this.trashedBefore.isPresent) {
json[r'updatedAfter'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') final value = this.trashedBefore.value;
? this.updatedAfter!.millisecondsSinceEpoch json[r'trashedBefore'] = value == null ? null : (_isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
: this.updatedAfter!.toUtc().toIso8601String(); ? value.millisecondsSinceEpoch
} else { : value.toUtc().toIso8601String());
// json[r'updatedAfter'] = null;
} }
if (this.updatedBefore != null) { if (this.type.isPresent) {
json[r'updatedBefore'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') final value = this.type.value;
? this.updatedBefore!.millisecondsSinceEpoch json[r'type'] = value;
: this.updatedBefore!.toUtc().toIso8601String();
} else {
// json[r'updatedBefore'] = null;
} }
if (this.visibility != null) { if (this.updatedAfter.isPresent) {
json[r'visibility'] = this.visibility; final value = this.updatedAfter.value;
} else { json[r'updatedAfter'] = value == null ? null : (_isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
// json[r'visibility'] = null; ? value.millisecondsSinceEpoch
: value.toUtc().toIso8601String());
} }
if (this.withDeleted != null) { if (this.updatedBefore.isPresent) {
json[r'withDeleted'] = this.withDeleted; final value = this.updatedBefore.value;
} else { json[r'updatedBefore'] = value == null ? null : (_isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
// json[r'withDeleted'] = null; ? value.millisecondsSinceEpoch
: value.toUtc().toIso8601String());
} }
if (this.withExif != null) { if (this.visibility.isPresent) {
json[r'withExif'] = this.withExif; final value = this.visibility.value;
} else { json[r'visibility'] = value;
// json[r'withExif'] = null;
} }
if (this.withPeople != null) { if (this.withDeleted.isPresent) {
json[r'withPeople'] = this.withPeople; final value = this.withDeleted.value;
} else { json[r'withDeleted'] = value;
// json[r'withPeople'] = null;
} }
if (this.withStacked != null) { if (this.withExif.isPresent) {
json[r'withStacked'] = this.withStacked; final value = this.withExif.value;
} else { json[r'withExif'] = value;
// json[r'withStacked'] = null; }
if (this.withPeople.isPresent) {
final value = this.withPeople.value;
json[r'withPeople'] = value;
}
if (this.withStacked.isPresent) {
final value = this.withStacked.value;
json[r'withStacked'] = value;
} }
return json; return json;
} }
@ -701,54 +667,54 @@ class MetadataSearchDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return MetadataSearchDto( return MetadataSearchDto(
albumIds: json[r'albumIds'] is Iterable albumIds: json.containsKey(r'albumIds') ? Optional.present(json[r'albumIds'] is Iterable
? (json[r'albumIds'] as Iterable).cast<String>().toList(growable: false) ? (json[r'albumIds'] as Iterable).cast<String>().toList(growable: false)
: const [], : const []) : const Optional.absent(),
checksum: mapValueOfType<String>(json, r'checksum'), checksum: json.containsKey(r'checksum') ? Optional.present(mapValueOfType<String>(json, r'checksum')) : const Optional.absent(),
city: mapValueOfType<String>(json, r'city'), city: json.containsKey(r'city') ? Optional.present(mapValueOfType<String>(json, r'city')) : const Optional.absent(),
country: mapValueOfType<String>(json, r'country'), country: json.containsKey(r'country') ? Optional.present(mapValueOfType<String>(json, r'country')) : const Optional.absent(),
createdAfter: mapDateTime(json, r'createdAfter', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), createdAfter: json.containsKey(r'createdAfter') ? Optional.present(mapDateTime(json, r'createdAfter', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(),
createdBefore: mapDateTime(json, r'createdBefore', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), createdBefore: json.containsKey(r'createdBefore') ? Optional.present(mapDateTime(json, r'createdBefore', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(),
description: mapValueOfType<String>(json, r'description'), description: json.containsKey(r'description') ? Optional.present(mapValueOfType<String>(json, r'description')) : const Optional.absent(),
encodedVideoPath: mapValueOfType<String>(json, r'encodedVideoPath'), encodedVideoPath: json.containsKey(r'encodedVideoPath') ? Optional.present(mapValueOfType<String>(json, r'encodedVideoPath')) : const Optional.absent(),
id: mapValueOfType<String>(json, r'id'), id: json.containsKey(r'id') ? Optional.present(mapValueOfType<String>(json, r'id')) : const Optional.absent(),
isEncoded: mapValueOfType<bool>(json, r'isEncoded'), isEncoded: json.containsKey(r'isEncoded') ? Optional.present(mapValueOfType<bool>(json, r'isEncoded')) : const Optional.absent(),
isFavorite: mapValueOfType<bool>(json, r'isFavorite'), isFavorite: json.containsKey(r'isFavorite') ? Optional.present(mapValueOfType<bool>(json, r'isFavorite')) : const Optional.absent(),
isMotion: mapValueOfType<bool>(json, r'isMotion'), isMotion: json.containsKey(r'isMotion') ? Optional.present(mapValueOfType<bool>(json, r'isMotion')) : const Optional.absent(),
isNotInAlbum: mapValueOfType<bool>(json, r'isNotInAlbum'), isNotInAlbum: json.containsKey(r'isNotInAlbum') ? Optional.present(mapValueOfType<bool>(json, r'isNotInAlbum')) : const Optional.absent(),
isOffline: mapValueOfType<bool>(json, r'isOffline'), isOffline: json.containsKey(r'isOffline') ? Optional.present(mapValueOfType<bool>(json, r'isOffline')) : const Optional.absent(),
lensModel: mapValueOfType<String>(json, r'lensModel'), lensModel: json.containsKey(r'lensModel') ? Optional.present(mapValueOfType<String>(json, r'lensModel')) : const Optional.absent(),
libraryId: mapValueOfType<String>(json, r'libraryId'), libraryId: json.containsKey(r'libraryId') ? Optional.present(mapValueOfType<String>(json, r'libraryId')) : const Optional.absent(),
make: mapValueOfType<String>(json, r'make'), make: json.containsKey(r'make') ? Optional.present(mapValueOfType<String>(json, r'make')) : const Optional.absent(),
model: mapValueOfType<String>(json, r'model'), model: json.containsKey(r'model') ? Optional.present(mapValueOfType<String>(json, r'model')) : const Optional.absent(),
ocr: mapValueOfType<String>(json, r'ocr'), ocr: json.containsKey(r'ocr') ? Optional.present(mapValueOfType<String>(json, r'ocr')) : const Optional.absent(),
order: AssetOrder.fromJson(json[r'order']), order: json.containsKey(r'order') ? Optional.present(AssetOrder.fromJson(json[r'order'])) : const Optional.absent(),
originalFileName: mapValueOfType<String>(json, r'originalFileName'), originalFileName: json.containsKey(r'originalFileName') ? Optional.present(mapValueOfType<String>(json, r'originalFileName')) : const Optional.absent(),
originalPath: mapValueOfType<String>(json, r'originalPath'), originalPath: json.containsKey(r'originalPath') ? Optional.present(mapValueOfType<String>(json, r'originalPath')) : const Optional.absent(),
page: mapValueOfType<int>(json, r'page'), page: json.containsKey(r'page') ? Optional.present(json[r'page'] == null ? null : int.parse('${json[r'page']}')) : const Optional.absent(),
personIds: json[r'personIds'] is Iterable personIds: json.containsKey(r'personIds') ? Optional.present(json[r'personIds'] is Iterable
? (json[r'personIds'] as Iterable).cast<String>().toList(growable: false) ? (json[r'personIds'] as Iterable).cast<String>().toList(growable: false)
: const [], : const []) : const Optional.absent(),
previewPath: mapValueOfType<String>(json, r'previewPath'), previewPath: json.containsKey(r'previewPath') ? Optional.present(mapValueOfType<String>(json, r'previewPath')) : const Optional.absent(),
rating: mapValueOfType<int>(json, r'rating'), rating: json.containsKey(r'rating') ? Optional.present(json[r'rating'] == null ? null : int.parse('${json[r'rating']}')) : const Optional.absent(),
size: mapValueOfType<int>(json, r'size'), size: json.containsKey(r'size') ? Optional.present(json[r'size'] == null ? null : int.parse('${json[r'size']}')) : const Optional.absent(),
state: mapValueOfType<String>(json, r'state'), state: json.containsKey(r'state') ? Optional.present(mapValueOfType<String>(json, r'state')) : const Optional.absent(),
tagIds: json[r'tagIds'] is Iterable tagIds: json.containsKey(r'tagIds') ? Optional.present(json[r'tagIds'] is Iterable
? (json[r'tagIds'] as Iterable).cast<String>().toList(growable: false) ? (json[r'tagIds'] as Iterable).cast<String>().toList(growable: false)
: const [], : const []) : const Optional.absent(),
takenAfter: mapDateTime(json, r'takenAfter', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), takenAfter: json.containsKey(r'takenAfter') ? Optional.present(mapDateTime(json, r'takenAfter', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(),
takenBefore: mapDateTime(json, r'takenBefore', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), takenBefore: json.containsKey(r'takenBefore') ? Optional.present(mapDateTime(json, r'takenBefore', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(),
thumbnailPath: mapValueOfType<String>(json, r'thumbnailPath'), thumbnailPath: json.containsKey(r'thumbnailPath') ? Optional.present(mapValueOfType<String>(json, r'thumbnailPath')) : const Optional.absent(),
trashedAfter: mapDateTime(json, r'trashedAfter', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), trashedAfter: json.containsKey(r'trashedAfter') ? Optional.present(mapDateTime(json, r'trashedAfter', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(),
trashedBefore: mapDateTime(json, r'trashedBefore', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), trashedBefore: json.containsKey(r'trashedBefore') ? Optional.present(mapDateTime(json, r'trashedBefore', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(),
type: AssetTypeEnum.fromJson(json[r'type']), type: json.containsKey(r'type') ? Optional.present(AssetTypeEnum.fromJson(json[r'type'])) : const Optional.absent(),
updatedAfter: mapDateTime(json, r'updatedAfter', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), updatedAfter: json.containsKey(r'updatedAfter') ? Optional.present(mapDateTime(json, r'updatedAfter', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(),
updatedBefore: mapDateTime(json, r'updatedBefore', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), updatedBefore: json.containsKey(r'updatedBefore') ? Optional.present(mapDateTime(json, r'updatedBefore', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(),
visibility: AssetVisibility.fromJson(json[r'visibility']), visibility: json.containsKey(r'visibility') ? Optional.present(AssetVisibility.fromJson(json[r'visibility'])) : const Optional.absent(),
withDeleted: mapValueOfType<bool>(json, r'withDeleted'), withDeleted: json.containsKey(r'withDeleted') ? Optional.present(mapValueOfType<bool>(json, r'withDeleted')) : const Optional.absent(),
withExif: mapValueOfType<bool>(json, r'withExif'), withExif: json.containsKey(r'withExif') ? Optional.present(mapValueOfType<bool>(json, r'withExif')) : const Optional.absent(),
withPeople: mapValueOfType<bool>(json, r'withPeople'), withPeople: json.containsKey(r'withPeople') ? Optional.present(mapValueOfType<bool>(json, r'withPeople')) : const Optional.absent(),
withStacked: mapValueOfType<bool>(json, r'withStacked'), withStacked: json.containsKey(r'withStacked') ? Optional.present(mapValueOfType<bool>(json, r'withStacked')) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -13,20 +13,20 @@ part of openapi.api;
class NotificationCreateDto { class NotificationCreateDto {
/// Returns a new [NotificationCreateDto] instance. /// Returns a new [NotificationCreateDto] instance.
NotificationCreateDto({ NotificationCreateDto({
this.data = const {}, this.data = const Optional.present(const {}),
this.description, this.description = const Optional.absent(),
this.level, this.level = const Optional.absent(),
this.readAt, this.readAt = const Optional.absent(),
required this.title, required this.title,
this.type, this.type = const Optional.absent(),
required this.userId, required this.userId,
}); });
/// Additional notification data /// Additional notification data
Map<String, Object> data; Optional<Map<String, Object>?> data;
/// Notification description /// Notification description
String? description; Optional<String?> description;
/// ///
/// Please note: This property should have been non-nullable! Since the specification file /// Please note: This property should have been non-nullable! Since the specification file
@ -34,10 +34,10 @@ class NotificationCreateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
NotificationLevel? level; Optional<NotificationLevel?> level;
/// Date when notification was read /// Date when notification was read
DateTime? readAt; Optional<DateTime?> readAt;
/// Notification title /// Notification title
String title; String title;
@ -48,7 +48,7 @@ class NotificationCreateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
NotificationType? type; Optional<NotificationType?> type;
/// User ID to send notification to /// User ID to send notification to
String userId; String userId;
@ -79,29 +79,28 @@ class NotificationCreateDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
json[r'data'] = this.data; if (this.data.isPresent) {
if (this.description != null) { final value = this.data.value;
json[r'description'] = this.description; json[r'data'] = value;
} else {
// json[r'description'] = null;
} }
if (this.level != null) { if (this.description.isPresent) {
json[r'level'] = this.level; final value = this.description.value;
} else { json[r'description'] = value;
// json[r'level'] = null;
} }
if (this.readAt != null) { if (this.level.isPresent) {
json[r'readAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') final value = this.level.value;
? this.readAt!.millisecondsSinceEpoch json[r'level'] = value;
: this.readAt!.toUtc().toIso8601String(); }
} else { if (this.readAt.isPresent) {
// json[r'readAt'] = null; final value = this.readAt.value;
json[r'readAt'] = value == null ? null : (_isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
? value.millisecondsSinceEpoch
: value.toUtc().toIso8601String());
} }
json[r'title'] = this.title; json[r'title'] = this.title;
if (this.type != null) { if (this.type.isPresent) {
json[r'type'] = this.type; final value = this.type.value;
} else { json[r'type'] = value;
// json[r'type'] = null;
} }
json[r'userId'] = this.userId; json[r'userId'] = this.userId;
return json; return json;
@ -116,12 +115,12 @@ class NotificationCreateDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return NotificationCreateDto( return NotificationCreateDto(
data: mapCastOfType<String, Object>(json, r'data') ?? const {}, data: json.containsKey(r'data') ? Optional.present(mapCastOfType<String, Object>(json, r'data')) : const Optional.absent(),
description: mapValueOfType<String>(json, r'description'), description: json.containsKey(r'description') ? Optional.present(mapValueOfType<String>(json, r'description')) : const Optional.absent(),
level: NotificationLevel.fromJson(json[r'level']), level: json.containsKey(r'level') ? Optional.present(NotificationLevel.fromJson(json[r'level'])) : const Optional.absent(),
readAt: mapDateTime(json, r'readAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), readAt: json.containsKey(r'readAt') ? Optional.present(mapDateTime(json, r'readAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(),
title: mapValueOfType<String>(json, r'title')!, title: mapValueOfType<String>(json, r'title')!,
type: NotificationType.fromJson(json[r'type']), type: json.containsKey(r'type') ? Optional.present(NotificationType.fromJson(json[r'type'])) : const Optional.absent(),
userId: mapValueOfType<String>(json, r'userId')!, userId: mapValueOfType<String>(json, r'userId')!,
); );
} }

View File

@ -14,11 +14,11 @@ class NotificationDto {
/// Returns a new [NotificationDto] instance. /// Returns a new [NotificationDto] instance.
NotificationDto({ NotificationDto({
required this.createdAt, required this.createdAt,
this.data = const {}, this.data = const Optional.present(const {}),
this.description, this.description = const Optional.absent(),
required this.id, required this.id,
required this.level, required this.level,
this.readAt, this.readAt = const Optional.absent(),
required this.title, required this.title,
required this.type, required this.type,
}); });
@ -27,7 +27,7 @@ class NotificationDto {
DateTime createdAt; DateTime createdAt;
/// Additional notification data /// Additional notification data
Map<String, Object> data; Optional<Map<String, Object>?> data;
/// Notification description /// Notification description
/// ///
@ -36,7 +36,7 @@ class NotificationDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? description; Optional<String?> description;
/// Notification ID /// Notification ID
String id; String id;
@ -50,7 +50,7 @@ class NotificationDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? readAt; Optional<DateTime?> readAt;
/// Notification title /// Notification title
String title; String title;
@ -88,20 +88,21 @@ class NotificationDto {
json[r'createdAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') json[r'createdAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
? this.createdAt.millisecondsSinceEpoch ? this.createdAt.millisecondsSinceEpoch
: this.createdAt.toUtc().toIso8601String(); : this.createdAt.toUtc().toIso8601String();
json[r'data'] = this.data; if (this.data.isPresent) {
if (this.description != null) { final value = this.data.value;
json[r'description'] = this.description; json[r'data'] = value;
} else { }
// json[r'description'] = null; if (this.description.isPresent) {
final value = this.description.value;
json[r'description'] = value;
} }
json[r'id'] = this.id; json[r'id'] = this.id;
json[r'level'] = this.level; json[r'level'] = this.level;
if (this.readAt != null) { if (this.readAt.isPresent) {
json[r'readAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') final value = this.readAt.value;
? this.readAt!.millisecondsSinceEpoch json[r'readAt'] = value == null ? null : (_isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
: this.readAt!.toUtc().toIso8601String(); ? value.millisecondsSinceEpoch
} else { : value.toUtc().toIso8601String());
// json[r'readAt'] = null;
} }
json[r'title'] = this.title; json[r'title'] = this.title;
json[r'type'] = this.type; json[r'type'] = this.type;
@ -118,11 +119,11 @@ class NotificationDto {
return NotificationDto( return NotificationDto(
createdAt: mapDateTime(json, r'createdAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')!, createdAt: mapDateTime(json, r'createdAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')!,
data: mapCastOfType<String, Object>(json, r'data') ?? const {}, data: json.containsKey(r'data') ? Optional.present(mapCastOfType<String, Object>(json, r'data')) : const Optional.absent(),
description: mapValueOfType<String>(json, r'description'), description: json.containsKey(r'description') ? Optional.present(mapValueOfType<String>(json, r'description')) : const Optional.absent(),
id: mapValueOfType<String>(json, r'id')!, id: mapValueOfType<String>(json, r'id')!,
level: NotificationLevel.fromJson(json[r'level'])!, level: NotificationLevel.fromJson(json[r'level'])!,
readAt: mapDateTime(json, r'readAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), readAt: json.containsKey(r'readAt') ? Optional.present(mapDateTime(json, r'readAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(),
title: mapValueOfType<String>(json, r'title')!, title: mapValueOfType<String>(json, r'title')!,
type: NotificationType.fromJson(json[r'type'])!, type: NotificationType.fromJson(json[r'type'])!,
); );

View File

@ -14,14 +14,14 @@ class NotificationUpdateAllDto {
/// Returns a new [NotificationUpdateAllDto] instance. /// Returns a new [NotificationUpdateAllDto] instance.
NotificationUpdateAllDto({ NotificationUpdateAllDto({
this.ids = const [], this.ids = const [],
this.readAt, this.readAt = const Optional.absent(),
}); });
/// Notification IDs to update /// Notification IDs to update
List<String> ids; List<String> ids;
/// Date when notifications were read /// Date when notifications were read
DateTime? readAt; Optional<DateTime?> readAt;
@override @override
bool operator ==(Object other) => identical(this, other) || other is NotificationUpdateAllDto && bool operator ==(Object other) => identical(this, other) || other is NotificationUpdateAllDto &&
@ -40,12 +40,11 @@ class NotificationUpdateAllDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
json[r'ids'] = this.ids; json[r'ids'] = this.ids;
if (this.readAt != null) { if (this.readAt.isPresent) {
json[r'readAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') final value = this.readAt.value;
? this.readAt!.millisecondsSinceEpoch json[r'readAt'] = value == null ? null : (_isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
: this.readAt!.toUtc().toIso8601String(); ? value.millisecondsSinceEpoch
} else { : value.toUtc().toIso8601String());
// json[r'readAt'] = null;
} }
return json; return json;
} }
@ -62,7 +61,7 @@ class NotificationUpdateAllDto {
ids: json[r'ids'] is Iterable ids: json[r'ids'] is Iterable
? (json[r'ids'] as Iterable).cast<String>().toList(growable: false) ? (json[r'ids'] as Iterable).cast<String>().toList(growable: false)
: const [], : const [],
readAt: mapDateTime(json, r'readAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), readAt: json.containsKey(r'readAt') ? Optional.present(mapDateTime(json, r'readAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -13,11 +13,11 @@ part of openapi.api;
class NotificationUpdateDto { class NotificationUpdateDto {
/// Returns a new [NotificationUpdateDto] instance. /// Returns a new [NotificationUpdateDto] instance.
NotificationUpdateDto({ NotificationUpdateDto({
this.readAt, this.readAt = const Optional.absent(),
}); });
/// Date when notification was read /// Date when notification was read
DateTime? readAt; Optional<DateTime?> readAt;
@override @override
bool operator ==(Object other) => identical(this, other) || other is NotificationUpdateDto && bool operator ==(Object other) => identical(this, other) || other is NotificationUpdateDto &&
@ -33,12 +33,11 @@ class NotificationUpdateDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.readAt != null) { if (this.readAt.isPresent) {
json[r'readAt'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') final value = this.readAt.value;
? this.readAt!.millisecondsSinceEpoch json[r'readAt'] = value == null ? null : (_isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
: this.readAt!.toUtc().toIso8601String(); ? value.millisecondsSinceEpoch
} else { : value.toUtc().toIso8601String());
// json[r'readAt'] = null;
} }
return json; return json;
} }
@ -52,7 +51,7 @@ class NotificationUpdateDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return NotificationUpdateDto( return NotificationUpdateDto(
readAt: mapDateTime(json, r'readAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), readAt: json.containsKey(r'readAt') ? Optional.present(mapDateTime(json, r'readAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -13,8 +13,8 @@ part of openapi.api;
class OAuthCallbackDto { class OAuthCallbackDto {
/// Returns a new [OAuthCallbackDto] instance. /// Returns a new [OAuthCallbackDto] instance.
OAuthCallbackDto({ OAuthCallbackDto({
this.codeVerifier, this.codeVerifier = const Optional.absent(),
this.state, this.state = const Optional.absent(),
required this.url, required this.url,
}); });
@ -25,7 +25,7 @@ class OAuthCallbackDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? codeVerifier; Optional<String?> codeVerifier;
/// OAuth state parameter /// OAuth state parameter
/// ///
@ -34,7 +34,7 @@ class OAuthCallbackDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? state; Optional<String?> state;
/// OAuth callback URL /// OAuth callback URL
String url; String url;
@ -57,15 +57,13 @@ class OAuthCallbackDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.codeVerifier != null) { if (this.codeVerifier.isPresent) {
json[r'codeVerifier'] = this.codeVerifier; final value = this.codeVerifier.value;
} else { json[r'codeVerifier'] = value;
// json[r'codeVerifier'] = null;
} }
if (this.state != null) { if (this.state.isPresent) {
json[r'state'] = this.state; final value = this.state.value;
} else { json[r'state'] = value;
// json[r'state'] = null;
} }
json[r'url'] = this.url; json[r'url'] = this.url;
return json; return json;
@ -80,8 +78,8 @@ class OAuthCallbackDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return OAuthCallbackDto( return OAuthCallbackDto(
codeVerifier: mapValueOfType<String>(json, r'codeVerifier'), codeVerifier: json.containsKey(r'codeVerifier') ? Optional.present(mapValueOfType<String>(json, r'codeVerifier')) : const Optional.absent(),
state: mapValueOfType<String>(json, r'state'), state: json.containsKey(r'state') ? Optional.present(mapValueOfType<String>(json, r'state')) : const Optional.absent(),
url: mapValueOfType<String>(json, r'url')!, url: mapValueOfType<String>(json, r'url')!,
); );
} }

View File

@ -13,9 +13,9 @@ part of openapi.api;
class OAuthConfigDto { class OAuthConfigDto {
/// Returns a new [OAuthConfigDto] instance. /// Returns a new [OAuthConfigDto] instance.
OAuthConfigDto({ OAuthConfigDto({
this.codeChallenge, this.codeChallenge = const Optional.absent(),
required this.redirectUri, required this.redirectUri,
this.state, this.state = const Optional.absent(),
}); });
/// OAuth code challenge (PKCE) /// OAuth code challenge (PKCE)
@ -25,7 +25,7 @@ class OAuthConfigDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? codeChallenge; Optional<String?> codeChallenge;
/// OAuth redirect URI /// OAuth redirect URI
String redirectUri; String redirectUri;
@ -37,7 +37,7 @@ class OAuthConfigDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? state; Optional<String?> state;
@override @override
bool operator ==(Object other) => identical(this, other) || other is OAuthConfigDto && bool operator ==(Object other) => identical(this, other) || other is OAuthConfigDto &&
@ -57,16 +57,14 @@ class OAuthConfigDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.codeChallenge != null) { if (this.codeChallenge.isPresent) {
json[r'codeChallenge'] = this.codeChallenge; final value = this.codeChallenge.value;
} else { json[r'codeChallenge'] = value;
// json[r'codeChallenge'] = null;
} }
json[r'redirectUri'] = this.redirectUri; json[r'redirectUri'] = this.redirectUri;
if (this.state != null) { if (this.state.isPresent) {
json[r'state'] = this.state; final value = this.state.value;
} else { json[r'state'] = value;
// json[r'state'] = null;
} }
return json; return json;
} }
@ -80,9 +78,9 @@ class OAuthConfigDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return OAuthConfigDto( return OAuthConfigDto(
codeChallenge: mapValueOfType<String>(json, r'codeChallenge'), codeChallenge: json.containsKey(r'codeChallenge') ? Optional.present(mapValueOfType<String>(json, r'codeChallenge')) : const Optional.absent(),
redirectUri: mapValueOfType<String>(json, r'redirectUri')!, redirectUri: mapValueOfType<String>(json, r'redirectUri')!,
state: mapValueOfType<String>(json, r'state'), state: json.containsKey(r'state') ? Optional.present(mapValueOfType<String>(json, r'state')) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -23,13 +23,13 @@ class OAuthTokenEndpointAuthMethod {
String toJson() => value; String toJson() => value;
static const post = OAuthTokenEndpointAuthMethod._(r'client_secret_post'); static const clientSecretPost = OAuthTokenEndpointAuthMethod._(r'client_secret_post');
static const basic = OAuthTokenEndpointAuthMethod._(r'client_secret_basic'); static const clientSecretBasic = OAuthTokenEndpointAuthMethod._(r'client_secret_basic');
/// List of all possible values in this [enum][OAuthTokenEndpointAuthMethod]. /// List of all possible values in this [enum][OAuthTokenEndpointAuthMethod].
static const values = <OAuthTokenEndpointAuthMethod>[ static const values = <OAuthTokenEndpointAuthMethod>[
post, clientSecretPost,
basic, clientSecretBasic,
]; ];
static OAuthTokenEndpointAuthMethod? fromJson(dynamic value) => OAuthTokenEndpointAuthMethodTypeTransformer().decode(value); static OAuthTokenEndpointAuthMethod? fromJson(dynamic value) => OAuthTokenEndpointAuthMethodTypeTransformer().decode(value);
@ -68,8 +68,8 @@ class OAuthTokenEndpointAuthMethodTypeTransformer {
OAuthTokenEndpointAuthMethod? decode(dynamic data, {bool allowNull = true}) { OAuthTokenEndpointAuthMethod? decode(dynamic data, {bool allowNull = true}) {
if (data != null) { if (data != null) {
switch (data) { switch (data) {
case r'client_secret_post': return OAuthTokenEndpointAuthMethod.post; case r'client_secret_post': return OAuthTokenEndpointAuthMethod.clientSecretPost;
case r'client_secret_basic': return OAuthTokenEndpointAuthMethod.basic; case r'client_secret_basic': return OAuthTokenEndpointAuthMethod.clientSecretBasic;
default: default:
if (!allowNull) { if (!allowNull) {
throw ArgumentError('Unknown enum value to decode: $data'); throw ArgumentError('Unknown enum value to decode: $data');

View File

@ -85,8 +85,8 @@ class OcrConfig {
return OcrConfig( return OcrConfig(
enabled: mapValueOfType<bool>(json, r'enabled')!, enabled: mapValueOfType<bool>(json, r'enabled')!,
maxResolution: mapValueOfType<int>(json, r'maxResolution')!, maxResolution: mapValueOfType<int>(json, r'maxResolution')!,
minDetectionScore: (mapValueOfType<num>(json, r'minDetectionScore')!).toDouble(), minDetectionScore: mapValueOfType<double>(json, r'minDetectionScore')!,
minRecognitionScore: (mapValueOfType<num>(json, r'minRecognitionScore')!).toDouble(), minRecognitionScore: mapValueOfType<double>(json, r'minRecognitionScore')!,
modelName: mapValueOfType<String>(json, r'modelName')!, modelName: mapValueOfType<String>(json, r'modelName')!,
); );
} }

View File

@ -23,13 +23,13 @@ class PartnerDirection {
String toJson() => value; String toJson() => value;
static const by = PartnerDirection._(r'shared-by'); static const sharedBy = PartnerDirection._(r'shared-by');
static const with_ = PartnerDirection._(r'shared-with'); static const sharedWith = PartnerDirection._(r'shared-with');
/// List of all possible values in this [enum][PartnerDirection]. /// List of all possible values in this [enum][PartnerDirection].
static const values = <PartnerDirection>[ static const values = <PartnerDirection>[
by, sharedBy,
with_, sharedWith,
]; ];
static PartnerDirection? fromJson(dynamic value) => PartnerDirectionTypeTransformer().decode(value); static PartnerDirection? fromJson(dynamic value) => PartnerDirectionTypeTransformer().decode(value);
@ -68,8 +68,8 @@ class PartnerDirectionTypeTransformer {
PartnerDirection? decode(dynamic data, {bool allowNull = true}) { PartnerDirection? decode(dynamic data, {bool allowNull = true}) {
if (data != null) { if (data != null) {
switch (data) { switch (data) {
case r'shared-by': return PartnerDirection.by; case r'shared-by': return PartnerDirection.sharedBy;
case r'shared-with': return PartnerDirection.with_; case r'shared-with': return PartnerDirection.sharedWith;
default: default:
if (!allowNull) { if (!allowNull) {
throw ArgumentError('Unknown enum value to decode: $data'); throw ArgumentError('Unknown enum value to decode: $data');

View File

@ -16,7 +16,7 @@ class PartnerResponseDto {
required this.avatarColor, required this.avatarColor,
required this.email, required this.email,
required this.id, required this.id,
this.inTimeline, this.inTimeline = const Optional.absent(),
required this.name, required this.name,
required this.profileChangedAt, required this.profileChangedAt,
required this.profileImagePath, required this.profileImagePath,
@ -37,7 +37,7 @@ class PartnerResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? inTimeline; Optional<bool?> inTimeline;
/// User name /// User name
String name; String name;
@ -77,10 +77,9 @@ class PartnerResponseDto {
json[r'avatarColor'] = this.avatarColor; json[r'avatarColor'] = this.avatarColor;
json[r'email'] = this.email; json[r'email'] = this.email;
json[r'id'] = this.id; json[r'id'] = this.id;
if (this.inTimeline != null) { if (this.inTimeline.isPresent) {
json[r'inTimeline'] = this.inTimeline; final value = this.inTimeline.value;
} else { json[r'inTimeline'] = value;
// json[r'inTimeline'] = null;
} }
json[r'name'] = this.name; json[r'name'] = this.name;
json[r'profileChangedAt'] = this.profileChangedAt.toUtc().toIso8601String(); json[r'profileChangedAt'] = this.profileChangedAt.toUtc().toIso8601String();
@ -100,7 +99,7 @@ class PartnerResponseDto {
avatarColor: UserAvatarColor.fromJson(json[r'avatarColor'])!, avatarColor: UserAvatarColor.fromJson(json[r'avatarColor'])!,
email: mapValueOfType<String>(json, r'email')!, email: mapValueOfType<String>(json, r'email')!,
id: mapValueOfType<String>(json, r'id')!, id: mapValueOfType<String>(json, r'id')!,
inTimeline: mapValueOfType<bool>(json, r'inTimeline'), inTimeline: json.containsKey(r'inTimeline') ? Optional.present(mapValueOfType<bool>(json, r'inTimeline')) : const Optional.absent(),
name: mapValueOfType<String>(json, r'name')!, name: mapValueOfType<String>(json, r'name')!,
profileChangedAt: mapDateTime(json, r'profileChangedAt', r'')!, profileChangedAt: mapDateTime(json, r'profileChangedAt', r'')!,
profileImagePath: mapValueOfType<String>(json, r'profileImagePath')!, profileImagePath: mapValueOfType<String>(json, r'profileImagePath')!,

View File

@ -14,7 +14,7 @@ class PeopleResponse {
/// Returns a new [PeopleResponse] instance. /// Returns a new [PeopleResponse] instance.
PeopleResponse({ PeopleResponse({
required this.enabled, required this.enabled,
this.minimumFaces, this.minimumFaces = const Optional.absent(),
required this.sidebarWeb, required this.sidebarWeb,
}); });
@ -31,7 +31,7 @@ class PeopleResponse {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
int? minimumFaces; Optional<int?> minimumFaces;
/// Whether people appear in web sidebar /// Whether people appear in web sidebar
bool sidebarWeb; bool sidebarWeb;
@ -55,10 +55,9 @@ class PeopleResponse {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
json[r'enabled'] = this.enabled; json[r'enabled'] = this.enabled;
if (this.minimumFaces != null) { if (this.minimumFaces.isPresent) {
json[r'minimumFaces'] = this.minimumFaces; final value = this.minimumFaces.value;
} else { json[r'minimumFaces'] = value;
// json[r'minimumFaces'] = null;
} }
json[r'sidebarWeb'] = this.sidebarWeb; json[r'sidebarWeb'] = this.sidebarWeb;
return json; return json;
@ -74,7 +73,7 @@ class PeopleResponse {
return PeopleResponse( return PeopleResponse(
enabled: mapValueOfType<bool>(json, r'enabled')!, enabled: mapValueOfType<bool>(json, r'enabled')!,
minimumFaces: mapValueOfType<int>(json, r'minimumFaces'), minimumFaces: json.containsKey(r'minimumFaces') ? Optional.present(json[r'minimumFaces'] == null ? null : int.parse('${json[r'minimumFaces']}')) : const Optional.absent(),
sidebarWeb: mapValueOfType<bool>(json, r'sidebarWeb')!, sidebarWeb: mapValueOfType<bool>(json, r'sidebarWeb')!,
); );
} }

View File

@ -13,7 +13,7 @@ part of openapi.api;
class PeopleResponseDto { class PeopleResponseDto {
/// Returns a new [PeopleResponseDto] instance. /// Returns a new [PeopleResponseDto] instance.
PeopleResponseDto({ PeopleResponseDto({
this.hasNextPage, this.hasNextPage = const Optional.absent(),
required this.hidden, required this.hidden,
this.people = const [], this.people = const [],
required this.total, required this.total,
@ -26,7 +26,7 @@ class PeopleResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? hasNextPage; Optional<bool?> hasNextPage;
/// Number of hidden people /// Number of hidden people
/// ///
@ -62,10 +62,9 @@ class PeopleResponseDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.hasNextPage != null) { if (this.hasNextPage.isPresent) {
json[r'hasNextPage'] = this.hasNextPage; final value = this.hasNextPage.value;
} else { json[r'hasNextPage'] = value;
// json[r'hasNextPage'] = null;
} }
json[r'hidden'] = this.hidden; json[r'hidden'] = this.hidden;
json[r'people'] = this.people; json[r'people'] = this.people;
@ -82,7 +81,7 @@ class PeopleResponseDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return PeopleResponseDto( return PeopleResponseDto(
hasNextPage: mapValueOfType<bool>(json, r'hasNextPage'), hasNextPage: json.containsKey(r'hasNextPage') ? Optional.present(mapValueOfType<bool>(json, r'hasNextPage')) : const Optional.absent(),
hidden: mapValueOfType<int>(json, r'hidden')!, hidden: mapValueOfType<int>(json, r'hidden')!,
people: PersonResponseDto.listFromJson(json[r'people']), people: PersonResponseDto.listFromJson(json[r'people']),
total: mapValueOfType<int>(json, r'total')!, total: mapValueOfType<int>(json, r'total')!,

View File

@ -13,9 +13,9 @@ part of openapi.api;
class PeopleUpdate { class PeopleUpdate {
/// Returns a new [PeopleUpdate] instance. /// Returns a new [PeopleUpdate] instance.
PeopleUpdate({ PeopleUpdate({
this.enabled, this.enabled = const Optional.absent(),
this.minimumFaces, this.minimumFaces = const Optional.absent(),
this.sidebarWeb, this.sidebarWeb = const Optional.absent(),
}); });
/// Whether people are enabled /// Whether people are enabled
@ -25,7 +25,7 @@ class PeopleUpdate {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? enabled; Optional<bool?> enabled;
/// People face threshold /// People face threshold
/// ///
@ -37,7 +37,7 @@ class PeopleUpdate {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
int? minimumFaces; Optional<int?> minimumFaces;
/// Whether people appear in web sidebar /// Whether people appear in web sidebar
/// ///
@ -46,7 +46,7 @@ class PeopleUpdate {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? sidebarWeb; Optional<bool?> sidebarWeb;
@override @override
bool operator ==(Object other) => identical(this, other) || other is PeopleUpdate && bool operator ==(Object other) => identical(this, other) || other is PeopleUpdate &&
@ -66,20 +66,17 @@ class PeopleUpdate {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.enabled != null) { if (this.enabled.isPresent) {
json[r'enabled'] = this.enabled; final value = this.enabled.value;
} else { json[r'enabled'] = value;
// json[r'enabled'] = null;
} }
if (this.minimumFaces != null) { if (this.minimumFaces.isPresent) {
json[r'minimumFaces'] = this.minimumFaces; final value = this.minimumFaces.value;
} else { json[r'minimumFaces'] = value;
// json[r'minimumFaces'] = null;
} }
if (this.sidebarWeb != null) { if (this.sidebarWeb.isPresent) {
json[r'sidebarWeb'] = this.sidebarWeb; final value = this.sidebarWeb.value;
} else { json[r'sidebarWeb'] = value;
// json[r'sidebarWeb'] = null;
} }
return json; return json;
} }
@ -93,9 +90,9 @@ class PeopleUpdate {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return PeopleUpdate( return PeopleUpdate(
enabled: mapValueOfType<bool>(json, r'enabled'), enabled: json.containsKey(r'enabled') ? Optional.present(mapValueOfType<bool>(json, r'enabled')) : const Optional.absent(),
minimumFaces: mapValueOfType<int>(json, r'minimumFaces'), minimumFaces: json.containsKey(r'minimumFaces') ? Optional.present(json[r'minimumFaces'] == null ? null : int.parse('${json[r'minimumFaces']}')) : const Optional.absent(),
sidebarWeb: mapValueOfType<bool>(json, r'sidebarWeb'), sidebarWeb: json.containsKey(r'sidebarWeb') ? Optional.present(mapValueOfType<bool>(json, r'sidebarWeb')) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -13,20 +13,20 @@ part of openapi.api;
class PeopleUpdateItem { class PeopleUpdateItem {
/// Returns a new [PeopleUpdateItem] instance. /// Returns a new [PeopleUpdateItem] instance.
PeopleUpdateItem({ PeopleUpdateItem({
this.birthDate, this.birthDate = const Optional.absent(),
this.color, this.color = const Optional.absent(),
this.featureFaceAssetId, this.featureFaceAssetId = const Optional.absent(),
required this.id, required this.id,
this.isFavorite, this.isFavorite = const Optional.absent(),
this.isHidden, this.isHidden = const Optional.absent(),
this.name, this.name = const Optional.absent(),
}); });
/// Person date of birth /// Person date of birth
DateTime? birthDate; Optional<DateTime?> birthDate;
/// Person color (hex) /// Person color (hex)
String? color; Optional<String?> color;
/// Asset ID used for feature face thumbnail /// Asset ID used for feature face thumbnail
/// ///
@ -35,7 +35,7 @@ class PeopleUpdateItem {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? featureFaceAssetId; Optional<String?> featureFaceAssetId;
/// Person ID /// Person ID
String id; String id;
@ -47,7 +47,7 @@ class PeopleUpdateItem {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? isFavorite; Optional<bool?> isFavorite;
/// Person visibility (hidden) /// Person visibility (hidden)
/// ///
@ -56,7 +56,7 @@ class PeopleUpdateItem {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? isHidden; Optional<bool?> isHidden;
/// Person name /// Person name
/// ///
@ -65,7 +65,7 @@ class PeopleUpdateItem {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? name; Optional<String?> name;
@override @override
bool operator ==(Object other) => identical(this, other) || other is PeopleUpdateItem && bool operator ==(Object other) => identical(this, other) || other is PeopleUpdateItem &&
@ -93,36 +93,30 @@ class PeopleUpdateItem {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.birthDate != null) { if (this.birthDate.isPresent) {
json[r'birthDate'] = _dateFormatter.format(this.birthDate!.toUtc()); final value = this.birthDate.value;
} else { json[r'birthDate'] = value == null ? null : _dateFormatter.format(value.toUtc());
// json[r'birthDate'] = null;
} }
if (this.color != null) { if (this.color.isPresent) {
json[r'color'] = this.color; final value = this.color.value;
} else { json[r'color'] = value;
// json[r'color'] = null;
} }
if (this.featureFaceAssetId != null) { if (this.featureFaceAssetId.isPresent) {
json[r'featureFaceAssetId'] = this.featureFaceAssetId; final value = this.featureFaceAssetId.value;
} else { json[r'featureFaceAssetId'] = value;
// json[r'featureFaceAssetId'] = null;
} }
json[r'id'] = this.id; json[r'id'] = this.id;
if (this.isFavorite != null) { if (this.isFavorite.isPresent) {
json[r'isFavorite'] = this.isFavorite; final value = this.isFavorite.value;
} else { json[r'isFavorite'] = value;
// json[r'isFavorite'] = null;
} }
if (this.isHidden != null) { if (this.isHidden.isPresent) {
json[r'isHidden'] = this.isHidden; final value = this.isHidden.value;
} else { json[r'isHidden'] = value;
// json[r'isHidden'] = null;
} }
if (this.name != null) { if (this.name.isPresent) {
json[r'name'] = this.name; final value = this.name.value;
} else { json[r'name'] = value;
// json[r'name'] = null;
} }
return json; return json;
} }
@ -136,13 +130,13 @@ class PeopleUpdateItem {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return PeopleUpdateItem( return PeopleUpdateItem(
birthDate: mapDateTime(json, r'birthDate', r''), birthDate: json.containsKey(r'birthDate') ? Optional.present(mapDateTime(json, r'birthDate', r'')) : const Optional.absent(),
color: mapValueOfType<String>(json, r'color'), color: json.containsKey(r'color') ? Optional.present(mapValueOfType<String>(json, r'color')) : const Optional.absent(),
featureFaceAssetId: mapValueOfType<String>(json, r'featureFaceAssetId'), featureFaceAssetId: json.containsKey(r'featureFaceAssetId') ? Optional.present(mapValueOfType<String>(json, r'featureFaceAssetId')) : const Optional.absent(),
id: mapValueOfType<String>(json, r'id')!, id: mapValueOfType<String>(json, r'id')!,
isFavorite: mapValueOfType<bool>(json, r'isFavorite'), isFavorite: json.containsKey(r'isFavorite') ? Optional.present(mapValueOfType<bool>(json, r'isFavorite')) : const Optional.absent(),
isHidden: mapValueOfType<bool>(json, r'isHidden'), isHidden: json.containsKey(r'isHidden') ? Optional.present(mapValueOfType<bool>(json, r'isHidden')) : const Optional.absent(),
name: mapValueOfType<String>(json, r'name'), name: json.containsKey(r'name') ? Optional.present(mapValueOfType<String>(json, r'name')) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -13,18 +13,18 @@ part of openapi.api;
class PersonCreateDto { class PersonCreateDto {
/// Returns a new [PersonCreateDto] instance. /// Returns a new [PersonCreateDto] instance.
PersonCreateDto({ PersonCreateDto({
this.birthDate, this.birthDate = const Optional.absent(),
this.color, this.color = const Optional.absent(),
this.isFavorite, this.isFavorite = const Optional.absent(),
this.isHidden, this.isHidden = const Optional.absent(),
this.name, this.name = const Optional.absent(),
}); });
/// Person date of birth /// Person date of birth
DateTime? birthDate; Optional<DateTime?> birthDate;
/// Person color (hex) /// Person color (hex)
String? color; Optional<String?> color;
/// Mark as favorite /// Mark as favorite
/// ///
@ -33,7 +33,7 @@ class PersonCreateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? isFavorite; Optional<bool?> isFavorite;
/// Person visibility (hidden) /// Person visibility (hidden)
/// ///
@ -42,7 +42,7 @@ class PersonCreateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? isHidden; Optional<bool?> isHidden;
/// Person name /// Person name
/// ///
@ -51,7 +51,7 @@ class PersonCreateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? name; Optional<String?> name;
@override @override
bool operator ==(Object other) => identical(this, other) || other is PersonCreateDto && bool operator ==(Object other) => identical(this, other) || other is PersonCreateDto &&
@ -75,30 +75,25 @@ class PersonCreateDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.birthDate != null) { if (this.birthDate.isPresent) {
json[r'birthDate'] = _dateFormatter.format(this.birthDate!.toUtc()); final value = this.birthDate.value;
} else { json[r'birthDate'] = value == null ? null : _dateFormatter.format(value.toUtc());
// json[r'birthDate'] = null;
} }
if (this.color != null) { if (this.color.isPresent) {
json[r'color'] = this.color; final value = this.color.value;
} else { json[r'color'] = value;
// json[r'color'] = null;
} }
if (this.isFavorite != null) { if (this.isFavorite.isPresent) {
json[r'isFavorite'] = this.isFavorite; final value = this.isFavorite.value;
} else { json[r'isFavorite'] = value;
// json[r'isFavorite'] = null;
} }
if (this.isHidden != null) { if (this.isHidden.isPresent) {
json[r'isHidden'] = this.isHidden; final value = this.isHidden.value;
} else { json[r'isHidden'] = value;
// json[r'isHidden'] = null;
} }
if (this.name != null) { if (this.name.isPresent) {
json[r'name'] = this.name; final value = this.name.value;
} else { json[r'name'] = value;
// json[r'name'] = null;
} }
return json; return json;
} }
@ -112,11 +107,11 @@ class PersonCreateDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return PersonCreateDto( return PersonCreateDto(
birthDate: mapDateTime(json, r'birthDate', r''), birthDate: json.containsKey(r'birthDate') ? Optional.present(mapDateTime(json, r'birthDate', r'')) : const Optional.absent(),
color: mapValueOfType<String>(json, r'color'), color: json.containsKey(r'color') ? Optional.present(mapValueOfType<String>(json, r'color')) : const Optional.absent(),
isFavorite: mapValueOfType<bool>(json, r'isFavorite'), isFavorite: json.containsKey(r'isFavorite') ? Optional.present(mapValueOfType<bool>(json, r'isFavorite')) : const Optional.absent(),
isHidden: mapValueOfType<bool>(json, r'isHidden'), isHidden: json.containsKey(r'isHidden') ? Optional.present(mapValueOfType<bool>(json, r'isHidden')) : const Optional.absent(),
name: mapValueOfType<String>(json, r'name'), name: json.containsKey(r'name') ? Optional.present(mapValueOfType<String>(json, r'name')) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -14,13 +14,13 @@ class PersonResponseDto {
/// Returns a new [PersonResponseDto] instance. /// Returns a new [PersonResponseDto] instance.
PersonResponseDto({ PersonResponseDto({
required this.birthDate, required this.birthDate,
this.color, this.color = const Optional.absent(),
required this.id, required this.id,
this.isFavorite, this.isFavorite = const Optional.absent(),
required this.isHidden, required this.isHidden,
required this.name, required this.name,
required this.thumbnailPath, required this.thumbnailPath,
this.updatedAt, this.updatedAt = const Optional.absent(),
}); });
/// Person date of birth /// Person date of birth
@ -33,7 +33,7 @@ class PersonResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? color; Optional<String?> color;
/// Person ID /// Person ID
String id; String id;
@ -45,7 +45,7 @@ class PersonResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? isFavorite; Optional<bool?> isFavorite;
/// Is hidden /// Is hidden
bool isHidden; bool isHidden;
@ -63,7 +63,7 @@ class PersonResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? updatedAt; Optional<DateTime?> updatedAt;
@override @override
bool operator ==(Object other) => identical(this, other) || other is PersonResponseDto && bool operator ==(Object other) => identical(this, other) || other is PersonResponseDto &&
@ -96,26 +96,23 @@ class PersonResponseDto {
if (this.birthDate != null) { if (this.birthDate != null) {
json[r'birthDate'] = _dateFormatter.format(this.birthDate!.toUtc()); json[r'birthDate'] = _dateFormatter.format(this.birthDate!.toUtc());
} else { } else {
// json[r'birthDate'] = null; json[r'birthDate'] = null;
} }
if (this.color != null) { if (this.color.isPresent) {
json[r'color'] = this.color; final value = this.color.value;
} else { json[r'color'] = value;
// json[r'color'] = null;
} }
json[r'id'] = this.id; json[r'id'] = this.id;
if (this.isFavorite != null) { if (this.isFavorite.isPresent) {
json[r'isFavorite'] = this.isFavorite; final value = this.isFavorite.value;
} else { json[r'isFavorite'] = value;
// json[r'isFavorite'] = null;
} }
json[r'isHidden'] = this.isHidden; json[r'isHidden'] = this.isHidden;
json[r'name'] = this.name; json[r'name'] = this.name;
json[r'thumbnailPath'] = this.thumbnailPath; json[r'thumbnailPath'] = this.thumbnailPath;
if (this.updatedAt != null) { if (this.updatedAt.isPresent) {
json[r'updatedAt'] = this.updatedAt!.toUtc().toIso8601String(); final value = this.updatedAt.value;
} else { json[r'updatedAt'] = value == null ? null : value.toUtc().toIso8601String();
// json[r'updatedAt'] = null;
} }
return json; return json;
} }
@ -130,13 +127,13 @@ class PersonResponseDto {
return PersonResponseDto( return PersonResponseDto(
birthDate: mapDateTime(json, r'birthDate', r''), birthDate: mapDateTime(json, r'birthDate', r''),
color: mapValueOfType<String>(json, r'color'), color: json.containsKey(r'color') ? Optional.present(mapValueOfType<String>(json, r'color')) : const Optional.absent(),
id: mapValueOfType<String>(json, r'id')!, id: mapValueOfType<String>(json, r'id')!,
isFavorite: mapValueOfType<bool>(json, r'isFavorite'), isFavorite: json.containsKey(r'isFavorite') ? Optional.present(mapValueOfType<bool>(json, r'isFavorite')) : const Optional.absent(),
isHidden: mapValueOfType<bool>(json, r'isHidden')!, isHidden: mapValueOfType<bool>(json, r'isHidden')!,
name: mapValueOfType<String>(json, r'name')!, name: mapValueOfType<String>(json, r'name')!,
thumbnailPath: mapValueOfType<String>(json, r'thumbnailPath')!, thumbnailPath: mapValueOfType<String>(json, r'thumbnailPath')!,
updatedAt: mapDateTime(json, r'updatedAt', r''), updatedAt: json.containsKey(r'updatedAt') ? Optional.present(mapDateTime(json, r'updatedAt', r'')) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -13,19 +13,19 @@ part of openapi.api;
class PersonUpdateDto { class PersonUpdateDto {
/// Returns a new [PersonUpdateDto] instance. /// Returns a new [PersonUpdateDto] instance.
PersonUpdateDto({ PersonUpdateDto({
this.birthDate, this.birthDate = const Optional.absent(),
this.color, this.color = const Optional.absent(),
this.featureFaceAssetId, this.featureFaceAssetId = const Optional.absent(),
this.isFavorite, this.isFavorite = const Optional.absent(),
this.isHidden, this.isHidden = const Optional.absent(),
this.name, this.name = const Optional.absent(),
}); });
/// Person date of birth /// Person date of birth
DateTime? birthDate; Optional<DateTime?> birthDate;
/// Person color (hex) /// Person color (hex)
String? color; Optional<String?> color;
/// Asset ID used for feature face thumbnail /// Asset ID used for feature face thumbnail
/// ///
@ -34,7 +34,7 @@ class PersonUpdateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? featureFaceAssetId; Optional<String?> featureFaceAssetId;
/// Mark as favorite /// Mark as favorite
/// ///
@ -43,7 +43,7 @@ class PersonUpdateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? isFavorite; Optional<bool?> isFavorite;
/// Person visibility (hidden) /// Person visibility (hidden)
/// ///
@ -52,7 +52,7 @@ class PersonUpdateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? isHidden; Optional<bool?> isHidden;
/// Person name /// Person name
/// ///
@ -61,7 +61,7 @@ class PersonUpdateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? name; Optional<String?> name;
@override @override
bool operator ==(Object other) => identical(this, other) || other is PersonUpdateDto && bool operator ==(Object other) => identical(this, other) || other is PersonUpdateDto &&
@ -87,35 +87,29 @@ class PersonUpdateDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.birthDate != null) { if (this.birthDate.isPresent) {
json[r'birthDate'] = _dateFormatter.format(this.birthDate!.toUtc()); final value = this.birthDate.value;
} else { json[r'birthDate'] = value == null ? null : _dateFormatter.format(value.toUtc());
// json[r'birthDate'] = null;
} }
if (this.color != null) { if (this.color.isPresent) {
json[r'color'] = this.color; final value = this.color.value;
} else { json[r'color'] = value;
// json[r'color'] = null;
} }
if (this.featureFaceAssetId != null) { if (this.featureFaceAssetId.isPresent) {
json[r'featureFaceAssetId'] = this.featureFaceAssetId; final value = this.featureFaceAssetId.value;
} else { json[r'featureFaceAssetId'] = value;
// json[r'featureFaceAssetId'] = null;
} }
if (this.isFavorite != null) { if (this.isFavorite.isPresent) {
json[r'isFavorite'] = this.isFavorite; final value = this.isFavorite.value;
} else { json[r'isFavorite'] = value;
// json[r'isFavorite'] = null;
} }
if (this.isHidden != null) { if (this.isHidden.isPresent) {
json[r'isHidden'] = this.isHidden; final value = this.isHidden.value;
} else { json[r'isHidden'] = value;
// json[r'isHidden'] = null;
} }
if (this.name != null) { if (this.name.isPresent) {
json[r'name'] = this.name; final value = this.name.value;
} else { json[r'name'] = value;
// json[r'name'] = null;
} }
return json; return json;
} }
@ -129,12 +123,12 @@ class PersonUpdateDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return PersonUpdateDto( return PersonUpdateDto(
birthDate: mapDateTime(json, r'birthDate', r''), birthDate: json.containsKey(r'birthDate') ? Optional.present(mapDateTime(json, r'birthDate', r'')) : const Optional.absent(),
color: mapValueOfType<String>(json, r'color'), color: json.containsKey(r'color') ? Optional.present(mapValueOfType<String>(json, r'color')) : const Optional.absent(),
featureFaceAssetId: mapValueOfType<String>(json, r'featureFaceAssetId'), featureFaceAssetId: json.containsKey(r'featureFaceAssetId') ? Optional.present(mapValueOfType<String>(json, r'featureFaceAssetId')) : const Optional.absent(),
isFavorite: mapValueOfType<bool>(json, r'isFavorite'), isFavorite: json.containsKey(r'isFavorite') ? Optional.present(mapValueOfType<bool>(json, r'isFavorite')) : const Optional.absent(),
isHidden: mapValueOfType<bool>(json, r'isHidden'), isHidden: json.containsKey(r'isHidden') ? Optional.present(mapValueOfType<bool>(json, r'isHidden')) : const Optional.absent(),
name: mapValueOfType<String>(json, r'name'), name: json.containsKey(r'name') ? Optional.present(mapValueOfType<String>(json, r'name')) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -14,8 +14,8 @@ class PinCodeChangeDto {
/// Returns a new [PinCodeChangeDto] instance. /// Returns a new [PinCodeChangeDto] instance.
PinCodeChangeDto({ PinCodeChangeDto({
required this.newPinCode, required this.newPinCode,
this.password, this.password = const Optional.absent(),
this.pinCode, this.pinCode = const Optional.absent(),
}); });
/// New PIN code (4-6 digits) /// New PIN code (4-6 digits)
@ -28,7 +28,7 @@ class PinCodeChangeDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? password; Optional<String?> password;
/// New PIN code (4-6 digits) /// New PIN code (4-6 digits)
/// ///
@ -37,7 +37,7 @@ class PinCodeChangeDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? pinCode; Optional<String?> pinCode;
@override @override
bool operator ==(Object other) => identical(this, other) || other is PinCodeChangeDto && bool operator ==(Object other) => identical(this, other) || other is PinCodeChangeDto &&
@ -58,15 +58,13 @@ class PinCodeChangeDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
json[r'newPinCode'] = this.newPinCode; json[r'newPinCode'] = this.newPinCode;
if (this.password != null) { if (this.password.isPresent) {
json[r'password'] = this.password; final value = this.password.value;
} else { json[r'password'] = value;
// json[r'password'] = null;
} }
if (this.pinCode != null) { if (this.pinCode.isPresent) {
json[r'pinCode'] = this.pinCode; final value = this.pinCode.value;
} else { json[r'pinCode'] = value;
// json[r'pinCode'] = null;
} }
return json; return json;
} }
@ -81,8 +79,8 @@ class PinCodeChangeDto {
return PinCodeChangeDto( return PinCodeChangeDto(
newPinCode: mapValueOfType<String>(json, r'newPinCode')!, newPinCode: mapValueOfType<String>(json, r'newPinCode')!,
password: mapValueOfType<String>(json, r'password'), password: json.containsKey(r'password') ? Optional.present(mapValueOfType<String>(json, r'password')) : const Optional.absent(),
pinCode: mapValueOfType<String>(json, r'pinCode'), pinCode: json.containsKey(r'pinCode') ? Optional.present(mapValueOfType<String>(json, r'pinCode')) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -13,8 +13,8 @@ part of openapi.api;
class PinCodeResetDto { class PinCodeResetDto {
/// Returns a new [PinCodeResetDto] instance. /// Returns a new [PinCodeResetDto] instance.
PinCodeResetDto({ PinCodeResetDto({
this.password, this.password = const Optional.absent(),
this.pinCode, this.pinCode = const Optional.absent(),
}); });
/// User password (required if PIN code is not provided) /// User password (required if PIN code is not provided)
@ -24,7 +24,7 @@ class PinCodeResetDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? password; Optional<String?> password;
/// New PIN code (4-6 digits) /// New PIN code (4-6 digits)
/// ///
@ -33,7 +33,7 @@ class PinCodeResetDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? pinCode; Optional<String?> pinCode;
@override @override
bool operator ==(Object other) => identical(this, other) || other is PinCodeResetDto && bool operator ==(Object other) => identical(this, other) || other is PinCodeResetDto &&
@ -51,15 +51,13 @@ class PinCodeResetDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.password != null) { if (this.password.isPresent) {
json[r'password'] = this.password; final value = this.password.value;
} else { json[r'password'] = value;
// json[r'password'] = null;
} }
if (this.pinCode != null) { if (this.pinCode.isPresent) {
json[r'pinCode'] = this.pinCode; final value = this.pinCode.value;
} else { json[r'pinCode'] = value;
// json[r'pinCode'] = null;
} }
return json; return json;
} }
@ -73,8 +71,8 @@ class PinCodeResetDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return PinCodeResetDto( return PinCodeResetDto(
password: mapValueOfType<String>(json, r'password'), password: json.containsKey(r'password') ? Optional.present(mapValueOfType<String>(json, r'password')) : const Optional.absent(),
pinCode: mapValueOfType<String>(json, r'pinCode'), pinCode: json.containsKey(r'pinCode') ? Optional.present(mapValueOfType<String>(json, r'pinCode')) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -13,8 +13,8 @@ part of openapi.api;
class PlacesResponseDto { class PlacesResponseDto {
/// Returns a new [PlacesResponseDto] instance. /// Returns a new [PlacesResponseDto] instance.
PlacesResponseDto({ PlacesResponseDto({
this.admin1name, this.admin1name = const Optional.absent(),
this.admin2name, this.admin2name = const Optional.absent(),
required this.latitude, required this.latitude,
required this.longitude, required this.longitude,
required this.name, required this.name,
@ -27,7 +27,7 @@ class PlacesResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? admin1name; Optional<String?> admin1name;
/// Administrative level 2 name (county/district) /// Administrative level 2 name (county/district)
/// ///
@ -36,7 +36,7 @@ class PlacesResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? admin2name; Optional<String?> admin2name;
/// Latitude coordinate /// Latitude coordinate
num latitude; num latitude;
@ -69,15 +69,13 @@ class PlacesResponseDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.admin1name != null) { if (this.admin1name.isPresent) {
json[r'admin1name'] = this.admin1name; final value = this.admin1name.value;
} else { json[r'admin1name'] = value;
// json[r'admin1name'] = null;
} }
if (this.admin2name != null) { if (this.admin2name.isPresent) {
json[r'admin2name'] = this.admin2name; final value = this.admin2name.value;
} else { json[r'admin2name'] = value;
// json[r'admin2name'] = null;
} }
json[r'latitude'] = this.latitude; json[r'latitude'] = this.latitude;
json[r'longitude'] = this.longitude; json[r'longitude'] = this.longitude;
@ -94,8 +92,8 @@ class PlacesResponseDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return PlacesResponseDto( return PlacesResponseDto(
admin1name: mapValueOfType<String>(json, r'admin1name'), admin1name: json.containsKey(r'admin1name') ? Optional.present(mapValueOfType<String>(json, r'admin1name')) : const Optional.absent(),
admin2name: mapValueOfType<String>(json, r'admin2name'), admin2name: json.containsKey(r'admin2name') ? Optional.present(mapValueOfType<String>(json, r'admin2name')) : const Optional.absent(),
latitude: num.parse('${json[r'latitude']}'), latitude: num.parse('${json[r'latitude']}'),
longitude: num.parse('${json[r'longitude']}'), longitude: num.parse('${json[r'longitude']}'),
name: mapValueOfType<String>(json, r'name')!, name: mapValueOfType<String>(json, r'name')!,

View File

@ -17,7 +17,7 @@ class PluginMethodResponseDto {
required this.hostFunctions, required this.hostFunctions,
required this.key, required this.key,
required this.name, required this.name,
this.schema, this.schema = const Optional.absent(),
required this.title, required this.title,
this.types = const [], this.types = const [],
this.uiHints = const [], this.uiHints = const [],
@ -40,7 +40,7 @@ class PluginMethodResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
Object? schema; Optional<Object?> schema;
/// Title /// Title
String title; String title;
@ -83,10 +83,9 @@ class PluginMethodResponseDto {
json[r'hostFunctions'] = this.hostFunctions; json[r'hostFunctions'] = this.hostFunctions;
json[r'key'] = this.key; json[r'key'] = this.key;
json[r'name'] = this.name; json[r'name'] = this.name;
if (this.schema != null) { if (this.schema.isPresent) {
json[r'schema'] = this.schema; final value = this.schema.value;
} else { json[r'schema'] = value;
// json[r'schema'] = null;
} }
json[r'title'] = this.title; json[r'title'] = this.title;
json[r'types'] = this.types; json[r'types'] = this.types;
@ -107,7 +106,7 @@ class PluginMethodResponseDto {
hostFunctions: mapValueOfType<bool>(json, r'hostFunctions')!, hostFunctions: mapValueOfType<bool>(json, r'hostFunctions')!,
key: mapValueOfType<String>(json, r'key')!, key: mapValueOfType<String>(json, r'key')!,
name: mapValueOfType<String>(json, r'name')!, name: mapValueOfType<String>(json, r'name')!,
schema: mapValueOfType<Object>(json, r'schema'), schema: json.containsKey(r'schema') ? Optional.present(mapValueOfType<Object>(json, r'schema')) : const Optional.absent(),
title: mapValueOfType<String>(json, r'title')!, title: mapValueOfType<String>(json, r'title')!,
types: WorkflowType.listFromJson(json[r'types']), types: WorkflowType.listFromJson(json[r'types']),
uiHints: json[r'uiHints'] is Iterable uiHints: json[r'uiHints'] is Iterable

View File

@ -14,7 +14,7 @@ class PluginTemplateStepResponseDto {
/// Returns a new [PluginTemplateStepResponseDto] instance. /// Returns a new [PluginTemplateStepResponseDto] instance.
PluginTemplateStepResponseDto({ PluginTemplateStepResponseDto({
this.config = const {}, this.config = const {},
this.enabled, this.enabled = const Optional.absent(),
required this.method, required this.method,
}); });
@ -28,7 +28,7 @@ class PluginTemplateStepResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? enabled; Optional<bool?> enabled;
/// Step plugin method /// Step plugin method
String method; String method;
@ -54,12 +54,11 @@ class PluginTemplateStepResponseDto {
if (this.config != null) { if (this.config != null) {
json[r'config'] = this.config; json[r'config'] = this.config;
} else { } else {
// json[r'config'] = null; json[r'config'] = null;
} }
if (this.enabled != null) { if (this.enabled.isPresent) {
json[r'enabled'] = this.enabled; final value = this.enabled.value;
} else { json[r'enabled'] = value;
// json[r'enabled'] = null;
} }
json[r'method'] = this.method; json[r'method'] = this.method;
return json; return json;
@ -75,7 +74,7 @@ class PluginTemplateStepResponseDto {
return PluginTemplateStepResponseDto( return PluginTemplateStepResponseDto(
config: mapCastOfType<String, Object>(json, r'config'), config: mapCastOfType<String, Object>(json, r'config'),
enabled: mapValueOfType<bool>(json, r'enabled'), enabled: json.containsKey(r'enabled') ? Optional.present(mapValueOfType<bool>(json, r'enabled')) : const Optional.absent(),
method: mapValueOfType<String>(json, r'method')!, method: mapValueOfType<String>(json, r'method')!,
); );
} }

View File

@ -13,8 +13,8 @@ part of openapi.api;
class PurchaseUpdate { class PurchaseUpdate {
/// Returns a new [PurchaseUpdate] instance. /// Returns a new [PurchaseUpdate] instance.
PurchaseUpdate({ PurchaseUpdate({
this.hideBuyButtonUntil, this.hideBuyButtonUntil = const Optional.absent(),
this.showSupportBadge, this.showSupportBadge = const Optional.absent(),
}); });
/// Date until which to hide buy button /// Date until which to hide buy button
@ -24,7 +24,7 @@ class PurchaseUpdate {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? hideBuyButtonUntil; Optional<String?> hideBuyButtonUntil;
/// Whether to show support badge /// Whether to show support badge
/// ///
@ -33,7 +33,7 @@ class PurchaseUpdate {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? showSupportBadge; Optional<bool?> showSupportBadge;
@override @override
bool operator ==(Object other) => identical(this, other) || other is PurchaseUpdate && bool operator ==(Object other) => identical(this, other) || other is PurchaseUpdate &&
@ -51,15 +51,13 @@ class PurchaseUpdate {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.hideBuyButtonUntil != null) { if (this.hideBuyButtonUntil.isPresent) {
json[r'hideBuyButtonUntil'] = this.hideBuyButtonUntil; final value = this.hideBuyButtonUntil.value;
} else { json[r'hideBuyButtonUntil'] = value;
// json[r'hideBuyButtonUntil'] = null;
} }
if (this.showSupportBadge != null) { if (this.showSupportBadge.isPresent) {
json[r'showSupportBadge'] = this.showSupportBadge; final value = this.showSupportBadge.value;
} else { json[r'showSupportBadge'] = value;
// json[r'showSupportBadge'] = null;
} }
return json; return json;
} }
@ -73,8 +71,8 @@ class PurchaseUpdate {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return PurchaseUpdate( return PurchaseUpdate(
hideBuyButtonUntil: mapValueOfType<String>(json, r'hideBuyButtonUntil'), hideBuyButtonUntil: json.containsKey(r'hideBuyButtonUntil') ? Optional.present(mapValueOfType<String>(json, r'hideBuyButtonUntil')) : const Optional.absent(),
showSupportBadge: mapValueOfType<bool>(json, r'showSupportBadge'), showSupportBadge: json.containsKey(r'showSupportBadge') ? Optional.present(mapValueOfType<bool>(json, r'showSupportBadge')) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -14,7 +14,7 @@ class QueueCommandDto {
/// Returns a new [QueueCommandDto] instance. /// Returns a new [QueueCommandDto] instance.
QueueCommandDto({ QueueCommandDto({
required this.command, required this.command,
this.force, this.force = const Optional.absent(),
}); });
QueueCommand command; QueueCommand command;
@ -26,7 +26,7 @@ class QueueCommandDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? force; Optional<bool?> force;
@override @override
bool operator ==(Object other) => identical(this, other) || other is QueueCommandDto && bool operator ==(Object other) => identical(this, other) || other is QueueCommandDto &&
@ -45,10 +45,9 @@ class QueueCommandDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
json[r'command'] = this.command; json[r'command'] = this.command;
if (this.force != null) { if (this.force.isPresent) {
json[r'force'] = this.force; final value = this.force.value;
} else { json[r'force'] = value;
// json[r'force'] = null;
} }
return json; return json;
} }
@ -63,7 +62,7 @@ class QueueCommandDto {
return QueueCommandDto( return QueueCommandDto(
command: QueueCommand.fromJson(json[r'command'])!, command: QueueCommand.fromJson(json[r'command'])!,
force: mapValueOfType<bool>(json, r'force'), force: json.containsKey(r'force') ? Optional.present(mapValueOfType<bool>(json, r'force')) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -13,7 +13,7 @@ part of openapi.api;
class QueueDeleteDto { class QueueDeleteDto {
/// Returns a new [QueueDeleteDto] instance. /// Returns a new [QueueDeleteDto] instance.
QueueDeleteDto({ QueueDeleteDto({
this.failed, this.failed = const Optional.absent(),
}); });
/// If true, will also remove failed jobs from the queue. /// If true, will also remove failed jobs from the queue.
@ -23,7 +23,7 @@ class QueueDeleteDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? failed; Optional<bool?> failed;
@override @override
bool operator ==(Object other) => identical(this, other) || other is QueueDeleteDto && bool operator ==(Object other) => identical(this, other) || other is QueueDeleteDto &&
@ -39,10 +39,9 @@ class QueueDeleteDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.failed != null) { if (this.failed.isPresent) {
json[r'failed'] = this.failed; final value = this.failed.value;
} else { json[r'failed'] = value;
// json[r'failed'] = null;
} }
return json; return json;
} }
@ -56,7 +55,7 @@ class QueueDeleteDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return QueueDeleteDto( return QueueDeleteDto(
failed: mapValueOfType<bool>(json, r'failed'), failed: json.containsKey(r'failed') ? Optional.present(mapValueOfType<bool>(json, r'failed')) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -14,7 +14,7 @@ class QueueJobResponseDto {
/// Returns a new [QueueJobResponseDto] instance. /// Returns a new [QueueJobResponseDto] instance.
QueueJobResponseDto({ QueueJobResponseDto({
this.data = const {}, this.data = const {},
this.id, this.id = const Optional.absent(),
required this.name, required this.name,
required this.timestamp, required this.timestamp,
}); });
@ -29,7 +29,7 @@ class QueueJobResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? id; Optional<String?> id;
JobName name; JobName name;
@ -60,10 +60,9 @@ class QueueJobResponseDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
json[r'data'] = this.data; json[r'data'] = this.data;
if (this.id != null) { if (this.id.isPresent) {
json[r'id'] = this.id; final value = this.id.value;
} else { json[r'id'] = value;
// json[r'id'] = null;
} }
json[r'name'] = this.name; json[r'name'] = this.name;
json[r'timestamp'] = this.timestamp; json[r'timestamp'] = this.timestamp;
@ -80,7 +79,7 @@ class QueueJobResponseDto {
return QueueJobResponseDto( return QueueJobResponseDto(
data: mapCastOfType<String, Object>(json, r'data')!, data: mapCastOfType<String, Object>(json, r'data')!,
id: mapValueOfType<String>(json, r'id'), id: json.containsKey(r'id') ? Optional.present(mapValueOfType<String>(json, r'id')) : const Optional.absent(),
name: JobName.fromJson(json[r'name'])!, name: JobName.fromJson(json[r'name'])!,
timestamp: mapValueOfType<int>(json, r'timestamp')!, timestamp: mapValueOfType<int>(json, r'timestamp')!,
); );

View File

@ -13,7 +13,7 @@ part of openapi.api;
class QueueUpdateDto { class QueueUpdateDto {
/// Returns a new [QueueUpdateDto] instance. /// Returns a new [QueueUpdateDto] instance.
QueueUpdateDto({ QueueUpdateDto({
this.isPaused, this.isPaused = const Optional.absent(),
}); });
/// Whether to pause the queue /// Whether to pause the queue
@ -23,7 +23,7 @@ class QueueUpdateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? isPaused; Optional<bool?> isPaused;
@override @override
bool operator ==(Object other) => identical(this, other) || other is QueueUpdateDto && bool operator ==(Object other) => identical(this, other) || other is QueueUpdateDto &&
@ -39,10 +39,9 @@ class QueueUpdateDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.isPaused != null) { if (this.isPaused.isPresent) {
json[r'isPaused'] = this.isPaused; final value = this.isPaused.value;
} else { json[r'isPaused'] = value;
// json[r'isPaused'] = null;
} }
return json; return json;
} }
@ -56,7 +55,7 @@ class QueueUpdateDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return QueueUpdateDto( return QueueUpdateDto(
isPaused: mapValueOfType<bool>(json, r'isPaused'), isPaused: json.containsKey(r'isPaused') ? Optional.present(mapValueOfType<bool>(json, r'isPaused')) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -13,48 +13,48 @@ part of openapi.api;
class RandomSearchDto { class RandomSearchDto {
/// Returns a new [RandomSearchDto] instance. /// Returns a new [RandomSearchDto] instance.
RandomSearchDto({ RandomSearchDto({
this.albumIds = const [], this.albumIds = const Optional.present(const []),
this.city, this.city = const Optional.absent(),
this.country, this.country = const Optional.absent(),
this.createdAfter, this.createdAfter = const Optional.absent(),
this.createdBefore, this.createdBefore = const Optional.absent(),
this.isEncoded, this.isEncoded = const Optional.absent(),
this.isFavorite, this.isFavorite = const Optional.absent(),
this.isMotion, this.isMotion = const Optional.absent(),
this.isNotInAlbum, this.isNotInAlbum = const Optional.absent(),
this.isOffline, this.isOffline = const Optional.absent(),
this.lensModel, this.lensModel = const Optional.absent(),
this.libraryId, this.libraryId = const Optional.absent(),
this.make, this.make = const Optional.absent(),
this.model, this.model = const Optional.absent(),
this.ocr, this.ocr = const Optional.absent(),
this.personIds = const [], this.personIds = const Optional.present(const []),
this.rating, this.rating = const Optional.absent(),
this.size, this.size = const Optional.absent(),
this.state, this.state = const Optional.absent(),
this.tagIds = const [], this.tagIds = const Optional.present(const []),
this.takenAfter, this.takenAfter = const Optional.absent(),
this.takenBefore, this.takenBefore = const Optional.absent(),
this.trashedAfter, this.trashedAfter = const Optional.absent(),
this.trashedBefore, this.trashedBefore = const Optional.absent(),
this.type, this.type = const Optional.absent(),
this.updatedAfter, this.updatedAfter = const Optional.absent(),
this.updatedBefore, this.updatedBefore = const Optional.absent(),
this.visibility, this.visibility = const Optional.absent(),
this.withDeleted, this.withDeleted = const Optional.absent(),
this.withExif, this.withExif = const Optional.absent(),
this.withPeople, this.withPeople = const Optional.absent(),
this.withStacked, this.withStacked = const Optional.absent(),
}); });
/// Filter by album IDs /// Filter by album IDs
List<String> albumIds; Optional<List<String>?> albumIds;
/// Filter by city name /// Filter by city name
String? city; Optional<String?> city;
/// Filter by country name /// Filter by country name
String? country; Optional<String?> country;
/// Filter by creation date (after) /// Filter by creation date (after)
/// ///
@ -63,7 +63,7 @@ class RandomSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? createdAfter; Optional<DateTime?> createdAfter;
/// Filter by creation date (before) /// Filter by creation date (before)
/// ///
@ -72,7 +72,7 @@ class RandomSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? createdBefore; Optional<DateTime?> createdBefore;
/// Filter by encoded status /// Filter by encoded status
/// ///
@ -81,7 +81,7 @@ class RandomSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? isEncoded; Optional<bool?> isEncoded;
/// Filter by favorite status /// Filter by favorite status
/// ///
@ -90,7 +90,7 @@ class RandomSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? isFavorite; Optional<bool?> isFavorite;
/// Filter by motion photo status /// Filter by motion photo status
/// ///
@ -99,7 +99,7 @@ class RandomSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? isMotion; Optional<bool?> isMotion;
/// Filter assets not in any album /// Filter assets not in any album
/// ///
@ -108,7 +108,7 @@ class RandomSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? isNotInAlbum; Optional<bool?> isNotInAlbum;
/// Filter by offline status /// Filter by offline status
/// ///
@ -117,19 +117,19 @@ class RandomSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? isOffline; Optional<bool?> isOffline;
/// Filter by lens model /// Filter by lens model
String? lensModel; Optional<String?> lensModel;
/// Library ID to filter by /// Library ID to filter by
String? libraryId; Optional<String?> libraryId;
/// Filter by camera make /// Filter by camera make
String? make; Optional<String?> make;
/// Filter by camera model /// Filter by camera model
String? model; Optional<String?> model;
/// Filter by OCR text content /// Filter by OCR text content
/// ///
@ -138,16 +138,16 @@ class RandomSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? ocr; Optional<String?> ocr;
/// Filter by person IDs /// Filter by person IDs
List<String> personIds; Optional<List<String>?> personIds;
/// Filter by rating [1-5], or null for unrated /// Filter by rating [1-5], or null for unrated
/// ///
/// Minimum value: -1 /// Minimum value: -1
/// Maximum value: 5 /// Maximum value: 5
int? rating; Optional<int?> rating;
/// Number of results to return /// Number of results to return
/// ///
@ -159,13 +159,13 @@ class RandomSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
int? size; Optional<int?> size;
/// Filter by state/province name /// Filter by state/province name
String? state; Optional<String?> state;
/// Filter by tag IDs /// Filter by tag IDs
List<String>? tagIds; Optional<List<String>?> tagIds;
/// Filter by taken date (after) /// Filter by taken date (after)
/// ///
@ -174,7 +174,7 @@ class RandomSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? takenAfter; Optional<DateTime?> takenAfter;
/// Filter by taken date (before) /// Filter by taken date (before)
/// ///
@ -183,7 +183,7 @@ class RandomSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? takenBefore; Optional<DateTime?> takenBefore;
/// Filter by trash date (after) /// Filter by trash date (after)
/// ///
@ -192,7 +192,7 @@ class RandomSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? trashedAfter; Optional<DateTime?> trashedAfter;
/// Filter by trash date (before) /// Filter by trash date (before)
/// ///
@ -201,7 +201,7 @@ class RandomSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? trashedBefore; Optional<DateTime?> trashedBefore;
/// ///
/// Please note: This property should have been non-nullable! Since the specification file /// Please note: This property should have been non-nullable! Since the specification file
@ -209,7 +209,7 @@ class RandomSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
AssetTypeEnum? type; Optional<AssetTypeEnum?> type;
/// Filter by update date (after) /// Filter by update date (after)
/// ///
@ -218,7 +218,7 @@ class RandomSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? updatedAfter; Optional<DateTime?> updatedAfter;
/// Filter by update date (before) /// Filter by update date (before)
/// ///
@ -227,7 +227,7 @@ class RandomSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
DateTime? updatedBefore; Optional<DateTime?> updatedBefore;
/// ///
/// Please note: This property should have been non-nullable! Since the specification file /// Please note: This property should have been non-nullable! Since the specification file
@ -235,7 +235,7 @@ class RandomSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
AssetVisibility? visibility; Optional<AssetVisibility?> visibility;
/// Include deleted assets /// Include deleted assets
/// ///
@ -244,7 +244,7 @@ class RandomSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? withDeleted; Optional<bool?> withDeleted;
/// Include EXIF data in response /// Include EXIF data in response
/// ///
@ -253,7 +253,7 @@ class RandomSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? withExif; Optional<bool?> withExif;
/// Include people data in response /// Include people data in response
/// ///
@ -262,7 +262,7 @@ class RandomSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? withPeople; Optional<bool?> withPeople;
/// Include stacked assets /// Include stacked assets
/// ///
@ -271,7 +271,7 @@ class RandomSearchDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? withStacked; Optional<bool?> withStacked;
@override @override
bool operator ==(Object other) => identical(this, other) || other is RandomSearchDto && bool operator ==(Object other) => identical(this, other) || other is RandomSearchDto &&
@ -349,173 +349,149 @@ class RandomSearchDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
json[r'albumIds'] = this.albumIds; if (this.albumIds.isPresent) {
if (this.city != null) { final value = this.albumIds.value;
json[r'city'] = this.city; json[r'albumIds'] = value;
} else {
// json[r'city'] = null;
} }
if (this.country != null) { if (this.city.isPresent) {
json[r'country'] = this.country; final value = this.city.value;
} else { json[r'city'] = value;
// json[r'country'] = null;
} }
if (this.createdAfter != null) { if (this.country.isPresent) {
json[r'createdAfter'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') final value = this.country.value;
? this.createdAfter!.millisecondsSinceEpoch json[r'country'] = value;
: this.createdAfter!.toUtc().toIso8601String();
} else {
// json[r'createdAfter'] = null;
} }
if (this.createdBefore != null) { if (this.createdAfter.isPresent) {
json[r'createdBefore'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') final value = this.createdAfter.value;
? this.createdBefore!.millisecondsSinceEpoch json[r'createdAfter'] = value == null ? null : (_isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
: this.createdBefore!.toUtc().toIso8601String(); ? value.millisecondsSinceEpoch
} else { : value.toUtc().toIso8601String());
// json[r'createdBefore'] = null;
} }
if (this.isEncoded != null) { if (this.createdBefore.isPresent) {
json[r'isEncoded'] = this.isEncoded; final value = this.createdBefore.value;
} else { json[r'createdBefore'] = value == null ? null : (_isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
// json[r'isEncoded'] = null; ? value.millisecondsSinceEpoch
: value.toUtc().toIso8601String());
} }
if (this.isFavorite != null) { if (this.isEncoded.isPresent) {
json[r'isFavorite'] = this.isFavorite; final value = this.isEncoded.value;
} else { json[r'isEncoded'] = value;
// json[r'isFavorite'] = null;
} }
if (this.isMotion != null) { if (this.isFavorite.isPresent) {
json[r'isMotion'] = this.isMotion; final value = this.isFavorite.value;
} else { json[r'isFavorite'] = value;
// json[r'isMotion'] = null;
} }
if (this.isNotInAlbum != null) { if (this.isMotion.isPresent) {
json[r'isNotInAlbum'] = this.isNotInAlbum; final value = this.isMotion.value;
} else { json[r'isMotion'] = value;
// json[r'isNotInAlbum'] = null;
} }
if (this.isOffline != null) { if (this.isNotInAlbum.isPresent) {
json[r'isOffline'] = this.isOffline; final value = this.isNotInAlbum.value;
} else { json[r'isNotInAlbum'] = value;
// json[r'isOffline'] = null;
} }
if (this.lensModel != null) { if (this.isOffline.isPresent) {
json[r'lensModel'] = this.lensModel; final value = this.isOffline.value;
} else { json[r'isOffline'] = value;
// json[r'lensModel'] = null;
} }
if (this.libraryId != null) { if (this.lensModel.isPresent) {
json[r'libraryId'] = this.libraryId; final value = this.lensModel.value;
} else { json[r'lensModel'] = value;
// json[r'libraryId'] = null;
} }
if (this.make != null) { if (this.libraryId.isPresent) {
json[r'make'] = this.make; final value = this.libraryId.value;
} else { json[r'libraryId'] = value;
// json[r'make'] = null;
} }
if (this.model != null) { if (this.make.isPresent) {
json[r'model'] = this.model; final value = this.make.value;
} else { json[r'make'] = value;
// json[r'model'] = null;
} }
if (this.ocr != null) { if (this.model.isPresent) {
json[r'ocr'] = this.ocr; final value = this.model.value;
} else { json[r'model'] = value;
// json[r'ocr'] = null;
} }
json[r'personIds'] = this.personIds; if (this.ocr.isPresent) {
if (this.rating != null) { final value = this.ocr.value;
json[r'rating'] = this.rating; json[r'ocr'] = value;
} else {
// json[r'rating'] = null;
} }
if (this.size != null) { if (this.personIds.isPresent) {
json[r'size'] = this.size; final value = this.personIds.value;
} else { json[r'personIds'] = value;
// json[r'size'] = null;
} }
if (this.state != null) { if (this.rating.isPresent) {
json[r'state'] = this.state; final value = this.rating.value;
} else { json[r'rating'] = value;
// json[r'state'] = null;
} }
if (this.tagIds != null) { if (this.size.isPresent) {
json[r'tagIds'] = this.tagIds; final value = this.size.value;
} else { json[r'size'] = value;
// json[r'tagIds'] = null;
} }
if (this.takenAfter != null) { if (this.state.isPresent) {
json[r'takenAfter'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') final value = this.state.value;
? this.takenAfter!.millisecondsSinceEpoch json[r'state'] = value;
: this.takenAfter!.toUtc().toIso8601String();
} else {
// json[r'takenAfter'] = null;
} }
if (this.takenBefore != null) { if (this.tagIds.isPresent) {
json[r'takenBefore'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') final value = this.tagIds.value;
? this.takenBefore!.millisecondsSinceEpoch json[r'tagIds'] = value;
: this.takenBefore!.toUtc().toIso8601String();
} else {
// json[r'takenBefore'] = null;
} }
if (this.trashedAfter != null) { if (this.takenAfter.isPresent) {
json[r'trashedAfter'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') final value = this.takenAfter.value;
? this.trashedAfter!.millisecondsSinceEpoch json[r'takenAfter'] = value == null ? null : (_isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
: this.trashedAfter!.toUtc().toIso8601String(); ? value.millisecondsSinceEpoch
} else { : value.toUtc().toIso8601String());
// json[r'trashedAfter'] = null;
} }
if (this.trashedBefore != null) { if (this.takenBefore.isPresent) {
json[r'trashedBefore'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') final value = this.takenBefore.value;
? this.trashedBefore!.millisecondsSinceEpoch json[r'takenBefore'] = value == null ? null : (_isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
: this.trashedBefore!.toUtc().toIso8601String(); ? value.millisecondsSinceEpoch
} else { : value.toUtc().toIso8601String());
// json[r'trashedBefore'] = null;
} }
if (this.type != null) { if (this.trashedAfter.isPresent) {
json[r'type'] = this.type; final value = this.trashedAfter.value;
} else { json[r'trashedAfter'] = value == null ? null : (_isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
// json[r'type'] = null; ? value.millisecondsSinceEpoch
: value.toUtc().toIso8601String());
} }
if (this.updatedAfter != null) { if (this.trashedBefore.isPresent) {
json[r'updatedAfter'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') final value = this.trashedBefore.value;
? this.updatedAfter!.millisecondsSinceEpoch json[r'trashedBefore'] = value == null ? null : (_isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
: this.updatedAfter!.toUtc().toIso8601String(); ? value.millisecondsSinceEpoch
} else { : value.toUtc().toIso8601String());
// json[r'updatedAfter'] = null;
} }
if (this.updatedBefore != null) { if (this.type.isPresent) {
json[r'updatedBefore'] = _isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/') final value = this.type.value;
? this.updatedBefore!.millisecondsSinceEpoch json[r'type'] = value;
: this.updatedBefore!.toUtc().toIso8601String();
} else {
// json[r'updatedBefore'] = null;
} }
if (this.visibility != null) { if (this.updatedAfter.isPresent) {
json[r'visibility'] = this.visibility; final value = this.updatedAfter.value;
} else { json[r'updatedAfter'] = value == null ? null : (_isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
// json[r'visibility'] = null; ? value.millisecondsSinceEpoch
: value.toUtc().toIso8601String());
} }
if (this.withDeleted != null) { if (this.updatedBefore.isPresent) {
json[r'withDeleted'] = this.withDeleted; final value = this.updatedBefore.value;
} else { json[r'updatedBefore'] = value == null ? null : (_isEpochMarker(r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')
// json[r'withDeleted'] = null; ? value.millisecondsSinceEpoch
: value.toUtc().toIso8601String());
} }
if (this.withExif != null) { if (this.visibility.isPresent) {
json[r'withExif'] = this.withExif; final value = this.visibility.value;
} else { json[r'visibility'] = value;
// json[r'withExif'] = null;
} }
if (this.withPeople != null) { if (this.withDeleted.isPresent) {
json[r'withPeople'] = this.withPeople; final value = this.withDeleted.value;
} else { json[r'withDeleted'] = value;
// json[r'withPeople'] = null;
} }
if (this.withStacked != null) { if (this.withExif.isPresent) {
json[r'withStacked'] = this.withStacked; final value = this.withExif.value;
} else { json[r'withExif'] = value;
// json[r'withStacked'] = null; }
if (this.withPeople.isPresent) {
final value = this.withPeople.value;
json[r'withPeople'] = value;
}
if (this.withStacked.isPresent) {
final value = this.withStacked.value;
json[r'withStacked'] = value;
} }
return json; return json;
} }
@ -529,44 +505,44 @@ class RandomSearchDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return RandomSearchDto( return RandomSearchDto(
albumIds: json[r'albumIds'] is Iterable albumIds: json.containsKey(r'albumIds') ? Optional.present(json[r'albumIds'] is Iterable
? (json[r'albumIds'] as Iterable).cast<String>().toList(growable: false) ? (json[r'albumIds'] as Iterable).cast<String>().toList(growable: false)
: const [], : const []) : const Optional.absent(),
city: mapValueOfType<String>(json, r'city'), city: json.containsKey(r'city') ? Optional.present(mapValueOfType<String>(json, r'city')) : const Optional.absent(),
country: mapValueOfType<String>(json, r'country'), country: json.containsKey(r'country') ? Optional.present(mapValueOfType<String>(json, r'country')) : const Optional.absent(),
createdAfter: mapDateTime(json, r'createdAfter', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), createdAfter: json.containsKey(r'createdAfter') ? Optional.present(mapDateTime(json, r'createdAfter', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(),
createdBefore: mapDateTime(json, r'createdBefore', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), createdBefore: json.containsKey(r'createdBefore') ? Optional.present(mapDateTime(json, r'createdBefore', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(),
isEncoded: mapValueOfType<bool>(json, r'isEncoded'), isEncoded: json.containsKey(r'isEncoded') ? Optional.present(mapValueOfType<bool>(json, r'isEncoded')) : const Optional.absent(),
isFavorite: mapValueOfType<bool>(json, r'isFavorite'), isFavorite: json.containsKey(r'isFavorite') ? Optional.present(mapValueOfType<bool>(json, r'isFavorite')) : const Optional.absent(),
isMotion: mapValueOfType<bool>(json, r'isMotion'), isMotion: json.containsKey(r'isMotion') ? Optional.present(mapValueOfType<bool>(json, r'isMotion')) : const Optional.absent(),
isNotInAlbum: mapValueOfType<bool>(json, r'isNotInAlbum'), isNotInAlbum: json.containsKey(r'isNotInAlbum') ? Optional.present(mapValueOfType<bool>(json, r'isNotInAlbum')) : const Optional.absent(),
isOffline: mapValueOfType<bool>(json, r'isOffline'), isOffline: json.containsKey(r'isOffline') ? Optional.present(mapValueOfType<bool>(json, r'isOffline')) : const Optional.absent(),
lensModel: mapValueOfType<String>(json, r'lensModel'), lensModel: json.containsKey(r'lensModel') ? Optional.present(mapValueOfType<String>(json, r'lensModel')) : const Optional.absent(),
libraryId: mapValueOfType<String>(json, r'libraryId'), libraryId: json.containsKey(r'libraryId') ? Optional.present(mapValueOfType<String>(json, r'libraryId')) : const Optional.absent(),
make: mapValueOfType<String>(json, r'make'), make: json.containsKey(r'make') ? Optional.present(mapValueOfType<String>(json, r'make')) : const Optional.absent(),
model: mapValueOfType<String>(json, r'model'), model: json.containsKey(r'model') ? Optional.present(mapValueOfType<String>(json, r'model')) : const Optional.absent(),
ocr: mapValueOfType<String>(json, r'ocr'), ocr: json.containsKey(r'ocr') ? Optional.present(mapValueOfType<String>(json, r'ocr')) : const Optional.absent(),
personIds: json[r'personIds'] is Iterable personIds: json.containsKey(r'personIds') ? Optional.present(json[r'personIds'] is Iterable
? (json[r'personIds'] as Iterable).cast<String>().toList(growable: false) ? (json[r'personIds'] as Iterable).cast<String>().toList(growable: false)
: const [], : const []) : const Optional.absent(),
rating: mapValueOfType<int>(json, r'rating'), rating: json.containsKey(r'rating') ? Optional.present(json[r'rating'] == null ? null : int.parse('${json[r'rating']}')) : const Optional.absent(),
size: mapValueOfType<int>(json, r'size'), size: json.containsKey(r'size') ? Optional.present(json[r'size'] == null ? null : int.parse('${json[r'size']}')) : const Optional.absent(),
state: mapValueOfType<String>(json, r'state'), state: json.containsKey(r'state') ? Optional.present(mapValueOfType<String>(json, r'state')) : const Optional.absent(),
tagIds: json[r'tagIds'] is Iterable tagIds: json.containsKey(r'tagIds') ? Optional.present(json[r'tagIds'] is Iterable
? (json[r'tagIds'] as Iterable).cast<String>().toList(growable: false) ? (json[r'tagIds'] as Iterable).cast<String>().toList(growable: false)
: const [], : const []) : const Optional.absent(),
takenAfter: mapDateTime(json, r'takenAfter', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), takenAfter: json.containsKey(r'takenAfter') ? Optional.present(mapDateTime(json, r'takenAfter', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(),
takenBefore: mapDateTime(json, r'takenBefore', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), takenBefore: json.containsKey(r'takenBefore') ? Optional.present(mapDateTime(json, r'takenBefore', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(),
trashedAfter: mapDateTime(json, r'trashedAfter', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), trashedAfter: json.containsKey(r'trashedAfter') ? Optional.present(mapDateTime(json, r'trashedAfter', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(),
trashedBefore: mapDateTime(json, r'trashedBefore', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), trashedBefore: json.containsKey(r'trashedBefore') ? Optional.present(mapDateTime(json, r'trashedBefore', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(),
type: AssetTypeEnum.fromJson(json[r'type']), type: json.containsKey(r'type') ? Optional.present(AssetTypeEnum.fromJson(json[r'type'])) : const Optional.absent(),
updatedAfter: mapDateTime(json, r'updatedAfter', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), updatedAfter: json.containsKey(r'updatedAfter') ? Optional.present(mapDateTime(json, r'updatedAfter', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(),
updatedBefore: mapDateTime(json, r'updatedBefore', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/'), updatedBefore: json.containsKey(r'updatedBefore') ? Optional.present(mapDateTime(json, r'updatedBefore', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(),
visibility: AssetVisibility.fromJson(json[r'visibility']), visibility: json.containsKey(r'visibility') ? Optional.present(AssetVisibility.fromJson(json[r'visibility'])) : const Optional.absent(),
withDeleted: mapValueOfType<bool>(json, r'withDeleted'), withDeleted: json.containsKey(r'withDeleted') ? Optional.present(mapValueOfType<bool>(json, r'withDeleted')) : const Optional.absent(),
withExif: mapValueOfType<bool>(json, r'withExif'), withExif: json.containsKey(r'withExif') ? Optional.present(mapValueOfType<bool>(json, r'withExif')) : const Optional.absent(),
withPeople: mapValueOfType<bool>(json, r'withPeople'), withPeople: json.containsKey(r'withPeople') ? Optional.present(mapValueOfType<bool>(json, r'withPeople')) : const Optional.absent(),
withStacked: mapValueOfType<bool>(json, r'withStacked'), withStacked: json.containsKey(r'withStacked') ? Optional.present(mapValueOfType<bool>(json, r'withStacked')) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -13,7 +13,7 @@ part of openapi.api;
class RatingsUpdate { class RatingsUpdate {
/// Returns a new [RatingsUpdate] instance. /// Returns a new [RatingsUpdate] instance.
RatingsUpdate({ RatingsUpdate({
this.enabled, this.enabled = const Optional.absent(),
}); });
/// Whether ratings are enabled /// Whether ratings are enabled
@ -23,7 +23,7 @@ class RatingsUpdate {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
bool? enabled; Optional<bool?> enabled;
@override @override
bool operator ==(Object other) => identical(this, other) || other is RatingsUpdate && bool operator ==(Object other) => identical(this, other) || other is RatingsUpdate &&
@ -39,10 +39,9 @@ class RatingsUpdate {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.enabled != null) { if (this.enabled.isPresent) {
json[r'enabled'] = this.enabled; final value = this.enabled.value;
} else { json[r'enabled'] = value;
// json[r'enabled'] = null;
} }
return json; return json;
} }
@ -56,7 +55,7 @@ class RatingsUpdate {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return RatingsUpdate( return RatingsUpdate(
enabled: mapValueOfType<bool>(json, r'enabled'), enabled: json.containsKey(r'enabled') ? Optional.present(mapValueOfType<bool>(json, r'enabled')) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -42,12 +42,12 @@ class ReverseGeocodingStateResponseDto {
if (this.lastImportFileName != null) { if (this.lastImportFileName != null) {
json[r'lastImportFileName'] = this.lastImportFileName; json[r'lastImportFileName'] = this.lastImportFileName;
} else { } else {
// json[r'lastImportFileName'] = null; json[r'lastImportFileName'] = null;
} }
if (this.lastUpdate != null) { if (this.lastUpdate != null) {
json[r'lastUpdate'] = this.lastUpdate; json[r'lastUpdate'] = this.lastUpdate;
} else { } else {
// json[r'lastUpdate'] = null; json[r'lastUpdate'] = null;
} }
return json; return json;
} }

View File

@ -67,7 +67,7 @@ class SearchAssetResponseDto {
if (this.nextPage != null) { if (this.nextPage != null) {
json[r'nextPage'] = this.nextPage; json[r'nextPage'] = this.nextPage;
} else { } else {
// json[r'nextPage'] = null; json[r'nextPage'] = null;
} }
json[r'total'] = this.total; json[r'total'] = this.total;
return json; return json;

View File

@ -13,25 +13,25 @@ part of openapi.api;
class ServerAboutResponseDto { class ServerAboutResponseDto {
/// Returns a new [ServerAboutResponseDto] instance. /// Returns a new [ServerAboutResponseDto] instance.
ServerAboutResponseDto({ ServerAboutResponseDto({
this.build, this.build = const Optional.absent(),
this.buildImage, this.buildImage = const Optional.absent(),
this.buildImageUrl, this.buildImageUrl = const Optional.absent(),
this.buildUrl, this.buildUrl = const Optional.absent(),
this.exiftool, this.exiftool = const Optional.absent(),
this.ffmpeg, this.ffmpeg = const Optional.absent(),
this.imagemagick, this.imagemagick = const Optional.absent(),
this.libvips, this.libvips = const Optional.absent(),
required this.licensed, required this.licensed,
this.nodejs, this.nodejs = const Optional.absent(),
this.repository, this.repository = const Optional.absent(),
this.repositoryUrl, this.repositoryUrl = const Optional.absent(),
this.sourceCommit, this.sourceCommit = const Optional.absent(),
this.sourceRef, this.sourceRef = const Optional.absent(),
this.sourceUrl, this.sourceUrl = const Optional.absent(),
this.thirdPartyBugFeatureUrl, this.thirdPartyBugFeatureUrl = const Optional.absent(),
this.thirdPartyDocumentationUrl, this.thirdPartyDocumentationUrl = const Optional.absent(),
this.thirdPartySourceUrl, this.thirdPartySourceUrl = const Optional.absent(),
this.thirdPartySupportUrl, this.thirdPartySupportUrl = const Optional.absent(),
required this.version, required this.version,
required this.versionUrl, required this.versionUrl,
}); });
@ -43,7 +43,7 @@ class ServerAboutResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? build; Optional<String?> build;
/// Build image name /// Build image name
/// ///
@ -52,7 +52,7 @@ class ServerAboutResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? buildImage; Optional<String?> buildImage;
/// Build image URL /// Build image URL
/// ///
@ -61,7 +61,7 @@ class ServerAboutResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? buildImageUrl; Optional<String?> buildImageUrl;
/// Build URL /// Build URL
/// ///
@ -70,7 +70,7 @@ class ServerAboutResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? buildUrl; Optional<String?> buildUrl;
/// ExifTool version /// ExifTool version
/// ///
@ -79,7 +79,7 @@ class ServerAboutResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? exiftool; Optional<String?> exiftool;
/// FFmpeg version /// FFmpeg version
/// ///
@ -88,7 +88,7 @@ class ServerAboutResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? ffmpeg; Optional<String?> ffmpeg;
/// ImageMagick version /// ImageMagick version
/// ///
@ -97,7 +97,7 @@ class ServerAboutResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? imagemagick; Optional<String?> imagemagick;
/// libvips version /// libvips version
/// ///
@ -106,7 +106,7 @@ class ServerAboutResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? libvips; Optional<String?> libvips;
/// Whether the server is licensed /// Whether the server is licensed
bool licensed; bool licensed;
@ -118,7 +118,7 @@ class ServerAboutResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? nodejs; Optional<String?> nodejs;
/// Repository name /// Repository name
/// ///
@ -127,7 +127,7 @@ class ServerAboutResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? repository; Optional<String?> repository;
/// Repository URL /// Repository URL
/// ///
@ -136,7 +136,7 @@ class ServerAboutResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? repositoryUrl; Optional<String?> repositoryUrl;
/// Source commit hash /// Source commit hash
/// ///
@ -145,7 +145,7 @@ class ServerAboutResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? sourceCommit; Optional<String?> sourceCommit;
/// Source reference (branch/tag) /// Source reference (branch/tag)
/// ///
@ -154,7 +154,7 @@ class ServerAboutResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? sourceRef; Optional<String?> sourceRef;
/// Source URL /// Source URL
/// ///
@ -163,7 +163,7 @@ class ServerAboutResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? sourceUrl; Optional<String?> sourceUrl;
/// Third-party bug/feature URL /// Third-party bug/feature URL
/// ///
@ -172,7 +172,7 @@ class ServerAboutResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? thirdPartyBugFeatureUrl; Optional<String?> thirdPartyBugFeatureUrl;
/// Third-party documentation URL /// Third-party documentation URL
/// ///
@ -181,7 +181,7 @@ class ServerAboutResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? thirdPartyDocumentationUrl; Optional<String?> thirdPartyDocumentationUrl;
/// Third-party source URL /// Third-party source URL
/// ///
@ -190,7 +190,7 @@ class ServerAboutResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? thirdPartySourceUrl; Optional<String?> thirdPartySourceUrl;
/// Third-party support URL /// Third-party support URL
/// ///
@ -199,7 +199,7 @@ class ServerAboutResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? thirdPartySupportUrl; Optional<String?> thirdPartySupportUrl;
/// Server version /// Server version
String version; String version;
@ -261,96 +261,78 @@ class ServerAboutResponseDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.build != null) { if (this.build.isPresent) {
json[r'build'] = this.build; final value = this.build.value;
} else { json[r'build'] = value;
// json[r'build'] = null;
} }
if (this.buildImage != null) { if (this.buildImage.isPresent) {
json[r'buildImage'] = this.buildImage; final value = this.buildImage.value;
} else { json[r'buildImage'] = value;
// json[r'buildImage'] = null;
} }
if (this.buildImageUrl != null) { if (this.buildImageUrl.isPresent) {
json[r'buildImageUrl'] = this.buildImageUrl; final value = this.buildImageUrl.value;
} else { json[r'buildImageUrl'] = value;
// json[r'buildImageUrl'] = null;
} }
if (this.buildUrl != null) { if (this.buildUrl.isPresent) {
json[r'buildUrl'] = this.buildUrl; final value = this.buildUrl.value;
} else { json[r'buildUrl'] = value;
// json[r'buildUrl'] = null;
} }
if (this.exiftool != null) { if (this.exiftool.isPresent) {
json[r'exiftool'] = this.exiftool; final value = this.exiftool.value;
} else { json[r'exiftool'] = value;
// json[r'exiftool'] = null;
} }
if (this.ffmpeg != null) { if (this.ffmpeg.isPresent) {
json[r'ffmpeg'] = this.ffmpeg; final value = this.ffmpeg.value;
} else { json[r'ffmpeg'] = value;
// json[r'ffmpeg'] = null;
} }
if (this.imagemagick != null) { if (this.imagemagick.isPresent) {
json[r'imagemagick'] = this.imagemagick; final value = this.imagemagick.value;
} else { json[r'imagemagick'] = value;
// json[r'imagemagick'] = null;
} }
if (this.libvips != null) { if (this.libvips.isPresent) {
json[r'libvips'] = this.libvips; final value = this.libvips.value;
} else { json[r'libvips'] = value;
// json[r'libvips'] = null;
} }
json[r'licensed'] = this.licensed; json[r'licensed'] = this.licensed;
if (this.nodejs != null) { if (this.nodejs.isPresent) {
json[r'nodejs'] = this.nodejs; final value = this.nodejs.value;
} else { json[r'nodejs'] = value;
// json[r'nodejs'] = null;
} }
if (this.repository != null) { if (this.repository.isPresent) {
json[r'repository'] = this.repository; final value = this.repository.value;
} else { json[r'repository'] = value;
// json[r'repository'] = null;
} }
if (this.repositoryUrl != null) { if (this.repositoryUrl.isPresent) {
json[r'repositoryUrl'] = this.repositoryUrl; final value = this.repositoryUrl.value;
} else { json[r'repositoryUrl'] = value;
// json[r'repositoryUrl'] = null;
} }
if (this.sourceCommit != null) { if (this.sourceCommit.isPresent) {
json[r'sourceCommit'] = this.sourceCommit; final value = this.sourceCommit.value;
} else { json[r'sourceCommit'] = value;
// json[r'sourceCommit'] = null;
} }
if (this.sourceRef != null) { if (this.sourceRef.isPresent) {
json[r'sourceRef'] = this.sourceRef; final value = this.sourceRef.value;
} else { json[r'sourceRef'] = value;
// json[r'sourceRef'] = null;
} }
if (this.sourceUrl != null) { if (this.sourceUrl.isPresent) {
json[r'sourceUrl'] = this.sourceUrl; final value = this.sourceUrl.value;
} else { json[r'sourceUrl'] = value;
// json[r'sourceUrl'] = null;
} }
if (this.thirdPartyBugFeatureUrl != null) { if (this.thirdPartyBugFeatureUrl.isPresent) {
json[r'thirdPartyBugFeatureUrl'] = this.thirdPartyBugFeatureUrl; final value = this.thirdPartyBugFeatureUrl.value;
} else { json[r'thirdPartyBugFeatureUrl'] = value;
// json[r'thirdPartyBugFeatureUrl'] = null;
} }
if (this.thirdPartyDocumentationUrl != null) { if (this.thirdPartyDocumentationUrl.isPresent) {
json[r'thirdPartyDocumentationUrl'] = this.thirdPartyDocumentationUrl; final value = this.thirdPartyDocumentationUrl.value;
} else { json[r'thirdPartyDocumentationUrl'] = value;
// json[r'thirdPartyDocumentationUrl'] = null;
} }
if (this.thirdPartySourceUrl != null) { if (this.thirdPartySourceUrl.isPresent) {
json[r'thirdPartySourceUrl'] = this.thirdPartySourceUrl; final value = this.thirdPartySourceUrl.value;
} else { json[r'thirdPartySourceUrl'] = value;
// json[r'thirdPartySourceUrl'] = null;
} }
if (this.thirdPartySupportUrl != null) { if (this.thirdPartySupportUrl.isPresent) {
json[r'thirdPartySupportUrl'] = this.thirdPartySupportUrl; final value = this.thirdPartySupportUrl.value;
} else { json[r'thirdPartySupportUrl'] = value;
// json[r'thirdPartySupportUrl'] = null;
} }
json[r'version'] = this.version; json[r'version'] = this.version;
json[r'versionUrl'] = this.versionUrl; json[r'versionUrl'] = this.versionUrl;
@ -366,25 +348,25 @@ class ServerAboutResponseDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return ServerAboutResponseDto( return ServerAboutResponseDto(
build: mapValueOfType<String>(json, r'build'), build: json.containsKey(r'build') ? Optional.present(mapValueOfType<String>(json, r'build')) : const Optional.absent(),
buildImage: mapValueOfType<String>(json, r'buildImage'), buildImage: json.containsKey(r'buildImage') ? Optional.present(mapValueOfType<String>(json, r'buildImage')) : const Optional.absent(),
buildImageUrl: mapValueOfType<String>(json, r'buildImageUrl'), buildImageUrl: json.containsKey(r'buildImageUrl') ? Optional.present(mapValueOfType<String>(json, r'buildImageUrl')) : const Optional.absent(),
buildUrl: mapValueOfType<String>(json, r'buildUrl'), buildUrl: json.containsKey(r'buildUrl') ? Optional.present(mapValueOfType<String>(json, r'buildUrl')) : const Optional.absent(),
exiftool: mapValueOfType<String>(json, r'exiftool'), exiftool: json.containsKey(r'exiftool') ? Optional.present(mapValueOfType<String>(json, r'exiftool')) : const Optional.absent(),
ffmpeg: mapValueOfType<String>(json, r'ffmpeg'), ffmpeg: json.containsKey(r'ffmpeg') ? Optional.present(mapValueOfType<String>(json, r'ffmpeg')) : const Optional.absent(),
imagemagick: mapValueOfType<String>(json, r'imagemagick'), imagemagick: json.containsKey(r'imagemagick') ? Optional.present(mapValueOfType<String>(json, r'imagemagick')) : const Optional.absent(),
libvips: mapValueOfType<String>(json, r'libvips'), libvips: json.containsKey(r'libvips') ? Optional.present(mapValueOfType<String>(json, r'libvips')) : const Optional.absent(),
licensed: mapValueOfType<bool>(json, r'licensed')!, licensed: mapValueOfType<bool>(json, r'licensed')!,
nodejs: mapValueOfType<String>(json, r'nodejs'), nodejs: json.containsKey(r'nodejs') ? Optional.present(mapValueOfType<String>(json, r'nodejs')) : const Optional.absent(),
repository: mapValueOfType<String>(json, r'repository'), repository: json.containsKey(r'repository') ? Optional.present(mapValueOfType<String>(json, r'repository')) : const Optional.absent(),
repositoryUrl: mapValueOfType<String>(json, r'repositoryUrl'), repositoryUrl: json.containsKey(r'repositoryUrl') ? Optional.present(mapValueOfType<String>(json, r'repositoryUrl')) : const Optional.absent(),
sourceCommit: mapValueOfType<String>(json, r'sourceCommit'), sourceCommit: json.containsKey(r'sourceCommit') ? Optional.present(mapValueOfType<String>(json, r'sourceCommit')) : const Optional.absent(),
sourceRef: mapValueOfType<String>(json, r'sourceRef'), sourceRef: json.containsKey(r'sourceRef') ? Optional.present(mapValueOfType<String>(json, r'sourceRef')) : const Optional.absent(),
sourceUrl: mapValueOfType<String>(json, r'sourceUrl'), sourceUrl: json.containsKey(r'sourceUrl') ? Optional.present(mapValueOfType<String>(json, r'sourceUrl')) : const Optional.absent(),
thirdPartyBugFeatureUrl: mapValueOfType<String>(json, r'thirdPartyBugFeatureUrl'), thirdPartyBugFeatureUrl: json.containsKey(r'thirdPartyBugFeatureUrl') ? Optional.present(mapValueOfType<String>(json, r'thirdPartyBugFeatureUrl')) : const Optional.absent(),
thirdPartyDocumentationUrl: mapValueOfType<String>(json, r'thirdPartyDocumentationUrl'), thirdPartyDocumentationUrl: json.containsKey(r'thirdPartyDocumentationUrl') ? Optional.present(mapValueOfType<String>(json, r'thirdPartyDocumentationUrl')) : const Optional.absent(),
thirdPartySourceUrl: mapValueOfType<String>(json, r'thirdPartySourceUrl'), thirdPartySourceUrl: json.containsKey(r'thirdPartySourceUrl') ? Optional.present(mapValueOfType<String>(json, r'thirdPartySourceUrl')) : const Optional.absent(),
thirdPartySupportUrl: mapValueOfType<String>(json, r'thirdPartySupportUrl'), thirdPartySupportUrl: json.containsKey(r'thirdPartySupportUrl') ? Optional.present(mapValueOfType<String>(json, r'thirdPartySupportUrl')) : const Optional.absent(),
version: mapValueOfType<String>(json, r'version')!, version: mapValueOfType<String>(json, r'version')!,
versionUrl: mapValueOfType<String>(json, r'versionUrl')!, versionUrl: mapValueOfType<String>(json, r'versionUrl')!,
); );

View File

@ -101,7 +101,7 @@ class ServerStorageResponseDto {
diskAvailableRaw: mapValueOfType<int>(json, r'diskAvailableRaw')!, diskAvailableRaw: mapValueOfType<int>(json, r'diskAvailableRaw')!,
diskSize: mapValueOfType<String>(json, r'diskSize')!, diskSize: mapValueOfType<String>(json, r'diskSize')!,
diskSizeRaw: mapValueOfType<int>(json, r'diskSizeRaw')!, diskSizeRaw: mapValueOfType<int>(json, r'diskSizeRaw')!,
diskUsagePercentage: (mapValueOfType<num>(json, r'diskUsagePercentage')!).toDouble(), diskUsagePercentage: mapValueOfType<double>(json, r'diskUsagePercentage')!,
diskUse: mapValueOfType<String>(json, r'diskUse')!, diskUse: mapValueOfType<String>(json, r'diskUse')!,
diskUseRaw: mapValueOfType<int>(json, r'diskUseRaw')!, diskUseRaw: mapValueOfType<int>(json, r'diskUseRaw')!,
); );

View File

@ -69,7 +69,7 @@ class ServerVersionResponseDto {
if (this.prerelease != null) { if (this.prerelease != null) {
json[r'prerelease'] = this.prerelease; json[r'prerelease'] = this.prerelease;
} else { } else {
// json[r'prerelease'] = null; json[r'prerelease'] = null;
} }
return json; return json;
} }

View File

@ -13,9 +13,9 @@ part of openapi.api;
class SessionCreateDto { class SessionCreateDto {
/// Returns a new [SessionCreateDto] instance. /// Returns a new [SessionCreateDto] instance.
SessionCreateDto({ SessionCreateDto({
this.deviceOS, this.deviceOS = const Optional.absent(),
this.deviceType, this.deviceType = const Optional.absent(),
this.duration, this.duration = const Optional.absent(),
}); });
/// Device OS /// Device OS
@ -25,7 +25,7 @@ class SessionCreateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? deviceOS; Optional<String?> deviceOS;
/// Device type /// Device type
/// ///
@ -34,7 +34,7 @@ class SessionCreateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? deviceType; Optional<String?> deviceType;
/// Session duration in seconds /// Session duration in seconds
/// ///
@ -46,7 +46,7 @@ class SessionCreateDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
int? duration; Optional<int?> duration;
@override @override
bool operator ==(Object other) => identical(this, other) || other is SessionCreateDto && bool operator ==(Object other) => identical(this, other) || other is SessionCreateDto &&
@ -66,20 +66,17 @@ class SessionCreateDto {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
if (this.deviceOS != null) { if (this.deviceOS.isPresent) {
json[r'deviceOS'] = this.deviceOS; final value = this.deviceOS.value;
} else { json[r'deviceOS'] = value;
// json[r'deviceOS'] = null;
} }
if (this.deviceType != null) { if (this.deviceType.isPresent) {
json[r'deviceType'] = this.deviceType; final value = this.deviceType.value;
} else { json[r'deviceType'] = value;
// json[r'deviceType'] = null;
} }
if (this.duration != null) { if (this.duration.isPresent) {
json[r'duration'] = this.duration; final value = this.duration.value;
} else { json[r'duration'] = value;
// json[r'duration'] = null;
} }
return json; return json;
} }
@ -93,9 +90,9 @@ class SessionCreateDto {
final json = value.cast<String, dynamic>(); final json = value.cast<String, dynamic>();
return SessionCreateDto( return SessionCreateDto(
deviceOS: mapValueOfType<String>(json, r'deviceOS'), deviceOS: json.containsKey(r'deviceOS') ? Optional.present(mapValueOfType<String>(json, r'deviceOS')) : const Optional.absent(),
deviceType: mapValueOfType<String>(json, r'deviceType'), deviceType: json.containsKey(r'deviceType') ? Optional.present(mapValueOfType<String>(json, r'deviceType')) : const Optional.absent(),
duration: mapValueOfType<int>(json, r'duration'), duration: json.containsKey(r'duration') ? Optional.present(json[r'duration'] == null ? null : int.parse('${json[r'duration']}')) : const Optional.absent(),
); );
} }
return null; return null;

View File

@ -18,7 +18,7 @@ class SessionCreateResponseDto {
required this.current, required this.current,
required this.deviceOS, required this.deviceOS,
required this.deviceType, required this.deviceType,
this.expiresAt, this.expiresAt = const Optional.absent(),
required this.id, required this.id,
required this.isPendingSyncReset, required this.isPendingSyncReset,
required this.token, required this.token,
@ -47,7 +47,7 @@ class SessionCreateResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? expiresAt; Optional<String?> expiresAt;
/// Session ID /// Session ID
String id; String id;
@ -96,16 +96,15 @@ class SessionCreateResponseDto {
if (this.appVersion != null) { if (this.appVersion != null) {
json[r'appVersion'] = this.appVersion; json[r'appVersion'] = this.appVersion;
} else { } else {
// json[r'appVersion'] = null; json[r'appVersion'] = null;
} }
json[r'createdAt'] = this.createdAt; json[r'createdAt'] = this.createdAt;
json[r'current'] = this.current; json[r'current'] = this.current;
json[r'deviceOS'] = this.deviceOS; json[r'deviceOS'] = this.deviceOS;
json[r'deviceType'] = this.deviceType; json[r'deviceType'] = this.deviceType;
if (this.expiresAt != null) { if (this.expiresAt.isPresent) {
json[r'expiresAt'] = this.expiresAt; final value = this.expiresAt.value;
} else { json[r'expiresAt'] = value;
// json[r'expiresAt'] = null;
} }
json[r'id'] = this.id; json[r'id'] = this.id;
json[r'isPendingSyncReset'] = this.isPendingSyncReset; json[r'isPendingSyncReset'] = this.isPendingSyncReset;
@ -128,7 +127,7 @@ class SessionCreateResponseDto {
current: mapValueOfType<bool>(json, r'current')!, current: mapValueOfType<bool>(json, r'current')!,
deviceOS: mapValueOfType<String>(json, r'deviceOS')!, deviceOS: mapValueOfType<String>(json, r'deviceOS')!,
deviceType: mapValueOfType<String>(json, r'deviceType')!, deviceType: mapValueOfType<String>(json, r'deviceType')!,
expiresAt: mapValueOfType<String>(json, r'expiresAt'), expiresAt: json.containsKey(r'expiresAt') ? Optional.present(mapValueOfType<String>(json, r'expiresAt')) : const Optional.absent(),
id: mapValueOfType<String>(json, r'id')!, id: mapValueOfType<String>(json, r'id')!,
isPendingSyncReset: mapValueOfType<bool>(json, r'isPendingSyncReset')!, isPendingSyncReset: mapValueOfType<bool>(json, r'isPendingSyncReset')!,
token: mapValueOfType<String>(json, r'token')!, token: mapValueOfType<String>(json, r'token')!,

View File

@ -18,7 +18,7 @@ class SessionResponseDto {
required this.current, required this.current,
required this.deviceOS, required this.deviceOS,
required this.deviceType, required this.deviceType,
this.expiresAt, this.expiresAt = const Optional.absent(),
required this.id, required this.id,
required this.isPendingSyncReset, required this.isPendingSyncReset,
required this.updatedAt, required this.updatedAt,
@ -46,7 +46,7 @@ class SessionResponseDto {
/// source code must fall back to having a nullable type. /// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note. /// Consider adding a "default:" property in the specification file to hide this note.
/// ///
String? expiresAt; Optional<String?> expiresAt;
/// Session ID /// Session ID
String id; String id;
@ -90,16 +90,15 @@ class SessionResponseDto {
if (this.appVersion != null) { if (this.appVersion != null) {
json[r'appVersion'] = this.appVersion; json[r'appVersion'] = this.appVersion;
} else { } else {
// json[r'appVersion'] = null; json[r'appVersion'] = null;
} }
json[r'createdAt'] = this.createdAt; json[r'createdAt'] = this.createdAt;
json[r'current'] = this.current; json[r'current'] = this.current;
json[r'deviceOS'] = this.deviceOS; json[r'deviceOS'] = this.deviceOS;
json[r'deviceType'] = this.deviceType; json[r'deviceType'] = this.deviceType;
if (this.expiresAt != null) { if (this.expiresAt.isPresent) {
json[r'expiresAt'] = this.expiresAt; final value = this.expiresAt.value;
} else { json[r'expiresAt'] = value;
// json[r'expiresAt'] = null;
} }
json[r'id'] = this.id; json[r'id'] = this.id;
json[r'isPendingSyncReset'] = this.isPendingSyncReset; json[r'isPendingSyncReset'] = this.isPendingSyncReset;
@ -121,7 +120,7 @@ class SessionResponseDto {
current: mapValueOfType<bool>(json, r'current')!, current: mapValueOfType<bool>(json, r'current')!,
deviceOS: mapValueOfType<String>(json, r'deviceOS')!, deviceOS: mapValueOfType<String>(json, r'deviceOS')!,
deviceType: mapValueOfType<String>(json, r'deviceType')!, deviceType: mapValueOfType<String>(json, r'deviceType')!,
expiresAt: mapValueOfType<String>(json, r'expiresAt'), expiresAt: json.containsKey(r'expiresAt') ? Optional.present(mapValueOfType<String>(json, r'expiresAt')) : const Optional.absent(),
id: mapValueOfType<String>(json, r'id')!, id: mapValueOfType<String>(json, r'id')!,
isPendingSyncReset: mapValueOfType<bool>(json, r'isPendingSyncReset')!, isPendingSyncReset: mapValueOfType<bool>(json, r'isPendingSyncReset')!,
updatedAt: mapValueOfType<String>(json, r'updatedAt')!, updatedAt: mapValueOfType<String>(json, r'updatedAt')!,

Some files were not shown because too many files have changed in this diff Show More