diff --git a/mobile/openapi/lib/model/asset_response_dto.dart b/mobile/openapi/lib/model/asset_response_dto.dart index e6b728566d..013ac00ff4 100644 --- a/mobile/openapi/lib/model/asset_response_dto.dart +++ b/mobile/openapi/lib/model/asset_response_dto.dart @@ -85,79 +85,76 @@ class AssetResponseDto { List tags; @override - bool operator ==(Object other) => - identical(this, other) || - other is AssetResponseDto && - other.type == type && - other.id == id && - other.deviceAssetId == deviceAssetId && - other.ownerId == ownerId && - other.deviceId == deviceId && - other.originalPath == originalPath && - other.resizePath == resizePath && - other.fileCreatedAt == fileCreatedAt && - other.fileModifiedAt == fileModifiedAt && - other.updatedAt == updatedAt && - other.isFavorite == isFavorite && - other.mimeType == mimeType && - other.duration == duration && - other.webpPath == webpPath && - other.encodedVideoPath == encodedVideoPath && - other.exifInfo == exifInfo && - other.smartInfo == smartInfo && - other.livePhotoVideoId == livePhotoVideoId && - other.tags == tags; + bool operator ==(Object other) => identical(this, other) || other is AssetResponseDto && + other.type == type && + other.id == id && + other.deviceAssetId == deviceAssetId && + other.ownerId == ownerId && + other.deviceId == deviceId && + other.originalPath == originalPath && + other.resizePath == resizePath && + other.fileCreatedAt == fileCreatedAt && + other.fileModifiedAt == fileModifiedAt && + other.updatedAt == updatedAt && + other.isFavorite == isFavorite && + other.mimeType == mimeType && + other.duration == duration && + other.webpPath == webpPath && + other.encodedVideoPath == encodedVideoPath && + other.exifInfo == exifInfo && + other.smartInfo == smartInfo && + other.livePhotoVideoId == livePhotoVideoId && + other.tags == tags; @override int get hashCode => - // ignore: unnecessary_parenthesis - (type.hashCode) + - (id.hashCode) + - (deviceAssetId.hashCode) + - (ownerId.hashCode) + - (deviceId.hashCode) + - (originalPath.hashCode) + - (resizePath == null ? 0 : resizePath!.hashCode) + - (fileCreatedAt.hashCode) + - (fileModifiedAt.hashCode) + - (updatedAt.hashCode) + - (isFavorite.hashCode) + - (mimeType == null ? 0 : mimeType!.hashCode) + - (duration.hashCode) + - (webpPath == null ? 0 : webpPath!.hashCode) + - (encodedVideoPath == null ? 0 : encodedVideoPath!.hashCode) + - (exifInfo == null ? 0 : exifInfo!.hashCode) + - (smartInfo == null ? 0 : smartInfo!.hashCode) + - (livePhotoVideoId == null ? 0 : livePhotoVideoId!.hashCode) + - (tags.hashCode); + // ignore: unnecessary_parenthesis + (type.hashCode) + + (id.hashCode) + + (deviceAssetId.hashCode) + + (ownerId.hashCode) + + (deviceId.hashCode) + + (originalPath.hashCode) + + (resizePath == null ? 0 : resizePath!.hashCode) + + (fileCreatedAt.hashCode) + + (fileModifiedAt.hashCode) + + (updatedAt.hashCode) + + (isFavorite.hashCode) + + (mimeType == null ? 0 : mimeType!.hashCode) + + (duration.hashCode) + + (webpPath == null ? 0 : webpPath!.hashCode) + + (encodedVideoPath == null ? 0 : encodedVideoPath!.hashCode) + + (exifInfo == null ? 0 : exifInfo!.hashCode) + + (smartInfo == null ? 0 : smartInfo!.hashCode) + + (livePhotoVideoId == null ? 0 : livePhotoVideoId!.hashCode) + + (tags.hashCode); @override - String toString() => - 'AssetResponseDto[type=$type, id=$id, deviceAssetId=$deviceAssetId, ownerId=$ownerId, deviceId=$deviceId, originalPath=$originalPath, resizePath=$resizePath, fileCreatedAt=$fileCreatedAt, fileModifiedAt=$fileModifiedAt, updatedAt=$updatedAt, isFavorite=$isFavorite, mimeType=$mimeType, duration=$duration, webpPath=$webpPath, encodedVideoPath=$encodedVideoPath, exifInfo=$exifInfo, smartInfo=$smartInfo, livePhotoVideoId=$livePhotoVideoId, tags=$tags]'; + String toString() => 'AssetResponseDto[type=$type, id=$id, deviceAssetId=$deviceAssetId, ownerId=$ownerId, deviceId=$deviceId, originalPath=$originalPath, resizePath=$resizePath, fileCreatedAt=$fileCreatedAt, fileModifiedAt=$fileModifiedAt, updatedAt=$updatedAt, isFavorite=$isFavorite, mimeType=$mimeType, duration=$duration, webpPath=$webpPath, encodedVideoPath=$encodedVideoPath, exifInfo=$exifInfo, smartInfo=$smartInfo, livePhotoVideoId=$livePhotoVideoId, tags=$tags]'; Map toJson() { final json = {}; - json[r'type'] = this.type; - json[r'id'] = this.id; - json[r'deviceAssetId'] = this.deviceAssetId; - json[r'ownerId'] = this.ownerId; - json[r'deviceId'] = this.deviceId; - json[r'originalPath'] = this.originalPath; + json[r'type'] = this.type; + json[r'id'] = this.id; + json[r'deviceAssetId'] = this.deviceAssetId; + json[r'ownerId'] = this.ownerId; + json[r'deviceId'] = this.deviceId; + json[r'originalPath'] = this.originalPath; if (this.resizePath != null) { json[r'resizePath'] = this.resizePath; } else { // json[r'resizePath'] = null; } - json[r'fileCreatedAt'] = this.fileCreatedAt; - json[r'fileModifiedAt'] = this.fileModifiedAt; - json[r'updatedAt'] = this.updatedAt; - json[r'isFavorite'] = this.isFavorite; + json[r'fileCreatedAt'] = this.fileCreatedAt; + json[r'fileModifiedAt'] = this.fileModifiedAt; + json[r'updatedAt'] = this.updatedAt; + json[r'isFavorite'] = this.isFavorite; if (this.mimeType != null) { json[r'mimeType'] = this.mimeType; } else { // json[r'mimeType'] = null; } - json[r'duration'] = this.duration; + json[r'duration'] = this.duration; if (this.webpPath != null) { json[r'webpPath'] = this.webpPath; } else { @@ -183,7 +180,7 @@ class AssetResponseDto { } else { // json[r'livePhotoVideoId'] = null; } - json[r'tags'] = this.tags; + json[r'tags'] = this.tags; return json; } @@ -197,13 +194,13 @@ class AssetResponseDto { // Ensure that the map contains the required keys. // Note 1: the values aren't checked for validity beyond being non-null. // Note 2: this code is stripped in release mode! - // assert(() { - // requiredKeys.forEach((key) { - // assert(json.containsKey(key), 'Required key "AssetResponseDto[$key]" is missing from JSON.'); - // assert(json[key] != null, 'Required key "AssetResponseDto[$key]" has a null value in JSON.'); - // }); - // return true; - // }()); + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "AssetResponseDto[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "AssetResponseDto[$key]" has a null value in JSON.'); + }); + return true; + }()); return AssetResponseDto( type: AssetTypeEnum.fromJson(json[r'type'])!, @@ -230,10 +227,7 @@ class AssetResponseDto { return null; } - static List? listFromJson( - dynamic json, { - bool growable = false, - }) { + static List? listFromJson(dynamic json, {bool growable = false,}) { final result = []; if (json is List && json.isNotEmpty) { for (final row in json) { @@ -261,18 +255,12 @@ class AssetResponseDto { } // maps a json object with a list of AssetResponseDto-objects as value to a dart map - static Map> mapListFromJson( - dynamic json, { - bool growable = false, - }) { + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { final map = >{}; if (json is Map && json.isNotEmpty) { json = json.cast(); // ignore: parameter_assignments for (final entry in json.entries) { - final value = AssetResponseDto.listFromJson( - entry.value, - growable: growable, - ); + final value = AssetResponseDto.listFromJson(entry.value, growable: growable,); if (value != null) { map[entry.key] = value; } @@ -299,3 +287,4 @@ class AssetResponseDto { 'webpPath', }; } +