1
0
mirror of https://github.com/immich-app/immich.git synced 2025-08-09 23:17:29 +02:00

feat: user's features preferences (#12099)

* feat: metadata in UserPreference

* feat: web metadata settings

* feat: web metadata settings

* fix: typo

* patch openapi

* fix: missing translation key

* new organization of preference strucutre

* feature settings on web

* localization

* added and used feature settings

* add default value to response dto

* patch openapi

* format en.json file

* implement helper method

* use tags preference logic

* Fix logic bug and add tests

* fix preference can be null in detail panel
This commit is contained in:
Alex
2024-08-29 14:29:04 -05:00
committed by GitHub
parent 9bfaa525db
commit ebecb60f39
32 changed files with 1418 additions and 296 deletions

View File

@@ -138,6 +138,8 @@ part 'model/file_checksum_response_dto.dart';
part 'model/file_report_dto.dart';
part 'model/file_report_fix_dto.dart';
part 'model/file_report_item_dto.dart';
part 'model/folders_response.dart';
part 'model/folders_update.dart';
part 'model/image_format.dart';
part 'model/job_command.dart';
part 'model/job_command_dto.dart';
@@ -156,12 +158,12 @@ part 'model/logout_response_dto.dart';
part 'model/map_marker_response_dto.dart';
part 'model/map_reverse_geocode_response_dto.dart';
part 'model/map_theme.dart';
part 'model/memories_response.dart';
part 'model/memories_update.dart';
part 'model/memory_create_dto.dart';
part 'model/memory_lane_response_dto.dart';
part 'model/memory_response.dart';
part 'model/memory_response_dto.dart';
part 'model/memory_type.dart';
part 'model/memory_update.dart';
part 'model/memory_update_dto.dart';
part 'model/merge_person_dto.dart';
part 'model/metadata_search_dto.dart';
@@ -173,7 +175,9 @@ part 'model/partner_direction.dart';
part 'model/partner_response_dto.dart';
part 'model/path_entity_type.dart';
part 'model/path_type.dart';
part 'model/people_response.dart';
part 'model/people_response_dto.dart';
part 'model/people_update.dart';
part 'model/people_update_dto.dart';
part 'model/people_update_item.dart';
part 'model/permission.dart';
@@ -186,8 +190,8 @@ part 'model/places_response_dto.dart';
part 'model/purchase_response.dart';
part 'model/purchase_update.dart';
part 'model/queue_status_dto.dart';
part 'model/rating_response.dart';
part 'model/rating_update.dart';
part 'model/ratings_response.dart';
part 'model/ratings_update.dart';
part 'model/reaction_level.dart';
part 'model/reaction_type.dart';
part 'model/reverse_geocoding_state_response_dto.dart';
@@ -249,6 +253,8 @@ part 'model/tag_create_dto.dart';
part 'model/tag_response_dto.dart';
part 'model/tag_update_dto.dart';
part 'model/tag_upsert_dto.dart';
part 'model/tags_response.dart';
part 'model/tags_update.dart';
part 'model/time_bucket_response_dto.dart';
part 'model/time_bucket_size.dart';
part 'model/tone_mapping.dart';

View File

