From e16e898140d59f4b5efb0a1b5b3c991bcca4ece5 Mon Sep 17 00:00:00 2001 From: Thomas Fransolet Date: Thu, 15 May 2025 15:11:21 +0200 Subject: [PATCH] Map done ! --- lib/Components/audio_input_container.dart | 4 +- ...loading_common.dart => common_loader.dart} | 8 +- lib/Components/geoloc_input_container.dart | 4 +- lib/Components/resource_input_container.dart | 4 +- lib/Components/video_viewer.dart | 4 +- .../Section/SubSection/Map/map_config.dart | 389 ++++++++-------- .../Map/showNewOrUpdateGeoPoint.dart | 4 +- .../Section/section_detail_screen.dart | 4 +- .../configuration_detail_screen.dart | 6 +- .../Configurations/configurations_screen.dart | 4 +- lib/Screens/Devices/devices_screen.dart | 4 +- lib/Screens/Policy/policy_screen.dart | 4 +- lib/Screens/Resources/resources_screen.dart | 4 +- .../Resources/show_resource_popup.dart | 2 +- lib/Screens/login_screen.dart | 4 +- lib/api/openApiTest.dart | 2 +- lib/api/swagger.yaml | 312 +++++++++++-- manager_api_new/.openapi-generator/FILES | 44 +- manager_api_new/README.md | 14 +- manager_api_new/doc/AuthenticationApi.md | 2 +- manager_api_new/doc/ConfigurationApi.md | 2 +- manager_api_new/doc/DeviceApi.md | 2 +- manager_api_new/doc/GeoPoint.md | 2 + manager_api_new/doc/GeoPointSectionMap.md | 42 ++ manager_api_new/doc/InstanceApi.md | 2 +- manager_api_new/doc/QuizQuestion.md | 4 +- .../doc/QuizQuestionSectionQuiz.md | 37 ++ manager_api_new/doc/ResourceApi.md | 2 +- manager_api_new/doc/Section.md | 32 ++ manager_api_new/doc/SectionApi.md | 2 +- manager_api_new/doc/SectionMap.md | 42 ++ .../doc/SectionMapAllOfMapMapProvider.md | 14 + .../doc/SectionMapAllOfMapMapType.md | 14 + .../doc/SectionMapAllOfMapResource.md | 20 + .../doc/SectionMapAllOfMapTypeMapbox.md | 14 + manager_api_new/doc/SectionMapApi.md | 6 +- manager_api_new/doc/SectionQuiz.md | 37 ++ manager_api_new/doc/SectionQuizApi.md | 2 +- manager_api_new/doc/UserApi.md | 2 +- manager_api_new/lib/api.dart | 10 +- manager_api_new/lib/api/section_map_api.dart | 6 +- manager_api_new/lib/api_client.dart | 22 +- manager_api_new/lib/model/geo_point.dart | 28 +- .../lib/model/geo_point_section_map.dart | 424 ++++++++++++++++++ manager_api_new/lib/model/quiz_question.dart | 32 +- .../lib/model/quiz_question_section_quiz.dart | 353 +++++++++++++++ manager_api_new/lib/model/section.dart | 309 +++++++++++++ manager_api_new/lib/model/section_map.dart | 424 ++++++++++++++++++ .../section_map_all_of_map_map_provider.dart | 100 +++++ .../section_map_all_of_map_map_type.dart | 100 +++++ .../section_map_all_of_map_resource.dart | 174 +++++++ .../section_map_all_of_map_type_mapbox.dart | 100 +++++ manager_api_new/lib/model/section_quiz.dart | 353 +++++++++++++++ .../test/geo_point_section_map_test.dart | 159 +++++++ .../test/quiz_question_section_quiz_test.dart | 134 ++++++ ...tion_map_all_of_map_map_provider_test.dart | 19 + .../section_map_all_of_map_map_type_test.dart | 19 + .../section_map_all_of_map_resource_test.dart | 49 ++ ...ction_map_all_of_map_type_mapbox_test.dart | 19 + manager_api_new/test/section_map_test.dart | 159 +++++++ manager_api_new/test/section_quiz_test.dart | 134 ++++++ manager_api_new/test/section_test.dart | 109 +++++ 62 files changed, 4049 insertions(+), 288 deletions(-) rename lib/Components/{loading_common.dart => common_loader.dart} (80%) create mode 100644 manager_api_new/doc/GeoPointSectionMap.md create mode 100644 manager_api_new/doc/QuizQuestionSectionQuiz.md create mode 100644 manager_api_new/doc/Section.md create mode 100644 manager_api_new/doc/SectionMap.md create mode 100644 manager_api_new/doc/SectionMapAllOfMapMapProvider.md create mode 100644 manager_api_new/doc/SectionMapAllOfMapMapType.md create mode 100644 manager_api_new/doc/SectionMapAllOfMapResource.md create mode 100644 manager_api_new/doc/SectionMapAllOfMapTypeMapbox.md create mode 100644 manager_api_new/doc/SectionQuiz.md create mode 100644 manager_api_new/lib/model/geo_point_section_map.dart create mode 100644 manager_api_new/lib/model/quiz_question_section_quiz.dart create mode 100644 manager_api_new/lib/model/section.dart create mode 100644 manager_api_new/lib/model/section_map.dart create mode 100644 manager_api_new/lib/model/section_map_all_of_map_map_provider.dart create mode 100644 manager_api_new/lib/model/section_map_all_of_map_map_type.dart create mode 100644 manager_api_new/lib/model/section_map_all_of_map_resource.dart create mode 100644 manager_api_new/lib/model/section_map_all_of_map_type_mapbox.dart create mode 100644 manager_api_new/lib/model/section_quiz.dart create mode 100644 manager_api_new/test/geo_point_section_map_test.dart create mode 100644 manager_api_new/test/quiz_question_section_quiz_test.dart create mode 100644 manager_api_new/test/section_map_all_of_map_map_provider_test.dart create mode 100644 manager_api_new/test/section_map_all_of_map_map_type_test.dart create mode 100644 manager_api_new/test/section_map_all_of_map_resource_test.dart create mode 100644 manager_api_new/test/section_map_all_of_map_type_mapbox_test.dart create mode 100644 manager_api_new/test/section_map_test.dart create mode 100644 manager_api_new/test/section_quiz_test.dart create mode 100644 manager_api_new/test/section_test.dart diff --git a/lib/Components/audio_input_container.dart b/lib/Components/audio_input_container.dart index 7bb9376..f1c912d 100644 --- a/lib/Components/audio_input_container.dart +++ b/lib/Components/audio_input_container.dart @@ -1,6 +1,6 @@ import 'package:auto_size_text/auto_size_text.dart'; import 'package:flutter/material.dart'; -import 'package:manager_app/Components/loading_common.dart'; +import 'package:manager_app/Components/common_loader.dart'; import 'package:manager_app/Models/managerContext.dart'; import 'package:manager_app/app_context.dart'; import 'package:manager_app/constants.dart'; @@ -117,7 +117,7 @@ class _AudioInputContainerState extends State { return Center( child: Container( height: size.height * 0.1, - child: LoadingCommon() + child: CommonLoader() ) ); } diff --git a/lib/Components/loading_common.dart b/lib/Components/common_loader.dart similarity index 80% rename from lib/Components/loading_common.dart rename to lib/Components/common_loader.dart index d2aafe0..b81e538 100644 --- a/lib/Components/loading_common.dart +++ b/lib/Components/common_loader.dart @@ -1,16 +1,16 @@ import 'package:flutter/material.dart'; import 'package:manager_app/constants.dart'; -class LoadingCommon extends StatefulWidget { +class CommonLoader extends StatefulWidget { double? iconSize; - LoadingCommon({Key? key, this.iconSize}) : super(key: key); + CommonLoader({Key? key, this.iconSize}) : super(key: key); @override - State createState() => _LoadingCommonState(); + State createState() => _CommonLoaderState(); } -class _LoadingCommonState extends State with TickerProviderStateMixin { +class _CommonLoaderState extends State with TickerProviderStateMixin { AnimationController? _controller; @override diff --git a/lib/Components/geoloc_input_container.dart b/lib/Components/geoloc_input_container.dart index b998939..6a62ad5 100644 --- a/lib/Components/geoloc_input_container.dart +++ b/lib/Components/geoloc_input_container.dart @@ -1,7 +1,7 @@ import 'package:auto_size_text/auto_size_text.dart'; import 'package:flutter/material.dart'; import 'package:location_picker_flutter_map/location_picker_flutter_map.dart'; -import 'package:manager_app/Components/loading_common.dart'; +import 'package:manager_app/Components/common_loader.dart'; import 'package:manager_app/Components/message_notification.dart'; import 'package:manager_app/Components/rounded_button.dart'; import 'package:manager_app/Components/rounded_input_field.dart'; @@ -78,7 +78,7 @@ class _GeolocInputContainerState extends State { color: kPrimaryColor, size: 50, ), - loadingWidget: LoadingCommon(iconSize: 40.0), + loadingWidget: CommonLoader(iconSize: 40.0), searchBarHintColor: kPrimaryColor, mapLoadingBackgroundColor: kSecond, zoomButtonsBackgroundColor: kPrimaryColor, diff --git a/lib/Components/resource_input_container.dart b/lib/Components/resource_input_container.dart index ac75400..6989d38 100644 --- a/lib/Components/resource_input_container.dart +++ b/lib/Components/resource_input_container.dart @@ -1,6 +1,6 @@ import 'package:auto_size_text/auto_size_text.dart'; import 'package:flutter/material.dart'; -import 'package:manager_app/Components/loading_common.dart'; +import 'package:manager_app/Components/common_loader.dart'; import 'package:manager_app/Models/managerContext.dart'; import 'package:manager_app/app_context.dart'; import 'package:manager_app/constants.dart'; @@ -136,7 +136,7 @@ class _ResourceInputContainerState extends State { return Center( child: Container( height: size.height * 0.1, - child: LoadingCommon() + child: CommonLoader() ) ); } diff --git a/lib/Components/video_viewer.dart b/lib/Components/video_viewer.dart index 25da555..b907079 100644 --- a/lib/Components/video_viewer.dart +++ b/lib/Components/video_viewer.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:manager_app/Components/loading_common.dart'; +import 'package:manager_app/Components/common_loader.dart'; import 'package:video_player/video_player.dart'; import '../../constants.dart'; @@ -55,7 +55,7 @@ class _VideoViewer extends State { ) : Center( child: Container( - child: LoadingCommon() + child: CommonLoader() ) ), ), diff --git a/lib/Screens/Configurations/Section/SubSection/Map/map_config.dart b/lib/Screens/Configurations/Section/SubSection/Map/map_config.dart index 4c2b2ea..a37134c 100644 --- a/lib/Screens/Configurations/Section/SubSection/Map/map_config.dart +++ b/lib/Screens/Configurations/Section/SubSection/Map/map_config.dart @@ -2,7 +2,10 @@ import 'package:diacritic/diacritic.dart'; import 'package:flutter/material.dart'; import 'package:flutter_widget_from_html/flutter_widget_from_html.dart'; import 'package:location_picker_flutter_map/location_picker_flutter_map.dart'; +import 'package:manager_app/Components/confirmation_dialog.dart'; import 'package:manager_app/Components/geoloc_input_container.dart'; +import 'package:manager_app/Components/common_loader.dart'; +import 'package:manager_app/Components/message_notification.dart'; import 'package:manager_app/Components/multi_select_dropdown_language_container.dart'; import 'package:manager_app/Models/managerContext.dart'; import 'package:manager_app/Screens/Configurations/Section/SubSection/Map/category_input_container.dart'; @@ -16,6 +19,7 @@ import 'package:manager_app/Components/string_input_container.dart'; import 'package:manager_app/Screens/Configurations/Section/SubSection/Map/showNewOrUpdateGeoPoint.dart'; import 'package:html/parser.dart' show parse; import 'package:manager_app/app_context.dart'; +import 'package:manager_app/client.dart'; import 'package:manager_app/constants.dart'; import 'package:manager_api_new/api.dart'; import 'dart:convert'; @@ -41,42 +45,21 @@ class MapConfig extends StatefulWidget { class _MapConfigState extends State { late MapDTO mapDTO; - late List pointsToShow; - List? selectedCategories = []; + late List pointsToShow = []; + //List? selectedCategories = []; String mapType= "hybrid"; String mapTypeMapBox= "standard"; String filterSearch = ''; + final ValueNotifier?> selectedCategoriesNotifier = ValueNotifier([]); + final ValueNotifier searchNotifier = ValueNotifier(""); + @override void initState() { super.initState(); //mapDTO = MapDTO.fromJson(json.decode(widget.initialValue))!; mapDTO = widget.initialValue; - pointsToShow = new List.from(mapDTO.points!); - mapDTO.points = pointsToShow; - pointsToShow.sort((a, b) => a.title!.firstWhere((t) => t.language == 'FR').value!.toLowerCase().compareTo(b.title!.firstWhere((t) => t.language == 'FR').value!.toLowerCase())); - - //selectedCategories = mapDTO.categories!.map((categorie) => categorie.label!.firstWhere((element) => element.language == 'FR').value!).toList(); - selectedCategories = mapDTO.categories!.map((categorie) => categorie.id!.toString()).toList(); - - pointsToShow.forEach((pts) { - /*if(pts.categorieId == null && pts.categorie != null && mapDTO.categories!.any((e) => e.order == pts.categorie!.order)) { - print("SET CATEGORIE ID FOR CAT"); - print(pts.categorie); - var testCat = mapDTO.categories!.where((c) => c.label![0].value == pts.categorie!.label![0].value); - if(testCat.isNotEmpty) { - pts.categorieId = testCat.first.id; - pts.categorie!.id = testCat.first.id; - } else { - pts.categorie = null; // Categorie no more existing so we can reset cat - } - - print(pts.categorieId); - }*/ - }); - - print(pointsToShow); if(mapDTO.mapType != null) { switch(mapDTO.mapType!.value) { @@ -310,152 +293,190 @@ class _MapConfigState extends State { ], ), ), - Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(25), - border: Border.all(width: 1.5, color: kSecond) - ), - child: Stack( - children: [ - Container( - constraints: BoxConstraints(minHeight: 100), - child: Padding( - padding: const EdgeInsets.only(top: 95, left: 10, right: 10, bottom: 10), - child: GridView.builder( - shrinkWrap: true, - gridDelegate: new SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 8), - itemCount: pointsToShow.length, - itemBuilder: (BuildContext context, int index) { - return - Container( - decoration: boxDecoration(pointsToShow[index], appContext), - padding: const EdgeInsets.all(5), - margin: EdgeInsets.symmetric(vertical: 10, horizontal: 10), - child: getElement(index, pointsToShow[index], size, appContext), - ); - } - ), - ), - ), - Positioned( - top: 10, - left: 10, - child: Text( - "Points géographiques", - style: TextStyle(fontSize: 15), - ), - ), - Positioned( - top: 10, - left: 175, - child: MultiSelectContainer( - label: null, - color: kSecond, - width: size.width * 0.45, - initialValue: selectedCategories!, - isMultiple: true, - isHTMLLabel : true, - values: mapDTO.categories!.map((categorie) => categorie.label!.firstWhere((element) => element.language == 'FR').value!).toList(), - onChanged: (value) { - var tempOutput = new List.from(value); - setState(() { - selectedCategories = tempOutput; - if(selectedCategories == null || selectedCategories!.length == 0) { - //pointsToShow = mapDTO.points!.where((point) => point.categorie == null).toList(); - pointsToShow = mapDTO.points!.where((point) => point.categorieId == null).toList(); - } else { - //pointsToShow = mapDTO.points!.where((point) => tempOutput.any((tps) => point.categorie == null || point.categorie?.label?.firstWhere((lab) => lab.language == 'FR').value == tps)).toList(); - pointsToShow = mapDTO.points!.where((point) => tempOutput.any((tps) => point.categorieId == null || point.categorieId == tps)).toList(); - } - }); - }, - ) - ), - Positioned( - top: 0, - right: 150, + FutureBuilder( + future: getGeoPoints((appContext.getContext() as ManagerAppContext).clientAPI!), + builder: (context, AsyncSnapshot snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return Center(child: CommonLoader()); + } else { + if(snapshot.connectionState == ConnectionState.done) + { + mapDTO.points = snapshot.data; + pointsToShow = mapDTO.points!; + pointsToShow.sort((a, b) => a.title!.firstWhere((t) => t.language == 'FR').value!.toLowerCase().compareTo(b.title!.firstWhere((t) => t.language == 'FR').value!.toLowerCase())); + selectedCategoriesNotifier.value = mapDTO.categories!.map((categorie) => categorie.id!).toList(); + + return Padding( + padding: const EdgeInsets.all(8.0), child: Container( - height: size.height*0.1, - constraints: BoxConstraints(minHeight: 85), - child: StringInputContainer( - label: "Recherche:", - isSmall: true, - fontSize: 15, - fontSizeText: 15, - onChanged: (String value) { - setState(() { - filterSearch = value; - filterPoints(); - }); - }, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(25), + border: Border.all(width: 1.5, color: kSecond) ), - ), - ), - Positioned( - top: 10, - right: 10, - child: InkWell( - onTap: () { - showNewOrUpdateGeoPoint( - mapDTO, - null, - (GeoPointDTO geoPoint) async { - setState(() { - mapDTO.points!.add(geoPoint); - mapDTO.points!.sort((a, b) => a.title!.firstWhere((t) => t.language == 'FR').value!.toLowerCase().compareTo(b.title!.firstWhere((t) => t.language == 'FR').value!.toLowerCase())); + child: Stack( + children: [ + Container( + constraints: BoxConstraints(minHeight: 100), + child: Padding( + padding: const EdgeInsets.only(top: 95, left: 10, right: 10, bottom: 10), + child: ValueListenableBuilder( + valueListenable: searchNotifier, + builder: (context, searchValue, child) { + return ValueListenableBuilder?>( + valueListenable: selectedCategoriesNotifier, + builder: (context, selectedCategories, child) { + if(selectedCategories == null || selectedCategories.length == 0) { + pointsToShow = mapDTO.points!.where((point) => point.categorieId == null).toList(); + } else { + pointsToShow = mapDTO.points!.where((point) => selectedCategories.any((tps) => point.categorieId == null || point.categorieId == tps)).toList(); + } - if(selectedCategories == null || selectedCategories!.length == 0) { - //pointsToShow = mapDTO.points!.where((point) => point.categorie == null).toList(); - pointsToShow = mapDTO.points!.where((point) => point.categorieId == null).toList(); - } else { - //pointsToShow = mapDTO.points!.where((point) => selectedCategories!.any((tps) => point.categorie == null || point.categorie?.label?.firstWhere((lab) => lab.language == 'FR').value == tps)).toList(); - pointsToShow = mapDTO.points!.where((point) => selectedCategories!.any((tps) => point.categorieId == null || point.categorieId == tps)).toList(); - } + pointsToShow = searchValue != null && searchValue.trim().isNotEmpty ? pointsToShow.where((GeoPointDTO pointGeo) => removeDiacritics(pointGeo.title!.firstWhere((t) => t.language == "FR").value!.toUpperCase()).contains(removeDiacritics(searchValue.toUpperCase()))).toList() : pointsToShow; - //widget.onChanged(jsonEncode(mapDTO).toString()); - widget.onChanged(mapDTO); - }); - - await (appContext.getContext() as ManagerAppContext).clientAPI!.sectionMapApi!.sectionMapCreate(mapDTO.id!, geoPoint); - // TODO refresh points list - }, - appContext, - context); - }, - child: Container( - height: MediaQuery.of(context).size.width * 0.04, - width: MediaQuery.of(context).size.width * 0.04, - child: Icon( - Icons.add, - color: kTextLightColor, - size: 30.0, - ), - decoration: BoxDecoration( - color: kSuccess, - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(20.0), - boxShadow: [ - BoxShadow( - color: kSecond, - spreadRadius: 0.5, - blurRadius: 5, - offset: Offset(0, 1.5), // changes position of shadow + return GridView.builder( + shrinkWrap: true, + gridDelegate: new SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 8), + itemCount: pointsToShow.length, + itemBuilder: (BuildContext context, int index) { + return + Container( + decoration: boxDecoration(pointsToShow[index], appContext), + padding: const EdgeInsets.all(5), + margin: EdgeInsets.symmetric(vertical: 10, horizontal: 10), + child: getElement(index, pointsToShow[index], size, appContext), + ); + } + ); + } + ); + } + ), + ), ), - ], - ), - ), + Positioned( + top: 10, + left: 10, + child: Text( + "Points géographiques", + style: TextStyle(fontSize: 15), + ), + ), + Positioned( + top: 10, + left: 175, + child: MultiSelectContainer( + label: null, + color: kSecond, + width: size.width * 0.45, + initialValue: mapDTO.categories!.where((cat) => selectedCategoriesNotifier.value!.contains(cat.id)).map((categorie) => categorie.label!.firstWhere((element) => element.language == 'FR').value!).toList(), + isMultiple: true, + isHTMLLabel : true, + values: mapDTO.categories!.map((categorie) => categorie.label!.firstWhere((element) => element.language == 'FR').value!).toList(), + onChanged: (value) { + var tempOutput = new List.from(value); + selectedCategoriesNotifier.value = mapDTO.categories!.where((c) => tempOutput.contains(c.label!.firstWhere((element) => element.language == 'FR').value!)).map((cat) => cat.id!).toList(); + }, + ) + ), + Positioned( + top: 0, + right: 150, + child: Container( + height: size.height*0.1, + constraints: BoxConstraints(minHeight: 85), + child: StringInputContainer( + label: "Recherche:", + isSmall: true, + fontSize: 15, + fontSizeText: 15, + onChanged: (String value) { + searchNotifier.value = value; + }, + ), + ), + ), + Positioned( + top: 10, + right: 10, + child: InkWell( + onTap: () { + showNewOrUpdateGeoPoint( + mapDTO, + null, + (GeoPointDTO geoPoint) async { + /*setState(() { + mapDTO.points!.add(geoPoint); + mapDTO.points!.sort((a, b) => a.title!.firstWhere((t) => t.language == 'FR').value!.toLowerCase().compareTo(b.title!.firstWhere((t) => t.language == 'FR').value!.toLowerCase())); + + if(selectedCategoriesNotifier.value == null || selectedCategoriesNotifier.value!.length == 0) { + //pointsToShow = mapDTO.points!.where((point) => point.categorie == null).toList(); + pointsToShow = mapDTO.points!.where((point) => point.categorieId == null).toList(); + } else { + //pointsToShow = mapDTO.points!.where((point) => selectedCategories!.any((tps) => point.categorie == null || point.categorie?.label?.firstWhere((lab) => lab.language == 'FR').value == tps)).toList(); + pointsToShow = mapDTO.points!.where((point) => selectedCategoriesNotifier.value!.any((tps) => point.categorieId == null || point.categorieId == tps)).toList(); + } + + //widget.onChanged(jsonEncode(mapDTO).toString()); + widget.onChanged(mapDTO); + });*/ + + try { + await (appContext.getContext() as ManagerAppContext).clientAPI!.sectionMapApi!.sectionMapCreate(mapDTO.id!, geoPoint); + showNotification(kSuccess, kWhite, 'Le point géographique a été créé avec succès', context, null); + setState(() { + // refresh ui + print("Refresh UI"); + }); + } catch(e) { + showNotification(kError, kWhite, 'Une erreur est survenue lors de la création du point géographique', context, null); + } + }, + appContext, + context); + }, + child: Container( + height: MediaQuery.of(context).size.width * 0.04, + width: MediaQuery.of(context).size.width * 0.04, + child: Icon( + Icons.add, + color: kTextLightColor, + size: 30.0, + ), + decoration: BoxDecoration( + color: kSuccess, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(20.0), + boxShadow: [ + BoxShadow( + color: kSecond, + spreadRadius: 0.5, + blurRadius: 5, + offset: Offset(0, 1.5), // changes position of shadow + ), + ], + ), + ), + ), + ) + ]), ), - ) - ]), - ), + ); + } else { + return Center(child: Text("Une erreur est survenue lors de la récupération des points géographiques"),); + } + } + } ), ], ), ); } + Future?> getGeoPoints(Client client) async { + List? geoPoints = await client.sectionMapApi!.sectionMapGetAllGeoPointsFromSection(widget.initialValue.id!); + return geoPoints ?? []; + } + getElement(int index, GeoPointDTO? point, Size size, AppContext appContext) { return Container( width: double.infinity, @@ -492,8 +513,19 @@ class _MapConfigState extends State { showNewOrUpdateGeoPoint( mapDTO, pointsToShow[index], - (GeoPointDTO geoPoint) { - setState(() { + (GeoPointDTO geoPoint) async { + try { + await (appContext.getContext() as ManagerAppContext).clientAPI!.sectionMapApi!.sectionMapUpdate(geoPoint); + showNotification(kSuccess, kWhite, 'Le point géographique a été mis à jour avec succès', context, null); + setState(() { + // refresh ui + print("Refresh UI"); + }); + } catch(e) { + showNotification(kError, kWhite, 'Une erreur est survenue lors de la mise à jour du point géographique', context, null); + } + + /*setState(() { var pointToUpdate = pointsToShow[index]; var pointToUpdateMapDTOPoints = mapDTO.points!.firstWhere((p) => p.longitude == pointToUpdate.longitude && p.latitude == pointToUpdate.latitude); var mapDTOPointsIndex = mapDTO.points!.indexOf(pointToUpdateMapDTOPoints); @@ -502,7 +534,7 @@ class _MapConfigState extends State { //widget.onChanged(jsonEncode(mapDTO).toString()); widget.onChanged(mapDTO); - }); + });*/ }, appContext, context); @@ -518,15 +550,26 @@ class _MapConfigState extends State { bottom: 0, right: 0, child: InkWell( - onTap: () { - setState(() { - var pointToRemove = pointsToShow[index]; - mapDTO.points = mapDTO.points!.where((p) => p.longitude != pointToRemove.longitude && p.latitude != pointToRemove.latitude).toList(); - pointsToShow.removeAt(index); - }); + onTap: () async { + showConfirmationDialog( + "Êtes-vous sûr de vouloir supprimer ce point géographique ?", + () {}, + () async { - //widget.onChanged(jsonEncode(mapDTO).toString()); - widget.onChanged(mapDTO); + try { + var pointToRemove = pointsToShow[index]; + (appContext.getContext() as ManagerAppContext).clientAPI!.sectionMapApi!.sectionMapDelete(pointToRemove.id!); + showNotification(kSuccess, kWhite, 'Le point géographique a été supprimé avec succès', context, null); + // refresh UI + setState(() { + print("Refresh UI"); + }); + } catch(e) { + showNotification(kError, kWhite, 'Une erreur est survenue lors de la suppression du point géographique', context, null); + } + }, + context + ); }, child: Icon( Icons.delete, @@ -539,10 +582,6 @@ class _MapConfigState extends State { ), ); } - - void filterPoints() { - pointsToShow = filterSearch.isEmpty ? mapDTO.points! : mapDTO.points!.where((GeoPointDTO pointGeo) => removeDiacritics(pointGeo.title!.firstWhere((t) => t.language == "FR").value!.toUpperCase()).contains(removeDiacritics(filterSearch.toUpperCase()))).toList(); - } } diff --git a/lib/Screens/Configurations/Section/SubSection/Map/showNewOrUpdateGeoPoint.dart b/lib/Screens/Configurations/Section/SubSection/Map/showNewOrUpdateGeoPoint.dart index c981bd1..841cf30 100644 --- a/lib/Screens/Configurations/Section/SubSection/Map/showNewOrUpdateGeoPoint.dart +++ b/lib/Screens/Configurations/Section/SubSection/Map/showNewOrUpdateGeoPoint.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:location_picker_flutter_map/location_picker_flutter_map.dart'; import 'package:manager_app/Components/dropDown_input_container_categories.dart'; -import 'package:manager_app/Components/loading_common.dart'; +import 'package:manager_app/Components/common_loader.dart'; import 'package:manager_app/Components/multi_string_input_container.dart'; import 'package:manager_app/Components/resource_input_container.dart'; import 'package:manager_app/Components/rounded_button.dart'; @@ -59,7 +59,7 @@ void showNewOrUpdateGeoPoint(MapDTO mapDTO, GeoPointDTO? inputGeoPointDTO, Funct color: kPrimaryColor, size: 50, ), - loadingWidget: LoadingCommon(iconSize: 40.0), + loadingWidget: CommonLoader(iconSize: 40.0), searchBarHintColor: kPrimaryColor, mapLoadingBackgroundColor: kSecond, zoomButtonsBackgroundColor: kPrimaryColor, diff --git a/lib/Screens/Configurations/Section/section_detail_screen.dart b/lib/Screens/Configurations/Section/section_detail_screen.dart index a492c2c..b0ee108 100644 --- a/lib/Screens/Configurations/Section/section_detail_screen.dart +++ b/lib/Screens/Configurations/Section/section_detail_screen.dart @@ -8,7 +8,7 @@ import 'package:manager_app/Components/check_input_container.dart'; import 'package:manager_app/Components/confirmation_dialog.dart'; import 'package:manager_app/Components/fetch_section_icon.dart'; import 'package:manager_app/Components/resource_input_container.dart'; -import 'package:manager_app/Components/loading_common.dart'; +import 'package:manager_app/Components/common_loader.dart'; import 'package:manager_app/Components/message_notification.dart'; import 'package:manager_app/Components/multi_string_input_container.dart'; import 'package:manager_app/Components/number_input_container.dart'; @@ -90,7 +90,7 @@ class _SectionDetailScreenState extends State { return Center( child: Container( height: size.height * 0.2, - child: LoadingCommon() + child: CommonLoader() ) ); } diff --git a/lib/Screens/Configurations/configuration_detail_screen.dart b/lib/Screens/Configurations/configuration_detail_screen.dart index 4ec42dc..327d327 100644 --- a/lib/Screens/Configurations/configuration_detail_screen.dart +++ b/lib/Screens/Configurations/configuration_detail_screen.dart @@ -9,7 +9,7 @@ import 'package:manager_app/Components/color_picker_input_container.dart'; import 'package:manager_app/Components/confirmation_dialog.dart'; import 'package:manager_app/Components/number_input_container.dart'; import 'package:manager_app/Components/resource_input_container.dart'; -import 'package:manager_app/Components/loading_common.dart'; +import 'package:manager_app/Components/common_loader.dart'; import 'package:manager_app/Components/message_notification.dart'; import 'package:manager_app/Components/multi_select_dropdown_language_container.dart'; import 'package:manager_app/Components/multi_string_input_container.dart'; @@ -55,7 +55,7 @@ class _ConfigurationDetailScreenState extends State { return Center( child: Container( height: size.height * 0.2, - child: LoadingCommon() + child: CommonLoader() ) ); } @@ -418,7 +418,7 @@ class _ConfigurationDetailScreenState extends State { return Center( child: Container( height: size.height * 0.15, - child: LoadingCommon() + child: CommonLoader() ) ); } diff --git a/lib/Screens/Configurations/configurations_screen.dart b/lib/Screens/Configurations/configurations_screen.dart index 0af484e..a675cbc 100644 --- a/lib/Screens/Configurations/configurations_screen.dart +++ b/lib/Screens/Configurations/configurations_screen.dart @@ -1,6 +1,6 @@ import 'package:auto_size_text/auto_size_text.dart'; import 'package:flutter/material.dart'; -import 'package:manager_app/Components/loading_common.dart'; +import 'package:manager_app/Components/common_loader.dart'; import 'package:manager_app/Components/message_notification.dart'; import 'package:manager_app/Models/managerContext.dart'; import 'package:manager_app/Screens/Configurations/configuration_detail_screen.dart'; @@ -51,7 +51,7 @@ class _ConfigurationsScreenState extends State { return Center( child: Container( height: size.height * 0.2, - child: LoadingCommon() + child: CommonLoader() ) ); } diff --git a/lib/Screens/Devices/devices_screen.dart b/lib/Screens/Devices/devices_screen.dart index c0a08ef..9488c58 100644 --- a/lib/Screens/Devices/devices_screen.dart +++ b/lib/Screens/Devices/devices_screen.dart @@ -1,6 +1,6 @@ import 'package:auto_size_text/auto_size_text.dart'; import 'package:flutter/material.dart'; -import 'package:manager_app/Components/loading_common.dart'; +import 'package:manager_app/Components/common_loader.dart'; import 'package:manager_app/Models/managerContext.dart'; import 'package:manager_app/Screens/Devices/device_element.dart'; import 'package:manager_app/app_context.dart'; @@ -67,7 +67,7 @@ class _DevicesScreenState extends State { return Center( child: Container( height: size.height * 0.2, - child: LoadingCommon() + child: CommonLoader() ) ); } diff --git a/lib/Screens/Policy/policy_screen.dart b/lib/Screens/Policy/policy_screen.dart index 925ee15..d793b52 100644 --- a/lib/Screens/Policy/policy_screen.dart +++ b/lib/Screens/Policy/policy_screen.dart @@ -2,7 +2,7 @@ import 'dart:html' as html; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:manager_app/Components/loading_common.dart'; +import 'package:manager_app/Components/common_loader.dart'; import 'package:manager_app/app_context.dart'; import 'package:provider/provider.dart'; @@ -53,7 +53,7 @@ class _PolicyScreenState extends State { return Center( child: Container( height: size.height * 0.2, - child: LoadingCommon() + child: CommonLoader() ) ); } diff --git a/lib/Screens/Resources/resources_screen.dart b/lib/Screens/Resources/resources_screen.dart index ab6c8e0..9dc95c1 100644 --- a/lib/Screens/Resources/resources_screen.dart +++ b/lib/Screens/Resources/resources_screen.dart @@ -3,7 +3,7 @@ import 'package:file_picker/file_picker.dart'; import 'package:firebase_storage/firebase_storage.dart'; import 'package:flutter/material.dart'; -import 'package:manager_app/Components/loading_common.dart'; +import 'package:manager_app/Components/common_loader.dart'; import 'package:manager_app/Components/message_notification.dart'; import 'package:manager_app/Models/managerContext.dart'; import 'package:manager_app/Screens/Resources/new_resource_popup.dart'; @@ -125,7 +125,7 @@ class _ResourcesScreenState extends State { return Center( child: Container( height: size.height * 0.2, - child: LoadingCommon() + child: CommonLoader() ) ); } diff --git a/lib/Screens/Resources/show_resource_popup.dart b/lib/Screens/Resources/show_resource_popup.dart index d19c32b..db89cf0 100644 --- a/lib/Screens/Resources/show_resource_popup.dart +++ b/lib/Screens/Resources/show_resource_popup.dart @@ -180,7 +180,7 @@ Future delete(ResourceDTO resourceDTO, AppContext appContext, context) asy appContext.setContext(managerAppContext); Navigator.of(context).pop(); - showNotification(Colors.green, kWhite, 'La ressource a été supprimée avec succès', context, null); + showNotification(kSuccess, kWhite, 'La ressource a été supprimée avec succès', context, null); }, context ); diff --git a/lib/Screens/login_screen.dart b/lib/Screens/login_screen.dart index bf4b694..f0369fb 100644 --- a/lib/Screens/login_screen.dart +++ b/lib/Screens/login_screen.dart @@ -3,7 +3,7 @@ import 'dart:html'; import 'package:auto_size_text/auto_size_text.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:manager_app/Components/loading_common.dart'; +import 'package:manager_app/Components/common_loader.dart'; import 'package:manager_app/Components/message_notification.dart'; import 'package:manager_app/Components/rounded_button.dart'; import 'package:manager_app/Components/rounded_input_field.dart'; @@ -377,7 +377,7 @@ class _LoginScreenState extends State { }, ): Container( height: size.height * 0.1, - child: LoadingCommon(iconSize: 40) + child: CommonLoader(iconSize: 40) ), ], ) diff --git a/lib/api/openApiTest.dart b/lib/api/openApiTest.dart index ced3dad..5b208c6 100644 --- a/lib/api/openApiTest.dart +++ b/lib/api/openApiTest.dart @@ -1,4 +1,4 @@ -// Openapi Generator last run: : 2025-05-07T14:31:51.428558 +// Openapi Generator last run: : 2025-05-15T14:44:57.478150 import 'package:openapi_generator_annotations/openapi_generator_annotations.dart'; @Openapi( diff --git a/lib/api/swagger.yaml b/lib/api/swagger.yaml index 7f1fea3..33f6f37 100644 --- a/lib/api/swagger.yaml +++ b/lib/api/swagger.yaml @@ -4,11 +4,11 @@ "info": { "title": "Manager Service", "description": "API Manager Service", - "version": "Version Alpha 0" + "version": "Version Alpha" }, "servers": [ { - "url": "https://localhost:5001" + "url": "http://localhost:5000" } ], "paths": { @@ -2631,7 +2631,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeoPoint" + "$ref": "#/components/schemas/GeoPointDTO" } } } @@ -4671,6 +4671,221 @@ "items": { "$ref": "#/components/schemas/TranslationDTO" } + }, + "sectionMapId": { + "type": "string", + "nullable": true + }, + "sectionMap": { + "nullable": true, + "oneOf": [ + { + "$ref": "#/components/schemas/SectionMap" + } + ] + } + } + }, + "SectionMap": { + "allOf": [ + { + "$ref": "#/components/schemas/Section" + }, + { + "type": "object", + "additionalProperties": false, + "required": [ + "mapCategories" + ], + "properties": { + "mapZoom": { + "type": "integer", + "format": "int32" + }, + "mapMapType": { + "nullable": true, + "oneOf": [ + { + "$ref": "#/components/schemas/MapTypeApp" + } + ] + }, + "mapTypeMapbox": { + "nullable": true, + "oneOf": [ + { + "$ref": "#/components/schemas/MapTypeMapBox" + } + ] + }, + "mapMapProvider": { + "nullable": true, + "oneOf": [ + { + "$ref": "#/components/schemas/MapProvider" + } + ] + }, + "mapPoints": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/GeoPoint" + } + }, + "mapResourceId": { + "type": "string", + "nullable": true + }, + "mapResource": { + "nullable": true, + "oneOf": [ + { + "$ref": "#/components/schemas/Resource" + } + ] + }, + "mapCategories": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CategorieDTO" + } + }, + "mapCenterLatitude": { + "type": "string", + "nullable": true + }, + "mapCenterLongitude": { + "type": "string", + "nullable": true + } + } + } + ] + }, + "Resource": { + "type": "object", + "additionalProperties": false, + "required": [ + "id", + "type", + "label", + "instanceId" + ], + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "type": { + "$ref": "#/components/schemas/ResourceType" + }, + "label": { + "type": "string", + "minLength": 1 + }, + "dateCreation": { + "type": "string", + "format": "date-time" + }, + "instanceId": { + "type": "string", + "minLength": 1 + }, + "url": { + "type": "string", + "nullable": true + } + } + }, + "Section": { + "type": "object", + "additionalProperties": false, + "required": [ + "id", + "label", + "title", + "configurationId", + "type", + "isSubSection", + "instanceId" + ], + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "label": { + "type": "string", + "minLength": 1 + }, + "title": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TranslationDTO" + } + }, + "description": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/TranslationDTO" + } + }, + "order": { + "type": "integer", + "format": "int32" + }, + "configurationId": { + "type": "string", + "minLength": 1 + }, + "imageId": { + "type": "string", + "nullable": true + }, + "imageSource": { + "type": "string", + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/SectionType" + }, + "isSubSection": { + "type": "boolean" + }, + "parentId": { + "type": "string", + "nullable": true + }, + "dateCreation": { + "type": "string", + "format": "date-time" + }, + "instanceId": { + "type": "string", + "minLength": 1 + }, + "isBeacon": { + "type": "boolean" + }, + "beaconId": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "latitude": { + "type": "string", + "nullable": true + }, + "longitude": { + "type": "string", + "nullable": true + }, + "meterZoneGPS": { + "type": "integer", + "format": "int32", + "nullable": true } } }, @@ -4714,43 +4929,70 @@ "items": { "$ref": "#/components/schemas/ResponseDTO" } + }, + "sectionQuizId": { + "type": "string", + "nullable": true + }, + "sectionQuiz": { + "nullable": true, + "oneOf": [ + { + "$ref": "#/components/schemas/SectionQuiz" + } + ] } } }, - "Resource": { - "type": "object", - "additionalProperties": false, - "required": [ - "id", - "type", - "label", - "instanceId" - ], - "properties": { - "id": { - "type": "string", - "minLength": 1 + "SectionQuiz": { + "allOf": [ + { + "$ref": "#/components/schemas/Section" }, - "type": { - "$ref": "#/components/schemas/ResourceType" - }, - "label": { - "type": "string", - "minLength": 1 - }, - "dateCreation": { - "type": "string", - "format": "date-time" - }, - "instanceId": { - "type": "string", - "minLength": 1 - }, - "url": { - "type": "string", - "nullable": true + { + "type": "object", + "additionalProperties": false, + "required": [ + "quizQuestions", + "quizBadLevel", + "quizMediumLevel", + "quizGoodLevel", + "quizGreatLevel" + ], + "properties": { + "quizQuestions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/QuizQuestion" + } + }, + "quizBadLevel": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TranslationAndResourceDTO" + } + }, + "quizMediumLevel": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TranslationAndResourceDTO" + } + }, + "quizGoodLevel": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TranslationAndResourceDTO" + } + }, + "quizGreatLevel": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TranslationAndResourceDTO" + } + } + } } - } + ] }, "User": { "type": "object", diff --git a/manager_api_new/.openapi-generator/FILES b/manager_api_new/.openapi-generator/FILES index e91954b..2c3515b 100644 --- a/manager_api_new/.openapi-generator/FILES +++ b/manager_api_new/.openapi-generator/FILES @@ -17,6 +17,7 @@ doc/DeviceDetailDTO.md doc/ExportConfigurationDTO.md doc/GeoPoint.md doc/GeoPointDTO.md +doc/GeoPointSectionMap.md doc/Instance.md doc/InstanceApi.md doc/InstanceDTO.md @@ -38,15 +39,22 @@ doc/QuestionDTO.md doc/QuestionDTOImageBackgroundResourceType.md doc/QuizDTO.md doc/QuizQuestion.md -doc/QuizQuestionResource.md +doc/QuizQuestionSectionQuiz.md doc/Resource.md doc/ResourceApi.md doc/ResourceDTO.md doc/ResourceType.md doc/ResponseDTO.md +doc/Section.md doc/SectionApi.md doc/SectionDTO.md +doc/SectionMap.md +doc/SectionMapAllOfMapMapProvider.md +doc/SectionMapAllOfMapMapType.md +doc/SectionMapAllOfMapResource.md +doc/SectionMapAllOfMapTypeMapbox.md doc/SectionMapApi.md +doc/SectionQuiz.md doc/SectionQuizApi.md doc/SectionType.md doc/SliderDTO.md @@ -90,6 +98,7 @@ lib/model/device_dto.dart lib/model/export_configuration_dto.dart lib/model/geo_point.dart lib/model/geo_point_dto.dart +lib/model/geo_point_section_map.dart lib/model/instance.dart lib/model/instance_dto.dart lib/model/login_dto.dart @@ -110,12 +119,19 @@ lib/model/question_dto.dart lib/model/question_dto_image_background_resource_type.dart lib/model/quiz_dto.dart lib/model/quiz_question.dart -lib/model/quiz_question_resource.dart +lib/model/quiz_question_section_quiz.dart lib/model/resource.dart lib/model/resource_dto.dart lib/model/resource_type.dart lib/model/response_dto.dart +lib/model/section.dart lib/model/section_dto.dart +lib/model/section_map.dart +lib/model/section_map_all_of_map_map_provider.dart +lib/model/section_map_all_of_map_map_type.dart +lib/model/section_map_all_of_map_resource.dart +lib/model/section_map_all_of_map_type_mapbox.dart +lib/model/section_quiz.dart lib/model/section_type.dart lib/model/slider_dto.dart lib/model/token_dto.dart @@ -127,18 +143,12 @@ lib/model/video_dto.dart lib/model/weather_dto.dart lib/model/web_dto.dart pubspec.yaml -test/agenda_dto_all_of_agenda_map_provider_test.dart -test/content_dto_resource_test.dart -test/geo_point_test.dart -test/map_dto_all_of_map_provider_test.dart -test/map_dto_all_of_map_type_mapbox_test.dart -test/map_dto_all_of_map_type_test.dart -test/ordered_translation_and_resource_dto_test.dart -test/puzzle_dto_all_of_puzzle_image_test.dart -test/question_dto_image_background_resource_type_test.dart -test/quiz_dto_test.dart -test/quiz_question_resource_test.dart -test/quiz_question_test.dart -test/resource_test.dart -test/section_map_api_test.dart -test/section_quiz_api_test.dart +test/geo_point_section_map_test.dart +test/quiz_question_section_quiz_test.dart +test/section_map_all_of_map_map_provider_test.dart +test/section_map_all_of_map_map_type_test.dart +test/section_map_all_of_map_resource_test.dart +test/section_map_all_of_map_type_mapbox_test.dart +test/section_map_test.dart +test/section_quiz_test.dart +test/section_test.dart diff --git a/manager_api_new/README.md b/manager_api_new/README.md index 3afdd13..9452f76 100644 --- a/manager_api_new/README.md +++ b/manager_api_new/README.md @@ -3,7 +3,7 @@ API Manager Service This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: Version Alpha 0 +- API version: Version Alpha - Generator version: 7.9.0 - Build package: org.openapitools.codegen.languages.DartClientCodegen @@ -61,7 +61,7 @@ try { ## Documentation for API Endpoints -All URIs are relative to *https://localhost:5001* +All URIs are relative to *http://localhost:5000* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- @@ -145,6 +145,7 @@ Class | Method | HTTP request | Description - [ExportConfigurationDTO](doc//ExportConfigurationDTO.md) - [GeoPoint](doc//GeoPoint.md) - [GeoPointDTO](doc//GeoPointDTO.md) + - [GeoPointSectionMap](doc//GeoPointSectionMap.md) - [Instance](doc//Instance.md) - [InstanceDTO](doc//InstanceDTO.md) - [LoginDTO](doc//LoginDTO.md) @@ -165,12 +166,19 @@ Class | Method | HTTP request | Description - [QuestionDTOImageBackgroundResourceType](doc//QuestionDTOImageBackgroundResourceType.md) - [QuizDTO](doc//QuizDTO.md) - [QuizQuestion](doc//QuizQuestion.md) - - [QuizQuestionResource](doc//QuizQuestionResource.md) + - [QuizQuestionSectionQuiz](doc//QuizQuestionSectionQuiz.md) - [Resource](doc//Resource.md) - [ResourceDTO](doc//ResourceDTO.md) - [ResourceType](doc//ResourceType.md) - [ResponseDTO](doc//ResponseDTO.md) + - [Section](doc//Section.md) - [SectionDTO](doc//SectionDTO.md) + - [SectionMap](doc//SectionMap.md) + - [SectionMapAllOfMapMapProvider](doc//SectionMapAllOfMapMapProvider.md) + - [SectionMapAllOfMapMapType](doc//SectionMapAllOfMapMapType.md) + - [SectionMapAllOfMapResource](doc//SectionMapAllOfMapResource.md) + - [SectionMapAllOfMapTypeMapbox](doc//SectionMapAllOfMapTypeMapbox.md) + - [SectionQuiz](doc//SectionQuiz.md) - [SectionType](doc//SectionType.md) - [SliderDTO](doc//SliderDTO.md) - [TokenDTO](doc//TokenDTO.md) diff --git a/manager_api_new/doc/AuthenticationApi.md b/manager_api_new/doc/AuthenticationApi.md index 9ef127e..b17a2f1 100644 --- a/manager_api_new/doc/AuthenticationApi.md +++ b/manager_api_new/doc/AuthenticationApi.md @@ -5,7 +5,7 @@ import 'package:manager_api_new/api.dart'; ``` -All URIs are relative to *https://localhost:5001* +All URIs are relative to *http://localhost:5000* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/manager_api_new/doc/ConfigurationApi.md b/manager_api_new/doc/ConfigurationApi.md index 8e88412..6b4f5c9 100644 --- a/manager_api_new/doc/ConfigurationApi.md +++ b/manager_api_new/doc/ConfigurationApi.md @@ -5,7 +5,7 @@ import 'package:manager_api_new/api.dart'; ``` -All URIs are relative to *https://localhost:5001* +All URIs are relative to *http://localhost:5000* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/manager_api_new/doc/DeviceApi.md b/manager_api_new/doc/DeviceApi.md index 1173900..a586e58 100644 --- a/manager_api_new/doc/DeviceApi.md +++ b/manager_api_new/doc/DeviceApi.md @@ -5,7 +5,7 @@ import 'package:manager_api_new/api.dart'; ``` -All URIs are relative to *https://localhost:5001* +All URIs are relative to *http://localhost:5000* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/manager_api_new/doc/GeoPoint.md b/manager_api_new/doc/GeoPoint.md index 44bffcf..60f5aa0 100644 --- a/manager_api_new/doc/GeoPoint.md +++ b/manager_api_new/doc/GeoPoint.md @@ -22,6 +22,8 @@ Name | Type | Description | Notes **longitude** | **String** | | [optional] **imageResourceId** | **String** | | [optional] **imageUrl** | **String** | | [optional] +**sectionMapId** | **String** | | [optional] +**sectionMap** | [**GeoPointSectionMap**](GeoPointSectionMap.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api_new/doc/GeoPointSectionMap.md b/manager_api_new/doc/GeoPointSectionMap.md new file mode 100644 index 0000000..1eb7bb9 --- /dev/null +++ b/manager_api_new/doc/GeoPointSectionMap.md @@ -0,0 +1,42 @@ +# manager_api_new.model.GeoPointSectionMap + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**label** | **String** | | +**title** | [**List**](TranslationDTO.md) | | [default to const []] +**configurationId** | **String** | | +**type** | [**SectionType**](SectionType.md) | | +**isSubSection** | **bool** | | +**instanceId** | **String** | | +**mapCategories** | [**List**](CategorieDTO.md) | | [default to const []] +**description** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**order** | **int** | | [optional] +**imageId** | **String** | | [optional] +**imageSource** | **String** | | [optional] +**parentId** | **String** | | [optional] +**dateCreation** | [**DateTime**](DateTime.md) | | [optional] +**isBeacon** | **bool** | | [optional] +**beaconId** | **int** | | [optional] +**latitude** | **String** | | [optional] +**longitude** | **String** | | [optional] +**meterZoneGPS** | **int** | | [optional] +**mapZoom** | **int** | | [optional] +**mapMapType** | [**SectionMapAllOfMapMapType**](SectionMapAllOfMapMapType.md) | | [optional] +**mapTypeMapbox** | [**SectionMapAllOfMapTypeMapbox**](SectionMapAllOfMapTypeMapbox.md) | | [optional] +**mapMapProvider** | [**SectionMapAllOfMapMapProvider**](SectionMapAllOfMapMapProvider.md) | | [optional] +**mapPoints** | [**List**](GeoPoint.md) | | [optional] [default to const []] +**mapResourceId** | **String** | | [optional] +**mapResource** | [**SectionMapAllOfMapResource**](SectionMapAllOfMapResource.md) | | [optional] +**mapCenterLatitude** | **String** | | [optional] +**mapCenterLongitude** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/InstanceApi.md b/manager_api_new/doc/InstanceApi.md index 5d8e006..0b675c0 100644 --- a/manager_api_new/doc/InstanceApi.md +++ b/manager_api_new/doc/InstanceApi.md @@ -5,7 +5,7 @@ import 'package:manager_api_new/api.dart'; ``` -All URIs are relative to *https://localhost:5001* +All URIs are relative to *http://localhost:5000* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/manager_api_new/doc/QuizQuestion.md b/manager_api_new/doc/QuizQuestion.md index ca55dd4..f8dd67a 100644 --- a/manager_api_new/doc/QuizQuestion.md +++ b/manager_api_new/doc/QuizQuestion.md @@ -12,8 +12,10 @@ Name | Type | Description | Notes **label** | [**List**](TranslationAndResourceDTO.md) | | [default to const []] **responses** | [**List**](ResponseDTO.md) | | [default to const []] **resourceId** | **String** | | [optional] -**resource** | [**QuizQuestionResource**](QuizQuestionResource.md) | | [optional] +**resource** | [**SectionMapAllOfMapResource**](SectionMapAllOfMapResource.md) | | [optional] **order** | **int** | | [optional] +**sectionQuizId** | **String** | | [optional] +**sectionQuiz** | [**QuizQuestionSectionQuiz**](QuizQuestionSectionQuiz.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/manager_api_new/doc/QuizQuestionSectionQuiz.md b/manager_api_new/doc/QuizQuestionSectionQuiz.md new file mode 100644 index 0000000..8979911 --- /dev/null +++ b/manager_api_new/doc/QuizQuestionSectionQuiz.md @@ -0,0 +1,37 @@ +# manager_api_new.model.QuizQuestionSectionQuiz + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**label** | **String** | | +**title** | [**List**](TranslationDTO.md) | | [default to const []] +**configurationId** | **String** | | +**type** | [**SectionType**](SectionType.md) | | +**isSubSection** | **bool** | | +**instanceId** | **String** | | +**quizQuestions** | [**List**](QuizQuestion.md) | | [default to const []] +**quizBadLevel** | [**List**](TranslationAndResourceDTO.md) | | [default to const []] +**quizMediumLevel** | [**List**](TranslationAndResourceDTO.md) | | [default to const []] +**quizGoodLevel** | [**List**](TranslationAndResourceDTO.md) | | [default to const []] +**quizGreatLevel** | [**List**](TranslationAndResourceDTO.md) | | [default to const []] +**description** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**order** | **int** | | [optional] +**imageId** | **String** | | [optional] +**imageSource** | **String** | | [optional] +**parentId** | **String** | | [optional] +**dateCreation** | [**DateTime**](DateTime.md) | | [optional] +**isBeacon** | **bool** | | [optional] +**beaconId** | **int** | | [optional] +**latitude** | **String** | | [optional] +**longitude** | **String** | | [optional] +**meterZoneGPS** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/ResourceApi.md b/manager_api_new/doc/ResourceApi.md index ff8f425..fcf1ea2 100644 --- a/manager_api_new/doc/ResourceApi.md +++ b/manager_api_new/doc/ResourceApi.md @@ -5,7 +5,7 @@ import 'package:manager_api_new/api.dart'; ``` -All URIs are relative to *https://localhost:5001* +All URIs are relative to *http://localhost:5000* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/manager_api_new/doc/Section.md b/manager_api_new/doc/Section.md new file mode 100644 index 0000000..165ef46 --- /dev/null +++ b/manager_api_new/doc/Section.md @@ -0,0 +1,32 @@ +# manager_api_new.model.Section + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**label** | **String** | | +**title** | [**List**](TranslationDTO.md) | | [default to const []] +**configurationId** | **String** | | +**type** | [**SectionType**](SectionType.md) | | +**isSubSection** | **bool** | | +**instanceId** | **String** | | +**description** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**order** | **int** | | [optional] +**imageId** | **String** | | [optional] +**imageSource** | **String** | | [optional] +**parentId** | **String** | | [optional] +**dateCreation** | [**DateTime**](DateTime.md) | | [optional] +**isBeacon** | **bool** | | [optional] +**beaconId** | **int** | | [optional] +**latitude** | **String** | | [optional] +**longitude** | **String** | | [optional] +**meterZoneGPS** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/SectionApi.md b/manager_api_new/doc/SectionApi.md index 8e2e397..71f061a 100644 --- a/manager_api_new/doc/SectionApi.md +++ b/manager_api_new/doc/SectionApi.md @@ -5,7 +5,7 @@ import 'package:manager_api_new/api.dart'; ``` -All URIs are relative to *https://localhost:5001* +All URIs are relative to *http://localhost:5000* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/manager_api_new/doc/SectionMap.md b/manager_api_new/doc/SectionMap.md new file mode 100644 index 0000000..e875189 --- /dev/null +++ b/manager_api_new/doc/SectionMap.md @@ -0,0 +1,42 @@ +# manager_api_new.model.SectionMap + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**label** | **String** | | +**title** | [**List**](TranslationDTO.md) | | [default to const []] +**configurationId** | **String** | | +**type** | [**SectionType**](SectionType.md) | | +**isSubSection** | **bool** | | +**instanceId** | **String** | | +**mapCategories** | [**List**](CategorieDTO.md) | | [default to const []] +**description** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**order** | **int** | | [optional] +**imageId** | **String** | | [optional] +**imageSource** | **String** | | [optional] +**parentId** | **String** | | [optional] +**dateCreation** | [**DateTime**](DateTime.md) | | [optional] +**isBeacon** | **bool** | | [optional] +**beaconId** | **int** | | [optional] +**latitude** | **String** | | [optional] +**longitude** | **String** | | [optional] +**meterZoneGPS** | **int** | | [optional] +**mapZoom** | **int** | | [optional] +**mapMapType** | [**SectionMapAllOfMapMapType**](SectionMapAllOfMapMapType.md) | | [optional] +**mapTypeMapbox** | [**SectionMapAllOfMapTypeMapbox**](SectionMapAllOfMapTypeMapbox.md) | | [optional] +**mapMapProvider** | [**SectionMapAllOfMapMapProvider**](SectionMapAllOfMapMapProvider.md) | | [optional] +**mapPoints** | [**List**](GeoPoint.md) | | [optional] [default to const []] +**mapResourceId** | **String** | | [optional] +**mapResource** | [**SectionMapAllOfMapResource**](SectionMapAllOfMapResource.md) | | [optional] +**mapCenterLatitude** | **String** | | [optional] +**mapCenterLongitude** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/SectionMapAllOfMapMapProvider.md b/manager_api_new/doc/SectionMapAllOfMapMapProvider.md new file mode 100644 index 0000000..bc9de49 --- /dev/null +++ b/manager_api_new/doc/SectionMapAllOfMapMapProvider.md @@ -0,0 +1,14 @@ +# manager_api_new.model.SectionMapAllOfMapMapProvider + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/SectionMapAllOfMapMapType.md b/manager_api_new/doc/SectionMapAllOfMapMapType.md new file mode 100644 index 0000000..2594134 --- /dev/null +++ b/manager_api_new/doc/SectionMapAllOfMapMapType.md @@ -0,0 +1,14 @@ +# manager_api_new.model.SectionMapAllOfMapMapType + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/SectionMapAllOfMapResource.md b/manager_api_new/doc/SectionMapAllOfMapResource.md new file mode 100644 index 0000000..4d70802 --- /dev/null +++ b/manager_api_new/doc/SectionMapAllOfMapResource.md @@ -0,0 +1,20 @@ +# manager_api_new.model.SectionMapAllOfMapResource + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**type** | [**ResourceType**](ResourceType.md) | | +**label** | **String** | | +**instanceId** | **String** | | +**dateCreation** | [**DateTime**](DateTime.md) | | [optional] +**url** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/SectionMapAllOfMapTypeMapbox.md b/manager_api_new/doc/SectionMapAllOfMapTypeMapbox.md new file mode 100644 index 0000000..1998288 --- /dev/null +++ b/manager_api_new/doc/SectionMapAllOfMapTypeMapbox.md @@ -0,0 +1,14 @@ +# manager_api_new.model.SectionMapAllOfMapTypeMapbox + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/SectionMapApi.md b/manager_api_new/doc/SectionMapApi.md index 84e4bfe..4d8a73f 100644 --- a/manager_api_new/doc/SectionMapApi.md +++ b/manager_api_new/doc/SectionMapApi.md @@ -5,7 +5,7 @@ import 'package:manager_api_new/api.dart'; ``` -All URIs are relative to *https://localhost:5001* +All URIs are relative to *http://localhost:5000* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -16,7 +16,7 @@ Method | HTTP request | Description # **sectionMapCreate** -> GeoPoint sectionMapCreate(sectionId, geoPointDTO) +> GeoPointDTO sectionMapCreate(sectionId, geoPointDTO) @@ -47,7 +47,7 @@ Name | Type | Description | Notes ### Return type -[**GeoPoint**](GeoPoint.md) +[**GeoPointDTO**](GeoPointDTO.md) ### Authorization diff --git a/manager_api_new/doc/SectionQuiz.md b/manager_api_new/doc/SectionQuiz.md new file mode 100644 index 0000000..0a9e9f6 --- /dev/null +++ b/manager_api_new/doc/SectionQuiz.md @@ -0,0 +1,37 @@ +# manager_api_new.model.SectionQuiz + +## Load the model package +```dart +import 'package:manager_api_new/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | +**label** | **String** | | +**title** | [**List**](TranslationDTO.md) | | [default to const []] +**configurationId** | **String** | | +**type** | [**SectionType**](SectionType.md) | | +**isSubSection** | **bool** | | +**instanceId** | **String** | | +**quizQuestions** | [**List**](QuizQuestion.md) | | [default to const []] +**quizBadLevel** | [**List**](TranslationAndResourceDTO.md) | | [default to const []] +**quizMediumLevel** | [**List**](TranslationAndResourceDTO.md) | | [default to const []] +**quizGoodLevel** | [**List**](TranslationAndResourceDTO.md) | | [default to const []] +**quizGreatLevel** | [**List**](TranslationAndResourceDTO.md) | | [default to const []] +**description** | [**List**](TranslationDTO.md) | | [optional] [default to const []] +**order** | **int** | | [optional] +**imageId** | **String** | | [optional] +**imageSource** | **String** | | [optional] +**parentId** | **String** | | [optional] +**dateCreation** | [**DateTime**](DateTime.md) | | [optional] +**isBeacon** | **bool** | | [optional] +**beaconId** | **int** | | [optional] +**latitude** | **String** | | [optional] +**longitude** | **String** | | [optional] +**meterZoneGPS** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/manager_api_new/doc/SectionQuizApi.md b/manager_api_new/doc/SectionQuizApi.md index f3a69a0..2b8ae38 100644 --- a/manager_api_new/doc/SectionQuizApi.md +++ b/manager_api_new/doc/SectionQuizApi.md @@ -5,7 +5,7 @@ import 'package:manager_api_new/api.dart'; ``` -All URIs are relative to *https://localhost:5001* +All URIs are relative to *http://localhost:5000* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/manager_api_new/doc/UserApi.md b/manager_api_new/doc/UserApi.md index c46e856..05129f6 100644 --- a/manager_api_new/doc/UserApi.md +++ b/manager_api_new/doc/UserApi.md @@ -5,7 +5,7 @@ import 'package:manager_api_new/api.dart'; ``` -All URIs are relative to *https://localhost:5001* +All URIs are relative to *http://localhost:5000* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/manager_api_new/lib/api.dart b/manager_api_new/lib/api.dart index 245f4f7..51455aa 100644 --- a/manager_api_new/lib/api.dart +++ b/manager_api_new/lib/api.dart @@ -50,6 +50,7 @@ part 'model/device_detail_dto.dart'; part 'model/export_configuration_dto.dart'; part 'model/geo_point.dart'; part 'model/geo_point_dto.dart'; +part 'model/geo_point_section_map.dart'; part 'model/instance.dart'; part 'model/instance_dto.dart'; part 'model/login_dto.dart'; @@ -70,12 +71,19 @@ part 'model/question_dto.dart'; part 'model/question_dto_image_background_resource_type.dart'; part 'model/quiz_dto.dart'; part 'model/quiz_question.dart'; -part 'model/quiz_question_resource.dart'; +part 'model/quiz_question_section_quiz.dart'; part 'model/resource.dart'; part 'model/resource_dto.dart'; part 'model/resource_type.dart'; part 'model/response_dto.dart'; +part 'model/section.dart'; part 'model/section_dto.dart'; +part 'model/section_map.dart'; +part 'model/section_map_all_of_map_map_provider.dart'; +part 'model/section_map_all_of_map_map_type.dart'; +part 'model/section_map_all_of_map_resource.dart'; +part 'model/section_map_all_of_map_type_mapbox.dart'; +part 'model/section_quiz.dart'; part 'model/section_type.dart'; part 'model/slider_dto.dart'; part 'model/token_dto.dart'; diff --git a/manager_api_new/lib/api/section_map_api.dart b/manager_api_new/lib/api/section_map_api.dart index 51895f0..2fd0f88 100644 --- a/manager_api_new/lib/api/section_map_api.dart +++ b/manager_api_new/lib/api/section_map_api.dart @@ -55,7 +55,7 @@ class SectionMapApi { /// * [String] sectionId (required): /// /// * [GeoPointDTO] geoPointDTO (required): - Future sectionMapCreate( + Future sectionMapCreate( String sectionId, GeoPointDTO geoPointDTO, ) async { @@ -73,8 +73,8 @@ class SectionMapApi { response.statusCode != HttpStatus.noContent) { return await apiClient.deserializeAsync( await _decodeBodyBytes(response), - 'GeoPoint', - ) as GeoPoint; + 'GeoPointDTO', + ) as GeoPointDTO; } return null; } diff --git a/manager_api_new/lib/api_client.dart b/manager_api_new/lib/api_client.dart index 35cdef5..bf35150 100644 --- a/manager_api_new/lib/api_client.dart +++ b/manager_api_new/lib/api_client.dart @@ -12,7 +12,7 @@ part of openapi.api; class ApiClient { ApiClient({ - this.basePath = 'https://localhost:5001', + this.basePath = 'http://localhost:5000', this.authentication, }); @@ -253,6 +253,8 @@ class ApiClient { return GeoPoint.fromJson(value); case 'GeoPointDTO': return GeoPointDTO.fromJson(value); + case 'GeoPointSectionMap': + return GeoPointSectionMap.fromJson(value); case 'Instance': return Instance.fromJson(value); case 'InstanceDTO': @@ -293,8 +295,8 @@ class ApiClient { return QuizDTO.fromJson(value); case 'QuizQuestion': return QuizQuestion.fromJson(value); - case 'QuizQuestionResource': - return QuizQuestionResource.fromJson(value); + case 'QuizQuestionSectionQuiz': + return QuizQuestionSectionQuiz.fromJson(value); case 'Resource': return Resource.fromJson(value); case 'ResourceDTO': @@ -303,8 +305,22 @@ class ApiClient { return ResourceTypeTypeTransformer().decode(value); case 'ResponseDTO': return ResponseDTO.fromJson(value); + case 'Section': + return Section.fromJson(value); case 'SectionDTO': return SectionDTO.fromJson(value); + case 'SectionMap': + return SectionMap.fromJson(value); + case 'SectionMapAllOfMapMapProvider': + return SectionMapAllOfMapMapProvider.fromJson(value); + case 'SectionMapAllOfMapMapType': + return SectionMapAllOfMapMapType.fromJson(value); + case 'SectionMapAllOfMapResource': + return SectionMapAllOfMapResource.fromJson(value); + case 'SectionMapAllOfMapTypeMapbox': + return SectionMapAllOfMapTypeMapbox.fromJson(value); + case 'SectionQuiz': + return SectionQuiz.fromJson(value); case 'SectionType': return SectionTypeTypeTransformer().decode(value); case 'SliderDTO': diff --git a/manager_api_new/lib/model/geo_point.dart b/manager_api_new/lib/model/geo_point.dart index bce1aa0..955c841 100644 --- a/manager_api_new/lib/model/geo_point.dart +++ b/manager_api_new/lib/model/geo_point.dart @@ -27,6 +27,8 @@ class GeoPoint { this.longitude, this.imageResourceId, this.imageUrl, + this.sectionMapId, + this.sectionMap, }); int id; @@ -57,6 +59,10 @@ class GeoPoint { String? imageUrl; + String? sectionMapId; + + GeoPointSectionMap? sectionMap; + @override bool operator ==(Object other) => identical(this, other) || @@ -74,7 +80,9 @@ class GeoPoint { other.latitude == latitude && other.longitude == longitude && other.imageResourceId == imageResourceId && - other.imageUrl == imageUrl; + other.imageUrl == imageUrl && + other.sectionMapId == sectionMapId && + other.sectionMap == sectionMap; @override int get hashCode => @@ -92,11 +100,13 @@ class GeoPoint { (latitude == null ? 0 : latitude!.hashCode) + (longitude == null ? 0 : longitude!.hashCode) + (imageResourceId == null ? 0 : imageResourceId!.hashCode) + - (imageUrl == null ? 0 : imageUrl!.hashCode); + (imageUrl == null ? 0 : imageUrl!.hashCode) + + (sectionMapId == null ? 0 : sectionMapId!.hashCode) + + (sectionMap == null ? 0 : sectionMap!.hashCode); @override String toString() => - 'GeoPoint[id=$id, title=$title, description=$description, contents=$contents, schedules=$schedules, prices=$prices, phone=$phone, email=$email, site=$site, categorieId=$categorieId, latitude=$latitude, longitude=$longitude, imageResourceId=$imageResourceId, imageUrl=$imageUrl]'; + 'GeoPoint[id=$id, title=$title, description=$description, contents=$contents, schedules=$schedules, prices=$prices, phone=$phone, email=$email, site=$site, categorieId=$categorieId, latitude=$latitude, longitude=$longitude, imageResourceId=$imageResourceId, imageUrl=$imageUrl, sectionMapId=$sectionMapId, sectionMap=$sectionMap]'; Map toJson() { final json = {}; @@ -134,6 +144,16 @@ class GeoPoint { } else { json[r'imageUrl'] = null; } + if (this.sectionMapId != null) { + json[r'sectionMapId'] = this.sectionMapId; + } else { + json[r'sectionMapId'] = null; + } + if (this.sectionMap != null) { + json[r'sectionMap'] = this.sectionMap; + } else { + json[r'sectionMap'] = null; + } return json; } @@ -172,6 +192,8 @@ class GeoPoint { longitude: mapValueOfType(json, r'longitude'), imageResourceId: mapValueOfType(json, r'imageResourceId'), imageUrl: mapValueOfType(json, r'imageUrl'), + sectionMapId: mapValueOfType(json, r'sectionMapId'), + sectionMap: GeoPointSectionMap.fromJson(json[r'sectionMap']), ); } return null; diff --git a/manager_api_new/lib/model/geo_point_section_map.dart b/manager_api_new/lib/model/geo_point_section_map.dart new file mode 100644 index 0000000..c9a7653 --- /dev/null +++ b/manager_api_new/lib/model/geo_point_section_map.dart @@ -0,0 +1,424 @@ +// +// 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 GeoPointSectionMap { + /// Returns a new [GeoPointSectionMap] instance. + GeoPointSectionMap({ + required this.id, + required this.label, + this.title = const [], + required this.configurationId, + required this.type, + required this.isSubSection, + required this.instanceId, + this.mapCategories = const [], + this.description = const [], + this.order, + this.imageId, + this.imageSource, + this.parentId, + this.dateCreation, + this.isBeacon, + this.beaconId, + this.latitude, + this.longitude, + this.meterZoneGPS, + this.mapZoom, + this.mapMapType, + this.mapTypeMapbox, + this.mapMapProvider, + this.mapPoints = const [], + this.mapResourceId, + this.mapResource, + this.mapCenterLatitude, + this.mapCenterLongitude, + }); + + String id; + + String label; + + List title; + + String configurationId; + + SectionType type; + + bool isSubSection; + + String instanceId; + + List mapCategories; + + List? description; + + /// + /// 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; + + String? imageId; + + String? imageSource; + + String? parentId; + + /// + /// 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. + /// + DateTime? dateCreation; + + /// + /// 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? isBeacon; + + int? beaconId; + + String? latitude; + + String? longitude; + + int? meterZoneGPS; + + /// + /// 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? mapZoom; + + SectionMapAllOfMapMapType? mapMapType; + + SectionMapAllOfMapTypeMapbox? mapTypeMapbox; + + SectionMapAllOfMapMapProvider? mapMapProvider; + + List? mapPoints; + + String? mapResourceId; + + SectionMapAllOfMapResource? mapResource; + + String? mapCenterLatitude; + + String? mapCenterLongitude; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GeoPointSectionMap && + other.id == id && + other.label == label && + _deepEquality.equals(other.title, title) && + other.configurationId == configurationId && + other.type == type && + other.isSubSection == isSubSection && + other.instanceId == instanceId && + _deepEquality.equals(other.mapCategories, mapCategories) && + _deepEquality.equals(other.description, description) && + other.order == order && + other.imageId == imageId && + other.imageSource == imageSource && + other.parentId == parentId && + other.dateCreation == dateCreation && + other.isBeacon == isBeacon && + other.beaconId == beaconId && + other.latitude == latitude && + other.longitude == longitude && + other.meterZoneGPS == meterZoneGPS && + other.mapZoom == mapZoom && + other.mapMapType == mapMapType && + other.mapTypeMapbox == mapTypeMapbox && + other.mapMapProvider == mapMapProvider && + _deepEquality.equals(other.mapPoints, mapPoints) && + other.mapResourceId == mapResourceId && + other.mapResource == mapResource && + other.mapCenterLatitude == mapCenterLatitude && + other.mapCenterLongitude == mapCenterLongitude; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (id.hashCode) + + (label.hashCode) + + (title.hashCode) + + (configurationId.hashCode) + + (type.hashCode) + + (isSubSection.hashCode) + + (instanceId.hashCode) + + (mapCategories.hashCode) + + (description == null ? 0 : description!.hashCode) + + (order == null ? 0 : order!.hashCode) + + (imageId == null ? 0 : imageId!.hashCode) + + (imageSource == null ? 0 : imageSource!.hashCode) + + (parentId == null ? 0 : parentId!.hashCode) + + (dateCreation == null ? 0 : dateCreation!.hashCode) + + (isBeacon == null ? 0 : isBeacon!.hashCode) + + (beaconId == null ? 0 : beaconId!.hashCode) + + (latitude == null ? 0 : latitude!.hashCode) + + (longitude == null ? 0 : longitude!.hashCode) + + (meterZoneGPS == null ? 0 : meterZoneGPS!.hashCode) + + (mapZoom == null ? 0 : mapZoom!.hashCode) + + (mapMapType == null ? 0 : mapMapType!.hashCode) + + (mapTypeMapbox == null ? 0 : mapTypeMapbox!.hashCode) + + (mapMapProvider == null ? 0 : mapMapProvider!.hashCode) + + (mapPoints == null ? 0 : mapPoints!.hashCode) + + (mapResourceId == null ? 0 : mapResourceId!.hashCode) + + (mapResource == null ? 0 : mapResource!.hashCode) + + (mapCenterLatitude == null ? 0 : mapCenterLatitude!.hashCode) + + (mapCenterLongitude == null ? 0 : mapCenterLongitude!.hashCode); + + @override + String toString() => + 'GeoPointSectionMap[id=$id, label=$label, title=$title, configurationId=$configurationId, type=$type, isSubSection=$isSubSection, instanceId=$instanceId, mapCategories=$mapCategories, description=$description, order=$order, imageId=$imageId, imageSource=$imageSource, parentId=$parentId, dateCreation=$dateCreation, isBeacon=$isBeacon, beaconId=$beaconId, latitude=$latitude, longitude=$longitude, meterZoneGPS=$meterZoneGPS, mapZoom=$mapZoom, mapMapType=$mapMapType, mapTypeMapbox=$mapTypeMapbox, mapMapProvider=$mapMapProvider, mapPoints=$mapPoints, mapResourceId=$mapResourceId, mapResource=$mapResource, mapCenterLatitude=$mapCenterLatitude, mapCenterLongitude=$mapCenterLongitude]'; + + Map toJson() { + final json = {}; + json[r'id'] = this.id; + json[r'label'] = this.label; + json[r'title'] = this.title; + json[r'configurationId'] = this.configurationId; + json[r'type'] = this.type; + json[r'isSubSection'] = this.isSubSection; + json[r'instanceId'] = this.instanceId; + json[r'mapCategories'] = this.mapCategories; + if (this.description != null) { + json[r'description'] = this.description; + } else { + json[r'description'] = null; + } + if (this.order != null) { + json[r'order'] = this.order; + } else { + json[r'order'] = null; + } + if (this.imageId != null) { + json[r'imageId'] = this.imageId; + } else { + json[r'imageId'] = null; + } + if (this.imageSource != null) { + json[r'imageSource'] = this.imageSource; + } else { + json[r'imageSource'] = null; + } + if (this.parentId != null) { + json[r'parentId'] = this.parentId; + } else { + json[r'parentId'] = null; + } + if (this.dateCreation != null) { + json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String(); + } else { + json[r'dateCreation'] = null; + } + if (this.isBeacon != null) { + json[r'isBeacon'] = this.isBeacon; + } else { + json[r'isBeacon'] = null; + } + if (this.beaconId != null) { + json[r'beaconId'] = this.beaconId; + } else { + json[r'beaconId'] = null; + } + if (this.latitude != null) { + json[r'latitude'] = this.latitude; + } else { + json[r'latitude'] = null; + } + if (this.longitude != null) { + json[r'longitude'] = this.longitude; + } else { + json[r'longitude'] = null; + } + if (this.meterZoneGPS != null) { + json[r'meterZoneGPS'] = this.meterZoneGPS; + } else { + json[r'meterZoneGPS'] = null; + } + if (this.mapZoom != null) { + json[r'mapZoom'] = this.mapZoom; + } else { + json[r'mapZoom'] = null; + } + if (this.mapMapType != null) { + json[r'mapMapType'] = this.mapMapType; + } else { + json[r'mapMapType'] = null; + } + if (this.mapTypeMapbox != null) { + json[r'mapTypeMapbox'] = this.mapTypeMapbox; + } else { + json[r'mapTypeMapbox'] = null; + } + if (this.mapMapProvider != null) { + json[r'mapMapProvider'] = this.mapMapProvider; + } else { + json[r'mapMapProvider'] = null; + } + if (this.mapPoints != null) { + json[r'mapPoints'] = this.mapPoints; + } else { + json[r'mapPoints'] = null; + } + if (this.mapResourceId != null) { + json[r'mapResourceId'] = this.mapResourceId; + } else { + json[r'mapResourceId'] = null; + } + if (this.mapResource != null) { + json[r'mapResource'] = this.mapResource; + } else { + json[r'mapResource'] = null; + } + if (this.mapCenterLatitude != null) { + json[r'mapCenterLatitude'] = this.mapCenterLatitude; + } else { + json[r'mapCenterLatitude'] = null; + } + if (this.mapCenterLongitude != null) { + json[r'mapCenterLongitude'] = this.mapCenterLongitude; + } else { + json[r'mapCenterLongitude'] = null; + } + return json; + } + + /// Returns a new [GeoPointSectionMap] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GeoPointSectionMap? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // 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 "GeoPointSectionMap[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "GeoPointSectionMap[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GeoPointSectionMap( + id: mapValueOfType(json, r'id')!, + label: mapValueOfType(json, r'label')!, + title: TranslationDTO.listFromJson(json[r'title']), + configurationId: mapValueOfType(json, r'configurationId')!, + type: SectionType.fromJson(json[r'type'])!, + isSubSection: mapValueOfType(json, r'isSubSection')!, + instanceId: mapValueOfType(json, r'instanceId')!, + mapCategories: CategorieDTO.listFromJson(json[r'mapCategories']), + description: TranslationDTO.listFromJson(json[r'description']), + order: mapValueOfType(json, r'order'), + imageId: mapValueOfType(json, r'imageId'), + imageSource: mapValueOfType(json, r'imageSource'), + parentId: mapValueOfType(json, r'parentId'), + dateCreation: mapDateTime(json, r'dateCreation', r''), + isBeacon: mapValueOfType(json, r'isBeacon'), + beaconId: mapValueOfType(json, r'beaconId'), + latitude: mapValueOfType(json, r'latitude'), + longitude: mapValueOfType(json, r'longitude'), + meterZoneGPS: mapValueOfType(json, r'meterZoneGPS'), + mapZoom: mapValueOfType(json, r'mapZoom'), + mapMapType: SectionMapAllOfMapMapType.fromJson(json[r'mapMapType']), + mapTypeMapbox: + SectionMapAllOfMapTypeMapbox.fromJson(json[r'mapTypeMapbox']), + mapMapProvider: + SectionMapAllOfMapMapProvider.fromJson(json[r'mapMapProvider']), + mapPoints: GeoPoint.listFromJson(json[r'mapPoints']), + mapResourceId: mapValueOfType(json, r'mapResourceId'), + mapResource: SectionMapAllOfMapResource.fromJson(json[r'mapResource']), + mapCenterLatitude: mapValueOfType(json, r'mapCenterLatitude'), + mapCenterLongitude: mapValueOfType(json, r'mapCenterLongitude'), + ); + } + return null; + } + + static List listFromJson( + dynamic json, { + bool growable = false, + }) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = GeoPointSectionMap.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = GeoPointSectionMap.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GeoPointSectionMap-objects as value to a dart map + static Map> mapListFromJson( + dynamic json, { + bool growable = false, + }) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = GeoPointSectionMap.listFromJson( + entry.value, + growable: growable, + ); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + 'id', + 'label', + 'title', + 'configurationId', + 'type', + 'isSubSection', + 'instanceId', + 'mapCategories', + }; +} diff --git a/manager_api_new/lib/model/quiz_question.dart b/manager_api_new/lib/model/quiz_question.dart index a79b1ed..5a34217 100644 --- a/manager_api_new/lib/model/quiz_question.dart +++ b/manager_api_new/lib/model/quiz_question.dart @@ -19,6 +19,8 @@ class QuizQuestion { this.resourceId, this.resource, this.order, + this.sectionQuizId, + this.sectionQuiz, }); int id; @@ -29,7 +31,7 @@ class QuizQuestion { String? resourceId; - QuizQuestionResource? resource; + Resource? resource; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -39,6 +41,10 @@ class QuizQuestion { /// int? order; + String? sectionQuizId; + + QuizQuestionSectionQuiz? sectionQuiz; + @override bool operator ==(Object other) => identical(this, other) || @@ -48,7 +54,9 @@ class QuizQuestion { _deepEquality.equals(other.responses, responses) && other.resourceId == resourceId && other.resource == resource && - other.order == order; + other.order == order && + other.sectionQuizId == sectionQuizId && + other.sectionQuiz == sectionQuiz; @override int get hashCode => @@ -58,11 +66,13 @@ class QuizQuestion { (responses.hashCode) + (resourceId == null ? 0 : resourceId!.hashCode) + (resource == null ? 0 : resource!.hashCode) + - (order == null ? 0 : order!.hashCode); + (order == null ? 0 : order!.hashCode) + + (sectionQuizId == null ? 0 : sectionQuizId!.hashCode) + + (sectionQuiz == null ? 0 : sectionQuiz!.hashCode); @override String toString() => - 'QuizQuestion[id=$id, label=$label, responses=$responses, resourceId=$resourceId, resource=$resource, order=$order]'; + 'QuizQuestion[id=$id, label=$label, responses=$responses, resourceId=$resourceId, resource=$resource, order=$order, sectionQuizId=$sectionQuizId, sectionQuiz=$sectionQuiz]'; Map toJson() { final json = {}; @@ -84,6 +94,16 @@ class QuizQuestion { } else { json[r'order'] = null; } + if (this.sectionQuizId != null) { + json[r'sectionQuizId'] = this.sectionQuizId; + } else { + json[r'sectionQuizId'] = null; + } + if (this.sectionQuiz != null) { + json[r'sectionQuiz'] = this.sectionQuiz; + } else { + json[r'sectionQuiz'] = null; + } return json; } @@ -112,8 +132,10 @@ class QuizQuestion { label: TranslationAndResourceDTO.listFromJson(json[r'label']), responses: ResponseDTO.listFromJson(json[r'responses']), resourceId: mapValueOfType(json, r'resourceId'), - resource: QuizQuestionResource.fromJson(json[r'resource']), + resource: Resource.fromJson(json[r'resource']), order: mapValueOfType(json, r'order'), + sectionQuizId: mapValueOfType(json, r'sectionQuizId'), + sectionQuiz: QuizQuestionSectionQuiz.fromJson(json[r'sectionQuiz']), ); } return null; diff --git a/manager_api_new/lib/model/quiz_question_section_quiz.dart b/manager_api_new/lib/model/quiz_question_section_quiz.dart new file mode 100644 index 0000000..44c9be4 --- /dev/null +++ b/manager_api_new/lib/model/quiz_question_section_quiz.dart @@ -0,0 +1,353 @@ +// +// 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 QuizQuestionSectionQuiz { + /// Returns a new [QuizQuestionSectionQuiz] instance. + QuizQuestionSectionQuiz({ + required this.id, + required this.label, + this.title = const [], + required this.configurationId, + required this.type, + required this.isSubSection, + required this.instanceId, + this.quizQuestions = const [], + this.quizBadLevel = const [], + this.quizMediumLevel = const [], + this.quizGoodLevel = const [], + this.quizGreatLevel = const [], + this.description = const [], + this.order, + this.imageId, + this.imageSource, + this.parentId, + this.dateCreation, + this.isBeacon, + this.beaconId, + this.latitude, + this.longitude, + this.meterZoneGPS, + }); + + String id; + + String label; + + List title; + + String configurationId; + + SectionType type; + + bool isSubSection; + + String instanceId; + + List quizQuestions; + + List quizBadLevel; + + List quizMediumLevel; + + List quizGoodLevel; + + List quizGreatLevel; + + List? description; + + /// + /// 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; + + String? imageId; + + String? imageSource; + + String? parentId; + + /// + /// 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. + /// + DateTime? dateCreation; + + /// + /// 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? isBeacon; + + int? beaconId; + + String? latitude; + + String? longitude; + + int? meterZoneGPS; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is QuizQuestionSectionQuiz && + other.id == id && + other.label == label && + _deepEquality.equals(other.title, title) && + other.configurationId == configurationId && + other.type == type && + other.isSubSection == isSubSection && + other.instanceId == instanceId && + _deepEquality.equals(other.quizQuestions, quizQuestions) && + _deepEquality.equals(other.quizBadLevel, quizBadLevel) && + _deepEquality.equals(other.quizMediumLevel, quizMediumLevel) && + _deepEquality.equals(other.quizGoodLevel, quizGoodLevel) && + _deepEquality.equals(other.quizGreatLevel, quizGreatLevel) && + _deepEquality.equals(other.description, description) && + other.order == order && + other.imageId == imageId && + other.imageSource == imageSource && + other.parentId == parentId && + other.dateCreation == dateCreation && + other.isBeacon == isBeacon && + other.beaconId == beaconId && + other.latitude == latitude && + other.longitude == longitude && + other.meterZoneGPS == meterZoneGPS; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (id.hashCode) + + (label.hashCode) + + (title.hashCode) + + (configurationId.hashCode) + + (type.hashCode) + + (isSubSection.hashCode) + + (instanceId.hashCode) + + (quizQuestions.hashCode) + + (quizBadLevel.hashCode) + + (quizMediumLevel.hashCode) + + (quizGoodLevel.hashCode) + + (quizGreatLevel.hashCode) + + (description == null ? 0 : description!.hashCode) + + (order == null ? 0 : order!.hashCode) + + (imageId == null ? 0 : imageId!.hashCode) + + (imageSource == null ? 0 : imageSource!.hashCode) + + (parentId == null ? 0 : parentId!.hashCode) + + (dateCreation == null ? 0 : dateCreation!.hashCode) + + (isBeacon == null ? 0 : isBeacon!.hashCode) + + (beaconId == null ? 0 : beaconId!.hashCode) + + (latitude == null ? 0 : latitude!.hashCode) + + (longitude == null ? 0 : longitude!.hashCode) + + (meterZoneGPS == null ? 0 : meterZoneGPS!.hashCode); + + @override + String toString() => + 'QuizQuestionSectionQuiz[id=$id, label=$label, title=$title, configurationId=$configurationId, type=$type, isSubSection=$isSubSection, instanceId=$instanceId, quizQuestions=$quizQuestions, quizBadLevel=$quizBadLevel, quizMediumLevel=$quizMediumLevel, quizGoodLevel=$quizGoodLevel, quizGreatLevel=$quizGreatLevel, description=$description, order=$order, imageId=$imageId, imageSource=$imageSource, parentId=$parentId, dateCreation=$dateCreation, isBeacon=$isBeacon, beaconId=$beaconId, latitude=$latitude, longitude=$longitude, meterZoneGPS=$meterZoneGPS]'; + + Map toJson() { + final json = {}; + json[r'id'] = this.id; + json[r'label'] = this.label; + json[r'title'] = this.title; + json[r'configurationId'] = this.configurationId; + json[r'type'] = this.type; + json[r'isSubSection'] = this.isSubSection; + json[r'instanceId'] = this.instanceId; + json[r'quizQuestions'] = this.quizQuestions; + json[r'quizBadLevel'] = this.quizBadLevel; + json[r'quizMediumLevel'] = this.quizMediumLevel; + json[r'quizGoodLevel'] = this.quizGoodLevel; + json[r'quizGreatLevel'] = this.quizGreatLevel; + if (this.description != null) { + json[r'description'] = this.description; + } else { + json[r'description'] = null; + } + if (this.order != null) { + json[r'order'] = this.order; + } else { + json[r'order'] = null; + } + if (this.imageId != null) { + json[r'imageId'] = this.imageId; + } else { + json[r'imageId'] = null; + } + if (this.imageSource != null) { + json[r'imageSource'] = this.imageSource; + } else { + json[r'imageSource'] = null; + } + if (this.parentId != null) { + json[r'parentId'] = this.parentId; + } else { + json[r'parentId'] = null; + } + if (this.dateCreation != null) { + json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String(); + } else { + json[r'dateCreation'] = null; + } + if (this.isBeacon != null) { + json[r'isBeacon'] = this.isBeacon; + } else { + json[r'isBeacon'] = null; + } + if (this.beaconId != null) { + json[r'beaconId'] = this.beaconId; + } else { + json[r'beaconId'] = null; + } + if (this.latitude != null) { + json[r'latitude'] = this.latitude; + } else { + json[r'latitude'] = null; + } + if (this.longitude != null) { + json[r'longitude'] = this.longitude; + } else { + json[r'longitude'] = null; + } + if (this.meterZoneGPS != null) { + json[r'meterZoneGPS'] = this.meterZoneGPS; + } else { + json[r'meterZoneGPS'] = null; + } + return json; + } + + /// Returns a new [QuizQuestionSectionQuiz] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static QuizQuestionSectionQuiz? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // 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 "QuizQuestionSectionQuiz[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "QuizQuestionSectionQuiz[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return QuizQuestionSectionQuiz( + id: mapValueOfType(json, r'id')!, + label: mapValueOfType(json, r'label')!, + title: TranslationDTO.listFromJson(json[r'title']), + configurationId: mapValueOfType(json, r'configurationId')!, + type: SectionType.fromJson(json[r'type'])!, + isSubSection: mapValueOfType(json, r'isSubSection')!, + instanceId: mapValueOfType(json, r'instanceId')!, + quizQuestions: QuizQuestion.listFromJson(json[r'quizQuestions']), + quizBadLevel: + TranslationAndResourceDTO.listFromJson(json[r'quizBadLevel']), + quizMediumLevel: + TranslationAndResourceDTO.listFromJson(json[r'quizMediumLevel']), + quizGoodLevel: + TranslationAndResourceDTO.listFromJson(json[r'quizGoodLevel']), + quizGreatLevel: + TranslationAndResourceDTO.listFromJson(json[r'quizGreatLevel']), + description: TranslationDTO.listFromJson(json[r'description']), + order: mapValueOfType(json, r'order'), + imageId: mapValueOfType(json, r'imageId'), + imageSource: mapValueOfType(json, r'imageSource'), + parentId: mapValueOfType(json, r'parentId'), + dateCreation: mapDateTime(json, r'dateCreation', r''), + isBeacon: mapValueOfType(json, r'isBeacon'), + beaconId: mapValueOfType(json, r'beaconId'), + latitude: mapValueOfType(json, r'latitude'), + longitude: mapValueOfType(json, r'longitude'), + meterZoneGPS: mapValueOfType(json, r'meterZoneGPS'), + ); + } + return null; + } + + static List listFromJson( + dynamic json, { + bool growable = false, + }) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = QuizQuestionSectionQuiz.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = QuizQuestionSectionQuiz.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of QuizQuestionSectionQuiz-objects as value to a dart map + static Map> mapListFromJson( + dynamic json, { + bool growable = false, + }) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = QuizQuestionSectionQuiz.listFromJson( + entry.value, + growable: growable, + ); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + 'id', + 'label', + 'title', + 'configurationId', + 'type', + 'isSubSection', + 'instanceId', + 'quizQuestions', + 'quizBadLevel', + 'quizMediumLevel', + 'quizGoodLevel', + 'quizGreatLevel', + }; +} diff --git a/manager_api_new/lib/model/section.dart b/manager_api_new/lib/model/section.dart new file mode 100644 index 0000000..43f6ebe --- /dev/null +++ b/manager_api_new/lib/model/section.dart @@ -0,0 +1,309 @@ +// +// 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 Section { + /// Returns a new [Section] instance. + Section({ + required this.id, + required this.label, + this.title = const [], + required this.configurationId, + required this.type, + required this.isSubSection, + required this.instanceId, + this.description = const [], + this.order, + this.imageId, + this.imageSource, + this.parentId, + this.dateCreation, + this.isBeacon, + this.beaconId, + this.latitude, + this.longitude, + this.meterZoneGPS, + }); + + String id; + + String label; + + List title; + + String configurationId; + + SectionType type; + + bool isSubSection; + + String instanceId; + + List? description; + + /// + /// 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; + + String? imageId; + + String? imageSource; + + String? parentId; + + /// + /// 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. + /// + DateTime? dateCreation; + + /// + /// 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? isBeacon; + + int? beaconId; + + String? latitude; + + String? longitude; + + int? meterZoneGPS; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Section && + other.id == id && + other.label == label && + _deepEquality.equals(other.title, title) && + other.configurationId == configurationId && + other.type == type && + other.isSubSection == isSubSection && + other.instanceId == instanceId && + _deepEquality.equals(other.description, description) && + other.order == order && + other.imageId == imageId && + other.imageSource == imageSource && + other.parentId == parentId && + other.dateCreation == dateCreation && + other.isBeacon == isBeacon && + other.beaconId == beaconId && + other.latitude == latitude && + other.longitude == longitude && + other.meterZoneGPS == meterZoneGPS; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (id.hashCode) + + (label.hashCode) + + (title.hashCode) + + (configurationId.hashCode) + + (type.hashCode) + + (isSubSection.hashCode) + + (instanceId.hashCode) + + (description == null ? 0 : description!.hashCode) + + (order == null ? 0 : order!.hashCode) + + (imageId == null ? 0 : imageId!.hashCode) + + (imageSource == null ? 0 : imageSource!.hashCode) + + (parentId == null ? 0 : parentId!.hashCode) + + (dateCreation == null ? 0 : dateCreation!.hashCode) + + (isBeacon == null ? 0 : isBeacon!.hashCode) + + (beaconId == null ? 0 : beaconId!.hashCode) + + (latitude == null ? 0 : latitude!.hashCode) + + (longitude == null ? 0 : longitude!.hashCode) + + (meterZoneGPS == null ? 0 : meterZoneGPS!.hashCode); + + @override + String toString() => + 'Section[id=$id, label=$label, title=$title, configurationId=$configurationId, type=$type, isSubSection=$isSubSection, instanceId=$instanceId, description=$description, order=$order, imageId=$imageId, imageSource=$imageSource, parentId=$parentId, dateCreation=$dateCreation, isBeacon=$isBeacon, beaconId=$beaconId, latitude=$latitude, longitude=$longitude, meterZoneGPS=$meterZoneGPS]'; + + Map toJson() { + final json = {}; + json[r'id'] = this.id; + json[r'label'] = this.label; + json[r'title'] = this.title; + json[r'configurationId'] = this.configurationId; + json[r'type'] = this.type; + json[r'isSubSection'] = this.isSubSection; + json[r'instanceId'] = this.instanceId; + if (this.description != null) { + json[r'description'] = this.description; + } else { + json[r'description'] = null; + } + if (this.order != null) { + json[r'order'] = this.order; + } else { + json[r'order'] = null; + } + if (this.imageId != null) { + json[r'imageId'] = this.imageId; + } else { + json[r'imageId'] = null; + } + if (this.imageSource != null) { + json[r'imageSource'] = this.imageSource; + } else { + json[r'imageSource'] = null; + } + if (this.parentId != null) { + json[r'parentId'] = this.parentId; + } else { + json[r'parentId'] = null; + } + if (this.dateCreation != null) { + json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String(); + } else { + json[r'dateCreation'] = null; + } + if (this.isBeacon != null) { + json[r'isBeacon'] = this.isBeacon; + } else { + json[r'isBeacon'] = null; + } + if (this.beaconId != null) { + json[r'beaconId'] = this.beaconId; + } else { + json[r'beaconId'] = null; + } + if (this.latitude != null) { + json[r'latitude'] = this.latitude; + } else { + json[r'latitude'] = null; + } + if (this.longitude != null) { + json[r'longitude'] = this.longitude; + } else { + json[r'longitude'] = null; + } + if (this.meterZoneGPS != null) { + json[r'meterZoneGPS'] = this.meterZoneGPS; + } else { + json[r'meterZoneGPS'] = null; + } + return json; + } + + /// Returns a new [Section] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static Section? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // 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 "Section[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "Section[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return Section( + id: mapValueOfType(json, r'id')!, + label: mapValueOfType(json, r'label')!, + title: TranslationDTO.listFromJson(json[r'title']), + configurationId: mapValueOfType(json, r'configurationId')!, + type: SectionType.fromJson(json[r'type'])!, + isSubSection: mapValueOfType(json, r'isSubSection')!, + instanceId: mapValueOfType(json, r'instanceId')!, + description: TranslationDTO.listFromJson(json[r'description']), + order: mapValueOfType(json, r'order'), + imageId: mapValueOfType(json, r'imageId'), + imageSource: mapValueOfType(json, r'imageSource'), + parentId: mapValueOfType(json, r'parentId'), + dateCreation: mapDateTime(json, r'dateCreation', r''), + isBeacon: mapValueOfType(json, r'isBeacon'), + beaconId: mapValueOfType(json, r'beaconId'), + latitude: mapValueOfType(json, r'latitude'), + longitude: mapValueOfType(json, r'longitude'), + meterZoneGPS: mapValueOfType(json, r'meterZoneGPS'), + ); + } + return null; + } + + static List
listFromJson( + dynamic json, { + bool growable = false, + }) { + final result =
[]; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = Section.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = Section.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of Section-objects as value to a dart map + static Map> mapListFromJson( + dynamic json, { + bool growable = false, + }) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = Section.listFromJson( + entry.value, + growable: growable, + ); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + 'id', + 'label', + 'title', + 'configurationId', + 'type', + 'isSubSection', + 'instanceId', + }; +} diff --git a/manager_api_new/lib/model/section_map.dart b/manager_api_new/lib/model/section_map.dart new file mode 100644 index 0000000..770b757 --- /dev/null +++ b/manager_api_new/lib/model/section_map.dart @@ -0,0 +1,424 @@ +// +// 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 SectionMap { + /// Returns a new [SectionMap] instance. + SectionMap({ + required this.id, + required this.label, + this.title = const [], + required this.configurationId, + required this.type, + required this.isSubSection, + required this.instanceId, + this.mapCategories = const [], + this.description = const [], + this.order, + this.imageId, + this.imageSource, + this.parentId, + this.dateCreation, + this.isBeacon, + this.beaconId, + this.latitude, + this.longitude, + this.meterZoneGPS, + this.mapZoom, + this.mapMapType, + this.mapTypeMapbox, + this.mapMapProvider, + this.mapPoints = const [], + this.mapResourceId, + this.mapResource, + this.mapCenterLatitude, + this.mapCenterLongitude, + }); + + String id; + + String label; + + List title; + + String configurationId; + + SectionType type; + + bool isSubSection; + + String instanceId; + + List mapCategories; + + List? description; + + /// + /// 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; + + String? imageId; + + String? imageSource; + + String? parentId; + + /// + /// 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. + /// + DateTime? dateCreation; + + /// + /// 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? isBeacon; + + int? beaconId; + + String? latitude; + + String? longitude; + + int? meterZoneGPS; + + /// + /// 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? mapZoom; + + SectionMapAllOfMapMapType? mapMapType; + + SectionMapAllOfMapTypeMapbox? mapTypeMapbox; + + SectionMapAllOfMapMapProvider? mapMapProvider; + + List? mapPoints; + + String? mapResourceId; + + SectionMapAllOfMapResource? mapResource; + + String? mapCenterLatitude; + + String? mapCenterLongitude; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SectionMap && + other.id == id && + other.label == label && + _deepEquality.equals(other.title, title) && + other.configurationId == configurationId && + other.type == type && + other.isSubSection == isSubSection && + other.instanceId == instanceId && + _deepEquality.equals(other.mapCategories, mapCategories) && + _deepEquality.equals(other.description, description) && + other.order == order && + other.imageId == imageId && + other.imageSource == imageSource && + other.parentId == parentId && + other.dateCreation == dateCreation && + other.isBeacon == isBeacon && + other.beaconId == beaconId && + other.latitude == latitude && + other.longitude == longitude && + other.meterZoneGPS == meterZoneGPS && + other.mapZoom == mapZoom && + other.mapMapType == mapMapType && + other.mapTypeMapbox == mapTypeMapbox && + other.mapMapProvider == mapMapProvider && + _deepEquality.equals(other.mapPoints, mapPoints) && + other.mapResourceId == mapResourceId && + other.mapResource == mapResource && + other.mapCenterLatitude == mapCenterLatitude && + other.mapCenterLongitude == mapCenterLongitude; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (id.hashCode) + + (label.hashCode) + + (title.hashCode) + + (configurationId.hashCode) + + (type.hashCode) + + (isSubSection.hashCode) + + (instanceId.hashCode) + + (mapCategories.hashCode) + + (description == null ? 0 : description!.hashCode) + + (order == null ? 0 : order!.hashCode) + + (imageId == null ? 0 : imageId!.hashCode) + + (imageSource == null ? 0 : imageSource!.hashCode) + + (parentId == null ? 0 : parentId!.hashCode) + + (dateCreation == null ? 0 : dateCreation!.hashCode) + + (isBeacon == null ? 0 : isBeacon!.hashCode) + + (beaconId == null ? 0 : beaconId!.hashCode) + + (latitude == null ? 0 : latitude!.hashCode) + + (longitude == null ? 0 : longitude!.hashCode) + + (meterZoneGPS == null ? 0 : meterZoneGPS!.hashCode) + + (mapZoom == null ? 0 : mapZoom!.hashCode) + + (mapMapType == null ? 0 : mapMapType!.hashCode) + + (mapTypeMapbox == null ? 0 : mapTypeMapbox!.hashCode) + + (mapMapProvider == null ? 0 : mapMapProvider!.hashCode) + + (mapPoints == null ? 0 : mapPoints!.hashCode) + + (mapResourceId == null ? 0 : mapResourceId!.hashCode) + + (mapResource == null ? 0 : mapResource!.hashCode) + + (mapCenterLatitude == null ? 0 : mapCenterLatitude!.hashCode) + + (mapCenterLongitude == null ? 0 : mapCenterLongitude!.hashCode); + + @override + String toString() => + 'SectionMap[id=$id, label=$label, title=$title, configurationId=$configurationId, type=$type, isSubSection=$isSubSection, instanceId=$instanceId, mapCategories=$mapCategories, description=$description, order=$order, imageId=$imageId, imageSource=$imageSource, parentId=$parentId, dateCreation=$dateCreation, isBeacon=$isBeacon, beaconId=$beaconId, latitude=$latitude, longitude=$longitude, meterZoneGPS=$meterZoneGPS, mapZoom=$mapZoom, mapMapType=$mapMapType, mapTypeMapbox=$mapTypeMapbox, mapMapProvider=$mapMapProvider, mapPoints=$mapPoints, mapResourceId=$mapResourceId, mapResource=$mapResource, mapCenterLatitude=$mapCenterLatitude, mapCenterLongitude=$mapCenterLongitude]'; + + Map toJson() { + final json = {}; + json[r'id'] = this.id; + json[r'label'] = this.label; + json[r'title'] = this.title; + json[r'configurationId'] = this.configurationId; + json[r'type'] = this.type; + json[r'isSubSection'] = this.isSubSection; + json[r'instanceId'] = this.instanceId; + json[r'mapCategories'] = this.mapCategories; + if (this.description != null) { + json[r'description'] = this.description; + } else { + json[r'description'] = null; + } + if (this.order != null) { + json[r'order'] = this.order; + } else { + json[r'order'] = null; + } + if (this.imageId != null) { + json[r'imageId'] = this.imageId; + } else { + json[r'imageId'] = null; + } + if (this.imageSource != null) { + json[r'imageSource'] = this.imageSource; + } else { + json[r'imageSource'] = null; + } + if (this.parentId != null) { + json[r'parentId'] = this.parentId; + } else { + json[r'parentId'] = null; + } + if (this.dateCreation != null) { + json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String(); + } else { + json[r'dateCreation'] = null; + } + if (this.isBeacon != null) { + json[r'isBeacon'] = this.isBeacon; + } else { + json[r'isBeacon'] = null; + } + if (this.beaconId != null) { + json[r'beaconId'] = this.beaconId; + } else { + json[r'beaconId'] = null; + } + if (this.latitude != null) { + json[r'latitude'] = this.latitude; + } else { + json[r'latitude'] = null; + } + if (this.longitude != null) { + json[r'longitude'] = this.longitude; + } else { + json[r'longitude'] = null; + } + if (this.meterZoneGPS != null) { + json[r'meterZoneGPS'] = this.meterZoneGPS; + } else { + json[r'meterZoneGPS'] = null; + } + if (this.mapZoom != null) { + json[r'mapZoom'] = this.mapZoom; + } else { + json[r'mapZoom'] = null; + } + if (this.mapMapType != null) { + json[r'mapMapType'] = this.mapMapType; + } else { + json[r'mapMapType'] = null; + } + if (this.mapTypeMapbox != null) { + json[r'mapTypeMapbox'] = this.mapTypeMapbox; + } else { + json[r'mapTypeMapbox'] = null; + } + if (this.mapMapProvider != null) { + json[r'mapMapProvider'] = this.mapMapProvider; + } else { + json[r'mapMapProvider'] = null; + } + if (this.mapPoints != null) { + json[r'mapPoints'] = this.mapPoints; + } else { + json[r'mapPoints'] = null; + } + if (this.mapResourceId != null) { + json[r'mapResourceId'] = this.mapResourceId; + } else { + json[r'mapResourceId'] = null; + } + if (this.mapResource != null) { + json[r'mapResource'] = this.mapResource; + } else { + json[r'mapResource'] = null; + } + if (this.mapCenterLatitude != null) { + json[r'mapCenterLatitude'] = this.mapCenterLatitude; + } else { + json[r'mapCenterLatitude'] = null; + } + if (this.mapCenterLongitude != null) { + json[r'mapCenterLongitude'] = this.mapCenterLongitude; + } else { + json[r'mapCenterLongitude'] = null; + } + return json; + } + + /// Returns a new [SectionMap] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static SectionMap? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // 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 "SectionMap[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "SectionMap[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return SectionMap( + id: mapValueOfType(json, r'id')!, + label: mapValueOfType(json, r'label')!, + title: TranslationDTO.listFromJson(json[r'title']), + configurationId: mapValueOfType(json, r'configurationId')!, + type: SectionType.fromJson(json[r'type'])!, + isSubSection: mapValueOfType(json, r'isSubSection')!, + instanceId: mapValueOfType(json, r'instanceId')!, + mapCategories: CategorieDTO.listFromJson(json[r'mapCategories']), + description: TranslationDTO.listFromJson(json[r'description']), + order: mapValueOfType(json, r'order'), + imageId: mapValueOfType(json, r'imageId'), + imageSource: mapValueOfType(json, r'imageSource'), + parentId: mapValueOfType(json, r'parentId'), + dateCreation: mapDateTime(json, r'dateCreation', r''), + isBeacon: mapValueOfType(json, r'isBeacon'), + beaconId: mapValueOfType(json, r'beaconId'), + latitude: mapValueOfType(json, r'latitude'), + longitude: mapValueOfType(json, r'longitude'), + meterZoneGPS: mapValueOfType(json, r'meterZoneGPS'), + mapZoom: mapValueOfType(json, r'mapZoom'), + mapMapType: SectionMapAllOfMapMapType.fromJson(json[r'mapMapType']), + mapTypeMapbox: + SectionMapAllOfMapTypeMapbox.fromJson(json[r'mapTypeMapbox']), + mapMapProvider: + SectionMapAllOfMapMapProvider.fromJson(json[r'mapMapProvider']), + mapPoints: GeoPoint.listFromJson(json[r'mapPoints']), + mapResourceId: mapValueOfType(json, r'mapResourceId'), + mapResource: SectionMapAllOfMapResource.fromJson(json[r'mapResource']), + mapCenterLatitude: mapValueOfType(json, r'mapCenterLatitude'), + mapCenterLongitude: mapValueOfType(json, r'mapCenterLongitude'), + ); + } + return null; + } + + static List listFromJson( + dynamic json, { + bool growable = false, + }) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = SectionMap.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = SectionMap.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of SectionMap-objects as value to a dart map + static Map> mapListFromJson( + dynamic json, { + bool growable = false, + }) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = SectionMap.listFromJson( + entry.value, + growable: growable, + ); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + 'id', + 'label', + 'title', + 'configurationId', + 'type', + 'isSubSection', + 'instanceId', + 'mapCategories', + }; +} diff --git a/manager_api_new/lib/model/section_map_all_of_map_map_provider.dart b/manager_api_new/lib/model/section_map_all_of_map_map_provider.dart new file mode 100644 index 0000000..1ba2900 --- /dev/null +++ b/manager_api_new/lib/model/section_map_all_of_map_map_provider.dart @@ -0,0 +1,100 @@ +// +// 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 SectionMapAllOfMapMapProvider { + /// Returns a new [SectionMapAllOfMapMapProvider] instance. + SectionMapAllOfMapMapProvider(); + + /*@override + bool operator ==(Object other) => identical(this, other) || other is SectionMapAllOfMapMapProvider && + + @override + int get hashCode => + // ignore: unnecessary_parenthesis +*/ + @override + String toString() => 'SectionMapAllOfMapMapProvider[]'; + + Map toJson() { + final json = {}; + return json; + } + + /// Returns a new [SectionMapAllOfMapMapProvider] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static SectionMapAllOfMapMapProvider? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // 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 "SectionMapAllOfMapMapProvider[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "SectionMapAllOfMapMapProvider[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return SectionMapAllOfMapMapProvider( + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = SectionMapAllOfMapMapProvider.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = SectionMapAllOfMapMapProvider.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of SectionMapAllOfMapMapProvider-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = SectionMapAllOfMapMapProvider.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} + diff --git a/manager_api_new/lib/model/section_map_all_of_map_map_type.dart b/manager_api_new/lib/model/section_map_all_of_map_map_type.dart new file mode 100644 index 0000000..2bf4aeb --- /dev/null +++ b/manager_api_new/lib/model/section_map_all_of_map_map_type.dart @@ -0,0 +1,100 @@ +// +// 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 SectionMapAllOfMapMapType { + /// Returns a new [SectionMapAllOfMapMapType] instance. + SectionMapAllOfMapMapType(); + + /*@override + bool operator ==(Object other) => identical(this, other) || other is SectionMapAllOfMapMapType && + + @override + int get hashCode => + // ignore: unnecessary_parenthesis +*/ + @override + String toString() => 'SectionMapAllOfMapMapType[]'; + + Map toJson() { + final json = {}; + return json; + } + + /// Returns a new [SectionMapAllOfMapMapType] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static SectionMapAllOfMapMapType? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // 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 "SectionMapAllOfMapMapType[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "SectionMapAllOfMapMapType[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return SectionMapAllOfMapMapType( + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = SectionMapAllOfMapMapType.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = SectionMapAllOfMapMapType.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of SectionMapAllOfMapMapType-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = SectionMapAllOfMapMapType.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} + diff --git a/manager_api_new/lib/model/section_map_all_of_map_resource.dart b/manager_api_new/lib/model/section_map_all_of_map_resource.dart new file mode 100644 index 0000000..3caca1a --- /dev/null +++ b/manager_api_new/lib/model/section_map_all_of_map_resource.dart @@ -0,0 +1,174 @@ +// +// 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 SectionMapAllOfMapResource { + /// Returns a new [SectionMapAllOfMapResource] instance. + SectionMapAllOfMapResource({ + required this.id, + required this.type, + required this.label, + required this.instanceId, + this.dateCreation, + this.url, + }); + + String id; + + ResourceType type; + + String label; + + String instanceId; + + /// + /// 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. + /// + DateTime? dateCreation; + + String? url; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SectionMapAllOfMapResource && + other.id == id && + other.type == type && + other.label == label && + other.instanceId == instanceId && + other.dateCreation == dateCreation && + other.url == url; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (id.hashCode) + + (type.hashCode) + + (label.hashCode) + + (instanceId.hashCode) + + (dateCreation == null ? 0 : dateCreation!.hashCode) + + (url == null ? 0 : url!.hashCode); + + @override + String toString() => + 'SectionMapAllOfMapResource[id=$id, type=$type, label=$label, instanceId=$instanceId, dateCreation=$dateCreation, url=$url]'; + + Map toJson() { + final json = {}; + json[r'id'] = this.id; + json[r'type'] = this.type; + json[r'label'] = this.label; + json[r'instanceId'] = this.instanceId; + if (this.dateCreation != null) { + json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String(); + } else { + json[r'dateCreation'] = null; + } + if (this.url != null) { + json[r'url'] = this.url; + } else { + json[r'url'] = null; + } + return json; + } + + /// Returns a new [SectionMapAllOfMapResource] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static SectionMapAllOfMapResource? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // 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 "SectionMapAllOfMapResource[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "SectionMapAllOfMapResource[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return SectionMapAllOfMapResource( + id: mapValueOfType(json, r'id')!, + type: ResourceType.fromJson(json[r'type'])!, + label: mapValueOfType(json, r'label')!, + instanceId: mapValueOfType(json, r'instanceId')!, + dateCreation: mapDateTime(json, r'dateCreation', r''), + url: mapValueOfType(json, r'url'), + ); + } + return null; + } + + static List listFromJson( + dynamic json, { + bool growable = false, + }) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = SectionMapAllOfMapResource.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = SectionMapAllOfMapResource.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of SectionMapAllOfMapResource-objects as value to a dart map + static Map> mapListFromJson( + dynamic json, { + bool growable = false, + }) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = SectionMapAllOfMapResource.listFromJson( + entry.value, + growable: growable, + ); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + 'id', + 'type', + 'label', + 'instanceId', + }; +} diff --git a/manager_api_new/lib/model/section_map_all_of_map_type_mapbox.dart b/manager_api_new/lib/model/section_map_all_of_map_type_mapbox.dart new file mode 100644 index 0000000..7a01593 --- /dev/null +++ b/manager_api_new/lib/model/section_map_all_of_map_type_mapbox.dart @@ -0,0 +1,100 @@ +// +// 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 SectionMapAllOfMapTypeMapbox { + /// Returns a new [SectionMapAllOfMapTypeMapbox] instance. + SectionMapAllOfMapTypeMapbox(); + + /*@override + bool operator ==(Object other) => identical(this, other) || other is SectionMapAllOfMapTypeMapbox && + + @override + int get hashCode => + // ignore: unnecessary_parenthesis +*/ + @override + String toString() => 'SectionMapAllOfMapTypeMapbox[]'; + + Map toJson() { + final json = {}; + return json; + } + + /// Returns a new [SectionMapAllOfMapTypeMapbox] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static SectionMapAllOfMapTypeMapbox? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // 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 "SectionMapAllOfMapTypeMapbox[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "SectionMapAllOfMapTypeMapbox[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return SectionMapAllOfMapTypeMapbox( + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = SectionMapAllOfMapTypeMapbox.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = SectionMapAllOfMapTypeMapbox.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of SectionMapAllOfMapTypeMapbox-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = SectionMapAllOfMapTypeMapbox.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} + diff --git a/manager_api_new/lib/model/section_quiz.dart b/manager_api_new/lib/model/section_quiz.dart new file mode 100644 index 0000000..43861f1 --- /dev/null +++ b/manager_api_new/lib/model/section_quiz.dart @@ -0,0 +1,353 @@ +// +// 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 SectionQuiz { + /// Returns a new [SectionQuiz] instance. + SectionQuiz({ + required this.id, + required this.label, + this.title = const [], + required this.configurationId, + required this.type, + required this.isSubSection, + required this.instanceId, + this.quizQuestions = const [], + this.quizBadLevel = const [], + this.quizMediumLevel = const [], + this.quizGoodLevel = const [], + this.quizGreatLevel = const [], + this.description = const [], + this.order, + this.imageId, + this.imageSource, + this.parentId, + this.dateCreation, + this.isBeacon, + this.beaconId, + this.latitude, + this.longitude, + this.meterZoneGPS, + }); + + String id; + + String label; + + List title; + + String configurationId; + + SectionType type; + + bool isSubSection; + + String instanceId; + + List quizQuestions; + + List quizBadLevel; + + List quizMediumLevel; + + List quizGoodLevel; + + List quizGreatLevel; + + List? description; + + /// + /// 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; + + String? imageId; + + String? imageSource; + + String? parentId; + + /// + /// 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. + /// + DateTime? dateCreation; + + /// + /// 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? isBeacon; + + int? beaconId; + + String? latitude; + + String? longitude; + + int? meterZoneGPS; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SectionQuiz && + other.id == id && + other.label == label && + _deepEquality.equals(other.title, title) && + other.configurationId == configurationId && + other.type == type && + other.isSubSection == isSubSection && + other.instanceId == instanceId && + _deepEquality.equals(other.quizQuestions, quizQuestions) && + _deepEquality.equals(other.quizBadLevel, quizBadLevel) && + _deepEquality.equals(other.quizMediumLevel, quizMediumLevel) && + _deepEquality.equals(other.quizGoodLevel, quizGoodLevel) && + _deepEquality.equals(other.quizGreatLevel, quizGreatLevel) && + _deepEquality.equals(other.description, description) && + other.order == order && + other.imageId == imageId && + other.imageSource == imageSource && + other.parentId == parentId && + other.dateCreation == dateCreation && + other.isBeacon == isBeacon && + other.beaconId == beaconId && + other.latitude == latitude && + other.longitude == longitude && + other.meterZoneGPS == meterZoneGPS; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (id.hashCode) + + (label.hashCode) + + (title.hashCode) + + (configurationId.hashCode) + + (type.hashCode) + + (isSubSection.hashCode) + + (instanceId.hashCode) + + (quizQuestions.hashCode) + + (quizBadLevel.hashCode) + + (quizMediumLevel.hashCode) + + (quizGoodLevel.hashCode) + + (quizGreatLevel.hashCode) + + (description == null ? 0 : description!.hashCode) + + (order == null ? 0 : order!.hashCode) + + (imageId == null ? 0 : imageId!.hashCode) + + (imageSource == null ? 0 : imageSource!.hashCode) + + (parentId == null ? 0 : parentId!.hashCode) + + (dateCreation == null ? 0 : dateCreation!.hashCode) + + (isBeacon == null ? 0 : isBeacon!.hashCode) + + (beaconId == null ? 0 : beaconId!.hashCode) + + (latitude == null ? 0 : latitude!.hashCode) + + (longitude == null ? 0 : longitude!.hashCode) + + (meterZoneGPS == null ? 0 : meterZoneGPS!.hashCode); + + @override + String toString() => + 'SectionQuiz[id=$id, label=$label, title=$title, configurationId=$configurationId, type=$type, isSubSection=$isSubSection, instanceId=$instanceId, quizQuestions=$quizQuestions, quizBadLevel=$quizBadLevel, quizMediumLevel=$quizMediumLevel, quizGoodLevel=$quizGoodLevel, quizGreatLevel=$quizGreatLevel, description=$description, order=$order, imageId=$imageId, imageSource=$imageSource, parentId=$parentId, dateCreation=$dateCreation, isBeacon=$isBeacon, beaconId=$beaconId, latitude=$latitude, longitude=$longitude, meterZoneGPS=$meterZoneGPS]'; + + Map toJson() { + final json = {}; + json[r'id'] = this.id; + json[r'label'] = this.label; + json[r'title'] = this.title; + json[r'configurationId'] = this.configurationId; + json[r'type'] = this.type; + json[r'isSubSection'] = this.isSubSection; + json[r'instanceId'] = this.instanceId; + json[r'quizQuestions'] = this.quizQuestions; + json[r'quizBadLevel'] = this.quizBadLevel; + json[r'quizMediumLevel'] = this.quizMediumLevel; + json[r'quizGoodLevel'] = this.quizGoodLevel; + json[r'quizGreatLevel'] = this.quizGreatLevel; + if (this.description != null) { + json[r'description'] = this.description; + } else { + json[r'description'] = null; + } + if (this.order != null) { + json[r'order'] = this.order; + } else { + json[r'order'] = null; + } + if (this.imageId != null) { + json[r'imageId'] = this.imageId; + } else { + json[r'imageId'] = null; + } + if (this.imageSource != null) { + json[r'imageSource'] = this.imageSource; + } else { + json[r'imageSource'] = null; + } + if (this.parentId != null) { + json[r'parentId'] = this.parentId; + } else { + json[r'parentId'] = null; + } + if (this.dateCreation != null) { + json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String(); + } else { + json[r'dateCreation'] = null; + } + if (this.isBeacon != null) { + json[r'isBeacon'] = this.isBeacon; + } else { + json[r'isBeacon'] = null; + } + if (this.beaconId != null) { + json[r'beaconId'] = this.beaconId; + } else { + json[r'beaconId'] = null; + } + if (this.latitude != null) { + json[r'latitude'] = this.latitude; + } else { + json[r'latitude'] = null; + } + if (this.longitude != null) { + json[r'longitude'] = this.longitude; + } else { + json[r'longitude'] = null; + } + if (this.meterZoneGPS != null) { + json[r'meterZoneGPS'] = this.meterZoneGPS; + } else { + json[r'meterZoneGPS'] = null; + } + return json; + } + + /// Returns a new [SectionQuiz] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static SectionQuiz? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // 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 "SectionQuiz[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "SectionQuiz[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return SectionQuiz( + id: mapValueOfType(json, r'id')!, + label: mapValueOfType(json, r'label')!, + title: TranslationDTO.listFromJson(json[r'title']), + configurationId: mapValueOfType(json, r'configurationId')!, + type: SectionType.fromJson(json[r'type'])!, + isSubSection: mapValueOfType(json, r'isSubSection')!, + instanceId: mapValueOfType(json, r'instanceId')!, + quizQuestions: QuizQuestion.listFromJson(json[r'quizQuestions']), + quizBadLevel: + TranslationAndResourceDTO.listFromJson(json[r'quizBadLevel']), + quizMediumLevel: + TranslationAndResourceDTO.listFromJson(json[r'quizMediumLevel']), + quizGoodLevel: + TranslationAndResourceDTO.listFromJson(json[r'quizGoodLevel']), + quizGreatLevel: + TranslationAndResourceDTO.listFromJson(json[r'quizGreatLevel']), + description: TranslationDTO.listFromJson(json[r'description']), + order: mapValueOfType(json, r'order'), + imageId: mapValueOfType(json, r'imageId'), + imageSource: mapValueOfType(json, r'imageSource'), + parentId: mapValueOfType(json, r'parentId'), + dateCreation: mapDateTime(json, r'dateCreation', r''), + isBeacon: mapValueOfType(json, r'isBeacon'), + beaconId: mapValueOfType(json, r'beaconId'), + latitude: mapValueOfType(json, r'latitude'), + longitude: mapValueOfType(json, r'longitude'), + meterZoneGPS: mapValueOfType(json, r'meterZoneGPS'), + ); + } + return null; + } + + static List listFromJson( + dynamic json, { + bool growable = false, + }) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = SectionQuiz.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = SectionQuiz.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of SectionQuiz-objects as value to a dart map + static Map> mapListFromJson( + dynamic json, { + bool growable = false, + }) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = SectionQuiz.listFromJson( + entry.value, + growable: growable, + ); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + 'id', + 'label', + 'title', + 'configurationId', + 'type', + 'isSubSection', + 'instanceId', + 'quizQuestions', + 'quizBadLevel', + 'quizMediumLevel', + 'quizGoodLevel', + 'quizGreatLevel', + }; +} diff --git a/manager_api_new/test/geo_point_section_map_test.dart b/manager_api_new/test/geo_point_section_map_test.dart new file mode 100644 index 0000000..4f80ed1 --- /dev/null +++ b/manager_api_new/test/geo_point_section_map_test.dart @@ -0,0 +1,159 @@ +// +// 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 + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for GeoPointSectionMap +void main() { + // final instance = GeoPointSectionMap(); + + group('test GeoPointSectionMap', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String label + test('to test the property `label`', () async { + // TODO + }); + + // List title (default value: const []) + test('to test the property `title`', () async { + // TODO + }); + + // String configurationId + test('to test the property `configurationId`', () async { + // TODO + }); + + // SectionType type + test('to test the property `type`', () async { + // TODO + }); + + // bool isSubSection + test('to test the property `isSubSection`', () async { + // TODO + }); + + // String instanceId + test('to test the property `instanceId`', () async { + // TODO + }); + + // List mapCategories (default value: const []) + test('to test the property `mapCategories`', () async { + // TODO + }); + + // List description (default value: const []) + test('to test the property `description`', () async { + // TODO + }); + + // int order + test('to test the property `order`', () async { + // TODO + }); + + // String imageId + test('to test the property `imageId`', () async { + // TODO + }); + + // String imageSource + test('to test the property `imageSource`', () async { + // TODO + }); + + // String parentId + test('to test the property `parentId`', () async { + // TODO + }); + + // DateTime dateCreation + test('to test the property `dateCreation`', () async { + // TODO + }); + + // bool isBeacon + test('to test the property `isBeacon`', () async { + // TODO + }); + + // int beaconId + test('to test the property `beaconId`', () async { + // TODO + }); + + // String latitude + test('to test the property `latitude`', () async { + // TODO + }); + + // String longitude + test('to test the property `longitude`', () async { + // TODO + }); + + // int meterZoneGPS + test('to test the property `meterZoneGPS`', () async { + // TODO + }); + + // int mapZoom + test('to test the property `mapZoom`', () async { + // TODO + }); + + // SectionMapAllOfMapMapType mapMapType + test('to test the property `mapMapType`', () async { + // TODO + }); + + // SectionMapAllOfMapTypeMapbox mapTypeMapbox + test('to test the property `mapTypeMapbox`', () async { + // TODO + }); + + // SectionMapAllOfMapMapProvider mapMapProvider + test('to test the property `mapMapProvider`', () async { + // TODO + }); + + // List mapPoints (default value: const []) + test('to test the property `mapPoints`', () async { + // TODO + }); + + // String mapResourceId + test('to test the property `mapResourceId`', () async { + // TODO + }); + + // SectionMapAllOfMapResource mapResource + test('to test the property `mapResource`', () async { + // TODO + }); + + // String mapCenterLatitude + test('to test the property `mapCenterLatitude`', () async { + // TODO + }); + + // String mapCenterLongitude + test('to test the property `mapCenterLongitude`', () async { + // TODO + }); + }); +} diff --git a/manager_api_new/test/quiz_question_section_quiz_test.dart b/manager_api_new/test/quiz_question_section_quiz_test.dart new file mode 100644 index 0000000..5f47a87 --- /dev/null +++ b/manager_api_new/test/quiz_question_section_quiz_test.dart @@ -0,0 +1,134 @@ +// +// 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 + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for QuizQuestionSectionQuiz +void main() { + // final instance = QuizQuestionSectionQuiz(); + + group('test QuizQuestionSectionQuiz', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String label + test('to test the property `label`', () async { + // TODO + }); + + // List title (default value: const []) + test('to test the property `title`', () async { + // TODO + }); + + // String configurationId + test('to test the property `configurationId`', () async { + // TODO + }); + + // SectionType type + test('to test the property `type`', () async { + // TODO + }); + + // bool isSubSection + test('to test the property `isSubSection`', () async { + // TODO + }); + + // String instanceId + test('to test the property `instanceId`', () async { + // TODO + }); + + // List quizQuestions (default value: const []) + test('to test the property `quizQuestions`', () async { + // TODO + }); + + // List quizBadLevel (default value: const []) + test('to test the property `quizBadLevel`', () async { + // TODO + }); + + // List quizMediumLevel (default value: const []) + test('to test the property `quizMediumLevel`', () async { + // TODO + }); + + // List quizGoodLevel (default value: const []) + test('to test the property `quizGoodLevel`', () async { + // TODO + }); + + // List quizGreatLevel (default value: const []) + test('to test the property `quizGreatLevel`', () async { + // TODO + }); + + // List description (default value: const []) + test('to test the property `description`', () async { + // TODO + }); + + // int order + test('to test the property `order`', () async { + // TODO + }); + + // String imageId + test('to test the property `imageId`', () async { + // TODO + }); + + // String imageSource + test('to test the property `imageSource`', () async { + // TODO + }); + + // String parentId + test('to test the property `parentId`', () async { + // TODO + }); + + // DateTime dateCreation + test('to test the property `dateCreation`', () async { + // TODO + }); + + // bool isBeacon + test('to test the property `isBeacon`', () async { + // TODO + }); + + // int beaconId + test('to test the property `beaconId`', () async { + // TODO + }); + + // String latitude + test('to test the property `latitude`', () async { + // TODO + }); + + // String longitude + test('to test the property `longitude`', () async { + // TODO + }); + + // int meterZoneGPS + test('to test the property `meterZoneGPS`', () async { + // TODO + }); + }); +} diff --git a/manager_api_new/test/section_map_all_of_map_map_provider_test.dart b/manager_api_new/test/section_map_all_of_map_map_provider_test.dart new file mode 100644 index 0000000..ad07407 --- /dev/null +++ b/manager_api_new/test/section_map_all_of_map_map_provider_test.dart @@ -0,0 +1,19 @@ +// +// 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 + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for SectionMapAllOfMapMapProvider +void main() { + // final instance = SectionMapAllOfMapMapProvider(); + + group('test SectionMapAllOfMapMapProvider', () {}); +} diff --git a/manager_api_new/test/section_map_all_of_map_map_type_test.dart b/manager_api_new/test/section_map_all_of_map_map_type_test.dart new file mode 100644 index 0000000..da26fa4 --- /dev/null +++ b/manager_api_new/test/section_map_all_of_map_map_type_test.dart @@ -0,0 +1,19 @@ +// +// 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 + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for SectionMapAllOfMapMapType +void main() { + // final instance = SectionMapAllOfMapMapType(); + + group('test SectionMapAllOfMapMapType', () {}); +} diff --git a/manager_api_new/test/section_map_all_of_map_resource_test.dart b/manager_api_new/test/section_map_all_of_map_resource_test.dart new file mode 100644 index 0000000..20067cb --- /dev/null +++ b/manager_api_new/test/section_map_all_of_map_resource_test.dart @@ -0,0 +1,49 @@ +// +// 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 + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for SectionMapAllOfMapResource +void main() { + // final instance = SectionMapAllOfMapResource(); + + group('test SectionMapAllOfMapResource', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // ResourceType type + test('to test the property `type`', () async { + // TODO + }); + + // String label + test('to test the property `label`', () async { + // TODO + }); + + // String instanceId + test('to test the property `instanceId`', () async { + // TODO + }); + + // DateTime dateCreation + test('to test the property `dateCreation`', () async { + // TODO + }); + + // String url + test('to test the property `url`', () async { + // TODO + }); + }); +} diff --git a/manager_api_new/test/section_map_all_of_map_type_mapbox_test.dart b/manager_api_new/test/section_map_all_of_map_type_mapbox_test.dart new file mode 100644 index 0000000..f715967 --- /dev/null +++ b/manager_api_new/test/section_map_all_of_map_type_mapbox_test.dart @@ -0,0 +1,19 @@ +// +// 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 + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for SectionMapAllOfMapTypeMapbox +void main() { + // final instance = SectionMapAllOfMapTypeMapbox(); + + group('test SectionMapAllOfMapTypeMapbox', () {}); +} diff --git a/manager_api_new/test/section_map_test.dart b/manager_api_new/test/section_map_test.dart new file mode 100644 index 0000000..72f7812 --- /dev/null +++ b/manager_api_new/test/section_map_test.dart @@ -0,0 +1,159 @@ +// +// 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 + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for SectionMap +void main() { + // final instance = SectionMap(); + + group('test SectionMap', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String label + test('to test the property `label`', () async { + // TODO + }); + + // List title (default value: const []) + test('to test the property `title`', () async { + // TODO + }); + + // String configurationId + test('to test the property `configurationId`', () async { + // TODO + }); + + // SectionType type + test('to test the property `type`', () async { + // TODO + }); + + // bool isSubSection + test('to test the property `isSubSection`', () async { + // TODO + }); + + // String instanceId + test('to test the property `instanceId`', () async { + // TODO + }); + + // List mapCategories (default value: const []) + test('to test the property `mapCategories`', () async { + // TODO + }); + + // List description (default value: const []) + test('to test the property `description`', () async { + // TODO + }); + + // int order + test('to test the property `order`', () async { + // TODO + }); + + // String imageId + test('to test the property `imageId`', () async { + // TODO + }); + + // String imageSource + test('to test the property `imageSource`', () async { + // TODO + }); + + // String parentId + test('to test the property `parentId`', () async { + // TODO + }); + + // DateTime dateCreation + test('to test the property `dateCreation`', () async { + // TODO + }); + + // bool isBeacon + test('to test the property `isBeacon`', () async { + // TODO + }); + + // int beaconId + test('to test the property `beaconId`', () async { + // TODO + }); + + // String latitude + test('to test the property `latitude`', () async { + // TODO + }); + + // String longitude + test('to test the property `longitude`', () async { + // TODO + }); + + // int meterZoneGPS + test('to test the property `meterZoneGPS`', () async { + // TODO + }); + + // int mapZoom + test('to test the property `mapZoom`', () async { + // TODO + }); + + // SectionMapAllOfMapMapType mapMapType + test('to test the property `mapMapType`', () async { + // TODO + }); + + // SectionMapAllOfMapTypeMapbox mapTypeMapbox + test('to test the property `mapTypeMapbox`', () async { + // TODO + }); + + // SectionMapAllOfMapMapProvider mapMapProvider + test('to test the property `mapMapProvider`', () async { + // TODO + }); + + // List mapPoints (default value: const []) + test('to test the property `mapPoints`', () async { + // TODO + }); + + // String mapResourceId + test('to test the property `mapResourceId`', () async { + // TODO + }); + + // SectionMapAllOfMapResource mapResource + test('to test the property `mapResource`', () async { + // TODO + }); + + // String mapCenterLatitude + test('to test the property `mapCenterLatitude`', () async { + // TODO + }); + + // String mapCenterLongitude + test('to test the property `mapCenterLongitude`', () async { + // TODO + }); + }); +} diff --git a/manager_api_new/test/section_quiz_test.dart b/manager_api_new/test/section_quiz_test.dart new file mode 100644 index 0000000..4712839 --- /dev/null +++ b/manager_api_new/test/section_quiz_test.dart @@ -0,0 +1,134 @@ +// +// 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 + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for SectionQuiz +void main() { + // final instance = SectionQuiz(); + + group('test SectionQuiz', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String label + test('to test the property `label`', () async { + // TODO + }); + + // List title (default value: const []) + test('to test the property `title`', () async { + // TODO + }); + + // String configurationId + test('to test the property `configurationId`', () async { + // TODO + }); + + // SectionType type + test('to test the property `type`', () async { + // TODO + }); + + // bool isSubSection + test('to test the property `isSubSection`', () async { + // TODO + }); + + // String instanceId + test('to test the property `instanceId`', () async { + // TODO + }); + + // List quizQuestions (default value: const []) + test('to test the property `quizQuestions`', () async { + // TODO + }); + + // List quizBadLevel (default value: const []) + test('to test the property `quizBadLevel`', () async { + // TODO + }); + + // List quizMediumLevel (default value: const []) + test('to test the property `quizMediumLevel`', () async { + // TODO + }); + + // List quizGoodLevel (default value: const []) + test('to test the property `quizGoodLevel`', () async { + // TODO + }); + + // List quizGreatLevel (default value: const []) + test('to test the property `quizGreatLevel`', () async { + // TODO + }); + + // List description (default value: const []) + test('to test the property `description`', () async { + // TODO + }); + + // int order + test('to test the property `order`', () async { + // TODO + }); + + // String imageId + test('to test the property `imageId`', () async { + // TODO + }); + + // String imageSource + test('to test the property `imageSource`', () async { + // TODO + }); + + // String parentId + test('to test the property `parentId`', () async { + // TODO + }); + + // DateTime dateCreation + test('to test the property `dateCreation`', () async { + // TODO + }); + + // bool isBeacon + test('to test the property `isBeacon`', () async { + // TODO + }); + + // int beaconId + test('to test the property `beaconId`', () async { + // TODO + }); + + // String latitude + test('to test the property `latitude`', () async { + // TODO + }); + + // String longitude + test('to test the property `longitude`', () async { + // TODO + }); + + // int meterZoneGPS + test('to test the property `meterZoneGPS`', () async { + // TODO + }); + }); +} diff --git a/manager_api_new/test/section_test.dart b/manager_api_new/test/section_test.dart new file mode 100644 index 0000000..73d3667 --- /dev/null +++ b/manager_api_new/test/section_test.dart @@ -0,0 +1,109 @@ +// +// 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 + +import 'package:manager_api_new/api.dart'; +import 'package:test/test.dart'; + +// tests for Section +void main() { + // final instance = Section(); + + group('test Section', () { + // String id + test('to test the property `id`', () async { + // TODO + }); + + // String label + test('to test the property `label`', () async { + // TODO + }); + + // List title (default value: const []) + test('to test the property `title`', () async { + // TODO + }); + + // String configurationId + test('to test the property `configurationId`', () async { + // TODO + }); + + // SectionType type + test('to test the property `type`', () async { + // TODO + }); + + // bool isSubSection + test('to test the property `isSubSection`', () async { + // TODO + }); + + // String instanceId + test('to test the property `instanceId`', () async { + // TODO + }); + + // List description (default value: const []) + test('to test the property `description`', () async { + // TODO + }); + + // int order + test('to test the property `order`', () async { + // TODO + }); + + // String imageId + test('to test the property `imageId`', () async { + // TODO + }); + + // String imageSource + test('to test the property `imageSource`', () async { + // TODO + }); + + // String parentId + test('to test the property `parentId`', () async { + // TODO + }); + + // DateTime dateCreation + test('to test the property `dateCreation`', () async { + // TODO + }); + + // bool isBeacon + test('to test the property `isBeacon`', () async { + // TODO + }); + + // int beaconId + test('to test the property `beaconId`', () async { + // TODO + }); + + // String latitude + test('to test the property `latitude`', () async { + // TODO + }); + + // String longitude + test('to test the property `longitude`', () async { + // TODO + }); + + // int meterZoneGPS + test('to test the property `meterZoneGPS`', () async { + // TODO + }); + }); +}