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

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