mirror of
https://github.com/immich-app/immich.git
synced 2025-12-22 17:24:56 +03:00
feat: sub-pages for integrity reports
This commit is contained in:
88
mobile/openapi/lib/model/integrity_report_type.dart
generated
Normal file
88
mobile/openapi/lib/model/integrity_report_type.dart
generated
Normal file
@@ -0,0 +1,88 @@
|
||||
//
|
||||
// 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 IntegrityReportType {
|
||||
/// Instantiate a new enum with the provided [value].
|
||||
const IntegrityReportType._(this.value);
|
||||
|
||||
/// The underlying value of this enum member.
|
||||
final String value;
|
||||
|
||||
@override
|
||||
String toString() => value;
|
||||
|
||||
String toJson() => value;
|
||||
|
||||
static const orphanFile = IntegrityReportType._(r'orphan_file');
|
||||
static const missingFile = IntegrityReportType._(r'missing_file');
|
||||
static const checksumMismatch = IntegrityReportType._(r'checksum_mismatch');
|
||||
|
||||
/// List of all possible values in this [enum][IntegrityReportType].
|
||||
static const values = <IntegrityReportType>[
|
||||
orphanFile,
|
||||
missingFile,
|
||||
checksumMismatch,
|
||||
];
|
||||
|
||||
static IntegrityReportType? fromJson(dynamic value) => IntegrityReportTypeTypeTransformer().decode(value);
|
||||
|
||||
static List<IntegrityReportType> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <IntegrityReportType>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = IntegrityReportType.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
}
|
||||
|
||||
/// Transformation class that can [encode] an instance of [IntegrityReportType] to String,
|
||||
/// and [decode] dynamic data back to [IntegrityReportType].
|
||||
class IntegrityReportTypeTypeTransformer {
|
||||
factory IntegrityReportTypeTypeTransformer() => _instance ??= const IntegrityReportTypeTypeTransformer._();
|
||||
|
||||
const IntegrityReportTypeTypeTransformer._();
|
||||
|
||||
String encode(IntegrityReportType data) => data.value;
|
||||
|
||||
/// Decodes a [dynamic value][data] to a IntegrityReportType.
|
||||
///
|
||||
/// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully,
|
||||
/// then null is returned. However, if [allowNull] is false and the [dynamic value][data]
|
||||
/// cannot be decoded successfully, then an [UnimplementedError] is thrown.
|
||||
///
|
||||
/// The [allowNull] is very handy when an API changes and a new enum value is added or removed,
|
||||
/// and users are still using an old app with the old code.
|
||||
IntegrityReportType? decode(dynamic data, {bool allowNull = true}) {
|
||||
if (data != null) {
|
||||
switch (data) {
|
||||
case r'orphan_file': return IntegrityReportType.orphanFile;
|
||||
case r'missing_file': return IntegrityReportType.missingFile;
|
||||
case r'checksum_mismatch': return IntegrityReportType.checksumMismatch;
|
||||
default:
|
||||
if (!allowNull) {
|
||||
throw ArgumentError('Unknown enum value to decode: $data');
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Singleton [IntegrityReportTypeTypeTransformer] instance.
|
||||
static IntegrityReportTypeTypeTransformer? _instance;
|
||||
}
|
||||
|
||||
99
mobile/openapi/lib/model/maintenance_get_integrity_report_dto.dart
generated
Normal file
99
mobile/openapi/lib/model/maintenance_get_integrity_report_dto.dart
generated
Normal file
@@ -0,0 +1,99 @@
|
||||
//
|
||||
// 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 MaintenanceGetIntegrityReportDto {
|
||||
/// Returns a new [MaintenanceGetIntegrityReportDto] instance.
|
||||
MaintenanceGetIntegrityReportDto({
|
||||
required this.type,
|
||||
});
|
||||
|
||||
IntegrityReportType type;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is MaintenanceGetIntegrityReportDto &&
|
||||
other.type == type;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(type.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'MaintenanceGetIntegrityReportDto[type=$type]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'type'] = this.type;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [MaintenanceGetIntegrityReportDto] 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");
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return MaintenanceGetIntegrityReportDto(
|
||||
type: IntegrityReportType.fromJson(json[r'type'])!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<MaintenanceGetIntegrityReportDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <MaintenanceGetIntegrityReportDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = MaintenanceGetIntegrityReportDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, MaintenanceGetIntegrityReportDto> mapFromJson(dynamic json) {
|
||||
final map = <String, MaintenanceGetIntegrityReportDto>{};
|
||||
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);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
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>>{};
|
||||
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,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'type',
|
||||
};
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ class MaintenanceIntegrityReportDto {
|
||||
|
||||
String path;
|
||||
|
||||
MaintenanceIntegrityReportDtoTypeEnum type;
|
||||
IntegrityReportType type;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is MaintenanceIntegrityReportDto &&
|
||||
@@ -59,7 +59,7 @@ class MaintenanceIntegrityReportDto {
|
||||
return MaintenanceIntegrityReportDto(
|
||||
id: mapValueOfType<String>(json, r'id')!,
|
||||
path: mapValueOfType<String>(json, r'path')!,
|
||||
type: MaintenanceIntegrityReportDtoTypeEnum.fromJson(json[r'type'])!,
|
||||
type: IntegrityReportType.fromJson(json[r'type'])!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
@@ -113,80 +113,3 @@ class MaintenanceIntegrityReportDto {
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
class MaintenanceIntegrityReportDtoTypeEnum {
|
||||
/// Instantiate a new enum with the provided [value].
|
||||
const MaintenanceIntegrityReportDtoTypeEnum._(this.value);
|
||||
|
||||
/// The underlying value of this enum member.
|
||||
final String value;
|
||||
|
||||
@override
|
||||
String toString() => value;
|
||||
|
||||
String toJson() => value;
|
||||
|
||||
static const orphanFile = MaintenanceIntegrityReportDtoTypeEnum._(r'orphan_file');
|
||||
static const missingFile = MaintenanceIntegrityReportDtoTypeEnum._(r'missing_file');
|
||||
static const checksumMismatch = MaintenanceIntegrityReportDtoTypeEnum._(r'checksum_mismatch');
|
||||
|
||||
/// List of all possible values in this [enum][MaintenanceIntegrityReportDtoTypeEnum].
|
||||
static const values = <MaintenanceIntegrityReportDtoTypeEnum>[
|
||||
orphanFile,
|
||||
missingFile,
|
||||
checksumMismatch,
|
||||
];
|
||||
|
||||
static MaintenanceIntegrityReportDtoTypeEnum? fromJson(dynamic value) => MaintenanceIntegrityReportDtoTypeEnumTypeTransformer().decode(value);
|
||||
|
||||
static List<MaintenanceIntegrityReportDtoTypeEnum> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <MaintenanceIntegrityReportDtoTypeEnum>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = MaintenanceIntegrityReportDtoTypeEnum.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
}
|
||||
|
||||
/// Transformation class that can [encode] an instance of [MaintenanceIntegrityReportDtoTypeEnum] to String,
|
||||
/// and [decode] dynamic data back to [MaintenanceIntegrityReportDtoTypeEnum].
|
||||
class MaintenanceIntegrityReportDtoTypeEnumTypeTransformer {
|
||||
factory MaintenanceIntegrityReportDtoTypeEnumTypeTransformer() => _instance ??= const MaintenanceIntegrityReportDtoTypeEnumTypeTransformer._();
|
||||
|
||||
const MaintenanceIntegrityReportDtoTypeEnumTypeTransformer._();
|
||||
|
||||
String encode(MaintenanceIntegrityReportDtoTypeEnum data) => data.value;
|
||||
|
||||
/// Decodes a [dynamic value][data] to a MaintenanceIntegrityReportDtoTypeEnum.
|
||||
///
|
||||
/// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully,
|
||||
/// then null is returned. However, if [allowNull] is false and the [dynamic value][data]
|
||||
/// cannot be decoded successfully, then an [UnimplementedError] is thrown.
|
||||
///
|
||||
/// The [allowNull] is very handy when an API changes and a new enum value is added or removed,
|
||||
/// and users are still using an old app with the old code.
|
||||
MaintenanceIntegrityReportDtoTypeEnum? decode(dynamic data, {bool allowNull = true}) {
|
||||
if (data != null) {
|
||||
switch (data) {
|
||||
case r'orphan_file': return MaintenanceIntegrityReportDtoTypeEnum.orphanFile;
|
||||
case r'missing_file': return MaintenanceIntegrityReportDtoTypeEnum.missingFile;
|
||||
case r'checksum_mismatch': return MaintenanceIntegrityReportDtoTypeEnum.checksumMismatch;
|
||||
default:
|
||||
if (!allowNull) {
|
||||
throw ArgumentError('Unknown enum value to decode: $data');
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Singleton [MaintenanceIntegrityReportDtoTypeEnumTypeTransformer] instance.
|
||||
static MaintenanceIntegrityReportDtoTypeEnumTypeTransformer? _instance;
|
||||
}
|
||||
|
||||
|
||||
|
||||
115
mobile/openapi/lib/model/maintenance_integrity_report_summary_response_dto.dart
generated
Normal file
115
mobile/openapi/lib/model/maintenance_integrity_report_summary_response_dto.dart
generated
Normal file
@@ -0,0 +1,115 @@
|
||||
//
|
||||
// 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 MaintenanceIntegrityReportSummaryResponseDto {
|
||||
/// Returns a new [MaintenanceIntegrityReportSummaryResponseDto] instance.
|
||||
MaintenanceIntegrityReportSummaryResponseDto({
|
||||
required this.checksumMismatch,
|
||||
required this.missingFile,
|
||||
required this.orphanFile,
|
||||
});
|
||||
|
||||
int checksumMismatch;
|
||||
|
||||
int missingFile;
|
||||
|
||||
int orphanFile;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is MaintenanceIntegrityReportSummaryResponseDto &&
|
||||
other.checksumMismatch == checksumMismatch &&
|
||||
other.missingFile == missingFile &&
|
||||
other.orphanFile == orphanFile;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(checksumMismatch.hashCode) +
|
||||
(missingFile.hashCode) +
|
||||
(orphanFile.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'MaintenanceIntegrityReportSummaryResponseDto[checksumMismatch=$checksumMismatch, missingFile=$missingFile, orphanFile=$orphanFile]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'checksum_mismatch'] = this.checksumMismatch;
|
||||
json[r'missing_file'] = this.missingFile;
|
||||
json[r'orphan_file'] = this.orphanFile;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [MaintenanceIntegrityReportSummaryResponseDto] 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");
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return MaintenanceIntegrityReportSummaryResponseDto(
|
||||
checksumMismatch: mapValueOfType<int>(json, r'checksum_mismatch')!,
|
||||
missingFile: mapValueOfType<int>(json, r'missing_file')!,
|
||||
orphanFile: mapValueOfType<int>(json, r'orphan_file')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<MaintenanceIntegrityReportSummaryResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <MaintenanceIntegrityReportSummaryResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = MaintenanceIntegrityReportSummaryResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, MaintenanceIntegrityReportSummaryResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, MaintenanceIntegrityReportSummaryResponseDto>{};
|
||||
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);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
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>>{};
|
||||
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,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'checksum_mismatch',
|
||||
'missing_file',
|
||||
'orphan_file',
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user