manager-app/manager_api_new/lib/model/visit_event_dto.dart

239 lines
7.1 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 VisitEventDTO {
/// Returns a new [VisitEventDTO] instance.
VisitEventDTO({
this.instanceId,
this.configurationId,
this.sectionId,
this.sessionId,
this.eventType,
this.appType,
this.language,
this.durationSeconds,
this.metadata,
this.timestamp,
});
String? instanceId;
String? configurationId;
String? sectionId;
String? sessionId;
String? eventType;
String? appType;
String? language;
int? durationSeconds;
String? metadata;
DateTime? timestamp;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is VisitEventDTO &&
other.instanceId == instanceId &&
other.configurationId == configurationId &&
other.sectionId == sectionId &&
other.sessionId == sessionId &&
other.eventType == eventType &&
other.appType == appType &&
other.language == language &&
other.durationSeconds == durationSeconds &&
other.metadata == metadata &&
other.timestamp == timestamp;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(instanceId == null ? 0 : instanceId!.hashCode) +
(configurationId == null ? 0 : configurationId!.hashCode) +
(sectionId == null ? 0 : sectionId!.hashCode) +
(sessionId == null ? 0 : sessionId!.hashCode) +
(eventType == null ? 0 : eventType!.hashCode) +
(appType == null ? 0 : appType!.hashCode) +
(language == null ? 0 : language!.hashCode) +
(durationSeconds == null ? 0 : durationSeconds!.hashCode) +
(metadata == null ? 0 : metadata!.hashCode) +
(timestamp == null ? 0 : timestamp!.hashCode);
@override
String toString() =>
'VisitEventDTO[instanceId=$instanceId, configurationId=$configurationId, sectionId=$sectionId, sessionId=$sessionId, eventType=$eventType, appType=$appType, language=$language, durationSeconds=$durationSeconds, metadata=$metadata, timestamp=$timestamp]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.instanceId != null) {
json[r'instanceId'] = this.instanceId;
} else {
json[r'instanceId'] = null;
}
if (this.configurationId != null) {
json[r'configurationId'] = this.configurationId;
} else {
json[r'configurationId'] = null;
}
if (this.sectionId != null) {
json[r'sectionId'] = this.sectionId;
} else {
json[r'sectionId'] = null;
}
if (this.sessionId != null) {
json[r'sessionId'] = this.sessionId;
} else {
json[r'sessionId'] = null;
}
if (this.eventType != null) {
json[r'eventType'] = this.eventType;
} else {
json[r'eventType'] = null;
}
if (this.appType != null) {
json[r'appType'] = this.appType;
} else {
json[r'appType'] = null;
}
if (this.language != null) {
json[r'language'] = this.language;
} else {
json[r'language'] = null;
}
if (this.durationSeconds != null) {
json[r'durationSeconds'] = this.durationSeconds;
} else {
json[r'durationSeconds'] = null;
}
if (this.metadata != null) {
json[r'metadata'] = this.metadata;
} else {
json[r'metadata'] = null;
}
if (this.timestamp != null) {
json[r'timestamp'] = this.timestamp!.toUtc().toIso8601String();
} else {
json[r'timestamp'] = null;
}
return json;
}
/// Returns a new [VisitEventDTO] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static VisitEventDTO? 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 "VisitEventDTO[$key]" is missing from JSON.');
assert(json[key] != null,
'Required key "VisitEventDTO[$key]" has a null value in JSON.');
});
return true;
}());
return VisitEventDTO(
instanceId: mapValueOfType<String>(json, r'instanceId'),
configurationId: mapValueOfType<String>(json, r'configurationId'),
sectionId: mapValueOfType<String>(json, r'sectionId'),
sessionId: mapValueOfType<String>(json, r'sessionId'),
eventType: mapValueOfType<String>(json, r'eventType'),
appType: mapValueOfType<String>(json, r'appType'),
language: mapValueOfType<String>(json, r'language'),
durationSeconds: mapValueOfType<int>(json, r'durationSeconds'),
metadata: mapValueOfType<String>(json, r'metadata'),
timestamp: mapDateTime(json, r'timestamp', r''),
);
}
return null;
}
static List<VisitEventDTO> listFromJson(
dynamic json, {
bool growable = false,
}) {
final result = <VisitEventDTO>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = VisitEventDTO.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, VisitEventDTO> mapFromJson(dynamic json) {
final map = <String, VisitEventDTO>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = VisitEventDTO.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of VisitEventDTO-objects as value to a dart map
static Map<String, List<VisitEventDTO>> mapListFromJson(
dynamic json, {
bool growable = false,
}) {
final map = <String, List<VisitEventDTO>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = VisitEventDTO.listFromJson(
entry.value,
growable: growable,
);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{};
}
class VisitEventType {
static const sectionView = 'SectionView';
static const sectionLeave = 'SectionLeave';
static const mapPoiTap = 'MapPoiTap';
static const qrScan = 'QrScan';
static const quizComplete = 'QuizComplete';
static const gameComplete = 'GameComplete';
static const agendaEventTap = 'AgendaEventTap';
static const menuItemTap = 'MenuItemTap';
static const assistantMessage = 'AssistantMessage';
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{};
}