feat: system integrity check in restore flow

This commit is contained in:
izzy
2025-11-21 16:37:28 +00:00
parent d2a4dd67d8
commit cbf3a2c3cb
14 changed files with 510 additions and 25 deletions

View File

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

View File

@@ -14,31 +14,25 @@ class MaintenanceListBackupsResponseDto {
/// Returns a new [MaintenanceListBackupsResponseDto] instance.
MaintenanceListBackupsResponseDto({
this.backups = const [],
this.failedBackups = const [],
});
List<String> backups;
List<String> failedBackups;
@override
bool operator ==(Object other) => identical(this, other) || other is MaintenanceListBackupsResponseDto &&
_deepEquality.equals(other.backups, backups) &&
_deepEquality.equals(other.failedBackups, failedBackups);
_deepEquality.equals(other.backups, backups);
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(backups.hashCode) +
(failedBackups.hashCode);
(backups.hashCode);
@override
String toString() => 'MaintenanceListBackupsResponseDto[backups=$backups, failedBackups=$failedBackups]';
String toString() => 'MaintenanceListBackupsResponseDto[backups=$backups]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'backups'] = this.backups;
json[r'failedBackups'] = this.failedBackups;
return json;
}
@@ -54,9 +48,6 @@ class MaintenanceListBackupsResponseDto {
backups: json[r'backups'] is Iterable
? (json[r'backups'] as Iterable).cast<String>().toList(growable: false)
: const [],
failedBackups: json[r'failedBackups'] is Iterable
? (json[r'failedBackups'] as Iterable).cast<String>().toList(growable: false)
: const [],
);
}
return null;
@@ -105,7 +96,6 @@ class MaintenanceListBackupsResponseDto {
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'backups',
'failedBackups',
};
}