fix: annotate oneOf in open api schema

This commit is contained in:
izzy
2026-01-12 13:50:36 +00:00
parent b49ee6d90d
commit d1fb292055
15 changed files with 1050 additions and 5 deletions

View File

@@ -389,6 +389,7 @@ Class | Method | HTTP request | Description
- [AudioCodec](doc//AudioCodec.md)
- [AuthStatusResponseDto](doc//AuthStatusResponseDto.md)
- [AvatarUpdate](doc//AvatarUpdate.md)
- [BaseJobData](doc//BaseJobData.md)
- [BulkIdErrorReason](doc//BulkIdErrorReason.md)
- [BulkIdResponseDto](doc//BulkIdResponseDto.md)
- [BulkIdsDto](doc//BulkIdsDto.md)
@@ -422,8 +423,14 @@ Class | Method | HTTP request | Description
- [FoldersUpdate](doc//FoldersUpdate.md)
- [ImageFormat](doc//ImageFormat.md)
- [JobCreateDto](doc//JobCreateDto.md)
- [JobDatabaseBackup](doc//JobDatabaseBackup.md)
- [JobMemoryCleanup](doc//JobMemoryCleanup.md)
- [JobMemoryGenerate](doc//JobMemoryGenerate.md)
- [JobName](doc//JobName.md)
- [JobPersonCleanup](doc//JobPersonCleanup.md)
- [JobSettingsDto](doc//JobSettingsDto.md)
- [JobTagCleanup](doc//JobTagCleanup.md)
- [JobUserDeleteCheck](doc//JobUserDeleteCheck.md)
- [LibraryResponseDto](doc//LibraryResponseDto.md)
- [LibraryStatsResponseDto](doc//LibraryStatsResponseDto.md)
- [LicenseKeyDto](doc//LicenseKeyDto.md)
@@ -497,6 +504,7 @@ Class | Method | HTTP request | Description
- [QueueCommandDto](doc//QueueCommandDto.md)
- [QueueDeleteDto](doc//QueueDeleteDto.md)
- [QueueJobCreateDto](doc//QueueJobCreateDto.md)
- [QueueJobCreateDtoJob](doc//QueueJobCreateDtoJob.md)
- [QueueJobResponseDto](doc//QueueJobResponseDto.md)
- [QueueJobStatus](doc//QueueJobStatus.md)
- [QueueName](doc//QueueName.md)

View File

@@ -134,6 +134,7 @@ part 'model/asset_visibility.dart';
part 'model/audio_codec.dart';
part 'model/auth_status_response_dto.dart';
part 'model/avatar_update.dart';
part 'model/base_job_data.dart';
part 'model/bulk_id_error_reason.dart';
part 'model/bulk_id_response_dto.dart';
part 'model/bulk_ids_dto.dart';
@@ -167,8 +168,14 @@ part 'model/folders_response.dart';
part 'model/folders_update.dart';
part 'model/image_format.dart';
part 'model/job_create_dto.dart';
part 'model/job_database_backup.dart';
part 'model/job_memory_cleanup.dart';
part 'model/job_memory_generate.dart';
part 'model/job_name.dart';
part 'model/job_person_cleanup.dart';
part 'model/job_settings_dto.dart';
part 'model/job_tag_cleanup.dart';
part 'model/job_user_delete_check.dart';
part 'model/library_response_dto.dart';
part 'model/library_stats_response_dto.dart';
part 'model/license_key_dto.dart';
@@ -242,6 +249,7 @@ part 'model/queue_command.dart';
part 'model/queue_command_dto.dart';
part 'model/queue_delete_dto.dart';
part 'model/queue_job_create_dto.dart';
part 'model/queue_job_create_dto_job.dart';
part 'model/queue_job_response_dto.dart';
part 'model/queue_job_status.dart';
part 'model/queue_name.dart';

View File

@@ -316,6 +316,8 @@ class ApiClient {
return AuthStatusResponseDto.fromJson(value);
case 'AvatarUpdate':
return AvatarUpdate.fromJson(value);
case 'BaseJobData':
return BaseJobData.fromJson(value);
case 'BulkIdErrorReason':
return BulkIdErrorReasonTypeTransformer().decode(value);
case 'BulkIdResponseDto':
@@ -382,10 +384,22 @@ class ApiClient {
return ImageFormatTypeTransformer().decode(value);
case 'JobCreateDto':
return JobCreateDto.fromJson(value);
case 'JobDatabaseBackup':
return JobDatabaseBackup.fromJson(value);
case 'JobMemoryCleanup':
return JobMemoryCleanup.fromJson(value);
case 'JobMemoryGenerate':
return JobMemoryGenerate.fromJson(value);
case 'JobName':
return JobNameTypeTransformer().decode(value);
case 'JobPersonCleanup':
return JobPersonCleanup.fromJson(value);
case 'JobSettingsDto':
return JobSettingsDto.fromJson(value);
case 'JobTagCleanup':
return JobTagCleanup.fromJson(value);
case 'JobUserDeleteCheck':
return JobUserDeleteCheck.fromJson(value);
case 'LibraryResponseDto':
return LibraryResponseDto.fromJson(value);
case 'LibraryStatsResponseDto':
@@ -532,6 +546,8 @@ class ApiClient {
return QueueDeleteDto.fromJson(value);
case 'QueueJobCreateDto':
return QueueJobCreateDto.fromJson(value);
case 'QueueJobCreateDtoJob':
return QueueJobCreateDtoJob.fromJson(value);
case 'QueueJobResponseDto':
return QueueJobResponseDto.fromJson(value);
case 'QueueJobStatus':

View File

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

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

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

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

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

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

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

View File

@@ -16,7 +16,7 @@ class QueueJobCreateDto {
required this.job,
});
Object job;
QueueJobCreateDtoJob job;
@override
bool operator ==(Object other) => identical(this, other) || other is QueueJobCreateDto &&
@@ -45,7 +45,7 @@ class QueueJobCreateDto {
final json = value.cast<String, dynamic>();
return QueueJobCreateDto(
job: mapValueOfType<Object>(json, r'job')!,
job: QueueJobCreateDtoJob.fromJson(json[r'job'])!,
);
}
return null;

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

View File

@@ -16575,6 +16575,14 @@
},
"type": "object"
},
"BaseJobData": {
"properties": {
"force": {
"type": "boolean"
}
},
"type": "object"
},
"BulkIdErrorReason": {
"enum": [
"duplicate",
@@ -17255,6 +17263,54 @@
],
"type": "object"
},
"JobDatabaseBackup": {
"properties": {
"data": {
"$ref": "#/components/schemas/BaseJobData"
},
"name": {
"enum": [],
"type": "number"
}
},
"required": [
"data",
"name"
],
"type": "object"
},
"JobMemoryCleanup": {
"properties": {
"data": {
"$ref": "#/components/schemas/BaseJobData"
},
"name": {
"enum": [],
"type": "number"
}
},
"required": [
"data",
"name"
],
"type": "object"
},
"JobMemoryGenerate": {
"properties": {
"data": {
"$ref": "#/components/schemas/BaseJobData"
},
"name": {
"enum": [],
"type": "number"
}
},
"required": [
"data",
"name"
],
"type": "object"
},
"JobName": {
"enum": [
"AssetDelete",
@@ -17316,6 +17372,22 @@
],
"type": "string"
},
"JobPersonCleanup": {
"properties": {
"data": {
"$ref": "#/components/schemas/BaseJobData"
},
"name": {
"enum": [],
"type": "number"
}
},
"required": [
"data",
"name"
],
"type": "object"
},
"JobSettingsDto": {
"properties": {
"concurrency": {
@@ -17328,6 +17400,38 @@
],
"type": "object"
},
"JobTagCleanup": {
"properties": {
"data": {
"$ref": "#/components/schemas/BaseJobData"
},
"name": {
"enum": [],
"type": "number"
}
},
"required": [
"data",
"name"
],
"type": "object"
},
"JobUserDeleteCheck": {
"properties": {
"data": {
"$ref": "#/components/schemas/BaseJobData"
},
"name": {
"enum": [],
"type": "number"
}
},
"required": [
"data",
"name"
],
"type": "object"
},
"LibraryResponseDto": {
"properties": {
"assetCount": {
@@ -19188,7 +19292,26 @@
"QueueJobCreateDto": {
"properties": {
"job": {
"type": "object"
"oneOf": [
{
"$ref": "#/components/schemas/JobTagCleanup"
},
{
"$ref": "#/components/schemas/JobPersonCleanup"
},
{
"$ref": "#/components/schemas/JobUserDeleteCheck"
},
{
"$ref": "#/components/schemas/JobMemoryCleanup"
},
{
"$ref": "#/components/schemas/JobMemoryGenerate"
},
{
"$ref": "#/components/schemas/JobDatabaseBackup"
}
]
}
},
"required": [

View File

@@ -1038,8 +1038,35 @@ export type QueueResponseDto = {
name: QueueName;
statistics: QueueStatisticsDto;
};
export type BaseJobData = {
force?: boolean;
};
export type JobTagCleanup = {
data: BaseJobData;
name: Name;
};
export type JobPersonCleanup = {
data: BaseJobData;
name: Name;
};
export type JobUserDeleteCheck = {
data: BaseJobData;
name: Name;
};
export type JobMemoryCleanup = {
data: BaseJobData;
name: Name;
};
export type JobMemoryGenerate = {
data: BaseJobData;
name: Name;
};
export type JobDatabaseBackup = {
data: BaseJobData;
name: Name;
};
export type QueueJobCreateDto = {
job: object;
job: JobTagCleanup | JobPersonCleanup | JobUserDeleteCheck | JobMemoryCleanup | JobMemoryGenerate | JobDatabaseBackup;
};
export type QueueUpdateDto = {
isPaused?: boolean;
@@ -5609,6 +5636,8 @@ export enum PluginTriggerType {
AssetCreate = "AssetCreate",
PersonRecognized = "PersonRecognized"
}
export enum Name {
}
export enum QueueJobStatus {
Active = "active",
Failed = "failed",

View File

@@ -1,4 +1,4 @@
import { ApiProperty } from '@nestjs/swagger';
import { ApiExtraModels, ApiProperty, getSchemaPath } from '@nestjs/swagger';
import { ClassConstructor, Transform, Type } from 'class-transformer';
import { Equals, IsBoolean, IsDefined, IsOptional, ValidateNested } from 'class-validator';
import { HistoryBuilder, Property } from 'src/decorators';
@@ -56,7 +56,11 @@ const JOB_MAP: Record<string, ClassConstructor<object>> = {
[JobName.DatabaseBackup]: JobDatabaseBackup,
};
@ApiExtraModels(...Object.values(JOB_MAP))
export class QueueJobCreateDto {
@ApiProperty({
oneOf: Object.values(JOB_MAP).map((job) => ({ $ref: getSchemaPath(job) })),
})
@ValidateNested()
@Transform(transformToOneOf(JOB_MAP))
@IsDefined({