This commit is contained in:
Daniel Dietzler
2023-12-28 19:06:45 +01:00
parent 902d4d0275
commit fb01bd956f
25 changed files with 1175 additions and 2 deletions

View File

@@ -37,6 +37,7 @@ part 'api/authentication_api.dart';
part 'api/face_api.dart';
part 'api/job_api.dart';
part 'api/library_api.dart';
part 'api/metrics_api.dart';
part 'api/o_auth_api.dart';
part 'api/partner_api.dart';
part 'api/person_api.dart';
@@ -124,6 +125,8 @@ part 'model/map_marker_response_dto.dart';
part 'model/map_theme.dart';
part 'model/memory_lane_response_dto.dart';
part 'model/merge_person_dto.dart';
part 'model/metric_server_info_config.dart';
part 'model/metrics_asset_count_config.dart';
part 'model/model_type.dart';
part 'model/o_auth_authorize_response_dto.dart';
part 'model/o_auth_callback_dto.dart';
@@ -173,6 +176,7 @@ part 'model/system_config_library_scan_dto.dart';
part 'model/system_config_logging_dto.dart';
part 'model/system_config_machine_learning_dto.dart';
part 'model/system_config_map_dto.dart';
part 'model/system_config_metrics_dto.dart';
part 'model/system_config_new_version_check_dto.dart';
part 'model/system_config_o_auth_dto.dart';
part 'model/system_config_password_login_dto.dart';

65
mobile/openapi/lib/api/metrics_api.dart generated Normal file
View File

@@ -0,0 +1,65 @@
//
// 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 MetricsApi {
MetricsApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Performs an HTTP 'PUT /metrics' operation and returns the [Response].
/// Parameters:
///
/// * [SystemConfigMetricsDto] systemConfigMetricsDto (required):
Future<Response> getMetricsWithHttpInfo(SystemConfigMetricsDto systemConfigMetricsDto,) async {
// ignore: prefer_const_declarations
final path = r'/metrics';
// ignore: prefer_final_locals
Object? postBody = systemConfigMetricsDto;
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:
///
/// * [SystemConfigMetricsDto] systemConfigMetricsDto (required):
Future<Object?> getMetrics(SystemConfigMetricsDto systemConfigMetricsDto,) async {
final response = await getMetricsWithHttpInfo(systemConfigMetricsDto,);
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), 'Object',) as Object;
}
return null;
}
}

View File

