feat(web,server)!: configure machine learning via the UI (#3768)

This commit is contained in:
Jason Rasmussen
2023-08-25 00:15:03 -04:00
committed by GitHub
parent 2cccef174a
commit 8211afb726
52 changed files with 831 additions and 649 deletions

View File

@@ -84,7 +84,6 @@ doc/SearchAlbumResponseDto.md
doc/SearchApi.md
doc/SearchAssetDto.md
doc/SearchAssetResponseDto.md
doc/SearchConfigResponseDto.md
doc/SearchExploreItem.md
doc/SearchExploreResponseDto.md
doc/SearchFacetCountResponseDto.md
@@ -108,6 +107,7 @@ doc/SystemConfigApi.md
doc/SystemConfigDto.md
doc/SystemConfigFFmpegDto.md
doc/SystemConfigJobDto.md
doc/SystemConfigMachineLearningDto.md
doc/SystemConfigOAuthDto.md
doc/SystemConfigPasswordLoginDto.md
doc/SystemConfigStorageTemplateDto.md
@@ -228,7 +228,6 @@ lib/model/queue_status_dto.dart
lib/model/search_album_response_dto.dart
lib/model/search_asset_dto.dart
lib/model/search_asset_response_dto.dart
lib/model/search_config_response_dto.dart
lib/model/search_explore_item.dart
lib/model/search_explore_response_dto.dart
lib/model/search_facet_count_response_dto.dart
@@ -249,6 +248,7 @@ lib/model/smart_info_response_dto.dart
lib/model/system_config_dto.dart
lib/model/system_config_f_fmpeg_dto.dart
lib/model/system_config_job_dto.dart
lib/model/system_config_machine_learning_dto.dart
lib/model/system_config_o_auth_dto.dart
lib/model/system_config_password_login_dto.dart
lib/model/system_config_storage_template_dto.dart
@@ -353,7 +353,6 @@ test/search_album_response_dto_test.dart
test/search_api_test.dart
test/search_asset_dto_test.dart
test/search_asset_response_dto_test.dart
test/search_config_response_dto_test.dart
test/search_explore_item_test.dart
test/search_explore_response_dto_test.dart
test/search_facet_count_response_dto_test.dart
@@ -377,6 +376,7 @@ test/system_config_api_test.dart
test/system_config_dto_test.dart
test/system_config_f_fmpeg_dto_test.dart
test/system_config_job_dto_test.dart
test/system_config_machine_learning_dto_test.dart
test/system_config_o_auth_dto_test.dart
test/system_config_password_login_dto_test.dart
test/system_config_storage_template_dto_test.dart

View File

@@ -140,7 +140,6 @@ Class | Method | HTTP request | Description
*PersonApi* | [**updatePeople**](doc//PersonApi.md#updatepeople) | **PUT** /person |
*PersonApi* | [**updatePerson**](doc//PersonApi.md#updateperson) | **PUT** /person/{id} |
*SearchApi* | [**getExploreData**](doc//SearchApi.md#getexploredata) | **GET** /search/explore |
*SearchApi* | [**getSearchConfig**](doc//SearchApi.md#getsearchconfig) | **GET** /search/config |
*SearchApi* | [**search**](doc//SearchApi.md#search) | **GET** /search |
*ServerInfoApi* | [**getServerFeatures**](doc//ServerInfoApi.md#getserverfeatures) | **GET** /server-info/features |
*ServerInfoApi* | [**getServerInfo**](doc//ServerInfoApi.md#getserverinfo) | **GET** /server-info |
@@ -253,7 +252,6 @@ Class | Method | HTTP request | Description
- [SearchAlbumResponseDto](doc//SearchAlbumResponseDto.md)
- [SearchAssetDto](doc//SearchAssetDto.md)
- [SearchAssetResponseDto](doc//SearchAssetResponseDto.md)
- [SearchConfigResponseDto](doc//SearchConfigResponseDto.md)
- [SearchExploreItem](doc//SearchExploreItem.md)
- [SearchExploreResponseDto](doc//SearchExploreResponseDto.md)
- [SearchFacetCountResponseDto](doc//SearchFacetCountResponseDto.md)
@@ -274,6 +272,7 @@ Class | Method | HTTP request | Description
- [SystemConfigDto](doc//SystemConfigDto.md)
- [SystemConfigFFmpegDto](doc//SystemConfigFFmpegDto.md)
- [SystemConfigJobDto](doc//SystemConfigJobDto.md)
- [SystemConfigMachineLearningDto](doc//SystemConfigMachineLearningDto.md)
- [SystemConfigOAuthDto](doc//SystemConfigOAuthDto.md)
- [SystemConfigPasswordLoginDto](doc//SystemConfigPasswordLoginDto.md)
- [SystemConfigStorageTemplateDto](doc//SystemConfigStorageTemplateDto.md)

View File

@@ -10,7 +10,6 @@ All URIs are relative to */api*
Method | HTTP request | Description
------------- | ------------- | -------------
[**getExploreData**](SearchApi.md#getexploredata) | **GET** /search/explore |
[**getSearchConfig**](SearchApi.md#getsearchconfig) | **GET** /search/config |
[**search**](SearchApi.md#search) | **GET** /search |
@@ -65,57 +64,6 @@ This endpoint does not need any parameter.
[[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)
# **getSearchConfig**
> SearchConfigResponseDto getSearchConfig()
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure API key authorization: cookie
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: api_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
// 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 = SearchApi();
try {
final result = api_instance.getSearchConfig();
print(result);
} catch (e) {
print('Exception when calling SearchApi->getSearchConfig: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**SearchConfigResponseDto**](SearchConfigResponseDto.md)
### Authorization
[cookie](../README.md#cookie), [api_key](../README.md#api_key), [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)
# **search**
> SearchResponseDto search(q, query, clip, type, isFavorite, isArchived, exifInfoPeriodCity, exifInfoPeriodState, exifInfoPeriodCountry, exifInfoPeriodMake, exifInfoPeriodModel, exifInfoPeriodProjectionType, smartInfoPeriodObjects, smartInfoPeriodTags, recent, motion)

View File

@@ -8,11 +8,14 @@ import 'package:openapi/api.dart';
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**machineLearning** | **bool** | |
**clipEncode** | **bool** | |
**facialRecognition** | **bool** | |
**oauth** | **bool** | |
**oauthAutoLaunch** | **bool** | |
**passwordLogin** | **bool** | |
**search** | **bool** | |
**sidecar** | **bool** | |
**tagImage** | **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)

View File

@@ -10,6 +10,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ffmpeg** | [**SystemConfigFFmpegDto**](SystemConfigFFmpegDto.md) | |
**job** | [**SystemConfigJobDto**](SystemConfigJobDto.md) | |
**machineLearning** | [**SystemConfigMachineLearningDto**](SystemConfigMachineLearningDto.md) | |
**oauth** | [**SystemConfigOAuthDto**](SystemConfigOAuthDto.md) | |
**passwordLogin** | [**SystemConfigPasswordLoginDto**](SystemConfigPasswordLoginDto.md) | |
**storageTemplate** | [**SystemConfigStorageTemplateDto**](SystemConfigStorageTemplateDto.md) | |

View File

@@ -1,4 +1,4 @@
# openapi.model.SearchConfigResponseDto
# openapi.model.SystemConfigMachineLearningDto
## Load the model package
```dart
@@ -8,7 +8,11 @@ import 'package:openapi/api.dart';
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**clipEncodeEnabled** | **bool** | |
**enabled** | **bool** | |
**facialRecognitionEnabled** | **bool** | |
**tagImageEnabled** | **bool** | |
**url** | **String** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -115,7 +115,6 @@ part 'model/queue_status_dto.dart';
part 'model/search_album_response_dto.dart';
part 'model/search_asset_dto.dart';
part 'model/search_asset_response_dto.dart';
part 'model/search_config_response_dto.dart';
part 'model/search_explore_item.dart';
part 'model/search_explore_response_dto.dart';
part 'model/search_facet_count_response_dto.dart';
@@ -136,6 +135,7 @@ part 'model/smart_info_response_dto.dart';
part 'model/system_config_dto.dart';
part 'model/system_config_f_fmpeg_dto.dart';
part 'model/system_config_job_dto.dart';
part 'model/system_config_machine_learning_dto.dart';
part 'model/system_config_o_auth_dto.dart';
part 'model/system_config_password_login_dto.dart';
part 'model/system_config_storage_template_dto.dart';

View File

@@ -60,47 +60,6 @@ class SearchApi {
return null;
}
/// Performs an HTTP 'GET /search/config' operation and returns the [Response].
Future<Response> getSearchConfigWithHttpInfo() async {
// ignore: prefer_const_declarations
final path = r'/search/config';
// 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<SearchConfigResponseDto?> getSearchConfig() async {
final response = await getSearchConfigWithHttpInfo();
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), 'SearchConfigResponseDto',) as SearchConfigResponseDto;
}
return null;
}
/// Performs an HTTP 'GET /search' operation and returns the [Response].
/// Parameters:
///

View File

@@ -323,8 +323,6 @@ class ApiClient {
return SearchAssetDto.fromJson(value);
case 'SearchAssetResponseDto':
return SearchAssetResponseDto.fromJson(value);
case 'SearchConfigResponseDto':
return SearchConfigResponseDto.fromJson(value);
case 'SearchExploreItem':
return SearchExploreItem.fromJson(value);
case 'SearchExploreResponseDto':
@@ -365,6 +363,8 @@ class ApiClient {
return SystemConfigFFmpegDto.fromJson(value);
case 'SystemConfigJobDto':
return SystemConfigJobDto.fromJson(value);
case 'SystemConfigMachineLearningDto':
return SystemConfigMachineLearningDto.fromJson(value);
case 'SystemConfigOAuthDto':
return SystemConfigOAuthDto.fromJson(value);
case 'SystemConfigPasswordLoginDto':

View File

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

View File

@@ -13,14 +13,19 @@ part of openapi.api;
class ServerFeaturesDto {
/// Returns a new [ServerFeaturesDto] instance.
ServerFeaturesDto({
required this.machineLearning,
required this.clipEncode,
required this.facialRecognition,
required this.oauth,
required this.oauthAutoLaunch,
required this.passwordLogin,
required this.search,
required this.sidecar,
required this.tagImage,
});
bool machineLearning;
bool clipEncode;
bool facialRecognition;
bool oauth;
@@ -30,33 +35,46 @@ class ServerFeaturesDto {
bool search;
bool sidecar;
bool tagImage;
@override
bool operator ==(Object other) => identical(this, other) || other is ServerFeaturesDto &&
other.machineLearning == machineLearning &&
other.clipEncode == clipEncode &&
other.facialRecognition == facialRecognition &&
other.oauth == oauth &&
other.oauthAutoLaunch == oauthAutoLaunch &&
other.passwordLogin == passwordLogin &&
other.search == search;
other.search == search &&
other.sidecar == sidecar &&
other.tagImage == tagImage;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(machineLearning.hashCode) +
(clipEncode.hashCode) +
(facialRecognition.hashCode) +
(oauth.hashCode) +
(oauthAutoLaunch.hashCode) +
(passwordLogin.hashCode) +
(search.hashCode);
(search.hashCode) +
(sidecar.hashCode) +
(tagImage.hashCode);
@override
String toString() => 'ServerFeaturesDto[machineLearning=$machineLearning, oauth=$oauth, oauthAutoLaunch=$oauthAutoLaunch, passwordLogin=$passwordLogin, search=$search]';
String toString() => 'ServerFeaturesDto[clipEncode=$clipEncode, facialRecognition=$facialRecognition, oauth=$oauth, oauthAutoLaunch=$oauthAutoLaunch, passwordLogin=$passwordLogin, search=$search, sidecar=$sidecar, tagImage=$tagImage]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'machineLearning'] = this.machineLearning;
json[r'clipEncode'] = this.clipEncode;
json[r'facialRecognition'] = this.facialRecognition;
json[r'oauth'] = this.oauth;
json[r'oauthAutoLaunch'] = this.oauthAutoLaunch;
json[r'passwordLogin'] = this.passwordLogin;
json[r'search'] = this.search;
json[r'sidecar'] = this.sidecar;
json[r'tagImage'] = this.tagImage;
return json;
}
@@ -68,11 +86,14 @@ class ServerFeaturesDto {
final json = value.cast<String, dynamic>();
return ServerFeaturesDto(
machineLearning: mapValueOfType<bool>(json, r'machineLearning')!,
clipEncode: mapValueOfType<bool>(json, r'clipEncode')!,
facialRecognition: mapValueOfType<bool>(json, r'facialRecognition')!,
oauth: mapValueOfType<bool>(json, r'oauth')!,
oauthAutoLaunch: mapValueOfType<bool>(json, r'oauthAutoLaunch')!,
passwordLogin: mapValueOfType<bool>(json, r'passwordLogin')!,
search: mapValueOfType<bool>(json, r'search')!,
sidecar: mapValueOfType<bool>(json, r'sidecar')!,
tagImage: mapValueOfType<bool>(json, r'tagImage')!,
);
}
return null;
@@ -120,11 +141,14 @@ class ServerFeaturesDto {
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'machineLearning',
'clipEncode',
'facialRecognition',
'oauth',
'oauthAutoLaunch',
'passwordLogin',
'search',
'sidecar',
'tagImage',
};
}

View File

@@ -15,6 +15,7 @@ class SystemConfigDto {
SystemConfigDto({
required this.ffmpeg,
required this.job,
required this.machineLearning,
required this.oauth,
required this.passwordLogin,
required this.storageTemplate,
@@ -25,6 +26,8 @@ class SystemConfigDto {
SystemConfigJobDto job;
SystemConfigMachineLearningDto machineLearning;
SystemConfigOAuthDto oauth;
SystemConfigPasswordLoginDto passwordLogin;
@@ -37,6 +40,7 @@ class SystemConfigDto {
bool operator ==(Object other) => identical(this, other) || other is SystemConfigDto &&
other.ffmpeg == ffmpeg &&
other.job == job &&
other.machineLearning == machineLearning &&
other.oauth == oauth &&
other.passwordLogin == passwordLogin &&
other.storageTemplate == storageTemplate &&
@@ -47,18 +51,20 @@ class SystemConfigDto {
// ignore: unnecessary_parenthesis
(ffmpeg.hashCode) +
(job.hashCode) +
(machineLearning.hashCode) +
(oauth.hashCode) +
(passwordLogin.hashCode) +
(storageTemplate.hashCode) +
(thumbnail.hashCode);
@override
String toString() => 'SystemConfigDto[ffmpeg=$ffmpeg, job=$job, oauth=$oauth, passwordLogin=$passwordLogin, storageTemplate=$storageTemplate, thumbnail=$thumbnail]';
String toString() => 'SystemConfigDto[ffmpeg=$ffmpeg, job=$job, machineLearning=$machineLearning, oauth=$oauth, passwordLogin=$passwordLogin, storageTemplate=$storageTemplate, thumbnail=$thumbnail]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'ffmpeg'] = this.ffmpeg;
json[r'job'] = this.job;
json[r'machineLearning'] = this.machineLearning;
json[r'oauth'] = this.oauth;
json[r'passwordLogin'] = this.passwordLogin;
json[r'storageTemplate'] = this.storageTemplate;
@@ -76,6 +82,7 @@ class SystemConfigDto {
return SystemConfigDto(
ffmpeg: SystemConfigFFmpegDto.fromJson(json[r'ffmpeg'])!,
job: SystemConfigJobDto.fromJson(json[r'job'])!,
machineLearning: SystemConfigMachineLearningDto.fromJson(json[r'machineLearning'])!,
oauth: SystemConfigOAuthDto.fromJson(json[r'oauth'])!,
passwordLogin: SystemConfigPasswordLoginDto.fromJson(json[r'passwordLogin'])!,
storageTemplate: SystemConfigStorageTemplateDto.fromJson(json[r'storageTemplate'])!,
@@ -129,6 +136,7 @@ class SystemConfigDto {
static const requiredKeys = <String>{
'ffmpeg',
'job',
'machineLearning',
'oauth',
'passwordLogin',
'storageTemplate',

View File

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

View File

@@ -22,11 +22,6 @@ void main() {
// TODO
});
//Future<SearchConfigResponseDto> getSearchConfig() async
test('test getSearchConfig', () async {
// TODO
});
//Future<SearchResponseDto> search({ String q, String query, bool clip, String type, bool isFavorite, bool isArchived, String exifInfoPeriodCity, String exifInfoPeriodState, String exifInfoPeriodCountry, String exifInfoPeriodMake, String exifInfoPeriodModel, String exifInfoPeriodProjectionType, List<String> smartInfoPeriodObjects, List<String> smartInfoPeriodTags, bool recent, bool motion }) async
test('test search', () async {
// TODO

View File

@@ -1,27 +0,0 @@
//
// 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 SearchConfigResponseDto
void main() {
// final instance = SearchConfigResponseDto();
group('test SearchConfigResponseDto', () {
// bool enabled
test('to test the property `enabled`', () async {
// TODO
});
});
}

View File

@@ -16,8 +16,13 @@ void main() {
// final instance = ServerFeaturesDto();
group('test ServerFeaturesDto', () {
// bool machineLearning
test('to test the property `machineLearning`', () async {
// bool clipEncode
test('to test the property `clipEncode`', () async {
// TODO
});
// bool facialRecognition
test('to test the property `facialRecognition`', () async {
// TODO
});
@@ -41,6 +46,16 @@ void main() {
// TODO
});
// bool sidecar
test('to test the property `sidecar`', () async {
// TODO
});
// bool tagImage
test('to test the property `tagImage`', () async {
// TODO
});
});

View File

@@ -26,6 +26,11 @@ void main() {
// TODO
});
// SystemConfigMachineLearningDto machineLearning
test('to test the property `machineLearning`', () async {
// TODO
});
// SystemConfigOAuthDto oauth
test('to test the property `oauth`', () async {
// TODO

View 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 SystemConfigMachineLearningDto
void main() {
// final instance = SystemConfigMachineLearningDto();
group('test SystemConfigMachineLearningDto', () {
// bool clipEncodeEnabled
test('to test the property `clipEncodeEnabled`', () async {
// TODO
});
// bool enabled
test('to test the property `enabled`', () async {
// TODO
});
// bool facialRecognitionEnabled
test('to test the property `facialRecognitionEnabled`', () async {
// TODO
});
// bool tagImageEnabled
test('to test the property `tagImageEnabled`', () async {
// TODO
});
// String url
test('to test the property `url`', () async {
// TODO
});
});
}