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

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