fix gen code

This commit is contained in:
shenlong-tanwen 2025-05-17 14:24:20 +05:30
parent e475653206
commit ac70d03693
53 changed files with 714 additions and 747 deletions

View File

@ -163,10 +163,11 @@ class Album {
dto.order == AssetOrder.asc ? SortOrder.asc : SortOrder.desc;
}
if (dto.albumThumbnailAssetId.unwrapOrNull() != null) {
if (dto.albumThumbnailAssetId != null &&
dto.albumThumbnailAssetId!.isSome) {
a.thumbnail.value = await db.assets
.where()
.remoteIdEqualTo(dto.albumThumbnailAssetId.unwrap())
.remoteIdEqualTo(dto.albumThumbnailAssetId!.unwrap())
.findFirst();
}
if (dto.albumUsers.isNotEmpty) {

View File

@ -27,9 +27,9 @@ class Asset {
durationInSeconds = remote.duration.toDuration()?.inSeconds ?? 0,
type = remote.type.toAssetType(),
fileName = remote.originalFileName,
height = remote.exifInfo?.exifImageHeight.unwrapOrNull()?.toInt(),
width = remote.exifInfo?.exifImageWidth.unwrapOrNull()?.toInt(),
livePhotoVideoId = remote.livePhotoVideoId.unwrapOrNull(),
height = remote.exifInfo?.exifImageHeight?.unwrapOrNull()?.toInt(),
width = remote.exifInfo?.exifImageWidth?.unwrapOrNull()?.toInt(),
livePhotoVideoId = remote.livePhotoVideoId?.unwrapOrNull(),
ownerId = fastHash(remote.ownerId),
exifInfo = remote.exifInfo == null
? null
@ -41,12 +41,12 @@ class Asset {
// workaround to nullify stackPrimaryAssetId for the parent asset until we refactor the mobile app
// stack handling to properly handle it
stackPrimaryAssetId =
remote.stack.unwrapOrNull()?.primaryAssetId == remote.id
remote.stack?.unwrapOrNull()?.primaryAssetId == remote.id
? null
: remote.stack.unwrapOrNull()?.primaryAssetId,
stackCount = remote.stack.unwrapOrNull()?.assetCount ?? 0,
stackId = remote.stack.unwrapOrNull()?.id,
thumbhash = remote.thumbhash.unwrapOrNull();
: remote.stack?.unwrapOrNull()?.primaryAssetId,
stackCount = remote.stack?.unwrapOrNull()?.assetCount ?? 0,
stackId = remote.stack?.unwrapOrNull()?.id,
thumbhash = remote.thumbhash?.unwrapOrNull();
Asset({
this.id = Isar.autoIncrement,

View File

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

View File

@ -31,8 +31,8 @@ abstract final class UserConverter {
inTimeline: false,
isPartnerSharedBy: false,
isPartnerSharedWith: false,
quotaUsageInBytes: adminDto.quotaUsageInBytes.unwrapOrNull() ?? 0,
quotaSizeInBytes: adminDto.quotaSizeInBytes.unwrapOrNull() ?? 0,
quotaUsageInBytes: adminDto.quotaUsageInBytes?.unwrapOrNull() ?? 0,
quotaSizeInBytes: adminDto.quotaSizeInBytes?.unwrapOrNull() ?? 0,
);
static UserDto fromPartnerDto(PartnerResponseDto dto) => UserDto(

View File

@ -61,9 +61,9 @@ class SharedLink {
: id = dto.id,
allowDownload = dto.allowDownload,
allowUpload = dto.allowUpload,
description = dto.description.unwrapOrNull(),
password = dto.password.unwrapOrNull(),
expiresAt = dto.expiresAt.unwrapOrNull(),
description = dto.description?.unwrapOrNull(),
password = dto.password?.unwrapOrNull(),
expiresAt = dto.expiresAt?.unwrapOrNull(),
key = dto.key,
showMetadata = dto.showMetadata,
type = dto.type == SharedLinkType.ALBUM
@ -73,7 +73,7 @@ class SharedLink {
? dto.album?.albumName.toUpperCase() ?? "UNKNOWN SHARE"
: "INDIVIDUAL SHARE",
thumbAssetId = dto.type == SharedLinkType.ALBUM
? dto.album?.albumThumbnailAssetId.unwrapOrNull()
? dto.album?.albumThumbnailAssetId?.unwrapOrNull()
: dto.assets.isNotEmpty
? dto.assets[0].id
: null;

View File

@ -40,7 +40,7 @@ final getAllPlacesProvider =
final curatedContent = assetPlaces
.map(
(data) => SearchCuratedContent(
label: data.exifInfo!.city.unwrap(),
label: data.exifInfo!.city!.unwrap(),
id: data.id,
),
)

View File

@ -61,7 +61,7 @@ class ActivityApiRepository extends ApiRepository
? ActivityType.comment
: ActivityType.like,
user: UserConverter.fromSimpleUserDto(dto.user),
assetId: dto.assetId.unwrapOrNull(),
comment: dto.comment.unwrapOrNull(),
assetId: dto.assetId?.unwrapOrNull(),
comment: dto.comment?.unwrapOrNull(),
);
}

View File

@ -168,7 +168,7 @@ class AlbumApiRepository extends ApiRepository implements IAlbumApiRepository {
album.remoteAssetCount = dto.assetCount;
album.owner.value =
entity.User.fromDto(UserConverter.fromSimpleUserDto(dto.owner));
album.remoteThumbnailAssetId = dto.albumThumbnailAssetId.unwrapOrNull();
album.remoteThumbnailAssetId = dto.albumThumbnailAssetId?.unwrapOrNull();
final users = dto.albumUsers
.map((albumUser) => UserConverter.fromSimpleUserDto(albumUser.user));
album.sharedUsers.addAll(users.map(entity.User.fromDto));

View File

@ -43,7 +43,7 @@ class AssetApiRepository extends ApiRepository implements IAssetApiRepository {
),
);
result.addAll(response.assets.items.map(Asset.remote));
hasNext = response.assets.nextPage.unwrapOrNull() != null;
hasNext = response.assets.nextPage?.unwrapOrNull() != null;
currentPage++;
}
return result;

View File

@ -29,7 +29,7 @@ class PersonApiRepository extends ApiRepository
}
static Person _toPerson(PersonResponseDto dto) => Person(
birthDate: dto.birthDate.unwrapOrNull(),
birthDate: dto.birthDate?.unwrapOrNull(),
id: dto.id,
isHidden: dto.isHidden,
name: dto.name,

View File

@ -119,7 +119,7 @@ class SearchService {
assets: await _assetRepository.getAllByRemoteId(
response.assets.items.map((e) => e.id),
),
nextPage: response.assets.nextPage.unwrapOrNull()?.toInt(),
nextPage: response.assets.nextPage?.unwrapOrNull()?.toInt(),
);
} catch (error, stackTrace) {
_log.severe("Failed to search for assets", error, stackTrace);

View File

@ -45,9 +45,9 @@ class PeopleInfo extends ConsumerWidget {
(p) => SearchCuratedContent(
id: p.id,
label: p.name,
subtitle: p.birthDate.unwrapOrNull() != null &&
p.birthDate.unwrap().isBefore(asset.fileCreatedAt)
? _formatAge(p.birthDate.unwrap(), asset.fileCreatedAt)
subtitle: p.birthDate?.unwrapOrNull() != null &&
p.birthDate!.unwrap().isBefore(asset.fileCreatedAt)
? _formatAge(p.birthDate!.unwrap(), asset.fileCreatedAt)
: null,
),
)

View File

@ -13,17 +13,17 @@ part of openapi.api;
class ActivityResponseDto {
/// Returns a new [ActivityResponseDto] instance.
ActivityResponseDto({
this.assetId = const None(),
this.comment = const None(),
required this.assetId,
this.comment,
required this.createdAt,
required this.id,
required this.type,
required this.user,
});
Option<String> assetId;
Option<String>? assetId;
Option<String> comment;
Option<String>? comment;
DateTime createdAt;
@ -45,8 +45,8 @@ class ActivityResponseDto {
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(assetId.hashCode) +
(comment.hashCode) +
(assetId == null ? 0 : assetId!.hashCode) +
(comment == null ? 0 : comment!.hashCode) +
(createdAt.hashCode) +
(id.hashCode) +
(type.hashCode) +
@ -57,17 +57,17 @@ class ActivityResponseDto {
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.assetId.unwrapOrNull() != null) {
if (this.assetId?.isSome ?? false) {
json[r'assetId'] = this.assetId;
} else {
if(this.assetId.isSome) {
if(this.assetId?.isNone ?? false) {
json[r'assetId'] = null;
}
}
if (this.comment.unwrapOrNull() != null) {
if (this.comment?.isSome ?? false) {
json[r'comment'] = this.comment;
} else {
if(this.comment.isSome) {
if(this.comment?.isNone ?? false) {
json[r'comment'] = null;
}
}

View File

@ -14,7 +14,7 @@ class AlbumResponseDto {
/// Returns a new [AlbumResponseDto] instance.
AlbumResponseDto({
required this.albumName,
this.albumThumbnailAssetId = const None(),
required this.albumThumbnailAssetId,
this.albumUsers = const [],
required this.assetCount,
this.assets = const [],
@ -35,7 +35,7 @@ class AlbumResponseDto {
String albumName;
Option<String> albumThumbnailAssetId;
Option<String>? albumThumbnailAssetId;
List<AlbumUserResponseDto> albumUsers;
@ -118,7 +118,7 @@ class AlbumResponseDto {
int get hashCode =>
// ignore: unnecessary_parenthesis
(albumName.hashCode) +
(albumThumbnailAssetId.hashCode) +
(albumThumbnailAssetId == null ? 0 : albumThumbnailAssetId!.hashCode) +
(albumUsers.hashCode) +
(assetCount.hashCode) +
(assets.hashCode) +
@ -142,10 +142,10 @@ class AlbumResponseDto {
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'albumName'] = this.albumName;
if (this.albumThumbnailAssetId.unwrapOrNull() != null) {
if (this.albumThumbnailAssetId?.isSome ?? false) {
json[r'albumThumbnailAssetId'] = this.albumThumbnailAssetId;
} else {
if(this.albumThumbnailAssetId.isSome) {
if(this.albumThumbnailAssetId?.isNone ?? false) {
json[r'albumThumbnailAssetId'] = null;
}
}

View File

@ -14,7 +14,7 @@ class AssetBulkUpdateDto {
/// Returns a new [AssetBulkUpdateDto] instance.
AssetBulkUpdateDto({
this.dateTimeOriginal,
this.duplicateId = const None(),
this.duplicateId,
this.ids = const [],
this.isFavorite,
this.latitude,
@ -31,7 +31,7 @@ class AssetBulkUpdateDto {
///
String? dateTimeOriginal;
Option<String> duplicateId;
Option<String>? duplicateId;
List<String> ids;
@ -92,7 +92,7 @@ class AssetBulkUpdateDto {
int get hashCode =>
// ignore: unnecessary_parenthesis
(dateTimeOriginal == null ? 0 : dateTimeOriginal!.hashCode) +
(duplicateId.hashCode) +
(duplicateId == null ? 0 : duplicateId!.hashCode) +
(ids.hashCode) +
(isFavorite == null ? 0 : isFavorite!.hashCode) +
(latitude == null ? 0 : latitude!.hashCode) +
@ -110,10 +110,10 @@ class AssetBulkUpdateDto {
} else {
// json[r'dateTimeOriginal'] = null;
}
if (this.duplicateId.unwrapOrNull() != null) {
if (this.duplicateId?.isSome ?? false) {
json[r'duplicateId'] = this.duplicateId;
} else {
if(this.duplicateId.isSome) {
if(this.duplicateId?.isNone ?? false) {
json[r'duplicateId'] = null;
}
}

View File

@ -20,7 +20,7 @@ class AssetFaceResponseDto {
required this.id,
required this.imageHeight,
required this.imageWidth,
this.person = const None(),
required this.person,
this.sourceType,
});
@ -38,7 +38,7 @@ class AssetFaceResponseDto {
int imageWidth;
Option<PersonResponseDto> person;
Option<PersonResponseDto>? person;
///
/// Please note: This property should have been non-nullable! Since the specification file
@ -70,7 +70,7 @@ class AssetFaceResponseDto {
(id.hashCode) +
(imageHeight.hashCode) +
(imageWidth.hashCode) +
(person.hashCode) +
(person == null ? 0 : person!.hashCode) +
(sourceType == null ? 0 : sourceType!.hashCode);
@override
@ -85,10 +85,10 @@ class AssetFaceResponseDto {
json[r'id'] = this.id;
json[r'imageHeight'] = this.imageHeight;
json[r'imageWidth'] = this.imageWidth;
if (this.person.unwrapOrNull() != null) {
if (this.person?.isSome ?? false) {
json[r'person'] = this.person;
} else {
if(this.person.isSome) {
if(this.person?.isNone ?? false) {
json[r'person'] = null;
}
}

View File

@ -16,7 +16,7 @@ class AssetResponseDto {
required this.checksum,
required this.deviceAssetId,
required this.deviceId,
this.duplicateId = const None(),
this.duplicateId,
required this.duration,
this.exifInfo,
required this.fileCreatedAt,
@ -27,8 +27,8 @@ class AssetResponseDto {
required this.isFavorite,
required this.isOffline,
required this.isTrashed,
this.libraryId = const None(),
this.livePhotoVideoId = const None(),
this.libraryId,
this.livePhotoVideoId,
required this.localDateTime,
required this.originalFileName,
this.originalMimeType,
@ -37,9 +37,9 @@ class AssetResponseDto {
required this.ownerId,
this.people = const [],
this.resized,
this.stack = const None(),
this.stack,
this.tags = const [],
this.thumbhash = const None(),
required this.thumbhash,
required this.type,
this.unassignedFaces = const [],
required this.updatedAt,
@ -53,7 +53,7 @@ class AssetResponseDto {
String deviceId;
Option<String> duplicateId;
Option<String>? duplicateId;
String duration;
@ -82,9 +82,9 @@ class AssetResponseDto {
bool isTrashed;
/// This property was deprecated in v1.106.0
Option<String> libraryId;
Option<String>? libraryId;
Option<String> livePhotoVideoId;
Option<String>? livePhotoVideoId;
DateTime localDateTime;
@ -121,11 +121,11 @@ class AssetResponseDto {
///
bool? resized;
Option<AssetStackResponseDto> stack;
Option<AssetStackResponseDto>? stack;
List<TagResponseDto> tags;
Option<String> thumbhash;
Option<String>? thumbhash;
AssetTypeEnum type;
@ -175,7 +175,7 @@ class AssetResponseDto {
(checksum.hashCode) +
(deviceAssetId.hashCode) +
(deviceId.hashCode) +
(duplicateId.hashCode) +
(duplicateId == null ? 0 : duplicateId!.hashCode) +
(duration.hashCode) +
(exifInfo == null ? 0 : exifInfo!.hashCode) +
(fileCreatedAt.hashCode) +
@ -186,8 +186,8 @@ class AssetResponseDto {
(isFavorite.hashCode) +
(isOffline.hashCode) +
(isTrashed.hashCode) +
(libraryId.hashCode) +
(livePhotoVideoId.hashCode) +
(libraryId == null ? 0 : libraryId!.hashCode) +
(livePhotoVideoId == null ? 0 : livePhotoVideoId!.hashCode) +
(localDateTime.hashCode) +
(originalFileName.hashCode) +
(originalMimeType == null ? 0 : originalMimeType!.hashCode) +
@ -196,9 +196,9 @@ class AssetResponseDto {
(ownerId.hashCode) +
(people.hashCode) +
(resized == null ? 0 : resized!.hashCode) +
(stack.hashCode) +
(stack == null ? 0 : stack!.hashCode) +
(tags.hashCode) +
(thumbhash.hashCode) +
(thumbhash == null ? 0 : thumbhash!.hashCode) +
(type.hashCode) +
(unassignedFaces.hashCode) +
(updatedAt.hashCode) +
@ -212,10 +212,10 @@ class AssetResponseDto {
json[r'checksum'] = this.checksum;
json[r'deviceAssetId'] = this.deviceAssetId;
json[r'deviceId'] = this.deviceId;
if (this.duplicateId.unwrapOrNull() != null) {
if (this.duplicateId?.isSome ?? false) {
json[r'duplicateId'] = this.duplicateId;
} else {
if(this.duplicateId.isSome) {
if(this.duplicateId?.isNone ?? false) {
json[r'duplicateId'] = null;
}
}
@ -233,17 +233,17 @@ class AssetResponseDto {
json[r'isFavorite'] = this.isFavorite;
json[r'isOffline'] = this.isOffline;
json[r'isTrashed'] = this.isTrashed;
if (this.libraryId.unwrapOrNull() != null) {
if (this.libraryId?.isSome ?? false) {
json[r'libraryId'] = this.libraryId;
} else {
if(this.libraryId.isSome) {
if(this.libraryId?.isNone ?? false) {
json[r'libraryId'] = null;
}
}
if (this.livePhotoVideoId.unwrapOrNull() != null) {
if (this.livePhotoVideoId?.isSome ?? false) {
json[r'livePhotoVideoId'] = this.livePhotoVideoId;
} else {
if(this.livePhotoVideoId.isSome) {
if(this.livePhotoVideoId?.isNone ?? false) {
json[r'livePhotoVideoId'] = null;
}
}
@ -267,18 +267,18 @@ class AssetResponseDto {
} else {
// json[r'resized'] = null;
}
if (this.stack.unwrapOrNull() != null) {
if (this.stack?.isSome ?? false) {
json[r'stack'] = this.stack;
} else {
if(this.stack.isSome) {
if(this.stack?.isNone ?? false) {
json[r'stack'] = null;
}
}
json[r'tags'] = this.tags;
if (this.thumbhash.unwrapOrNull() != null) {
if (this.thumbhash?.isSome ?? false) {
json[r'thumbhash'] = this.thumbhash;
} else {
if(this.thumbhash.isSome) {
if(this.thumbhash?.isNone ?? false) {
json[r'thumbhash'] = null;
}
}

View File

@ -13,73 +13,73 @@ part of openapi.api;
class ExifResponseDto {
/// Returns a new [ExifResponseDto] instance.
ExifResponseDto({
this.city = const None(),
this.country = const None(),
this.dateTimeOriginal = const None(),
this.description = const None(),
this.exifImageHeight = const None(),
this.exifImageWidth = const None(),
this.exposureTime = const None(),
this.fNumber = const None(),
this.fileSizeInByte = const None(),
this.focalLength = const None(),
this.iso = const None(),
this.latitude = const None(),
this.lensModel = const None(),
this.longitude = const None(),
this.make = const None(),
this.model = const None(),
this.modifyDate = const None(),
this.orientation = const None(),
this.projectionType = const None(),
this.rating = const None(),
this.state = const None(),
this.timeZone = const None(),
this.city,
this.country,
this.dateTimeOriginal,
this.description,
this.exifImageHeight,
this.exifImageWidth,
this.exposureTime,
this.fNumber,
this.fileSizeInByte,
this.focalLength,
this.iso,
this.latitude,
this.lensModel,
this.longitude,
this.make,
this.model,
this.modifyDate,
this.orientation,
this.projectionType,
this.rating,
this.state,
this.timeZone,
});
Option<String> city;
Option<String>? city;
Option<String> country;
Option<String>? country;
Option<DateTime> dateTimeOriginal;
Option<DateTime>? dateTimeOriginal;
Option<String> description;
Option<String>? description;
Option<num> exifImageHeight;
Option<num>? exifImageHeight;
Option<num> exifImageWidth;
Option<num>? exifImageWidth;
Option<String> exposureTime;
Option<String>? exposureTime;
Option<num> fNumber;
Option<num>? fNumber;
Option<int> fileSizeInByte;
Option<int>? fileSizeInByte;
Option<num> focalLength;
Option<num>? focalLength;
Option<num> iso;
Option<num>? iso;
Option<num> latitude;
Option<num>? latitude;
Option<String> lensModel;
Option<String>? lensModel;
Option<num> longitude;
Option<num>? longitude;
Option<String> make;
Option<String>? make;
Option<String> model;
Option<String>? model;
Option<DateTime> modifyDate;
Option<DateTime>? modifyDate;
Option<String> orientation;
Option<String>? orientation;
Option<String> projectionType;
Option<String>? projectionType;
Option<num> rating;
Option<num>? rating;
Option<String> state;
Option<String>? state;
Option<String> timeZone;
Option<String>? timeZone;
@override
bool operator ==(Object other) => identical(this, other) || other is ExifResponseDto &&
@ -109,185 +109,185 @@ class ExifResponseDto {
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(city.hashCode) +
(country.hashCode) +
(dateTimeOriginal.hashCode) +
(description.hashCode) +
(exifImageHeight.hashCode) +
(exifImageWidth.hashCode) +
(exposureTime.hashCode) +
(fNumber.hashCode) +
(fileSizeInByte.hashCode) +
(focalLength.hashCode) +
(iso.hashCode) +
(latitude.hashCode) +
(lensModel.hashCode) +
(longitude.hashCode) +
(make.hashCode) +
(model.hashCode) +
(modifyDate.hashCode) +
(orientation.hashCode) +
(projectionType.hashCode) +
(rating.hashCode) +
(state.hashCode) +
(timeZone.hashCode);
(city == null ? 0 : city!.hashCode) +
(country == null ? 0 : country!.hashCode) +
(dateTimeOriginal == null ? 0 : dateTimeOriginal!.hashCode) +
(description == null ? 0 : description!.hashCode) +
(exifImageHeight == null ? 0 : exifImageHeight!.hashCode) +
(exifImageWidth == null ? 0 : exifImageWidth!.hashCode) +
(exposureTime == null ? 0 : exposureTime!.hashCode) +
(fNumber == null ? 0 : fNumber!.hashCode) +
(fileSizeInByte == null ? 0 : fileSizeInByte!.hashCode) +
(focalLength == null ? 0 : focalLength!.hashCode) +
(iso == null ? 0 : iso!.hashCode) +
(latitude == null ? 0 : latitude!.hashCode) +
(lensModel == null ? 0 : lensModel!.hashCode) +
(longitude == null ? 0 : longitude!.hashCode) +
(make == null ? 0 : make!.hashCode) +
(model == null ? 0 : model!.hashCode) +
(modifyDate == null ? 0 : modifyDate!.hashCode) +
(orientation == null ? 0 : orientation!.hashCode) +
(projectionType == null ? 0 : projectionType!.hashCode) +
(rating == null ? 0 : rating!.hashCode) +
(state == null ? 0 : state!.hashCode) +
(timeZone == null ? 0 : timeZone!.hashCode);
@override
String toString() => 'ExifResponseDto[city=$city, country=$country, dateTimeOriginal=$dateTimeOriginal, description=$description, exifImageHeight=$exifImageHeight, exifImageWidth=$exifImageWidth, exposureTime=$exposureTime, fNumber=$fNumber, fileSizeInByte=$fileSizeInByte, focalLength=$focalLength, iso=$iso, latitude=$latitude, lensModel=$lensModel, longitude=$longitude, make=$make, model=$model, modifyDate=$modifyDate, orientation=$orientation, projectionType=$projectionType, rating=$rating, state=$state, timeZone=$timeZone]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.city.unwrapOrNull() != null) {
if (this.city?.isSome ?? false) {
json[r'city'] = this.city;
} else {
if(this.city.isSome) {
if(this.city?.isNone ?? false) {
json[r'city'] = null;
}
}
if (this.country.unwrapOrNull() != null) {
if (this.country?.isSome ?? false) {
json[r'country'] = this.country;
} else {
if(this.country.isSome) {
if(this.country?.isNone ?? false) {
json[r'country'] = null;
}
}
if (this.dateTimeOriginal.unwrapOrNull() != null) {
json[r'dateTimeOriginal'] = this.dateTimeOriginal.unwrap().toUtc().toIso8601String();
if (this.dateTimeOriginal?.isSome ?? false) {
json[r'dateTimeOriginal'] = this.dateTimeOriginal!.unwrap().toUtc().toIso8601String();
} else {
if(this.dateTimeOriginal.isSome) {
if(this.dateTimeOriginal?.isNone ?? false) {
json[r'dateTimeOriginal'] = null;
}
}
if (this.description.unwrapOrNull() != null) {
if (this.description?.isSome ?? false) {
json[r'description'] = this.description;
} else {
if(this.description.isSome) {
if(this.description?.isNone ?? false) {
json[r'description'] = null;
}
}
if (this.exifImageHeight.unwrapOrNull() != null) {
if (this.exifImageHeight?.isSome ?? false) {
json[r'exifImageHeight'] = this.exifImageHeight;
} else {
if(this.exifImageHeight.isSome) {
if(this.exifImageHeight?.isNone ?? false) {
json[r'exifImageHeight'] = null;
}
}
if (this.exifImageWidth.unwrapOrNull() != null) {
if (this.exifImageWidth?.isSome ?? false) {
json[r'exifImageWidth'] = this.exifImageWidth;
} else {
if(this.exifImageWidth.isSome) {
if(this.exifImageWidth?.isNone ?? false) {
json[r'exifImageWidth'] = null;
}
}
if (this.exposureTime.unwrapOrNull() != null) {
if (this.exposureTime?.isSome ?? false) {
json[r'exposureTime'] = this.exposureTime;
} else {
if(this.exposureTime.isSome) {
if(this.exposureTime?.isNone ?? false) {
json[r'exposureTime'] = null;
}
}
if (this.fNumber.unwrapOrNull() != null) {
if (this.fNumber?.isSome ?? false) {
json[r'fNumber'] = this.fNumber;
} else {
if(this.fNumber.isSome) {
if(this.fNumber?.isNone ?? false) {
json[r'fNumber'] = null;
}
}
if (this.fileSizeInByte.unwrapOrNull() != null) {
if (this.fileSizeInByte?.isSome ?? false) {
json[r'fileSizeInByte'] = this.fileSizeInByte;
} else {
if(this.fileSizeInByte.isSome) {
if(this.fileSizeInByte?.isNone ?? false) {
json[r'fileSizeInByte'] = null;
}
}
if (this.focalLength.unwrapOrNull() != null) {
if (this.focalLength?.isSome ?? false) {
json[r'focalLength'] = this.focalLength;
} else {
if(this.focalLength.isSome) {
if(this.focalLength?.isNone ?? false) {
json[r'focalLength'] = null;
}
}
if (this.iso.unwrapOrNull() != null) {
if (this.iso?.isSome ?? false) {
json[r'iso'] = this.iso;
} else {
if(this.iso.isSome) {
if(this.iso?.isNone ?? false) {
json[r'iso'] = null;
}
}
if (this.latitude.unwrapOrNull() != null) {
if (this.latitude?.isSome ?? false) {
json[r'latitude'] = this.latitude;
} else {
if(this.latitude.isSome) {
if(this.latitude?.isNone ?? false) {
json[r'latitude'] = null;
}
}
if (this.lensModel.unwrapOrNull() != null) {
if (this.lensModel?.isSome ?? false) {
json[r'lensModel'] = this.lensModel;
} else {
if(this.lensModel.isSome) {
if(this.lensModel?.isNone ?? false) {
json[r'lensModel'] = null;
}
}
if (this.longitude.unwrapOrNull() != null) {
if (this.longitude?.isSome ?? false) {
json[r'longitude'] = this.longitude;
} else {
if(this.longitude.isSome) {
if(this.longitude?.isNone ?? false) {
json[r'longitude'] = null;
}
}
if (this.make.unwrapOrNull() != null) {
if (this.make?.isSome ?? false) {
json[r'make'] = this.make;
} else {
if(this.make.isSome) {
if(this.make?.isNone ?? false) {
json[r'make'] = null;
}
}
if (this.model.unwrapOrNull() != null) {
if (this.model?.isSome ?? false) {
json[r'model'] = this.model;
} else {
if(this.model.isSome) {
if(this.model?.isNone ?? false) {
json[r'model'] = null;
}
}
if (this.modifyDate.unwrapOrNull() != null) {
json[r'modifyDate'] = this.modifyDate.unwrap().toUtc().toIso8601String();
if (this.modifyDate?.isSome ?? false) {
json[r'modifyDate'] = this.modifyDate!.unwrap().toUtc().toIso8601String();
} else {
if(this.modifyDate.isSome) {
if(this.modifyDate?.isNone ?? false) {
json[r'modifyDate'] = null;
}
}
if (this.orientation.unwrapOrNull() != null) {
if (this.orientation?.isSome ?? false) {
json[r'orientation'] = this.orientation;
} else {
if(this.orientation.isSome) {
if(this.orientation?.isNone ?? false) {
json[r'orientation'] = null;
}
}
if (this.projectionType.unwrapOrNull() != null) {
if (this.projectionType?.isSome ?? false) {
json[r'projectionType'] = this.projectionType;
} else {
if(this.projectionType.isSome) {
if(this.projectionType?.isNone ?? false) {
json[r'projectionType'] = null;
}
}
if (this.rating.unwrapOrNull() != null) {
if (this.rating?.isSome ?? false) {
json[r'rating'] = this.rating;
} else {
if(this.rating.isSome) {
if(this.rating?.isNone ?? false) {
json[r'rating'] = null;
}
}
if (this.state.unwrapOrNull() != null) {
if (this.state?.isSome ?? false) {
json[r'state'] = this.state;
} else {
if(this.state.isSome) {
if(this.state?.isNone ?? false) {
json[r'state'] = null;
}
}
if (this.timeZone.unwrapOrNull() != null) {
if (this.timeZone?.isSome ?? false) {
json[r'timeZone'] = this.timeZone;
} else {
if(this.timeZone.isSome) {
if(this.timeZone?.isNone ?? false) {
json[r'timeZone'] = null;
}
}

View File

@ -20,7 +20,7 @@ class LibraryResponseDto {
this.importPaths = const [],
required this.name,
required this.ownerId,
this.refreshedAt = const None(),
required this.refreshedAt,
required this.updatedAt,
});
@ -38,7 +38,7 @@ class LibraryResponseDto {
String ownerId;
Option<DateTime> refreshedAt;
Option<DateTime>? refreshedAt;
DateTime updatedAt;
@ -64,7 +64,7 @@ class LibraryResponseDto {
(importPaths.hashCode) +
(name.hashCode) +
(ownerId.hashCode) +
(refreshedAt.hashCode) +
(refreshedAt == null ? 0 : refreshedAt!.hashCode) +
(updatedAt.hashCode);
@override
@ -79,10 +79,10 @@ class LibraryResponseDto {
json[r'importPaths'] = this.importPaths;
json[r'name'] = this.name;
json[r'ownerId'] = this.ownerId;
if (this.refreshedAt.unwrapOrNull() != null) {
json[r'refreshedAt'] = this.refreshedAt.unwrap().toUtc().toIso8601String();
if (this.refreshedAt?.isSome ?? false) {
json[r'refreshedAt'] = this.refreshedAt!.unwrap().toUtc().toIso8601String();
} else {
if(this.refreshedAt.isSome) {
if(this.refreshedAt?.isNone ?? false) {
json[r'refreshedAt'] = null;
}
}

View File

@ -13,17 +13,17 @@ part of openapi.api;
class MapMarkerResponseDto {
/// Returns a new [MapMarkerResponseDto] instance.
MapMarkerResponseDto({
this.city = const None(),
this.country = const None(),
required this.city,
required this.country,
required this.id,
required this.lat,
required this.lon,
this.state = const None(),
required this.state,
});
Option<String> city;
Option<String>? city;
Option<String> country;
Option<String>? country;
String id;
@ -31,7 +31,7 @@ class MapMarkerResponseDto {
double lon;
Option<String> state;
Option<String>? state;
@override
bool operator ==(Object other) => identical(this, other) || other is MapMarkerResponseDto &&
@ -45,39 +45,39 @@ class MapMarkerResponseDto {
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(city.hashCode) +
(country.hashCode) +
(city == null ? 0 : city!.hashCode) +
(country == null ? 0 : country!.hashCode) +
(id.hashCode) +
(lat.hashCode) +
(lon.hashCode) +
(state.hashCode);
(state == null ? 0 : state!.hashCode);
@override
String toString() => 'MapMarkerResponseDto[city=$city, country=$country, id=$id, lat=$lat, lon=$lon, state=$state]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.city.unwrapOrNull() != null) {
if (this.city?.isSome ?? false) {
json[r'city'] = this.city;
} else {
if(this.city.isSome) {
if(this.city?.isNone ?? false) {
json[r'city'] = null;
}
}
if (this.country.unwrapOrNull() != null) {
if (this.country?.isSome ?? false) {
json[r'country'] = this.country;
} else {
if(this.country.isSome) {
if(this.country?.isNone ?? false) {
json[r'country'] = null;
}
}
json[r'id'] = this.id;
json[r'lat'] = this.lat;
json[r'lon'] = this.lon;
if (this.state.unwrapOrNull() != null) {
if (this.state?.isSome ?? false) {
json[r'state'] = this.state;
} else {
if(this.state.isSome) {
if(this.state?.isNone ?? false) {
json[r'state'] = null;
}
}

View File

@ -13,16 +13,16 @@ part of openapi.api;
class MapReverseGeocodeResponseDto {
/// Returns a new [MapReverseGeocodeResponseDto] instance.
MapReverseGeocodeResponseDto({
this.city = const None(),
this.country = const None(),
this.state = const None(),
required this.city,
required this.country,
required this.state,
});
Option<String> city;
Option<String>? city;
Option<String> country;
Option<String>? country;
Option<String> state;
Option<String>? state;
@override
bool operator ==(Object other) => identical(this, other) || other is MapReverseGeocodeResponseDto &&
@ -33,33 +33,33 @@ class MapReverseGeocodeResponseDto {
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(city.hashCode) +
(country.hashCode) +
(state.hashCode);
(city == null ? 0 : city!.hashCode) +
(country == null ? 0 : country!.hashCode) +
(state == null ? 0 : state!.hashCode);
@override
String toString() => 'MapReverseGeocodeResponseDto[city=$city, country=$country, state=$state]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.city.unwrapOrNull() != null) {
if (this.city?.isSome ?? false) {
json[r'city'] = this.city;
} else {
if(this.city.isSome) {
if(this.city?.isNone ?? false) {
json[r'city'] = null;
}
}
if (this.country.unwrapOrNull() != null) {
if (this.country?.isSome ?? false) {
json[r'country'] = this.country;
} else {
if(this.country.isSome) {
if(this.country?.isNone ?? false) {
json[r'country'] = null;
}
}
if (this.state.unwrapOrNull() != null) {
if (this.state?.isSome ?? false) {
json[r'state'] = this.state;
} else {
if(this.state.isSome) {
if(this.state?.isNone ?? false) {
json[r'state'] = null;
}
}

View File

@ -14,8 +14,8 @@ class MetadataSearchDto {
/// Returns a new [MetadataSearchDto] instance.
MetadataSearchDto({
this.checksum,
this.city = const None(),
this.country = const None(),
this.city,
this.country,
this.createdAfter,
this.createdBefore,
this.description,
@ -28,10 +28,10 @@ class MetadataSearchDto {
this.isMotion,
this.isNotInAlbum,
this.isOffline,
this.lensModel = const None(),
this.libraryId = const None(),
this.lensModel,
this.libraryId,
this.make,
this.model = const None(),
this.model,
this.order = AssetOrder.desc,
this.originalFileName,
this.originalPath,
@ -40,7 +40,7 @@ class MetadataSearchDto {
this.previewPath,
this.rating,
this.size,
this.state = const None(),
this.state,
this.tagIds = const [],
this.takenAfter,
this.takenBefore,
@ -65,9 +65,9 @@ class MetadataSearchDto {
///
String? checksum;
Option<String> city;
Option<String>? city;
Option<String> country;
Option<String>? country;
///
/// Please note: This property should have been non-nullable! Since the specification file
@ -165,9 +165,9 @@ class MetadataSearchDto {
///
bool? isOffline;
Option<String> lensModel;
Option<String>? lensModel;
Option<String> libraryId;
Option<String>? libraryId;
///
/// Please note: This property should have been non-nullable! Since the specification file
@ -177,7 +177,7 @@ class MetadataSearchDto {
///
String? make;
Option<String> model;
Option<String>? model;
AssetOrder order;
@ -236,7 +236,7 @@ class MetadataSearchDto {
///
num? size;
Option<String> state;
Option<String>? state;
List<String> tagIds;
@ -393,8 +393,8 @@ class MetadataSearchDto {
int get hashCode =>
// ignore: unnecessary_parenthesis
(checksum == null ? 0 : checksum!.hashCode) +
(city.hashCode) +
(country.hashCode) +
(city == null ? 0 : city!.hashCode) +
(country == null ? 0 : country!.hashCode) +
(createdAfter == null ? 0 : createdAfter!.hashCode) +
(createdBefore == null ? 0 : createdBefore!.hashCode) +
(description == null ? 0 : description!.hashCode) +
@ -407,10 +407,10 @@ class MetadataSearchDto {
(isMotion == null ? 0 : isMotion!.hashCode) +
(isNotInAlbum == null ? 0 : isNotInAlbum!.hashCode) +
(isOffline == null ? 0 : isOffline!.hashCode) +
(lensModel.hashCode) +
(libraryId.hashCode) +
(lensModel == null ? 0 : lensModel!.hashCode) +
(libraryId == null ? 0 : libraryId!.hashCode) +
(make == null ? 0 : make!.hashCode) +
(model.hashCode) +
(model == null ? 0 : model!.hashCode) +
(order.hashCode) +
(originalFileName == null ? 0 : originalFileName!.hashCode) +
(originalPath == null ? 0 : originalPath!.hashCode) +
@ -419,7 +419,7 @@ class MetadataSearchDto {
(previewPath == null ? 0 : previewPath!.hashCode) +
(rating == null ? 0 : rating!.hashCode) +
(size == null ? 0 : size!.hashCode) +
(state.hashCode) +
(state == null ? 0 : state!.hashCode) +
(tagIds.hashCode) +
(takenAfter == null ? 0 : takenAfter!.hashCode) +
(takenBefore == null ? 0 : takenBefore!.hashCode) +
@ -445,17 +445,17 @@ class MetadataSearchDto {
} else {
// json[r'checksum'] = null;
}
if (this.city.unwrapOrNull() != null) {
if (this.city?.isSome ?? false) {
json[r'city'] = this.city;
} else {
if(this.city.isSome) {
if(this.city?.isNone ?? false) {
json[r'city'] = null;
}
}
if (this.country.unwrapOrNull() != null) {
if (this.country?.isSome ?? false) {
json[r'country'] = this.country;
} else {
if(this.country.isSome) {
if(this.country?.isNone ?? false) {
json[r'country'] = null;
}
}
@ -519,17 +519,17 @@ class MetadataSearchDto {
} else {
// json[r'isOffline'] = null;
}
if (this.lensModel.unwrapOrNull() != null) {
if (this.lensModel?.isSome ?? false) {
json[r'lensModel'] = this.lensModel;
} else {
if(this.lensModel.isSome) {
if(this.lensModel?.isNone ?? false) {
json[r'lensModel'] = null;
}
}
if (this.libraryId.unwrapOrNull() != null) {
if (this.libraryId?.isSome ?? false) {
json[r'libraryId'] = this.libraryId;
} else {
if(this.libraryId.isSome) {
if(this.libraryId?.isNone ?? false) {
json[r'libraryId'] = null;
}
}
@ -538,10 +538,10 @@ class MetadataSearchDto {
} else {
// json[r'make'] = null;
}
if (this.model.unwrapOrNull() != null) {
if (this.model?.isSome ?? false) {
json[r'model'] = this.model;
} else {
if(this.model.isSome) {
if(this.model?.isNone ?? false) {
json[r'model'] = null;
}
}
@ -577,10 +577,10 @@ class MetadataSearchDto {
} else {
// json[r'size'] = null;
}
if (this.state.unwrapOrNull() != null) {
if (this.state?.isSome ?? false) {
json[r'state'] = this.state;
} else {
if(this.state.isSome) {
if(this.state?.isNone ?? false) {
json[r'state'] = null;
}
}

View File

@ -14,9 +14,9 @@ class NotificationCreateDto {
/// Returns a new [NotificationCreateDto] instance.
NotificationCreateDto({
this.data,
this.description = const None(),
this.description,
this.level,
this.readAt = const None(),
this.readAt,
required this.title,
this.type,
required this.userId,
@ -30,7 +30,7 @@ class NotificationCreateDto {
///
Object? data;
Option<String> description;
Option<String>? description;
///
/// Please note: This property should have been non-nullable! Since the specification file
@ -40,7 +40,7 @@ class NotificationCreateDto {
///
NotificationLevel? level;
Option<DateTime> readAt;
Option<DateTime>? readAt;
String title;
@ -68,9 +68,9 @@ class NotificationCreateDto {
int get hashCode =>
// ignore: unnecessary_parenthesis
(data == null ? 0 : data!.hashCode) +
(description.hashCode) +
(description == null ? 0 : description!.hashCode) +
(level == null ? 0 : level!.hashCode) +
(readAt.hashCode) +
(readAt == null ? 0 : readAt!.hashCode) +
(title.hashCode) +
(type == null ? 0 : type!.hashCode) +
(userId.hashCode);
@ -85,10 +85,10 @@ class NotificationCreateDto {
} else {
// json[r'data'] = null;
}
if (this.description.unwrapOrNull() != null) {
if (this.description?.isSome ?? false) {
json[r'description'] = this.description;
} else {
if(this.description.isSome) {
if(this.description?.isNone ?? false) {
json[r'description'] = null;
}
}
@ -97,10 +97,10 @@ class NotificationCreateDto {
} else {
// json[r'level'] = null;
}
if (this.readAt.unwrapOrNull() != null) {
json[r'readAt'] = this.readAt.unwrap().toUtc().toIso8601String();
if (this.readAt?.isSome ?? false) {
json[r'readAt'] = this.readAt!.unwrap().toUtc().toIso8601String();
} else {
if(this.readAt.isSome) {
if(this.readAt?.isNone ?? false) {
json[r'readAt'] = null;
}
}

View File

@ -14,12 +14,12 @@ class NotificationUpdateAllDto {
/// Returns a new [NotificationUpdateAllDto] instance.
NotificationUpdateAllDto({
this.ids = const [],
this.readAt = const None(),
this.readAt,
});
List<String> ids;
Option<DateTime> readAt;
Option<DateTime>? readAt;
@override
bool operator ==(Object other) => identical(this, other) || other is NotificationUpdateAllDto &&
@ -30,7 +30,7 @@ class NotificationUpdateAllDto {
int get hashCode =>
// ignore: unnecessary_parenthesis
(ids.hashCode) +
(readAt.hashCode);
(readAt == null ? 0 : readAt!.hashCode);
@override
String toString() => 'NotificationUpdateAllDto[ids=$ids, readAt=$readAt]';
@ -38,10 +38,10 @@ class NotificationUpdateAllDto {
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'ids'] = this.ids;
if (this.readAt.unwrapOrNull() != null) {
json[r'readAt'] = this.readAt.unwrap().toUtc().toIso8601String();
if (this.readAt?.isSome ?? false) {
json[r'readAt'] = this.readAt!.unwrap().toUtc().toIso8601String();
} else {
if(this.readAt.isSome) {
if(this.readAt?.isNone ?? false) {
json[r'readAt'] = null;
}
}

View File

@ -13,10 +13,10 @@ part of openapi.api;
class NotificationUpdateDto {
/// Returns a new [NotificationUpdateDto] instance.
NotificationUpdateDto({
this.readAt = const None(),
this.readAt,
});
Option<DateTime> readAt;
Option<DateTime>? readAt;
@override
bool operator ==(Object other) => identical(this, other) || other is NotificationUpdateDto &&
@ -25,17 +25,17 @@ class NotificationUpdateDto {
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(readAt.hashCode);
(readAt == null ? 0 : readAt!.hashCode);
@override
String toString() => 'NotificationUpdateDto[readAt=$readAt]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.readAt.unwrapOrNull() != null) {
json[r'readAt'] = this.readAt.unwrap().toUtc().toIso8601String();
if (this.readAt?.isSome ?? false) {
json[r'readAt'] = this.readAt!.unwrap().toUtc().toIso8601String();
} else {
if(this.readAt.isSome) {
if(this.readAt?.isNone ?? false) {
json[r'readAt'] = null;
}
}

View File

@ -13,8 +13,8 @@ part of openapi.api;
class PeopleUpdateItem {
/// Returns a new [PeopleUpdateItem] instance.
PeopleUpdateItem({
this.birthDate = const None(),
this.color = const None(),
this.birthDate,
this.color,
this.featureFaceAssetId,
required this.id,
this.isFavorite,
@ -23,9 +23,9 @@ class PeopleUpdateItem {
});
/// Person date of birth. Note: the mobile app cannot currently set the birth date to null.
Option<DateTime> birthDate;
Option<DateTime>? birthDate;
Option<String> color;
Option<String>? color;
/// Asset is used to get the feature face thumbnail.
///
@ -78,8 +78,8 @@ class PeopleUpdateItem {
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(birthDate.hashCode) +
(color.hashCode) +
(birthDate == null ? 0 : birthDate!.hashCode) +
(color == null ? 0 : color!.hashCode) +
(featureFaceAssetId == null ? 0 : featureFaceAssetId!.hashCode) +
(id.hashCode) +
(isFavorite == null ? 0 : isFavorite!.hashCode) +
@ -91,17 +91,17 @@ class PeopleUpdateItem {
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.birthDate.unwrapOrNull() != null) {
json[r'birthDate'] = _dateFormatter.format(this.birthDate.unwrap().toUtc());
if (this.birthDate?.isSome ?? false) {
json[r'birthDate'] = _dateFormatter.format(this.birthDate!.unwrap().toUtc());
} else {
if(this.birthDate.isSome) {
if(this.birthDate?.isNone ?? false) {
json[r'birthDate'] = null;
}
}
if (this.color.unwrapOrNull() != null) {
if (this.color?.isSome ?? false) {
json[r'color'] = this.color;
} else {
if(this.color.isSome) {
if(this.color?.isNone ?? false) {
json[r'color'] = null;
}
}

View File

@ -13,17 +13,17 @@ part of openapi.api;
class PersonCreateDto {
/// Returns a new [PersonCreateDto] instance.
PersonCreateDto({
this.birthDate = const None(),
this.color = const None(),
this.birthDate,
this.color,
this.isFavorite,
this.isHidden,
this.name,
});
/// Person date of birth. Note: the mobile app cannot currently set the birth date to null.
Option<DateTime> birthDate;
Option<DateTime>? birthDate;
Option<String> color;
Option<String>? color;
///
/// Please note: This property should have been non-nullable! Since the specification file
@ -62,8 +62,8 @@ class PersonCreateDto {
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(birthDate.hashCode) +
(color.hashCode) +
(birthDate == null ? 0 : birthDate!.hashCode) +
(color == null ? 0 : color!.hashCode) +
(isFavorite == null ? 0 : isFavorite!.hashCode) +
(isHidden == null ? 0 : isHidden!.hashCode) +
(name == null ? 0 : name!.hashCode);
@ -73,17 +73,17 @@ class PersonCreateDto {
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.birthDate.unwrapOrNull() != null) {
json[r'birthDate'] = _dateFormatter.format(this.birthDate.unwrap().toUtc());
if (this.birthDate?.isSome ?? false) {
json[r'birthDate'] = _dateFormatter.format(this.birthDate!.unwrap().toUtc());
} else {
if(this.birthDate.isSome) {
if(this.birthDate?.isNone ?? false) {
json[r'birthDate'] = null;
}
}
if (this.color.unwrapOrNull() != null) {
if (this.color?.isSome ?? false) {
json[r'color'] = this.color;
} else {
if(this.color.isSome) {
if(this.color?.isNone ?? false) {
json[r'color'] = null;
}
}

View File

@ -13,7 +13,7 @@ part of openapi.api;
class PersonResponseDto {
/// Returns a new [PersonResponseDto] instance.
PersonResponseDto({
this.birthDate = const None(),
required this.birthDate,
this.color,
required this.id,
this.isFavorite,
@ -23,7 +23,7 @@ class PersonResponseDto {
this.updatedAt,
});
Option<DateTime> birthDate;
Option<DateTime>? birthDate;
/// This property was added in v1.126.0
///
@ -74,7 +74,7 @@ class PersonResponseDto {
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(birthDate.hashCode) +
(birthDate == null ? 0 : birthDate!.hashCode) +
(color == null ? 0 : color!.hashCode) +
(id.hashCode) +
(isFavorite == null ? 0 : isFavorite!.hashCode) +
@ -88,10 +88,10 @@ class PersonResponseDto {
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.birthDate.unwrapOrNull() != null) {
json[r'birthDate'] = _dateFormatter.format(this.birthDate.unwrap().toUtc());
if (this.birthDate?.isSome ?? false) {
json[r'birthDate'] = _dateFormatter.format(this.birthDate!.unwrap().toUtc());
} else {
if(this.birthDate.isSome) {
if(this.birthDate?.isNone ?? false) {
json[r'birthDate'] = null;
}
}

View File

@ -13,8 +13,8 @@ part of openapi.api;
class PersonUpdateDto {
/// Returns a new [PersonUpdateDto] instance.
PersonUpdateDto({
this.birthDate = const None(),
this.color = const None(),
this.birthDate,
this.color,
this.featureFaceAssetId,
this.isFavorite,
this.isHidden,
@ -22,9 +22,9 @@ class PersonUpdateDto {
});
/// Person date of birth. Note: the mobile app cannot currently set the birth date to null.
Option<DateTime> birthDate;
Option<DateTime>? birthDate;
Option<String> color;
Option<String>? color;
/// Asset is used to get the feature face thumbnail.
///
@ -73,8 +73,8 @@ class PersonUpdateDto {
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(birthDate.hashCode) +
(color.hashCode) +
(birthDate == null ? 0 : birthDate!.hashCode) +
(color == null ? 0 : color!.hashCode) +
(featureFaceAssetId == null ? 0 : featureFaceAssetId!.hashCode) +
(isFavorite == null ? 0 : isFavorite!.hashCode) +
(isHidden == null ? 0 : isHidden!.hashCode) +
@ -85,17 +85,17 @@ class PersonUpdateDto {
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.birthDate.unwrapOrNull() != null) {
json[r'birthDate'] = _dateFormatter.format(this.birthDate.unwrap().toUtc());
if (this.birthDate?.isSome ?? false) {
json[r'birthDate'] = _dateFormatter.format(this.birthDate!.unwrap().toUtc());
} else {
if(this.birthDate.isSome) {
if(this.birthDate?.isNone ?? false) {
json[r'birthDate'] = null;
}
}
if (this.color.unwrapOrNull() != null) {
if (this.color?.isSome ?? false) {
json[r'color'] = this.color;
} else {
if(this.color.isSome) {
if(this.color?.isNone ?? false) {
json[r'color'] = null;
}
}

View File

@ -13,7 +13,7 @@ part of openapi.api;
class PersonWithFacesResponseDto {
/// Returns a new [PersonWithFacesResponseDto] instance.
PersonWithFacesResponseDto({
this.birthDate = const None(),
required this.birthDate,
this.color,
this.faces = const [],
required this.id,
@ -24,7 +24,7 @@ class PersonWithFacesResponseDto {
this.updatedAt,
});
Option<DateTime> birthDate;
Option<DateTime>? birthDate;
/// This property was added in v1.126.0
///
@ -78,7 +78,7 @@ class PersonWithFacesResponseDto {
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(birthDate.hashCode) +
(birthDate == null ? 0 : birthDate!.hashCode) +
(color == null ? 0 : color!.hashCode) +
(faces.hashCode) +
(id.hashCode) +
@ -93,10 +93,10 @@ class PersonWithFacesResponseDto {
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.birthDate.unwrapOrNull() != null) {
json[r'birthDate'] = _dateFormatter.format(this.birthDate.unwrap().toUtc());
if (this.birthDate?.isSome ?? false) {
json[r'birthDate'] = _dateFormatter.format(this.birthDate!.unwrap().toUtc());
} else {
if(this.birthDate.isSome) {
if(this.birthDate?.isNone ?? false) {
json[r'birthDate'] = null;
}
}

View File

@ -13,8 +13,8 @@ part of openapi.api;
class RandomSearchDto {
/// Returns a new [RandomSearchDto] instance.
RandomSearchDto({
this.city = const None(),
this.country = const None(),
this.city,
this.country,
this.createdAfter,
this.createdBefore,
this.deviceId,
@ -23,14 +23,14 @@ class RandomSearchDto {
this.isMotion,
this.isNotInAlbum,
this.isOffline,
this.lensModel = const None(),
this.libraryId = const None(),
this.lensModel,
this.libraryId,
this.make,
this.model = const None(),
this.model,
this.personIds = const [],
this.rating,
this.size,
this.state = const None(),
this.state,
this.tagIds = const [],
this.takenAfter,
this.takenBefore,
@ -46,9 +46,9 @@ class RandomSearchDto {
this.withStacked,
});
Option<String> city;
Option<String>? city;
Option<String> country;
Option<String>? country;
///
/// Please note: This property should have been non-nullable! Since the specification file
@ -114,9 +114,9 @@ class RandomSearchDto {
///
bool? isOffline;
Option<String> lensModel;
Option<String>? lensModel;
Option<String> libraryId;
Option<String>? libraryId;
///
/// Please note: This property should have been non-nullable! Since the specification file
@ -126,7 +126,7 @@ class RandomSearchDto {
///
String? make;
Option<String> model;
Option<String>? model;
List<String> personIds;
@ -150,7 +150,7 @@ class RandomSearchDto {
///
num? size;
Option<String> state;
Option<String>? state;
List<String> tagIds;
@ -287,8 +287,8 @@ class RandomSearchDto {
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(city.hashCode) +
(country.hashCode) +
(city == null ? 0 : city!.hashCode) +
(country == null ? 0 : country!.hashCode) +
(createdAfter == null ? 0 : createdAfter!.hashCode) +
(createdBefore == null ? 0 : createdBefore!.hashCode) +
(deviceId == null ? 0 : deviceId!.hashCode) +
@ -297,14 +297,14 @@ class RandomSearchDto {
(isMotion == null ? 0 : isMotion!.hashCode) +
(isNotInAlbum == null ? 0 : isNotInAlbum!.hashCode) +
(isOffline == null ? 0 : isOffline!.hashCode) +
(lensModel.hashCode) +
(libraryId.hashCode) +
(lensModel == null ? 0 : lensModel!.hashCode) +
(libraryId == null ? 0 : libraryId!.hashCode) +
(make == null ? 0 : make!.hashCode) +
(model.hashCode) +
(model == null ? 0 : model!.hashCode) +
(personIds.hashCode) +
(rating == null ? 0 : rating!.hashCode) +
(size == null ? 0 : size!.hashCode) +
(state.hashCode) +
(state == null ? 0 : state!.hashCode) +
(tagIds.hashCode) +
(takenAfter == null ? 0 : takenAfter!.hashCode) +
(takenBefore == null ? 0 : takenBefore!.hashCode) +
@ -324,17 +324,17 @@ class RandomSearchDto {
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.city.unwrapOrNull() != null) {
if (this.city?.isSome ?? false) {
json[r'city'] = this.city;
} else {
if(this.city.isSome) {
if(this.city?.isNone ?? false) {
json[r'city'] = null;
}
}
if (this.country.unwrapOrNull() != null) {
if (this.country?.isSome ?? false) {
json[r'country'] = this.country;
} else {
if(this.country.isSome) {
if(this.country?.isNone ?? false) {
json[r'country'] = null;
}
}
@ -378,17 +378,17 @@ class RandomSearchDto {
} else {
// json[r'isOffline'] = null;
}
if (this.lensModel.unwrapOrNull() != null) {
if (this.lensModel?.isSome ?? false) {
json[r'lensModel'] = this.lensModel;
} else {
if(this.lensModel.isSome) {
if(this.lensModel?.isNone ?? false) {
json[r'lensModel'] = null;
}
}
if (this.libraryId.unwrapOrNull() != null) {
if (this.libraryId?.isSome ?? false) {
json[r'libraryId'] = this.libraryId;
} else {
if(this.libraryId.isSome) {
if(this.libraryId?.isNone ?? false) {
json[r'libraryId'] = null;
}
}
@ -397,10 +397,10 @@ class RandomSearchDto {
} else {
// json[r'make'] = null;
}
if (this.model.unwrapOrNull() != null) {
if (this.model?.isSome ?? false) {
json[r'model'] = this.model;
} else {
if(this.model.isSome) {
if(this.model?.isNone ?? false) {
json[r'model'] = null;
}
}
@ -415,10 +415,10 @@ class RandomSearchDto {
} else {
// json[r'size'] = null;
}
if (this.state.unwrapOrNull() != null) {
if (this.state?.isSome ?? false) {
json[r'state'] = this.state;
} else {
if(this.state.isSome) {
if(this.state?.isNone ?? false) {
json[r'state'] = null;
}
}

View File

@ -13,13 +13,13 @@ part of openapi.api;
class ReverseGeocodingStateResponseDto {
/// Returns a new [ReverseGeocodingStateResponseDto] instance.
ReverseGeocodingStateResponseDto({
this.lastImportFileName = const None(),
this.lastUpdate = const None(),
required this.lastImportFileName,
required this.lastUpdate,
});
Option<String> lastImportFileName;
Option<String>? lastImportFileName;
Option<String> lastUpdate;
Option<String>? lastUpdate;
@override
bool operator ==(Object other) => identical(this, other) || other is ReverseGeocodingStateResponseDto &&
@ -29,25 +29,25 @@ class ReverseGeocodingStateResponseDto {
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(lastImportFileName.hashCode) +
(lastUpdate.hashCode);
(lastImportFileName == null ? 0 : lastImportFileName!.hashCode) +
(lastUpdate == null ? 0 : lastUpdate!.hashCode);
@override
String toString() => 'ReverseGeocodingStateResponseDto[lastImportFileName=$lastImportFileName, lastUpdate=$lastUpdate]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.lastImportFileName.unwrapOrNull() != null) {
if (this.lastImportFileName?.isSome ?? false) {
json[r'lastImportFileName'] = this.lastImportFileName;
} else {
if(this.lastImportFileName.isSome) {
if(this.lastImportFileName?.isNone ?? false) {
json[r'lastImportFileName'] = null;
}
}
if (this.lastUpdate.unwrapOrNull() != null) {
if (this.lastUpdate?.isSome ?? false) {
json[r'lastUpdate'] = this.lastUpdate;
} else {
if(this.lastUpdate.isSome) {
if(this.lastUpdate?.isNone ?? false) {
json[r'lastUpdate'] = null;
}
}

View File

@ -16,7 +16,7 @@ class SearchAssetResponseDto {
required this.count,
this.facets = const [],
this.items = const [],
this.nextPage = const None(),
required this.nextPage,
required this.total,
});
@ -26,7 +26,7 @@ class SearchAssetResponseDto {
List<AssetResponseDto> items;
Option<String> nextPage;
Option<String>? nextPage;
int total;
@ -44,7 +44,7 @@ class SearchAssetResponseDto {
(count.hashCode) +
(facets.hashCode) +
(items.hashCode) +
(nextPage.hashCode) +
(nextPage == null ? 0 : nextPage!.hashCode) +
(total.hashCode);
@override
@ -55,10 +55,10 @@ class SearchAssetResponseDto {
json[r'count'] = this.count;
json[r'facets'] = this.facets;
json[r'items'] = this.items;
if (this.nextPage.unwrapOrNull() != null) {
if (this.nextPage?.isSome ?? false) {
json[r'nextPage'] = this.nextPage;
} else {
if(this.nextPage.isSome) {
if(this.nextPage?.isNone ?? false) {
json[r'nextPage'] = null;
}
}

View File

@ -18,7 +18,7 @@ class SharedLinkCreateDto {
this.allowUpload,
this.assetIds = const [],
this.description,
this.expiresAt = const None(),
this.expiresAt,
this.password,
this.showMetadata = true,
required this.type,
@ -52,7 +52,7 @@ class SharedLinkCreateDto {
///
String? description;
Option<DateTime> expiresAt;
Option<DateTime>? expiresAt;
///
/// Please note: This property should have been non-nullable! Since the specification file
@ -86,7 +86,7 @@ class SharedLinkCreateDto {
(allowUpload == null ? 0 : allowUpload!.hashCode) +
(assetIds.hashCode) +
(description == null ? 0 : description!.hashCode) +
(expiresAt.hashCode) +
(expiresAt == null ? 0 : expiresAt!.hashCode) +
(password == null ? 0 : password!.hashCode) +
(showMetadata.hashCode) +
(type.hashCode);
@ -113,10 +113,10 @@ class SharedLinkCreateDto {
} else {
// json[r'description'] = null;
}
if (this.expiresAt.unwrapOrNull() != null) {
json[r'expiresAt'] = this.expiresAt.unwrap().toUtc().toIso8601String();
if (this.expiresAt?.isSome ?? false) {
json[r'expiresAt'] = this.expiresAt!.unwrap().toUtc().toIso8601String();
} else {
if(this.expiresAt.isSome) {
if(this.expiresAt?.isNone ?? false) {
json[r'expiresAt'] = null;
}
}

View File

@ -17,7 +17,7 @@ class SharedLinkEditDto {
this.allowUpload,
this.changeExpiryTime,
this.description,
this.expiresAt = const None(),
this.expiresAt,
this.password,
this.showMetadata,
});
@ -55,7 +55,7 @@ class SharedLinkEditDto {
///
String? description;
Option<DateTime> expiresAt;
Option<DateTime>? expiresAt;
///
/// Please note: This property should have been non-nullable! Since the specification file
@ -90,7 +90,7 @@ class SharedLinkEditDto {
(allowUpload == null ? 0 : allowUpload!.hashCode) +
(changeExpiryTime == null ? 0 : changeExpiryTime!.hashCode) +
(description == null ? 0 : description!.hashCode) +
(expiresAt.hashCode) +
(expiresAt == null ? 0 : expiresAt!.hashCode) +
(password == null ? 0 : password!.hashCode) +
(showMetadata == null ? 0 : showMetadata!.hashCode);
@ -119,10 +119,10 @@ class SharedLinkEditDto {
} else {
// json[r'description'] = null;
}
if (this.expiresAt.unwrapOrNull() != null) {
json[r'expiresAt'] = this.expiresAt.unwrap().toUtc().toIso8601String();
if (this.expiresAt?.isSome ?? false) {
json[r'expiresAt'] = this.expiresAt!.unwrap().toUtc().toIso8601String();
} else {
if(this.expiresAt.isSome) {
if(this.expiresAt?.isNone ?? false) {
json[r'expiresAt'] = null;
}
}

View File

@ -18,13 +18,13 @@ class SharedLinkResponseDto {
required this.allowUpload,
this.assets = const [],
required this.createdAt,
this.description = const None(),
this.expiresAt = const None(),
required this.description,
required this.expiresAt,
required this.id,
required this.key,
this.password = const None(),
required this.password,
required this.showMetadata,
this.token = const None(),
this.token,
required this.type,
required this.userId,
});
@ -45,19 +45,19 @@ class SharedLinkResponseDto {
DateTime createdAt;
Option<String> description;
Option<String>? description;
Option<DateTime> expiresAt;
Option<DateTime>? expiresAt;
String id;
String key;
Option<String> password;
Option<String>? password;
bool showMetadata;
Option<String> token;
Option<String>? token;
SharedLinkType type;
@ -88,13 +88,13 @@ class SharedLinkResponseDto {
(allowUpload.hashCode) +
(assets.hashCode) +
(createdAt.hashCode) +
(description.hashCode) +
(expiresAt.hashCode) +
(description == null ? 0 : description!.hashCode) +
(expiresAt == null ? 0 : expiresAt!.hashCode) +
(id.hashCode) +
(key.hashCode) +
(password.hashCode) +
(password == null ? 0 : password!.hashCode) +
(showMetadata.hashCode) +
(token.hashCode) +
(token == null ? 0 : token!.hashCode) +
(type.hashCode) +
(userId.hashCode);
@ -112,34 +112,34 @@ class SharedLinkResponseDto {
json[r'allowUpload'] = this.allowUpload;
json[r'assets'] = this.assets;
json[r'createdAt'] = this.createdAt.toUtc().toIso8601String();
if (this.description.unwrapOrNull() != null) {
if (this.description?.isSome ?? false) {
json[r'description'] = this.description;
} else {
if(this.description.isSome) {
if(this.description?.isNone ?? false) {
json[r'description'] = null;
}
}
if (this.expiresAt.unwrapOrNull() != null) {
json[r'expiresAt'] = this.expiresAt.unwrap().toUtc().toIso8601String();
if (this.expiresAt?.isSome ?? false) {
json[r'expiresAt'] = this.expiresAt!.unwrap().toUtc().toIso8601String();
} else {
if(this.expiresAt.isSome) {
if(this.expiresAt?.isNone ?? false) {
json[r'expiresAt'] = null;
}
}
json[r'id'] = this.id;
json[r'key'] = this.key;
if (this.password.unwrapOrNull() != null) {
if (this.password?.isSome ?? false) {
json[r'password'] = this.password;
} else {
if(this.password.isSome) {
if(this.password?.isNone ?? false) {
json[r'password'] = null;
}
}
json[r'showMetadata'] = this.showMetadata;
if (this.token.unwrapOrNull() != null) {
if (this.token?.isSome ?? false) {
json[r'token'] = this.token;
} else {
if(this.token.isSome) {
if(this.token?.isNone ?? false) {
json[r'token'] = null;
}
}

View File

@ -13,8 +13,8 @@ part of openapi.api;
class SmartSearchDto {
/// Returns a new [SmartSearchDto] instance.
SmartSearchDto({
this.city = const None(),
this.country = const None(),
this.city,
this.country,
this.createdAfter,
this.createdBefore,
this.deviceId,
@ -24,16 +24,16 @@ class SmartSearchDto {
this.isNotInAlbum,
this.isOffline,
this.language,
this.lensModel = const None(),
this.libraryId = const None(),
this.lensModel,
this.libraryId,
this.make,
this.model = const None(),
this.model,
this.page,
this.personIds = const [],
required this.query,
this.rating,
this.size,
this.state = const None(),
this.state,
this.tagIds = const [],
this.takenAfter,
this.takenBefore,
@ -47,9 +47,9 @@ class SmartSearchDto {
this.withExif,
});
Option<String> city;
Option<String>? city;
Option<String> country;
Option<String>? country;
///
/// Please note: This property should have been non-nullable! Since the specification file
@ -123,9 +123,9 @@ class SmartSearchDto {
///
String? language;
Option<String> lensModel;
Option<String>? lensModel;
Option<String> libraryId;
Option<String>? libraryId;
///
/// Please note: This property should have been non-nullable! Since the specification file
@ -135,7 +135,7 @@ class SmartSearchDto {
///
String? make;
Option<String> model;
Option<String>? model;
/// Minimum value: 1
///
@ -170,7 +170,7 @@ class SmartSearchDto {
///
num? size;
Option<String> state;
Option<String>? state;
List<String> tagIds;
@ -292,8 +292,8 @@ class SmartSearchDto {
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(city.hashCode) +
(country.hashCode) +
(city == null ? 0 : city!.hashCode) +
(country == null ? 0 : country!.hashCode) +
(createdAfter == null ? 0 : createdAfter!.hashCode) +
(createdBefore == null ? 0 : createdBefore!.hashCode) +
(deviceId == null ? 0 : deviceId!.hashCode) +
@ -303,16 +303,16 @@ class SmartSearchDto {
(isNotInAlbum == null ? 0 : isNotInAlbum!.hashCode) +
(isOffline == null ? 0 : isOffline!.hashCode) +
(language == null ? 0 : language!.hashCode) +
(lensModel.hashCode) +
(libraryId.hashCode) +
(lensModel == null ? 0 : lensModel!.hashCode) +
(libraryId == null ? 0 : libraryId!.hashCode) +
(make == null ? 0 : make!.hashCode) +
(model.hashCode) +
(model == null ? 0 : model!.hashCode) +
(page == null ? 0 : page!.hashCode) +
(personIds.hashCode) +
(query.hashCode) +
(rating == null ? 0 : rating!.hashCode) +
(size == null ? 0 : size!.hashCode) +
(state.hashCode) +
(state == null ? 0 : state!.hashCode) +
(tagIds.hashCode) +
(takenAfter == null ? 0 : takenAfter!.hashCode) +
(takenBefore == null ? 0 : takenBefore!.hashCode) +
@ -330,17 +330,17 @@ class SmartSearchDto {
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.city.unwrapOrNull() != null) {
if (this.city?.isSome ?? false) {
json[r'city'] = this.city;
} else {
if(this.city.isSome) {
if(this.city?.isNone ?? false) {
json[r'city'] = null;
}
}
if (this.country.unwrapOrNull() != null) {
if (this.country?.isSome ?? false) {
json[r'country'] = this.country;
} else {
if(this.country.isSome) {
if(this.country?.isNone ?? false) {
json[r'country'] = null;
}
}
@ -389,17 +389,17 @@ class SmartSearchDto {
} else {
// json[r'language'] = null;
}
if (this.lensModel.unwrapOrNull() != null) {
if (this.lensModel?.isSome ?? false) {
json[r'lensModel'] = this.lensModel;
} else {
if(this.lensModel.isSome) {
if(this.lensModel?.isNone ?? false) {
json[r'lensModel'] = null;
}
}
if (this.libraryId.unwrapOrNull() != null) {
if (this.libraryId?.isSome ?? false) {
json[r'libraryId'] = this.libraryId;
} else {
if(this.libraryId.isSome) {
if(this.libraryId?.isNone ?? false) {
json[r'libraryId'] = null;
}
}
@ -408,10 +408,10 @@ class SmartSearchDto {
} else {
// json[r'make'] = null;
}
if (this.model.unwrapOrNull() != null) {
if (this.model?.isSome ?? false) {
json[r'model'] = this.model;
} else {
if(this.model.isSome) {
if(this.model?.isNone ?? false) {
json[r'model'] = null;
}
}
@ -432,10 +432,10 @@ class SmartSearchDto {
} else {
// json[r'size'] = null;
}
if (this.state.unwrapOrNull() != null) {
if (this.state?.isSome ?? false) {
json[r'state'] = this.state;
} else {
if(this.state.isSome) {
if(this.state?.isNone ?? false) {
json[r'state'] = null;
}
}

View File

@ -14,81 +14,81 @@ class SyncAssetExifV1 {
/// Returns a new [SyncAssetExifV1] instance.
SyncAssetExifV1({
required this.assetId,
this.city = const None(),
this.country = const None(),
this.dateTimeOriginal = const None(),
this.description = const None(),
this.exifImageHeight = const None(),
this.exifImageWidth = const None(),
this.exposureTime = const None(),
this.fNumber = const None(),
this.fileSizeInByte = const None(),
this.focalLength = const None(),
this.fps = const None(),
this.iso = const None(),
this.latitude = const None(),
this.lensModel = const None(),
this.longitude = const None(),
this.make = const None(),
this.model = const None(),
this.modifyDate = const None(),
this.orientation = const None(),
this.profileDescription = const None(),
this.projectionType = const None(),
this.rating = const None(),
this.state = const None(),
this.timeZone = const None(),
required this.city,
required this.country,
required this.dateTimeOriginal,
required this.description,
required this.exifImageHeight,
required this.exifImageWidth,
required this.exposureTime,
required this.fNumber,
required this.fileSizeInByte,
required this.focalLength,
required this.fps,
required this.iso,
required this.latitude,
required this.lensModel,
required this.longitude,
required this.make,
required this.model,
required this.modifyDate,
required this.orientation,
required this.profileDescription,
required this.projectionType,
required this.rating,
required this.state,
required this.timeZone,
});
String assetId;
Option<String> city;
Option<String>? city;
Option<String> country;
Option<String>? country;
Option<DateTime> dateTimeOriginal;
Option<DateTime>? dateTimeOriginal;
Option<String> description;
Option<String>? description;
Option<int> exifImageHeight;
Option<int>? exifImageHeight;
Option<int> exifImageWidth;
Option<int>? exifImageWidth;
Option<String> exposureTime;
Option<String>? exposureTime;
Option<int> fNumber;
Option<int>? fNumber;
Option<int> fileSizeInByte;
Option<int>? fileSizeInByte;
Option<int> focalLength;
Option<int>? focalLength;
Option<int> fps;
Option<int>? fps;
Option<int> iso;
Option<int>? iso;
Option<int> latitude;
Option<int>? latitude;
Option<String> lensModel;
Option<String>? lensModel;
Option<int> longitude;
Option<int>? longitude;
Option<String> make;
Option<String>? make;
Option<String> model;
Option<String>? model;
Option<DateTime> modifyDate;
Option<DateTime>? modifyDate;
Option<String> orientation;
Option<String>? orientation;
Option<String> profileDescription;
Option<String>? profileDescription;
Option<String> projectionType;
Option<String>? projectionType;
Option<int> rating;
Option<int>? rating;
Option<String> state;
Option<String>? state;
Option<String> timeZone;
Option<String>? timeZone;
@override
bool operator ==(Object other) => identical(this, other) || other is SyncAssetExifV1 &&
@ -122,30 +122,30 @@ class SyncAssetExifV1 {
int get hashCode =>
// ignore: unnecessary_parenthesis
(assetId.hashCode) +
(city.hashCode) +
(country.hashCode) +
(dateTimeOriginal.hashCode) +
(description.hashCode) +
(exifImageHeight.hashCode) +
(exifImageWidth.hashCode) +
(exposureTime.hashCode) +
(fNumber.hashCode) +
(fileSizeInByte.hashCode) +
(focalLength.hashCode) +
(fps.hashCode) +
(iso.hashCode) +
(latitude.hashCode) +
(lensModel.hashCode) +
(longitude.hashCode) +
(make.hashCode) +
(model.hashCode) +
(modifyDate.hashCode) +
(orientation.hashCode) +
(profileDescription.hashCode) +
(projectionType.hashCode) +
(rating.hashCode) +
(state.hashCode) +
(timeZone.hashCode);
(city == null ? 0 : city!.hashCode) +
(country == null ? 0 : country!.hashCode) +
(dateTimeOriginal == null ? 0 : dateTimeOriginal!.hashCode) +
(description == null ? 0 : description!.hashCode) +
(exifImageHeight == null ? 0 : exifImageHeight!.hashCode) +
(exifImageWidth == null ? 0 : exifImageWidth!.hashCode) +
(exposureTime == null ? 0 : exposureTime!.hashCode) +
(fNumber == null ? 0 : fNumber!.hashCode) +
(fileSizeInByte == null ? 0 : fileSizeInByte!.hashCode) +
(focalLength == null ? 0 : focalLength!.hashCode) +
(fps == null ? 0 : fps!.hashCode) +
(iso == null ? 0 : iso!.hashCode) +
(latitude == null ? 0 : latitude!.hashCode) +
(lensModel == null ? 0 : lensModel!.hashCode) +
(longitude == null ? 0 : longitude!.hashCode) +
(make == null ? 0 : make!.hashCode) +
(model == null ? 0 : model!.hashCode) +
(modifyDate == null ? 0 : modifyDate!.hashCode) +
(orientation == null ? 0 : orientation!.hashCode) +
(profileDescription == null ? 0 : profileDescription!.hashCode) +
(projectionType == null ? 0 : projectionType!.hashCode) +
(rating == null ? 0 : rating!.hashCode) +
(state == null ? 0 : state!.hashCode) +
(timeZone == null ? 0 : timeZone!.hashCode);
@override
String toString() => 'SyncAssetExifV1[assetId=$assetId, city=$city, country=$country, dateTimeOriginal=$dateTimeOriginal, description=$description, exifImageHeight=$exifImageHeight, exifImageWidth=$exifImageWidth, exposureTime=$exposureTime, fNumber=$fNumber, fileSizeInByte=$fileSizeInByte, focalLength=$focalLength, fps=$fps, iso=$iso, latitude=$latitude, lensModel=$lensModel, longitude=$longitude, make=$make, model=$model, modifyDate=$modifyDate, orientation=$orientation, profileDescription=$profileDescription, projectionType=$projectionType, rating=$rating, state=$state, timeZone=$timeZone]';
@ -153,171 +153,171 @@ class SyncAssetExifV1 {
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'assetId'] = this.assetId;
if (this.city.unwrapOrNull() != null) {
if (this.city?.isSome ?? false) {
json[r'city'] = this.city;
} else {
if(this.city.isSome) {
if(this.city?.isNone ?? false) {
json[r'city'] = null;
}
}
if (this.country.unwrapOrNull() != null) {
if (this.country?.isSome ?? false) {
json[r'country'] = this.country;
} else {
if(this.country.isSome) {
if(this.country?.isNone ?? false) {
json[r'country'] = null;
}
}
if (this.dateTimeOriginal.unwrapOrNull() != null) {
json[r'dateTimeOriginal'] = this.dateTimeOriginal.unwrap().toUtc().toIso8601String();
if (this.dateTimeOriginal?.isSome ?? false) {
json[r'dateTimeOriginal'] = this.dateTimeOriginal!.unwrap().toUtc().toIso8601String();
} else {
if(this.dateTimeOriginal.isSome) {
if(this.dateTimeOriginal?.isNone ?? false) {
json[r'dateTimeOriginal'] = null;
}
}
if (this.description.unwrapOrNull() != null) {
if (this.description?.isSome ?? false) {
json[r'description'] = this.description;
} else {
if(this.description.isSome) {
if(this.description?.isNone ?? false) {
json[r'description'] = null;
}
}
if (this.exifImageHeight.unwrapOrNull() != null) {
if (this.exifImageHeight?.isSome ?? false) {
json[r'exifImageHeight'] = this.exifImageHeight;
} else {
if(this.exifImageHeight.isSome) {
if(this.exifImageHeight?.isNone ?? false) {
json[r'exifImageHeight'] = null;
}
}
if (this.exifImageWidth.unwrapOrNull() != null) {
if (this.exifImageWidth?.isSome ?? false) {
json[r'exifImageWidth'] = this.exifImageWidth;
} else {
if(this.exifImageWidth.isSome) {
if(this.exifImageWidth?.isNone ?? false) {
json[r'exifImageWidth'] = null;
}
}
if (this.exposureTime.unwrapOrNull() != null) {
if (this.exposureTime?.isSome ?? false) {
json[r'exposureTime'] = this.exposureTime;
} else {
if(this.exposureTime.isSome) {
if(this.exposureTime?.isNone ?? false) {
json[r'exposureTime'] = null;
}
}
if (this.fNumber.unwrapOrNull() != null) {
if (this.fNumber?.isSome ?? false) {
json[r'fNumber'] = this.fNumber;
} else {
if(this.fNumber.isSome) {
if(this.fNumber?.isNone ?? false) {
json[r'fNumber'] = null;
}
}
if (this.fileSizeInByte.unwrapOrNull() != null) {
if (this.fileSizeInByte?.isSome ?? false) {
json[r'fileSizeInByte'] = this.fileSizeInByte;
} else {
if(this.fileSizeInByte.isSome) {
if(this.fileSizeInByte?.isNone ?? false) {
json[r'fileSizeInByte'] = null;
}
}
if (this.focalLength.unwrapOrNull() != null) {
if (this.focalLength?.isSome ?? false) {
json[r'focalLength'] = this.focalLength;
} else {
if(this.focalLength.isSome) {
if(this.focalLength?.isNone ?? false) {
json[r'focalLength'] = null;
}
}
if (this.fps.unwrapOrNull() != null) {
if (this.fps?.isSome ?? false) {
json[r'fps'] = this.fps;
} else {
if(this.fps.isSome) {
if(this.fps?.isNone ?? false) {
json[r'fps'] = null;
}
}
if (this.iso.unwrapOrNull() != null) {
if (this.iso?.isSome ?? false) {
json[r'iso'] = this.iso;
} else {
if(this.iso.isSome) {
if(this.iso?.isNone ?? false) {
json[r'iso'] = null;
}
}
if (this.latitude.unwrapOrNull() != null) {
if (this.latitude?.isSome ?? false) {
json[r'latitude'] = this.latitude;
} else {
if(this.latitude.isSome) {
if(this.latitude?.isNone ?? false) {
json[r'latitude'] = null;
}
}
if (this.lensModel.unwrapOrNull() != null) {
if (this.lensModel?.isSome ?? false) {
json[r'lensModel'] = this.lensModel;
} else {
if(this.lensModel.isSome) {
if(this.lensModel?.isNone ?? false) {
json[r'lensModel'] = null;
}
}
if (this.longitude.unwrapOrNull() != null) {
if (this.longitude?.isSome ?? false) {
json[r'longitude'] = this.longitude;
} else {
if(this.longitude.isSome) {
if(this.longitude?.isNone ?? false) {
json[r'longitude'] = null;
}
}
if (this.make.unwrapOrNull() != null) {
if (this.make?.isSome ?? false) {
json[r'make'] = this.make;
} else {
if(this.make.isSome) {
if(this.make?.isNone ?? false) {
json[r'make'] = null;
}
}
if (this.model.unwrapOrNull() != null) {
if (this.model?.isSome ?? false) {
json[r'model'] = this.model;
} else {
if(this.model.isSome) {
if(this.model?.isNone ?? false) {
json[r'model'] = null;
}
}
if (this.modifyDate.unwrapOrNull() != null) {
json[r'modifyDate'] = this.modifyDate.unwrap().toUtc().toIso8601String();
if (this.modifyDate?.isSome ?? false) {
json[r'modifyDate'] = this.modifyDate!.unwrap().toUtc().toIso8601String();
} else {
if(this.modifyDate.isSome) {
if(this.modifyDate?.isNone ?? false) {
json[r'modifyDate'] = null;
}
}
if (this.orientation.unwrapOrNull() != null) {
if (this.orientation?.isSome ?? false) {
json[r'orientation'] = this.orientation;
} else {
if(this.orientation.isSome) {
if(this.orientation?.isNone ?? false) {
json[r'orientation'] = null;
}
}
if (this.profileDescription.unwrapOrNull() != null) {
if (this.profileDescription?.isSome ?? false) {
json[r'profileDescription'] = this.profileDescription;
} else {
if(this.profileDescription.isSome) {
if(this.profileDescription?.isNone ?? false) {
json[r'profileDescription'] = null;
}
}
if (this.projectionType.unwrapOrNull() != null) {
if (this.projectionType?.isSome ?? false) {
json[r'projectionType'] = this.projectionType;
} else {
if(this.projectionType.isSome) {
if(this.projectionType?.isNone ?? false) {
json[r'projectionType'] = null;
}
}
if (this.rating.unwrapOrNull() != null) {
if (this.rating?.isSome ?? false) {
json[r'rating'] = this.rating;
} else {
if(this.rating.isSome) {
if(this.rating?.isNone ?? false) {
json[r'rating'] = null;
}
}
if (this.state.unwrapOrNull() != null) {
if (this.state?.isSome ?? false) {
json[r'state'] = this.state;
} else {
if(this.state.isSome) {
if(this.state?.isNone ?? false) {
json[r'state'] = null;
}
}
if (this.timeZone.unwrapOrNull() != null) {
if (this.timeZone?.isSome ?? false) {
json[r'timeZone'] = this.timeZone;
} else {
if(this.timeZone.isSome) {
if(this.timeZone?.isNone ?? false) {
json[r'timeZone'] = null;
}
}

View File

@ -14,35 +14,35 @@ class SyncAssetV1 {
/// Returns a new [SyncAssetV1] instance.
SyncAssetV1({
required this.checksum,
this.deletedAt = const None(),
this.fileCreatedAt = const None(),
this.fileModifiedAt = const None(),
required this.deletedAt,
required this.fileCreatedAt,
required this.fileModifiedAt,
required this.id,
required this.isFavorite,
this.localDateTime = const None(),
required this.localDateTime,
required this.ownerId,
this.thumbhash = const None(),
required this.thumbhash,
required this.type,
required this.visibility,
});
String checksum;
Option<DateTime> deletedAt;
Option<DateTime>? deletedAt;
Option<DateTime> fileCreatedAt;
Option<DateTime>? fileCreatedAt;
Option<DateTime> fileModifiedAt;
Option<DateTime>? fileModifiedAt;
String id;
bool isFavorite;
Option<DateTime> localDateTime;
Option<DateTime>? localDateTime;
String ownerId;
Option<String> thumbhash;
Option<String>? thumbhash;
SyncAssetV1TypeEnum type;
@ -66,14 +66,14 @@ class SyncAssetV1 {
int get hashCode =>
// ignore: unnecessary_parenthesis
(checksum.hashCode) +
(deletedAt.hashCode) +
(fileCreatedAt.hashCode) +
(fileModifiedAt.hashCode) +
(deletedAt == null ? 0 : deletedAt!.hashCode) +
(fileCreatedAt == null ? 0 : fileCreatedAt!.hashCode) +
(fileModifiedAt == null ? 0 : fileModifiedAt!.hashCode) +
(id.hashCode) +
(isFavorite.hashCode) +
(localDateTime.hashCode) +
(localDateTime == null ? 0 : localDateTime!.hashCode) +
(ownerId.hashCode) +
(thumbhash.hashCode) +
(thumbhash == null ? 0 : thumbhash!.hashCode) +
(type.hashCode) +
(visibility.hashCode);
@ -83,41 +83,41 @@ class SyncAssetV1 {
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'checksum'] = this.checksum;
if (this.deletedAt.unwrapOrNull() != null) {
json[r'deletedAt'] = this.deletedAt.unwrap().toUtc().toIso8601String();
if (this.deletedAt?.isSome ?? false) {
json[r'deletedAt'] = this.deletedAt!.unwrap().toUtc().toIso8601String();
} else {
if(this.deletedAt.isSome) {
if(this.deletedAt?.isNone ?? false) {
json[r'deletedAt'] = null;
}
}
if (this.fileCreatedAt.unwrapOrNull() != null) {
json[r'fileCreatedAt'] = this.fileCreatedAt.unwrap().toUtc().toIso8601String();
if (this.fileCreatedAt?.isSome ?? false) {
json[r'fileCreatedAt'] = this.fileCreatedAt!.unwrap().toUtc().toIso8601String();
} else {
if(this.fileCreatedAt.isSome) {
if(this.fileCreatedAt?.isNone ?? false) {
json[r'fileCreatedAt'] = null;
}
}
if (this.fileModifiedAt.unwrapOrNull() != null) {
json[r'fileModifiedAt'] = this.fileModifiedAt.unwrap().toUtc().toIso8601String();
if (this.fileModifiedAt?.isSome ?? false) {
json[r'fileModifiedAt'] = this.fileModifiedAt!.unwrap().toUtc().toIso8601String();
} else {
if(this.fileModifiedAt.isSome) {
if(this.fileModifiedAt?.isNone ?? false) {
json[r'fileModifiedAt'] = null;
}
}
json[r'id'] = this.id;
json[r'isFavorite'] = this.isFavorite;
if (this.localDateTime.unwrapOrNull() != null) {
json[r'localDateTime'] = this.localDateTime.unwrap().toUtc().toIso8601String();
if (this.localDateTime?.isSome ?? false) {
json[r'localDateTime'] = this.localDateTime!.unwrap().toUtc().toIso8601String();
} else {
if(this.localDateTime.isSome) {
if(this.localDateTime?.isNone ?? false) {
json[r'localDateTime'] = null;
}
}
json[r'ownerId'] = this.ownerId;
if (this.thumbhash.unwrapOrNull() != null) {
if (this.thumbhash?.isSome ?? false) {
json[r'thumbhash'] = this.thumbhash;
} else {
if(this.thumbhash.isSome) {
if(this.thumbhash?.isNone ?? false) {
json[r'thumbhash'] = null;
}
}

View File

@ -13,13 +13,13 @@ part of openapi.api;
class SyncUserV1 {
/// Returns a new [SyncUserV1] instance.
SyncUserV1({
this.deletedAt = const None(),
required this.deletedAt,
required this.email,
required this.id,
required this.name,
});
Option<DateTime> deletedAt;
Option<DateTime>? deletedAt;
String email;
@ -37,7 +37,7 @@ class SyncUserV1 {
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(deletedAt.hashCode) +
(deletedAt == null ? 0 : deletedAt!.hashCode) +
(email.hashCode) +
(id.hashCode) +
(name.hashCode);
@ -47,10 +47,10 @@ class SyncUserV1 {
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.deletedAt.unwrapOrNull() != null) {
json[r'deletedAt'] = this.deletedAt.unwrap().toUtc().toIso8601String();
if (this.deletedAt?.isSome ?? false) {
json[r'deletedAt'] = this.deletedAt!.unwrap().toUtc().toIso8601String();
} else {
if(this.deletedAt.isSome) {
if(this.deletedAt?.isNone ?? false) {
json[r'deletedAt'] = null;
}
}

View File

@ -15,7 +15,7 @@ class TagCreateDto {
TagCreateDto({
this.color,
required this.name,
this.parentId = const None(),
this.parentId,
});
///
@ -28,7 +28,7 @@ class TagCreateDto {
String name;
Option<String> parentId;
Option<String>? parentId;
@override
bool operator ==(Object other) => identical(this, other) || other is TagCreateDto &&
@ -41,7 +41,7 @@ class TagCreateDto {
// ignore: unnecessary_parenthesis
(color == null ? 0 : color!.hashCode) +
(name.hashCode) +
(parentId.hashCode);
(parentId == null ? 0 : parentId!.hashCode);
@override
String toString() => 'TagCreateDto[color=$color, name=$name, parentId=$parentId]';
@ -54,10 +54,10 @@ class TagCreateDto {
// json[r'color'] = null;
}
json[r'name'] = this.name;
if (this.parentId.unwrapOrNull() != null) {
if (this.parentId?.isSome ?? false) {
json[r'parentId'] = this.parentId;
} else {
if(this.parentId.isSome) {
if(this.parentId?.isNone ?? false) {
json[r'parentId'] = null;
}
}

View File

@ -13,10 +13,10 @@ part of openapi.api;
class TagUpdateDto {
/// Returns a new [TagUpdateDto] instance.
TagUpdateDto({
this.color = const None(),
this.color,
});
Option<String> color;
Option<String>? color;
@override
bool operator ==(Object other) => identical(this, other) || other is TagUpdateDto &&
@ -25,17 +25,17 @@ class TagUpdateDto {
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(color.hashCode);
(color == null ? 0 : color!.hashCode);
@override
String toString() => 'TagUpdateDto[color=$color]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.color.unwrapOrNull() != null) {
if (this.color?.isSome ?? false) {
json[r'color'] = this.color;
} else {
if(this.color.isSome) {
if(this.color?.isNone ?? false) {
json[r'color'] = null;
}
}

View File

@ -17,7 +17,7 @@ class UpdateAssetDto {
this.description,
this.isFavorite,
this.latitude,
this.livePhotoVideoId = const None(),
this.livePhotoVideoId,
this.longitude,
this.rating,
this.visibility,
@ -55,7 +55,7 @@ class UpdateAssetDto {
///
num? latitude;
Option<String> livePhotoVideoId;
Option<String>? livePhotoVideoId;
///
/// Please note: This property should have been non-nullable! Since the specification file
@ -101,7 +101,7 @@ class UpdateAssetDto {
(description == null ? 0 : description!.hashCode) +
(isFavorite == null ? 0 : isFavorite!.hashCode) +
(latitude == null ? 0 : latitude!.hashCode) +
(livePhotoVideoId.hashCode) +
(livePhotoVideoId == null ? 0 : livePhotoVideoId!.hashCode) +
(longitude == null ? 0 : longitude!.hashCode) +
(rating == null ? 0 : rating!.hashCode) +
(visibility == null ? 0 : visibility!.hashCode);
@ -131,10 +131,10 @@ class UpdateAssetDto {
} else {
// json[r'latitude'] = null;
}
if (this.livePhotoVideoId.unwrapOrNull() != null) {
if (this.livePhotoVideoId?.isSome ?? false) {
json[r'livePhotoVideoId'] = this.livePhotoVideoId;
} else {
if(this.livePhotoVideoId.isSome) {
if(this.livePhotoVideoId?.isNone ?? false) {
json[r'livePhotoVideoId'] = null;
}
}

View File

@ -14,7 +14,7 @@ class UsageByUserDto {
/// Returns a new [UsageByUserDto] instance.
UsageByUserDto({
required this.photos,
this.quotaSizeInBytes = const None(),
required this.quotaSizeInBytes,
required this.usage,
required this.usagePhotos,
required this.usageVideos,
@ -25,7 +25,7 @@ class UsageByUserDto {
int photos;
Option<int> quotaSizeInBytes;
Option<int>? quotaSizeInBytes;
int usage;
@ -54,7 +54,7 @@ class UsageByUserDto {
int get hashCode =>
// ignore: unnecessary_parenthesis
(photos.hashCode) +
(quotaSizeInBytes.hashCode) +
(quotaSizeInBytes == null ? 0 : quotaSizeInBytes!.hashCode) +
(usage.hashCode) +
(usagePhotos.hashCode) +
(usageVideos.hashCode) +
@ -68,10 +68,10 @@ class UsageByUserDto {
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'photos'] = this.photos;
if (this.quotaSizeInBytes.unwrapOrNull() != null) {
if (this.quotaSizeInBytes?.isSome ?? false) {
json[r'quotaSizeInBytes'] = this.quotaSizeInBytes;
} else {
if(this.quotaSizeInBytes.isSome) {
if(this.quotaSizeInBytes?.isNone ?? false) {
json[r'quotaSizeInBytes'] = null;
}
}

View File

@ -13,17 +13,17 @@ part of openapi.api;
class UserAdminCreateDto {
/// Returns a new [UserAdminCreateDto] instance.
UserAdminCreateDto({
this.avatarColor = const None(),
this.avatarColor,
required this.email,
required this.name,
this.notify,
required this.password,
this.quotaSizeInBytes = const None(),
this.quotaSizeInBytes,
this.shouldChangePassword,
this.storageLabel = const None(),
this.storageLabel,
});
Option<UserAvatarColor> avatarColor;
Option<UserAvatarColor>? avatarColor;
String email;
@ -40,7 +40,7 @@ class UserAdminCreateDto {
String password;
/// Minimum value: 0
Option<int> quotaSizeInBytes;
Option<int>? quotaSizeInBytes;
///
/// Please note: This property should have been non-nullable! Since the specification file
@ -50,7 +50,7 @@ class UserAdminCreateDto {
///
bool? shouldChangePassword;
Option<String> storageLabel;
Option<String>? storageLabel;
@override
bool operator ==(Object other) => identical(this, other) || other is UserAdminCreateDto &&
@ -66,24 +66,24 @@ class UserAdminCreateDto {
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(avatarColor.hashCode) +
(avatarColor == null ? 0 : avatarColor!.hashCode) +
(email.hashCode) +
(name.hashCode) +
(notify == null ? 0 : notify!.hashCode) +
(password.hashCode) +
(quotaSizeInBytes.hashCode) +
(quotaSizeInBytes == null ? 0 : quotaSizeInBytes!.hashCode) +
(shouldChangePassword == null ? 0 : shouldChangePassword!.hashCode) +
(storageLabel.hashCode);
(storageLabel == null ? 0 : storageLabel!.hashCode);
@override
String toString() => 'UserAdminCreateDto[avatarColor=$avatarColor, email=$email, name=$name, notify=$notify, password=$password, quotaSizeInBytes=$quotaSizeInBytes, shouldChangePassword=$shouldChangePassword, storageLabel=$storageLabel]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.avatarColor.unwrapOrNull() != null) {
if (this.avatarColor?.isSome ?? false) {
json[r'avatarColor'] = this.avatarColor;
} else {
if(this.avatarColor.isSome) {
if(this.avatarColor?.isNone ?? false) {
json[r'avatarColor'] = null;
}
}
@ -95,10 +95,10 @@ class UserAdminCreateDto {
// json[r'notify'] = null;
}
json[r'password'] = this.password;
if (this.quotaSizeInBytes.unwrapOrNull() != null) {
if (this.quotaSizeInBytes?.isSome ?? false) {
json[r'quotaSizeInBytes'] = this.quotaSizeInBytes;
} else {
if(this.quotaSizeInBytes.isSome) {
if(this.quotaSizeInBytes?.isNone ?? false) {
json[r'quotaSizeInBytes'] = null;
}
}
@ -107,10 +107,10 @@ class UserAdminCreateDto {
} else {
// json[r'shouldChangePassword'] = null;
}
if (this.storageLabel.unwrapOrNull() != null) {
if (this.storageLabel?.isSome ?? false) {
json[r'storageLabel'] = this.storageLabel;
} else {
if(this.storageLabel.isSome) {
if(this.storageLabel?.isNone ?? false) {
json[r'storageLabel'] = null;
}
}

View File

@ -15,20 +15,20 @@ class UserAdminResponseDto {
UserAdminResponseDto({
required this.avatarColor,
required this.createdAt,
this.deletedAt = const None(),
required this.deletedAt,
required this.email,
required this.id,
required this.isAdmin,
this.license = const None(),
required this.license,
required this.name,
required this.oauthId,
required this.profileChangedAt,
required this.profileImagePath,
this.quotaSizeInBytes = const None(),
this.quotaUsageInBytes = const None(),
required this.quotaSizeInBytes,
required this.quotaUsageInBytes,
required this.shouldChangePassword,
required this.status,
this.storageLabel = const None(),
required this.storageLabel,
required this.updatedAt,
});
@ -36,7 +36,7 @@ class UserAdminResponseDto {
DateTime createdAt;
Option<DateTime> deletedAt;
Option<DateTime>? deletedAt;
String email;
@ -44,7 +44,7 @@ class UserAdminResponseDto {
bool isAdmin;
Option<UserLicense> license;
Option<UserLicense>? license;
String name;
@ -54,15 +54,15 @@ class UserAdminResponseDto {
String profileImagePath;
Option<int> quotaSizeInBytes;
Option<int>? quotaSizeInBytes;
Option<int> quotaUsageInBytes;
Option<int>? quotaUsageInBytes;
bool shouldChangePassword;
UserStatus status;
Option<String> storageLabel;
Option<String>? storageLabel;
DateTime updatedAt;
@ -91,20 +91,20 @@ class UserAdminResponseDto {
// ignore: unnecessary_parenthesis
(avatarColor.hashCode) +
(createdAt.hashCode) +
(deletedAt.hashCode) +
(deletedAt == null ? 0 : deletedAt!.hashCode) +
(email.hashCode) +
(id.hashCode) +
(isAdmin.hashCode) +
(license.hashCode) +
(license == null ? 0 : license!.hashCode) +
(name.hashCode) +
(oauthId.hashCode) +
(profileChangedAt.hashCode) +
(profileImagePath.hashCode) +
(quotaSizeInBytes.hashCode) +
(quotaUsageInBytes.hashCode) +
(quotaSizeInBytes == null ? 0 : quotaSizeInBytes!.hashCode) +
(quotaUsageInBytes == null ? 0 : quotaUsageInBytes!.hashCode) +
(shouldChangePassword.hashCode) +
(status.hashCode) +
(storageLabel.hashCode) +
(storageLabel == null ? 0 : storageLabel!.hashCode) +
(updatedAt.hashCode);
@override
@ -114,20 +114,20 @@ class UserAdminResponseDto {
final json = <String, dynamic>{};
json[r'avatarColor'] = this.avatarColor;
json[r'createdAt'] = this.createdAt.toUtc().toIso8601String();
if (this.deletedAt.unwrapOrNull() != null) {
json[r'deletedAt'] = this.deletedAt.unwrap().toUtc().toIso8601String();
if (this.deletedAt?.isSome ?? false) {
json[r'deletedAt'] = this.deletedAt!.unwrap().toUtc().toIso8601String();
} else {
if(this.deletedAt.isSome) {
if(this.deletedAt?.isNone ?? false) {
json[r'deletedAt'] = null;
}
}
json[r'email'] = this.email;
json[r'id'] = this.id;
json[r'isAdmin'] = this.isAdmin;
if (this.license.unwrapOrNull() != null) {
if (this.license?.isSome ?? false) {
json[r'license'] = this.license;
} else {
if(this.license.isSome) {
if(this.license?.isNone ?? false) {
json[r'license'] = null;
}
}
@ -135,26 +135,26 @@ class UserAdminResponseDto {
json[r'oauthId'] = this.oauthId;
json[r'profileChangedAt'] = this.profileChangedAt.toUtc().toIso8601String();
json[r'profileImagePath'] = this.profileImagePath;
if (this.quotaSizeInBytes.unwrapOrNull() != null) {
if (this.quotaSizeInBytes?.isSome ?? false) {
json[r'quotaSizeInBytes'] = this.quotaSizeInBytes;
} else {
if(this.quotaSizeInBytes.isSome) {
if(this.quotaSizeInBytes?.isNone ?? false) {
json[r'quotaSizeInBytes'] = null;
}
}
if (this.quotaUsageInBytes.unwrapOrNull() != null) {
if (this.quotaUsageInBytes?.isSome ?? false) {
json[r'quotaUsageInBytes'] = this.quotaUsageInBytes;
} else {
if(this.quotaUsageInBytes.isSome) {
if(this.quotaUsageInBytes?.isNone ?? false) {
json[r'quotaUsageInBytes'] = null;
}
}
json[r'shouldChangePassword'] = this.shouldChangePassword;
json[r'status'] = this.status;
if (this.storageLabel.unwrapOrNull() != null) {
if (this.storageLabel?.isSome ?? false) {
json[r'storageLabel'] = this.storageLabel;
} else {
if(this.storageLabel.isSome) {
if(this.storageLabel?.isNone ?? false) {
json[r'storageLabel'] = null;
}
}

View File

@ -13,17 +13,17 @@ part of openapi.api;
class UserAdminUpdateDto {
/// Returns a new [UserAdminUpdateDto] instance.
UserAdminUpdateDto({
this.avatarColor = const None(),
this.avatarColor,
this.email,
this.name,
this.password,
this.pinCode = const None(),
this.quotaSizeInBytes = const None(),
this.pinCode,
this.quotaSizeInBytes,
this.shouldChangePassword,
this.storageLabel = const None(),
this.storageLabel,
});
Option<UserAvatarColor> avatarColor;
Option<UserAvatarColor>? avatarColor;
///
/// Please note: This property should have been non-nullable! Since the specification file
@ -49,10 +49,10 @@ class UserAdminUpdateDto {
///
String? password;
Option<String> pinCode;
Option<String>? pinCode;
/// Minimum value: 0
Option<int> quotaSizeInBytes;
Option<int>? quotaSizeInBytes;
///
/// Please note: This property should have been non-nullable! Since the specification file
@ -62,7 +62,7 @@ class UserAdminUpdateDto {
///
bool? shouldChangePassword;
Option<String> storageLabel;
Option<String>? storageLabel;
@override
bool operator ==(Object other) => identical(this, other) || other is UserAdminUpdateDto &&
@ -78,24 +78,24 @@ class UserAdminUpdateDto {
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(avatarColor.hashCode) +
(avatarColor == null ? 0 : avatarColor!.hashCode) +
(email == null ? 0 : email!.hashCode) +
(name == null ? 0 : name!.hashCode) +
(password == null ? 0 : password!.hashCode) +
(pinCode.hashCode) +
(quotaSizeInBytes.hashCode) +
(pinCode == null ? 0 : pinCode!.hashCode) +
(quotaSizeInBytes == null ? 0 : quotaSizeInBytes!.hashCode) +
(shouldChangePassword == null ? 0 : shouldChangePassword!.hashCode) +
(storageLabel.hashCode);
(storageLabel == null ? 0 : storageLabel!.hashCode);
@override
String toString() => 'UserAdminUpdateDto[avatarColor=$avatarColor, email=$email, name=$name, password=$password, pinCode=$pinCode, quotaSizeInBytes=$quotaSizeInBytes, shouldChangePassword=$shouldChangePassword, storageLabel=$storageLabel]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.avatarColor.unwrapOrNull() != null) {
if (this.avatarColor?.isSome ?? false) {
json[r'avatarColor'] = this.avatarColor;
} else {
if(this.avatarColor.isSome) {
if(this.avatarColor?.isNone ?? false) {
json[r'avatarColor'] = null;
}
}
@ -114,17 +114,17 @@ class UserAdminUpdateDto {
} else {
// json[r'password'] = null;
}
if (this.pinCode.unwrapOrNull() != null) {
if (this.pinCode?.isSome ?? false) {
json[r'pinCode'] = this.pinCode;
} else {
if(this.pinCode.isSome) {
if(this.pinCode?.isNone ?? false) {
json[r'pinCode'] = null;
}
}
if (this.quotaSizeInBytes.unwrapOrNull() != null) {
if (this.quotaSizeInBytes?.isSome ?? false) {
json[r'quotaSizeInBytes'] = this.quotaSizeInBytes;
} else {
if(this.quotaSizeInBytes.isSome) {
if(this.quotaSizeInBytes?.isNone ?? false) {
json[r'quotaSizeInBytes'] = null;
}
}
@ -133,10 +133,10 @@ class UserAdminUpdateDto {
} else {
// json[r'shouldChangePassword'] = null;
}
if (this.storageLabel.unwrapOrNull() != null) {
if (this.storageLabel?.isSome ?? false) {
json[r'storageLabel'] = this.storageLabel;
} else {
if(this.storageLabel.isSome) {
if(this.storageLabel?.isNone ?? false) {
json[r'storageLabel'] = null;
}
}

View File

@ -13,13 +13,13 @@ part of openapi.api;
class UserUpdateMeDto {
/// Returns a new [UserUpdateMeDto] instance.
UserUpdateMeDto({
this.avatarColor = const None(),
this.avatarColor,
this.email,
this.name,
this.password,
});
Option<UserAvatarColor> avatarColor;
Option<UserAvatarColor>? avatarColor;
///
/// Please note: This property should have been non-nullable! Since the specification file
@ -55,7 +55,7 @@ class UserUpdateMeDto {
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(avatarColor.hashCode) +
(avatarColor == null ? 0 : avatarColor!.hashCode) +
(email == null ? 0 : email!.hashCode) +
(name == null ? 0 : name!.hashCode) +
(password == null ? 0 : password!.hashCode);
@ -65,10 +65,10 @@ class UserUpdateMeDto {
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.avatarColor.unwrapOrNull() != null) {
if (this.avatarColor?.isSome ?? false) {
json[r'avatarColor'] = this.avatarColor;
} else {
if(this.avatarColor.isSome) {
if(this.avatarColor?.isNone ?? false) {
json[r'avatarColor'] = null;
}
}

View File

@ -13,9 +13,6 @@ function dart {
wget -O api.mustache https://raw.githubusercontent.com/OpenAPITools/openapi-generator/$OPENAPI_GENERATOR_VERSION/modules/openapi-generator/src/main/resources/dart2/api.mustache
patch --no-backup-if-mismatch -u api.mustache <api.mustache.patch
wget -O dart_constructor.mustache https://raw.githubusercontent.com/OpenAPITools/openapi-generator/$OPENAPI_GENERATOR_VERSION/modules/openapi-generator/src/main/resources/dart2/dart_constructor.mustache
patch --no-backup-if-mismatch -u dart_constructor.mustache <dart_constructor.mustache.patch
cd ../../
npx --yes @openapitools/openapi-generator-cli generate -g dart -i ./immich-openapi-specs.json -o ../mobile/openapi -t ./templates/mobile

View File

@ -1,10 +0,0 @@
/// Returns a new [{{{classname}}}] instance.
{{{classname}}}({
{{#vars}}
{{!
A field is required in Dart when it is
required && !defaultValue in OAS
}}
{{^isNullable}}{{#required}}{{^defaultValue}}required {{/defaultValue}}{{/required}}{{/isNullable}}this.{{{name}}}{{#isNullable}} = const None(){{/isNullable}}{{^isNullable}}{{#defaultValue}} = {{#isEnum}}{{^isContainer}}const {{{enumName}}}._({{/isContainer}}{{/isEnum}}{{{.}}}{{#isEnum}}{{^isContainer}}){{/isContainer}}{{/isEnum}}{{/defaultValue}}{{/isNullable}},
{{/vars}}
});

View File

@ -1,12 +0,0 @@
diff --git a/dart_constructor.mustache b/dart_constructor.mustache
index dc5dfec..4993ab9 100644
--- a/dart_constructor.mustache
+++ b/dart_constructor.mustache
@@ -5,6 +5,6 @@
A field is required in Dart when it is
required && !defaultValue in OAS
}}
- {{#required}}{{^defaultValue}}required {{/defaultValue}}{{/required}}this.{{{name}}}{{#defaultValue}} = {{#isEnum}}{{^isContainer}}const {{{enumName}}}._({{/isContainer}}{{/isEnum}}{{{.}}}{{#isEnum}}{{^isContainer}}){{/isContainer}}{{/isEnum}}{{/defaultValue}},
+ {{^isNullable}}{{#required}}{{^defaultValue}}required {{/defaultValue}}{{/required}}{{/isNullable}}this.{{{name}}}{{#isNullable}} = const None(){{/isNullable}}{{^isNullable}}{{#defaultValue}} = {{#isEnum}}{{^isContainer}}const {{{enumName}}}._({{/isContainer}}{{/isEnum}}{{{.}}}{{#isEnum}}{{^isContainer}}){{/isContainer}}{{/isEnum}}{{/defaultValue}}{{/isNullable}},
{{/vars}}
});

View File

@ -32,7 +32,7 @@ class {{{classname}}} {
{{/required}}
{{/isNullable}}
{{/isEnum}}
{{#isNullable}}Option<{{/isNullable}}{{{datatypeWithEnum}}}{{#isNullable}}>{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}?{{/defaultValue}}{{/required}}{{/isNullable}} {{{name}}};
{{#isNullable}}Option<{{/isNullable}}{{{datatypeWithEnum}}}{{#isNullable}}>?{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}?{{/defaultValue}}{{/required}}{{/isNullable}} {{{name}}};
{{/vars}}
@override
@ -45,7 +45,7 @@ class {{{classname}}} {
int get hashCode =>
// ignore: unnecessary_parenthesis
{{#vars}}
({{^isNullable}}{{^required}}{{^defaultValue}}{{{name}}} == null ? 0 : {{/defaultValue}}{{/required}}{{/isNullable}}{{{name}}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.hashCode){{^-last}} +{{/-last}}{{#-last}};{{/-last}}
({{#isNullable}}{{{name}}} == null ? 0 : {{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}{{{name}}} == null ? 0 : {{/defaultValue}}{{/required}}{{/isNullable}}{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.hashCode){{^-last}} +{{/-last}}{{#-last}};{{/-last}}
{{/vars}}
@override
@ -55,7 +55,7 @@ class {{{classname}}} {
final json = <String, dynamic>{};
{{#vars}}
{{#isNullable}}
if (this.{{{name}}}.unwrapOrNull() != null) {
if (this.{{{name}}}?.isSome ?? false) {
{{/isNullable}}
{{^isNullable}}
{{^required}}
@ -67,31 +67,31 @@ class {{{classname}}} {
{{#isDateTime}}
{{#pattern}}
json[r'{{{baseName}}}'] = _isEpochMarker(r'{{{pattern}}}')
? this.{{{name}}}{{#isNullable}}.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.millisecondsSinceEpoch
: this.{{{name}}}{{#isNullable}}.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc().toIso8601String();
? this.{{{name}}}{{#isNullable}}!.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.millisecondsSinceEpoch
: this.{{{name}}}{{#isNullable}}!.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc().toIso8601String();
{{/pattern}}
{{^pattern}}
json[r'{{{baseName}}}'] = this.{{{name}}}{{#isNullable}}.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc().toIso8601String();
json[r'{{{baseName}}}'] = this.{{{name}}}{{#isNullable}}!.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc().toIso8601String();
{{/pattern}}
{{/isDateTime}}
{{#isDate}}
{{#pattern}}
json[r'{{{baseName}}}'] = _isEpochMarker(r'{{{pattern}}}')
? this.{{{name}}}{{#isNullable}}.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.millisecondsSinceEpoch
: _dateFormatter.format(this.{{{name}}}{{#isNullable}}.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc());
? this.{{{name}}}{{#isNullable}}!.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.millisecondsSinceEpoch
: _dateFormatter.format(this.{{{name}}}{{#isNullable}}!.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc());
{{/pattern}}
{{^pattern}}
json[r'{{{baseName}}}'] = _dateFormatter.format(this.{{{name}}}{{#isNullable}}.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc());
json[r'{{{baseName}}}'] = _dateFormatter.format(this.{{{name}}}{{#isNullable}}!.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc());
{{/pattern}}
{{/isDate}}
{{^isDateTime}}
{{^isDate}}
json[r'{{{baseName}}}'] = this.{{{name}}}{{#isArray}}{{#uniqueItems}}{{#isNullable}}.unwrap(){{/isNullable}}.toList(growable: false){{/uniqueItems}}{{/isArray}};
json[r'{{{baseName}}}'] = this.{{{name}}}{{#isArray}}{{#uniqueItems}}{{#isNullable}}!.unwrap(){{/isNullable}}.toList(growable: false){{/uniqueItems}}{{/isArray}};
{{/isDate}}
{{/isDateTime}}
{{#isNullable}}
} else {
if(this.{{{name}}}.isSome) {
if(this.{{{name}}}?.isNone ?? false) {
json[r'{{{baseName}}}'] = null;
}
}

View File

@ -1,5 +1,5 @@
diff --git a/native_class.mustache b/native_class.mustache
index 3a6c457..e321056 100644
index 3a6c457..b1c8c5b 100644
--- a/native_class.mustache
+++ b/native_class.mustache
@@ -32,7 +32,7 @@ class {{{classname}}} {
@ -7,25 +7,16 @@ index 3a6c457..e321056 100644
{{/isNullable}}
{{/isEnum}}
- {{{datatypeWithEnum}}}{{#isNullable}}?{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}?{{/defaultValue}}{{/required}}{{/isNullable}} {{{name}}};
+ {{#isNullable}}Option<{{/isNullable}}{{{datatypeWithEnum}}}{{#isNullable}}>{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}?{{/defaultValue}}{{/required}}{{/isNullable}} {{{name}}};
+ {{#isNullable}}Option<{{/isNullable}}{{{datatypeWithEnum}}}{{#isNullable}}>?{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}?{{/defaultValue}}{{/required}}{{/isNullable}} {{{name}}};
{{/vars}}
@override
@@ -45,7 +45,7 @@ class {{{classname}}} {
int get hashCode =>
// ignore: unnecessary_parenthesis
{{#vars}}
- ({{#isNullable}}{{{name}}} == null ? 0 : {{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}{{{name}}} == null ? 0 : {{/defaultValue}}{{/required}}{{/isNullable}}{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.hashCode){{^-last}} +{{/-last}}{{#-last}};{{/-last}}
+ ({{^isNullable}}{{^required}}{{^defaultValue}}{{{name}}} == null ? 0 : {{/defaultValue}}{{/required}}{{/isNullable}}{{{name}}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.hashCode){{^-last}} +{{/-last}}{{#-last}};{{/-last}}
{{/vars}}
@override
@@ -55,7 +55,7 @@ class {{{classname}}} {
final json = <String, dynamic>{};
{{#vars}}
{{#isNullable}}
- if (this.{{{name}}} != null) {
+ if (this.{{{name}}}.unwrapOrNull() != null) {
+ if (this.{{{name}}}?.isSome ?? false) {
{{/isNullable}}
{{^isNullable}}
{{^required}}
@ -35,12 +26,12 @@ index 3a6c457..e321056 100644
json[r'{{{baseName}}}'] = _isEpochMarker(r'{{{pattern}}}')
- ? this.{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.millisecondsSinceEpoch
- : this.{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc().toIso8601String();
+ ? this.{{{name}}}{{#isNullable}}.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.millisecondsSinceEpoch
+ : this.{{{name}}}{{#isNullable}}.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc().toIso8601String();
+ ? this.{{{name}}}{{#isNullable}}!.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.millisecondsSinceEpoch
+ : this.{{{name}}}{{#isNullable}}!.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc().toIso8601String();
{{/pattern}}
{{^pattern}}
- json[r'{{{baseName}}}'] = this.{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc().toIso8601String();
+ json[r'{{{baseName}}}'] = this.{{{name}}}{{#isNullable}}.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc().toIso8601String();
+ json[r'{{{baseName}}}'] = this.{{{name}}}{{#isNullable}}!.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc().toIso8601String();
{{/pattern}}
{{/isDateTime}}
{{#isDate}}
@ -48,24 +39,24 @@ index 3a6c457..e321056 100644
json[r'{{{baseName}}}'] = _isEpochMarker(r'{{{pattern}}}')
- ? this.{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.millisecondsSinceEpoch
- : _dateFormatter.format(this.{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc());
+ ? this.{{{name}}}{{#isNullable}}.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.millisecondsSinceEpoch
+ : _dateFormatter.format(this.{{{name}}}{{#isNullable}}.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc());
+ ? this.{{{name}}}{{#isNullable}}!.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.millisecondsSinceEpoch
+ : _dateFormatter.format(this.{{{name}}}{{#isNullable}}!.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc());
{{/pattern}}
{{^pattern}}
- json[r'{{{baseName}}}'] = _dateFormatter.format(this.{{{name}}}{{#isNullable}}!{{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc());
+ json[r'{{{baseName}}}'] = _dateFormatter.format(this.{{{name}}}{{#isNullable}}.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc());
+ json[r'{{{baseName}}}'] = _dateFormatter.format(this.{{{name}}}{{#isNullable}}!.unwrap(){{/isNullable}}{{^isNullable}}{{^required}}{{^defaultValue}}!{{/defaultValue}}{{/required}}{{/isNullable}}.toUtc());
{{/pattern}}
{{/isDate}}
{{^isDateTime}}
{{^isDate}}
- json[r'{{{baseName}}}'] = this.{{{name}}}{{#isArray}}{{#uniqueItems}}{{#isNullable}}!{{/isNullable}}.toList(growable: false){{/uniqueItems}}{{/isArray}};
+ json[r'{{{baseName}}}'] = this.{{{name}}}{{#isArray}}{{#uniqueItems}}{{#isNullable}}.unwrap(){{/isNullable}}.toList(growable: false){{/uniqueItems}}{{/isArray}};
+ json[r'{{{baseName}}}'] = this.{{{name}}}{{#isArray}}{{#uniqueItems}}{{#isNullable}}!.unwrap(){{/isNullable}}.toList(growable: false){{/uniqueItems}}{{/isArray}};
{{/isDate}}
{{/isDateTime}}
{{#isNullable}}
} else {
- json[r'{{{baseName}}}'] = null;
+ if(this.{{{name}}}.isSome) {
+ if(this.{{{name}}}?.isNone ?? false) {
+ json[r'{{{baseName}}}'] = null;
+ }
}