// @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 StatsSummaryDTO { StatsSummaryDTO({ this.totalSessions = 0, this.avgVisitDurationSeconds = 0, this.topSections = const [], this.visitsByDay = const [], this.languageDistribution = const {}, this.appTypeDistribution = const {}, this.topPois = const [], this.topAgendaEvents = const [], this.quizStats = const [], this.gameStats = const [], }); int totalSessions; int avgVisitDurationSeconds; List topSections; List visitsByDay; Map languageDistribution; Map appTypeDistribution; List topPois; List topAgendaEvents; List quizStats; List gameStats; static StatsSummaryDTO? fromJson(dynamic value) { if (value is Map) { final json = value.cast(); return StatsSummaryDTO( totalSessions: mapValueOfType(json, r'totalSessions') ?? 0, avgVisitDurationSeconds: mapValueOfType(json, r'avgVisitDurationSeconds') ?? 0, topSections: SectionStatDTO.listFromJson(json[r'topSections']), visitsByDay: DayStatDTO.listFromJson(json[r'visitsByDay']), languageDistribution: (json[r'languageDistribution'] is Map) ? (json[r'languageDistribution'] as Map).cast() : {}, appTypeDistribution: (json[r'appTypeDistribution'] is Map) ? (json[r'appTypeDistribution'] as Map).cast() : {}, topPois: PoiStatDTO.listFromJson(json[r'topPois']), topAgendaEvents: AgendaEventStatDTO.listFromJson(json[r'topAgendaEvents']), quizStats: QuizStatDTO.listFromJson(json[r'quizStats']), gameStats: GameStatDTO.listFromJson(json[r'gameStats']), ); } return null; } } class SectionStatDTO { SectionStatDTO({ this.sectionId, this.sectionTitle, this.views = 0, this.avgDurationSeconds = 0, }); String? sectionId; String? sectionTitle; int views; int avgDurationSeconds; static SectionStatDTO? fromJson(dynamic value) { if (value is Map) { final json = value.cast(); return SectionStatDTO( sectionId: mapValueOfType(json, r'sectionId'), sectionTitle: mapValueOfType(json, r'sectionTitle'), views: mapValueOfType(json, r'views') ?? 0, avgDurationSeconds: mapValueOfType(json, r'avgDurationSeconds') ?? 0, ); } return null; } static List listFromJson(dynamic json) { final result = []; if (json is List) { for (final row in json) { final value = SectionStatDTO.fromJson(row); if (value != null) result.add(value); } } return result; } } class DayStatDTO { DayStatDTO({ this.date, this.total = 0, this.mobile = 0, this.tablet = 0, }); String? date; int total; int mobile; int tablet; static DayStatDTO? fromJson(dynamic value) { if (value is Map) { final json = value.cast(); return DayStatDTO( date: mapValueOfType(json, r'date'), total: mapValueOfType(json, r'total') ?? 0, mobile: mapValueOfType(json, r'mobile') ?? 0, tablet: mapValueOfType(json, r'tablet') ?? 0, ); } return null; } static List listFromJson(dynamic json) { final result = []; if (json is List) { for (final row in json) { final value = DayStatDTO.fromJson(row); if (value != null) result.add(value); } } return result; } } class PoiStatDTO { PoiStatDTO({this.geoPointId, this.title, this.taps = 0, this.sectionId}); int? geoPointId; String? title; int taps; String? sectionId; static PoiStatDTO? fromJson(dynamic value) { if (value is Map) { final json = value.cast(); return PoiStatDTO( geoPointId: mapValueOfType(json, r'geoPointId'), title: mapValueOfType(json, r'title'), taps: mapValueOfType(json, r'taps') ?? 0, sectionId: mapValueOfType(json, r'sectionId'), ); } return null; } static List listFromJson(dynamic json) { final result = []; if (json is List) { for (final row in json) { final value = PoiStatDTO.fromJson(row); if (value != null) result.add(value); } } return result; } } class AgendaEventStatDTO { AgendaEventStatDTO({this.eventId, this.eventTitle, this.taps = 0}); String? eventId; String? eventTitle; int taps; static AgendaEventStatDTO? fromJson(dynamic value) { if (value is Map) { final json = value.cast(); return AgendaEventStatDTO( eventId: mapValueOfType(json, r'eventId'), eventTitle: mapValueOfType(json, r'eventTitle'), taps: mapValueOfType(json, r'taps') ?? 0, ); } return null; } static List listFromJson(dynamic json) { final result = []; if (json is List) { for (final row in json) { final value = AgendaEventStatDTO.fromJson(row); if (value != null) result.add(value); } } return result; } } class QuizStatDTO { QuizStatDTO({ this.sectionId, this.sectionTitle, this.completions = 0, this.avgScore = 0, this.totalQuestions = 0, }); String? sectionId; String? sectionTitle; int completions; double avgScore; int totalQuestions; static QuizStatDTO? fromJson(dynamic value) { if (value is Map) { final json = value.cast(); return QuizStatDTO( sectionId: mapValueOfType(json, r'sectionId'), sectionTitle: mapValueOfType(json, r'sectionTitle'), completions: mapValueOfType(json, r'completions') ?? 0, avgScore: mapValueOfType(json, r'avgScore') ?? 0, totalQuestions: mapValueOfType(json, r'totalQuestions') ?? 0, ); } return null; } static List listFromJson(dynamic json) { final result = []; if (json is List) { for (final row in json) { final value = QuizStatDTO.fromJson(row); if (value != null) result.add(value); } } return result; } } class GameStatDTO { GameStatDTO({this.gameType, this.completions = 0, this.avgDurationSeconds = 0}); String? gameType; int completions; int avgDurationSeconds; static GameStatDTO? fromJson(dynamic value) { if (value is Map) { final json = value.cast(); return GameStatDTO( gameType: mapValueOfType(json, r'gameType'), completions: mapValueOfType(json, r'completions') ?? 0, avgDurationSeconds: mapValueOfType(json, r'avgDurationSeconds') ?? 0, ); } return null; } static List listFromJson(dynamic json) { final result = []; if (json is List) { for (final row in json) { final value = GameStatDTO.fromJson(row); if (value != null) result.add(value); } } return result; } }