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

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