You've already forked immich
mirror of
https://github.com/immich-app/immich.git
synced 2025-08-08 23:07:06 +02:00
feat(server/web) Add manual job trigger mechanism to the web (#767)
This commit is contained in:
@ -8,6 +8,7 @@ doc/AdminSignupResponseDto.md
|
||||
doc/AlbumApi.md
|
||||
doc/AlbumCountResponseDto.md
|
||||
doc/AlbumResponseDto.md
|
||||
doc/AllJobStatusResponseDto.md
|
||||
doc/AssetApi.md
|
||||
doc/AssetCountByTimeBucket.md
|
||||
doc/AssetCountByTimeBucketResponseDto.md
|
||||
@ -33,6 +34,12 @@ doc/DeviceTypeEnum.md
|
||||
doc/ExifResponseDto.md
|
||||
doc/GetAssetByTimeBucketDto.md
|
||||
doc/GetAssetCountByTimeBucketDto.md
|
||||
doc/JobApi.md
|
||||
doc/JobCommand.md
|
||||
doc/JobCommandDto.md
|
||||
doc/JobCounts.md
|
||||
doc/JobId.md
|
||||
doc/JobStatusResponseDto.md
|
||||
doc/LoginCredentialDto.md
|
||||
doc/LoginResponseDto.md
|
||||
doc/LogoutResponseDto.md
|
||||
@ -59,6 +66,7 @@ lib/api/album_api.dart
|
||||
lib/api/asset_api.dart
|
||||
lib/api/authentication_api.dart
|
||||
lib/api/device_info_api.dart
|
||||
lib/api/job_api.dart
|
||||
lib/api/server_info_api.dart
|
||||
lib/api/user_api.dart
|
||||
lib/api_client.dart
|
||||
@ -74,6 +82,7 @@ lib/model/add_users_dto.dart
|
||||
lib/model/admin_signup_response_dto.dart
|
||||
lib/model/album_count_response_dto.dart
|
||||
lib/model/album_response_dto.dart
|
||||
lib/model/all_job_status_response_dto.dart
|
||||
lib/model/asset_count_by_time_bucket.dart
|
||||
lib/model/asset_count_by_time_bucket_response_dto.dart
|
||||
lib/model/asset_count_by_user_id_response_dto.dart
|
||||
@ -96,6 +105,11 @@ lib/model/device_type_enum.dart
|
||||
lib/model/exif_response_dto.dart
|
||||
lib/model/get_asset_by_time_bucket_dto.dart
|
||||
lib/model/get_asset_count_by_time_bucket_dto.dart
|
||||
lib/model/job_command.dart
|
||||
lib/model/job_command_dto.dart
|
||||
lib/model/job_counts.dart
|
||||
lib/model/job_id.dart
|
||||
lib/model/job_status_response_dto.dart
|
||||
lib/model/login_credential_dto.dart
|
||||
lib/model/login_response_dto.dart
|
||||
lib/model/logout_response_dto.dart
|
||||
|
@ -97,6 +97,9 @@ Class | Method | HTTP request | Description
|
||||
*AuthenticationApi* | [**validateAccessToken**](doc//AuthenticationApi.md#validateaccesstoken) | **POST** /auth/validateToken |
|
||||
*DeviceInfoApi* | [**createDeviceInfo**](doc//DeviceInfoApi.md#createdeviceinfo) | **POST** /device-info |
|
||||
*DeviceInfoApi* | [**updateDeviceInfo**](doc//DeviceInfoApi.md#updatedeviceinfo) | **PATCH** /device-info |
|
||||
*JobApi* | [**getAllJobsStatus**](doc//JobApi.md#getalljobsstatus) | **GET** /jobs |
|
||||
*JobApi* | [**getJobStatus**](doc//JobApi.md#getjobstatus) | **GET** /jobs/{jobId} |
|
||||
*JobApi* | [**sendJobCommand**](doc//JobApi.md#sendjobcommand) | **PUT** /jobs/{jobId} |
|
||||
*ServerInfoApi* | [**getServerInfo**](doc//ServerInfoApi.md#getserverinfo) | **GET** /server-info |
|
||||
*ServerInfoApi* | [**getServerVersion**](doc//ServerInfoApi.md#getserverversion) | **GET** /server-info/version |
|
||||
*ServerInfoApi* | [**pingServer**](doc//ServerInfoApi.md#pingserver) | **GET** /server-info/ping |
|
||||
@ -117,6 +120,7 @@ Class | Method | HTTP request | Description
|
||||
- [AdminSignupResponseDto](doc//AdminSignupResponseDto.md)
|
||||
- [AlbumCountResponseDto](doc//AlbumCountResponseDto.md)
|
||||
- [AlbumResponseDto](doc//AlbumResponseDto.md)
|
||||
- [AllJobStatusResponseDto](doc//AllJobStatusResponseDto.md)
|
||||
- [AssetCountByTimeBucket](doc//AssetCountByTimeBucket.md)
|
||||
- [AssetCountByTimeBucketResponseDto](doc//AssetCountByTimeBucketResponseDto.md)
|
||||
- [AssetCountByUserIdResponseDto](doc//AssetCountByUserIdResponseDto.md)
|
||||
@ -139,6 +143,11 @@ Class | Method | HTTP request | Description
|
||||
- [ExifResponseDto](doc//ExifResponseDto.md)
|
||||
- [GetAssetByTimeBucketDto](doc//GetAssetByTimeBucketDto.md)
|
||||
- [GetAssetCountByTimeBucketDto](doc//GetAssetCountByTimeBucketDto.md)
|
||||
- [JobCommand](doc//JobCommand.md)
|
||||
- [JobCommandDto](doc//JobCommandDto.md)
|
||||
- [JobCounts](doc//JobCounts.md)
|
||||
- [JobId](doc//JobId.md)
|
||||
- [JobStatusResponseDto](doc//JobStatusResponseDto.md)
|
||||
- [LoginCredentialDto](doc//LoginCredentialDto.md)
|
||||
- [LoginResponseDto](doc//LoginResponseDto.md)
|
||||
- [LogoutResponseDto](doc//LogoutResponseDto.md)
|
||||
|
22
mobile/openapi/doc/AllJobStatusResponseDto.md
Normal file
22
mobile/openapi/doc/AllJobStatusResponseDto.md
Normal file
@ -0,0 +1,22 @@
|
||||
# openapi.model.AllJobStatusResponseDto
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**thumbnailGenerationQueueCount** | [**JobCounts**](JobCounts.md) | |
|
||||
**metadataExtractionQueueCount** | [**JobCounts**](JobCounts.md) | |
|
||||
**videoConversionQueueCount** | [**JobCounts**](JobCounts.md) | |
|
||||
**machineLearningQueueCount** | [**JobCounts**](JobCounts.md) | |
|
||||
**isThumbnailGenerationActive** | **bool** | |
|
||||
**isMetadataExtractionActive** | **bool** | |
|
||||
**isVideoConversionActive** | **bool** | |
|
||||
**isMachineLearningActive** | **bool** | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
15
mobile/openapi/doc/CreateJobDto.md
Normal file
15
mobile/openapi/doc/CreateJobDto.md
Normal file
@ -0,0 +1,15 @@
|
||||
# openapi.model.CreateJobDto
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**jobType** | [**JobType**](JobType.md) | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
@ -8,13 +8,13 @@ import 'package:openapi/api.dart';
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **String** | | [optional]
|
||||
**id** | **int** | | [optional]
|
||||
**fileSizeInByte** | **int** | | [optional]
|
||||
**make** | **String** | | [optional]
|
||||
**model** | **String** | | [optional]
|
||||
**imageName** | **String** | | [optional]
|
||||
**exifImageWidth** | **num** | | [optional]
|
||||
**exifImageHeight** | **num** | | [optional]
|
||||
**fileSizeInByte** | **num** | | [optional]
|
||||
**orientation** | **String** | | [optional]
|
||||
**dateTimeOriginal** | [**DateTime**](DateTime.md) | | [optional]
|
||||
**modifyDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||
|
155
mobile/openapi/doc/JobApi.md
Normal file
155
mobile/openapi/doc/JobApi.md
Normal file
@ -0,0 +1,155 @@
|
||||
# openapi.api.JobApi
|
||||
|
||||
## Load the API package
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
All URIs are relative to */api*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**getAllJobsStatus**](JobApi.md#getalljobsstatus) | **GET** /jobs |
|
||||
[**getJobStatus**](JobApi.md#getjobstatus) | **GET** /jobs/{jobId} |
|
||||
[**sendJobCommand**](JobApi.md#sendjobcommand) | **PUT** /jobs/{jobId} |
|
||||
|
||||
|
||||
# **getAllJobsStatus**
|
||||
> AllJobStatusResponseDto getAllJobsStatus()
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
// TODO Configure HTTP Bearer authorization: bearer
|
||||
// Case 1. Use String Token
|
||||
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
|
||||
// Case 2. Use Function which generate token.
|
||||
// String yourTokenGeneratorFunction() { ... }
|
||||
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
|
||||
|
||||
final api_instance = JobApi();
|
||||
|
||||
try {
|
||||
final result = api_instance.getAllJobsStatus();
|
||||
print(result);
|
||||
} catch (e) {
|
||||
print('Exception when calling JobApi->getAllJobsStatus: $e\n');
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
[**AllJobStatusResponseDto**](AllJobStatusResponseDto.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[bearer](../README.md#bearer)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **getJobStatus**
|
||||
> JobStatusResponseDto getJobStatus(jobId)
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
// TODO Configure HTTP Bearer authorization: bearer
|
||||
// Case 1. Use String Token
|
||||
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
|
||||
// Case 2. Use Function which generate token.
|
||||
// String yourTokenGeneratorFunction() { ... }
|
||||
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
|
||||
|
||||
final api_instance = JobApi();
|
||||
final jobId = ; // JobId |
|
||||
|
||||
try {
|
||||
final result = api_instance.getJobStatus(jobId);
|
||||
print(result);
|
||||
} catch (e) {
|
||||
print('Exception when calling JobApi->getJobStatus: $e\n');
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**jobId** | [**JobId**](.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
[**JobStatusResponseDto**](JobStatusResponseDto.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[bearer](../README.md#bearer)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **sendJobCommand**
|
||||
> num sendJobCommand(jobId, jobCommandDto)
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
// TODO Configure HTTP Bearer authorization: bearer
|
||||
// Case 1. Use String Token
|
||||
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
|
||||
// Case 2. Use Function which generate token.
|
||||
// String yourTokenGeneratorFunction() { ... }
|
||||
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
|
||||
|
||||
final api_instance = JobApi();
|
||||
final jobId = ; // JobId |
|
||||
final jobCommandDto = JobCommandDto(); // JobCommandDto |
|
||||
|
||||
try {
|
||||
final result = api_instance.sendJobCommand(jobId, jobCommandDto);
|
||||
print(result);
|
||||
} catch (e) {
|
||||
print('Exception when calling JobApi->sendJobCommand: $e\n');
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**jobId** | [**JobId**](.md)| |
|
||||
**jobCommandDto** | [**JobCommandDto**](JobCommandDto.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
**num**
|
||||
|
||||
### Authorization
|
||||
|
||||
[bearer](../README.md#bearer)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
14
mobile/openapi/doc/JobCommand.md
Normal file
14
mobile/openapi/doc/JobCommand.md
Normal file
@ -0,0 +1,14 @@
|
||||
# openapi.model.JobCommand
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
15
mobile/openapi/doc/JobCommandDto.md
Normal file
15
mobile/openapi/doc/JobCommandDto.md
Normal file
@ -0,0 +1,15 @@
|
||||
# openapi.model.JobCommandDto
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**command** | [**JobCommand**](JobCommand.md) | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
19
mobile/openapi/doc/JobCounts.md
Normal file
19
mobile/openapi/doc/JobCounts.md
Normal file
@ -0,0 +1,19 @@
|
||||
# openapi.model.JobCounts
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**active** | **num** | |
|
||||
**completed** | **num** | |
|
||||
**failed** | **num** | |
|
||||
**delayed** | **num** | |
|
||||
**waiting** | **num** | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
14
mobile/openapi/doc/JobId.md
Normal file
14
mobile/openapi/doc/JobId.md
Normal file
@ -0,0 +1,14 @@
|
||||
# openapi.model.JobId
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
16
mobile/openapi/doc/JobStatusResponseDto.md
Normal file
16
mobile/openapi/doc/JobStatusResponseDto.md
Normal file
@ -0,0 +1,16 @@
|
||||
# openapi.model.JobStatusResponseDto
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**isActive** | **bool** | |
|
||||
**queueCount** | [**Object**](.md) | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
14
mobile/openapi/doc/JobType.md
Normal file
14
mobile/openapi/doc/JobType.md
Normal file
@ -0,0 +1,14 @@
|
||||
# openapi.model.JobType
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
@ -31,6 +31,7 @@ part 'api/album_api.dart';
|
||||
part 'api/asset_api.dart';
|
||||
part 'api/authentication_api.dart';
|
||||
part 'api/device_info_api.dart';
|
||||
part 'api/job_api.dart';
|
||||
part 'api/server_info_api.dart';
|
||||
part 'api/user_api.dart';
|
||||
|
||||
@ -39,6 +40,7 @@ part 'model/add_users_dto.dart';
|
||||
part 'model/admin_signup_response_dto.dart';
|
||||
part 'model/album_count_response_dto.dart';
|
||||
part 'model/album_response_dto.dart';
|
||||
part 'model/all_job_status_response_dto.dart';
|
||||
part 'model/asset_count_by_time_bucket.dart';
|
||||
part 'model/asset_count_by_time_bucket_response_dto.dart';
|
||||
part 'model/asset_count_by_user_id_response_dto.dart';
|
||||
@ -61,6 +63,11 @@ part 'model/device_type_enum.dart';
|
||||
part 'model/exif_response_dto.dart';
|
||||
part 'model/get_asset_by_time_bucket_dto.dart';
|
||||
part 'model/get_asset_count_by_time_bucket_dto.dart';
|
||||
part 'model/job_command.dart';
|
||||
part 'model/job_command_dto.dart';
|
||||
part 'model/job_counts.dart';
|
||||
part 'model/job_id.dart';
|
||||
part 'model/job_status_response_dto.dart';
|
||||
part 'model/login_credential_dto.dart';
|
||||
part 'model/login_response_dto.dart';
|
||||
part 'model/logout_response_dto.dart';
|
||||
|
159
mobile/openapi/lib/api/job_api.dart
Normal file
159
mobile/openapi/lib/api/job_api.dart
Normal file
@ -0,0 +1,159 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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 JobApi {
|
||||
JobApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
|
||||
|
||||
final ApiClient apiClient;
|
||||
|
||||
/// Performs an HTTP 'GET /jobs' operation and returns the [Response].
|
||||
Future<Response> getAllJobsStatusWithHttpInfo() async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/jobs';
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'GET',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
Future<AllJobStatusResponseDto?> getAllJobsStatus() async {
|
||||
final response = await getAllJobsStatusWithHttpInfo();
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// 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 null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'GET /jobs/{jobId}' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [JobId] jobId (required):
|
||||
Future<Response> getJobStatusWithHttpInfo(JobId jobId,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/jobs/{jobId}'
|
||||
.replaceAll('{jobId}', jobId.toString());
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'GET',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [JobId] jobId (required):
|
||||
Future<JobStatusResponseDto?> getJobStatus(JobId jobId,) async {
|
||||
final response = await getJobStatusWithHttpInfo(jobId,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// 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), 'JobStatusResponseDto',) as JobStatusResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Performs an HTTP 'PUT /jobs/{jobId}' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [JobId] jobId (required):
|
||||
///
|
||||
/// * [JobCommandDto] jobCommandDto (required):
|
||||
Future<Response> sendJobCommandWithHttpInfo(JobId jobId, JobCommandDto jobCommandDto,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/jobs/{jobId}'
|
||||
.replaceAll('{jobId}', jobId.toString());
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody = jobCommandDto;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
final formParams = <String, String>{};
|
||||
|
||||
const contentTypes = <String>['application/json'];
|
||||
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
path,
|
||||
'PUT',
|
||||
queryParams,
|
||||
postBody,
|
||||
headerParams,
|
||||
formParams,
|
||||
contentTypes.isEmpty ? null : contentTypes.first,
|
||||
);
|
||||
}
|
||||
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [JobId] jobId (required):
|
||||
///
|
||||
/// * [JobCommandDto] jobCommandDto (required):
|
||||
Future<num?> sendJobCommand(JobId jobId, JobCommandDto jobCommandDto,) async {
|
||||
final response = await sendJobCommandWithHttpInfo(jobId, jobCommandDto,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||
// 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), 'num',) as num;
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@ -202,6 +202,8 @@ class ApiClient {
|
||||
return AlbumCountResponseDto.fromJson(value);
|
||||
case 'AlbumResponseDto':
|
||||
return AlbumResponseDto.fromJson(value);
|
||||
case 'AllJobStatusResponseDto':
|
||||
return AllJobStatusResponseDto.fromJson(value);
|
||||
case 'AssetCountByTimeBucket':
|
||||
return AssetCountByTimeBucket.fromJson(value);
|
||||
case 'AssetCountByTimeBucketResponseDto':
|
||||
@ -246,6 +248,16 @@ class ApiClient {
|
||||
return GetAssetByTimeBucketDto.fromJson(value);
|
||||
case 'GetAssetCountByTimeBucketDto':
|
||||
return GetAssetCountByTimeBucketDto.fromJson(value);
|
||||
case 'JobCommand':
|
||||
return JobCommandTypeTransformer().decode(value);
|
||||
case 'JobCommandDto':
|
||||
return JobCommandDto.fromJson(value);
|
||||
case 'JobCounts':
|
||||
return JobCounts.fromJson(value);
|
||||
case 'JobId':
|
||||
return JobIdTypeTransformer().decode(value);
|
||||
case 'JobStatusResponseDto':
|
||||
return JobStatusResponseDto.fromJson(value);
|
||||
case 'LoginCredentialDto':
|
||||
return LoginCredentialDto.fromJson(value);
|
||||
case 'LoginResponseDto':
|
||||
|
@ -64,6 +64,12 @@ String parameterToString(dynamic value) {
|
||||
if (value is DeviceTypeEnum) {
|
||||
return DeviceTypeEnumTypeTransformer().encode(value).toString();
|
||||
}
|
||||
if (value is JobCommand) {
|
||||
return JobCommandTypeTransformer().encode(value).toString();
|
||||
}
|
||||
if (value is JobId) {
|
||||
return JobIdTypeTransformer().encode(value).toString();
|
||||
}
|
||||
if (value is ThumbnailFormat) {
|
||||
return ThumbnailFormatTypeTransformer().encode(value).toString();
|
||||
}
|
||||
|
167
mobile/openapi/lib/model/all_job_status_response_dto.dart
Normal file
167
mobile/openapi/lib/model/all_job_status_response_dto.dart
Normal file
@ -0,0 +1,167 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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 AllJobStatusResponseDto {
|
||||
/// Returns a new [AllJobStatusResponseDto] instance.
|
||||
AllJobStatusResponseDto({
|
||||
required this.thumbnailGenerationQueueCount,
|
||||
required this.metadataExtractionQueueCount,
|
||||
required this.videoConversionQueueCount,
|
||||
required this.machineLearningQueueCount,
|
||||
required this.isThumbnailGenerationActive,
|
||||
required this.isMetadataExtractionActive,
|
||||
required this.isVideoConversionActive,
|
||||
required this.isMachineLearningActive,
|
||||
});
|
||||
|
||||
JobCounts thumbnailGenerationQueueCount;
|
||||
|
||||
JobCounts metadataExtractionQueueCount;
|
||||
|
||||
JobCounts videoConversionQueueCount;
|
||||
|
||||
JobCounts machineLearningQueueCount;
|
||||
|
||||
bool isThumbnailGenerationActive;
|
||||
|
||||
bool isMetadataExtractionActive;
|
||||
|
||||
bool isVideoConversionActive;
|
||||
|
||||
bool isMachineLearningActive;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is AllJobStatusResponseDto &&
|
||||
other.thumbnailGenerationQueueCount == thumbnailGenerationQueueCount &&
|
||||
other.metadataExtractionQueueCount == metadataExtractionQueueCount &&
|
||||
other.videoConversionQueueCount == videoConversionQueueCount &&
|
||||
other.machineLearningQueueCount == machineLearningQueueCount &&
|
||||
other.isThumbnailGenerationActive == isThumbnailGenerationActive &&
|
||||
other.isMetadataExtractionActive == isMetadataExtractionActive &&
|
||||
other.isVideoConversionActive == isVideoConversionActive &&
|
||||
other.isMachineLearningActive == isMachineLearningActive;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(thumbnailGenerationQueueCount.hashCode) +
|
||||
(metadataExtractionQueueCount.hashCode) +
|
||||
(videoConversionQueueCount.hashCode) +
|
||||
(machineLearningQueueCount.hashCode) +
|
||||
(isThumbnailGenerationActive.hashCode) +
|
||||
(isMetadataExtractionActive.hashCode) +
|
||||
(isVideoConversionActive.hashCode) +
|
||||
(isMachineLearningActive.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'AllJobStatusResponseDto[thumbnailGenerationQueueCount=$thumbnailGenerationQueueCount, metadataExtractionQueueCount=$metadataExtractionQueueCount, videoConversionQueueCount=$videoConversionQueueCount, machineLearningQueueCount=$machineLearningQueueCount, isThumbnailGenerationActive=$isThumbnailGenerationActive, isMetadataExtractionActive=$isMetadataExtractionActive, isVideoConversionActive=$isVideoConversionActive, isMachineLearningActive=$isMachineLearningActive]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'thumbnailGenerationQueueCount'] = thumbnailGenerationQueueCount;
|
||||
_json[r'metadataExtractionQueueCount'] = metadataExtractionQueueCount;
|
||||
_json[r'videoConversionQueueCount'] = videoConversionQueueCount;
|
||||
_json[r'machineLearningQueueCount'] = machineLearningQueueCount;
|
||||
_json[r'isThumbnailGenerationActive'] = isThumbnailGenerationActive;
|
||||
_json[r'isMetadataExtractionActive'] = isMetadataExtractionActive;
|
||||
_json[r'isVideoConversionActive'] = isVideoConversionActive;
|
||||
_json[r'isMachineLearningActive'] = isMachineLearningActive;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [AllJobStatusResponseDto] 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) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "AllJobStatusResponseDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "AllJobStatusResponseDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return AllJobStatusResponseDto(
|
||||
thumbnailGenerationQueueCount: JobCounts.fromJson(json[r'thumbnailGenerationQueueCount'])!,
|
||||
metadataExtractionQueueCount: JobCounts.fromJson(json[r'metadataExtractionQueueCount'])!,
|
||||
videoConversionQueueCount: JobCounts.fromJson(json[r'videoConversionQueueCount'])!,
|
||||
machineLearningQueueCount: JobCounts.fromJson(json[r'machineLearningQueueCount'])!,
|
||||
isThumbnailGenerationActive: mapValueOfType<bool>(json, r'isThumbnailGenerationActive')!,
|
||||
isMetadataExtractionActive: mapValueOfType<bool>(json, r'isMetadataExtractionActive')!,
|
||||
isVideoConversionActive: mapValueOfType<bool>(json, r'isVideoConversionActive')!,
|
||||
isMachineLearningActive: mapValueOfType<bool>(json, r'isMachineLearningActive')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AllJobStatusResponseDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AllJobStatusResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = AllJobStatusResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, AllJobStatusResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, AllJobStatusResponseDto>{};
|
||||
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);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
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>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = AllJobStatusResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'thumbnailGenerationQueueCount',
|
||||
'metadataExtractionQueueCount',
|
||||
'videoConversionQueueCount',
|
||||
'machineLearningQueueCount',
|
||||
'isThumbnailGenerationActive',
|
||||
'isMetadataExtractionActive',
|
||||
'isVideoConversionActive',
|
||||
'isMachineLearningActive',
|
||||
};
|
||||
}
|
||||
|
@ -76,72 +76,69 @@ class AssetResponseDto {
|
||||
SmartInfoResponseDto? smartInfo;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is AssetResponseDto &&
|
||||
other.type == type &&
|
||||
other.id == id &&
|
||||
other.deviceAssetId == deviceAssetId &&
|
||||
other.ownerId == ownerId &&
|
||||
other.deviceId == deviceId &&
|
||||
other.originalPath == originalPath &&
|
||||
other.resizePath == resizePath &&
|
||||
other.createdAt == createdAt &&
|
||||
other.modifiedAt == modifiedAt &&
|
||||
other.isFavorite == isFavorite &&
|
||||
other.mimeType == mimeType &&
|
||||
other.duration == duration &&
|
||||
other.webpPath == webpPath &&
|
||||
other.encodedVideoPath == encodedVideoPath &&
|
||||
other.exifInfo == exifInfo &&
|
||||
other.smartInfo == smartInfo;
|
||||
bool operator ==(Object other) => identical(this, other) || other is AssetResponseDto &&
|
||||
other.type == type &&
|
||||
other.id == id &&
|
||||
other.deviceAssetId == deviceAssetId &&
|
||||
other.ownerId == ownerId &&
|
||||
other.deviceId == deviceId &&
|
||||
other.originalPath == originalPath &&
|
||||
other.resizePath == resizePath &&
|
||||
other.createdAt == createdAt &&
|
||||
other.modifiedAt == modifiedAt &&
|
||||
other.isFavorite == isFavorite &&
|
||||
other.mimeType == mimeType &&
|
||||
other.duration == duration &&
|
||||
other.webpPath == webpPath &&
|
||||
other.encodedVideoPath == encodedVideoPath &&
|
||||
other.exifInfo == exifInfo &&
|
||||
other.smartInfo == smartInfo;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(type.hashCode) +
|
||||
(id.hashCode) +
|
||||
(deviceAssetId.hashCode) +
|
||||
(ownerId.hashCode) +
|
||||
(deviceId.hashCode) +
|
||||
(originalPath.hashCode) +
|
||||
(resizePath == null ? 0 : resizePath!.hashCode) +
|
||||
(createdAt.hashCode) +
|
||||
(modifiedAt.hashCode) +
|
||||
(isFavorite.hashCode) +
|
||||
(mimeType == null ? 0 : mimeType!.hashCode) +
|
||||
(duration.hashCode) +
|
||||
(webpPath == null ? 0 : webpPath!.hashCode) +
|
||||
(encodedVideoPath == null ? 0 : encodedVideoPath!.hashCode) +
|
||||
(exifInfo == null ? 0 : exifInfo!.hashCode) +
|
||||
(smartInfo == null ? 0 : smartInfo!.hashCode);
|
||||
// ignore: unnecessary_parenthesis
|
||||
(type.hashCode) +
|
||||
(id.hashCode) +
|
||||
(deviceAssetId.hashCode) +
|
||||
(ownerId.hashCode) +
|
||||
(deviceId.hashCode) +
|
||||
(originalPath.hashCode) +
|
||||
(resizePath == null ? 0 : resizePath!.hashCode) +
|
||||
(createdAt.hashCode) +
|
||||
(modifiedAt.hashCode) +
|
||||
(isFavorite.hashCode) +
|
||||
(mimeType == null ? 0 : mimeType!.hashCode) +
|
||||
(duration.hashCode) +
|
||||
(webpPath == null ? 0 : webpPath!.hashCode) +
|
||||
(encodedVideoPath == null ? 0 : encodedVideoPath!.hashCode) +
|
||||
(exifInfo == null ? 0 : exifInfo!.hashCode) +
|
||||
(smartInfo == null ? 0 : smartInfo!.hashCode);
|
||||
|
||||
@override
|
||||
String toString() =>
|
||||
'AssetResponseDto[type=$type, id=$id, deviceAssetId=$deviceAssetId, ownerId=$ownerId, deviceId=$deviceId, originalPath=$originalPath, resizePath=$resizePath, createdAt=$createdAt, modifiedAt=$modifiedAt, isFavorite=$isFavorite, mimeType=$mimeType, duration=$duration, webpPath=$webpPath, encodedVideoPath=$encodedVideoPath, exifInfo=$exifInfo, smartInfo=$smartInfo]';
|
||||
String toString() => 'AssetResponseDto[type=$type, id=$id, deviceAssetId=$deviceAssetId, ownerId=$ownerId, deviceId=$deviceId, originalPath=$originalPath, resizePath=$resizePath, createdAt=$createdAt, modifiedAt=$modifiedAt, isFavorite=$isFavorite, mimeType=$mimeType, duration=$duration, webpPath=$webpPath, encodedVideoPath=$encodedVideoPath, exifInfo=$exifInfo, smartInfo=$smartInfo]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'type'] = type;
|
||||
_json[r'id'] = id;
|
||||
_json[r'deviceAssetId'] = deviceAssetId;
|
||||
_json[r'ownerId'] = ownerId;
|
||||
_json[r'deviceId'] = deviceId;
|
||||
_json[r'originalPath'] = originalPath;
|
||||
_json[r'type'] = type;
|
||||
_json[r'id'] = id;
|
||||
_json[r'deviceAssetId'] = deviceAssetId;
|
||||
_json[r'ownerId'] = ownerId;
|
||||
_json[r'deviceId'] = deviceId;
|
||||
_json[r'originalPath'] = originalPath;
|
||||
if (resizePath != null) {
|
||||
_json[r'resizePath'] = resizePath;
|
||||
} else {
|
||||
_json[r'resizePath'] = null;
|
||||
}
|
||||
_json[r'createdAt'] = createdAt;
|
||||
_json[r'modifiedAt'] = modifiedAt;
|
||||
_json[r'isFavorite'] = isFavorite;
|
||||
_json[r'createdAt'] = createdAt;
|
||||
_json[r'modifiedAt'] = modifiedAt;
|
||||
_json[r'isFavorite'] = isFavorite;
|
||||
if (mimeType != null) {
|
||||
_json[r'mimeType'] = mimeType;
|
||||
} else {
|
||||
_json[r'mimeType'] = null;
|
||||
}
|
||||
_json[r'duration'] = duration;
|
||||
_json[r'duration'] = duration;
|
||||
if (webpPath != null) {
|
||||
_json[r'webpPath'] = webpPath;
|
||||
} else {
|
||||
@ -175,13 +172,13 @@ class AssetResponseDto {
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
// assert(() {
|
||||
// requiredKeys.forEach((key) {
|
||||
// assert(json.containsKey(key), 'Required key "AssetResponseDto[$key]" is missing from JSON.');
|
||||
// assert(json[key] != null, 'Required key "AssetResponseDto[$key]" has a null value in JSON.');
|
||||
// });
|
||||
// return true;
|
||||
// }());
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "AssetResponseDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "AssetResponseDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return AssetResponseDto(
|
||||
type: AssetTypeEnum.fromJson(json[r'type'])!,
|
||||
@ -205,10 +202,7 @@ class AssetResponseDto {
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AssetResponseDto>? listFromJson(
|
||||
dynamic json, {
|
||||
bool growable = false,
|
||||
}) {
|
||||
static List<AssetResponseDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AssetResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
@ -236,18 +230,12 @@ class AssetResponseDto {
|
||||
}
|
||||
|
||||
// maps a json object with a list of AssetResponseDto-objects as value to a dart map
|
||||
static Map<String, List<AssetResponseDto>> mapListFromJson(
|
||||
dynamic json, {
|
||||
bool growable = false,
|
||||
}) {
|
||||
static Map<String, List<AssetResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AssetResponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = AssetResponseDto.listFromJson(
|
||||
entry.value,
|
||||
growable: growable,
|
||||
);
|
||||
final value = AssetResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
@ -274,3 +262,4 @@ class AssetResponseDto {
|
||||
'encodedVideoPath',
|
||||
};
|
||||
}
|
||||
|
||||
|
111
mobile/openapi/lib/model/create_job_dto.dart
Normal file
111
mobile/openapi/lib/model/create_job_dto.dart
Normal file
@ -0,0 +1,111 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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 CreateJobDto {
|
||||
/// Returns a new [CreateJobDto] instance.
|
||||
CreateJobDto({
|
||||
required this.jobType,
|
||||
});
|
||||
|
||||
JobType jobType;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is CreateJobDto &&
|
||||
other.jobType == jobType;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(jobType.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'CreateJobDto[jobType=$jobType]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'jobType'] = jobType;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [CreateJobDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static CreateJobDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "CreateJobDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "CreateJobDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return CreateJobDto(
|
||||
jobType: JobType.fromJson(json[r'jobType'])!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<CreateJobDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <CreateJobDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = CreateJobDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, CreateJobDto> mapFromJson(dynamic json) {
|
||||
final map = <String, CreateJobDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = CreateJobDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of CreateJobDto-objects as value to a dart map
|
||||
static Map<String, List<CreateJobDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<CreateJobDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = CreateJobDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'jobType',
|
||||
};
|
||||
}
|
||||
|
@ -14,12 +14,12 @@ class ExifResponseDto {
|
||||
/// Returns a new [ExifResponseDto] instance.
|
||||
ExifResponseDto({
|
||||
this.id,
|
||||
this.fileSizeInByte,
|
||||
this.make,
|
||||
this.model,
|
||||
this.imageName,
|
||||
this.exifImageWidth,
|
||||
this.exifImageHeight,
|
||||
this.fileSizeInByte,
|
||||
this.orientation,
|
||||
this.dateTimeOriginal,
|
||||
this.modifyDate,
|
||||
@ -35,7 +35,9 @@ class ExifResponseDto {
|
||||
this.country,
|
||||
});
|
||||
|
||||
String? id;
|
||||
int? id;
|
||||
|
||||
int? fileSizeInByte;
|
||||
|
||||
String? make;
|
||||
|
||||
@ -47,8 +49,6 @@ class ExifResponseDto {
|
||||
|
||||
num? exifImageHeight;
|
||||
|
||||
num? fileSizeInByte;
|
||||
|
||||
String? orientation;
|
||||
|
||||
DateTime? dateTimeOriginal;
|
||||
@ -78,12 +78,12 @@ class ExifResponseDto {
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is ExifResponseDto &&
|
||||
other.id == id &&
|
||||
other.fileSizeInByte == fileSizeInByte &&
|
||||
other.make == make &&
|
||||
other.model == model &&
|
||||
other.imageName == imageName &&
|
||||
other.exifImageWidth == exifImageWidth &&
|
||||
other.exifImageHeight == exifImageHeight &&
|
||||
other.fileSizeInByte == fileSizeInByte &&
|
||||
other.orientation == orientation &&
|
||||
other.dateTimeOriginal == dateTimeOriginal &&
|
||||
other.modifyDate == modifyDate &&
|
||||
@ -102,12 +102,12 @@ class ExifResponseDto {
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(id == null ? 0 : id!.hashCode) +
|
||||
(fileSizeInByte == null ? 0 : fileSizeInByte!.hashCode) +
|
||||
(make == null ? 0 : make!.hashCode) +
|
||||
(model == null ? 0 : model!.hashCode) +
|
||||
(imageName == null ? 0 : imageName!.hashCode) +
|
||||
(exifImageWidth == null ? 0 : exifImageWidth!.hashCode) +
|
||||
(exifImageHeight == null ? 0 : exifImageHeight!.hashCode) +
|
||||
(fileSizeInByte == null ? 0 : fileSizeInByte!.hashCode) +
|
||||
(orientation == null ? 0 : orientation!.hashCode) +
|
||||
(dateTimeOriginal == null ? 0 : dateTimeOriginal!.hashCode) +
|
||||
(modifyDate == null ? 0 : modifyDate!.hashCode) +
|
||||
@ -123,7 +123,7 @@ class ExifResponseDto {
|
||||
(country == null ? 0 : country!.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'ExifResponseDto[id=$id, make=$make, model=$model, imageName=$imageName, exifImageWidth=$exifImageWidth, exifImageHeight=$exifImageHeight, fileSizeInByte=$fileSizeInByte, orientation=$orientation, dateTimeOriginal=$dateTimeOriginal, modifyDate=$modifyDate, lensModel=$lensModel, fNumber=$fNumber, focalLength=$focalLength, iso=$iso, exposureTime=$exposureTime, latitude=$latitude, longitude=$longitude, city=$city, state=$state, country=$country]';
|
||||
String toString() => 'ExifResponseDto[id=$id, fileSizeInByte=$fileSizeInByte, make=$make, model=$model, imageName=$imageName, exifImageWidth=$exifImageWidth, exifImageHeight=$exifImageHeight, orientation=$orientation, dateTimeOriginal=$dateTimeOriginal, modifyDate=$modifyDate, lensModel=$lensModel, fNumber=$fNumber, focalLength=$focalLength, iso=$iso, exposureTime=$exposureTime, latitude=$latitude, longitude=$longitude, city=$city, state=$state, country=$country]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
@ -132,6 +132,11 @@ class ExifResponseDto {
|
||||
} else {
|
||||
_json[r'id'] = null;
|
||||
}
|
||||
if (fileSizeInByte != null) {
|
||||
_json[r'fileSizeInByte'] = fileSizeInByte;
|
||||
} else {
|
||||
_json[r'fileSizeInByte'] = null;
|
||||
}
|
||||
if (make != null) {
|
||||
_json[r'make'] = make;
|
||||
} else {
|
||||
@ -157,11 +162,6 @@ class ExifResponseDto {
|
||||
} else {
|
||||
_json[r'exifImageHeight'] = null;
|
||||
}
|
||||
if (fileSizeInByte != null) {
|
||||
_json[r'fileSizeInByte'] = fileSizeInByte;
|
||||
} else {
|
||||
_json[r'fileSizeInByte'] = null;
|
||||
}
|
||||
if (orientation != null) {
|
||||
_json[r'orientation'] = orientation;
|
||||
} else {
|
||||
@ -249,7 +249,8 @@ class ExifResponseDto {
|
||||
}());
|
||||
|
||||
return ExifResponseDto(
|
||||
id: mapValueOfType<String>(json, r'id'),
|
||||
id: mapValueOfType<int>(json, r'id'),
|
||||
fileSizeInByte: mapValueOfType<int>(json, r'fileSizeInByte'),
|
||||
make: mapValueOfType<String>(json, r'make'),
|
||||
model: mapValueOfType<String>(json, r'model'),
|
||||
imageName: mapValueOfType<String>(json, r'imageName'),
|
||||
@ -259,9 +260,6 @@ class ExifResponseDto {
|
||||
exifImageHeight: json[r'exifImageHeight'] == null
|
||||
? null
|
||||
: num.parse(json[r'exifImageHeight'].toString()),
|
||||
fileSizeInByte: json[r'fileSizeInByte'] == null
|
||||
? null
|
||||
: num.parse(json[r'fileSizeInByte'].toString()),
|
||||
orientation: mapValueOfType<String>(json, r'orientation'),
|
||||
dateTimeOriginal: mapDateTime(json, r'dateTimeOriginal', ''),
|
||||
modifyDate: mapDateTime(json, r'modifyDate', ''),
|
||||
|
85
mobile/openapi/lib/model/job_command.dart
Normal file
85
mobile/openapi/lib/model/job_command.dart
Normal file
@ -0,0 +1,85 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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 stop = JobCommand._(r'stop');
|
||||
|
||||
/// List of all possible values in this [enum][JobCommand].
|
||||
static const values = <JobCommand>[
|
||||
start,
|
||||
stop,
|
||||
];
|
||||
|
||||
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.toString()) {
|
||||
case r'start': return JobCommand.start;
|
||||
case r'stop': return JobCommand.stop;
|
||||
default:
|
||||
if (!allowNull) {
|
||||
throw ArgumentError('Unknown enum value to decode: $data');
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Singleton [JobCommandTypeTransformer] instance.
|
||||
static JobCommandTypeTransformer? _instance;
|
||||
}
|
||||
|
111
mobile/openapi/lib/model/job_command_dto.dart
Normal file
111
mobile/openapi/lib/model/job_command_dto.dart
Normal file
@ -0,0 +1,111 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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 JobCommandDto {
|
||||
/// Returns a new [JobCommandDto] instance.
|
||||
JobCommandDto({
|
||||
required this.command,
|
||||
});
|
||||
|
||||
JobCommand command;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is JobCommandDto &&
|
||||
other.command == command;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(command.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'JobCommandDto[command=$command]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'command'] = command;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [JobCommandDto] 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) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "JobCommandDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "JobCommandDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return JobCommandDto(
|
||||
command: JobCommand.fromJson(json[r'command'])!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<JobCommandDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <JobCommandDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = JobCommandDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, JobCommandDto> mapFromJson(dynamic json) {
|
||||
final map = <String, JobCommandDto>{};
|
||||
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);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
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>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = JobCommandDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'command',
|
||||
};
|
||||
}
|
||||
|
153
mobile/openapi/lib/model/job_counts.dart
Normal file
153
mobile/openapi/lib/model/job_counts.dart
Normal file
@ -0,0 +1,153 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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 JobCounts {
|
||||
/// Returns a new [JobCounts] instance.
|
||||
JobCounts({
|
||||
required this.active,
|
||||
required this.completed,
|
||||
required this.failed,
|
||||
required this.delayed,
|
||||
required this.waiting,
|
||||
});
|
||||
|
||||
num active;
|
||||
|
||||
num completed;
|
||||
|
||||
num failed;
|
||||
|
||||
num delayed;
|
||||
|
||||
num waiting;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is JobCounts &&
|
||||
other.active == active &&
|
||||
other.completed == completed &&
|
||||
other.failed == failed &&
|
||||
other.delayed == delayed &&
|
||||
other.waiting == waiting;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(active.hashCode) +
|
||||
(completed.hashCode) +
|
||||
(failed.hashCode) +
|
||||
(delayed.hashCode) +
|
||||
(waiting.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'JobCounts[active=$active, completed=$completed, failed=$failed, delayed=$delayed, waiting=$waiting]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'active'] = active;
|
||||
_json[r'completed'] = completed;
|
||||
_json[r'failed'] = failed;
|
||||
_json[r'delayed'] = delayed;
|
||||
_json[r'waiting'] = waiting;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [JobCounts] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static JobCounts? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "JobCounts[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "JobCounts[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return JobCounts(
|
||||
active: json[r'active'] == null
|
||||
? null
|
||||
: num.parse(json[r'active'].toString()),
|
||||
completed: json[r'completed'] == null
|
||||
? null
|
||||
: num.parse(json[r'completed'].toString()),
|
||||
failed: json[r'failed'] == null
|
||||
? null
|
||||
: num.parse(json[r'failed'].toString()),
|
||||
delayed: json[r'delayed'] == null
|
||||
? null
|
||||
: num.parse(json[r'delayed'].toString()),
|
||||
waiting: json[r'waiting'] == null
|
||||
? null
|
||||
: num.parse(json[r'waiting'].toString()),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<JobCounts>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <JobCounts>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = JobCounts.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, JobCounts> mapFromJson(dynamic json) {
|
||||
final map = <String, JobCounts>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = JobCounts.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of JobCounts-objects as value to a dart map
|
||||
static Map<String, List<JobCounts>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<JobCounts>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = JobCounts.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'active',
|
||||
'completed',
|
||||
'failed',
|
||||
'delayed',
|
||||
'waiting',
|
||||
};
|
||||
}
|
||||
|
91
mobile/openapi/lib/model/job_id.dart
Normal file
91
mobile/openapi/lib/model/job_id.dart
Normal file
@ -0,0 +1,91 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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 JobId {
|
||||
/// Instantiate a new enum with the provided [value].
|
||||
const JobId._(this.value);
|
||||
|
||||
/// The underlying value of this enum member.
|
||||
final String value;
|
||||
|
||||
@override
|
||||
String toString() => value;
|
||||
|
||||
String toJson() => value;
|
||||
|
||||
static const thumbnailGeneration = JobId._(r'thumbnail-generation');
|
||||
static const metadataExtraction = JobId._(r'metadata-extraction');
|
||||
static const videoConversion = JobId._(r'video-conversion');
|
||||
static const machineLearning = JobId._(r'machine-learning');
|
||||
|
||||
/// List of all possible values in this [enum][JobId].
|
||||
static const values = <JobId>[
|
||||
thumbnailGeneration,
|
||||
metadataExtraction,
|
||||
videoConversion,
|
||||
machineLearning,
|
||||
];
|
||||
|
||||
static JobId? fromJson(dynamic value) => JobIdTypeTransformer().decode(value);
|
||||
|
||||
static List<JobId>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <JobId>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = JobId.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
}
|
||||
|
||||
/// Transformation class that can [encode] an instance of [JobId] to String,
|
||||
/// and [decode] dynamic data back to [JobId].
|
||||
class JobIdTypeTransformer {
|
||||
factory JobIdTypeTransformer() => _instance ??= const JobIdTypeTransformer._();
|
||||
|
||||
const JobIdTypeTransformer._();
|
||||
|
||||
String encode(JobId data) => data.value;
|
||||
|
||||
/// Decodes a [dynamic value][data] to a JobId.
|
||||
///
|
||||
/// 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.
|
||||
JobId? decode(dynamic data, {bool allowNull = true}) {
|
||||
if (data != null) {
|
||||
switch (data.toString()) {
|
||||
case r'thumbnail-generation': return JobId.thumbnailGeneration;
|
||||
case r'metadata-extraction': return JobId.metadataExtraction;
|
||||
case r'video-conversion': return JobId.videoConversion;
|
||||
case r'machine-learning': return JobId.machineLearning;
|
||||
default:
|
||||
if (!allowNull) {
|
||||
throw ArgumentError('Unknown enum value to decode: $data');
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Singleton [JobIdTypeTransformer] instance.
|
||||
static JobIdTypeTransformer? _instance;
|
||||
}
|
||||
|
119
mobile/openapi/lib/model/job_status_response_dto.dart
Normal file
119
mobile/openapi/lib/model/job_status_response_dto.dart
Normal file
@ -0,0 +1,119 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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 JobStatusResponseDto {
|
||||
/// Returns a new [JobStatusResponseDto] instance.
|
||||
JobStatusResponseDto({
|
||||
required this.isActive,
|
||||
required this.queueCount,
|
||||
});
|
||||
|
||||
bool isActive;
|
||||
|
||||
Object queueCount;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is JobStatusResponseDto &&
|
||||
other.isActive == isActive &&
|
||||
other.queueCount == queueCount;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(isActive.hashCode) +
|
||||
(queueCount.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'JobStatusResponseDto[isActive=$isActive, queueCount=$queueCount]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _json = <String, dynamic>{};
|
||||
_json[r'isActive'] = isActive;
|
||||
_json[r'queueCount'] = queueCount;
|
||||
return _json;
|
||||
}
|
||||
|
||||
/// Returns a new [JobStatusResponseDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static JobStatusResponseDto? fromJson(dynamic value) {
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
// Ensure that the map contains the required keys.
|
||||
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||
// Note 2: this code is stripped in release mode!
|
||||
assert(() {
|
||||
requiredKeys.forEach((key) {
|
||||
assert(json.containsKey(key), 'Required key "JobStatusResponseDto[$key]" is missing from JSON.');
|
||||
assert(json[key] != null, 'Required key "JobStatusResponseDto[$key]" has a null value in JSON.');
|
||||
});
|
||||
return true;
|
||||
}());
|
||||
|
||||
return JobStatusResponseDto(
|
||||
isActive: mapValueOfType<bool>(json, r'isActive')!,
|
||||
queueCount: mapValueOfType<Object>(json, r'queueCount')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<JobStatusResponseDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <JobStatusResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = JobStatusResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, JobStatusResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, JobStatusResponseDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = JobStatusResponseDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of JobStatusResponseDto-objects as value to a dart map
|
||||
static Map<String, List<JobStatusResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<JobStatusResponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = JobStatusResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'isActive',
|
||||
'queueCount',
|
||||
};
|
||||
}
|
||||
|
91
mobile/openapi/lib/model/job_type.dart
Normal file
91
mobile/openapi/lib/model/job_type.dart
Normal file
@ -0,0 +1,91 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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 JobType {
|
||||
/// Instantiate a new enum with the provided [value].
|
||||
const JobType._(this.value);
|
||||
|
||||
/// The underlying value of this enum member.
|
||||
final String value;
|
||||
|
||||
@override
|
||||
String toString() => value;
|
||||
|
||||
String toJson() => value;
|
||||
|
||||
static const THUMBNAIL_GENERATION = JobType._(r'THUMBNAIL_GENERATION');
|
||||
static const METADATA_EXTRACTION = JobType._(r'METADATA_EXTRACTION');
|
||||
static const VIDEO_CONVERSION = JobType._(r'VIDEO_CONVERSION');
|
||||
static const CHECKSUM_GENERATION = JobType._(r'CHECKSUM_GENERATION');
|
||||
|
||||
/// List of all possible values in this [enum][JobType].
|
||||
static const values = <JobType>[
|
||||
THUMBNAIL_GENERATION,
|
||||
METADATA_EXTRACTION,
|
||||
VIDEO_CONVERSION,
|
||||
CHECKSUM_GENERATION,
|
||||
];
|
||||
|
||||
static JobType? fromJson(dynamic value) => JobTypeTypeTransformer().decode(value);
|
||||
|
||||
static List<JobType>? listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <JobType>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = JobType.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
}
|
||||
|
||||
/// Transformation class that can [encode] an instance of [JobType] to String,
|
||||
/// and [decode] dynamic data back to [JobType].
|
||||
class JobTypeTypeTransformer {
|
||||
factory JobTypeTypeTransformer() => _instance ??= const JobTypeTypeTransformer._();
|
||||
|
||||
const JobTypeTypeTransformer._();
|
||||
|
||||
String encode(JobType data) => data.value;
|
||||
|
||||
/// Decodes a [dynamic value][data] to a JobType.
|
||||
///
|
||||
/// 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.
|
||||
JobType? decode(dynamic data, {bool allowNull = true}) {
|
||||
if (data != null) {
|
||||
switch (data.toString()) {
|
||||
case r'THUMBNAIL_GENERATION': return JobType.THUMBNAIL_GENERATION;
|
||||
case r'METADATA_EXTRACTION': return JobType.METADATA_EXTRACTION;
|
||||
case r'VIDEO_CONVERSION': return JobType.VIDEO_CONVERSION;
|
||||
case r'CHECKSUM_GENERATION': return JobType.CHECKSUM_GENERATION;
|
||||
default:
|
||||
if (!allowNull) {
|
||||
throw ArgumentError('Unknown enum value to decode: $data');
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Singleton [JobTypeTypeTransformer] instance.
|
||||
static JobTypeTypeTransformer? _instance;
|
||||
}
|
||||
|
52
mobile/openapi/test/all_job_status_response_dto_test.dart
Normal file
52
mobile/openapi/test/all_job_status_response_dto_test.dart
Normal file
@ -0,0 +1,52 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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
|
||||
|
||||
import 'package:openapi/api.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
// tests for AllJobStatusResponseDto
|
||||
void main() {
|
||||
// final instance = AllJobStatusResponseDto();
|
||||
|
||||
group('test AllJobStatusResponseDto', () {
|
||||
// bool isThumbnailGenerationActive
|
||||
test('to test the property `isThumbnailGenerationActive`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
// Object thumbnailGenerationQueueCount
|
||||
test('to test the property `thumbnailGenerationQueueCount`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
// bool isMetadataExtractionActive
|
||||
test('to test the property `isMetadataExtractionActive`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
// Object metadataExtractionQueueCount
|
||||
test('to test the property `metadataExtractionQueueCount`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
// bool isVideoConversionActive
|
||||
test('to test the property `isVideoConversionActive`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
// Object videoConversionQueueCount
|
||||
test('to test the property `videoConversionQueueCount`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
}
|
27
mobile/openapi/test/create_job_dto_test.dart
Normal file
27
mobile/openapi/test/create_job_dto_test.dart
Normal file
@ -0,0 +1,27 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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
|
||||
|
||||
import 'package:openapi/api.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
// tests for CreateJobDto
|
||||
void main() {
|
||||
// final instance = CreateJobDto();
|
||||
|
||||
group('test CreateJobDto', () {
|
||||
// JobType jobType
|
||||
test('to test the property `jobType`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
}
|
41
mobile/openapi/test/job_api_test.dart
Normal file
41
mobile/openapi/test/job_api_test.dart
Normal file
@ -0,0 +1,41 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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
|
||||
|
||||
import 'package:openapi/api.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
|
||||
/// tests for JobApi
|
||||
void main() {
|
||||
// final instance = JobApi();
|
||||
|
||||
group('tests for JobApi', () {
|
||||
//Future<Object> create(CreateJobDto createJobDto) async
|
||||
test('test create', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
//Future<AllJobStatusResponseDto> getAllJobsStatus() async
|
||||
test('test getAllJobsStatus', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
//Future<JobStatusResponseDto> getJobStatus(JobType jobType) async
|
||||
test('test getJobStatus', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
//Future<JobStatusResponseDto> stopJob(JobType jobType) async
|
||||
test('test stopJob', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
});
|
||||
}
|
27
mobile/openapi/test/job_command_dto_test.dart
Normal file
27
mobile/openapi/test/job_command_dto_test.dart
Normal file
@ -0,0 +1,27 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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
|
||||
|
||||
import 'package:openapi/api.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
// tests for JobCommandDto
|
||||
void main() {
|
||||
// final instance = JobCommandDto();
|
||||
|
||||
group('test JobCommandDto', () {
|
||||
// JobCommand command
|
||||
test('to test the property `command`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
}
|
21
mobile/openapi/test/job_command_test.dart
Normal file
21
mobile/openapi/test/job_command_test.dart
Normal file
@ -0,0 +1,21 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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
|
||||
|
||||
import 'package:openapi/api.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
// tests for JobCommand
|
||||
void main() {
|
||||
|
||||
group('test JobCommand', () {
|
||||
|
||||
});
|
||||
|
||||
}
|
47
mobile/openapi/test/job_counts_test.dart
Normal file
47
mobile/openapi/test/job_counts_test.dart
Normal file
@ -0,0 +1,47 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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
|
||||
|
||||
import 'package:openapi/api.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
// tests for JobCounts
|
||||
void main() {
|
||||
// final instance = JobCounts();
|
||||
|
||||
group('test JobCounts', () {
|
||||
// num active
|
||||
test('to test the property `active`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
// num completed
|
||||
test('to test the property `completed`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
// num failed
|
||||
test('to test the property `failed`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
// num delayed
|
||||
test('to test the property `delayed`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
// num waiting
|
||||
test('to test the property `waiting`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
}
|
21
mobile/openapi/test/job_id_test.dart
Normal file
21
mobile/openapi/test/job_id_test.dart
Normal file
@ -0,0 +1,21 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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
|
||||
|
||||
import 'package:openapi/api.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
// tests for JobId
|
||||
void main() {
|
||||
|
||||
group('test JobId', () {
|
||||
|
||||
});
|
||||
|
||||
}
|
32
mobile/openapi/test/job_status_response_dto_test.dart
Normal file
32
mobile/openapi/test/job_status_response_dto_test.dart
Normal file
@ -0,0 +1,32 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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
|
||||
|
||||
import 'package:openapi/api.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
// tests for JobStatusResponseDto
|
||||
void main() {
|
||||
// final instance = JobStatusResponseDto();
|
||||
|
||||
group('test JobStatusResponseDto', () {
|
||||
// bool isActive
|
||||
test('to test the property `isActive`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
// Object queueCount
|
||||
test('to test the property `queueCount`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
}
|
21
mobile/openapi/test/job_type_test.dart
Normal file
21
mobile/openapi/test/job_type_test.dart
Normal file
@ -0,0 +1,21 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.12
|
||||
|
||||
// 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
|
||||
|
||||
import 'package:openapi/api.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
// tests for JobType
|
||||
void main() {
|
||||
|
||||
group('test JobType', () {
|
||||
|
||||
});
|
||||
|
||||
}
|
Reference in New Issue
Block a user