@@ -331,6 +331,10 @@ class ApiClient {
return FileReportFixDto.fromJson(value);
case 'FileReportItemDto':
return FileReportItemDto.fromJson(value);
case 'FoldersResponse':
return FoldersResponse.fromJson(value);
case 'FoldersUpdate':
return FoldersUpdate.fromJson(value);
case 'ImageFormat':
return ImageFormatTypeTransformer().decode(value);
case 'JobCommand':
@@ -367,18 +371,18 @@ class ApiClient {
return MapReverseGeocodeResponseDto.fromJson(value);
case 'MapTheme':
return MapThemeTypeTransformer().decode(value);
case 'MemoriesResponse':
return MemoriesResponse.fromJson(value);
case 'MemoriesUpdate':
return MemoriesUpdate.fromJson(value);
case 'MemoryCreateDto':
return MemoryCreateDto.fromJson(value);
case 'MemoryLaneResponseDto':
return MemoryLaneResponseDto.fromJson(value);
case 'MemoryResponse':
return MemoryResponse.fromJson(value);
case 'MemoryResponseDto':
return MemoryResponseDto.fromJson(value);
case 'MemoryType':
return MemoryTypeTypeTransformer().decode(value);
case 'MemoryUpdate':
return MemoryUpdate.fromJson(value);
case 'MemoryUpdateDto':
return MemoryUpdateDto.fromJson(value);
case 'MergePersonDto':
@@ -401,8 +405,12 @@ class ApiClient {
return PathEntityTypeTypeTransformer().decode(value);
case 'PathType':
return PathTypeTypeTransformer().decode(value);
case 'PeopleResponse':
return PeopleResponse.fromJson(value);
case 'PeopleResponseDto':
return PeopleResponseDto.fromJson(value);
case 'PeopleUpdate':
return PeopleUpdate.fromJson(value);
case 'PeopleUpdateDto':
return PeopleUpdateDto.fromJson(value);
case 'PeopleUpdateItem':
@@ -427,10 +435,10 @@ class ApiClient {
return PurchaseUpdate.fromJson(value);
case 'QueueStatusDto':
return QueueStatusDto.fromJson(value);
case 'RatingResponse':
return RatingResponse.fromJson(value);
case 'RatingUpdate':
return RatingUpdate.fromJson(value);
case 'RatingsResponse':
return RatingsResponse.fromJson(value);
case 'RatingsUpdate':
return RatingsUpdate.fromJson(value);
case 'ReactionLevel':
return ReactionLevelTypeTransformer().decode(value);
case 'ReactionType':
@@ -553,6 +561,10 @@ class ApiClient {
return TagUpdateDto.fromJson(value);
case 'TagUpsertDto':
return TagUpsertDto.fromJson(value);
case 'TagsResponse':
return TagsResponse.fromJson(value);
case 'TagsUpdate':
return TagsUpdate.fromJson(value);
case 'TimeBucketResponseDto':
return TimeBucketResponseDto.fromJson(value);
case 'TimeBucketSize':

View File

@@ -0,0 +1,106 @@
//
// 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 FoldersResponse {
/// Returns a new [FoldersResponse] instance.
FoldersResponse({
this.enabled = false,
this.sidebarWeb = false,
});
bool enabled;
bool sidebarWeb;
@override
bool operator ==(Object other) => identical(this, other) || other is FoldersResponse &&
other.enabled == enabled &&
other.sidebarWeb == sidebarWeb;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(enabled.hashCode) +
(sidebarWeb.hashCode);
@override
String toString() => 'FoldersResponse[enabled=$enabled, sidebarWeb=$sidebarWeb]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'enabled'] = this.enabled;
json[r'sidebarWeb'] = this.sidebarWeb;
return json;
}
/// Returns a new [FoldersResponse] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static FoldersResponse? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
return FoldersResponse(
enabled: mapValueOfType<bool>(json, r'enabled')!,
sidebarWeb: mapValueOfType<bool>(json, r'sidebarWeb')!,
);
}
return null;
}
static List<FoldersResponse> listFromJson(dynamic json, {bool growable = false,}) {
final result = <FoldersResponse>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = FoldersResponse.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, FoldersResponse> mapFromJson(dynamic json) {
final map = <String, FoldersResponse>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = FoldersResponse.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of FoldersResponse-objects as value to a dart map
static Map<String, List<FoldersResponse>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<FoldersResponse>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = FoldersResponse.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'enabled',
'sidebarWeb',
};
}

View File

@@ -0,0 +1,124 @@
//
// 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 FoldersUpdate {
/// Returns a new [FoldersUpdate] instance.
FoldersUpdate({
this.enabled,
this.sidebarWeb,
});
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? enabled;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? sidebarWeb;
@override
bool operator ==(Object other) => identical(this, other) || other is FoldersUpdate &&
other.enabled == enabled &&
other.sidebarWeb == sidebarWeb;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(enabled == null ? 0 : enabled!.hashCode) +
(sidebarWeb == null ? 0 : sidebarWeb!.hashCode);
@override
String toString() => 'FoldersUpdate[enabled=$enabled, sidebarWeb=$sidebarWeb]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.enabled != null) {
json[r'enabled'] = this.enabled;
} else {
// json[r'enabled'] = null;
}
if (this.sidebarWeb != null) {
json[r'sidebarWeb'] = this.sidebarWeb;
} else {
// json[r'sidebarWeb'] = null;
}
return json;
}
/// Returns a new [FoldersUpdate] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static FoldersUpdate? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
return FoldersUpdate(
enabled: mapValueOfType<bool>(json, r'enabled'),
sidebarWeb: mapValueOfType<bool>(json, r'sidebarWeb'),
);
}
return null;
}
static List<FoldersUpdate> listFromJson(dynamic json, {bool growable = false,}) {
final result = <FoldersUpdate>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = FoldersUpdate.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, FoldersUpdate> mapFromJson(dynamic json) {
final map = <String, FoldersUpdate>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = FoldersUpdate.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of FoldersUpdate-objects as value to a dart map
static Map<String, List<FoldersUpdate>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<FoldersUpdate>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = FoldersUpdate.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
}

View File

@@ -10,16 +10,16 @@
part of openapi.api;
class MemoryResponse {
/// Returns a new [MemoryResponse] instance.
MemoryResponse({
required this.enabled,
class MemoriesResponse {
/// Returns a new [MemoriesResponse] instance.
MemoriesResponse({
this.enabled = true,
});
bool enabled;
@override
bool operator ==(Object other) => identical(this, other) || other is MemoryResponse &&
bool operator ==(Object other) => identical(this, other) || other is MemoriesResponse &&
other.enabled == enabled;
@override
@@ -28,7 +28,7 @@ class MemoryResponse {
(enabled.hashCode);
@override
String toString() => 'MemoryResponse[enabled=$enabled]';
String toString() => 'MemoriesResponse[enabled=$enabled]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@@ -36,25 +36,25 @@ class MemoryResponse {
return json;
}
/// Returns a new [MemoryResponse] instance and imports its values from
/// Returns a new [MemoriesResponse] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static MemoryResponse? fromJson(dynamic value) {
static MemoriesResponse? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
return MemoryResponse(
return MemoriesResponse(
enabled: mapValueOfType<bool>(json, r'enabled')!,
);
}
return null;
}
static List<MemoryResponse> listFromJson(dynamic json, {bool growable = false,}) {
final result = <MemoryResponse>[];
static List<MemoriesResponse> listFromJson(dynamic json, {bool growable = false,}) {
final result = <MemoriesResponse>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = MemoryResponse.fromJson(row);
final value = MemoriesResponse.fromJson(row);
if (value != null) {
result.add(value);
}
@@ -63,12 +63,12 @@ class MemoryResponse {
return result.toList(growable: growable);
}
static Map<String, MemoryResponse> mapFromJson(dynamic json) {
final map = <String, MemoryResponse>{};
static Map<String, MemoriesResponse> mapFromJson(dynamic json) {
final map = <String, MemoriesResponse>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = MemoryResponse.fromJson(entry.value);
final value = MemoriesResponse.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
@@ -77,14 +77,14 @@ class MemoryResponse {
return map;
}
// maps a json object with a list of MemoryResponse-objects as value to a dart map
static Map<String, List<MemoryResponse>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<MemoryResponse>>{};
// maps a json object with a list of MemoriesResponse-objects as value to a dart map
static Map<String, List<MemoriesResponse>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<MemoriesResponse>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = MemoryResponse.listFromJson(entry.value, growable: growable,);
map[entry.key] = MemoriesResponse.listFromJson(entry.value, growable: growable,);
}
}
return map;

View File

@@ -10,9 +10,9 @@
part of openapi.api;
class RatingUpdate {
/// Returns a new [RatingUpdate] instance.
RatingUpdate({
class MemoriesUpdate {
/// Returns a new [MemoriesUpdate] instance.
MemoriesUpdate({
this.enabled,
});
@@ -25,7 +25,7 @@ class RatingUpdate {
bool? enabled;
@override
bool operator ==(Object other) => identical(this, other) || other is RatingUpdate &&
bool operator ==(Object other) => identical(this, other) || other is MemoriesUpdate &&
other.enabled == enabled;
@override
@@ -34,7 +34,7 @@ class RatingUpdate {
(enabled == null ? 0 : enabled!.hashCode);
@override
String toString() => 'RatingUpdate[enabled=$enabled]';
String toString() => 'MemoriesUpdate[enabled=$enabled]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@@ -46,25 +46,25 @@ class RatingUpdate {
return json;
}
/// Returns a new [RatingUpdate] instance and imports its values from
/// Returns a new [MemoriesUpdate] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static RatingUpdate? fromJson(dynamic value) {
static MemoriesUpdate? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
return RatingUpdate(
return MemoriesUpdate(
enabled: mapValueOfType<bool>(json, r'enabled'),
);
}
return null;
}
static List<RatingUpdate> listFromJson(dynamic json, {bool growable = false,}) {
final result = <RatingUpdate>[];
static List<MemoriesUpdate> listFromJson(dynamic json, {bool growable = false,}) {
final result = <MemoriesUpdate>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = RatingUpdate.fromJson(row);
final value = MemoriesUpdate.fromJson(row);
if (value != null) {
result.add(value);
}
@@ -73,12 +73,12 @@ class RatingUpdate {
return result.toList(growable: growable);
}
static Map<String, RatingUpdate> mapFromJson(dynamic json) {
final map = <String, RatingUpdate>{};
static Map<String, MemoriesUpdate> mapFromJson(dynamic json) {
final map = <String, MemoriesUpdate>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = RatingUpdate.fromJson(entry.value);
final value = MemoriesUpdate.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
@@ -87,14 +87,14 @@ class RatingUpdate {
return map;
}
// maps a json object with a list of RatingUpdate-objects as value to a dart map
static Map<String, List<RatingUpdate>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<RatingUpdate>>{};
// maps a json object with a list of MemoriesUpdate-objects as value to a dart map
static Map<String, List<MemoriesUpdate>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<MemoriesUpdate>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = RatingUpdate.listFromJson(entry.value, growable: growable,);
map[entry.key] = MemoriesUpdate.listFromJson(entry.value, growable: growable,);
}
}
return map;

View File

@@ -0,0 +1,106 @@
//
// 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 PeopleResponse {
/// Returns a new [PeopleResponse] instance.
PeopleResponse({
this.enabled = true,
this.sidebarWeb = false,
});
bool enabled;
bool sidebarWeb;
@override
bool operator ==(Object other) => identical(this, other) || other is PeopleResponse &&
other.enabled == enabled &&
other.sidebarWeb == sidebarWeb;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(enabled.hashCode) +
(sidebarWeb.hashCode);
@override
String toString() => 'PeopleResponse[enabled=$enabled, sidebarWeb=$sidebarWeb]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'enabled'] = this.enabled;
json[r'sidebarWeb'] = this.sidebarWeb;
return json;
}
/// Returns a new [PeopleResponse] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static PeopleResponse? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
return PeopleResponse(
enabled: mapValueOfType<bool>(json, r'enabled')!,
sidebarWeb: mapValueOfType<bool>(json, r'sidebarWeb')!,
);
}
return null;
}
static List<PeopleResponse> listFromJson(dynamic json, {bool growable = false,}) {
final result = <PeopleResponse>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = PeopleResponse.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, PeopleResponse> mapFromJson(dynamic json) {
final map = <String, PeopleResponse>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = PeopleResponse.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of PeopleResponse-objects as value to a dart map
static Map<String, List<PeopleResponse>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<PeopleResponse>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = PeopleResponse.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'enabled',
'sidebarWeb',
};
}

View File

@@ -0,0 +1,124 @@
//
// 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 PeopleUpdate {
/// Returns a new [PeopleUpdate] instance.
PeopleUpdate({
this.enabled,
this.sidebarWeb,
});
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? enabled;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? sidebarWeb;
@override
bool operator ==(Object other) => identical(this, other) || other is PeopleUpdate &&
other.enabled == enabled &&
other.sidebarWeb == sidebarWeb;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(enabled == null ? 0 : enabled!.hashCode) +
(sidebarWeb == null ? 0 : sidebarWeb!.hashCode);
@override
String toString() => 'PeopleUpdate[enabled=$enabled, sidebarWeb=$sidebarWeb]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.enabled != null) {
json[r'enabled'] = this.enabled;
} else {
// json[r'enabled'] = null;
}
if (this.sidebarWeb != null) {
json[r'sidebarWeb'] = this.sidebarWeb;
} else {
// json[r'sidebarWeb'] = null;
}
return json;
}
/// Returns a new [PeopleUpdate] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static PeopleUpdate? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
return PeopleUpdate(
enabled: mapValueOfType<bool>(json, r'enabled'),
sidebarWeb: mapValueOfType<bool>(json, r'sidebarWeb'),
);
}
return null;
}
static List<PeopleUpdate> listFromJson(dynamic json, {bool growable = false,}) {
final result = <PeopleUpdate>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = PeopleUpdate.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, PeopleUpdate> mapFromJson(dynamic json) {
final map = <String, PeopleUpdate>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = PeopleUpdate.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of PeopleUpdate-objects as value to a dart map
static Map<String, List<PeopleUpdate>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<PeopleUpdate>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = PeopleUpdate.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
}

View File

@@ -10,16 +10,16 @@
part of openapi.api;
class RatingResponse {
/// Returns a new [RatingResponse] instance.
RatingResponse({
class RatingsResponse {
/// Returns a new [RatingsResponse] instance.
RatingsResponse({
this.enabled = false,
});
bool enabled;
@override
bool operator ==(Object other) => identical(this, other) || other is RatingResponse &&
bool operator ==(Object other) => identical(this, other) || other is RatingsResponse &&
other.enabled == enabled;
@override
@@ -28,7 +28,7 @@ class RatingResponse {
(enabled.hashCode);
@override
String toString() => 'RatingResponse[enabled=$enabled]';
String toString() => 'RatingsResponse[enabled=$enabled]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@@ -36,25 +36,25 @@ class RatingResponse {
return json;
}
/// Returns a new [RatingResponse] instance and imports its values from
/// Returns a new [RatingsResponse] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static RatingResponse? fromJson(dynamic value) {
static RatingsResponse? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
return RatingResponse(
return RatingsResponse(
enabled: mapValueOfType<bool>(json, r'enabled')!,
);
}
return null;
}
static List<RatingResponse> listFromJson(dynamic json, {bool growable = false,}) {
final result = <RatingResponse>[];
static List<RatingsResponse> listFromJson(dynamic json, {bool growable = false,}) {
final result = <RatingsResponse>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = RatingResponse.fromJson(row);
final value = RatingsResponse.fromJson(row);
if (value != null) {
result.add(value);
}
@@ -63,12 +63,12 @@ class RatingResponse {
return result.toList(growable: growable);
}
static Map<String, RatingResponse> mapFromJson(dynamic json) {
final map = <String, RatingResponse>{};
static Map<String, RatingsResponse> mapFromJson(dynamic json) {
final map = <String, RatingsResponse>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = RatingResponse.fromJson(entry.value);
final value = RatingsResponse.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
@@ -77,14 +77,14 @@ class RatingResponse {
return map;
}
// maps a json object with a list of RatingResponse-objects as value to a dart map
static Map<String, List<RatingResponse>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<RatingResponse>>{};
// maps a json object with a list of RatingsResponse-objects as value to a dart map
static Map<String, List<RatingsResponse>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<RatingsResponse>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = RatingResponse.listFromJson(entry.value, growable: growable,);
map[entry.key] = RatingsResponse.listFromJson(entry.value, growable: growable,);
}
}
return map;

View File

@@ -10,9 +10,9 @@
part of openapi.api;
class MemoryUpdate {
/// Returns a new [MemoryUpdate] instance.
MemoryUpdate({
class RatingsUpdate {
/// Returns a new [RatingsUpdate] instance.
RatingsUpdate({
this.enabled,
});
@@ -25,7 +25,7 @@ class MemoryUpdate {
bool? enabled;
@override
bool operator ==(Object other) => identical(this, other) || other is MemoryUpdate &&
bool operator ==(Object other) => identical(this, other) || other is RatingsUpdate &&
other.enabled == enabled;
@override
@@ -34,7 +34,7 @@ class MemoryUpdate {
(enabled == null ? 0 : enabled!.hashCode);
@override
String toString() => 'MemoryUpdate[enabled=$enabled]';
String toString() => 'RatingsUpdate[enabled=$enabled]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@@ -46,25 +46,25 @@ class MemoryUpdate {
return json;
}
/// Returns a new [MemoryUpdate] instance and imports its values from
/// Returns a new [RatingsUpdate] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static MemoryUpdate? fromJson(dynamic value) {
static RatingsUpdate? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
return MemoryUpdate(
return RatingsUpdate(
enabled: mapValueOfType<bool>(json, r'enabled'),
);
}
return null;
}
static List<MemoryUpdate> listFromJson(dynamic json, {bool growable = false,}) {
final result = <MemoryUpdate>[];
static List<RatingsUpdate> listFromJson(dynamic json, {bool growable = false,}) {
final result = <RatingsUpdate>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = MemoryUpdate.fromJson(row);
final value = RatingsUpdate.fromJson(row);
if (value != null) {
result.add(value);
}
@@ -73,12 +73,12 @@ class MemoryUpdate {
return result.toList(growable: growable);
}
static Map<String, MemoryUpdate> mapFromJson(dynamic json) {
final map = <String, MemoryUpdate>{};
static Map<String, RatingsUpdate> mapFromJson(dynamic json) {
final map = <String, RatingsUpdate>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = MemoryUpdate.fromJson(entry.value);
final value = RatingsUpdate.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
@@ -87,14 +87,14 @@ class MemoryUpdate {
return map;
}
// maps a json object with a list of MemoryUpdate-objects as value to a dart map
static Map<String, List<MemoryUpdate>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<MemoryUpdate>>{};
// maps a json object with a list of RatingsUpdate-objects as value to a dart map
static Map<String, List<RatingsUpdate>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<RatingsUpdate>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = MemoryUpdate.listFromJson(entry.value, growable: growable,);
map[entry.key] = RatingsUpdate.listFromJson(entry.value, growable: growable,);
}
}
return map;

View File

@@ -0,0 +1,106 @@
//
// 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 TagsResponse {
/// Returns a new [TagsResponse] instance.
TagsResponse({
this.enabled = true,
this.sidebarWeb = true,
});
bool enabled;
bool sidebarWeb;
@override
bool operator ==(Object other) => identical(this, other) || other is TagsResponse &&
other.enabled == enabled &&
other.sidebarWeb == sidebarWeb;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(enabled.hashCode) +
(sidebarWeb.hashCode);
@override
String toString() => 'TagsResponse[enabled=$enabled, sidebarWeb=$sidebarWeb]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'enabled'] = this.enabled;
json[r'sidebarWeb'] = this.sidebarWeb;
return json;
}
/// Returns a new [TagsResponse] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static TagsResponse? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
return TagsResponse(
enabled: mapValueOfType<bool>(json, r'enabled')!,
sidebarWeb: mapValueOfType<bool>(json, r'sidebarWeb')!,
);
}
return null;
}
static List<TagsResponse> listFromJson(dynamic json, {bool growable = false,}) {
final result = <TagsResponse>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = TagsResponse.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, TagsResponse> mapFromJson(dynamic json) {
final map = <String, TagsResponse>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = TagsResponse.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of TagsResponse-objects as value to a dart map
static Map<String, List<TagsResponse>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<TagsResponse>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = TagsResponse.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'enabled',
'sidebarWeb',
};
}

124
mobile/openapi/lib/model/tags_update.dart generated Normal file
View File

@@ -0,0 +1,124 @@
//
// 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 TagsUpdate {
/// Returns a new [TagsUpdate] instance.
TagsUpdate({
this.enabled,
this.sidebarWeb,
});
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? enabled;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? sidebarWeb;
@override
bool operator ==(Object other) => identical(this, other) || other is TagsUpdate &&
other.enabled == enabled &&
other.sidebarWeb == sidebarWeb;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(enabled == null ? 0 : enabled!.hashCode) +
(sidebarWeb == null ? 0 : sidebarWeb!.hashCode);
@override
String toString() => 'TagsUpdate[enabled=$enabled, sidebarWeb=$sidebarWeb]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.enabled != null) {
json[r'enabled'] = this.enabled;
} else {
// json[r'enabled'] = null;
}
if (this.sidebarWeb != null) {
json[r'sidebarWeb'] = this.sidebarWeb;
} else {
// json[r'sidebarWeb'] = null;
}
return json;
}
/// Returns a new [TagsUpdate] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static TagsUpdate? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
return TagsUpdate(
enabled: mapValueOfType<bool>(json, r'enabled'),
sidebarWeb: mapValueOfType<bool>(json, r'sidebarWeb'),
);
}
return null;
}
static List<TagsUpdate> listFromJson(dynamic json, {bool growable = false,}) {
final result = <TagsUpdate>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = TagsUpdate.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, TagsUpdate> mapFromJson(dynamic json) {
final map = <String, TagsUpdate>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = TagsUpdate.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of TagsUpdate-objects as value to a dart map
static Map<String, List<TagsUpdate>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<TagsUpdate>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = TagsUpdate.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
}

View File

@@ -16,9 +16,12 @@ class UserPreferencesResponseDto {
required this.avatar,
required this.download,
required this.emailNotifications,
required this.folders,
required this.memories,
required this.people,
required this.purchase,
required this.rating,
required this.ratings,
required this.tags,
});
AvatarResponse avatar;
@@ -27,20 +30,29 @@ class UserPreferencesResponseDto {
EmailNotificationsResponse emailNotifications;
MemoryResponse memories;
FoldersResponse folders;
MemoriesResponse memories;
PeopleResponse people;
PurchaseResponse purchase;
RatingResponse rating;
RatingsResponse ratings;
TagsResponse tags;
@override
bool operator ==(Object other) => identical(this, other) || other is UserPreferencesResponseDto &&
other.avatar == avatar &&
other.download == download &&
other.emailNotifications == emailNotifications &&
other.folders == folders &&
other.memories == memories &&
other.people == people &&
other.purchase == purchase &&
other.rating == rating;
other.ratings == ratings &&
other.tags == tags;
@override
int get hashCode =>
@@ -48,21 +60,27 @@ class UserPreferencesResponseDto {
(avatar.hashCode) +
(download.hashCode) +
(emailNotifications.hashCode) +
(folders.hashCode) +
(memories.hashCode) +
(people.hashCode) +
(purchase.hashCode) +
(rating.hashCode);
(ratings.hashCode) +
(tags.hashCode);
@override
String toString() => 'UserPreferencesResponseDto[avatar=$avatar, download=$download, emailNotifications=$emailNotifications, memories=$memories, purchase=$purchase, rating=$rating]';
String toString() => 'UserPreferencesResponseDto[avatar=$avatar, download=$download, emailNotifications=$emailNotifications, folders=$folders, memories=$memories, people=$people, purchase=$purchase, ratings=$ratings, tags=$tags]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'avatar'] = this.avatar;
json[r'download'] = this.download;
json[r'emailNotifications'] = this.emailNotifications;
json[r'folders'] = this.folders;
json[r'memories'] = this.memories;
json[r'people'] = this.people;
json[r'purchase'] = this.purchase;
json[r'rating'] = this.rating;
json[r'ratings'] = this.ratings;
json[r'tags'] = this.tags;
return json;
}
@@ -77,9 +95,12 @@ class UserPreferencesResponseDto {
avatar: AvatarResponse.fromJson(json[r'avatar'])!,
download: DownloadResponse.fromJson(json[r'download'])!,
emailNotifications: EmailNotificationsResponse.fromJson(json[r'emailNotifications'])!,
memories: MemoryResponse.fromJson(json[r'memories'])!,
folders: FoldersResponse.fromJson(json[r'folders'])!,
memories: MemoriesResponse.fromJson(json[r'memories'])!,
people: PeopleResponse.fromJson(json[r'people'])!,
purchase: PurchaseResponse.fromJson(json[r'purchase'])!,
rating: RatingResponse.fromJson(json[r'rating'])!,
ratings: RatingsResponse.fromJson(json[r'ratings'])!,
tags: TagsResponse.fromJson(json[r'tags'])!,
);
}
return null;
@@ -130,9 +151,12 @@ class UserPreferencesResponseDto {
'avatar',
'download',
'emailNotifications',
'folders',
'memories',
'people',
'purchase',
'rating',
'ratings',
'tags',
};
}

View File

@@ -16,9 +16,12 @@ class UserPreferencesUpdateDto {
this.avatar,
this.download,
this.emailNotifications,
this.folders,
this.memories,
this.people,
this.purchase,
this.rating,
this.ratings,
this.tags,
});
///
@@ -51,7 +54,23 @@ class UserPreferencesUpdateDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
MemoryUpdate? memories;
FoldersUpdate? folders;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
MemoriesUpdate? memories;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
PeopleUpdate? people;
///
/// Please note: This property should have been non-nullable! Since the specification file
@@ -67,16 +86,27 @@ class UserPreferencesUpdateDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
RatingUpdate? rating;
RatingsUpdate? ratings;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
TagsUpdate? tags;
@override
bool operator ==(Object other) => identical(this, other) || other is UserPreferencesUpdateDto &&
other.avatar == avatar &&
other.download == download &&
other.emailNotifications == emailNotifications &&
other.folders == folders &&
other.memories == memories &&
other.people == people &&
other.purchase == purchase &&
other.rating == rating;
other.ratings == ratings &&
other.tags == tags;
@override
int get hashCode =>
@@ -84,12 +114,15 @@ class UserPreferencesUpdateDto {
(avatar == null ? 0 : avatar!.hashCode) +
(download == null ? 0 : download!.hashCode) +
(emailNotifications == null ? 0 : emailNotifications!.hashCode) +
(folders == null ? 0 : folders!.hashCode) +
(memories == null ? 0 : memories!.hashCode) +
(people == null ? 0 : people!.hashCode) +
(purchase == null ? 0 : purchase!.hashCode) +
(rating == null ? 0 : rating!.hashCode);
(ratings == null ? 0 : ratings!.hashCode) +
(tags == null ? 0 : tags!.hashCode);
@override
String toString() => 'UserPreferencesUpdateDto[avatar=$avatar, download=$download, emailNotifications=$emailNotifications, memories=$memories, purchase=$purchase, rating=$rating]';
String toString() => 'UserPreferencesUpdateDto[avatar=$avatar, download=$download, emailNotifications=$emailNotifications, folders=$folders, memories=$memories, people=$people, purchase=$purchase, ratings=$ratings, tags=$tags]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@@ -108,20 +141,35 @@ class UserPreferencesUpdateDto {
} else {
// json[r'emailNotifications'] = null;
}
if (this.folders != null) {
json[r'folders'] = this.folders;
} else {
// json[r'folders'] = null;
}
if (this.memories != null) {
json[r'memories'] = this.memories;
} else {
// json[r'memories'] = null;
}
if (this.people != null) {
json[r'people'] = this.people;
} else {
// json[r'people'] = null;
}
if (this.purchase != null) {
json[r'purchase'] = this.purchase;
} else {
// json[r'purchase'] = null;
}
if (this.rating != null) {
json[r'rating'] = this.rating;
if (this.ratings != null) {
json[r'ratings'] = this.ratings;
} else {
// json[r'rating'] = null;
// json[r'ratings'] = null;
}
if (this.tags != null) {
json[r'tags'] = this.tags;
} else {
// json[r'tags'] = null;
}
return json;
}
@@ -137,9 +185,12 @@ class UserPreferencesUpdateDto {
avatar: AvatarUpdate.fromJson(json[r'avatar']),
download: DownloadUpdate.fromJson(json[r'download']),
emailNotifications: EmailNotificationsUpdate.fromJson(json[r'emailNotifications']),
memories: MemoryUpdate.fromJson(json[r'memories']),
folders: FoldersUpdate.fromJson(json[r'folders']),
memories: MemoriesUpdate.fromJson(json[r'memories']),
people: PeopleUpdate.fromJson(json[r'people']),
purchase: PurchaseUpdate.fromJson(json[r'purchase']),
rating: RatingUpdate.fromJson(json[r'rating']),
ratings: RatingsUpdate.fromJson(json[r'ratings']),
tags: TagsUpdate.fromJson(json[r'tags']),
);
}
return null;