1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-07 20:36:48 +01:00
immich/mobile/openapi/lib/model/server_features_dto.dart
BugFest 77e6a6d78b
feat(server): Import face regions from metadata (#6455)
* feat: faces-from-metadata - Import face regions from metadata

Implements immich-app#1692.
- OpenAPI spec changes to accomodate metadata face import configs. New settings to enable the feature.
- Updates admin UI compoments
- ML faces detection/recognition & Exif/Metadata faces compatibility

Signed-off-by: BugFest <bugfest.dev@pm.me>

* chore(web): remove unused file confirm-enable-import-faces

* chore(web): format metadata-settings

* fix(server): faces-from-metadata tests and format

* fix(server): code refinements, nullable face asset sourceType

* fix(server): Add RegionInfo to ImmichTags interface

* fix(server): deleteAllFaces sourceType param can be undefined

* fix(server): exiftool-vendored 27.0.0 moves readArgs into ExifToolOptions

* fix(server): rename isImportFacesFromMetadataEnabled to isFaceImportEnabled

* fix(server): simplify sourceType conditional

* fix(server): small fixes

* fix(server): handling sourceType

* fix(server): sourceType enum

* fix(server): refactor metadata applyTaggedFaces

* fix(server): create/update signature changes

* fix(server): reduce computational cost of Person.getManyByName

* fix(server): use faceList instead of faceSet

* fix(server): Skip regions without Name defined

* fix(mobile): Update open-api (face assets feature changes)

* fix(server): Face-Person reconciliation with map/index

* fix(server): tags.RegionInfo.AppliedToDimensions must be defined to process face-region

* fix(server): fix shared-link.service.ts format

* fix(mobile): Update open-api after branch update

* simplify

* fix(server): minor fixes

* fix(server): person create/update methods type enforcement

* fix(server): style fixes

* fix(server): remove unused metadata code

* fix(server): metadata faces unit tests

* fix(server): top level config metadata category

* fix(server): rename upsertFaces to replaceFaces

* fix(server): remove sourceType when unnecessary

* fix(server): sourceType as ENUM

* fix(server): format fixes

* fix(server): fix tests after sourceType ENUM change

* fix(server): remove unnecessary JobItem cast

* fix(server): fix asset enum imports

* fix(open-api): add metadata config

* fix(mobile): update open-api after metadata open-api spec changes

* fix(web): update web/api metadata config

* fix(server): remove duplicated sourceType def

* fix(server): update generated sql queries

* fix(e2e): tests for metadata face import feature

* fix(web): Fix check:typescript

* fix(e2e): update subproject ref

* fix(server): revert format changes to pass format checks after ci

* fix(mobile): update open-api

* fix(server,movile,open-api,mobile): sourceType as DB data type

* fix(e2e): upload face asset after enabling metadata face import

* fix(web): simplify metadata admin settings and i18n keys

* Update person.repository.ts

Co-authored-by: Jason Rasmussen <jason@rasm.me>

* fix(server): asset_faces.sourceType column not nullable

* fix(server): simplified syntax

* fix(e2e): use SDK for everything except the endpoint being tested

* fix(e2e): fix test format

* chore: clean up

* chore: clean up

* chore: update e2e/test-assets

---------

Signed-off-by: BugFest <bugfest.dev@pm.me>
Co-authored-by: mertalev <101130780+mertalev@users.noreply.github.com>
Co-authored-by: Jason Rasmussen <jason@rasm.me>
2024-09-04 18:23:58 -04:00

202 lines
6.2 KiB
Dart
Generated

//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class ServerFeaturesDto {
/// Returns a new [ServerFeaturesDto] instance.
ServerFeaturesDto({
required this.configFile,
required this.duplicateDetection,
required this.email,
required this.facialRecognition,
required this.importFaces,
required this.map,
required this.oauth,
required this.oauthAutoLaunch,
required this.passwordLogin,
required this.reverseGeocoding,
required this.search,
required this.sidecar,
required this.smartSearch,
required this.trash,
});
bool configFile;
bool duplicateDetection;
bool email;
bool facialRecognition;
bool importFaces;
bool map;
bool oauth;
bool oauthAutoLaunch;
bool passwordLogin;
bool reverseGeocoding;
bool search;
bool sidecar;
bool smartSearch;
bool trash;
@override
bool operator ==(Object other) => identical(this, other) || other is ServerFeaturesDto &&
other.configFile == configFile &&
other.duplicateDetection == duplicateDetection &&
other.email == email &&
other.facialRecognition == facialRecognition &&
other.importFaces == importFaces &&
other.map == map &&
other.oauth == oauth &&
other.oauthAutoLaunch == oauthAutoLaunch &&
other.passwordLogin == passwordLogin &&
other.reverseGeocoding == reverseGeocoding &&
other.search == search &&
other.sidecar == sidecar &&
other.smartSearch == smartSearch &&
other.trash == trash;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(configFile.hashCode) +
(duplicateDetection.hashCode) +
(email.hashCode) +
(facialRecognition.hashCode) +
(importFaces.hashCode) +
(map.hashCode) +
(oauth.hashCode) +
(oauthAutoLaunch.hashCode) +
(passwordLogin.hashCode) +
(reverseGeocoding.hashCode) +
(search.hashCode) +
(sidecar.hashCode) +
(smartSearch.hashCode) +
(trash.hashCode);
@override
String toString() => 'ServerFeaturesDto[configFile=$configFile, duplicateDetection=$duplicateDetection, email=$email, facialRecognition=$facialRecognition, importFaces=$importFaces, map=$map, oauth=$oauth, oauthAutoLaunch=$oauthAutoLaunch, passwordLogin=$passwordLogin, reverseGeocoding=$reverseGeocoding, search=$search, sidecar=$sidecar, smartSearch=$smartSearch, trash=$trash]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'configFile'] = this.configFile;
json[r'duplicateDetection'] = this.duplicateDetection;
json[r'email'] = this.email;
json[r'facialRecognition'] = this.facialRecognition;
json[r'importFaces'] = this.importFaces;
json[r'map'] = this.map;
json[r'oauth'] = this.oauth;
json[r'oauthAutoLaunch'] = this.oauthAutoLaunch;
json[r'passwordLogin'] = this.passwordLogin;
json[r'reverseGeocoding'] = this.reverseGeocoding;
json[r'search'] = this.search;
json[r'sidecar'] = this.sidecar;
json[r'smartSearch'] = this.smartSearch;
json[r'trash'] = this.trash;
return json;
}
/// Returns a new [ServerFeaturesDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static ServerFeaturesDto? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
return ServerFeaturesDto(
configFile: mapValueOfType<bool>(json, r'configFile')!,
duplicateDetection: mapValueOfType<bool>(json, r'duplicateDetection')!,
email: mapValueOfType<bool>(json, r'email')!,
facialRecognition: mapValueOfType<bool>(json, r'facialRecognition')!,
importFaces: mapValueOfType<bool>(json, r'importFaces')!,
map: mapValueOfType<bool>(json, r'map')!,
oauth: mapValueOfType<bool>(json, r'oauth')!,
oauthAutoLaunch: mapValueOfType<bool>(json, r'oauthAutoLaunch')!,
passwordLogin: mapValueOfType<bool>(json, r'passwordLogin')!,
reverseGeocoding: mapValueOfType<bool>(json, r'reverseGeocoding')!,
search: mapValueOfType<bool>(json, r'search')!,
sidecar: mapValueOfType<bool>(json, r'sidecar')!,
smartSearch: mapValueOfType<bool>(json, r'smartSearch')!,
trash: mapValueOfType<bool>(json, r'trash')!,
);
}
return null;
}
static List<ServerFeaturesDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ServerFeaturesDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = ServerFeaturesDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, ServerFeaturesDto> mapFromJson(dynamic json) {
final map = <String, ServerFeaturesDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = ServerFeaturesDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of ServerFeaturesDto-objects as value to a dart map
static Map<String, List<ServerFeaturesDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ServerFeaturesDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = ServerFeaturesDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'configFile',
'duplicateDetection',
'email',
'facialRecognition',
'importFaces',
'map',
'oauth',
'oauthAutoLaunch',
'passwordLogin',
'reverseGeocoding',
'search',
'sidecar',
'smartSearch',
'trash',
};
}