@@ -335,6 +335,10 @@ class ApiClient {
return MemoryLaneResponseDto.fromJson(value);
case 'MergePersonDto':
return MergePersonDto.fromJson(value);
case 'MetricServerInfoConfig':
return MetricServerInfoConfig.fromJson(value);
case 'MetricsAssetCountConfig':
return MetricsAssetCountConfig.fromJson(value);
case 'ModelType':
return ModelTypeTypeTransformer().decode(value);
case 'OAuthAuthorizeResponseDto':
@@ -433,6 +437,8 @@ class ApiClient {
return SystemConfigMachineLearningDto.fromJson(value);
case 'SystemConfigMapDto':
return SystemConfigMapDto.fromJson(value);
case 'SystemConfigMetricsDto':
return SystemConfigMetricsDto.fromJson(value);
case 'SystemConfigNewVersionCheckDto':
return SystemConfigNewVersionCheckDto.fromJson(value);
case 'SystemConfigOAuthDto':

View File

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

View File

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

View File

@@ -17,6 +17,7 @@ class ServerFeaturesDto {
required this.configFile,
required this.facialRecognition,
required this.map,
required this.metrics,
required this.oauth,
required this.oauthAutoLaunch,
required this.passwordLogin,
@@ -34,6 +35,8 @@ class ServerFeaturesDto {
bool map;
bool metrics;
bool oauth;
bool oauthAutoLaunch;
@@ -54,6 +57,7 @@ class ServerFeaturesDto {
other.configFile == configFile &&
other.facialRecognition == facialRecognition &&
other.map == map &&
other.metrics == metrics &&
other.oauth == oauth &&
other.oauthAutoLaunch == oauthAutoLaunch &&
other.passwordLogin == passwordLogin &&
@@ -69,6 +73,7 @@ class ServerFeaturesDto {
(configFile.hashCode) +
(facialRecognition.hashCode) +
(map.hashCode) +
(metrics.hashCode) +
(oauth.hashCode) +
(oauthAutoLaunch.hashCode) +
(passwordLogin.hashCode) +
@@ -78,7 +83,7 @@ class ServerFeaturesDto {
(trash.hashCode);
@override
String toString() => 'ServerFeaturesDto[clipEncode=$clipEncode, configFile=$configFile, facialRecognition=$facialRecognition, map=$map, oauth=$oauth, oauthAutoLaunch=$oauthAutoLaunch, passwordLogin=$passwordLogin, reverseGeocoding=$reverseGeocoding, search=$search, sidecar=$sidecar, trash=$trash]';
String toString() => 'ServerFeaturesDto[clipEncode=$clipEncode, configFile=$configFile, facialRecognition=$facialRecognition, map=$map, metrics=$metrics, oauth=$oauth, oauthAutoLaunch=$oauthAutoLaunch, passwordLogin=$passwordLogin, reverseGeocoding=$reverseGeocoding, search=$search, sidecar=$sidecar, trash=$trash]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@@ -86,6 +91,7 @@ class ServerFeaturesDto {
json[r'configFile'] = this.configFile;
json[r'facialRecognition'] = this.facialRecognition;
json[r'map'] = this.map;
json[r'metrics'] = this.metrics;
json[r'oauth'] = this.oauth;
json[r'oauthAutoLaunch'] = this.oauthAutoLaunch;
json[r'passwordLogin'] = this.passwordLogin;
@@ -108,6 +114,7 @@ class ServerFeaturesDto {
configFile: mapValueOfType<bool>(json, r'configFile')!,
facialRecognition: mapValueOfType<bool>(json, r'facialRecognition')!,
map: mapValueOfType<bool>(json, r'map')!,
metrics: mapValueOfType<bool>(json, r'metrics')!,
oauth: mapValueOfType<bool>(json, r'oauth')!,
oauthAutoLaunch: mapValueOfType<bool>(json, r'oauthAutoLaunch')!,
passwordLogin: mapValueOfType<bool>(json, r'passwordLogin')!,
@@ -166,6 +173,7 @@ class ServerFeaturesDto {
'configFile',
'facialRecognition',
'map',
'metrics',
'oauth',
'oauthAutoLaunch',
'passwordLogin',

View File

@@ -19,6 +19,7 @@ class SystemConfigDto {
required this.logging,
required this.machineLearning,
required this.map,
required this.metrics,
required this.newVersionCheck,
required this.oauth,
required this.passwordLogin,
@@ -41,6 +42,8 @@ class SystemConfigDto {
SystemConfigMapDto map;
SystemConfigMetricsDto metrics;
SystemConfigNewVersionCheckDto newVersionCheck;
SystemConfigOAuthDto oauth;
@@ -65,6 +68,7 @@ class SystemConfigDto {
other.logging == logging &&
other.machineLearning == machineLearning &&
other.map == map &&
other.metrics == metrics &&
other.newVersionCheck == newVersionCheck &&
other.oauth == oauth &&
other.passwordLogin == passwordLogin &&
@@ -83,6 +87,7 @@ class SystemConfigDto {
(logging.hashCode) +
(machineLearning.hashCode) +
(map.hashCode) +
(metrics.hashCode) +
(newVersionCheck.hashCode) +
(oauth.hashCode) +
(passwordLogin.hashCode) +
@@ -93,7 +98,7 @@ class SystemConfigDto {
(trash.hashCode);
@override
String toString() => 'SystemConfigDto[ffmpeg=$ffmpeg, job=$job, library_=$library_, logging=$logging, machineLearning=$machineLearning, map=$map, newVersionCheck=$newVersionCheck, oauth=$oauth, passwordLogin=$passwordLogin, reverseGeocoding=$reverseGeocoding, storageTemplate=$storageTemplate, theme=$theme, thumbnail=$thumbnail, trash=$trash]';
String toString() => 'SystemConfigDto[ffmpeg=$ffmpeg, job=$job, library_=$library_, logging=$logging, machineLearning=$machineLearning, map=$map, metrics=$metrics, newVersionCheck=$newVersionCheck, oauth=$oauth, passwordLogin=$passwordLogin, reverseGeocoding=$reverseGeocoding, storageTemplate=$storageTemplate, theme=$theme, thumbnail=$thumbnail, trash=$trash]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@@ -103,6 +108,7 @@ class SystemConfigDto {
json[r'logging'] = this.logging;
json[r'machineLearning'] = this.machineLearning;
json[r'map'] = this.map;
json[r'metrics'] = this.metrics;
json[r'newVersionCheck'] = this.newVersionCheck;
json[r'oauth'] = this.oauth;
json[r'passwordLogin'] = this.passwordLogin;
@@ -128,6 +134,7 @@ class SystemConfigDto {
logging: SystemConfigLoggingDto.fromJson(json[r'logging'])!,
machineLearning: SystemConfigMachineLearningDto.fromJson(json[r'machineLearning'])!,
map: SystemConfigMapDto.fromJson(json[r'map'])!,
metrics: SystemConfigMetricsDto.fromJson(json[r'metrics'])!,
newVersionCheck: SystemConfigNewVersionCheckDto.fromJson(json[r'newVersionCheck'])!,
oauth: SystemConfigOAuthDto.fromJson(json[r'oauth'])!,
passwordLogin: SystemConfigPasswordLoginDto.fromJson(json[r'passwordLogin'])!,
@@ -189,6 +196,7 @@ class SystemConfigDto {
'logging',
'machineLearning',
'map',
'metrics',
'newVersionCheck',
'oauth',
'passwordLogin',

View File

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