2022-11-14 21:39:32 -07:00
|
|
|
//
|
|
|
|
// 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;
|
|
|
|
|
2022-12-09 13:51:42 -07:00
|
|
|
class SystemConfigDto {
|
|
|
|
/// Returns a new [SystemConfigDto] instance.
|
|
|
|
SystemConfigDto({
|
|
|
|
required this.ffmpeg,
|
|
|
|
required this.oauth,
|
2023-01-09 14:32:58 -07:00
|
|
|
required this.passwordLogin,
|
2022-12-16 13:26:12 -07:00
|
|
|
required this.storageTemplate,
|
2022-11-14 21:39:32 -07:00
|
|
|
});
|
|
|
|
|
2022-12-09 13:51:42 -07:00
|
|
|
SystemConfigFFmpegDto ffmpeg;
|
|
|
|
|
|
|
|
SystemConfigOAuthDto oauth;
|
2022-11-14 21:39:32 -07:00
|
|
|
|
2023-01-09 14:32:58 -07:00
|
|
|
SystemConfigPasswordLoginDto passwordLogin;
|
|
|
|
|
2022-12-16 13:26:12 -07:00
|
|
|
SystemConfigStorageTemplateDto storageTemplate;
|
|
|
|
|
2022-11-14 21:39:32 -07:00
|
|
|
@override
|
2022-12-09 13:51:42 -07:00
|
|
|
bool operator ==(Object other) => identical(this, other) || other is SystemConfigDto &&
|
|
|
|
other.ffmpeg == ffmpeg &&
|
2022-12-16 13:26:12 -07:00
|
|
|
other.oauth == oauth &&
|
2023-01-09 14:32:58 -07:00
|
|
|
other.passwordLogin == passwordLogin &&
|
2022-12-16 13:26:12 -07:00
|
|
|
other.storageTemplate == storageTemplate;
|
2022-11-14 21:39:32 -07:00
|
|
|
|
|
|
|
@override
|
|
|
|
int get hashCode =>
|
|
|
|
// ignore: unnecessary_parenthesis
|
2022-12-09 13:51:42 -07:00
|
|
|
(ffmpeg.hashCode) +
|
2022-12-16 13:26:12 -07:00
|
|
|
(oauth.hashCode) +
|
2023-01-09 14:32:58 -07:00
|
|
|
(passwordLogin.hashCode) +
|
2022-12-16 13:26:12 -07:00
|
|
|
(storageTemplate.hashCode);
|
2022-11-14 21:39:32 -07:00
|
|
|
|
|
|
|
@override
|
2023-01-09 14:32:58 -07:00
|
|
|
String toString() => 'SystemConfigDto[ffmpeg=$ffmpeg, oauth=$oauth, passwordLogin=$passwordLogin, storageTemplate=$storageTemplate]';
|
2022-11-14 21:39:32 -07:00
|
|
|
|
|
|
|
Map<String, dynamic> toJson() {
|
2023-01-09 21:08:45 -07:00
|
|
|
final json = <String, dynamic>{};
|
|
|
|
json[r'ffmpeg'] = this.ffmpeg;
|
|
|
|
json[r'oauth'] = this.oauth;
|
|
|
|
json[r'passwordLogin'] = this.passwordLogin;
|
|
|
|
json[r'storageTemplate'] = this.storageTemplate;
|
|
|
|
return json;
|
2022-11-14 21:39:32 -07:00
|
|
|
}
|
|
|
|
|
2022-12-09 13:51:42 -07:00
|
|
|
/// Returns a new [SystemConfigDto] instance and imports its values from
|
2022-11-14 21:39:32 -07:00
|
|
|
/// [value] if it's a [Map], null otherwise.
|
|
|
|
// ignore: prefer_constructors_over_static_methods
|
2022-12-09 13:51:42 -07:00
|
|
|
static SystemConfigDto? fromJson(dynamic value) {
|
2022-11-14 21:39:32 -07:00
|
|
|
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) {
|
2022-12-09 13:51:42 -07:00
|
|
|
assert(json.containsKey(key), 'Required key "SystemConfigDto[$key]" is missing from JSON.');
|
|
|
|
assert(json[key] != null, 'Required key "SystemConfigDto[$key]" has a null value in JSON.');
|
2022-11-14 21:39:32 -07:00
|
|
|
});
|
|
|
|
return true;
|
|
|
|
}());
|
|
|
|
|
2022-12-09 13:51:42 -07:00
|
|
|
return SystemConfigDto(
|
|
|
|
ffmpeg: SystemConfigFFmpegDto.fromJson(json[r'ffmpeg'])!,
|
|
|
|
oauth: SystemConfigOAuthDto.fromJson(json[r'oauth'])!,
|
2023-01-09 14:32:58 -07:00
|
|
|
passwordLogin: SystemConfigPasswordLoginDto.fromJson(json[r'passwordLogin'])!,
|
2022-12-16 13:26:12 -07:00
|
|
|
storageTemplate: SystemConfigStorageTemplateDto.fromJson(json[r'storageTemplate'])!,
|
2022-11-14 21:39:32 -07:00
|
|
|
);
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2022-12-09 13:51:42 -07:00
|
|
|
static List<SystemConfigDto>? listFromJson(dynamic json, {bool growable = false,}) {
|
|
|
|
final result = <SystemConfigDto>[];
|
2022-11-14 21:39:32 -07:00
|
|
|
if (json is List && json.isNotEmpty) {
|
|
|
|
for (final row in json) {
|
2022-12-09 13:51:42 -07:00
|
|
|
final value = SystemConfigDto.fromJson(row);
|
2022-11-14 21:39:32 -07:00
|
|
|
if (value != null) {
|
|
|
|
result.add(value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return result.toList(growable: growable);
|
|
|
|
}
|
|
|
|
|
2022-12-09 13:51:42 -07:00
|
|
|
static Map<String, SystemConfigDto> mapFromJson(dynamic json) {
|
|
|
|
final map = <String, SystemConfigDto>{};
|
2022-11-14 21:39:32 -07:00
|
|
|
if (json is Map && json.isNotEmpty) {
|
|
|
|
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
|
|
|
for (final entry in json.entries) {
|
2022-12-09 13:51:42 -07:00
|
|
|
final value = SystemConfigDto.fromJson(entry.value);
|
2022-11-14 21:39:32 -07:00
|
|
|
if (value != null) {
|
|
|
|
map[entry.key] = value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return map;
|
|
|
|
}
|
|
|
|
|
2022-12-09 13:51:42 -07:00
|
|
|
// maps a json object with a list of SystemConfigDto-objects as value to a dart map
|
|
|
|
static Map<String, List<SystemConfigDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
|
|
|
final map = <String, List<SystemConfigDto>>{};
|
2022-11-14 21:39:32 -07:00
|
|
|
if (json is Map && json.isNotEmpty) {
|
|
|
|
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
|
|
|
for (final entry in json.entries) {
|
2022-12-09 13:51:42 -07:00
|
|
|
final value = SystemConfigDto.listFromJson(entry.value, growable: growable,);
|
2022-11-14 21:39:32 -07:00
|
|
|
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>{
|
2022-12-09 13:51:42 -07:00
|
|
|
'ffmpeg',
|
|
|
|
'oauth',
|
2023-01-09 14:32:58 -07:00
|
|
|
'passwordLogin',
|
2022-12-16 13:26:12 -07:00
|
|
|
'storageTemplate',
|
2022-11-14 21:39:32 -07:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|