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

356 lines
12 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 ApplicationInstance {
/// Returns a new [ApplicationInstance] instance.
ApplicationInstance({
required this.instanceId,
required this.appType,
this.id,
this.configurations = const [],
this.mainImageId,
this.mainImageUrl,
this.loaderImageId,
this.loaderImageUrl,
this.isDate,
this.isHour,
this.primaryColor,
this.secondaryColor,
this.roundedValue,
this.screenPercentageSectionsMainPage,
this.isSectionImageBackground,
this.layoutMainPage,
this.languages = const [],
this.sectionEventId,
this.sectionEvent,
});
String instanceId;
AppType appType;
String? id;
List<AppConfigurationLink>? configurations;
String? mainImageId;
String? mainImageUrl;
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? isDate;
///
/// 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? isHour;
String? primaryColor;
String? secondaryColor;
int? roundedValue;
int? screenPercentageSectionsMainPage;
///
/// 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? isSectionImageBackground;
///
/// 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.
///
LayoutMainPageType? layoutMainPage;
List<String>? languages;
String? sectionEventId;
ApplicationInstanceSectionEvent? sectionEvent;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is ApplicationInstance &&
other.instanceId == instanceId &&
other.appType == appType &&
other.id == id &&
_deepEquality.equals(other.configurations, configurations) &&
other.mainImageId == mainImageId &&
other.mainImageUrl == mainImageUrl &&
other.loaderImageId == loaderImageId &&
other.loaderImageUrl == loaderImageUrl &&
other.isDate == isDate &&
other.isHour == isHour &&
other.primaryColor == primaryColor &&
other.secondaryColor == secondaryColor &&
other.roundedValue == roundedValue &&
other.screenPercentageSectionsMainPage ==
screenPercentageSectionsMainPage &&
other.isSectionImageBackground == isSectionImageBackground &&
other.layoutMainPage == layoutMainPage &&
_deepEquality.equals(other.languages, languages) &&
other.sectionEventId == sectionEventId &&
other.sectionEvent == sectionEvent;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(instanceId.hashCode) +
(appType.hashCode) +
(id == null ? 0 : id!.hashCode) +
(configurations == null ? 0 : configurations!.hashCode) +
(mainImageId == null ? 0 : mainImageId!.hashCode) +
(mainImageUrl == null ? 0 : mainImageUrl!.hashCode) +
(loaderImageId == null ? 0 : loaderImageId!.hashCode) +
(loaderImageUrl == null ? 0 : loaderImageUrl!.hashCode) +
(isDate == null ? 0 : isDate!.hashCode) +
(isHour == null ? 0 : isHour!.hashCode) +
(primaryColor == null ? 0 : primaryColor!.hashCode) +
(secondaryColor == null ? 0 : secondaryColor!.hashCode) +
(roundedValue == null ? 0 : roundedValue!.hashCode) +
(screenPercentageSectionsMainPage == null
? 0
: screenPercentageSectionsMainPage!.hashCode) +
(isSectionImageBackground == null
? 0
: isSectionImageBackground!.hashCode) +
(layoutMainPage == null ? 0 : layoutMainPage!.hashCode) +
(languages == null ? 0 : languages!.hashCode) +
(sectionEventId == null ? 0 : sectionEventId!.hashCode) +
(sectionEvent == null ? 0 : sectionEvent!.hashCode);
@override
String toString() =>
'ApplicationInstance[instanceId=$instanceId, appType=$appType, id=$id, configurations=$configurations, mainImageId=$mainImageId, mainImageUrl=$mainImageUrl, loaderImageId=$loaderImageId, loaderImageUrl=$loaderImageUrl, isDate=$isDate, isHour=$isHour, primaryColor=$primaryColor, secondaryColor=$secondaryColor, roundedValue=$roundedValue, screenPercentageSectionsMainPage=$screenPercentageSectionsMainPage, isSectionImageBackground=$isSectionImageBackground, layoutMainPage=$layoutMainPage, languages=$languages, sectionEventId=$sectionEventId, sectionEvent=$sectionEvent]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'instanceId'] = this.instanceId;
json[r'appType'] = this.appType;
if (this.id != null) {
json[r'id'] = this.id;
} else {
json[r'id'] = null;
}
if (this.configurations != null) {
json[r'configurations'] = this.configurations;
} else {
json[r'configurations'] = null;
}
if (this.mainImageId != null) {
json[r'mainImageId'] = this.mainImageId;
} else {
json[r'mainImageId'] = null;
}
if (this.mainImageUrl != null) {
json[r'mainImageUrl'] = this.mainImageUrl;
} else {
json[r'mainImageUrl'] = 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.isDate != null) {
json[r'isDate'] = this.isDate;
} else {
json[r'isDate'] = null;
}
if (this.isHour != null) {
json[r'isHour'] = this.isHour;
} else {
json[r'isHour'] = 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.roundedValue != null) {
json[r'roundedValue'] = this.roundedValue;
} else {
json[r'roundedValue'] = null;
}
if (this.screenPercentageSectionsMainPage != null) {
json[r'screenPercentageSectionsMainPage'] =
this.screenPercentageSectionsMainPage;
} else {
json[r'screenPercentageSectionsMainPage'] = null;
}
if (this.isSectionImageBackground != null) {
json[r'isSectionImageBackground'] = this.isSectionImageBackground;
} else {
json[r'isSectionImageBackground'] = null;
}
if (this.layoutMainPage != null) {
json[r'layoutMainPage'] = this.layoutMainPage;
} else {
json[r'layoutMainPage'] = null;
}
if (this.languages != null) {
json[r'languages'] = this.languages;
} else {
json[r'languages'] = null;
}
if (this.sectionEventId != null) {
json[r'sectionEventId'] = this.sectionEventId;
} else {
json[r'sectionEventId'] = null;
}
if (this.sectionEvent != null) {
json[r'sectionEvent'] = this.sectionEvent;
} else {
json[r'sectionEvent'] = null;
}
return json;
}
/// Returns a new [ApplicationInstance] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static ApplicationInstance? 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 "ApplicationInstance[$key]" is missing from JSON.');
assert(json[key] != null,
'Required key "ApplicationInstance[$key]" has a null value in JSON.');
});
return true;
}());
return ApplicationInstance(
instanceId: mapValueOfType<String>(json, r'instanceId')!,
appType: AppType.fromJson(json[r'appType'])!,
id: mapValueOfType<String>(json, r'id'),
configurations:
AppConfigurationLink.listFromJson(json[r'configurations']),
mainImageId: mapValueOfType<String>(json, r'mainImageId'),
mainImageUrl: mapValueOfType<String>(json, r'mainImageUrl'),
loaderImageId: mapValueOfType<String>(json, r'loaderImageId'),
loaderImageUrl: mapValueOfType<String>(json, r'loaderImageUrl'),
isDate: mapValueOfType<bool>(json, r'isDate'),
isHour: mapValueOfType<bool>(json, r'isHour'),
primaryColor: mapValueOfType<String>(json, r'primaryColor'),
secondaryColor: mapValueOfType<String>(json, r'secondaryColor'),
roundedValue: mapValueOfType<int>(json, r'roundedValue'),
screenPercentageSectionsMainPage:
mapValueOfType<int>(json, r'screenPercentageSectionsMainPage'),
isSectionImageBackground:
mapValueOfType<bool>(json, r'isSectionImageBackground'),
layoutMainPage: LayoutMainPageType.fromJson(json[r'layoutMainPage']),
languages: json[r'languages'] is Iterable
? (json[r'languages'] as Iterable)
.cast<String>()
.toList(growable: false)
: const [],
sectionEventId: mapValueOfType<String>(json, r'sectionEventId'),
sectionEvent:
ApplicationInstanceSectionEvent.fromJson(json[r'sectionEvent']),
);
}
return null;
}
static List<ApplicationInstance> listFromJson(
dynamic json, {
bool growable = false,
}) {
final result = <ApplicationInstance>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = ApplicationInstance.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, ApplicationInstance> mapFromJson(dynamic json) {
final map = <String, ApplicationInstance>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = ApplicationInstance.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of ApplicationInstance-objects as value to a dart map
static Map<String, List<ApplicationInstance>> mapListFromJson(
dynamic json, {
bool growable = false,
}) {
final map = <String, List<ApplicationInstance>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = ApplicationInstance.listFromJson(
entry.value,
growable: growable,
);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'instanceId',
'appType',
};
}