mirror of
https://github.com/immich-app/immich.git
synced 2025-12-22 09:15:34 +03:00
refactor: split maintenance dto for integrity checks
This commit is contained in:
@@ -10,16 +10,16 @@
|
||||
|
||||
part of openapi.api;
|
||||
|
||||
class MaintenanceGetIntegrityReportDto {
|
||||
/// Returns a new [MaintenanceGetIntegrityReportDto] instance.
|
||||
MaintenanceGetIntegrityReportDto({
|
||||
class IntegrityGetReportDto {
|
||||
/// Returns a new [IntegrityGetReportDto] instance.
|
||||
IntegrityGetReportDto({
|
||||
required this.type,
|
||||
});
|
||||
|
||||
IntegrityReportType type;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is MaintenanceGetIntegrityReportDto &&
|
||||
bool operator ==(Object other) => identical(this, other) || other is IntegrityGetReportDto &&
|
||||
other.type == type;
|
||||
|
||||
@override
|
||||
@@ -28,7 +28,7 @@ class MaintenanceGetIntegrityReportDto {
|
||||
(type.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'MaintenanceGetIntegrityReportDto[type=$type]';
|
||||
String toString() => 'IntegrityGetReportDto[type=$type]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
@@ -36,26 +36,26 @@ class MaintenanceGetIntegrityReportDto {
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [MaintenanceGetIntegrityReportDto] instance and imports its values from
|
||||
/// Returns a new [IntegrityGetReportDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static MaintenanceGetIntegrityReportDto? fromJson(dynamic value) {
|
||||
upgradeDto(value, "MaintenanceGetIntegrityReportDto");
|
||||
static IntegrityGetReportDto? fromJson(dynamic value) {
|
||||
upgradeDto(value, "IntegrityGetReportDto");
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return MaintenanceGetIntegrityReportDto(
|
||||
return IntegrityGetReportDto(
|
||||
type: IntegrityReportType.fromJson(json[r'type'])!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<MaintenanceGetIntegrityReportDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <MaintenanceGetIntegrityReportDto>[];
|
||||
static List<IntegrityGetReportDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <IntegrityGetReportDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = MaintenanceGetIntegrityReportDto.fromJson(row);
|
||||
final value = IntegrityGetReportDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
@@ -64,12 +64,12 @@ class MaintenanceGetIntegrityReportDto {
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, MaintenanceGetIntegrityReportDto> mapFromJson(dynamic json) {
|
||||
final map = <String, MaintenanceGetIntegrityReportDto>{};
|
||||
static Map<String, IntegrityGetReportDto> mapFromJson(dynamic json) {
|
||||
final map = <String, IntegrityGetReportDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = MaintenanceGetIntegrityReportDto.fromJson(entry.value);
|
||||
final value = IntegrityGetReportDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
@@ -78,14 +78,14 @@ class MaintenanceGetIntegrityReportDto {
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of MaintenanceGetIntegrityReportDto-objects as value to a dart map
|
||||
static Map<String, List<MaintenanceGetIntegrityReportDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<MaintenanceGetIntegrityReportDto>>{};
|
||||
// maps a json object with a list of IntegrityGetReportDto-objects as value to a dart map
|
||||
static Map<String, List<IntegrityGetReportDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<IntegrityGetReportDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = MaintenanceGetIntegrityReportDto.listFromJson(entry.value, growable: growable,);
|
||||
map[entry.key] = IntegrityGetReportDto.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
@@ -10,9 +10,9 @@
|
||||
|
||||
part of openapi.api;
|
||||
|
||||
class MaintenanceIntegrityReportDto {
|
||||
/// Returns a new [MaintenanceIntegrityReportDto] instance.
|
||||
MaintenanceIntegrityReportDto({
|
||||
class IntegrityReportDto {
|
||||
/// Returns a new [IntegrityReportDto] instance.
|
||||
IntegrityReportDto({
|
||||
required this.id,
|
||||
required this.path,
|
||||
required this.type,
|
||||
@@ -25,7 +25,7 @@ class MaintenanceIntegrityReportDto {
|
||||
IntegrityReportType type;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is MaintenanceIntegrityReportDto &&
|
||||
bool operator ==(Object other) => identical(this, other) || other is IntegrityReportDto &&
|
||||
other.id == id &&
|
||||
other.path == path &&
|
||||
other.type == type;
|
||||
@@ -38,7 +38,7 @@ class MaintenanceIntegrityReportDto {
|
||||
(type.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'MaintenanceIntegrityReportDto[id=$id, path=$path, type=$type]';
|
||||
String toString() => 'IntegrityReportDto[id=$id, path=$path, type=$type]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
@@ -48,15 +48,15 @@ class MaintenanceIntegrityReportDto {
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [MaintenanceIntegrityReportDto] instance and imports its values from
|
||||
/// Returns a new [IntegrityReportDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static MaintenanceIntegrityReportDto? fromJson(dynamic value) {
|
||||
upgradeDto(value, "MaintenanceIntegrityReportDto");
|
||||
static IntegrityReportDto? fromJson(dynamic value) {
|
||||
upgradeDto(value, "IntegrityReportDto");
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return MaintenanceIntegrityReportDto(
|
||||
return IntegrityReportDto(
|
||||
id: mapValueOfType<String>(json, r'id')!,
|
||||
path: mapValueOfType<String>(json, r'path')!,
|
||||
type: IntegrityReportType.fromJson(json[r'type'])!,
|
||||
@@ -65,11 +65,11 @@ class MaintenanceIntegrityReportDto {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<MaintenanceIntegrityReportDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <MaintenanceIntegrityReportDto>[];
|
||||
static List<IntegrityReportDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <IntegrityReportDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = MaintenanceIntegrityReportDto.fromJson(row);
|
||||
final value = IntegrityReportDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
@@ -78,12 +78,12 @@ class MaintenanceIntegrityReportDto {
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, MaintenanceIntegrityReportDto> mapFromJson(dynamic json) {
|
||||
final map = <String, MaintenanceIntegrityReportDto>{};
|
||||
static Map<String, IntegrityReportDto> mapFromJson(dynamic json) {
|
||||
final map = <String, IntegrityReportDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = MaintenanceIntegrityReportDto.fromJson(entry.value);
|
||||
final value = IntegrityReportDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
@@ -92,14 +92,14 @@ class MaintenanceIntegrityReportDto {
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of MaintenanceIntegrityReportDto-objects as value to a dart map
|
||||
static Map<String, List<MaintenanceIntegrityReportDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<MaintenanceIntegrityReportDto>>{};
|
||||
// maps a json object with a list of IntegrityReportDto-objects as value to a dart map
|
||||
static Map<String, List<IntegrityReportDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<IntegrityReportDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = MaintenanceIntegrityReportDto.listFromJson(entry.value, growable: growable,);
|
||||
map[entry.key] = IntegrityReportDto.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
@@ -10,16 +10,16 @@
|
||||
|
||||
part of openapi.api;
|
||||
|
||||
class MaintenanceIntegrityReportResponseDto {
|
||||
/// Returns a new [MaintenanceIntegrityReportResponseDto] instance.
|
||||
MaintenanceIntegrityReportResponseDto({
|
||||
class IntegrityReportResponseDto {
|
||||
/// Returns a new [IntegrityReportResponseDto] instance.
|
||||
IntegrityReportResponseDto({
|
||||
this.items = const [],
|
||||
});
|
||||
|
||||
List<MaintenanceIntegrityReportDto> items;
|
||||
List<IntegrityReportDto> items;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is MaintenanceIntegrityReportResponseDto &&
|
||||
bool operator ==(Object other) => identical(this, other) || other is IntegrityReportResponseDto &&
|
||||
_deepEquality.equals(other.items, items);
|
||||
|
||||
@override
|
||||
@@ -28,7 +28,7 @@ class MaintenanceIntegrityReportResponseDto {
|
||||
(items.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'MaintenanceIntegrityReportResponseDto[items=$items]';
|
||||
String toString() => 'IntegrityReportResponseDto[items=$items]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
@@ -36,26 +36,26 @@ class MaintenanceIntegrityReportResponseDto {
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [MaintenanceIntegrityReportResponseDto] instance and imports its values from
|
||||
/// Returns a new [IntegrityReportResponseDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static MaintenanceIntegrityReportResponseDto? fromJson(dynamic value) {
|
||||
upgradeDto(value, "MaintenanceIntegrityReportResponseDto");
|
||||
static IntegrityReportResponseDto? fromJson(dynamic value) {
|
||||
upgradeDto(value, "IntegrityReportResponseDto");
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return MaintenanceIntegrityReportResponseDto(
|
||||
items: MaintenanceIntegrityReportDto.listFromJson(json[r'items']),
|
||||
return IntegrityReportResponseDto(
|
||||
items: IntegrityReportDto.listFromJson(json[r'items']),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<MaintenanceIntegrityReportResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <MaintenanceIntegrityReportResponseDto>[];
|
||||
static List<IntegrityReportResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <IntegrityReportResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = MaintenanceIntegrityReportResponseDto.fromJson(row);
|
||||
final value = IntegrityReportResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
@@ -64,12 +64,12 @@ class MaintenanceIntegrityReportResponseDto {
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, MaintenanceIntegrityReportResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, MaintenanceIntegrityReportResponseDto>{};
|
||||
static Map<String, IntegrityReportResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, IntegrityReportResponseDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = MaintenanceIntegrityReportResponseDto.fromJson(entry.value);
|
||||
final value = IntegrityReportResponseDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
@@ -78,14 +78,14 @@ class MaintenanceIntegrityReportResponseDto {
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of MaintenanceIntegrityReportResponseDto-objects as value to a dart map
|
||||
static Map<String, List<MaintenanceIntegrityReportResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<MaintenanceIntegrityReportResponseDto>>{};
|
||||
// maps a json object with a list of IntegrityReportResponseDto-objects as value to a dart map
|
||||
static Map<String, List<IntegrityReportResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<IntegrityReportResponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = MaintenanceIntegrityReportResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
map[entry.key] = IntegrityReportResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
@@ -10,9 +10,9 @@
|
||||
|
||||
part of openapi.api;
|
||||
|
||||
class MaintenanceIntegrityReportSummaryResponseDto {
|
||||
/// Returns a new [MaintenanceIntegrityReportSummaryResponseDto] instance.
|
||||
MaintenanceIntegrityReportSummaryResponseDto({
|
||||
class IntegrityReportSummaryResponseDto {
|
||||
/// Returns a new [IntegrityReportSummaryResponseDto] instance.
|
||||
IntegrityReportSummaryResponseDto({
|
||||
required this.checksumMismatch,
|
||||
required this.missingFile,
|
||||
required this.orphanFile,
|
||||
@@ -25,7 +25,7 @@ class MaintenanceIntegrityReportSummaryResponseDto {
|
||||
int orphanFile;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is MaintenanceIntegrityReportSummaryResponseDto &&
|
||||
bool operator ==(Object other) => identical(this, other) || other is IntegrityReportSummaryResponseDto &&
|
||||
other.checksumMismatch == checksumMismatch &&
|
||||
other.missingFile == missingFile &&
|
||||
other.orphanFile == orphanFile;
|
||||
@@ -38,7 +38,7 @@ class MaintenanceIntegrityReportSummaryResponseDto {
|
||||
(orphanFile.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'MaintenanceIntegrityReportSummaryResponseDto[checksumMismatch=$checksumMismatch, missingFile=$missingFile, orphanFile=$orphanFile]';
|
||||
String toString() => 'IntegrityReportSummaryResponseDto[checksumMismatch=$checksumMismatch, missingFile=$missingFile, orphanFile=$orphanFile]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
@@ -48,15 +48,15 @@ class MaintenanceIntegrityReportSummaryResponseDto {
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [MaintenanceIntegrityReportSummaryResponseDto] instance and imports its values from
|
||||
/// Returns a new [IntegrityReportSummaryResponseDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static MaintenanceIntegrityReportSummaryResponseDto? fromJson(dynamic value) {
|
||||
upgradeDto(value, "MaintenanceIntegrityReportSummaryResponseDto");
|
||||
static IntegrityReportSummaryResponseDto? fromJson(dynamic value) {
|
||||
upgradeDto(value, "IntegrityReportSummaryResponseDto");
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return MaintenanceIntegrityReportSummaryResponseDto(
|
||||
return IntegrityReportSummaryResponseDto(
|
||||
checksumMismatch: mapValueOfType<int>(json, r'checksum_mismatch')!,
|
||||
missingFile: mapValueOfType<int>(json, r'missing_file')!,
|
||||
orphanFile: mapValueOfType<int>(json, r'orphan_file')!,
|
||||
@@ -65,11 +65,11 @@ class MaintenanceIntegrityReportSummaryResponseDto {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<MaintenanceIntegrityReportSummaryResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <MaintenanceIntegrityReportSummaryResponseDto>[];
|
||||
static List<IntegrityReportSummaryResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <IntegrityReportSummaryResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = MaintenanceIntegrityReportSummaryResponseDto.fromJson(row);
|
||||
final value = IntegrityReportSummaryResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
@@ -78,12 +78,12 @@ class MaintenanceIntegrityReportSummaryResponseDto {
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, MaintenanceIntegrityReportSummaryResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, MaintenanceIntegrityReportSummaryResponseDto>{};
|
||||
static Map<String, IntegrityReportSummaryResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, IntegrityReportSummaryResponseDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = MaintenanceIntegrityReportSummaryResponseDto.fromJson(entry.value);
|
||||
final value = IntegrityReportSummaryResponseDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
@@ -92,14 +92,14 @@ class MaintenanceIntegrityReportSummaryResponseDto {
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of MaintenanceIntegrityReportSummaryResponseDto-objects as value to a dart map
|
||||
static Map<String, List<MaintenanceIntegrityReportSummaryResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<MaintenanceIntegrityReportSummaryResponseDto>>{};
|
||||
// maps a json object with a list of IntegrityReportSummaryResponseDto-objects as value to a dart map
|
||||
static Map<String, List<IntegrityReportSummaryResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<IntegrityReportSummaryResponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = MaintenanceIntegrityReportSummaryResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
map[entry.key] = IntegrityReportSummaryResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
Reference in New Issue
Block a user