manager-app/manager_api_new/lib/model/app_configuration_link_configuration.dart
2025-07-17 12:11:59 +02:00

314 lines
11 KiB
Dart

//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class AppConfigurationLinkConfiguration {
/// Returns a new [AppConfigurationLinkConfiguration] instance.
AppConfigurationLinkConfiguration({
required this.id,
required this.instanceId,
required this.label,
this.title = const [],
this.imageId,
this.imageSource,
this.primaryColor,
this.secondaryColor,
this.languages = const [],
this.dateCreation,
this.isOffline,
this.loaderImageId,
this.loaderImageUrl,
this.isQRCode,
this.isSearchText,
this.isSearchNumber,
});
String id;
String instanceId;
String label;
List<TranslationDTO> title;
String? imageId;
String? imageSource;
String? primaryColor;
String? secondaryColor;
List<String>? languages;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
DateTime? dateCreation;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? isOffline;
String? loaderImageId;
String? loaderImageUrl;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? isQRCode;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? isSearchText;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? isSearchNumber;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is AppConfigurationLinkConfiguration &&
other.id == id &&
other.instanceId == instanceId &&
other.label == label &&
_deepEquality.equals(other.title, title) &&
other.imageId == imageId &&
other.imageSource == imageSource &&
other.primaryColor == primaryColor &&
other.secondaryColor == secondaryColor &&
_deepEquality.equals(other.languages, languages) &&
other.dateCreation == dateCreation &&
other.isOffline == isOffline &&
other.loaderImageId == loaderImageId &&
other.loaderImageUrl == loaderImageUrl &&
other.isQRCode == isQRCode &&
other.isSearchText == isSearchText &&
other.isSearchNumber == isSearchNumber;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(id.hashCode) +
(instanceId.hashCode) +
(label.hashCode) +
(title.hashCode) +
(imageId == null ? 0 : imageId!.hashCode) +
(imageSource == null ? 0 : imageSource!.hashCode) +
(primaryColor == null ? 0 : primaryColor!.hashCode) +
(secondaryColor == null ? 0 : secondaryColor!.hashCode) +
(languages == null ? 0 : languages!.hashCode) +
(dateCreation == null ? 0 : dateCreation!.hashCode) +
(isOffline == null ? 0 : isOffline!.hashCode) +
(loaderImageId == null ? 0 : loaderImageId!.hashCode) +
(loaderImageUrl == null ? 0 : loaderImageUrl!.hashCode) +
(isQRCode == null ? 0 : isQRCode!.hashCode) +
(isSearchText == null ? 0 : isSearchText!.hashCode) +
(isSearchNumber == null ? 0 : isSearchNumber!.hashCode);
@override
String toString() =>
'AppConfigurationLinkConfiguration[id=$id, instanceId=$instanceId, label=$label, title=$title, imageId=$imageId, imageSource=$imageSource, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, isOffline=$isOffline, loaderImageId=$loaderImageId, loaderImageUrl=$loaderImageUrl, isQRCode=$isQRCode, isSearchText=$isSearchText, isSearchNumber=$isSearchNumber]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'id'] = this.id;
json[r'instanceId'] = this.instanceId;
json[r'label'] = this.label;
json[r'title'] = this.title;
if (this.imageId != null) {
json[r'imageId'] = this.imageId;
} else {
json[r'imageId'] = null;
}
if (this.imageSource != null) {
json[r'imageSource'] = this.imageSource;
} else {
json[r'imageSource'] = null;
}
if (this.primaryColor != null) {
json[r'primaryColor'] = this.primaryColor;
} else {
json[r'primaryColor'] = null;
}
if (this.secondaryColor != null) {
json[r'secondaryColor'] = this.secondaryColor;
} else {
json[r'secondaryColor'] = null;
}
if (this.languages != null) {
json[r'languages'] = this.languages;
} else {
json[r'languages'] = null;
}
if (this.dateCreation != null) {
json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String();
} else {
json[r'dateCreation'] = null;
}
if (this.isOffline != null) {
json[r'isOffline'] = this.isOffline;
} else {
json[r'isOffline'] = null;
}
if (this.loaderImageId != null) {
json[r'loaderImageId'] = this.loaderImageId;
} else {
json[r'loaderImageId'] = null;
}
if (this.loaderImageUrl != null) {
json[r'loaderImageUrl'] = this.loaderImageUrl;
} else {
json[r'loaderImageUrl'] = null;
}
if (this.isQRCode != null) {
json[r'isQRCode'] = this.isQRCode;
} else {
json[r'isQRCode'] = null;
}
if (this.isSearchText != null) {
json[r'isSearchText'] = this.isSearchText;
} else {
json[r'isSearchText'] = null;
}
if (this.isSearchNumber != null) {
json[r'isSearchNumber'] = this.isSearchNumber;
} else {
json[r'isSearchNumber'] = null;
}
return json;
}
/// Returns a new [AppConfigurationLinkConfiguration] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static AppConfigurationLinkConfiguration? 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 "AppConfigurationLinkConfiguration[$key]" is missing from JSON.');
assert(json[key] != null,
'Required key "AppConfigurationLinkConfiguration[$key]" has a null value in JSON.');
});
return true;
}());
return AppConfigurationLinkConfiguration(
id: mapValueOfType<String>(json, r'id')!,
instanceId: mapValueOfType<String>(json, r'instanceId')!,
label: mapValueOfType<String>(json, r'label')!,
title: TranslationDTO.listFromJson(json[r'title']),
imageId: mapValueOfType<String>(json, r'imageId'),
imageSource: mapValueOfType<String>(json, r'imageSource'),
primaryColor: mapValueOfType<String>(json, r'primaryColor'),
secondaryColor: mapValueOfType<String>(json, r'secondaryColor'),
languages: json[r'languages'] is Iterable
? (json[r'languages'] as Iterable)
.cast<String>()
.toList(growable: false)
: const [],
dateCreation: mapDateTime(json, r'dateCreation', r''),
isOffline: mapValueOfType<bool>(json, r'isOffline'),
loaderImageId: mapValueOfType<String>(json, r'loaderImageId'),
loaderImageUrl: mapValueOfType<String>(json, r'loaderImageUrl'),
isQRCode: mapValueOfType<bool>(json, r'isQRCode'),
isSearchText: mapValueOfType<bool>(json, r'isSearchText'),
isSearchNumber: mapValueOfType<bool>(json, r'isSearchNumber'),
);
}
return null;
}
static List<AppConfigurationLinkConfiguration> listFromJson(
dynamic json, {
bool growable = false,
}) {
final result = <AppConfigurationLinkConfiguration>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = AppConfigurationLinkConfiguration.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, AppConfigurationLinkConfiguration> mapFromJson(
dynamic json) {
final map = <String, AppConfigurationLinkConfiguration>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AppConfigurationLinkConfiguration.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of AppConfigurationLinkConfiguration-objects as value to a dart map
static Map<String, List<AppConfigurationLinkConfiguration>> mapListFromJson(
dynamic json, {
bool growable = false,
}) {
final map = <String, List<AppConfigurationLinkConfiguration>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = AppConfigurationLinkConfiguration.listFromJson(
entry.value,
growable: growable,
);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'id',
'instanceId',
'label',
'title',
};
}