fix: ensure name spec is defined correctly

This commit is contained in:
izzy
2026-01-12 14:05:37 +00:00
parent d1fb292055
commit efe0606863
20 changed files with 643 additions and 33 deletions
+82
View File
@@ -0,0 +1,82 @@
//
// 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 DatabaseBackup {
/// Instantiate a new enum with the provided [value].
const DatabaseBackup._(this.value);
/// The underlying value of this enum member.
final String value;
@override
String toString() => value;
String toJson() => value;
static const databaseBackup = DatabaseBackup._(r'DatabaseBackup');
/// List of all possible values in this [enum][DatabaseBackup].
static const values = <DatabaseBackup>[
databaseBackup,
];
static DatabaseBackup? fromJson(dynamic value) => DatabaseBackupTypeTransformer().decode(value);
static List<DatabaseBackup> listFromJson(dynamic json, {bool growable = false,}) {
final result = <DatabaseBackup>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = DatabaseBackup.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
}
/// Transformation class that can [encode] an instance of [DatabaseBackup] to String,
/// and [decode] dynamic data back to [DatabaseBackup].
class DatabaseBackupTypeTransformer {
factory DatabaseBackupTypeTransformer() => _instance ??= const DatabaseBackupTypeTransformer._();
const DatabaseBackupTypeTransformer._();
String encode(DatabaseBackup data) => data.value;
/// Decodes a [dynamic value][data] to a DatabaseBackup.
///
/// 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.
DatabaseBackup? decode(dynamic data, {bool allowNull = true}) {
if (data != null) {
switch (data) {
case r'DatabaseBackup': return DatabaseBackup.databaseBackup;
default:
if (!allowNull) {
throw ArgumentError('Unknown enum value to decode: $data');
}
}
}
return null;
}
/// Singleton [DatabaseBackupTypeTransformer] instance.
static DatabaseBackupTypeTransformer? _instance;
}
+2 -2
View File
@@ -19,7 +19,7 @@ class JobDatabaseBackup {
BaseJobData data;
num name;
DatabaseBackup name;
@override
bool operator ==(Object other) => identical(this, other) || other is JobDatabaseBackup &&
@@ -52,7 +52,7 @@ class JobDatabaseBackup {
return JobDatabaseBackup(
data: BaseJobData.fromJson(json[r'data'])!,
name: num.parse('${json[r'name']}'),
name: DatabaseBackup.fromJson(json[r'name'])!,
);
}
return null;
+2 -2
View File
@@ -19,7 +19,7 @@ class JobMemoryCleanup {
BaseJobData data;
num name;
MemoryCleanup name;
@override
bool operator ==(Object other) => identical(this, other) || other is JobMemoryCleanup &&
@@ -52,7 +52,7 @@ class JobMemoryCleanup {
return JobMemoryCleanup(
data: BaseJobData.fromJson(json[r'data'])!,
name: num.parse('${json[r'name']}'),
name: MemoryCleanup.fromJson(json[r'name'])!,
);
}
return null;
+2 -2
View File
@@ -19,7 +19,7 @@ class JobMemoryGenerate {
BaseJobData data;
num name;
MemoryGenerate name;
@override
bool operator ==(Object other) => identical(this, other) || other is JobMemoryGenerate &&
@@ -52,7 +52,7 @@ class JobMemoryGenerate {
return JobMemoryGenerate(
data: BaseJobData.fromJson(json[r'data'])!,
name: num.parse('${json[r'name']}'),
name: MemoryGenerate.fromJson(json[r'name'])!,
);
}
return null;
+2 -2
View File
@@ -19,7 +19,7 @@ class JobPersonCleanup {
BaseJobData data;
num name;
PersonCleanup name;
@override
bool operator ==(Object other) => identical(this, other) || other is JobPersonCleanup &&
@@ -52,7 +52,7 @@ class JobPersonCleanup {
return JobPersonCleanup(
data: BaseJobData.fromJson(json[r'data'])!,
name: num.parse('${json[r'name']}'),
name: PersonCleanup.fromJson(json[r'name'])!,
);
}
return null;
+2 -2
View File
@@ -19,7 +19,7 @@ class JobTagCleanup {
BaseJobData data;
num name;
TagCleanup name;
@override
bool operator ==(Object other) => identical(this, other) || other is JobTagCleanup &&
@@ -52,7 +52,7 @@ class JobTagCleanup {
return JobTagCleanup(
data: BaseJobData.fromJson(json[r'data'])!,
name: num.parse('${json[r'name']}'),
name: TagCleanup.fromJson(json[r'name'])!,
);
}
return null;
+2 -2
View File
@@ -19,7 +19,7 @@ class JobUserDeleteCheck {
BaseJobData data;
num name;
UserDeleteCheck name;
@override
bool operator ==(Object other) => identical(this, other) || other is JobUserDeleteCheck &&
@@ -52,7 +52,7 @@ class JobUserDeleteCheck {
return JobUserDeleteCheck(
data: BaseJobData.fromJson(json[r'data'])!,
name: num.parse('${json[r'name']}'),
name: UserDeleteCheck.fromJson(json[r'name'])!,
);
}
return null;
+82
View File
@@ -0,0 +1,82 @@
//
// 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 MemoryCleanup {
/// Instantiate a new enum with the provided [value].
const MemoryCleanup._(this.value);
/// The underlying value of this enum member.
final String value;
@override
String toString() => value;
String toJson() => value;
static const memoryCleanup = MemoryCleanup._(r'MemoryCleanup');
/// List of all possible values in this [enum][MemoryCleanup].
static const values = <MemoryCleanup>[
memoryCleanup,
];
static MemoryCleanup? fromJson(dynamic value) => MemoryCleanupTypeTransformer().decode(value);
static List<MemoryCleanup> listFromJson(dynamic json, {bool growable = false,}) {
final result = <MemoryCleanup>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = MemoryCleanup.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
}
/// Transformation class that can [encode] an instance of [MemoryCleanup] to String,
/// and [decode] dynamic data back to [MemoryCleanup].
class MemoryCleanupTypeTransformer {
factory MemoryCleanupTypeTransformer() => _instance ??= const MemoryCleanupTypeTransformer._();
const MemoryCleanupTypeTransformer._();
String encode(MemoryCleanup data) => data.value;
/// Decodes a [dynamic value][data] to a MemoryCleanup.
///
/// 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.
MemoryCleanup? decode(dynamic data, {bool allowNull = true}) {
if (data != null) {
switch (data) {
case r'MemoryCleanup': return MemoryCleanup.memoryCleanup;
default:
if (!allowNull) {
throw ArgumentError('Unknown enum value to decode: $data');
}
}
}
return null;
}
/// Singleton [MemoryCleanupTypeTransformer] instance.
static MemoryCleanupTypeTransformer? _instance;
}
+82
View File
@@ -0,0 +1,82 @@
//
// 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 MemoryGenerate {
/// Instantiate a new enum with the provided [value].
const MemoryGenerate._(this.value);
/// The underlying value of this enum member.
final String value;
@override
String toString() => value;
String toJson() => value;
static const memoryGenerate = MemoryGenerate._(r'MemoryGenerate');
/// List of all possible values in this [enum][MemoryGenerate].
static const values = <MemoryGenerate>[
memoryGenerate,
];
static MemoryGenerate? fromJson(dynamic value) => MemoryGenerateTypeTransformer().decode(value);
static List<MemoryGenerate> listFromJson(dynamic json, {bool growable = false,}) {
final result = <MemoryGenerate>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = MemoryGenerate.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
}
/// Transformation class that can [encode] an instance of [MemoryGenerate] to String,
/// and [decode] dynamic data back to [MemoryGenerate].
class MemoryGenerateTypeTransformer {
factory MemoryGenerateTypeTransformer() => _instance ??= const MemoryGenerateTypeTransformer._();
const MemoryGenerateTypeTransformer._();
String encode(MemoryGenerate data) => data.value;
/// Decodes a [dynamic value][data] to a MemoryGenerate.
///
/// 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.
MemoryGenerate? decode(dynamic data, {bool allowNull = true}) {
if (data != null) {
switch (data) {
case r'MemoryGenerate': return MemoryGenerate.memoryGenerate;
default:
if (!allowNull) {
throw ArgumentError('Unknown enum value to decode: $data');
}
}
}
return null;
}
/// Singleton [MemoryGenerateTypeTransformer] instance.
static MemoryGenerateTypeTransformer? _instance;
}
+82
View File
@@ -0,0 +1,82 @@
//
// 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 PersonCleanup {
/// Instantiate a new enum with the provided [value].
const PersonCleanup._(this.value);
/// The underlying value of this enum member.
final String value;
@override
String toString() => value;
String toJson() => value;
static const personCleanup = PersonCleanup._(r'PersonCleanup');
/// List of all possible values in this [enum][PersonCleanup].
static const values = <PersonCleanup>[
personCleanup,
];
static PersonCleanup? fromJson(dynamic value) => PersonCleanupTypeTransformer().decode(value);
static List<PersonCleanup> listFromJson(dynamic json, {bool growable = false,}) {
final result = <PersonCleanup>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = PersonCleanup.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
}
/// Transformation class that can [encode] an instance of [PersonCleanup] to String,
/// and [decode] dynamic data back to [PersonCleanup].
class PersonCleanupTypeTransformer {
factory PersonCleanupTypeTransformer() => _instance ??= const PersonCleanupTypeTransformer._();
const PersonCleanupTypeTransformer._();
String encode(PersonCleanup data) => data.value;
/// Decodes a [dynamic value][data] to a PersonCleanup.
///
/// 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.
PersonCleanup? decode(dynamic data, {bool allowNull = true}) {
if (data != null) {
switch (data) {
case r'PersonCleanup': return PersonCleanup.personCleanup;
default:
if (!allowNull) {
throw ArgumentError('Unknown enum value to decode: $data');
}
}
}
return null;
}
/// Singleton [PersonCleanupTypeTransformer] instance.
static PersonCleanupTypeTransformer? _instance;
}
+2 -2
View File
@@ -19,7 +19,7 @@ class QueueJobCreateDtoJob {
BaseJobData data;
num name;
DatabaseBackup name;
@override
bool operator ==(Object other) => identical(this, other) || other is QueueJobCreateDtoJob &&
@@ -52,7 +52,7 @@ class QueueJobCreateDtoJob {
return QueueJobCreateDtoJob(
data: BaseJobData.fromJson(json[r'data'])!,
name: num.parse('${json[r'name']}'),
name: DatabaseBackup.fromJson(json[r'name'])!,
);
}
return null;
+82
View File
@@ -0,0 +1,82 @@
//
// 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 TagCleanup {
/// Instantiate a new enum with the provided [value].
const TagCleanup._(this.value);
/// The underlying value of this enum member.
final String value;
@override
String toString() => value;
String toJson() => value;
static const tagCleanup = TagCleanup._(r'TagCleanup');
/// List of all possible values in this [enum][TagCleanup].
static const values = <TagCleanup>[
tagCleanup,
];
static TagCleanup? fromJson(dynamic value) => TagCleanupTypeTransformer().decode(value);
static List<TagCleanup> listFromJson(dynamic json, {bool growable = false,}) {
final result = <TagCleanup>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = TagCleanup.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
}
/// Transformation class that can [encode] an instance of [TagCleanup] to String,
/// and [decode] dynamic data back to [TagCleanup].
class TagCleanupTypeTransformer {
factory TagCleanupTypeTransformer() => _instance ??= const TagCleanupTypeTransformer._();
const TagCleanupTypeTransformer._();
String encode(TagCleanup data) => data.value;
/// Decodes a [dynamic value][data] to a TagCleanup.
///
/// 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.
TagCleanup? decode(dynamic data, {bool allowNull = true}) {
if (data != null) {
switch (data) {
case r'TagCleanup': return TagCleanup.tagCleanup;
default:
if (!allowNull) {
throw ArgumentError('Unknown enum value to decode: $data');
}
}
}
return null;
}
/// Singleton [TagCleanupTypeTransformer] instance.
static TagCleanupTypeTransformer? _instance;
}
+82
View File
@@ -0,0 +1,82 @@
//
// 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 UserDeleteCheck {
/// Instantiate a new enum with the provided [value].
const UserDeleteCheck._(this.value);
/// The underlying value of this enum member.
final String value;
@override
String toString() => value;
String toJson() => value;
static const userDeleteCheck = UserDeleteCheck._(r'UserDeleteCheck');
/// List of all possible values in this [enum][UserDeleteCheck].
static const values = <UserDeleteCheck>[
userDeleteCheck,
];
static UserDeleteCheck? fromJson(dynamic value) => UserDeleteCheckTypeTransformer().decode(value);
static List<UserDeleteCheck> listFromJson(dynamic json, {bool growable = false,}) {
final result = <UserDeleteCheck>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = UserDeleteCheck.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
}
/// Transformation class that can [encode] an instance of [UserDeleteCheck] to String,
/// and [decode] dynamic data back to [UserDeleteCheck].
class UserDeleteCheckTypeTransformer {
factory UserDeleteCheckTypeTransformer() => _instance ??= const UserDeleteCheckTypeTransformer._();
const UserDeleteCheckTypeTransformer._();
String encode(UserDeleteCheck data) => data.value;
/// Decodes a [dynamic value][data] to a UserDeleteCheck.
///
/// 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.
UserDeleteCheck? decode(dynamic data, {bool allowNull = true}) {
if (data != null) {
switch (data) {
case r'UserDeleteCheck': return UserDeleteCheck.userDeleteCheck;
default:
if (!allowNull) {
throw ArgumentError('Unknown enum value to decode: $data');
}
}
}
return null;
}
/// Singleton [UserDeleteCheckTypeTransformer] instance.
static UserDeleteCheckTypeTransformer? _instance;
}