manager-app/manager_api_new/lib/model/guided_step_dto.dart
2025-07-28 16:44:12 +02:00

317 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 GuidedStepDTO {
/// Returns a new [GuidedStepDTO] instance.
GuidedStepDTO({
this.id,
this.guidedPathId,
this.order,
this.title = const [],
this.description = const [],
this.geometry,
this.zoneRadiusMeters,
this.imageUrl,
this.triggerGeoPointId,
this.triggerGeoPoint,
this.isHiddenInitially,
this.isStepTimer,
this.isStepLocked,
this.timerSeconds,
this.timerExpiredMessage = const [],
this.quizQuestions = const [],
});
String? id;
String? guidedPathId;
///
/// 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.
///
int? order;
List<TranslationDTO>? title;
List<TranslationDTO>? description;
EventAddressDTOGeometry? geometry;
double? zoneRadiusMeters;
String? imageUrl;
int? triggerGeoPointId;
GuidedStepDTOTriggerGeoPoint? triggerGeoPoint;
///
/// 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? isHiddenInitially;
///
/// 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? isStepTimer;
///
/// 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? isStepLocked;
int? timerSeconds;
List<TranslationDTO>? timerExpiredMessage;
List<QuizQuestion>? quizQuestions;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is GuidedStepDTO &&
other.id == id &&
other.guidedPathId == guidedPathId &&
other.order == order &&
_deepEquality.equals(other.title, title) &&
_deepEquality.equals(other.description, description) &&
other.geometry == geometry &&
other.zoneRadiusMeters == zoneRadiusMeters &&
other.imageUrl == imageUrl &&
other.triggerGeoPointId == triggerGeoPointId &&
other.triggerGeoPoint == triggerGeoPoint &&
other.isHiddenInitially == isHiddenInitially &&
other.isStepTimer == isStepTimer &&
other.isStepLocked == isStepLocked &&
other.timerSeconds == timerSeconds &&
_deepEquality.equals(
other.timerExpiredMessage, timerExpiredMessage) &&
_deepEquality.equals(other.quizQuestions, quizQuestions);
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(id == null ? 0 : id!.hashCode) +
(guidedPathId == null ? 0 : guidedPathId!.hashCode) +
(order == null ? 0 : order!.hashCode) +
(title == null ? 0 : title!.hashCode) +
(description == null ? 0 : description!.hashCode) +
(geometry == null ? 0 : geometry!.hashCode) +
(zoneRadiusMeters == null ? 0 : zoneRadiusMeters!.hashCode) +
(imageUrl == null ? 0 : imageUrl!.hashCode) +
(triggerGeoPointId == null ? 0 : triggerGeoPointId!.hashCode) +
(triggerGeoPoint == null ? 0 : triggerGeoPoint!.hashCode) +
(isHiddenInitially == null ? 0 : isHiddenInitially!.hashCode) +
(isStepTimer == null ? 0 : isStepTimer!.hashCode) +
(isStepLocked == null ? 0 : isStepLocked!.hashCode) +
(timerSeconds == null ? 0 : timerSeconds!.hashCode) +
(timerExpiredMessage == null ? 0 : timerExpiredMessage!.hashCode) +
(quizQuestions == null ? 0 : quizQuestions!.hashCode);
@override
String toString() =>
'GuidedStepDTO[id=$id, guidedPathId=$guidedPathId, order=$order, title=$title, description=$description, geometry=$geometry, zoneRadiusMeters=$zoneRadiusMeters, imageUrl=$imageUrl, triggerGeoPointId=$triggerGeoPointId, triggerGeoPoint=$triggerGeoPoint, isHiddenInitially=$isHiddenInitially, isStepTimer=$isStepTimer, isStepLocked=$isStepLocked, timerSeconds=$timerSeconds, timerExpiredMessage=$timerExpiredMessage, quizQuestions=$quizQuestions]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.id != null) {
json[r'id'] = this.id;
} else {
json[r'id'] = null;
}
if (this.guidedPathId != null) {
json[r'guidedPathId'] = this.guidedPathId;
} else {
json[r'guidedPathId'] = null;
}
if (this.order != null) {
json[r'order'] = this.order;
} else {
json[r'order'] = null;
}
if (this.title != null) {
json[r'title'] = this.title;
} else {
json[r'title'] = null;
}
if (this.description != null) {
json[r'description'] = this.description;
} else {
json[r'description'] = null;
}
if (this.geometry != null) {
json[r'geometry'] = this.geometry;
} else {
json[r'geometry'] = null;
}
if (this.zoneRadiusMeters != null) {
json[r'zoneRadiusMeters'] = this.zoneRadiusMeters;
} else {
json[r'zoneRadiusMeters'] = null;
}
if (this.imageUrl != null) {
json[r'imageUrl'] = this.imageUrl;
} else {
json[r'imageUrl'] = null;
}
if (this.triggerGeoPointId != null) {
json[r'triggerGeoPointId'] = this.triggerGeoPointId;
} else {
json[r'triggerGeoPointId'] = null;
}
if (this.triggerGeoPoint != null) {
json[r'triggerGeoPoint'] = this.triggerGeoPoint;
} else {
json[r'triggerGeoPoint'] = null;
}
if (this.isHiddenInitially != null) {
json[r'isHiddenInitially'] = this.isHiddenInitially;
} else {
json[r'isHiddenInitially'] = null;
}
if (this.isStepTimer != null) {
json[r'isStepTimer'] = this.isStepTimer;
} else {
json[r'isStepTimer'] = null;
}
if (this.isStepLocked != null) {
json[r'isStepLocked'] = this.isStepLocked;
} else {
json[r'isStepLocked'] = null;
}
if (this.timerSeconds != null) {
json[r'timerSeconds'] = this.timerSeconds;
} else {
json[r'timerSeconds'] = null;
}
if (this.timerExpiredMessage != null) {
json[r'timerExpiredMessage'] = this.timerExpiredMessage;
} else {
json[r'timerExpiredMessage'] = null;
}
if (this.quizQuestions != null) {
json[r'quizQuestions'] = this.quizQuestions;
} else {
json[r'quizQuestions'] = null;
}
return json;
}
/// Returns a new [GuidedStepDTO] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static GuidedStepDTO? 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 "GuidedStepDTO[$key]" is missing from JSON.');
assert(json[key] != null,
'Required key "GuidedStepDTO[$key]" has a null value in JSON.');
});
return true;
}());
return GuidedStepDTO(
id: mapValueOfType<String>(json, r'id'),
guidedPathId: mapValueOfType<String>(json, r'guidedPathId'),
order: mapValueOfType<int>(json, r'order'),
title: TranslationDTO.listFromJson(json[r'title']),
description: TranslationDTO.listFromJson(json[r'description']),
geometry: EventAddressDTOGeometry.fromJson(json[r'geometry']),
zoneRadiusMeters: mapValueOfType<double>(json, r'zoneRadiusMeters'),
imageUrl: mapValueOfType<String>(json, r'imageUrl'),
triggerGeoPointId: mapValueOfType<int>(json, r'triggerGeoPointId'),
triggerGeoPoint:
GuidedStepDTOTriggerGeoPoint.fromJson(json[r'triggerGeoPoint']),
isHiddenInitially: mapValueOfType<bool>(json, r'isHiddenInitially'),
isStepTimer: mapValueOfType<bool>(json, r'isStepTimer'),
isStepLocked: mapValueOfType<bool>(json, r'isStepLocked'),
timerSeconds: mapValueOfType<int>(json, r'timerSeconds'),
timerExpiredMessage:
TranslationDTO.listFromJson(json[r'timerExpiredMessage']),
quizQuestions: QuizQuestion.listFromJson(json[r'quizQuestions']),
);
}
return null;
}
static List<GuidedStepDTO> listFromJson(
dynamic json, {
bool growable = false,
}) {
final result = <GuidedStepDTO>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = GuidedStepDTO.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, GuidedStepDTO> mapFromJson(dynamic json) {
final map = <String, GuidedStepDTO>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = GuidedStepDTO.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of GuidedStepDTO-objects as value to a dart map
static Map<String, List<GuidedStepDTO>> mapListFromJson(
dynamic json, {
bool growable = false,
}) {
final map = <String, List<GuidedStepDTO>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = GuidedStepDTO.listFromJson(
entry.value,
growable: growable,
);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{};
}