mirror of
https://github.com/immich-app/immich.git
synced 2025-12-06 09:13:13 +03:00
refactor: job vs queue naming (#23902)
This commit is contained in:
16
mobile/openapi/README.md
generated
16
mobile/openapi/README.md
generated
@@ -149,8 +149,8 @@ Class | Method | HTTP request | Description
|
||||
*FacesApi* | [**getFaces**](doc//FacesApi.md#getfaces) | **GET** /faces | Retrieve faces for asset
|
||||
*FacesApi* | [**reassignFacesById**](doc//FacesApi.md#reassignfacesbyid) | **PUT** /faces/{id} | Re-assign a face to another person
|
||||
*JobsApi* | [**createJob**](doc//JobsApi.md#createjob) | **POST** /jobs | Create a manual job
|
||||
*JobsApi* | [**getAllJobsStatus**](doc//JobsApi.md#getalljobsstatus) | **GET** /jobs | Retrieve queue counts and status
|
||||
*JobsApi* | [**sendJobCommand**](doc//JobsApi.md#sendjobcommand) | **PUT** /jobs/{id} | Run jobs
|
||||
*JobsApi* | [**getQueuesLegacy**](doc//JobsApi.md#getqueueslegacy) | **GET** /jobs | Retrieve queue counts and status
|
||||
*JobsApi* | [**runQueueCommandLegacy**](doc//JobsApi.md#runqueuecommandlegacy) | **PUT** /jobs/{name} | Run jobs
|
||||
*LibrariesApi* | [**createLibrary**](doc//LibrariesApi.md#createlibrary) | **POST** /libraries | Create a library
|
||||
*LibrariesApi* | [**deleteLibrary**](doc//LibrariesApi.md#deletelibrary) | **DELETE** /libraries/{id} | Delete a library
|
||||
*LibrariesApi* | [**getAllLibraries**](doc//LibrariesApi.md#getalllibraries) | **GET** /libraries | Retrieve libraries
|
||||
@@ -318,7 +318,6 @@ Class | Method | HTTP request | Description
|
||||
- [AlbumsAddAssetsResponseDto](doc//AlbumsAddAssetsResponseDto.md)
|
||||
- [AlbumsResponse](doc//AlbumsResponse.md)
|
||||
- [AlbumsUpdate](doc//AlbumsUpdate.md)
|
||||
- [AllJobStatusResponseDto](doc//AllJobStatusResponseDto.md)
|
||||
- [AssetBulkDeleteDto](doc//AssetBulkDeleteDto.md)
|
||||
- [AssetBulkUpdateDto](doc//AssetBulkUpdateDto.md)
|
||||
- [AssetBulkUploadCheckDto](doc//AssetBulkUploadCheckDto.md)
|
||||
@@ -387,13 +386,8 @@ Class | Method | HTTP request | Description
|
||||
- [FoldersResponse](doc//FoldersResponse.md)
|
||||
- [FoldersUpdate](doc//FoldersUpdate.md)
|
||||
- [ImageFormat](doc//ImageFormat.md)
|
||||
- [JobCommand](doc//JobCommand.md)
|
||||
- [JobCommandDto](doc//JobCommandDto.md)
|
||||
- [JobCountsDto](doc//JobCountsDto.md)
|
||||
- [JobCreateDto](doc//JobCreateDto.md)
|
||||
- [JobName](doc//JobName.md)
|
||||
- [JobSettingsDto](doc//JobSettingsDto.md)
|
||||
- [JobStatusDto](doc//JobStatusDto.md)
|
||||
- [LibraryResponseDto](doc//LibraryResponseDto.md)
|
||||
- [LibraryStatsResponseDto](doc//LibraryStatsResponseDto.md)
|
||||
- [LicenseKeyDto](doc//LicenseKeyDto.md)
|
||||
@@ -452,7 +446,13 @@ Class | Method | HTTP request | Description
|
||||
- [PlacesResponseDto](doc//PlacesResponseDto.md)
|
||||
- [PurchaseResponse](doc//PurchaseResponse.md)
|
||||
- [PurchaseUpdate](doc//PurchaseUpdate.md)
|
||||
- [QueueCommand](doc//QueueCommand.md)
|
||||
- [QueueCommandDto](doc//QueueCommandDto.md)
|
||||
- [QueueName](doc//QueueName.md)
|
||||
- [QueueResponseDto](doc//QueueResponseDto.md)
|
||||
- [QueueStatisticsDto](doc//QueueStatisticsDto.md)
|
||||
- [QueueStatusDto](doc//QueueStatusDto.md)
|
||||
- [QueuesResponseDto](doc//QueuesResponseDto.md)
|
||||
- [RandomSearchDto](doc//RandomSearchDto.md)
|
||||
- [RatingsResponse](doc//RatingsResponse.md)
|
||||
- [RatingsUpdate](doc//RatingsUpdate.md)
|
||||
|
||||
12
mobile/openapi/lib/api.dart
generated
12
mobile/openapi/lib/api.dart
generated
@@ -82,7 +82,6 @@ part 'model/albums_add_assets_dto.dart';
|
||||
part 'model/albums_add_assets_response_dto.dart';
|
||||
part 'model/albums_response.dart';
|
||||
part 'model/albums_update.dart';
|
||||
part 'model/all_job_status_response_dto.dart';
|
||||
part 'model/asset_bulk_delete_dto.dart';
|
||||
part 'model/asset_bulk_update_dto.dart';
|
||||
part 'model/asset_bulk_upload_check_dto.dart';
|
||||
@@ -151,13 +150,8 @@ part 'model/facial_recognition_config.dart';
|
||||
part 'model/folders_response.dart';
|
||||
part 'model/folders_update.dart';
|
||||
part 'model/image_format.dart';
|
||||
part 'model/job_command.dart';
|
||||
part 'model/job_command_dto.dart';
|
||||
part 'model/job_counts_dto.dart';
|
||||
part 'model/job_create_dto.dart';
|
||||
part 'model/job_name.dart';
|
||||
part 'model/job_settings_dto.dart';
|
||||
part 'model/job_status_dto.dart';
|
||||
part 'model/library_response_dto.dart';
|
||||
part 'model/library_stats_response_dto.dart';
|
||||
part 'model/license_key_dto.dart';
|
||||
@@ -216,7 +210,13 @@ part 'model/pin_code_setup_dto.dart';
|
||||
part 'model/places_response_dto.dart';
|
||||
part 'model/purchase_response.dart';
|
||||
part 'model/purchase_update.dart';
|
||||
part 'model/queue_command.dart';
|
||||
part 'model/queue_command_dto.dart';
|
||||
part 'model/queue_name.dart';
|
||||
part 'model/queue_response_dto.dart';
|
||||
part 'model/queue_statistics_dto.dart';
|
||||
part 'model/queue_status_dto.dart';
|
||||
part 'model/queues_response_dto.dart';
|
||||
part 'model/random_search_dto.dart';
|
||||
part 'model/ratings_response.dart';
|
||||
part 'model/ratings_update.dart';
|
||||
|
||||
30
mobile/openapi/lib/api/jobs_api.dart
generated
30
mobile/openapi/lib/api/jobs_api.dart
generated
@@ -69,7 +69,7 @@ class JobsApi {
|
||||
/// Retrieve the counts of the current queue, as well as the current status.
|
||||
///
|
||||
/// Note: This method returns the HTTP [Response].
|
||||
Future<Response> getAllJobsStatusWithHttpInfo() async {
|
||||
Future<Response> getQueuesLegacyWithHttpInfo() async {
|
||||
// ignore: prefer_const_declarations
|
||||
final apiPath = r'/jobs';
|
||||
|
||||
@@ -97,8 +97,8 @@ class JobsApi {
|
||||
/// Retrieve queue counts and status
|
||||
///
|
||||
/// Retrieve the counts of the current queue, as well as the current status.
|
||||
Future<AllJobStatusResponseDto?> getAllJobsStatus() async {
|
||||
final response = await getAllJobsStatusWithHttpInfo();
|
||||
Future<QueuesResponseDto?> getQueuesLegacy() async {
|
||||
final response = await getQueuesLegacyWithHttpInfo();
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
@@ -106,7 +106,7 @@ class JobsApi {
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AllJobStatusResponseDto',) as AllJobStatusResponseDto;
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'QueuesResponseDto',) as QueuesResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
@@ -120,16 +120,16 @@ class JobsApi {
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [JobName] id (required):
|
||||
/// * [QueueName] name (required):
|
||||
///
|
||||
/// * [JobCommandDto] jobCommandDto (required):
|
||||
Future<Response> sendJobCommandWithHttpInfo(JobName id, JobCommandDto jobCommandDto,) async {
|
||||
/// * [QueueCommandDto] queueCommandDto (required):
|
||||
Future<Response> runQueueCommandLegacyWithHttpInfo(QueueName name, QueueCommandDto queueCommandDto,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final apiPath = r'/jobs/{id}'
|
||||
.replaceAll('{id}', id.toString());
|
||||
final apiPath = r'/jobs/{name}'
|
||||
.replaceAll('{name}', name.toString());
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody = jobCommandDto;
|
||||
Object? postBody = queueCommandDto;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
@@ -155,11 +155,11 @@ class JobsApi {
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [JobName] id (required):
|
||||
/// * [QueueName] name (required):
|
||||
///
|
||||
/// * [JobCommandDto] jobCommandDto (required):
|
||||
Future<JobStatusDto?> sendJobCommand(JobName id, JobCommandDto jobCommandDto,) async {
|
||||
final response = await sendJobCommandWithHttpInfo(id, jobCommandDto,);
|
||||
/// * [QueueCommandDto] queueCommandDto (required):
|
||||
Future<QueueResponseDto?> runQueueCommandLegacy(QueueName name, QueueCommandDto queueCommandDto,) async {
|
||||
final response = await runQueueCommandLegacyWithHttpInfo(name, queueCommandDto,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
@@ -167,7 +167,7 @@ class JobsApi {
|
||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||
// FormatException when trying to decode an empty string.
|
||||
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'JobStatusDto',) as JobStatusDto;
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'QueueResponseDto',) as QueueResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
|
||||
24
mobile/openapi/lib/api_client.dart
generated
24
mobile/openapi/lib/api_client.dart
generated
@@ -220,8 +220,6 @@ class ApiClient {
|
||||
return AlbumsResponse.fromJson(value);
|
||||
case 'AlbumsUpdate':
|
||||
return AlbumsUpdate.fromJson(value);
|
||||
case 'AllJobStatusResponseDto':
|
||||
return AllJobStatusResponseDto.fromJson(value);
|
||||
case 'AssetBulkDeleteDto':
|
||||
return AssetBulkDeleteDto.fromJson(value);
|
||||
case 'AssetBulkUpdateDto':
|
||||
@@ -358,20 +356,10 @@ class ApiClient {
|
||||
return FoldersUpdate.fromJson(value);
|
||||
case 'ImageFormat':
|
||||
return ImageFormatTypeTransformer().decode(value);
|
||||
case 'JobCommand':
|
||||
return JobCommandTypeTransformer().decode(value);
|
||||
case 'JobCommandDto':
|
||||
return JobCommandDto.fromJson(value);
|
||||
case 'JobCountsDto':
|
||||
return JobCountsDto.fromJson(value);
|
||||
case 'JobCreateDto':
|
||||
return JobCreateDto.fromJson(value);
|
||||
case 'JobName':
|
||||
return JobNameTypeTransformer().decode(value);
|
||||
case 'JobSettingsDto':
|
||||
return JobSettingsDto.fromJson(value);
|
||||
case 'JobStatusDto':
|
||||
return JobStatusDto.fromJson(value);
|
||||
case 'LibraryResponseDto':
|
||||
return LibraryResponseDto.fromJson(value);
|
||||
case 'LibraryStatsResponseDto':
|
||||
@@ -488,8 +476,20 @@ class ApiClient {
|
||||
return PurchaseResponse.fromJson(value);
|
||||
case 'PurchaseUpdate':
|
||||
return PurchaseUpdate.fromJson(value);
|
||||
case 'QueueCommand':
|
||||
return QueueCommandTypeTransformer().decode(value);
|
||||
case 'QueueCommandDto':
|
||||
return QueueCommandDto.fromJson(value);
|
||||
case 'QueueName':
|
||||
return QueueNameTypeTransformer().decode(value);
|
||||
case 'QueueResponseDto':
|
||||
return QueueResponseDto.fromJson(value);
|
||||
case 'QueueStatisticsDto':
|
||||
return QueueStatisticsDto.fromJson(value);
|
||||
case 'QueueStatusDto':
|
||||
return QueueStatusDto.fromJson(value);
|
||||
case 'QueuesResponseDto':
|
||||
return QueuesResponseDto.fromJson(value);
|
||||
case 'RandomSearchDto':
|
||||
return RandomSearchDto.fromJson(value);
|
||||
case 'RatingsResponse':
|
||||
|
||||
12
mobile/openapi/lib/api_helper.dart
generated
12
mobile/openapi/lib/api_helper.dart
generated
@@ -94,12 +94,6 @@ String parameterToString(dynamic value) {
|
||||
if (value is ImageFormat) {
|
||||
return ImageFormatTypeTransformer().encode(value).toString();
|
||||
}
|
||||
if (value is JobCommand) {
|
||||
return JobCommandTypeTransformer().encode(value).toString();
|
||||
}
|
||||
if (value is JobName) {
|
||||
return JobNameTypeTransformer().encode(value).toString();
|
||||
}
|
||||
if (value is LogLevel) {
|
||||
return LogLevelTypeTransformer().encode(value).toString();
|
||||
}
|
||||
@@ -127,6 +121,12 @@ String parameterToString(dynamic value) {
|
||||
if (value is Permission) {
|
||||
return PermissionTypeTransformer().encode(value).toString();
|
||||
}
|
||||
if (value is QueueCommand) {
|
||||
return QueueCommandTypeTransformer().encode(value).toString();
|
||||
}
|
||||
if (value is QueueName) {
|
||||
return QueueNameTypeTransformer().encode(value).toString();
|
||||
}
|
||||
if (value is ReactionLevel) {
|
||||
return ReactionLevelTypeTransformer().encode(value).toString();
|
||||
}
|
||||
|
||||
94
mobile/openapi/lib/model/job_command.dart
generated
94
mobile/openapi/lib/model/job_command.dart
generated
@@ -1,94 +0,0 @@
|
||||
//
|
||||
// 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 JobCommand {
|
||||
/// Instantiate a new enum with the provided [value].
|
||||
const JobCommand._(this.value);
|
||||
|
||||
/// The underlying value of this enum member.
|
||||
final String value;
|
||||
|
||||
@override
|
||||
String toString() => value;
|
||||
|
||||
String toJson() => value;
|
||||
|
||||
static const start = JobCommand._(r'start');
|
||||
static const pause = JobCommand._(r'pause');
|
||||
static const resume = JobCommand._(r'resume');
|
||||
static const empty = JobCommand._(r'empty');
|
||||
static const clearFailed = JobCommand._(r'clear-failed');
|
||||
|
||||
/// List of all possible values in this [enum][JobCommand].
|
||||
static const values = <JobCommand>[
|
||||
start,
|
||||
pause,
|
||||
resume,
|
||||
empty,
|
||||
clearFailed,
|
||||
];
|
||||
|
||||
static JobCommand? fromJson(dynamic value) => JobCommandTypeTransformer().decode(value);
|
||||
|
||||
static List<JobCommand> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <JobCommand>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = JobCommand.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
}
|
||||
|
||||
/// Transformation class that can [encode] an instance of [JobCommand] to String,
|
||||
/// and [decode] dynamic data back to [JobCommand].
|
||||
class JobCommandTypeTransformer {
|
||||
factory JobCommandTypeTransformer() => _instance ??= const JobCommandTypeTransformer._();
|
||||
|
||||
const JobCommandTypeTransformer._();
|
||||
|
||||
String encode(JobCommand data) => data.value;
|
||||
|
||||
/// Decodes a [dynamic value][data] to a JobCommand.
|
||||
///
|
||||
/// 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.
|
||||
JobCommand? decode(dynamic data, {bool allowNull = true}) {
|
||||
if (data != null) {
|
||||
switch (data) {
|
||||
case r'start': return JobCommand.start;
|
||||
case r'pause': return JobCommand.pause;
|
||||
case r'resume': return JobCommand.resume;
|
||||
case r'empty': return JobCommand.empty;
|
||||
case r'clear-failed': return JobCommand.clearFailed;
|
||||
default:
|
||||
if (!allowNull) {
|
||||
throw ArgumentError('Unknown enum value to decode: $data');
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Singleton [JobCommandTypeTransformer] instance.
|
||||
static JobCommandTypeTransformer? _instance;
|
||||
}
|
||||
|
||||
127
mobile/openapi/lib/model/job_name.dart
generated
127
mobile/openapi/lib/model/job_name.dart
generated
@@ -1,127 +0,0 @@
|
||||
//
|
||||
// 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 JobName {
|
||||
/// Instantiate a new enum with the provided [value].
|
||||
const JobName._(this.value);
|
||||
|
||||
/// The underlying value of this enum member.
|
||||
final String value;
|
||||
|
||||
@override
|
||||
String toString() => value;
|
||||
|
||||
String toJson() => value;
|
||||
|
||||
static const thumbnailGeneration = JobName._(r'thumbnailGeneration');
|
||||
static const metadataExtraction = JobName._(r'metadataExtraction');
|
||||
static const videoConversion = JobName._(r'videoConversion');
|
||||
static const faceDetection = JobName._(r'faceDetection');
|
||||
static const facialRecognition = JobName._(r'facialRecognition');
|
||||
static const smartSearch = JobName._(r'smartSearch');
|
||||
static const duplicateDetection = JobName._(r'duplicateDetection');
|
||||
static const backgroundTask = JobName._(r'backgroundTask');
|
||||
static const storageTemplateMigration = JobName._(r'storageTemplateMigration');
|
||||
static const migration = JobName._(r'migration');
|
||||
static const search = JobName._(r'search');
|
||||
static const sidecar = JobName._(r'sidecar');
|
||||
static const library_ = JobName._(r'library');
|
||||
static const notifications = JobName._(r'notifications');
|
||||
static const backupDatabase = JobName._(r'backupDatabase');
|
||||
static const ocr = JobName._(r'ocr');
|
||||
|
||||
/// List of all possible values in this [enum][JobName].
|
||||
static const values = <JobName>[
|
||||
thumbnailGeneration,
|
||||
metadataExtraction,
|
||||
videoConversion,
|
||||
faceDetection,
|
||||
facialRecognition,
|
||||
smartSearch,
|
||||
duplicateDetection,
|
||||
backgroundTask,
|
||||
storageTemplateMigration,
|
||||
migration,
|
||||
search,
|
||||
sidecar,
|
||||
library_,
|
||||
notifications,
|
||||
backupDatabase,
|
||||
ocr,
|
||||
];
|
||||
|
||||
static JobName? fromJson(dynamic value) => JobNameTypeTransformer().decode(value);
|
||||
|
||||
static List<JobName> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <JobName>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = JobName.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
}
|
||||
|
||||
/// Transformation class that can [encode] an instance of [JobName] to String,
|
||||
/// and [decode] dynamic data back to [JobName].
|
||||
class JobNameTypeTransformer {
|
||||
factory JobNameTypeTransformer() => _instance ??= const JobNameTypeTransformer._();
|
||||
|
||||
const JobNameTypeTransformer._();
|
||||
|
||||
String encode(JobName data) => data.value;
|
||||
|
||||
/// Decodes a [dynamic value][data] to a JobName.
|
||||
///
|
||||
/// 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.
|
||||
JobName? decode(dynamic data, {bool allowNull = true}) {
|
||||
if (data != null) {
|
||||
switch (data) {
|
||||
case r'thumbnailGeneration': return JobName.thumbnailGeneration;
|
||||
case r'metadataExtraction': return JobName.metadataExtraction;
|
||||
case r'videoConversion': return JobName.videoConversion;
|
||||
case r'faceDetection': return JobName.faceDetection;
|
||||
case r'facialRecognition': return JobName.facialRecognition;
|
||||
case r'smartSearch': return JobName.smartSearch;
|
||||
case r'duplicateDetection': return JobName.duplicateDetection;
|
||||
case r'backgroundTask': return JobName.backgroundTask;
|
||||
case r'storageTemplateMigration': return JobName.storageTemplateMigration;
|
||||
case r'migration': return JobName.migration;
|
||||
case r'search': return JobName.search;
|
||||
case r'sidecar': return JobName.sidecar;
|
||||
case r'library': return JobName.library_;
|
||||
case r'notifications': return JobName.notifications;
|
||||
case r'backupDatabase': return JobName.backupDatabase;
|
||||
case r'ocr': return JobName.ocr;
|
||||
default:
|
||||
if (!allowNull) {
|
||||
throw ArgumentError('Unknown enum value to decode: $data');
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Singleton [JobNameTypeTransformer] instance.
|
||||
static JobNameTypeTransformer? _instance;
|
||||
}
|
||||
|
||||
94
mobile/openapi/lib/model/queue_command.dart
generated
Normal file
94
mobile/openapi/lib/model/queue_command.dart
generated
Normal file
@@ -0,0 +1,94 @@
|
||||
//
|
||||
// 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 QueueCommand {
|
||||
/// Instantiate a new enum with the provided [value].
|
||||
const QueueCommand._(this.value);
|
||||
|
||||
/// The underlying value of this enum member.
|
||||
final String value;
|
||||
|
||||
@override
|
||||
String toString() => value;
|
||||
|
||||
String toJson() => value;
|
||||
|
||||
static const start = QueueCommand._(r'start');
|
||||
static const pause = QueueCommand._(r'pause');
|
||||
static const resume = QueueCommand._(r'resume');
|
||||
static const empty = QueueCommand._(r'empty');
|
||||
static const clearFailed = QueueCommand._(r'clear-failed');
|
||||
|
||||
/// List of all possible values in this [enum][QueueCommand].
|
||||
static const values = <QueueCommand>[
|
||||
start,
|
||||
pause,
|
||||
resume,
|
||||
empty,
|
||||
clearFailed,
|
||||
];
|
||||
|
||||
static QueueCommand? fromJson(dynamic value) => QueueCommandTypeTransformer().decode(value);
|
||||
|
||||
static List<QueueCommand> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <QueueCommand>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = QueueCommand.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
}
|
||||
|
||||
/// Transformation class that can [encode] an instance of [QueueCommand] to String,
|
||||
/// and [decode] dynamic data back to [QueueCommand].
|
||||
class QueueCommandTypeTransformer {
|
||||
factory QueueCommandTypeTransformer() => _instance ??= const QueueCommandTypeTransformer._();
|
||||
|
||||
const QueueCommandTypeTransformer._();
|
||||
|
||||
String encode(QueueCommand data) => data.value;
|
||||
|
||||
/// Decodes a [dynamic value][data] to a QueueCommand.
|
||||
///
|
||||
/// 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.
|
||||
QueueCommand? decode(dynamic data, {bool allowNull = true}) {
|
||||
if (data != null) {
|
||||
switch (data) {
|
||||
case r'start': return QueueCommand.start;
|
||||
case r'pause': return QueueCommand.pause;
|
||||
case r'resume': return QueueCommand.resume;
|
||||
case r'empty': return QueueCommand.empty;
|
||||
case r'clear-failed': return QueueCommand.clearFailed;
|
||||
default:
|
||||
if (!allowNull) {
|
||||
throw ArgumentError('Unknown enum value to decode: $data');
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Singleton [QueueCommandTypeTransformer] instance.
|
||||
static QueueCommandTypeTransformer? _instance;
|
||||
}
|
||||
|
||||
@@ -10,14 +10,14 @@
|
||||
|
||||
part of openapi.api;
|
||||
|
||||
class JobCommandDto {
|
||||
/// Returns a new [JobCommandDto] instance.
|
||||
JobCommandDto({
|
||||
class QueueCommandDto {
|
||||
/// Returns a new [QueueCommandDto] instance.
|
||||
QueueCommandDto({
|
||||
required this.command,
|
||||
this.force,
|
||||
});
|
||||
|
||||
JobCommand command;
|
||||
QueueCommand command;
|
||||
|
||||
///
|
||||
/// Please note: This property should have been non-nullable! Since the specification file
|
||||
@@ -28,7 +28,7 @@ class JobCommandDto {
|
||||
bool? force;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is JobCommandDto &&
|
||||
bool operator ==(Object other) => identical(this, other) || other is QueueCommandDto &&
|
||||
other.command == command &&
|
||||
other.force == force;
|
||||
|
||||
@@ -39,7 +39,7 @@ class JobCommandDto {
|
||||
(force == null ? 0 : force!.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'JobCommandDto[command=$command, force=$force]';
|
||||
String toString() => 'QueueCommandDto[command=$command, force=$force]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
@@ -52,27 +52,27 @@ class JobCommandDto {
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [JobCommandDto] instance and imports its values from
|
||||
/// Returns a new [QueueCommandDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static JobCommandDto? fromJson(dynamic value) {
|
||||
upgradeDto(value, "JobCommandDto");
|
||||
static QueueCommandDto? fromJson(dynamic value) {
|
||||
upgradeDto(value, "QueueCommandDto");
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return JobCommandDto(
|
||||
command: JobCommand.fromJson(json[r'command'])!,
|
||||
return QueueCommandDto(
|
||||
command: QueueCommand.fromJson(json[r'command'])!,
|
||||
force: mapValueOfType<bool>(json, r'force'),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<JobCommandDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <JobCommandDto>[];
|
||||
static List<QueueCommandDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <QueueCommandDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = JobCommandDto.fromJson(row);
|
||||
final value = QueueCommandDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
@@ -81,12 +81,12 @@ class JobCommandDto {
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, JobCommandDto> mapFromJson(dynamic json) {
|
||||
final map = <String, JobCommandDto>{};
|
||||
static Map<String, QueueCommandDto> mapFromJson(dynamic json) {
|
||||
final map = <String, QueueCommandDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = JobCommandDto.fromJson(entry.value);
|
||||
final value = QueueCommandDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
@@ -95,14 +95,14 @@ class JobCommandDto {
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of JobCommandDto-objects as value to a dart map
|
||||
static Map<String, List<JobCommandDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<JobCommandDto>>{};
|
||||
// maps a json object with a list of QueueCommandDto-objects as value to a dart map
|
||||
static Map<String, List<QueueCommandDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<QueueCommandDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = JobCommandDto.listFromJson(entry.value, growable: growable,);
|
||||
map[entry.key] = QueueCommandDto.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
127
mobile/openapi/lib/model/queue_name.dart
generated
Normal file
127
mobile/openapi/lib/model/queue_name.dart
generated
Normal file
@@ -0,0 +1,127 @@
|
||||
//
|
||||
// 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 QueueName {
|
||||
/// Instantiate a new enum with the provided [value].
|
||||
const QueueName._(this.value);
|
||||
|
||||
/// The underlying value of this enum member.
|
||||
final String value;
|
||||
|
||||
@override
|
||||
String toString() => value;
|
||||
|
||||
String toJson() => value;
|
||||
|
||||
static const thumbnailGeneration = QueueName._(r'thumbnailGeneration');
|
||||
static const metadataExtraction = QueueName._(r'metadataExtraction');
|
||||
static const videoConversion = QueueName._(r'videoConversion');
|
||||
static const faceDetection = QueueName._(r'faceDetection');
|
||||
static const facialRecognition = QueueName._(r'facialRecognition');
|
||||
static const smartSearch = QueueName._(r'smartSearch');
|
||||
static const duplicateDetection = QueueName._(r'duplicateDetection');
|
||||
static const backgroundTask = QueueName._(r'backgroundTask');
|
||||
static const storageTemplateMigration = QueueName._(r'storageTemplateMigration');
|
||||
static const migration = QueueName._(r'migration');
|
||||
static const search = QueueName._(r'search');
|
||||
static const sidecar = QueueName._(r'sidecar');
|
||||
static const library_ = QueueName._(r'library');
|
||||
static const notifications = QueueName._(r'notifications');
|
||||
static const backupDatabase = QueueName._(r'backupDatabase');
|
||||
static const ocr = QueueName._(r'ocr');
|
||||
|
||||
/// List of all possible values in this [enum][QueueName].
|
||||
static const values = <QueueName>[
|
||||
thumbnailGeneration,
|
||||
metadataExtraction,
|
||||
videoConversion,
|
||||
faceDetection,
|
||||
facialRecognition,
|
||||
smartSearch,
|
||||
duplicateDetection,
|
||||
backgroundTask,
|
||||
storageTemplateMigration,
|
||||
migration,
|
||||
search,
|
||||
sidecar,
|
||||
library_,
|
||||
notifications,
|
||||
backupDatabase,
|
||||
ocr,
|
||||
];
|
||||
|
||||
static QueueName? fromJson(dynamic value) => QueueNameTypeTransformer().decode(value);
|
||||
|
||||
static List<QueueName> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <QueueName>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = QueueName.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
}
|
||||
|
||||
/// Transformation class that can [encode] an instance of [QueueName] to String,
|
||||
/// and [decode] dynamic data back to [QueueName].
|
||||
class QueueNameTypeTransformer {
|
||||
factory QueueNameTypeTransformer() => _instance ??= const QueueNameTypeTransformer._();
|
||||
|
||||
const QueueNameTypeTransformer._();
|
||||
|
||||
String encode(QueueName data) => data.value;
|
||||
|
||||
/// Decodes a [dynamic value][data] to a QueueName.
|
||||
///
|
||||
/// 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.
|
||||
QueueName? decode(dynamic data, {bool allowNull = true}) {
|
||||
if (data != null) {
|
||||
switch (data) {
|
||||
case r'thumbnailGeneration': return QueueName.thumbnailGeneration;
|
||||
case r'metadataExtraction': return QueueName.metadataExtraction;
|
||||
case r'videoConversion': return QueueName.videoConversion;
|
||||
case r'faceDetection': return QueueName.faceDetection;
|
||||
case r'facialRecognition': return QueueName.facialRecognition;
|
||||
case r'smartSearch': return QueueName.smartSearch;
|
||||
case r'duplicateDetection': return QueueName.duplicateDetection;
|
||||
case r'backgroundTask': return QueueName.backgroundTask;
|
||||
case r'storageTemplateMigration': return QueueName.storageTemplateMigration;
|
||||
case r'migration': return QueueName.migration;
|
||||
case r'search': return QueueName.search;
|
||||
case r'sidecar': return QueueName.sidecar;
|
||||
case r'library': return QueueName.library_;
|
||||
case r'notifications': return QueueName.notifications;
|
||||
case r'backupDatabase': return QueueName.backupDatabase;
|
||||
case r'ocr': return QueueName.ocr;
|
||||
default:
|
||||
if (!allowNull) {
|
||||
throw ArgumentError('Unknown enum value to decode: $data');
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Singleton [QueueNameTypeTransformer] instance.
|
||||
static QueueNameTypeTransformer? _instance;
|
||||
}
|
||||
|
||||
@@ -10,19 +10,19 @@
|
||||
|
||||
part of openapi.api;
|
||||
|
||||
class JobStatusDto {
|
||||
/// Returns a new [JobStatusDto] instance.
|
||||
JobStatusDto({
|
||||
class QueueResponseDto {
|
||||
/// Returns a new [QueueResponseDto] instance.
|
||||
QueueResponseDto({
|
||||
required this.jobCounts,
|
||||
required this.queueStatus,
|
||||
});
|
||||
|
||||
JobCountsDto jobCounts;
|
||||
QueueStatisticsDto jobCounts;
|
||||
|
||||
QueueStatusDto queueStatus;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is JobStatusDto &&
|
||||
bool operator ==(Object other) => identical(this, other) || other is QueueResponseDto &&
|
||||
other.jobCounts == jobCounts &&
|
||||
other.queueStatus == queueStatus;
|
||||
|
||||
@@ -33,7 +33,7 @@ class JobStatusDto {
|
||||
(queueStatus.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'JobStatusDto[jobCounts=$jobCounts, queueStatus=$queueStatus]';
|
||||
String toString() => 'QueueResponseDto[jobCounts=$jobCounts, queueStatus=$queueStatus]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
@@ -42,27 +42,27 @@ class JobStatusDto {
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [JobStatusDto] instance and imports its values from
|
||||
/// Returns a new [QueueResponseDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static JobStatusDto? fromJson(dynamic value) {
|
||||
upgradeDto(value, "JobStatusDto");
|
||||
static QueueResponseDto? fromJson(dynamic value) {
|
||||
upgradeDto(value, "QueueResponseDto");
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return JobStatusDto(
|
||||
jobCounts: JobCountsDto.fromJson(json[r'jobCounts'])!,
|
||||
return QueueResponseDto(
|
||||
jobCounts: QueueStatisticsDto.fromJson(json[r'jobCounts'])!,
|
||||
queueStatus: QueueStatusDto.fromJson(json[r'queueStatus'])!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<JobStatusDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <JobStatusDto>[];
|
||||
static List<QueueResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <QueueResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = JobStatusDto.fromJson(row);
|
||||
final value = QueueResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
@@ -71,12 +71,12 @@ class JobStatusDto {
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, JobStatusDto> mapFromJson(dynamic json) {
|
||||
final map = <String, JobStatusDto>{};
|
||||
static Map<String, QueueResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, QueueResponseDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = JobStatusDto.fromJson(entry.value);
|
||||
final value = QueueResponseDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
@@ -85,14 +85,14 @@ class JobStatusDto {
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of JobStatusDto-objects as value to a dart map
|
||||
static Map<String, List<JobStatusDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<JobStatusDto>>{};
|
||||
// maps a json object with a list of QueueResponseDto-objects as value to a dart map
|
||||
static Map<String, List<QueueResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<QueueResponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = JobStatusDto.listFromJson(entry.value, growable: growable,);
|
||||
map[entry.key] = QueueResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
@@ -10,9 +10,9 @@
|
||||
|
||||
part of openapi.api;
|
||||
|
||||
class JobCountsDto {
|
||||
/// Returns a new [JobCountsDto] instance.
|
||||
JobCountsDto({
|
||||
class QueueStatisticsDto {
|
||||
/// Returns a new [QueueStatisticsDto] instance.
|
||||
QueueStatisticsDto({
|
||||
required this.active,
|
||||
required this.completed,
|
||||
required this.delayed,
|
||||
@@ -34,7 +34,7 @@ class JobCountsDto {
|
||||
int waiting;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is JobCountsDto &&
|
||||
bool operator ==(Object other) => identical(this, other) || other is QueueStatisticsDto &&
|
||||
other.active == active &&
|
||||
other.completed == completed &&
|
||||
other.delayed == delayed &&
|
||||
@@ -53,7 +53,7 @@ class JobCountsDto {
|
||||
(waiting.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'JobCountsDto[active=$active, completed=$completed, delayed=$delayed, failed=$failed, paused=$paused, waiting=$waiting]';
|
||||
String toString() => 'QueueStatisticsDto[active=$active, completed=$completed, delayed=$delayed, failed=$failed, paused=$paused, waiting=$waiting]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
@@ -66,15 +66,15 @@ class JobCountsDto {
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [JobCountsDto] instance and imports its values from
|
||||
/// Returns a new [QueueStatisticsDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static JobCountsDto? fromJson(dynamic value) {
|
||||
upgradeDto(value, "JobCountsDto");
|
||||
static QueueStatisticsDto? fromJson(dynamic value) {
|
||||
upgradeDto(value, "QueueStatisticsDto");
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return JobCountsDto(
|
||||
return QueueStatisticsDto(
|
||||
active: mapValueOfType<int>(json, r'active')!,
|
||||
completed: mapValueOfType<int>(json, r'completed')!,
|
||||
delayed: mapValueOfType<int>(json, r'delayed')!,
|
||||
@@ -86,11 +86,11 @@ class JobCountsDto {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<JobCountsDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <JobCountsDto>[];
|
||||
static List<QueueStatisticsDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <QueueStatisticsDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = JobCountsDto.fromJson(row);
|
||||
final value = QueueStatisticsDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
@@ -99,12 +99,12 @@ class JobCountsDto {
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, JobCountsDto> mapFromJson(dynamic json) {
|
||||
final map = <String, JobCountsDto>{};
|
||||
static Map<String, QueueStatisticsDto> mapFromJson(dynamic json) {
|
||||
final map = <String, QueueStatisticsDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = JobCountsDto.fromJson(entry.value);
|
||||
final value = QueueStatisticsDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
@@ -113,14 +113,14 @@ class JobCountsDto {
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of JobCountsDto-objects as value to a dart map
|
||||
static Map<String, List<JobCountsDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<JobCountsDto>>{};
|
||||
// maps a json object with a list of QueueStatisticsDto-objects as value to a dart map
|
||||
static Map<String, List<QueueStatisticsDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<QueueStatisticsDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = JobCountsDto.listFromJson(entry.value, growable: growable,);
|
||||
map[entry.key] = QueueStatisticsDto.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
@@ -10,9 +10,9 @@
|
||||
|
||||
part of openapi.api;
|
||||
|
||||
class AllJobStatusResponseDto {
|
||||
/// Returns a new [AllJobStatusResponseDto] instance.
|
||||
AllJobStatusResponseDto({
|
||||
class QueuesResponseDto {
|
||||
/// Returns a new [QueuesResponseDto] instance.
|
||||
QueuesResponseDto({
|
||||
required this.backgroundTask,
|
||||
required this.backupDatabase,
|
||||
required this.duplicateDetection,
|
||||
@@ -31,40 +31,40 @@ class AllJobStatusResponseDto {
|
||||
required this.videoConversion,
|
||||
});
|
||||
|
||||
JobStatusDto backgroundTask;
|
||||
QueueResponseDto backgroundTask;
|
||||
|
||||
JobStatusDto backupDatabase;
|
||||
QueueResponseDto backupDatabase;
|
||||
|
||||
JobStatusDto duplicateDetection;
|
||||
QueueResponseDto duplicateDetection;
|
||||
|
||||
JobStatusDto faceDetection;
|
||||
QueueResponseDto faceDetection;
|
||||
|
||||
JobStatusDto facialRecognition;
|
||||
QueueResponseDto facialRecognition;
|
||||
|
||||
JobStatusDto library_;
|
||||
QueueResponseDto library_;
|
||||
|
||||
JobStatusDto metadataExtraction;
|
||||
QueueResponseDto metadataExtraction;
|
||||
|
||||
JobStatusDto migration;
|
||||
QueueResponseDto migration;
|
||||
|
||||
JobStatusDto notifications;
|
||||
QueueResponseDto notifications;
|
||||
|
||||
JobStatusDto ocr;
|
||||
QueueResponseDto ocr;
|
||||
|
||||
JobStatusDto search;
|
||||
QueueResponseDto search;
|
||||
|
||||
JobStatusDto sidecar;
|
||||
QueueResponseDto sidecar;
|
||||
|
||||
JobStatusDto smartSearch;
|
||||
QueueResponseDto smartSearch;
|
||||
|
||||
JobStatusDto storageTemplateMigration;
|
||||
QueueResponseDto storageTemplateMigration;
|
||||
|
||||
JobStatusDto thumbnailGeneration;
|
||||
QueueResponseDto thumbnailGeneration;
|
||||
|
||||
JobStatusDto videoConversion;
|
||||
QueueResponseDto videoConversion;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is AllJobStatusResponseDto &&
|
||||
bool operator ==(Object other) => identical(this, other) || other is QueuesResponseDto &&
|
||||
other.backgroundTask == backgroundTask &&
|
||||
other.backupDatabase == backupDatabase &&
|
||||
other.duplicateDetection == duplicateDetection &&
|
||||
@@ -103,7 +103,7 @@ class AllJobStatusResponseDto {
|
||||
(videoConversion.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'AllJobStatusResponseDto[backgroundTask=$backgroundTask, backupDatabase=$backupDatabase, duplicateDetection=$duplicateDetection, faceDetection=$faceDetection, facialRecognition=$facialRecognition, library_=$library_, metadataExtraction=$metadataExtraction, migration=$migration, notifications=$notifications, ocr=$ocr, search=$search, sidecar=$sidecar, smartSearch=$smartSearch, storageTemplateMigration=$storageTemplateMigration, thumbnailGeneration=$thumbnailGeneration, videoConversion=$videoConversion]';
|
||||
String toString() => 'QueuesResponseDto[backgroundTask=$backgroundTask, backupDatabase=$backupDatabase, duplicateDetection=$duplicateDetection, faceDetection=$faceDetection, facialRecognition=$facialRecognition, library_=$library_, metadataExtraction=$metadataExtraction, migration=$migration, notifications=$notifications, ocr=$ocr, search=$search, sidecar=$sidecar, smartSearch=$smartSearch, storageTemplateMigration=$storageTemplateMigration, thumbnailGeneration=$thumbnailGeneration, videoConversion=$videoConversion]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
@@ -126,41 +126,41 @@ class AllJobStatusResponseDto {
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [AllJobStatusResponseDto] instance and imports its values from
|
||||
/// Returns a new [QueuesResponseDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static AllJobStatusResponseDto? fromJson(dynamic value) {
|
||||
upgradeDto(value, "AllJobStatusResponseDto");
|
||||
static QueuesResponseDto? fromJson(dynamic value) {
|
||||
upgradeDto(value, "QueuesResponseDto");
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return AllJobStatusResponseDto(
|
||||
backgroundTask: JobStatusDto.fromJson(json[r'backgroundTask'])!,
|
||||
backupDatabase: JobStatusDto.fromJson(json[r'backupDatabase'])!,
|
||||
duplicateDetection: JobStatusDto.fromJson(json[r'duplicateDetection'])!,
|
||||
faceDetection: JobStatusDto.fromJson(json[r'faceDetection'])!,
|
||||
facialRecognition: JobStatusDto.fromJson(json[r'facialRecognition'])!,
|
||||
library_: JobStatusDto.fromJson(json[r'library'])!,
|
||||
metadataExtraction: JobStatusDto.fromJson(json[r'metadataExtraction'])!,
|
||||
migration: JobStatusDto.fromJson(json[r'migration'])!,
|
||||
notifications: JobStatusDto.fromJson(json[r'notifications'])!,
|
||||
ocr: JobStatusDto.fromJson(json[r'ocr'])!,
|
||||
search: JobStatusDto.fromJson(json[r'search'])!,
|
||||
sidecar: JobStatusDto.fromJson(json[r'sidecar'])!,
|
||||
smartSearch: JobStatusDto.fromJson(json[r'smartSearch'])!,
|
||||
storageTemplateMigration: JobStatusDto.fromJson(json[r'storageTemplateMigration'])!,
|
||||
thumbnailGeneration: JobStatusDto.fromJson(json[r'thumbnailGeneration'])!,
|
||||
videoConversion: JobStatusDto.fromJson(json[r'videoConversion'])!,
|
||||
return QueuesResponseDto(
|
||||
backgroundTask: QueueResponseDto.fromJson(json[r'backgroundTask'])!,
|
||||
backupDatabase: QueueResponseDto.fromJson(json[r'backupDatabase'])!,
|
||||
duplicateDetection: QueueResponseDto.fromJson(json[r'duplicateDetection'])!,
|
||||
faceDetection: QueueResponseDto.fromJson(json[r'faceDetection'])!,
|
||||
facialRecognition: QueueResponseDto.fromJson(json[r'facialRecognition'])!,
|
||||
library_: QueueResponseDto.fromJson(json[r'library'])!,
|
||||
metadataExtraction: QueueResponseDto.fromJson(json[r'metadataExtraction'])!,
|
||||
migration: QueueResponseDto.fromJson(json[r'migration'])!,
|
||||
notifications: QueueResponseDto.fromJson(json[r'notifications'])!,
|
||||
ocr: QueueResponseDto.fromJson(json[r'ocr'])!,
|
||||
search: QueueResponseDto.fromJson(json[r'search'])!,
|
||||
sidecar: QueueResponseDto.fromJson(json[r'sidecar'])!,
|
||||
smartSearch: QueueResponseDto.fromJson(json[r'smartSearch'])!,
|
||||
storageTemplateMigration: QueueResponseDto.fromJson(json[r'storageTemplateMigration'])!,
|
||||
thumbnailGeneration: QueueResponseDto.fromJson(json[r'thumbnailGeneration'])!,
|
||||
videoConversion: QueueResponseDto.fromJson(json[r'videoConversion'])!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AllJobStatusResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AllJobStatusResponseDto>[];
|
||||
static List<QueuesResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <QueuesResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = AllJobStatusResponseDto.fromJson(row);
|
||||
final value = QueuesResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
@@ -169,12 +169,12 @@ class AllJobStatusResponseDto {
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, AllJobStatusResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, AllJobStatusResponseDto>{};
|
||||
static Map<String, QueuesResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, QueuesResponseDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = AllJobStatusResponseDto.fromJson(entry.value);
|
||||
final value = QueuesResponseDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
@@ -183,14 +183,14 @@ class AllJobStatusResponseDto {
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of AllJobStatusResponseDto-objects as value to a dart map
|
||||
static Map<String, List<AllJobStatusResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AllJobStatusResponseDto>>{};
|
||||
// maps a json object with a list of QueuesResponseDto-objects as value to a dart map
|
||||
static Map<String, List<QueuesResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<QueuesResponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = AllJobStatusResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
map[entry.key] = QueuesResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
Reference in New Issue
Block a user