chore: oapi

This commit is contained in:
izzy
2026-05-18 16:32:30 +01:00
parent cb87a39b3a
commit a41aa623da
17 changed files with 9352 additions and 18 deletions
@@ -18,6 +18,7 @@ class ConfigureImmichIntegrationRequestDto {
this.dataFolders = const [],
required this.libraries,
required this.name,
this.retentionPolicy,
required this.worm,
});
@@ -31,6 +32,8 @@ class ConfigureImmichIntegrationRequestDto {
String name;
RetentionPolicyDto? retentionPolicy;
bool worm;
@override
@@ -40,6 +43,7 @@ class ConfigureImmichIntegrationRequestDto {
_deepEquality.equals(other.dataFolders, dataFolders) &&
other.libraries == libraries &&
other.name == name &&
other.retentionPolicy == retentionPolicy &&
other.worm == worm;
@override
@@ -50,10 +54,11 @@ class ConfigureImmichIntegrationRequestDto {
(dataFolders.hashCode) +
(libraries.hashCode) +
(name.hashCode) +
(retentionPolicy == null ? 0 : retentionPolicy!.hashCode) +
(worm.hashCode);
@override
String toString() => 'ConfigureImmichIntegrationRequestDto[backupConfiguration=$backupConfiguration, cron=$cron, dataFolders=$dataFolders, libraries=$libraries, name=$name, worm=$worm]';
String toString() => 'ConfigureImmichIntegrationRequestDto[backupConfiguration=$backupConfiguration, cron=$cron, dataFolders=$dataFolders, libraries=$libraries, name=$name, retentionPolicy=$retentionPolicy, worm=$worm]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@@ -62,6 +67,11 @@ class ConfigureImmichIntegrationRequestDto {
json[r'dataFolders'] = this.dataFolders;
json[r'libraries'] = this.libraries;
json[r'name'] = this.name;
if (this.retentionPolicy != null) {
json[r'retentionPolicy'] = this.retentionPolicy;
} else {
// json[r'retentionPolicy'] = null;
}
json[r'worm'] = this.worm;
return json;
}
@@ -82,6 +92,7 @@ class ConfigureImmichIntegrationRequestDto {
: const [],
libraries: ConfigureImmichIntegrationRequestDtoLibraries.fromJson(json[r'libraries'])!,
name: mapValueOfType<String>(json, r'name')!,
retentionPolicy: RetentionPolicyDto.fromJson(json[r'retentionPolicy']),
worm: mapValueOfType<bool>(json, r'worm')!,
);
}
+14 -3
View File
@@ -14,25 +14,35 @@ class RepositoryConfigurationDto {
/// Returns a new [RepositoryConfigurationDto] instance.
RepositoryConfigurationDto({
this.paths = const [],
this.retentionPolicy,
});
List<String> paths;
RetentionPolicyDto? retentionPolicy;
@override
bool operator ==(Object other) => identical(this, other) || other is RepositoryConfigurationDto &&
_deepEquality.equals(other.paths, paths);
_deepEquality.equals(other.paths, paths) &&
other.retentionPolicy == retentionPolicy;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(paths.hashCode);
(paths.hashCode) +
(retentionPolicy == null ? 0 : retentionPolicy!.hashCode);
@override
String toString() => 'RepositoryConfigurationDto[paths=$paths]';
String toString() => 'RepositoryConfigurationDto[paths=$paths, retentionPolicy=$retentionPolicy]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'paths'] = this.paths;
if (this.retentionPolicy != null) {
json[r'retentionPolicy'] = this.retentionPolicy;
} else {
// json[r'retentionPolicy'] = null;
}
return json;
}
@@ -48,6 +58,7 @@ class RepositoryConfigurationDto {
paths: json[r'paths'] is Iterable
? (json[r'paths'] as Iterable).cast<String>().toList(growable: false)
: const [],
retentionPolicy: RetentionPolicyDto.fromJson(json[r'retentionPolicy']),
);
}
return null;
+14 -3
View File
@@ -15,6 +15,7 @@ class RepositoryUpdateRequestDto {
RepositoryUpdateRequestDto({
this.name,
this.paths = const [],
this.retentionPolicy,
});
///
@@ -27,19 +28,23 @@ class RepositoryUpdateRequestDto {
List<String> paths;
RetentionPolicyDto? retentionPolicy;
@override
bool operator ==(Object other) => identical(this, other) || other is RepositoryUpdateRequestDto &&
other.name == name &&
_deepEquality.equals(other.paths, paths);
_deepEquality.equals(other.paths, paths) &&
other.retentionPolicy == retentionPolicy;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(name == null ? 0 : name!.hashCode) +
(paths.hashCode);
(paths.hashCode) +
(retentionPolicy == null ? 0 : retentionPolicy!.hashCode);
@override
String toString() => 'RepositoryUpdateRequestDto[name=$name, paths=$paths]';
String toString() => 'RepositoryUpdateRequestDto[name=$name, paths=$paths, retentionPolicy=$retentionPolicy]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@@ -49,6 +54,11 @@ class RepositoryUpdateRequestDto {
// json[r'name'] = null;
}
json[r'paths'] = this.paths;
if (this.retentionPolicy != null) {
json[r'retentionPolicy'] = this.retentionPolicy;
} else {
// json[r'retentionPolicy'] = null;
}
return json;
}
@@ -65,6 +75,7 @@ class RepositoryUpdateRequestDto {
paths: json[r'paths'] is Iterable
? (json[r'paths'] as Iterable).cast<String>().toList(growable: false)
: const [],
retentionPolicy: RetentionPolicyDto.fromJson(json[r'retentionPolicy']),
);
}
return null;
+210
View File
@@ -0,0 +1,210 @@
//
// 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 RetentionPolicyDto {
/// Returns a new [RetentionPolicyDto] instance.
RetentionPolicyDto({
this.keepLast,
this.keepWithin,
this.keepWithinDaily,
this.keepWithinHourly,
this.keepWithinMonthly,
this.keepWithinWeekly,
this.keepWithinYearly,
});
///
/// 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.
///
num? keepLast;
///
/// 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.
///
String? keepWithin;
///
/// 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.
///
String? keepWithinDaily;
///
/// 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.
///
String? keepWithinHourly;
///
/// 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.
///
String? keepWithinMonthly;
///
/// 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.
///
String? keepWithinWeekly;
///
/// 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.
///
String? keepWithinYearly;
@override
bool operator ==(Object other) => identical(this, other) || other is RetentionPolicyDto &&
other.keepLast == keepLast &&
other.keepWithin == keepWithin &&
other.keepWithinDaily == keepWithinDaily &&
other.keepWithinHourly == keepWithinHourly &&
other.keepWithinMonthly == keepWithinMonthly &&
other.keepWithinWeekly == keepWithinWeekly &&
other.keepWithinYearly == keepWithinYearly;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(keepLast == null ? 0 : keepLast!.hashCode) +
(keepWithin == null ? 0 : keepWithin!.hashCode) +
(keepWithinDaily == null ? 0 : keepWithinDaily!.hashCode) +
(keepWithinHourly == null ? 0 : keepWithinHourly!.hashCode) +
(keepWithinMonthly == null ? 0 : keepWithinMonthly!.hashCode) +
(keepWithinWeekly == null ? 0 : keepWithinWeekly!.hashCode) +
(keepWithinYearly == null ? 0 : keepWithinYearly!.hashCode);
@override
String toString() => 'RetentionPolicyDto[keepLast=$keepLast, keepWithin=$keepWithin, keepWithinDaily=$keepWithinDaily, keepWithinHourly=$keepWithinHourly, keepWithinMonthly=$keepWithinMonthly, keepWithinWeekly=$keepWithinWeekly, keepWithinYearly=$keepWithinYearly]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.keepLast != null) {
json[r'keepLast'] = this.keepLast;
} else {
// json[r'keepLast'] = null;
}
if (this.keepWithin != null) {
json[r'keepWithin'] = this.keepWithin;
} else {
// json[r'keepWithin'] = null;
}
if (this.keepWithinDaily != null) {
json[r'keepWithinDaily'] = this.keepWithinDaily;
} else {
// json[r'keepWithinDaily'] = null;
}
if (this.keepWithinHourly != null) {
json[r'keepWithinHourly'] = this.keepWithinHourly;
} else {
// json[r'keepWithinHourly'] = null;
}
if (this.keepWithinMonthly != null) {
json[r'keepWithinMonthly'] = this.keepWithinMonthly;
} else {
// json[r'keepWithinMonthly'] = null;
}
if (this.keepWithinWeekly != null) {
json[r'keepWithinWeekly'] = this.keepWithinWeekly;
} else {
// json[r'keepWithinWeekly'] = null;
}
if (this.keepWithinYearly != null) {
json[r'keepWithinYearly'] = this.keepWithinYearly;
} else {
// json[r'keepWithinYearly'] = null;
}
return json;
}
/// Returns a new [RetentionPolicyDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static RetentionPolicyDto? fromJson(dynamic value) {
upgradeDto(value, "RetentionPolicyDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return RetentionPolicyDto(
keepLast: num.parse('${json[r'keepLast']}'),
keepWithin: mapValueOfType<String>(json, r'keepWithin'),
keepWithinDaily: mapValueOfType<String>(json, r'keepWithinDaily'),
keepWithinHourly: mapValueOfType<String>(json, r'keepWithinHourly'),
keepWithinMonthly: mapValueOfType<String>(json, r'keepWithinMonthly'),
keepWithinWeekly: mapValueOfType<String>(json, r'keepWithinWeekly'),
keepWithinYearly: mapValueOfType<String>(json, r'keepWithinYearly'),
);
}
return null;
}
static List<RetentionPolicyDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <RetentionPolicyDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = RetentionPolicyDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, RetentionPolicyDto> mapFromJson(dynamic json) {
final map = <String, RetentionPolicyDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = RetentionPolicyDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of RetentionPolicyDto-objects as value to a dart map
static Map<String, List<RetentionPolicyDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<RetentionPolicyDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = RetentionPolicyDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
}
+9 -3
View File
@@ -23,13 +23,17 @@ class RunType {
String toJson() => value;
static const backup = RunType._(r'backup');
static const schedule = RunType._(r'schedule');
static const restore = RunType._(r'restore');
static const backup = RunType._(r'backup');
static const forget = RunType._(r'forget');
/// List of all possible values in this [enum][RunType].
static const values = <RunType>[
backup,
schedule,
restore,
backup,
forget,
];
static RunType? fromJson(dynamic value) => RunTypeTypeTransformer().decode(value);
@@ -68,8 +72,10 @@ class RunTypeTypeTransformer {
RunType? decode(dynamic data, {bool allowNull = true}) {
if (data != null) {
switch (data) {
case r'backup': return RunType.backup;
case r'schedule': return RunType.schedule;
case r'restore': return RunType.restore;
case r'backup': return RunType.backup;
case r'forget': return RunType.forget;
default:
if (!allowNull) {
throw ArgumentError('Unknown enum value to decode: $data');