mirror of
https://github.com/immich-app/immich.git
synced 2025-12-20 09:15:35 +03:00
feat: sync status to web app
This commit is contained in:
111
mobile/openapi/lib/model/maintenance_list_backups_response_dto.dart
generated
Normal file
111
mobile/openapi/lib/model/maintenance_list_backups_response_dto.dart
generated
Normal file
@@ -0,0 +1,111 @@
|
||||
//
|
||||
// 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 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);
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(backups.hashCode) +
|
||||
(failedBackups.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'MaintenanceListBackupsResponseDto[backups=$backups, failedBackups=$failedBackups]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'backups'] = this.backups;
|
||||
json[r'failedBackups'] = this.failedBackups;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [MaintenanceListBackupsResponseDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static MaintenanceListBackupsResponseDto? fromJson(dynamic value) {
|
||||
upgradeDto(value, "MaintenanceListBackupsResponseDto");
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return 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;
|
||||
}
|
||||
|
||||
static List<MaintenanceListBackupsResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <MaintenanceListBackupsResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = MaintenanceListBackupsResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, MaintenanceListBackupsResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, MaintenanceListBackupsResponseDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = MaintenanceListBackupsResponseDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of MaintenanceListBackupsResponseDto-objects as value to a dart map
|
||||
static Map<String, List<MaintenanceListBackupsResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<MaintenanceListBackupsResponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = MaintenanceListBackupsResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'backups',
|
||||
'failedBackups',
|
||||
};
|
||||
}
|
||||
|
||||
@@ -13,13 +13,13 @@ part of openapi.api;
|
||||
class MaintenanceStatusResponseDto {
|
||||
/// Returns a new [MaintenanceStatusResponseDto] instance.
|
||||
MaintenanceStatusResponseDto({
|
||||
this.action,
|
||||
required this.action,
|
||||
this.error,
|
||||
this.progress,
|
||||
this.task,
|
||||
});
|
||||
|
||||
MaintenanceStatusResponseDtoActionEnum? action;
|
||||
MaintenanceAction action;
|
||||
|
||||
///
|
||||
/// Please note: This property should have been non-nullable! Since the specification file
|
||||
@@ -55,7 +55,7 @@ class MaintenanceStatusResponseDto {
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(action == null ? 0 : action!.hashCode) +
|
||||
(action.hashCode) +
|
||||
(error == null ? 0 : error!.hashCode) +
|
||||
(progress == null ? 0 : progress!.hashCode) +
|
||||
(task == null ? 0 : task!.hashCode);
|
||||
@@ -65,11 +65,7 @@ class MaintenanceStatusResponseDto {
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
if (this.action != null) {
|
||||
json[r'action'] = this.action;
|
||||
} else {
|
||||
// json[r'action'] = null;
|
||||
}
|
||||
if (this.error != null) {
|
||||
json[r'error'] = this.error;
|
||||
} else {
|
||||
@@ -97,7 +93,7 @@ class MaintenanceStatusResponseDto {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return MaintenanceStatusResponseDto(
|
||||
action: MaintenanceStatusResponseDtoActionEnum.fromJson(json[r'action']),
|
||||
action: MaintenanceAction.fromJson(json[r'action'])!,
|
||||
error: mapValueOfType<String>(json, r'error'),
|
||||
progress: num.parse('${json[r'progress']}'),
|
||||
task: mapValueOfType<String>(json, r'task'),
|
||||
@@ -148,83 +144,7 @@ class MaintenanceStatusResponseDto {
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'action',
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
class MaintenanceStatusResponseDtoActionEnum {
|
||||
/// Instantiate a new enum with the provided [value].
|
||||
const MaintenanceStatusResponseDtoActionEnum._(this.value);
|
||||
|
||||
/// The underlying value of this enum member.
|
||||
final String value;
|
||||
|
||||
@override
|
||||
String toString() => value;
|
||||
|
||||
String toJson() => value;
|
||||
|
||||
static const start = MaintenanceStatusResponseDtoActionEnum._(r'start');
|
||||
static const end = MaintenanceStatusResponseDtoActionEnum._(r'end');
|
||||
static const restoreDatabase = MaintenanceStatusResponseDtoActionEnum._(r'restore_database');
|
||||
|
||||
/// List of all possible values in this [enum][MaintenanceStatusResponseDtoActionEnum].
|
||||
static const values = <MaintenanceStatusResponseDtoActionEnum>[
|
||||
start,
|
||||
end,
|
||||
restoreDatabase,
|
||||
];
|
||||
|
||||
static MaintenanceStatusResponseDtoActionEnum? fromJson(dynamic value) => MaintenanceStatusResponseDtoActionEnumTypeTransformer().decode(value);
|
||||
|
||||
static List<MaintenanceStatusResponseDtoActionEnum> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <MaintenanceStatusResponseDtoActionEnum>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = MaintenanceStatusResponseDtoActionEnum.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
}
|
||||
|
||||
/// Transformation class that can [encode] an instance of [MaintenanceStatusResponseDtoActionEnum] to String,
|
||||
/// and [decode] dynamic data back to [MaintenanceStatusResponseDtoActionEnum].
|
||||
class MaintenanceStatusResponseDtoActionEnumTypeTransformer {
|
||||
factory MaintenanceStatusResponseDtoActionEnumTypeTransformer() => _instance ??= const MaintenanceStatusResponseDtoActionEnumTypeTransformer._();
|
||||
|
||||
const MaintenanceStatusResponseDtoActionEnumTypeTransformer._();
|
||||
|
||||
String encode(MaintenanceStatusResponseDtoActionEnum data) => data.value;
|
||||
|
||||
/// Decodes a [dynamic value][data] to a MaintenanceStatusResponseDtoActionEnum.
|
||||
///
|
||||
/// 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.
|
||||
MaintenanceStatusResponseDtoActionEnum? decode(dynamic data, {bool allowNull = true}) {
|
||||
if (data != null) {
|
||||
switch (data) {
|
||||
case r'start': return MaintenanceStatusResponseDtoActionEnum.start;
|
||||
case r'end': return MaintenanceStatusResponseDtoActionEnum.end;
|
||||
case r'restore_database': return MaintenanceStatusResponseDtoActionEnum.restoreDatabase;
|
||||
default:
|
||||
if (!allowNull) {
|
||||
throw ArgumentError('Unknown enum value to decode: $data');
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Singleton [MaintenanceStatusResponseDtoActionEnumTypeTransformer] instance.
|
||||
static MaintenanceStatusResponseDtoActionEnumTypeTransformer? _instance;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user