mirror of
https://github.com/immich-app/immich.git
synced 2026-05-22 23:52:32 -04:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 182de9871a | |||
| 1ed8d32291 | |||
| a6d5e9a62c |
@@ -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(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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(
|
||||||
|
|||||||
@@ -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));
|
||||||
|
|||||||
@@ -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)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -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)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
7.8.0
|
7.22.0
|
||||||
|
|||||||
Generated
+1
-1
@@ -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
|
||||||
|
|||||||
Generated
+1
@@ -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';
|
||||||
|
|||||||
Generated
+3
-3
@@ -143,19 +143,19 @@ class ApiClient {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<dynamic> deserializeAsync(String value, String targetType, {bool growable = false,}) =>
|
Future<dynamic> deserializeAsync(String value, String targetType, {bool growable = false,}) async =>
|
||||||
// ignore: deprecated_member_use_from_same_package
|
// ignore: deprecated_member_use_from_same_package
|
||||||
deserialize(value, targetType, growable: growable);
|
deserialize(value, targetType, growable: growable);
|
||||||
|
|
||||||
@Deprecated('Scheduled for removal in OpenAPI Generator 6.x. Use deserializeAsync() instead.')
|
@Deprecated('Scheduled for removal in OpenAPI Generator 6.x. Use deserializeAsync() instead.')
|
||||||
Future<dynamic> deserialize(String value, String targetType, {bool growable = false,}) async {
|
dynamic deserialize(String value, String targetType, {bool growable = false,}) {
|
||||||
// Remove all spaces. Necessary for regular expressions as well.
|
// Remove all spaces. Necessary for regular expressions as well.
|
||||||
targetType = targetType.replaceAll(' ', ''); // ignore: parameter_assignments
|
targetType = targetType.replaceAll(' ', ''); // ignore: parameter_assignments
|
||||||
|
|
||||||
// If the expected target type is String, nothing to do...
|
// If the expected target type is String, nothing to do...
|
||||||
return targetType == 'String'
|
return targetType == 'String'
|
||||||
? value
|
? value
|
||||||
: fromJson(await compute((String j) => json.decode(j), value), targetType, growable: growable);
|
: fromJson(json.decode(value), targetType, growable: growable);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore: deprecated_member_use_from_same_package
|
// ignore: deprecated_member_use_from_same_package
|
||||||
|
|||||||
Generated
+3
@@ -220,6 +220,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+23
-14
@@ -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;
|
||||||
@@ -85,10 +83,21 @@ class ActivityCreateDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'albumId'), 'Required key "ActivityCreateDto[albumId]" is missing from JSON.');
|
||||||
|
assert(json[r'albumId'] != null, 'Required key "ActivityCreateDto[albumId]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'type'), 'Required key "ActivityCreateDto[type]" is missing from JSON.');
|
||||||
|
assert(json[r'type'] != null, 'Required key "ActivityCreateDto[type]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
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'])!,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+23
-8
@@ -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
|
||||||
@@ -88,9 +87,25 @@ class ActivityResponseDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'assetId'), 'Required key "ActivityResponseDto[assetId]" is missing from JSON.');
|
||||||
|
assert(json.containsKey(r'createdAt'), 'Required key "ActivityResponseDto[createdAt]" is missing from JSON.');
|
||||||
|
assert(json[r'createdAt'] != null, 'Required key "ActivityResponseDto[createdAt]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'id'), 'Required key "ActivityResponseDto[id]" is missing from JSON.');
|
||||||
|
assert(json[r'id'] != null, 'Required key "ActivityResponseDto[id]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'type'), 'Required key "ActivityResponseDto[type]" is missing from JSON.');
|
||||||
|
assert(json[r'type'] != null, 'Required key "ActivityResponseDto[type]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'user'), 'Required key "ActivityResponseDto[user]" is missing from JSON.');
|
||||||
|
assert(json[r'user'] != null, 'Required key "ActivityResponseDto[user]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
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'])!,
|
||||||
|
|||||||
@@ -58,6 +58,17 @@ class ActivityStatisticsResponseDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'comments'), 'Required key "ActivityStatisticsResponseDto[comments]" is missing from JSON.');
|
||||||
|
assert(json[r'comments'] != null, 'Required key "ActivityStatisticsResponseDto[comments]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'likes'), 'Required key "ActivityStatisticsResponseDto[likes]" is missing from JSON.');
|
||||||
|
assert(json[r'likes'] != null, 'Required key "ActivityStatisticsResponseDto[likes]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return ActivityStatisticsResponseDto(
|
return ActivityStatisticsResponseDto(
|
||||||
comments: mapValueOfType<int>(json, r'comments')!,
|
comments: mapValueOfType<int>(json, r'comments')!,
|
||||||
likes: mapValueOfType<int>(json, r'likes')!,
|
likes: mapValueOfType<int>(json, r'likes')!,
|
||||||
|
|||||||
+9
@@ -45,6 +45,15 @@ class AddUsersDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'albumUsers'), 'Required key "AddUsersDto[albumUsers]" is missing from JSON.');
|
||||||
|
assert(json[r'albumUsers'] != null, 'Required key "AddUsersDto[albumUsers]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AddUsersDto(
|
return AddUsersDto(
|
||||||
albumUsers: AlbumUserAddDto.listFromJson(json[r'albumUsers']),
|
albumUsers: AlbumUserAddDto.listFromJson(json[r'albumUsers']),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -45,6 +45,15 @@ class AdminOnboardingUpdateDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'isOnboarded'), 'Required key "AdminOnboardingUpdateDto[isOnboarded]" is missing from JSON.');
|
||||||
|
assert(json[r'isOnboarded'] != null, 'Required key "AdminOnboardingUpdateDto[isOnboarded]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AdminOnboardingUpdateDto(
|
return AdminOnboardingUpdateDto(
|
||||||
isOnboarded: mapValueOfType<bool>(json, r'isOnboarded')!,
|
isOnboarded: mapValueOfType<bool>(json, r'isOnboarded')!,
|
||||||
);
|
);
|
||||||
|
|||||||
+60
-33
@@ -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;
|
||||||
@@ -195,22 +194,50 @@ class AlbumResponseDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'albumName'), 'Required key "AlbumResponseDto[albumName]" is missing from JSON.');
|
||||||
|
assert(json[r'albumName'] != null, 'Required key "AlbumResponseDto[albumName]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'albumThumbnailAssetId'), 'Required key "AlbumResponseDto[albumThumbnailAssetId]" is missing from JSON.');
|
||||||
|
assert(json.containsKey(r'albumUsers'), 'Required key "AlbumResponseDto[albumUsers]" is missing from JSON.');
|
||||||
|
assert(json[r'albumUsers'] != null, 'Required key "AlbumResponseDto[albumUsers]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'assetCount'), 'Required key "AlbumResponseDto[assetCount]" is missing from JSON.');
|
||||||
|
assert(json[r'assetCount'] != null, 'Required key "AlbumResponseDto[assetCount]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'createdAt'), 'Required key "AlbumResponseDto[createdAt]" is missing from JSON.');
|
||||||
|
assert(json[r'createdAt'] != null, 'Required key "AlbumResponseDto[createdAt]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'description'), 'Required key "AlbumResponseDto[description]" is missing from JSON.');
|
||||||
|
assert(json[r'description'] != null, 'Required key "AlbumResponseDto[description]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'hasSharedLink'), 'Required key "AlbumResponseDto[hasSharedLink]" is missing from JSON.');
|
||||||
|
assert(json[r'hasSharedLink'] != null, 'Required key "AlbumResponseDto[hasSharedLink]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'id'), 'Required key "AlbumResponseDto[id]" is missing from JSON.');
|
||||||
|
assert(json[r'id'] != null, 'Required key "AlbumResponseDto[id]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'isActivityEnabled'), 'Required key "AlbumResponseDto[isActivityEnabled]" is missing from JSON.');
|
||||||
|
assert(json[r'isActivityEnabled'] != null, 'Required key "AlbumResponseDto[isActivityEnabled]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'shared'), 'Required key "AlbumResponseDto[shared]" is missing from JSON.');
|
||||||
|
assert(json[r'shared'] != null, 'Required key "AlbumResponseDto[shared]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'updatedAt'), 'Required key "AlbumResponseDto[updatedAt]" is missing from JSON.');
|
||||||
|
assert(json[r'updatedAt'] != null, 'Required key "AlbumResponseDto[updatedAt]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AlbumResponseDto(
|
return AlbumResponseDto(
|
||||||
albumName: mapValueOfType<String>(json, r'albumName')!,
|
albumName: mapValueOfType<String>(json, r'albumName')!,
|
||||||
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'')!,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,6 +68,19 @@ class AlbumStatisticsResponseDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'notShared'), 'Required key "AlbumStatisticsResponseDto[notShared]" is missing from JSON.');
|
||||||
|
assert(json[r'notShared'] != null, 'Required key "AlbumStatisticsResponseDto[notShared]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'owned'), 'Required key "AlbumStatisticsResponseDto[owned]" is missing from JSON.');
|
||||||
|
assert(json[r'owned'] != null, 'Required key "AlbumStatisticsResponseDto[owned]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'shared'), 'Required key "AlbumStatisticsResponseDto[shared]" is missing from JSON.');
|
||||||
|
assert(json[r'shared'] != null, 'Required key "AlbumStatisticsResponseDto[shared]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AlbumStatisticsResponseDto(
|
return AlbumStatisticsResponseDto(
|
||||||
notShared: mapValueOfType<int>(json, r'notShared')!,
|
notShared: mapValueOfType<int>(json, r'notShared')!,
|
||||||
owned: mapValueOfType<int>(json, r'owned')!,
|
owned: mapValueOfType<int>(json, r'owned')!,
|
||||||
|
|||||||
+15
-7
@@ -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;
|
||||||
@@ -61,8 +60,17 @@ class AlbumUserAddDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'userId'), 'Required key "AlbumUserAddDto[userId]" is missing from JSON.');
|
||||||
|
assert(json[r'userId'] != null, 'Required key "AlbumUserAddDto[userId]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
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')!,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+11
@@ -51,6 +51,17 @@ class AlbumUserCreateDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'role'), 'Required key "AlbumUserCreateDto[role]" is missing from JSON.');
|
||||||
|
assert(json[r'role'] != null, 'Required key "AlbumUserCreateDto[role]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'userId'), 'Required key "AlbumUserCreateDto[userId]" is missing from JSON.');
|
||||||
|
assert(json[r'userId'] != null, 'Required key "AlbumUserCreateDto[userId]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AlbumUserCreateDto(
|
return AlbumUserCreateDto(
|
||||||
role: AlbumUserRole.fromJson(json[r'role'])!,
|
role: AlbumUserRole.fromJson(json[r'role'])!,
|
||||||
userId: mapValueOfType<String>(json, r'userId')!,
|
userId: mapValueOfType<String>(json, r'userId')!,
|
||||||
|
|||||||
@@ -50,6 +50,17 @@ class AlbumUserResponseDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'role'), 'Required key "AlbumUserResponseDto[role]" is missing from JSON.');
|
||||||
|
assert(json[r'role'] != null, 'Required key "AlbumUserResponseDto[role]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'user'), 'Required key "AlbumUserResponseDto[user]" is missing from JSON.');
|
||||||
|
assert(json[r'user'] != null, 'Required key "AlbumUserResponseDto[user]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AlbumUserResponseDto(
|
return AlbumUserResponseDto(
|
||||||
role: AlbumUserRole.fromJson(json[r'role'])!,
|
role: AlbumUserRole.fromJson(json[r'role'])!,
|
||||||
user: UserResponseDto.fromJson(json[r'user'])!,
|
user: UserResponseDto.fromJson(json[r'user'])!,
|
||||||
|
|||||||
+11
@@ -52,6 +52,17 @@ class AlbumsAddAssetsDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'albumIds'), 'Required key "AlbumsAddAssetsDto[albumIds]" is missing from JSON.');
|
||||||
|
assert(json[r'albumIds'] != null, 'Required key "AlbumsAddAssetsDto[albumIds]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'assetIds'), 'Required key "AlbumsAddAssetsDto[assetIds]" is missing from JSON.');
|
||||||
|
assert(json[r'assetIds'] != null, 'Required key "AlbumsAddAssetsDto[assetIds]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AlbumsAddAssetsDto(
|
return AlbumsAddAssetsDto(
|
||||||
albumIds: json[r'albumIds'] is Iterable
|
albumIds: 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)
|
||||||
|
|||||||
+15
-7
@@ -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;
|
||||||
@@ -61,8 +60,17 @@ class AlbumsAddAssetsResponseDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'success'), 'Required key "AlbumsAddAssetsResponseDto[success]" is missing from JSON.');
|
||||||
|
assert(json[r'success'] != null, 'Required key "AlbumsAddAssetsResponseDto[success]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
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')!,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+9
@@ -44,6 +44,15 @@ class AlbumsResponse {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'defaultAssetOrder'), 'Required key "AlbumsResponse[defaultAssetOrder]" is missing from JSON.');
|
||||||
|
assert(json[r'defaultAssetOrder'] != null, 'Required key "AlbumsResponse[defaultAssetOrder]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AlbumsResponse(
|
return AlbumsResponse(
|
||||||
defaultAssetOrder: AssetOrder.fromJson(json[r'defaultAssetOrder'])!,
|
defaultAssetOrder: AssetOrder.fromJson(json[r'defaultAssetOrder'])!,
|
||||||
);
|
);
|
||||||
|
|||||||
+13
-7
@@ -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;
|
||||||
}
|
}
|
||||||
@@ -54,8 +53,15 @@ class AlbumsUpdate {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
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;
|
||||||
|
|||||||
+15
-7
@@ -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;
|
||||||
@@ -62,8 +61,17 @@ class ApiKeyCreateDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'permissions'), 'Required key "ApiKeyCreateDto[permissions]" is missing from JSON.');
|
||||||
|
assert(json[r'permissions'] != null, 'Required key "ApiKeyCreateDto[permissions]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
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']),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,17 @@ class ApiKeyCreateResponseDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'apiKey'), 'Required key "ApiKeyCreateResponseDto[apiKey]" is missing from JSON.');
|
||||||
|
assert(json[r'apiKey'] != null, 'Required key "ApiKeyCreateResponseDto[apiKey]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'secret'), 'Required key "ApiKeyCreateResponseDto[secret]" is missing from JSON.');
|
||||||
|
assert(json[r'secret'] != null, 'Required key "ApiKeyCreateResponseDto[secret]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return ApiKeyCreateResponseDto(
|
return ApiKeyCreateResponseDto(
|
||||||
apiKey: ApiKeyResponseDto.fromJson(json[r'apiKey'])!,
|
apiKey: ApiKeyResponseDto.fromJson(json[r'apiKey'])!,
|
||||||
secret: mapValueOfType<String>(json, r'secret')!,
|
secret: mapValueOfType<String>(json, r'secret')!,
|
||||||
|
|||||||
+17
@@ -77,6 +77,23 @@ class ApiKeyResponseDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'createdAt'), 'Required key "ApiKeyResponseDto[createdAt]" is missing from JSON.');
|
||||||
|
assert(json[r'createdAt'] != null, 'Required key "ApiKeyResponseDto[createdAt]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'id'), 'Required key "ApiKeyResponseDto[id]" is missing from JSON.');
|
||||||
|
assert(json[r'id'] != null, 'Required key "ApiKeyResponseDto[id]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'name'), 'Required key "ApiKeyResponseDto[name]" is missing from JSON.');
|
||||||
|
assert(json[r'name'] != null, 'Required key "ApiKeyResponseDto[name]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'permissions'), 'Required key "ApiKeyResponseDto[permissions]" is missing from JSON.');
|
||||||
|
assert(json[r'permissions'] != null, 'Required key "ApiKeyResponseDto[permissions]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'updatedAt'), 'Required key "ApiKeyResponseDto[updatedAt]" is missing from JSON.');
|
||||||
|
assert(json[r'updatedAt'] != null, 'Required key "ApiKeyResponseDto[updatedAt]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return ApiKeyResponseDto(
|
return ApiKeyResponseDto(
|
||||||
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')!,
|
||||||
|
|||||||
+20
-11
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,9 +64,16 @@ class ApiKeyUpdateDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
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;
|
||||||
|
|||||||
+15
-7
@@ -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;
|
||||||
@@ -62,8 +61,17 @@ class AssetBulkDeleteDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'ids'), 'Required key "AssetBulkDeleteDto[ids]" is missing from JSON.');
|
||||||
|
assert(json[r'ids'] != null, 'Required key "AssetBulkDeleteDto[ids]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
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 [],
|
||||||
|
|||||||
+69
-70
@@ -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;
|
||||||
}
|
}
|
||||||
@@ -214,20 +204,29 @@ class AssetBulkUpdateDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'ids'), 'Required key "AssetBulkUpdateDto[ids]" is missing from JSON.');
|
||||||
|
assert(json[r'ids'] != null, 'Required key "AssetBulkUpdateDto[ids]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
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;
|
||||||
|
|||||||
@@ -45,6 +45,15 @@ class AssetBulkUploadCheckDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'assets'), 'Required key "AssetBulkUploadCheckDto[assets]" is missing from JSON.');
|
||||||
|
assert(json[r'assets'] != null, 'Required key "AssetBulkUploadCheckDto[assets]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AssetBulkUploadCheckDto(
|
return AssetBulkUploadCheckDto(
|
||||||
assets: AssetBulkUploadCheckItem.listFromJson(json[r'assets']),
|
assets: AssetBulkUploadCheckItem.listFromJson(json[r'assets']),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -52,6 +52,17 @@ class AssetBulkUploadCheckItem {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'checksum'), 'Required key "AssetBulkUploadCheckItem[checksum]" is missing from JSON.');
|
||||||
|
assert(json[r'checksum'] != null, 'Required key "AssetBulkUploadCheckItem[checksum]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'id'), 'Required key "AssetBulkUploadCheckItem[id]" is missing from JSON.');
|
||||||
|
assert(json[r'id'] != null, 'Required key "AssetBulkUploadCheckItem[id]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AssetBulkUploadCheckItem(
|
return AssetBulkUploadCheckItem(
|
||||||
checksum: mapValueOfType<String>(json, r'checksum')!,
|
checksum: mapValueOfType<String>(json, r'checksum')!,
|
||||||
id: mapValueOfType<String>(json, r'id')!,
|
id: mapValueOfType<String>(json, r'id')!,
|
||||||
|
|||||||
@@ -45,6 +45,15 @@ class AssetBulkUploadCheckResponseDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'results'), 'Required key "AssetBulkUploadCheckResponseDto[results]" is missing from JSON.');
|
||||||
|
assert(json[r'results'] != null, 'Required key "AssetBulkUploadCheckResponseDto[results]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AssetBulkUploadCheckResponseDto(
|
return AssetBulkUploadCheckResponseDto(
|
||||||
results: AssetBulkUploadCheckResult.listFromJson(json[r'results']),
|
results: AssetBulkUploadCheckResult.listFromJson(json[r'results']),
|
||||||
);
|
);
|
||||||
|
|||||||
+29
-21
@@ -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;
|
||||||
}
|
}
|
||||||
@@ -101,12 +98,23 @@ class AssetBulkUploadCheckResult {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'action'), 'Required key "AssetBulkUploadCheckResult[action]" is missing from JSON.');
|
||||||
|
assert(json[r'action'] != null, 'Required key "AssetBulkUploadCheckResult[action]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'id'), 'Required key "AssetBulkUploadCheckResult[id]" is missing from JSON.');
|
||||||
|
assert(json[r'id'] != null, 'Required key "AssetBulkUploadCheckResult[id]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
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;
|
||||||
|
|||||||
+46
-20
@@ -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;
|
||||||
}
|
}
|
||||||
@@ -87,13 +102,24 @@ class AssetCopyDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'sourceId'), 'Required key "AssetCopyDto[sourceId]" is missing from JSON.');
|
||||||
|
assert(json[r'sourceId'] != null, 'Required key "AssetCopyDto[sourceId]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'targetId'), 'Required key "AssetCopyDto[targetId]" is missing from JSON.');
|
||||||
|
assert(json[r'targetId'] != null, 'Required key "AssetCopyDto[targetId]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
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')!,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,6 +50,17 @@ class AssetEditActionItemDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'action'), 'Required key "AssetEditActionItemDto[action]" is missing from JSON.');
|
||||||
|
assert(json[r'action'] != null, 'Required key "AssetEditActionItemDto[action]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'parameters'), 'Required key "AssetEditActionItemDto[parameters]" is missing from JSON.');
|
||||||
|
assert(json[r'parameters'] != null, 'Required key "AssetEditActionItemDto[parameters]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AssetEditActionItemDto(
|
return AssetEditActionItemDto(
|
||||||
action: AssetEditAction.fromJson(json[r'action'])!,
|
action: AssetEditAction.fromJson(json[r'action'])!,
|
||||||
parameters: json[r'parameters'],
|
parameters: json[r'parameters'],
|
||||||
|
|||||||
@@ -91,6 +91,25 @@ class AssetEditActionItemDtoParameters {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'height'), 'Required key "AssetEditActionItemDtoParameters[height]" is missing from JSON.');
|
||||||
|
assert(json[r'height'] != null, 'Required key "AssetEditActionItemDtoParameters[height]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'width'), 'Required key "AssetEditActionItemDtoParameters[width]" is missing from JSON.');
|
||||||
|
assert(json[r'width'] != null, 'Required key "AssetEditActionItemDtoParameters[width]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'x'), 'Required key "AssetEditActionItemDtoParameters[x]" is missing from JSON.');
|
||||||
|
assert(json[r'x'] != null, 'Required key "AssetEditActionItemDtoParameters[x]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'y'), 'Required key "AssetEditActionItemDtoParameters[y]" is missing from JSON.');
|
||||||
|
assert(json[r'y'] != null, 'Required key "AssetEditActionItemDtoParameters[y]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'angle'), 'Required key "AssetEditActionItemDtoParameters[angle]" is missing from JSON.');
|
||||||
|
assert(json[r'angle'] != null, 'Required key "AssetEditActionItemDtoParameters[angle]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'axis'), 'Required key "AssetEditActionItemDtoParameters[axis]" is missing from JSON.');
|
||||||
|
assert(json[r'axis'] != null, 'Required key "AssetEditActionItemDtoParameters[axis]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AssetEditActionItemDtoParameters(
|
return AssetEditActionItemDtoParameters(
|
||||||
height: mapValueOfType<int>(json, r'height')!,
|
height: mapValueOfType<int>(json, r'height')!,
|
||||||
width: mapValueOfType<int>(json, r'width')!,
|
width: mapValueOfType<int>(json, r'width')!,
|
||||||
|
|||||||
@@ -57,6 +57,19 @@ class AssetEditActionItemResponseDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'action'), 'Required key "AssetEditActionItemResponseDto[action]" is missing from JSON.');
|
||||||
|
assert(json[r'action'] != null, 'Required key "AssetEditActionItemResponseDto[action]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'id'), 'Required key "AssetEditActionItemResponseDto[id]" is missing from JSON.');
|
||||||
|
assert(json[r'id'] != null, 'Required key "AssetEditActionItemResponseDto[id]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'parameters'), 'Required key "AssetEditActionItemResponseDto[parameters]" is missing from JSON.');
|
||||||
|
assert(json[r'parameters'] != null, 'Required key "AssetEditActionItemResponseDto[parameters]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AssetEditActionItemResponseDto(
|
return AssetEditActionItemResponseDto(
|
||||||
action: AssetEditAction.fromJson(json[r'action'])!,
|
action: AssetEditAction.fromJson(json[r'action'])!,
|
||||||
id: mapValueOfType<String>(json, r'id')!,
|
id: mapValueOfType<String>(json, r'id')!,
|
||||||
|
|||||||
@@ -45,6 +45,15 @@ class AssetEditsCreateDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'edits'), 'Required key "AssetEditsCreateDto[edits]" is missing from JSON.');
|
||||||
|
assert(json[r'edits'] != null, 'Required key "AssetEditsCreateDto[edits]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AssetEditsCreateDto(
|
return AssetEditsCreateDto(
|
||||||
edits: AssetEditActionItemDto.listFromJson(json[r'edits']),
|
edits: AssetEditActionItemDto.listFromJson(json[r'edits']),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -52,6 +52,17 @@ class AssetEditsResponseDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'assetId'), 'Required key "AssetEditsResponseDto[assetId]" is missing from JSON.');
|
||||||
|
assert(json[r'assetId'] != null, 'Required key "AssetEditsResponseDto[assetId]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'edits'), 'Required key "AssetEditsResponseDto[edits]" is missing from JSON.');
|
||||||
|
assert(json[r'edits'] != null, 'Required key "AssetEditsResponseDto[edits]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AssetEditsResponseDto(
|
return AssetEditsResponseDto(
|
||||||
assetId: mapValueOfType<String>(json, r'assetId')!,
|
assetId: mapValueOfType<String>(json, r'assetId')!,
|
||||||
edits: AssetEditActionItemResponseDto.listFromJson(json[r'edits']),
|
edits: AssetEditActionItemResponseDto.listFromJson(json[r'edits']),
|
||||||
|
|||||||
+23
@@ -112,6 +112,29 @@ class AssetFaceCreateDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'assetId'), 'Required key "AssetFaceCreateDto[assetId]" is missing from JSON.');
|
||||||
|
assert(json[r'assetId'] != null, 'Required key "AssetFaceCreateDto[assetId]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'height'), 'Required key "AssetFaceCreateDto[height]" is missing from JSON.');
|
||||||
|
assert(json[r'height'] != null, 'Required key "AssetFaceCreateDto[height]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'imageHeight'), 'Required key "AssetFaceCreateDto[imageHeight]" is missing from JSON.');
|
||||||
|
assert(json[r'imageHeight'] != null, 'Required key "AssetFaceCreateDto[imageHeight]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'imageWidth'), 'Required key "AssetFaceCreateDto[imageWidth]" is missing from JSON.');
|
||||||
|
assert(json[r'imageWidth'] != null, 'Required key "AssetFaceCreateDto[imageWidth]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'personId'), 'Required key "AssetFaceCreateDto[personId]" is missing from JSON.');
|
||||||
|
assert(json[r'personId'] != null, 'Required key "AssetFaceCreateDto[personId]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'width'), 'Required key "AssetFaceCreateDto[width]" is missing from JSON.');
|
||||||
|
assert(json[r'width'] != null, 'Required key "AssetFaceCreateDto[width]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'x'), 'Required key "AssetFaceCreateDto[x]" is missing from JSON.');
|
||||||
|
assert(json[r'x'] != null, 'Required key "AssetFaceCreateDto[x]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'y'), 'Required key "AssetFaceCreateDto[y]" is missing from JSON.');
|
||||||
|
assert(json[r'y'] != null, 'Required key "AssetFaceCreateDto[y]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AssetFaceCreateDto(
|
return AssetFaceCreateDto(
|
||||||
assetId: mapValueOfType<String>(json, r'assetId')!,
|
assetId: mapValueOfType<String>(json, r'assetId')!,
|
||||||
height: mapValueOfType<int>(json, r'height')!,
|
height: mapValueOfType<int>(json, r'height')!,
|
||||||
|
|||||||
@@ -45,6 +45,15 @@ class AssetFaceDeleteDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'force'), 'Required key "AssetFaceDeleteDto[force]" is missing from JSON.');
|
||||||
|
assert(json[r'force'] != null, 'Required key "AssetFaceDeleteDto[force]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AssetFaceDeleteDto(
|
return AssetFaceDeleteDto(
|
||||||
force: mapValueOfType<bool>(json, r'force')!,
|
force: mapValueOfType<bool>(json, r'force')!,
|
||||||
);
|
);
|
||||||
|
|||||||
+29
-8
@@ -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;
|
||||||
}
|
}
|
||||||
@@ -131,6 +130,28 @@ class AssetFaceResponseDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'boundingBoxX1'), 'Required key "AssetFaceResponseDto[boundingBoxX1]" is missing from JSON.');
|
||||||
|
assert(json[r'boundingBoxX1'] != null, 'Required key "AssetFaceResponseDto[boundingBoxX1]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'boundingBoxX2'), 'Required key "AssetFaceResponseDto[boundingBoxX2]" is missing from JSON.');
|
||||||
|
assert(json[r'boundingBoxX2'] != null, 'Required key "AssetFaceResponseDto[boundingBoxX2]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'boundingBoxY1'), 'Required key "AssetFaceResponseDto[boundingBoxY1]" is missing from JSON.');
|
||||||
|
assert(json[r'boundingBoxY1'] != null, 'Required key "AssetFaceResponseDto[boundingBoxY1]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'boundingBoxY2'), 'Required key "AssetFaceResponseDto[boundingBoxY2]" is missing from JSON.');
|
||||||
|
assert(json[r'boundingBoxY2'] != null, 'Required key "AssetFaceResponseDto[boundingBoxY2]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'id'), 'Required key "AssetFaceResponseDto[id]" is missing from JSON.');
|
||||||
|
assert(json[r'id'] != null, 'Required key "AssetFaceResponseDto[id]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'imageHeight'), 'Required key "AssetFaceResponseDto[imageHeight]" is missing from JSON.');
|
||||||
|
assert(json[r'imageHeight'] != null, 'Required key "AssetFaceResponseDto[imageHeight]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'imageWidth'), 'Required key "AssetFaceResponseDto[imageWidth]" is missing from JSON.');
|
||||||
|
assert(json[r'imageWidth'] != null, 'Required key "AssetFaceResponseDto[imageWidth]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'person'), 'Required key "AssetFaceResponseDto[person]" is missing from JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AssetFaceResponseDto(
|
return AssetFaceResponseDto(
|
||||||
boundingBoxX1: mapValueOfType<int>(json, r'boundingBoxX1')!,
|
boundingBoxX1: mapValueOfType<int>(json, r'boundingBoxX1')!,
|
||||||
boundingBoxX2: mapValueOfType<int>(json, r'boundingBoxX2')!,
|
boundingBoxX2: mapValueOfType<int>(json, r'boundingBoxX2')!,
|
||||||
@@ -140,7 +161,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;
|
||||||
|
|||||||
@@ -45,6 +45,15 @@ class AssetFaceUpdateDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'data'), 'Required key "AssetFaceUpdateDto[data]" is missing from JSON.');
|
||||||
|
assert(json[r'data'] != null, 'Required key "AssetFaceUpdateDto[data]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AssetFaceUpdateDto(
|
return AssetFaceUpdateDto(
|
||||||
data: AssetFaceUpdateItem.listFromJson(json[r'data']),
|
data: AssetFaceUpdateItem.listFromJson(json[r'data']),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -52,6 +52,17 @@ class AssetFaceUpdateItem {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'assetId'), 'Required key "AssetFaceUpdateItem[assetId]" is missing from JSON.');
|
||||||
|
assert(json[r'assetId'] != null, 'Required key "AssetFaceUpdateItem[assetId]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'personId'), 'Required key "AssetFaceUpdateItem[personId]" is missing from JSON.');
|
||||||
|
assert(json[r'personId'] != null, 'Required key "AssetFaceUpdateItem[personId]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AssetFaceUpdateItem(
|
return AssetFaceUpdateItem(
|
||||||
assetId: mapValueOfType<String>(json, r'assetId')!,
|
assetId: mapValueOfType<String>(json, r'assetId')!,
|
||||||
personId: mapValueOfType<String>(json, r'personId')!,
|
personId: mapValueOfType<String>(json, r'personId')!,
|
||||||
|
|||||||
+9
@@ -45,6 +45,15 @@ class AssetIdsDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'assetIds'), 'Required key "AssetIdsDto[assetIds]" is missing from JSON.');
|
||||||
|
assert(json[r'assetIds'] != null, 'Required key "AssetIdsDto[assetIds]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AssetIdsDto(
|
return AssetIdsDto(
|
||||||
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)
|
||||||
|
|||||||
+17
-7
@@ -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;
|
||||||
@@ -68,9 +67,20 @@ class AssetIdsResponseDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'assetId'), 'Required key "AssetIdsResponseDto[assetId]" is missing from JSON.');
|
||||||
|
assert(json[r'assetId'] != null, 'Required key "AssetIdsResponseDto[assetId]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'success'), 'Required key "AssetIdsResponseDto[success]" is missing from JSON.');
|
||||||
|
assert(json[r'success'] != null, 'Required key "AssetIdsResponseDto[success]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
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')!,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+11
@@ -51,6 +51,17 @@ class AssetJobsDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'assetIds'), 'Required key "AssetJobsDto[assetIds]" is missing from JSON.');
|
||||||
|
assert(json[r'assetIds'] != null, 'Required key "AssetJobsDto[assetIds]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'name'), 'Required key "AssetJobsDto[name]" is missing from JSON.');
|
||||||
|
assert(json[r'name'] != null, 'Required key "AssetJobsDto[name]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AssetJobsDto(
|
return AssetJobsDto(
|
||||||
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)
|
||||||
|
|||||||
@@ -51,6 +51,17 @@ class AssetMediaResponseDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'id'), 'Required key "AssetMediaResponseDto[id]" is missing from JSON.');
|
||||||
|
assert(json[r'id'] != null, 'Required key "AssetMediaResponseDto[id]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'status'), 'Required key "AssetMediaResponseDto[status]" is missing from JSON.');
|
||||||
|
assert(json[r'status'] != null, 'Required key "AssetMediaResponseDto[status]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AssetMediaResponseDto(
|
return AssetMediaResponseDto(
|
||||||
id: mapValueOfType<String>(json, r'id')!,
|
id: mapValueOfType<String>(json, r'id')!,
|
||||||
status: AssetMediaStatus.fromJson(json[r'status'])!,
|
status: AssetMediaStatus.fromJson(json[r'status'])!,
|
||||||
|
|||||||
@@ -45,6 +45,15 @@ class AssetMetadataBulkDeleteDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'items'), 'Required key "AssetMetadataBulkDeleteDto[items]" is missing from JSON.');
|
||||||
|
assert(json[r'items'] != null, 'Required key "AssetMetadataBulkDeleteDto[items]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AssetMetadataBulkDeleteDto(
|
return AssetMetadataBulkDeleteDto(
|
||||||
items: AssetMetadataBulkDeleteItemDto.listFromJson(json[r'items']),
|
items: AssetMetadataBulkDeleteItemDto.listFromJson(json[r'items']),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -52,6 +52,17 @@ class AssetMetadataBulkDeleteItemDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'assetId'), 'Required key "AssetMetadataBulkDeleteItemDto[assetId]" is missing from JSON.');
|
||||||
|
assert(json[r'assetId'] != null, 'Required key "AssetMetadataBulkDeleteItemDto[assetId]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'key'), 'Required key "AssetMetadataBulkDeleteItemDto[key]" is missing from JSON.');
|
||||||
|
assert(json[r'key'] != null, 'Required key "AssetMetadataBulkDeleteItemDto[key]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AssetMetadataBulkDeleteItemDto(
|
return AssetMetadataBulkDeleteItemDto(
|
||||||
assetId: mapValueOfType<String>(json, r'assetId')!,
|
assetId: mapValueOfType<String>(json, r'assetId')!,
|
||||||
key: mapValueOfType<String>(json, r'key')!,
|
key: mapValueOfType<String>(json, r'key')!,
|
||||||
|
|||||||
@@ -68,6 +68,21 @@ class AssetMetadataBulkResponseDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'assetId'), 'Required key "AssetMetadataBulkResponseDto[assetId]" is missing from JSON.');
|
||||||
|
assert(json[r'assetId'] != null, 'Required key "AssetMetadataBulkResponseDto[assetId]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'key'), 'Required key "AssetMetadataBulkResponseDto[key]" is missing from JSON.');
|
||||||
|
assert(json[r'key'] != null, 'Required key "AssetMetadataBulkResponseDto[key]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'updatedAt'), 'Required key "AssetMetadataBulkResponseDto[updatedAt]" is missing from JSON.');
|
||||||
|
assert(json[r'updatedAt'] != null, 'Required key "AssetMetadataBulkResponseDto[updatedAt]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'value'), 'Required key "AssetMetadataBulkResponseDto[value]" is missing from JSON.');
|
||||||
|
assert(json[r'value'] != null, 'Required key "AssetMetadataBulkResponseDto[value]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AssetMetadataBulkResponseDto(
|
return AssetMetadataBulkResponseDto(
|
||||||
assetId: mapValueOfType<String>(json, r'assetId')!,
|
assetId: mapValueOfType<String>(json, r'assetId')!,
|
||||||
key: mapValueOfType<String>(json, r'key')!,
|
key: mapValueOfType<String>(json, r'key')!,
|
||||||
|
|||||||
@@ -45,6 +45,15 @@ class AssetMetadataBulkUpsertDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'items'), 'Required key "AssetMetadataBulkUpsertDto[items]" is missing from JSON.');
|
||||||
|
assert(json[r'items'] != null, 'Required key "AssetMetadataBulkUpsertDto[items]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AssetMetadataBulkUpsertDto(
|
return AssetMetadataBulkUpsertDto(
|
||||||
items: AssetMetadataBulkUpsertItemDto.listFromJson(json[r'items']),
|
items: AssetMetadataBulkUpsertItemDto.listFromJson(json[r'items']),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -59,6 +59,19 @@ class AssetMetadataBulkUpsertItemDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'assetId'), 'Required key "AssetMetadataBulkUpsertItemDto[assetId]" is missing from JSON.');
|
||||||
|
assert(json[r'assetId'] != null, 'Required key "AssetMetadataBulkUpsertItemDto[assetId]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'key'), 'Required key "AssetMetadataBulkUpsertItemDto[key]" is missing from JSON.');
|
||||||
|
assert(json[r'key'] != null, 'Required key "AssetMetadataBulkUpsertItemDto[key]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'value'), 'Required key "AssetMetadataBulkUpsertItemDto[value]" is missing from JSON.');
|
||||||
|
assert(json[r'value'] != null, 'Required key "AssetMetadataBulkUpsertItemDto[value]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AssetMetadataBulkUpsertItemDto(
|
return AssetMetadataBulkUpsertItemDto(
|
||||||
assetId: mapValueOfType<String>(json, r'assetId')!,
|
assetId: mapValueOfType<String>(json, r'assetId')!,
|
||||||
key: mapValueOfType<String>(json, r'key')!,
|
key: mapValueOfType<String>(json, r'key')!,
|
||||||
|
|||||||
@@ -61,6 +61,19 @@ class AssetMetadataResponseDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'key'), 'Required key "AssetMetadataResponseDto[key]" is missing from JSON.');
|
||||||
|
assert(json[r'key'] != null, 'Required key "AssetMetadataResponseDto[key]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'updatedAt'), 'Required key "AssetMetadataResponseDto[updatedAt]" is missing from JSON.');
|
||||||
|
assert(json[r'updatedAt'] != null, 'Required key "AssetMetadataResponseDto[updatedAt]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'value'), 'Required key "AssetMetadataResponseDto[value]" is missing from JSON.');
|
||||||
|
assert(json[r'value'] != null, 'Required key "AssetMetadataResponseDto[value]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AssetMetadataResponseDto(
|
return AssetMetadataResponseDto(
|
||||||
key: mapValueOfType<String>(json, r'key')!,
|
key: mapValueOfType<String>(json, r'key')!,
|
||||||
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))$/')!,
|
||||||
|
|||||||
@@ -45,6 +45,15 @@ class AssetMetadataUpsertDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'items'), 'Required key "AssetMetadataUpsertDto[items]" is missing from JSON.');
|
||||||
|
assert(json[r'items'] != null, 'Required key "AssetMetadataUpsertDto[items]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AssetMetadataUpsertDto(
|
return AssetMetadataUpsertDto(
|
||||||
items: AssetMetadataUpsertItemDto.listFromJson(json[r'items']),
|
items: AssetMetadataUpsertItemDto.listFromJson(json[r'items']),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -52,6 +52,17 @@ class AssetMetadataUpsertItemDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'key'), 'Required key "AssetMetadataUpsertItemDto[key]" is missing from JSON.');
|
||||||
|
assert(json[r'key'] != null, 'Required key "AssetMetadataUpsertItemDto[key]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'value'), 'Required key "AssetMetadataUpsertItemDto[value]" is missing from JSON.');
|
||||||
|
assert(json[r'value'] != null, 'Required key "AssetMetadataUpsertItemDto[value]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AssetMetadataUpsertItemDto(
|
return AssetMetadataUpsertItemDto(
|
||||||
key: mapValueOfType<String>(json, r'key')!,
|
key: mapValueOfType<String>(json, r'key')!,
|
||||||
value: mapCastOfType<String, Object>(json, r'value')!,
|
value: mapCastOfType<String, Object>(json, r'value')!,
|
||||||
|
|||||||
+43
-10
@@ -127,20 +127,53 @@ class AssetOcrResponseDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'assetId'), 'Required key "AssetOcrResponseDto[assetId]" is missing from JSON.');
|
||||||
|
assert(json[r'assetId'] != null, 'Required key "AssetOcrResponseDto[assetId]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'boxScore'), 'Required key "AssetOcrResponseDto[boxScore]" is missing from JSON.');
|
||||||
|
assert(json[r'boxScore'] != null, 'Required key "AssetOcrResponseDto[boxScore]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'id'), 'Required key "AssetOcrResponseDto[id]" is missing from JSON.');
|
||||||
|
assert(json[r'id'] != null, 'Required key "AssetOcrResponseDto[id]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'text'), 'Required key "AssetOcrResponseDto[text]" is missing from JSON.');
|
||||||
|
assert(json[r'text'] != null, 'Required key "AssetOcrResponseDto[text]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'textScore'), 'Required key "AssetOcrResponseDto[textScore]" is missing from JSON.');
|
||||||
|
assert(json[r'textScore'] != null, 'Required key "AssetOcrResponseDto[textScore]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'x1'), 'Required key "AssetOcrResponseDto[x1]" is missing from JSON.');
|
||||||
|
assert(json[r'x1'] != null, 'Required key "AssetOcrResponseDto[x1]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'x2'), 'Required key "AssetOcrResponseDto[x2]" is missing from JSON.');
|
||||||
|
assert(json[r'x2'] != null, 'Required key "AssetOcrResponseDto[x2]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'x3'), 'Required key "AssetOcrResponseDto[x3]" is missing from JSON.');
|
||||||
|
assert(json[r'x3'] != null, 'Required key "AssetOcrResponseDto[x3]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'x4'), 'Required key "AssetOcrResponseDto[x4]" is missing from JSON.');
|
||||||
|
assert(json[r'x4'] != null, 'Required key "AssetOcrResponseDto[x4]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'y1'), 'Required key "AssetOcrResponseDto[y1]" is missing from JSON.');
|
||||||
|
assert(json[r'y1'] != null, 'Required key "AssetOcrResponseDto[y1]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'y2'), 'Required key "AssetOcrResponseDto[y2]" is missing from JSON.');
|
||||||
|
assert(json[r'y2'] != null, 'Required key "AssetOcrResponseDto[y2]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'y3'), 'Required key "AssetOcrResponseDto[y3]" is missing from JSON.');
|
||||||
|
assert(json[r'y3'] != null, 'Required key "AssetOcrResponseDto[y3]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'y4'), 'Required key "AssetOcrResponseDto[y4]" is missing from JSON.');
|
||||||
|
assert(json[r'y4'] != null, 'Required key "AssetOcrResponseDto[y4]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
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;
|
||||||
|
|||||||
+113
-68
@@ -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;
|
||||||
}
|
}
|
||||||
@@ -336,12 +334,59 @@ class AssetResponseDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'checksum'), 'Required key "AssetResponseDto[checksum]" is missing from JSON.');
|
||||||
|
assert(json[r'checksum'] != null, 'Required key "AssetResponseDto[checksum]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'createdAt'), 'Required key "AssetResponseDto[createdAt]" is missing from JSON.');
|
||||||
|
assert(json[r'createdAt'] != null, 'Required key "AssetResponseDto[createdAt]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'duration'), 'Required key "AssetResponseDto[duration]" is missing from JSON.');
|
||||||
|
assert(json.containsKey(r'fileCreatedAt'), 'Required key "AssetResponseDto[fileCreatedAt]" is missing from JSON.');
|
||||||
|
assert(json[r'fileCreatedAt'] != null, 'Required key "AssetResponseDto[fileCreatedAt]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'fileModifiedAt'), 'Required key "AssetResponseDto[fileModifiedAt]" is missing from JSON.');
|
||||||
|
assert(json[r'fileModifiedAt'] != null, 'Required key "AssetResponseDto[fileModifiedAt]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'hasMetadata'), 'Required key "AssetResponseDto[hasMetadata]" is missing from JSON.');
|
||||||
|
assert(json[r'hasMetadata'] != null, 'Required key "AssetResponseDto[hasMetadata]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'height'), 'Required key "AssetResponseDto[height]" is missing from JSON.');
|
||||||
|
assert(json.containsKey(r'id'), 'Required key "AssetResponseDto[id]" is missing from JSON.');
|
||||||
|
assert(json[r'id'] != null, 'Required key "AssetResponseDto[id]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'isArchived'), 'Required key "AssetResponseDto[isArchived]" is missing from JSON.');
|
||||||
|
assert(json[r'isArchived'] != null, 'Required key "AssetResponseDto[isArchived]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'isEdited'), 'Required key "AssetResponseDto[isEdited]" is missing from JSON.');
|
||||||
|
assert(json[r'isEdited'] != null, 'Required key "AssetResponseDto[isEdited]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'isFavorite'), 'Required key "AssetResponseDto[isFavorite]" is missing from JSON.');
|
||||||
|
assert(json[r'isFavorite'] != null, 'Required key "AssetResponseDto[isFavorite]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'isOffline'), 'Required key "AssetResponseDto[isOffline]" is missing from JSON.');
|
||||||
|
assert(json[r'isOffline'] != null, 'Required key "AssetResponseDto[isOffline]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'isTrashed'), 'Required key "AssetResponseDto[isTrashed]" is missing from JSON.');
|
||||||
|
assert(json[r'isTrashed'] != null, 'Required key "AssetResponseDto[isTrashed]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'localDateTime'), 'Required key "AssetResponseDto[localDateTime]" is missing from JSON.');
|
||||||
|
assert(json[r'localDateTime'] != null, 'Required key "AssetResponseDto[localDateTime]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'originalFileName'), 'Required key "AssetResponseDto[originalFileName]" is missing from JSON.');
|
||||||
|
assert(json[r'originalFileName'] != null, 'Required key "AssetResponseDto[originalFileName]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'originalPath'), 'Required key "AssetResponseDto[originalPath]" is missing from JSON.');
|
||||||
|
assert(json[r'originalPath'] != null, 'Required key "AssetResponseDto[originalPath]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'ownerId'), 'Required key "AssetResponseDto[ownerId]" is missing from JSON.');
|
||||||
|
assert(json[r'ownerId'] != null, 'Required key "AssetResponseDto[ownerId]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'thumbhash'), 'Required key "AssetResponseDto[thumbhash]" is missing from JSON.');
|
||||||
|
assert(json.containsKey(r'type'), 'Required key "AssetResponseDto[type]" is missing from JSON.');
|
||||||
|
assert(json[r'type'] != null, 'Required key "AssetResponseDto[type]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'updatedAt'), 'Required key "AssetResponseDto[updatedAt]" is missing from JSON.');
|
||||||
|
assert(json[r'updatedAt'] != null, 'Required key "AssetResponseDto[updatedAt]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'visibility'), 'Required key "AssetResponseDto[visibility]" is missing from JSON.');
|
||||||
|
assert(json[r'visibility'] != null, 'Required key "AssetResponseDto[visibility]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'width'), 'Required key "AssetResponseDto[width]" is missing from JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
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 +397,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'')!,
|
||||||
|
|||||||
@@ -62,6 +62,19 @@ class AssetStackResponseDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'assetCount'), 'Required key "AssetStackResponseDto[assetCount]" is missing from JSON.');
|
||||||
|
assert(json[r'assetCount'] != null, 'Required key "AssetStackResponseDto[assetCount]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'id'), 'Required key "AssetStackResponseDto[id]" is missing from JSON.');
|
||||||
|
assert(json[r'id'] != null, 'Required key "AssetStackResponseDto[id]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'primaryAssetId'), 'Required key "AssetStackResponseDto[primaryAssetId]" is missing from JSON.');
|
||||||
|
assert(json[r'primaryAssetId'] != null, 'Required key "AssetStackResponseDto[primaryAssetId]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AssetStackResponseDto(
|
return AssetStackResponseDto(
|
||||||
assetCount: mapValueOfType<int>(json, r'assetCount')!,
|
assetCount: mapValueOfType<int>(json, r'assetCount')!,
|
||||||
id: mapValueOfType<String>(json, r'id')!,
|
id: mapValueOfType<String>(json, r'id')!,
|
||||||
|
|||||||
@@ -68,6 +68,19 @@ class AssetStatsResponseDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'images'), 'Required key "AssetStatsResponseDto[images]" is missing from JSON.');
|
||||||
|
assert(json[r'images'] != null, 'Required key "AssetStatsResponseDto[images]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'total'), 'Required key "AssetStatsResponseDto[total]" is missing from JSON.');
|
||||||
|
assert(json[r'total'] != null, 'Required key "AssetStatsResponseDto[total]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'videos'), 'Required key "AssetStatsResponseDto[videos]" is missing from JSON.');
|
||||||
|
assert(json[r'videos'] != null, 'Required key "AssetStatsResponseDto[videos]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return AssetStatsResponseDto(
|
return AssetStatsResponseDto(
|
||||||
images: mapValueOfType<int>(json, r'images')!,
|
images: mapValueOfType<int>(json, r'images')!,
|
||||||
total: mapValueOfType<int>(json, r'total')!,
|
total: mapValueOfType<int>(json, r'total')!,
|
||||||
|
|||||||
+25
-14
@@ -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;
|
||||||
}
|
}
|
||||||
@@ -93,12 +91,25 @@ class AuthStatusResponseDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'isElevated'), 'Required key "AuthStatusResponseDto[isElevated]" is missing from JSON.');
|
||||||
|
assert(json[r'isElevated'] != null, 'Required key "AuthStatusResponseDto[isElevated]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'password'), 'Required key "AuthStatusResponseDto[password]" is missing from JSON.');
|
||||||
|
assert(json[r'password'] != null, 'Required key "AuthStatusResponseDto[password]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'pinCode'), 'Required key "AuthStatusResponseDto[pinCode]" is missing from JSON.');
|
||||||
|
assert(json[r'pinCode'] != null, 'Required key "AuthStatusResponseDto[pinCode]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
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;
|
||||||
|
|||||||
+13
-7
@@ -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;
|
||||||
}
|
}
|
||||||
@@ -54,8 +53,15 @@ class AvatarUpdate {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
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;
|
||||||
|
|||||||
+23
-14
@@ -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;
|
||||||
@@ -84,9 +82,20 @@ class BulkIdResponseDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'id'), 'Required key "BulkIdResponseDto[id]" is missing from JSON.');
|
||||||
|
assert(json[r'id'] != null, 'Required key "BulkIdResponseDto[id]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'success'), 'Required key "BulkIdResponseDto[success]" is missing from JSON.');
|
||||||
|
assert(json[r'success'] != null, 'Required key "BulkIdResponseDto[success]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
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')!,
|
||||||
);
|
);
|
||||||
|
|||||||
+9
@@ -45,6 +45,15 @@ class BulkIdsDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'ids'), 'Required key "BulkIdsDto[ids]" is missing from JSON.');
|
||||||
|
assert(json[r'ids'] != null, 'Required key "BulkIdsDto[ids]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return BulkIdsDto(
|
return BulkIdsDto(
|
||||||
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)
|
||||||
|
|||||||
+9
@@ -45,6 +45,15 @@ class CastResponse {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'gCastEnabled'), 'Required key "CastResponse[gCastEnabled]" is missing from JSON.');
|
||||||
|
assert(json[r'gCastEnabled'] != null, 'Required key "CastResponse[gCastEnabled]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return CastResponse(
|
return CastResponse(
|
||||||
gCastEnabled: mapValueOfType<bool>(json, r'gCastEnabled')!,
|
gCastEnabled: mapValueOfType<bool>(json, r'gCastEnabled')!,
|
||||||
);
|
);
|
||||||
|
|||||||
+13
-7
@@ -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;
|
||||||
}
|
}
|
||||||
@@ -55,8 +54,15 @@ class CastUpdate {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
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;
|
||||||
|
|||||||
+18
-4
@@ -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;
|
||||||
@@ -59,8 +62,19 @@ class ChangePasswordDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'newPassword'), 'Required key "ChangePasswordDto[newPassword]" is missing from JSON.');
|
||||||
|
assert(json[r'newPassword'] != null, 'Required key "ChangePasswordDto[newPassword]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'password'), 'Required key "ChangePasswordDto[password]" is missing from JSON.');
|
||||||
|
assert(json[r'password'] != null, 'Required key "ChangePasswordDto[password]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
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')!,
|
||||||
);
|
);
|
||||||
|
|||||||
+11
@@ -52,6 +52,17 @@ class CLIPConfig {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'enabled'), 'Required key "CLIPConfig[enabled]" is missing from JSON.');
|
||||||
|
assert(json[r'enabled'] != null, 'Required key "CLIPConfig[enabled]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'modelName'), 'Required key "CLIPConfig[modelName]" is missing from JSON.');
|
||||||
|
assert(json[r'modelName'] != null, 'Required key "CLIPConfig[modelName]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return CLIPConfig(
|
return CLIPConfig(
|
||||||
enabled: mapValueOfType<bool>(json, r'enabled')!,
|
enabled: mapValueOfType<bool>(json, r'enabled')!,
|
||||||
modelName: mapValueOfType<String>(json, r'modelName')!,
|
modelName: mapValueOfType<String>(json, r'modelName')!,
|
||||||
|
|||||||
@@ -55,6 +55,17 @@ class ContributorCountResponseDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'assetCount'), 'Required key "ContributorCountResponseDto[assetCount]" is missing from JSON.');
|
||||||
|
assert(json[r'assetCount'] != null, 'Required key "ContributorCountResponseDto[assetCount]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'userId'), 'Required key "ContributorCountResponseDto[userId]" is missing from JSON.');
|
||||||
|
assert(json[r'userId'] != null, 'Required key "ContributorCountResponseDto[userId]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return ContributorCountResponseDto(
|
return ContributorCountResponseDto(
|
||||||
assetCount: mapValueOfType<int>(json, r'assetCount')!,
|
assetCount: mapValueOfType<int>(json, r'assetCount')!,
|
||||||
userId: mapValueOfType<String>(json, r'userId')!,
|
userId: mapValueOfType<String>(json, r'userId')!,
|
||||||
|
|||||||
+30
-16
@@ -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;
|
||||||
}
|
}
|
||||||
@@ -76,13 +81,22 @@ class CreateAlbumDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'albumName'), 'Required key "CreateAlbumDto[albumName]" is missing from JSON.');
|
||||||
|
assert(json[r'albumName'] != null, 'Required key "CreateAlbumDto[albumName]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
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;
|
||||||
|
|||||||
+31
-17
@@ -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;
|
||||||
@@ -76,14 +81,23 @@ class CreateLibraryDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'ownerId'), 'Required key "CreateLibraryDto[ownerId]" is missing from JSON.');
|
||||||
|
assert(json[r'ownerId'] != null, 'Required key "CreateLibraryDto[ownerId]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
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')!,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,6 +61,19 @@ class CreateProfileImageResponseDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'profileChangedAt'), 'Required key "CreateProfileImageResponseDto[profileChangedAt]" is missing from JSON.');
|
||||||
|
assert(json[r'profileChangedAt'] != null, 'Required key "CreateProfileImageResponseDto[profileChangedAt]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'profileImagePath'), 'Required key "CreateProfileImageResponseDto[profileImagePath]" is missing from JSON.');
|
||||||
|
assert(json[r'profileImagePath'] != null, 'Required key "CreateProfileImageResponseDto[profileImagePath]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'userId'), 'Required key "CreateProfileImageResponseDto[userId]" is missing from JSON.');
|
||||||
|
assert(json[r'userId'] != null, 'Required key "CreateProfileImageResponseDto[userId]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return CreateProfileImageResponseDto(
|
return CreateProfileImageResponseDto(
|
||||||
profileChangedAt: mapDateTime(json, r'profileChangedAt', 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))$/')!,
|
profileChangedAt: mapDateTime(json, r'profileChangedAt', 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))$/')!,
|
||||||
profileImagePath: mapValueOfType<String>(json, r'profileImagePath')!,
|
profileImagePath: mapValueOfType<String>(json, r'profileImagePath')!,
|
||||||
|
|||||||
+15
@@ -78,6 +78,21 @@ class CropParameters {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'height'), 'Required key "CropParameters[height]" is missing from JSON.');
|
||||||
|
assert(json[r'height'] != null, 'Required key "CropParameters[height]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'width'), 'Required key "CropParameters[width]" is missing from JSON.');
|
||||||
|
assert(json[r'width'] != null, 'Required key "CropParameters[width]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'x'), 'Required key "CropParameters[x]" is missing from JSON.');
|
||||||
|
assert(json[r'x'] != null, 'Required key "CropParameters[x]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'y'), 'Required key "CropParameters[y]" is missing from JSON.');
|
||||||
|
assert(json[r'y'] != null, 'Required key "CropParameters[y]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return CropParameters(
|
return CropParameters(
|
||||||
height: mapValueOfType<int>(json, r'height')!,
|
height: mapValueOfType<int>(json, r'height')!,
|
||||||
width: mapValueOfType<int>(json, r'width')!,
|
width: mapValueOfType<int>(json, r'width')!,
|
||||||
|
|||||||
@@ -62,6 +62,19 @@ class DatabaseBackupConfig {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'cronExpression'), 'Required key "DatabaseBackupConfig[cronExpression]" is missing from JSON.');
|
||||||
|
assert(json[r'cronExpression'] != null, 'Required key "DatabaseBackupConfig[cronExpression]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'enabled'), 'Required key "DatabaseBackupConfig[enabled]" is missing from JSON.');
|
||||||
|
assert(json[r'enabled'] != null, 'Required key "DatabaseBackupConfig[enabled]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'keepLastAmount'), 'Required key "DatabaseBackupConfig[keepLastAmount]" is missing from JSON.');
|
||||||
|
assert(json[r'keepLastAmount'] != null, 'Required key "DatabaseBackupConfig[keepLastAmount]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return DatabaseBackupConfig(
|
return DatabaseBackupConfig(
|
||||||
cronExpression: mapValueOfType<String>(json, r'cronExpression')!,
|
cronExpression: mapValueOfType<String>(json, r'cronExpression')!,
|
||||||
enabled: mapValueOfType<bool>(json, r'enabled')!,
|
enabled: mapValueOfType<bool>(json, r'enabled')!,
|
||||||
|
|||||||
@@ -45,6 +45,15 @@ class DatabaseBackupDeleteDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'backups'), 'Required key "DatabaseBackupDeleteDto[backups]" is missing from JSON.');
|
||||||
|
assert(json[r'backups'] != null, 'Required key "DatabaseBackupDeleteDto[backups]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return DatabaseBackupDeleteDto(
|
return DatabaseBackupDeleteDto(
|
||||||
backups: json[r'backups'] is Iterable
|
backups: json[r'backups'] is Iterable
|
||||||
? (json[r'backups'] as Iterable).cast<String>().toList(growable: false)
|
? (json[r'backups'] as Iterable).cast<String>().toList(growable: false)
|
||||||
|
|||||||
+13
@@ -62,6 +62,19 @@ class DatabaseBackupDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'filename'), 'Required key "DatabaseBackupDto[filename]" is missing from JSON.');
|
||||||
|
assert(json[r'filename'] != null, 'Required key "DatabaseBackupDto[filename]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'filesize'), 'Required key "DatabaseBackupDto[filesize]" is missing from JSON.');
|
||||||
|
assert(json[r'filesize'] != null, 'Required key "DatabaseBackupDto[filesize]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'timezone'), 'Required key "DatabaseBackupDto[timezone]" is missing from JSON.');
|
||||||
|
assert(json[r'timezone'] != null, 'Required key "DatabaseBackupDto[timezone]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return DatabaseBackupDto(
|
return DatabaseBackupDto(
|
||||||
filename: mapValueOfType<String>(json, r'filename')!,
|
filename: mapValueOfType<String>(json, r'filename')!,
|
||||||
filesize: mapValueOfType<int>(json, r'filesize')!,
|
filesize: mapValueOfType<int>(json, r'filesize')!,
|
||||||
|
|||||||
@@ -45,6 +45,15 @@ class DatabaseBackupListResponseDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'backups'), 'Required key "DatabaseBackupListResponseDto[backups]" is missing from JSON.');
|
||||||
|
assert(json[r'backups'] != null, 'Required key "DatabaseBackupListResponseDto[backups]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return DatabaseBackupListResponseDto(
|
return DatabaseBackupListResponseDto(
|
||||||
backups: DatabaseBackupDto.listFromJson(json[r'backups']),
|
backups: DatabaseBackupDto.listFromJson(json[r'backups']),
|
||||||
);
|
);
|
||||||
|
|||||||
+15
-7
@@ -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;
|
||||||
}
|
}
|
||||||
@@ -62,11 +61,20 @@ class DownloadArchiveDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'assetIds'), 'Required key "DownloadArchiveDto[assetIds]" is missing from JSON.');
|
||||||
|
assert(json[r'assetIds'] != null, 'Required key "DownloadArchiveDto[assetIds]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return DownloadArchiveDto(
|
return 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;
|
||||||
|
|||||||
+11
@@ -55,6 +55,17 @@ class DownloadArchiveInfo {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'assetIds'), 'Required key "DownloadArchiveInfo[assetIds]" is missing from JSON.');
|
||||||
|
assert(json[r'assetIds'] != null, 'Required key "DownloadArchiveInfo[assetIds]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'size'), 'Required key "DownloadArchiveInfo[size]" is missing from JSON.');
|
||||||
|
assert(json[r'size'] != null, 'Required key "DownloadArchiveInfo[size]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return DownloadArchiveInfo(
|
return DownloadArchiveInfo(
|
||||||
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)
|
||||||
|
|||||||
+33
-26
@@ -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;
|
||||||
}
|
}
|
||||||
@@ -99,13 +99,20 @@ class DownloadInfoDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
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;
|
||||||
|
|||||||
+11
@@ -55,6 +55,17 @@ class DownloadResponse {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'archiveSize'), 'Required key "DownloadResponse[archiveSize]" is missing from JSON.');
|
||||||
|
assert(json[r'archiveSize'] != null, 'Required key "DownloadResponse[archiveSize]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'includeEmbeddedVideos'), 'Required key "DownloadResponse[includeEmbeddedVideos]" is missing from JSON.');
|
||||||
|
assert(json[r'includeEmbeddedVideos'] != null, 'Required key "DownloadResponse[includeEmbeddedVideos]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return DownloadResponse(
|
return DownloadResponse(
|
||||||
archiveSize: mapValueOfType<int>(json, r'archiveSize')!,
|
archiveSize: mapValueOfType<int>(json, r'archiveSize')!,
|
||||||
includeEmbeddedVideos: mapValueOfType<bool>(json, r'includeEmbeddedVideos')!,
|
includeEmbeddedVideos: mapValueOfType<bool>(json, r'includeEmbeddedVideos')!,
|
||||||
|
|||||||
+11
@@ -55,6 +55,17 @@ class DownloadResponseDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'archives'), 'Required key "DownloadResponseDto[archives]" is missing from JSON.');
|
||||||
|
assert(json[r'archives'] != null, 'Required key "DownloadResponseDto[archives]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'totalSize'), 'Required key "DownloadResponseDto[totalSize]" is missing from JSON.');
|
||||||
|
assert(json[r'totalSize'] != null, 'Required key "DownloadResponseDto[totalSize]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return DownloadResponseDto(
|
return DownloadResponseDto(
|
||||||
archives: DownloadArchiveInfo.listFromJson(json[r'archives']),
|
archives: DownloadArchiveInfo.listFromJson(json[r'archives']),
|
||||||
totalSize: mapValueOfType<int>(json, r'totalSize')!,
|
totalSize: mapValueOfType<int>(json, r'totalSize')!,
|
||||||
|
|||||||
+19
-14
@@ -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;
|
||||||
}
|
}
|
||||||
@@ -75,9 +73,16 @@ class DownloadUpdate {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
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;
|
||||||
|
|||||||
+12
-1
@@ -55,9 +55,20 @@ class DuplicateDetectionConfig {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'enabled'), 'Required key "DuplicateDetectionConfig[enabled]" is missing from JSON.');
|
||||||
|
assert(json[r'enabled'] != null, 'Required key "DuplicateDetectionConfig[enabled]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'maxDistance'), 'Required key "DuplicateDetectionConfig[maxDistance]" is missing from JSON.');
|
||||||
|
assert(json[r'maxDistance'] != null, 'Required key "DuplicateDetectionConfig[maxDistance]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
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;
|
||||||
|
|||||||
@@ -45,6 +45,15 @@ class DuplicateResolveDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'groups'), 'Required key "DuplicateResolveDto[groups]" is missing from JSON.');
|
||||||
|
assert(json[r'groups'] != null, 'Required key "DuplicateResolveDto[groups]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return DuplicateResolveDto(
|
return DuplicateResolveDto(
|
||||||
groups: DuplicateResolveGroupDto.listFromJson(json[r'groups']),
|
groups: DuplicateResolveGroupDto.listFromJson(json[r'groups']),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -58,6 +58,19 @@ class DuplicateResolveGroupDto {
|
|||||||
if (value is Map) {
|
if (value is Map) {
|
||||||
final json = value.cast<String, dynamic>();
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
assert(json.containsKey(r'duplicateId'), 'Required key "DuplicateResolveGroupDto[duplicateId]" is missing from JSON.');
|
||||||
|
assert(json[r'duplicateId'] != null, 'Required key "DuplicateResolveGroupDto[duplicateId]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'keepAssetIds'), 'Required key "DuplicateResolveGroupDto[keepAssetIds]" is missing from JSON.');
|
||||||
|
assert(json[r'keepAssetIds'] != null, 'Required key "DuplicateResolveGroupDto[keepAssetIds]" has a null value in JSON.');
|
||||||
|
assert(json.containsKey(r'trashAssetIds'), 'Required key "DuplicateResolveGroupDto[trashAssetIds]" is missing from JSON.');
|
||||||
|
assert(json[r'trashAssetIds'] != null, 'Required key "DuplicateResolveGroupDto[trashAssetIds]" has a null value in JSON.');
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
return DuplicateResolveGroupDto(
|
return DuplicateResolveGroupDto(
|
||||||
duplicateId: mapValueOfType<String>(json, r'duplicateId')!,
|
duplicateId: mapValueOfType<String>(json, r'duplicateId')!,
|
||||||
keepAssetIds: json[r'keepAssetIds'] is Iterable
|
keepAssetIds: json[r'keepAssetIds'] is Iterable
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user