diff --git a/lib/Helpers/PDFHelper.dart b/lib/Helpers/PDFHelper.dart index c96e06d..1dfc244 100644 --- a/lib/Helpers/PDFHelper.dart +++ b/lib/Helpers/PDFHelper.dart @@ -7,7 +7,7 @@ import 'dart:html' as html; class PDFHelper { static downloadPDF(ManagerAppContext managerAppContext, List sections) async { - var sectionsArticle = sections.where((section) => section.type == SectionType.Article || section.type == SectionType.Quiz); // TODO HERE Support more section types + var sectionsArticle = sections; if(sectionsArticle.length > 0) { //final font = await rootBundle.load("fonts/OpenSans-Medium.ttf"); //Uint8List byteData = new File("fonts/OpenSans-Medium.ttf").readAsBytesSync(); diff --git a/lib/Screens/Configurations/Section/SubSection/Map/showNewOrUpdateGeoPoint.dart b/lib/Screens/Configurations/Section/SubSection/Map/showNewOrUpdateGeoPoint.dart index b05673f..2e7c438 100644 --- a/lib/Screens/Configurations/Section/SubSection/Map/showNewOrUpdateGeoPoint.dart +++ b/lib/Screens/Configurations/Section/SubSection/Map/showNewOrUpdateGeoPoint.dart @@ -51,7 +51,7 @@ void showNewOrUpdateGeoPoint(MapDTO mapDTO, GeoPointDTO? inputGeoPointDTO, Funct height: 350, child: FlutterLocationPicker( initZoom: 14, - initPosition: geoPointDTO.latitude == null && geoPointDTO.longitude == null ? LatLong(50.429333, 4.891434) : LatLong(double.parse(geoPointDTO.latitude!), double.parse(geoPointDTO.longitude!)), + initPosition: /*geoPointDTO.latitude == null && geoPointDTO.longitude == null ?*/ LatLong(50.429333, 4.891434) /*: LatLong(double.parse(geoPointDTO.latitude!), double.parse(geoPointDTO.longitude!))*/, minZoomLevel: 0, maxZoomLevel: 17, markerIcon: const Icon( @@ -78,8 +78,9 @@ void showNewOrUpdateGeoPoint(MapDTO mapDTO, GeoPointDTO? inputGeoPointDTO, Funct onError: (e) => print(e), selectLocationButtonLeadingIcon: const Icon(Icons.check, color: kPrimaryColor), onPicked: (pickedData) { - geoPointDTO.latitude = pickedData.latLong.latitude.toString(); - geoPointDTO.longitude = pickedData.latLong.longitude.toString(); + print("TODO !"); + /*geoPointDTO.latitude = pickedData.latLong.latitude.toString(); + geoPointDTO.longitude = pickedData.latLong.longitude.toString();*/ }, onChanged: (pickedData) { /*print("onChanged"); @@ -352,10 +353,11 @@ void showNewOrUpdateGeoPoint(MapDTO mapDTO, GeoPointDTO? inputGeoPointDTO, Funct color: kPrimaryColor, textColor: kWhite, press: () { - if (geoPointDTO.latitude != null && geoPointDTO.longitude != null) { + print("TODO"); + /*if (geoPointDTO.latitude != null && geoPointDTO.longitude != null) { getResult(geoPointDTO); Navigator.of(context).pop(); - } + }*/ }, fontSize: 20, ), diff --git a/lib/Screens/Configurations/Section/section_detail_screen.dart b/lib/Screens/Configurations/Section/section_detail_screen.dart index 56d870d..3301ba4 100644 --- a/lib/Screens/Configurations/Section/section_detail_screen.dart +++ b/lib/Screens/Configurations/Section/section_detail_screen.dart @@ -132,7 +132,7 @@ class _SectionDetailScreenState extends State { ), ), Text(sectionDTO.label!, style: TextStyle(fontSize: 30, fontWeight: FontWeight.w400)), - if((appContext.getContext() as ManagerAppContext).selectedConfiguration!.isMobile!) + //if((appContext.getContext() as ManagerAppContext).selectedConfiguration!.isMobile!) DownloadPDF(sections: [sectionDTO]), ], ), @@ -180,7 +180,7 @@ class _SectionDetailScreenState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ - if((appContext.getContext() as ManagerAppContext).selectedConfiguration!.isMobile!) + //if((appContext.getContext() as ManagerAppContext).selectedConfiguration!.isMobile!) Column( mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start, @@ -267,7 +267,7 @@ class _SectionDetailScreenState extends State { isHTML: true, isTitle: true, ), - if(!(appContext.getContext() as ManagerAppContext).selectedConfiguration!.isMobile!) + /*if(!(appContext.getContext() as ManagerAppContext).selectedConfiguration!.isMobile!) MultiStringInputContainer( label: "Description affichée:", modalLabel: "Description", @@ -283,7 +283,7 @@ class _SectionDetailScreenState extends State { }, maxLines: 2, isTitle: true, - ), + ),*/ ], ), Column( diff --git a/lib/Screens/Configurations/configuration_detail_screen.dart b/lib/Screens/Configurations/configuration_detail_screen.dart index aeaf53e..0fce42f 100644 --- a/lib/Screens/Configurations/configuration_detail_screen.dart +++ b/lib/Screens/Configurations/configuration_detail_screen.dart @@ -205,7 +205,7 @@ class _ConfigurationDetailScreenState extends State { } }, ), - if(configurationDTO.isTablet!) + /*if(configurationDTO.isTablet!) CheckInputContainer( icon: Icons.image, label: "Fond pour les images des sections :", @@ -214,7 +214,7 @@ class _ConfigurationDetailScreenState extends State { onChanged: (value) { configurationDTO.isSectionImageBackground = value; }, - ), + ),*/ ], ), Column( @@ -230,7 +230,7 @@ class _ConfigurationDetailScreenState extends State { configurationDTO.isOffline = value; }, ), - CheckInputContainer( + /*CheckInputContainer( icon: Icons.tablet, label: "Tablette :", fontSize: 20, @@ -239,8 +239,8 @@ class _ConfigurationDetailScreenState extends State { configurationDTO.isTablet = value; save(configurationDTO, appContext); }, - ), - CheckInputContainer( + ),*/ + /*CheckInputContainer( icon: Icons.phone_android, label: "Mobile :", fontSize: 20, @@ -249,8 +249,8 @@ class _ConfigurationDetailScreenState extends State { configurationDTO.isMobile = value; save(configurationDTO, appContext); }, - ), - if(configurationDTO.isMobile != null && configurationDTO.isMobile!) + ),*/ + /*if(configurationDTO.isMobile != null && configurationDTO.isMobile!) RoundedButton( text: "Télécharger les QRCodes", icon: Icons.qr_code, @@ -280,14 +280,14 @@ class _ConfigurationDetailScreenState extends State { onChanged: (value) { configurationDTO.isHour = value; }, - ), + ),*/ ], ), Column( mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start, children: [ - if(!configurationDTO.isMobile!) + /*if(!configurationDTO.isMobile!) ColorPickerInputContainer( label: "Couleur fond d'écran :", fontSize: 20, @@ -295,8 +295,8 @@ class _ConfigurationDetailScreenState extends State { onChanged: (value) { configurationDTO.secondaryColor = value; }, - ), - if(!configurationDTO.isMobile!) + ),*/ + /*if(!configurationDTO.isMobile!) ColorPickerInputContainer( label: "Couleur principale :", fontSize: 20, @@ -323,7 +323,7 @@ class _ConfigurationDetailScreenState extends State { maxLines: 1, isTitle: true, ), - ), + ),*/ ResourceInputContainer( label: "Image fond d'écran :", fontSize: 20, @@ -339,7 +339,7 @@ class _ConfigurationDetailScreenState extends State { } }, ), - if(configurationDTO.isTablet!) + /*if(configurationDTO.isTablet!) Container( height: 100, child: NumberInputContainer( @@ -374,7 +374,7 @@ class _ConfigurationDetailScreenState extends State { } }, ), - ), + ),*/ // It's a section now /*SizedBox( height: 100, @@ -404,12 +404,7 @@ class _ConfigurationDetailScreenState extends State { builder: (context, AsyncSnapshot snapshot) { if (snapshot.connectionState == ConnectionState.done) { - if(configurationDTO.isMobile!) { - // Only see Article and Quiz type - sections = new List.from(snapshot.data).where((section) => !section.isSubSection! && (section.type == SectionType.Article || section.type == SectionType.Quiz)).toList(); - } else { - sections = new List.from(snapshot.data).where((section) => !section.isSubSection!).toList(); - } + sections = new List.from(snapshot.data).where((section) => !section.isSubSection!).toList(); return bodyGrid(configurationDTO, size, appContext); } else if (snapshot.connectionState == ConnectionState.none) { diff --git a/lib/Screens/Configurations/configurations_screen.dart b/lib/Screens/Configurations/configurations_screen.dart index a675cbc..161f960 100644 --- a/lib/Screens/Configurations/configurations_screen.dart +++ b/lib/Screens/Configurations/configurations_screen.dart @@ -81,12 +81,12 @@ class _ConfigurationsScreenState extends State { if(configurationToCreate != null) { if (configurationToCreate.label != null) { configurationToCreate.dateCreation = DateTime.now(); - configurationToCreate.isMobile = false; - configurationToCreate.isTablet = false; + /*configurationToCreate.isMobile = false; + configurationToCreate.isTablet = false;*/ configurationToCreate.isOffline = false; - configurationToCreate.isDate = false; + /*configurationToCreate.isDate = false; configurationToCreate.isHour = false; - configurationToCreate.isSectionImageBackground = false; + configurationToCreate.isSectionImageBackground = false;*/ configurationToCreate.instanceId = (appContext.getContext() as ManagerAppContext).instanceId; await (appContext.getContext() as ManagerAppContext).clientAPI!.configurationApi!.configurationCreate(configurationToCreate); ManagerAppContext managerAppContext = appContext.getContext(); diff --git a/lib/Screens/Configurations/section_reorderList.dart b/lib/Screens/Configurations/section_reorderList.dart index 2e30df8..8039147 100644 --- a/lib/Screens/Configurations/section_reorderList.dart +++ b/lib/Screens/Configurations/section_reorderList.dart @@ -82,7 +82,8 @@ class _SectionReorderListState extends State { sections, index, Key('$index'), - currentConfiguration.isMobile!, + false, + //currentConfiguration.isMobile!, appContext, (section) { setState(() { @@ -147,7 +148,7 @@ class _SectionReorderListState extends State { right: 10, child: InkWell( onTap: () async { - var sectionToCreate = await showNewSection(widget.configurationId, appContext, context, false, currentConfiguration.isMobile!); + var sectionToCreate = await showNewSection(widget.configurationId, appContext, context, false, false/*currentConfiguration.isMobile!*/); if(sectionToCreate != null) { ManagerAppContext managerAppContext = appContext.getContext(); diff --git a/lib/Screens/login_screen.dart b/lib/Screens/login_screen.dart index 541cc7a..f0369fb 100644 --- a/lib/Screens/login_screen.dart +++ b/lib/Screens/login_screen.dart @@ -30,7 +30,7 @@ class LoginScreen extends StatefulWidget { class _LoginScreenState extends State { String email = ""; // DEV "test@email.be" String password = ""; // DEV = "kljqsdkljqsd" - String? host = "https://api.mymuseum.be"; // "https://api.myinfomate.be" // "https://api.mymuseum.be" // DEV = "http://192.168.31.96" // http://localhost:5000 // https://api.mymuseum.be // myCore http://192.168.31.140:8089 + String? host = "http://localhost:5000"; // "https://api.myinfomate.be" // "https://api.mymuseum.be" // DEV = "http://192.168.31.96" // http://localhost:5000 // https://api.mymuseum.be // myCore http://192.168.31.140:8089 Client? clientAPI; bool isLoading = false; bool isRememberMe = false; @@ -178,7 +178,7 @@ class _LoginScreenState extends State { @override void initState() { //this.isRememberMe = widget.session.rememberMe; - this.host = "https://api.mymuseum.be"; // "https://api.myinfomate.be"// "https://api.mymuseum.be" // "http://localhost:5000" //widget.session.host; // MDLF "http://192.168.1.19:8089" // "https://api.mymuseum.be" + this.host = "http://localhost:5000"; // "https://api.myinfomate.be"// "https://api.mymuseum.be" // "http://localhost:5000" //widget.session.host; // MDLF "http://192.168.1.19:8089" // "https://api.mymuseum.be" //this.email = "test@email.be"; //widget.session.email; //this.password = "kljqsdkljqsd"; //widget.session.password; diff --git a/manager_api_new/lib/model/coordinate_equality_comparer.dart b/manager_api_new/lib/model/coordinate_equality_comparer.dart index 51bb525..577cfdf 100644 --- a/manager_api_new/lib/model/coordinate_equality_comparer.dart +++ b/manager_api_new/lib/model/coordinate_equality_comparer.dart @@ -12,16 +12,15 @@ part of openapi.api; class CoordinateEqualityComparer { /// Returns a new [CoordinateEqualityComparer] instance. - CoordinateEqualityComparer({ - }); + CoordinateEqualityComparer(); @override - bool operator ==(Object other) => identical(this, other) || other is CoordinateEqualityComparer && + bool operator ==(Object other) => identical(this, other) || other is CoordinateEqualityComparer; - @override + /*@override int get hashCode => // ignore: unnecessary_parenthesis - +*/ @override String toString() => 'CoordinateEqualityComparer[]'; diff --git a/manager_api_new/lib/model/device_detail_dto_all_of.dart b/manager_api_new/lib/model/device_detail_dto_all_of.dart deleted file mode 100644 index 729d201..0000000 --- a/manager_api_new/lib/model/device_detail_dto_all_of.dart +++ /dev/null @@ -1,171 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// -// @dart=2.12 - -// 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 DeviceDetailDTOAllOf { - /// Returns a new [DeviceDetailDTOAllOf] instance. - DeviceDetailDTOAllOf({ - this.connectionLevel, - this.lastConnectionLevel, - this.batteryLevel, - this.lastBatteryLevel, - }); - - String? connectionLevel; - - /// - /// 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? lastConnectionLevel; - - String? batteryLevel; - - /// - /// 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? lastBatteryLevel; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is DeviceDetailDTOAllOf && - other.connectionLevel == connectionLevel && - other.lastConnectionLevel == lastConnectionLevel && - other.batteryLevel == batteryLevel && - other.lastBatteryLevel == lastBatteryLevel; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (connectionLevel == null ? 0 : connectionLevel!.hashCode) + - (lastConnectionLevel == null ? 0 : lastConnectionLevel!.hashCode) + - (batteryLevel == null ? 0 : batteryLevel!.hashCode) + - (lastBatteryLevel == null ? 0 : lastBatteryLevel!.hashCode); - - @override - String toString() => - 'DeviceDetailDTOAllOf[connectionLevel=$connectionLevel, lastConnectionLevel=$lastConnectionLevel, batteryLevel=$batteryLevel, lastBatteryLevel=$lastBatteryLevel]'; - - Map toJson() { - final json = {}; - if (this.connectionLevel != null) { - json[r'connectionLevel'] = this.connectionLevel; - } else { - json[r'connectionLevel'] = null; - } - if (this.lastConnectionLevel != null) { - json[r'lastConnectionLevel'] = - this.lastConnectionLevel!.toUtc().toIso8601String(); - } else { - json[r'lastConnectionLevel'] = null; - } - if (this.batteryLevel != null) { - json[r'batteryLevel'] = this.batteryLevel; - } else { - json[r'batteryLevel'] = null; - } - if (this.lastBatteryLevel != null) { - json[r'lastBatteryLevel'] = - this.lastBatteryLevel!.toUtc().toIso8601String(); - } else { - json[r'lastBatteryLevel'] = null; - } - return json; - } - - /// Returns a new [DeviceDetailDTOAllOf] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static DeviceDetailDTOAllOf? 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 "DeviceDetailDTOAllOf[$key]" is missing from JSON.'); - assert(json[key] != null, - 'Required key "DeviceDetailDTOAllOf[$key]" has a null value in JSON.'); - }); - return true; - }()); - - return DeviceDetailDTOAllOf( - connectionLevel: mapValueOfType(json, r'connectionLevel'), - lastConnectionLevel: mapDateTime(json, r'lastConnectionLevel', ''), - batteryLevel: mapValueOfType(json, r'batteryLevel'), - lastBatteryLevel: mapDateTime(json, r'lastBatteryLevel', ''), - ); - } - 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 = DeviceDetailDTOAllOf.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 = DeviceDetailDTOAllOf.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of DeviceDetailDTOAllOf-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] = DeviceDetailDTOAllOf.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/export_configuration_dto_all_of.dart b/manager_api_new/lib/model/export_configuration_dto_all_of.dart deleted file mode 100644 index 02e3aec..0000000 --- a/manager_api_new/lib/model/export_configuration_dto_all_of.dart +++ /dev/null @@ -1,135 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// -// @dart=2.12 - -// 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 ExportConfigurationDTOAllOf { - /// Returns a new [ExportConfigurationDTOAllOf] instance. - ExportConfigurationDTOAllOf({ - this.sections = const [], - this.resources = const [], - }); - - List? sections; - - List? resources; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is ExportConfigurationDTOAllOf && - other.sections == sections && - other.resources == resources; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (sections == null ? 0 : sections!.hashCode) + - (resources == null ? 0 : resources!.hashCode); - - @override - String toString() => - 'ExportConfigurationDTOAllOf[sections=$sections, resources=$resources]'; - - Map toJson() { - final json = {}; - if (this.sections != null) { - json[r'sections'] = this.sections; - } else { - json[r'sections'] = null; - } - if (this.resources != null) { - json[r'resources'] = this.resources; - } else { - json[r'resources'] = null; - } - return json; - } - - /// Returns a new [ExportConfigurationDTOAllOf] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static ExportConfigurationDTOAllOf? 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 "ExportConfigurationDTOAllOf[$key]" is missing from JSON.'); - assert(json[key] != null, - 'Required key "ExportConfigurationDTOAllOf[$key]" has a null value in JSON.'); - }); - return true; - }()); - - return ExportConfigurationDTOAllOf( - sections: SectionDTO.listFromJson(json[r'sections']), - resources: ResourceDTO.listFromJson(json[r'resources']), - ); - } - 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 = ExportConfigurationDTOAllOf.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 = ExportConfigurationDTOAllOf.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of ExportConfigurationDTOAllOf-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] = ExportConfigurationDTOAllOf.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/geo_point.dart b/manager_api_new/lib/model/geo_point.dart index 955c841..705915d 100644 --- a/manager_api_new/lib/model/geo_point.dart +++ b/manager_api_new/lib/model/geo_point.dart @@ -23,12 +23,14 @@ class GeoPoint { this.email = const [], this.site = const [], this.categorieId, - this.latitude, - this.longitude, + this.geometry, + this.polyColor, this.imageResourceId, this.imageUrl, this.sectionMapId, this.sectionMap, + this.sectionEventId, + this.sectionEvent, }); int id; @@ -51,9 +53,9 @@ class GeoPoint { int? categorieId; - String? latitude; + PointAllOfBoundary? geometry; - String? longitude; + String? polyColor; String? imageResourceId; @@ -61,7 +63,11 @@ class GeoPoint { String? sectionMapId; - GeoPointSectionMap? sectionMap; + GuidedPathSectionMap? sectionMap; + + String? sectionEventId; + + ApplicationInstanceSectionEvent? sectionEvent; @override bool operator ==(Object other) => @@ -77,12 +83,14 @@ class GeoPoint { _deepEquality.equals(other.email, email) && _deepEquality.equals(other.site, site) && other.categorieId == categorieId && - other.latitude == latitude && - other.longitude == longitude && + other.geometry == geometry && + other.polyColor == polyColor && other.imageResourceId == imageResourceId && other.imageUrl == imageUrl && other.sectionMapId == sectionMapId && - other.sectionMap == sectionMap; + other.sectionMap == sectionMap && + other.sectionEventId == sectionEventId && + other.sectionEvent == sectionEvent; @override int get hashCode => @@ -97,16 +105,18 @@ class GeoPoint { (email.hashCode) + (site.hashCode) + (categorieId == null ? 0 : categorieId!.hashCode) + - (latitude == null ? 0 : latitude!.hashCode) + - (longitude == null ? 0 : longitude!.hashCode) + + (geometry == null ? 0 : geometry!.hashCode) + + (polyColor == null ? 0 : polyColor!.hashCode) + (imageResourceId == null ? 0 : imageResourceId!.hashCode) + (imageUrl == null ? 0 : imageUrl!.hashCode) + (sectionMapId == null ? 0 : sectionMapId!.hashCode) + - (sectionMap == null ? 0 : sectionMap!.hashCode); + (sectionMap == null ? 0 : sectionMap!.hashCode) + + (sectionEventId == null ? 0 : sectionEventId!.hashCode) + + (sectionEvent == null ? 0 : sectionEvent!.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, sectionMapId=$sectionMapId, sectionMap=$sectionMap]'; + 'GeoPoint[id=$id, title=$title, description=$description, contents=$contents, schedules=$schedules, prices=$prices, phone=$phone, email=$email, site=$site, categorieId=$categorieId, geometry=$geometry, polyColor=$polyColor, imageResourceId=$imageResourceId, imageUrl=$imageUrl, sectionMapId=$sectionMapId, sectionMap=$sectionMap, sectionEventId=$sectionEventId, sectionEvent=$sectionEvent]'; Map toJson() { final json = {}; @@ -124,15 +134,15 @@ class GeoPoint { } else { json[r'categorieId'] = null; } - if (this.latitude != null) { - json[r'latitude'] = this.latitude; + if (this.geometry != null) { + json[r'geometry'] = this.geometry; } else { - json[r'latitude'] = null; + json[r'geometry'] = null; } - if (this.longitude != null) { - json[r'longitude'] = this.longitude; + if (this.polyColor != null) { + json[r'polyColor'] = this.polyColor; } else { - json[r'longitude'] = null; + json[r'polyColor'] = null; } if (this.imageResourceId != null) { json[r'imageResourceId'] = this.imageResourceId; @@ -154,6 +164,16 @@ class GeoPoint { } else { json[r'sectionMap'] = null; } + if (this.sectionEventId != null) { + json[r'sectionEventId'] = this.sectionEventId; + } else { + json[r'sectionEventId'] = null; + } + if (this.sectionEvent != null) { + json[r'sectionEvent'] = this.sectionEvent; + } else { + json[r'sectionEvent'] = null; + } return json; } @@ -188,12 +208,15 @@ class GeoPoint { email: TranslationDTO.listFromJson(json[r'email']), site: TranslationDTO.listFromJson(json[r'site']), categorieId: mapValueOfType(json, r'categorieId'), - latitude: mapValueOfType(json, r'latitude'), - longitude: mapValueOfType(json, r'longitude'), + geometry: PointAllOfBoundary.fromJson(json[r'geometry']), + polyColor: mapValueOfType(json, r'polyColor'), imageResourceId: mapValueOfType(json, r'imageResourceId'), imageUrl: mapValueOfType(json, r'imageUrl'), sectionMapId: mapValueOfType(json, r'sectionMapId'), - sectionMap: GeoPointSectionMap.fromJson(json[r'sectionMap']), + sectionMap: GuidedPathSectionMap.fromJson(json[r'sectionMap']), + sectionEventId: mapValueOfType(json, r'sectionEventId'), + sectionEvent: + ApplicationInstanceSectionEvent.fromJson(json[r'sectionEvent']), ); } return null; diff --git a/manager_api_new/lib/model/geo_point_dto.dart b/manager_api_new/lib/model/geo_point_dto.dart index e901072..b947e88 100644 --- a/manager_api_new/lib/model/geo_point_dto.dart +++ b/manager_api_new/lib/model/geo_point_dto.dart @@ -18,8 +18,6 @@ class GeoPointDTO { this.description = const [], this.contents = const [], this.categorieId, - this.latitude, - this.longitude, this.imageResourceId, this.imageUrl, this.schedules = const [], @@ -27,6 +25,10 @@ class GeoPointDTO { this.phone = const [], this.email = const [], this.site = const [], + this.geometry, + this.polyColor, + this.sectionMapId, + this.sectionEventId, }); int? id; @@ -39,10 +41,6 @@ class GeoPointDTO { int? categorieId; - String? latitude; - - String? longitude; - String? imageResourceId; String? imageUrl; @@ -57,6 +55,14 @@ class GeoPointDTO { List? site; + EventAddressDTOGeometry? geometry; + + String? polyColor; + + String? sectionMapId; + + String? sectionEventId; + @override bool operator ==(Object other) => identical(this, other) || @@ -66,15 +72,17 @@ class GeoPointDTO { _deepEquality.equals(other.description, description) && _deepEquality.equals(other.contents, contents) && other.categorieId == categorieId && - other.latitude == latitude && - other.longitude == longitude && other.imageResourceId == imageResourceId && other.imageUrl == imageUrl && _deepEquality.equals(other.schedules, schedules) && _deepEquality.equals(other.prices, prices) && _deepEquality.equals(other.phone, phone) && _deepEquality.equals(other.email, email) && - _deepEquality.equals(other.site, site); + _deepEquality.equals(other.site, site) && + other.geometry == geometry && + other.polyColor == polyColor && + other.sectionMapId == sectionMapId && + other.sectionEventId == sectionEventId; @override int get hashCode => @@ -84,19 +92,21 @@ class GeoPointDTO { (description == null ? 0 : description!.hashCode) + (contents == null ? 0 : contents!.hashCode) + (categorieId == null ? 0 : categorieId!.hashCode) + - (latitude == null ? 0 : latitude!.hashCode) + - (longitude == null ? 0 : longitude!.hashCode) + (imageResourceId == null ? 0 : imageResourceId!.hashCode) + (imageUrl == null ? 0 : imageUrl!.hashCode) + (schedules == null ? 0 : schedules!.hashCode) + (prices == null ? 0 : prices!.hashCode) + (phone == null ? 0 : phone!.hashCode) + (email == null ? 0 : email!.hashCode) + - (site == null ? 0 : site!.hashCode); + (site == null ? 0 : site!.hashCode) + + (geometry == null ? 0 : geometry!.hashCode) + + (polyColor == null ? 0 : polyColor!.hashCode) + + (sectionMapId == null ? 0 : sectionMapId!.hashCode) + + (sectionEventId == null ? 0 : sectionEventId!.hashCode); @override String toString() => - 'GeoPointDTO[id=$id, title=$title, description=$description, contents=$contents, categorieId=$categorieId, latitude=$latitude, longitude=$longitude, imageResourceId=$imageResourceId, imageUrl=$imageUrl, schedules=$schedules, prices=$prices, phone=$phone, email=$email, site=$site]'; + 'GeoPointDTO[id=$id, title=$title, description=$description, contents=$contents, categorieId=$categorieId, imageResourceId=$imageResourceId, imageUrl=$imageUrl, schedules=$schedules, prices=$prices, phone=$phone, email=$email, site=$site, geometry=$geometry, polyColor=$polyColor, sectionMapId=$sectionMapId, sectionEventId=$sectionEventId]'; Map toJson() { final json = {}; @@ -125,16 +135,6 @@ class GeoPointDTO { } else { json[r'categorieId'] = 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.imageResourceId != null) { json[r'imageResourceId'] = this.imageResourceId; } else { @@ -170,6 +170,26 @@ class GeoPointDTO { } else { json[r'site'] = null; } + if (this.geometry != null) { + json[r'geometry'] = this.geometry; + } else { + json[r'geometry'] = null; + } + if (this.polyColor != null) { + json[r'polyColor'] = this.polyColor; + } else { + json[r'polyColor'] = null; + } + if (this.sectionMapId != null) { + json[r'sectionMapId'] = this.sectionMapId; + } else { + json[r'sectionMapId'] = null; + } + if (this.sectionEventId != null) { + json[r'sectionEventId'] = this.sectionEventId; + } else { + json[r'sectionEventId'] = null; + } return json; } @@ -199,8 +219,6 @@ class GeoPointDTO { description: TranslationDTO.listFromJson(json[r'description']), contents: ContentDTO.listFromJson(json[r'contents']), categorieId: mapValueOfType(json, r'categorieId'), - latitude: mapValueOfType(json, r'latitude'), - longitude: mapValueOfType(json, r'longitude'), imageResourceId: mapValueOfType(json, r'imageResourceId'), imageUrl: mapValueOfType(json, r'imageUrl'), schedules: TranslationDTO.listFromJson(json[r'schedules']), @@ -208,6 +226,10 @@ class GeoPointDTO { phone: TranslationDTO.listFromJson(json[r'phone']), email: TranslationDTO.listFromJson(json[r'email']), site: TranslationDTO.listFromJson(json[r'site']), + geometry: EventAddressDTOGeometry.fromJson(json[r'geometry']), + polyColor: mapValueOfType(json, r'polyColor'), + sectionMapId: mapValueOfType(json, r'sectionMapId'), + sectionEventId: mapValueOfType(json, r'sectionEventId'), ); } return null; diff --git a/manager_api_new/lib/model/geo_point_dto_categorie.dart b/manager_api_new/lib/model/geo_point_dto_categorie.dart deleted file mode 100644 index 5df6384..0000000 --- a/manager_api_new/lib/model/geo_point_dto_categorie.dart +++ /dev/null @@ -1,179 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// -// @dart=2.12 - -// 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 GeoPointDTOCategorie { - /// Returns a new [GeoPointDTOCategorie] instance. - GeoPointDTOCategorie({ - this.id, - this.label = const [], - this.icon, - this.iconResourceId, - this.iconUrl, - this.order, - }); - - int? id; - - List? label; - - String? icon; - - String? iconResourceId; - - String? iconUrl; - - int? order; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is GeoPointDTOCategorie && - other.id == id && - other.label == label && - other.icon == icon && - other.iconResourceId == iconResourceId && - other.iconUrl == iconUrl && - other.order == order; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (id == null ? 0 : id!.hashCode) + - (label == null ? 0 : label!.hashCode) + - (icon == null ? 0 : icon!.hashCode) + - (iconResourceId == null ? 0 : iconResourceId!.hashCode) + - (iconUrl == null ? 0 : iconUrl!.hashCode) + - (order == null ? 0 : order!.hashCode); - - @override - String toString() => - 'GeoPointDTOCategorie[id=$id, label=$label, icon=$icon, iconResourceId=$iconResourceId, iconUrl=$iconUrl, order=$order]'; - - Map toJson() { - final json = {}; - if (this.id != null) { - json[r'id'] = this.id; - } else { - json[r'id'] = null; - } - if (this.label != null) { - json[r'label'] = this.label; - } else { - json[r'label'] = null; - } - if (this.icon != null) { - json[r'icon'] = this.icon; - } else { - json[r'icon'] = null; - } - if (this.iconResourceId != null) { - json[r'iconResourceId'] = this.iconResourceId; - } else { - json[r'iconResourceId'] = null; - } - if (this.iconUrl != null) { - json[r'iconUrl'] = this.iconUrl; - } else { - json[r'iconUrl'] = null; - } - if (this.order != null) { - json[r'order'] = this.order; - } else { - json[r'order'] = null; - } - return json; - } - - /// Returns a new [GeoPointDTOCategorie] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static GeoPointDTOCategorie? 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 "GeoPointDTOCategorie[$key]" is missing from JSON.'); - assert(json[key] != null, - 'Required key "GeoPointDTOCategorie[$key]" has a null value in JSON.'); - }); - return true; - }()); - - return GeoPointDTOCategorie( - id: mapValueOfType(json, r'id'), - label: TranslationDTO.listFromJson(json[r'label']), - icon: mapValueOfType(json, r'icon'), - iconResourceId: mapValueOfType(json, r'iconResourceId'), - iconUrl: mapValueOfType(json, r'iconUrl'), - order: mapValueOfType(json, r'order'), - ); - } - 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 = GeoPointDTOCategorie.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 = GeoPointDTOCategorie.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of GeoPointDTOCategorie-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] = GeoPointDTOCategorie.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/geometry.dart b/manager_api_new/lib/model/geometry.dart new file mode 100644 index 0000000..99b92e5 --- /dev/null +++ b/manager_api_new/lib/model/geometry.dart @@ -0,0 +1,322 @@ +// +// 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 Geometry { + /// Returns a new [Geometry] instance. + Geometry({ + this.factory_, + this.userData, + this.srid, + this.precisionModel, + this.numGeometries, + this.isSimple, + this.isValid, + this.area, + this.length, + this.centroid, + this.interiorPoint, + this.pointOnSurface, + this.envelope, + this.envelopeInternal, + this.isRectangle, + }); + + GeometryFactory? factory_; + + Object? userData; + + /// + /// 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? srid; + + GeometryPrecisionModel? precisionModel; + + /// + /// 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? numGeometries; + + /// + /// 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? isSimple; + + /// + /// 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? isValid; + + /// + /// 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. + /// + double? area; + + /// + /// 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. + /// + double? length; + + GeometryCentroid? centroid; + + GeometryCentroid? interiorPoint; + + GeometryCentroid? pointOnSurface; + + MapAnnotationGeometry? envelope; + + GeometryEnvelopeInternal? envelopeInternal; + + /// + /// 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? isRectangle; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Geometry && + other.factory_ == factory_ && + other.userData == userData && + other.srid == srid && + other.precisionModel == precisionModel && + other.numGeometries == numGeometries && + other.isSimple == isSimple && + other.isValid == isValid && + other.area == area && + other.length == length && + other.centroid == centroid && + other.interiorPoint == interiorPoint && + other.pointOnSurface == pointOnSurface && + other.envelope == envelope && + other.envelopeInternal == envelopeInternal && + other.isRectangle == isRectangle; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (factory_ == null ? 0 : factory_!.hashCode) + + (userData == null ? 0 : userData!.hashCode) + + (srid == null ? 0 : srid!.hashCode) + + (precisionModel == null ? 0 : precisionModel!.hashCode) + + (numGeometries == null ? 0 : numGeometries!.hashCode) + + (isSimple == null ? 0 : isSimple!.hashCode) + + (isValid == null ? 0 : isValid!.hashCode) + + (area == null ? 0 : area!.hashCode) + + (length == null ? 0 : length!.hashCode) + + (centroid == null ? 0 : centroid!.hashCode) + + (interiorPoint == null ? 0 : interiorPoint!.hashCode) + + (pointOnSurface == null ? 0 : pointOnSurface!.hashCode) + + (envelope == null ? 0 : envelope!.hashCode) + + (envelopeInternal == null ? 0 : envelopeInternal!.hashCode) + + (isRectangle == null ? 0 : isRectangle!.hashCode); + + @override + String toString() => + 'Geometry[factory_=$factory_, userData=$userData, srid=$srid, precisionModel=$precisionModel, numGeometries=$numGeometries, isSimple=$isSimple, isValid=$isValid, area=$area, length=$length, centroid=$centroid, interiorPoint=$interiorPoint, pointOnSurface=$pointOnSurface, envelope=$envelope, envelopeInternal=$envelopeInternal, isRectangle=$isRectangle]'; + + Map toJson() { + final json = {}; + if (this.factory_ != null) { + json[r'factory'] = this.factory_; + } else { + json[r'factory'] = null; + } + if (this.userData != null) { + json[r'userData'] = this.userData; + } else { + json[r'userData'] = null; + } + if (this.srid != null) { + json[r'srid'] = this.srid; + } else { + json[r'srid'] = null; + } + if (this.precisionModel != null) { + json[r'precisionModel'] = this.precisionModel; + } else { + json[r'precisionModel'] = null; + } + if (this.numGeometries != null) { + json[r'numGeometries'] = this.numGeometries; + } else { + json[r'numGeometries'] = null; + } + if (this.isSimple != null) { + json[r'isSimple'] = this.isSimple; + } else { + json[r'isSimple'] = null; + } + if (this.isValid != null) { + json[r'isValid'] = this.isValid; + } else { + json[r'isValid'] = null; + } + if (this.area != null) { + json[r'area'] = this.area; + } else { + json[r'area'] = null; + } + if (this.length != null) { + json[r'length'] = this.length; + } else { + json[r'length'] = null; + } + if (this.centroid != null) { + json[r'centroid'] = this.centroid; + } else { + json[r'centroid'] = null; + } + if (this.interiorPoint != null) { + json[r'interiorPoint'] = this.interiorPoint; + } else { + json[r'interiorPoint'] = null; + } + if (this.pointOnSurface != null) { + json[r'pointOnSurface'] = this.pointOnSurface; + } else { + json[r'pointOnSurface'] = null; + } + if (this.envelope != null) { + json[r'envelope'] = this.envelope; + } else { + json[r'envelope'] = null; + } + if (this.envelopeInternal != null) { + json[r'envelopeInternal'] = this.envelopeInternal; + } else { + json[r'envelopeInternal'] = null; + } + if (this.isRectangle != null) { + json[r'isRectangle'] = this.isRectangle; + } else { + json[r'isRectangle'] = null; + } + return json; + } + + /// Returns a new [Geometry] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static Geometry? 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 "Geometry[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "Geometry[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return Geometry( + factory_: GeometryFactory.fromJson(json[r'factory']), + userData: mapValueOfType(json, r'userData'), + srid: mapValueOfType(json, r'srid'), + precisionModel: + GeometryPrecisionModel.fromJson(json[r'precisionModel']), + numGeometries: mapValueOfType(json, r'numGeometries'), + isSimple: mapValueOfType(json, r'isSimple'), + isValid: mapValueOfType(json, r'isValid'), + area: mapValueOfType(json, r'area'), + length: mapValueOfType(json, r'length'), + centroid: GeometryCentroid.fromJson(json[r'centroid']), + interiorPoint: GeometryCentroid.fromJson(json[r'interiorPoint']), + pointOnSurface: GeometryCentroid.fromJson(json[r'pointOnSurface']), + envelope: MapAnnotationGeometry.fromJson(json[r'envelope']), + envelopeInternal: + GeometryEnvelopeInternal.fromJson(json[r'envelopeInternal']), + isRectangle: mapValueOfType(json, r'isRectangle'), + ); + } + 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 = Geometry.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 = Geometry.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of Geometry-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] = Geometry.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/geometry_centroid.dart b/manager_api_new/lib/model/geometry_centroid.dart new file mode 100644 index 0000000..8a2de1f --- /dev/null +++ b/manager_api_new/lib/model/geometry_centroid.dart @@ -0,0 +1,531 @@ +// +// 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 GeometryCentroid { + /// Returns a new [GeometryCentroid] instance. + GeometryCentroid({ + this.factory_, + this.userData, + this.srid, + this.precisionModel, + this.numGeometries, + this.isSimple, + this.isValid, + this.area, + this.length, + this.centroid, + this.interiorPoint, + this.pointOnSurface, + this.envelope, + this.envelopeInternal, + this.isRectangle, + this.coordinateSequence, + this.coordinates = const [], + this.numPoints, + this.isEmpty, + this.dimension, + this.boundaryDimension, + this.x, + this.y, + this.coordinate, + this.geometryType, + this.ogcGeometryType, + this.boundary, + this.z, + this.m, + }); + + GeometryFactory? factory_; + + Object? userData; + + /// + /// 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? srid; + + GeometryPrecisionModel? precisionModel; + + /// + /// 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? numGeometries; + + /// + /// 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? isSimple; + + /// + /// 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? isValid; + + /// + /// 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. + /// + double? area; + + /// + /// 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. + /// + double? length; + + GeometryCentroid? centroid; + + GeometryCentroid? interiorPoint; + + GeometryCentroid? pointOnSurface; + + MapAnnotationGeometry? envelope; + + GeometryEnvelopeInternal? envelopeInternal; + + /// + /// 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? isRectangle; + + PointAllOfCoordinateSequence? coordinateSequence; + + List? coordinates; + + /// + /// 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? numPoints; + + /// + /// 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? isEmpty; + + /// + /// 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. + /// + Dimension? dimension; + + /// + /// 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. + /// + Dimension? boundaryDimension; + + /// + /// 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. + /// + double? x; + + /// + /// 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. + /// + double? y; + + PointAllOfCoordinate? coordinate; + + String? geometryType; + + /// + /// 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. + /// + OgcGeometryType? ogcGeometryType; + + PointAllOfBoundary? boundary; + + /// + /// 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. + /// + double? z; + + /// + /// 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. + /// + double? m; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GeometryCentroid && + other.factory_ == factory_ && + other.userData == userData && + other.srid == srid && + other.precisionModel == precisionModel && + other.numGeometries == numGeometries && + other.isSimple == isSimple && + other.isValid == isValid && + other.area == area && + other.length == length && + other.centroid == centroid && + other.interiorPoint == interiorPoint && + other.pointOnSurface == pointOnSurface && + other.envelope == envelope && + other.envelopeInternal == envelopeInternal && + other.isRectangle == isRectangle && + other.coordinateSequence == coordinateSequence && + _deepEquality.equals(other.coordinates, coordinates) && + other.numPoints == numPoints && + other.isEmpty == isEmpty && + other.dimension == dimension && + other.boundaryDimension == boundaryDimension && + other.x == x && + other.y == y && + other.coordinate == coordinate && + other.geometryType == geometryType && + other.ogcGeometryType == ogcGeometryType && + other.boundary == boundary && + other.z == z && + other.m == m; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (factory_ == null ? 0 : factory_!.hashCode) + + (userData == null ? 0 : userData!.hashCode) + + (srid == null ? 0 : srid!.hashCode) + + (precisionModel == null ? 0 : precisionModel!.hashCode) + + (numGeometries == null ? 0 : numGeometries!.hashCode) + + (isSimple == null ? 0 : isSimple!.hashCode) + + (isValid == null ? 0 : isValid!.hashCode) + + (area == null ? 0 : area!.hashCode) + + (length == null ? 0 : length!.hashCode) + + (centroid == null ? 0 : centroid!.hashCode) + + (interiorPoint == null ? 0 : interiorPoint!.hashCode) + + (pointOnSurface == null ? 0 : pointOnSurface!.hashCode) + + (envelope == null ? 0 : envelope!.hashCode) + + (envelopeInternal == null ? 0 : envelopeInternal!.hashCode) + + (isRectangle == null ? 0 : isRectangle!.hashCode) + + (coordinateSequence == null ? 0 : coordinateSequence!.hashCode) + + (coordinates == null ? 0 : coordinates!.hashCode) + + (numPoints == null ? 0 : numPoints!.hashCode) + + (isEmpty == null ? 0 : isEmpty!.hashCode) + + (dimension == null ? 0 : dimension!.hashCode) + + (boundaryDimension == null ? 0 : boundaryDimension!.hashCode) + + (x == null ? 0 : x!.hashCode) + + (y == null ? 0 : y!.hashCode) + + (coordinate == null ? 0 : coordinate!.hashCode) + + (geometryType == null ? 0 : geometryType!.hashCode) + + (ogcGeometryType == null ? 0 : ogcGeometryType!.hashCode) + + (boundary == null ? 0 : boundary!.hashCode) + + (z == null ? 0 : z!.hashCode) + + (m == null ? 0 : m!.hashCode); + + @override + String toString() => + 'GeometryCentroid[factory_=$factory_, userData=$userData, srid=$srid, precisionModel=$precisionModel, numGeometries=$numGeometries, isSimple=$isSimple, isValid=$isValid, area=$area, length=$length, centroid=$centroid, interiorPoint=$interiorPoint, pointOnSurface=$pointOnSurface, envelope=$envelope, envelopeInternal=$envelopeInternal, isRectangle=$isRectangle, coordinateSequence=$coordinateSequence, coordinates=$coordinates, numPoints=$numPoints, isEmpty=$isEmpty, dimension=$dimension, boundaryDimension=$boundaryDimension, x=$x, y=$y, coordinate=$coordinate, geometryType=$geometryType, ogcGeometryType=$ogcGeometryType, boundary=$boundary, z=$z, m=$m]'; + + Map toJson() { + final json = {}; + if (this.factory_ != null) { + json[r'factory'] = this.factory_; + } else { + json[r'factory'] = null; + } + if (this.userData != null) { + json[r'userData'] = this.userData; + } else { + json[r'userData'] = null; + } + if (this.srid != null) { + json[r'srid'] = this.srid; + } else { + json[r'srid'] = null; + } + if (this.precisionModel != null) { + json[r'precisionModel'] = this.precisionModel; + } else { + json[r'precisionModel'] = null; + } + if (this.numGeometries != null) { + json[r'numGeometries'] = this.numGeometries; + } else { + json[r'numGeometries'] = null; + } + if (this.isSimple != null) { + json[r'isSimple'] = this.isSimple; + } else { + json[r'isSimple'] = null; + } + if (this.isValid != null) { + json[r'isValid'] = this.isValid; + } else { + json[r'isValid'] = null; + } + if (this.area != null) { + json[r'area'] = this.area; + } else { + json[r'area'] = null; + } + if (this.length != null) { + json[r'length'] = this.length; + } else { + json[r'length'] = null; + } + if (this.centroid != null) { + json[r'centroid'] = this.centroid; + } else { + json[r'centroid'] = null; + } + if (this.interiorPoint != null) { + json[r'interiorPoint'] = this.interiorPoint; + } else { + json[r'interiorPoint'] = null; + } + if (this.pointOnSurface != null) { + json[r'pointOnSurface'] = this.pointOnSurface; + } else { + json[r'pointOnSurface'] = null; + } + if (this.envelope != null) { + json[r'envelope'] = this.envelope; + } else { + json[r'envelope'] = null; + } + if (this.envelopeInternal != null) { + json[r'envelopeInternal'] = this.envelopeInternal; + } else { + json[r'envelopeInternal'] = null; + } + if (this.isRectangle != null) { + json[r'isRectangle'] = this.isRectangle; + } else { + json[r'isRectangle'] = null; + } + if (this.coordinateSequence != null) { + json[r'coordinateSequence'] = this.coordinateSequence; + } else { + json[r'coordinateSequence'] = null; + } + if (this.coordinates != null) { + json[r'coordinates'] = this.coordinates; + } else { + json[r'coordinates'] = null; + } + if (this.numPoints != null) { + json[r'numPoints'] = this.numPoints; + } else { + json[r'numPoints'] = null; + } + if (this.isEmpty != null) { + json[r'isEmpty'] = this.isEmpty; + } else { + json[r'isEmpty'] = null; + } + if (this.dimension != null) { + json[r'dimension'] = this.dimension; + } else { + json[r'dimension'] = null; + } + if (this.boundaryDimension != null) { + json[r'boundaryDimension'] = this.boundaryDimension; + } else { + json[r'boundaryDimension'] = null; + } + if (this.x != null) { + json[r'x'] = this.x; + } else { + json[r'x'] = null; + } + if (this.y != null) { + json[r'y'] = this.y; + } else { + json[r'y'] = null; + } + if (this.coordinate != null) { + json[r'coordinate'] = this.coordinate; + } else { + json[r'coordinate'] = null; + } + if (this.geometryType != null) { + json[r'geometryType'] = this.geometryType; + } else { + json[r'geometryType'] = null; + } + if (this.ogcGeometryType != null) { + json[r'ogcGeometryType'] = this.ogcGeometryType; + } else { + json[r'ogcGeometryType'] = null; + } + if (this.boundary != null) { + json[r'boundary'] = this.boundary; + } else { + json[r'boundary'] = null; + } + if (this.z != null) { + json[r'z'] = this.z; + } else { + json[r'z'] = null; + } + if (this.m != null) { + json[r'm'] = this.m; + } else { + json[r'm'] = null; + } + return json; + } + + /// Returns a new [GeometryCentroid] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GeometryCentroid? 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 "GeometryCentroid[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "GeometryCentroid[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GeometryCentroid( + factory_: GeometryFactory.fromJson(json[r'factory']), + userData: mapValueOfType(json, r'userData'), + srid: mapValueOfType(json, r'srid'), + precisionModel: + GeometryPrecisionModel.fromJson(json[r'precisionModel']), + numGeometries: mapValueOfType(json, r'numGeometries'), + isSimple: mapValueOfType(json, r'isSimple'), + isValid: mapValueOfType(json, r'isValid'), + area: mapValueOfType(json, r'area'), + length: mapValueOfType(json, r'length'), + centroid: GeometryCentroid.fromJson(json[r'centroid']), + interiorPoint: GeometryCentroid.fromJson(json[r'interiorPoint']), + pointOnSurface: GeometryCentroid.fromJson(json[r'pointOnSurface']), + envelope: MapAnnotationGeometry.fromJson(json[r'envelope']), + envelopeInternal: + GeometryEnvelopeInternal.fromJson(json[r'envelopeInternal']), + isRectangle: mapValueOfType(json, r'isRectangle'), + coordinateSequence: + PointAllOfCoordinateSequence.fromJson(json[r'coordinateSequence']), + coordinates: Coordinate.listFromJson(json[r'coordinates']), + numPoints: mapValueOfType(json, r'numPoints'), + isEmpty: mapValueOfType(json, r'isEmpty'), + dimension: Dimension.fromJson(json[r'dimension']), + boundaryDimension: Dimension.fromJson(json[r'boundaryDimension']), + x: mapValueOfType(json, r'x'), + y: mapValueOfType(json, r'y'), + coordinate: PointAllOfCoordinate.fromJson(json[r'coordinate']), + geometryType: mapValueOfType(json, r'geometryType'), + ogcGeometryType: OgcGeometryType.fromJson(json[r'ogcGeometryType']), + boundary: PointAllOfBoundary.fromJson(json[r'boundary']), + z: mapValueOfType(json, r'z'), + m: mapValueOfType(json, r'm'), + ); + } + 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 = GeometryCentroid.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 = GeometryCentroid.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GeometryCentroid-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] = GeometryCentroid.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/quizz_dto_bad_level.dart b/manager_api_new/lib/model/geometry_dto.dart similarity index 56% rename from manager_api_new/lib/model/quizz_dto_bad_level.dart rename to manager_api_new/lib/model/geometry_dto.dart index 4a44df1..79f9927 100644 --- a/manager_api_new/lib/model/quizz_dto_bad_level.dart +++ b/manager_api_new/lib/model/geometry_dto.dart @@ -1,7 +1,7 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.12 +// @dart=2.18 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first @@ -10,41 +10,52 @@ part of openapi.api; -class QuizzDTOBadLevel { - /// Returns a new [QuizzDTOBadLevel] instance. - QuizzDTOBadLevel({ - this.label = const [], +class GeometryDTO { + /// Returns a new [GeometryDTO] instance. + GeometryDTO({ + this.type, + this.coordinates, }); - List? label; + String? type; + + Object? coordinates; @override bool operator ==(Object other) => identical(this, other) || - other is QuizzDTOBadLevel && other.label == label; + other is GeometryDTO && + other.type == type && + other.coordinates == coordinates; @override int get hashCode => // ignore: unnecessary_parenthesis - (label == null ? 0 : label!.hashCode); + (type == null ? 0 : type!.hashCode) + + (coordinates == null ? 0 : coordinates!.hashCode); @override - String toString() => 'QuizzDTOBadLevel[label=$label]'; + String toString() => 'GeometryDTO[type=$type, coordinates=$coordinates]'; Map toJson() { final json = {}; - if (this.label != null) { - json[r'label'] = this.label; + if (this.type != null) { + json[r'type'] = this.type; } else { - json[r'label'] = null; + json[r'type'] = null; + } + if (this.coordinates != null) { + json[r'coordinates'] = this.coordinates; + } else { + json[r'coordinates'] = null; } return json; } - /// Returns a new [QuizzDTOBadLevel] instance and imports its values from + /// Returns a new [GeometryDTO] instance and imports its values from /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods - static QuizzDTOBadLevel? fromJson(dynamic value) { + static GeometryDTO? fromJson(dynamic value) { if (value is Map) { final json = value.cast(); @@ -54,28 +65,29 @@ class QuizzDTOBadLevel { assert(() { requiredKeys.forEach((key) { assert(json.containsKey(key), - 'Required key "QuizzDTOBadLevel[$key]" is missing from JSON.'); + 'Required key "GeometryDTO[$key]" is missing from JSON.'); assert(json[key] != null, - 'Required key "QuizzDTOBadLevel[$key]" has a null value in JSON.'); + 'Required key "GeometryDTO[$key]" has a null value in JSON.'); }); return true; }()); - return QuizzDTOBadLevel( - label: TranslationAndResourceDTO.listFromJson(json[r'label']), + return GeometryDTO( + type: mapValueOfType(json, r'type'), + coordinates: mapValueOfType(json, r'coordinates'), ); } return null; } - static List listFromJson( + static List listFromJson( dynamic json, { bool growable = false, }) { - final result = []; + final result = []; if (json is List && json.isNotEmpty) { for (final row in json) { - final value = QuizzDTOBadLevel.fromJson(row); + final value = GeometryDTO.fromJson(row); if (value != null) { result.add(value); } @@ -84,12 +96,12 @@ class QuizzDTOBadLevel { return result.toList(growable: growable); } - static Map mapFromJson(dynamic json) { - final map = {}; + 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 = QuizzDTOBadLevel.fromJson(entry.value); + final value = GeometryDTO.fromJson(entry.value); if (value != null) { map[entry.key] = value; } @@ -98,17 +110,17 @@ class QuizzDTOBadLevel { return map; } - // maps a json object with a list of QuizzDTOBadLevel-objects as value to a dart map - static Map> mapListFromJson( + // maps a json object with a list of GeometryDTO-objects as value to a dart map + static Map> mapListFromJson( dynamic json, { bool growable = false, }) { - final map = >{}; + final map = >{}; if (json is Map && json.isNotEmpty) { // ignore: parameter_assignments json = json.cast(); for (final entry in json.entries) { - map[entry.key] = QuizzDTOBadLevel.listFromJson( + map[entry.key] = GeometryDTO.listFromJson( entry.value, growable: growable, ); diff --git a/manager_api_new/lib/model/geometry_envelope_internal.dart b/manager_api_new/lib/model/geometry_envelope_internal.dart new file mode 100644 index 0000000..51ac8b8 --- /dev/null +++ b/manager_api_new/lib/model/geometry_envelope_internal.dart @@ -0,0 +1,311 @@ +// +// 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 GeometryEnvelopeInternal { + /// Returns a new [GeometryEnvelopeInternal] instance. + GeometryEnvelopeInternal({ + this.isNull, + this.width, + this.height, + this.diameter, + this.minX, + this.maxX, + this.minY, + this.maxY, + this.area, + this.minExtent, + this.maxExtent, + this.centre, + }); + + /// + /// 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? isNull; + + /// + /// 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. + /// + double? width; + + /// + /// 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. + /// + double? height; + + /// + /// 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. + /// + double? diameter; + + /// + /// 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. + /// + double? minX; + + /// + /// 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. + /// + double? maxX; + + /// + /// 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. + /// + double? minY; + + /// + /// 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. + /// + double? maxY; + + /// + /// 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. + /// + double? area; + + /// + /// 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. + /// + double? minExtent; + + /// + /// 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. + /// + double? maxExtent; + + PointAllOfCoordinate? centre; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GeometryEnvelopeInternal && + other.isNull == isNull && + other.width == width && + other.height == height && + other.diameter == diameter && + other.minX == minX && + other.maxX == maxX && + other.minY == minY && + other.maxY == maxY && + other.area == area && + other.minExtent == minExtent && + other.maxExtent == maxExtent && + other.centre == centre; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (isNull == null ? 0 : isNull!.hashCode) + + (width == null ? 0 : width!.hashCode) + + (height == null ? 0 : height!.hashCode) + + (diameter == null ? 0 : diameter!.hashCode) + + (minX == null ? 0 : minX!.hashCode) + + (maxX == null ? 0 : maxX!.hashCode) + + (minY == null ? 0 : minY!.hashCode) + + (maxY == null ? 0 : maxY!.hashCode) + + (area == null ? 0 : area!.hashCode) + + (minExtent == null ? 0 : minExtent!.hashCode) + + (maxExtent == null ? 0 : maxExtent!.hashCode) + + (centre == null ? 0 : centre!.hashCode); + + @override + String toString() => + 'GeometryEnvelopeInternal[isNull=$isNull, width=$width, height=$height, diameter=$diameter, minX=$minX, maxX=$maxX, minY=$minY, maxY=$maxY, area=$area, minExtent=$minExtent, maxExtent=$maxExtent, centre=$centre]'; + + Map toJson() { + final json = {}; + if (this.isNull != null) { + json[r'isNull'] = this.isNull; + } else { + json[r'isNull'] = null; + } + if (this.width != null) { + json[r'width'] = this.width; + } else { + json[r'width'] = null; + } + if (this.height != null) { + json[r'height'] = this.height; + } else { + json[r'height'] = null; + } + if (this.diameter != null) { + json[r'diameter'] = this.diameter; + } else { + json[r'diameter'] = null; + } + if (this.minX != null) { + json[r'minX'] = this.minX; + } else { + json[r'minX'] = null; + } + if (this.maxX != null) { + json[r'maxX'] = this.maxX; + } else { + json[r'maxX'] = null; + } + if (this.minY != null) { + json[r'minY'] = this.minY; + } else { + json[r'minY'] = null; + } + if (this.maxY != null) { + json[r'maxY'] = this.maxY; + } else { + json[r'maxY'] = null; + } + if (this.area != null) { + json[r'area'] = this.area; + } else { + json[r'area'] = null; + } + if (this.minExtent != null) { + json[r'minExtent'] = this.minExtent; + } else { + json[r'minExtent'] = null; + } + if (this.maxExtent != null) { + json[r'maxExtent'] = this.maxExtent; + } else { + json[r'maxExtent'] = null; + } + if (this.centre != null) { + json[r'centre'] = this.centre; + } else { + json[r'centre'] = null; + } + return json; + } + + /// Returns a new [GeometryEnvelopeInternal] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GeometryEnvelopeInternal? 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 "GeometryEnvelopeInternal[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "GeometryEnvelopeInternal[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GeometryEnvelopeInternal( + isNull: mapValueOfType(json, r'isNull'), + width: mapValueOfType(json, r'width'), + height: mapValueOfType(json, r'height'), + diameter: mapValueOfType(json, r'diameter'), + minX: mapValueOfType(json, r'minX'), + maxX: mapValueOfType(json, r'maxX'), + minY: mapValueOfType(json, r'minY'), + maxY: mapValueOfType(json, r'maxY'), + area: mapValueOfType(json, r'area'), + minExtent: mapValueOfType(json, r'minExtent'), + maxExtent: mapValueOfType(json, r'maxExtent'), + centre: PointAllOfCoordinate.fromJson(json[r'centre']), + ); + } + 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 = GeometryEnvelopeInternal.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 = GeometryEnvelopeInternal.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GeometryEnvelopeInternal-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] = GeometryEnvelopeInternal.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/geometry_factory.dart b/manager_api_new/lib/model/geometry_factory.dart new file mode 100644 index 0000000..c0c6902 --- /dev/null +++ b/manager_api_new/lib/model/geometry_factory.dart @@ -0,0 +1,169 @@ +// +// 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 GeometryFactory { + /// Returns a new [GeometryFactory] instance. + GeometryFactory({ + this.precisionModel, + this.coordinateSequenceFactory, + this.srid, + this.geometryServices, + }); + + GeometryPrecisionModel? precisionModel; + + GeometryFactoryCoordinateSequenceFactory? coordinateSequenceFactory; + + /// + /// 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? srid; + + GeometryFactoryGeometryServices? geometryServices; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GeometryFactory && + other.precisionModel == precisionModel && + other.coordinateSequenceFactory == coordinateSequenceFactory && + other.srid == srid && + other.geometryServices == geometryServices; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (precisionModel == null ? 0 : precisionModel!.hashCode) + + (coordinateSequenceFactory == null + ? 0 + : coordinateSequenceFactory!.hashCode) + + (srid == null ? 0 : srid!.hashCode) + + (geometryServices == null ? 0 : geometryServices!.hashCode); + + @override + String toString() => + 'GeometryFactory[precisionModel=$precisionModel, coordinateSequenceFactory=$coordinateSequenceFactory, srid=$srid, geometryServices=$geometryServices]'; + + Map toJson() { + final json = {}; + if (this.precisionModel != null) { + json[r'precisionModel'] = this.precisionModel; + } else { + json[r'precisionModel'] = null; + } + if (this.coordinateSequenceFactory != null) { + json[r'coordinateSequenceFactory'] = this.coordinateSequenceFactory; + } else { + json[r'coordinateSequenceFactory'] = null; + } + if (this.srid != null) { + json[r'srid'] = this.srid; + } else { + json[r'srid'] = null; + } + if (this.geometryServices != null) { + json[r'geometryServices'] = this.geometryServices; + } else { + json[r'geometryServices'] = null; + } + return json; + } + + /// Returns a new [GeometryFactory] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GeometryFactory? 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 "GeometryFactory[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "GeometryFactory[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GeometryFactory( + precisionModel: + GeometryPrecisionModel.fromJson(json[r'precisionModel']), + coordinateSequenceFactory: + GeometryFactoryCoordinateSequenceFactory.fromJson( + json[r'coordinateSequenceFactory']), + srid: mapValueOfType(json, r'srid'), + geometryServices: + GeometryFactoryGeometryServices.fromJson(json[r'geometryServices']), + ); + } + 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 = GeometryFactory.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 = GeometryFactory.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GeometryFactory-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] = GeometryFactory.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/geometry_factory_coordinate_sequence_factory.dart b/manager_api_new/lib/model/geometry_factory_coordinate_sequence_factory.dart new file mode 100644 index 0000000..4c53f40 --- /dev/null +++ b/manager_api_new/lib/model/geometry_factory_coordinate_sequence_factory.dart @@ -0,0 +1,133 @@ +// +// 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 GeometryFactoryCoordinateSequenceFactory { + /// Returns a new [GeometryFactoryCoordinateSequenceFactory] instance. + GeometryFactoryCoordinateSequenceFactory({ + this.ordinates, + }); + + /// + /// 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. + /// + Ordinates? ordinates; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GeometryFactoryCoordinateSequenceFactory && + other.ordinates == ordinates; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (ordinates == null ? 0 : ordinates!.hashCode); + + @override + String toString() => + 'GeometryFactoryCoordinateSequenceFactory[ordinates=$ordinates]'; + + Map toJson() { + final json = {}; + if (this.ordinates != null) { + json[r'ordinates'] = this.ordinates; + } else { + json[r'ordinates'] = null; + } + return json; + } + + /// Returns a new [GeometryFactoryCoordinateSequenceFactory] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GeometryFactoryCoordinateSequenceFactory? 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 "GeometryFactoryCoordinateSequenceFactory[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "GeometryFactoryCoordinateSequenceFactory[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GeometryFactoryCoordinateSequenceFactory( + ordinates: Ordinates.fromJson(json[r'ordinates']), + ); + } + 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 = GeometryFactoryCoordinateSequenceFactory.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 = + GeometryFactoryCoordinateSequenceFactory.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GeometryFactoryCoordinateSequenceFactory-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] = GeometryFactoryCoordinateSequenceFactory.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/geometry_factory_geometry_services.dart b/manager_api_new/lib/model/geometry_factory_geometry_services.dart new file mode 100644 index 0000000..c76d3dd --- /dev/null +++ b/manager_api_new/lib/model/geometry_factory_geometry_services.dart @@ -0,0 +1,187 @@ +// +// 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 GeometryFactoryGeometryServices { + /// Returns a new [GeometryFactoryGeometryServices] instance. + GeometryFactoryGeometryServices({ + this.geometryOverlay, + this.coordinateEqualityComparer, + this.defaultSRID, + this.defaultCoordinateSequenceFactory, + this.defaultPrecisionModel, + }); + + NtsGeometryServicesGeometryOverlay? geometryOverlay; + + NtsGeometryServicesCoordinateEqualityComparer? coordinateEqualityComparer; + + /// + /// 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? defaultSRID; + + GeometryFactoryCoordinateSequenceFactory? defaultCoordinateSequenceFactory; + + GeometryPrecisionModel? defaultPrecisionModel; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GeometryFactoryGeometryServices && + other.geometryOverlay == geometryOverlay && + other.coordinateEqualityComparer == coordinateEqualityComparer && + other.defaultSRID == defaultSRID && + other.defaultCoordinateSequenceFactory == + defaultCoordinateSequenceFactory && + other.defaultPrecisionModel == defaultPrecisionModel; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (geometryOverlay == null ? 0 : geometryOverlay!.hashCode) + + (coordinateEqualityComparer == null + ? 0 + : coordinateEqualityComparer!.hashCode) + + (defaultSRID == null ? 0 : defaultSRID!.hashCode) + + (defaultCoordinateSequenceFactory == null + ? 0 + : defaultCoordinateSequenceFactory!.hashCode) + + (defaultPrecisionModel == null ? 0 : defaultPrecisionModel!.hashCode); + + @override + String toString() => + 'GeometryFactoryGeometryServices[geometryOverlay=$geometryOverlay, coordinateEqualityComparer=$coordinateEqualityComparer, defaultSRID=$defaultSRID, defaultCoordinateSequenceFactory=$defaultCoordinateSequenceFactory, defaultPrecisionModel=$defaultPrecisionModel]'; + + Map toJson() { + final json = {}; + if (this.geometryOverlay != null) { + json[r'geometryOverlay'] = this.geometryOverlay; + } else { + json[r'geometryOverlay'] = null; + } + if (this.coordinateEqualityComparer != null) { + json[r'coordinateEqualityComparer'] = this.coordinateEqualityComparer; + } else { + json[r'coordinateEqualityComparer'] = null; + } + if (this.defaultSRID != null) { + json[r'defaultSRID'] = this.defaultSRID; + } else { + json[r'defaultSRID'] = null; + } + if (this.defaultCoordinateSequenceFactory != null) { + json[r'defaultCoordinateSequenceFactory'] = + this.defaultCoordinateSequenceFactory; + } else { + json[r'defaultCoordinateSequenceFactory'] = null; + } + if (this.defaultPrecisionModel != null) { + json[r'defaultPrecisionModel'] = this.defaultPrecisionModel; + } else { + json[r'defaultPrecisionModel'] = null; + } + return json; + } + + /// Returns a new [GeometryFactoryGeometryServices] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GeometryFactoryGeometryServices? 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 "GeometryFactoryGeometryServices[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "GeometryFactoryGeometryServices[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GeometryFactoryGeometryServices( + geometryOverlay: NtsGeometryServicesGeometryOverlay.fromJson( + json[r'geometryOverlay']), + coordinateEqualityComparer: + NtsGeometryServicesCoordinateEqualityComparer.fromJson( + json[r'coordinateEqualityComparer']), + defaultSRID: mapValueOfType(json, r'defaultSRID'), + defaultCoordinateSequenceFactory: + GeometryFactoryCoordinateSequenceFactory.fromJson( + json[r'defaultCoordinateSequenceFactory']), + defaultPrecisionModel: + GeometryPrecisionModel.fromJson(json[r'defaultPrecisionModel']), + ); + } + 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 = GeometryFactoryGeometryServices.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 = GeometryFactoryGeometryServices.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GeometryFactoryGeometryServices-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] = GeometryFactoryGeometryServices.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/geometry_precision_model.dart b/manager_api_new/lib/model/geometry_precision_model.dart new file mode 100644 index 0000000..56dffc3 --- /dev/null +++ b/manager_api_new/lib/model/geometry_precision_model.dart @@ -0,0 +1,202 @@ +// +// 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 GeometryPrecisionModel { + /// Returns a new [GeometryPrecisionModel] instance. + GeometryPrecisionModel({ + this.isFloating, + this.maximumSignificantDigits, + this.scale, + this.gridSize, + this.precisionModelType, + }); + + /// + /// 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? isFloating; + + /// + /// 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? maximumSignificantDigits; + + /// + /// 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. + /// + double? scale; + + /// + /// 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. + /// + double? gridSize; + + /// + /// 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. + /// + PrecisionModels? precisionModelType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GeometryPrecisionModel && + other.isFloating == isFloating && + other.maximumSignificantDigits == maximumSignificantDigits && + other.scale == scale && + other.gridSize == gridSize && + other.precisionModelType == precisionModelType; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (isFloating == null ? 0 : isFloating!.hashCode) + + (maximumSignificantDigits == null + ? 0 + : maximumSignificantDigits!.hashCode) + + (scale == null ? 0 : scale!.hashCode) + + (gridSize == null ? 0 : gridSize!.hashCode) + + (precisionModelType == null ? 0 : precisionModelType!.hashCode); + + @override + String toString() => + 'GeometryPrecisionModel[isFloating=$isFloating, maximumSignificantDigits=$maximumSignificantDigits, scale=$scale, gridSize=$gridSize, precisionModelType=$precisionModelType]'; + + Map toJson() { + final json = {}; + if (this.isFloating != null) { + json[r'isFloating'] = this.isFloating; + } else { + json[r'isFloating'] = null; + } + if (this.maximumSignificantDigits != null) { + json[r'maximumSignificantDigits'] = this.maximumSignificantDigits; + } else { + json[r'maximumSignificantDigits'] = null; + } + if (this.scale != null) { + json[r'scale'] = this.scale; + } else { + json[r'scale'] = null; + } + if (this.gridSize != null) { + json[r'gridSize'] = this.gridSize; + } else { + json[r'gridSize'] = null; + } + if (this.precisionModelType != null) { + json[r'precisionModelType'] = this.precisionModelType; + } else { + json[r'precisionModelType'] = null; + } + return json; + } + + /// Returns a new [GeometryPrecisionModel] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GeometryPrecisionModel? 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 "GeometryPrecisionModel[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "GeometryPrecisionModel[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GeometryPrecisionModel( + isFloating: mapValueOfType(json, r'isFloating'), + maximumSignificantDigits: + mapValueOfType(json, r'maximumSignificantDigits'), + scale: mapValueOfType(json, r'scale'), + gridSize: mapValueOfType(json, r'gridSize'), + precisionModelType: + PrecisionModels.fromJson(json[r'precisionModelType']), + ); + } + 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 = GeometryPrecisionModel.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 = GeometryPrecisionModel.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GeometryPrecisionModel-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] = GeometryPrecisionModel.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/geometry_type.dart b/manager_api_new/lib/model/geometry_type.dart new file mode 100644 index 0000000..d3b122d --- /dev/null +++ b/manager_api_new/lib/model/geometry_type.dart @@ -0,0 +1,99 @@ +// +// 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; + +/// 0 = Point 1 = Polyline 2 = Circle 3 = Polygon +class GeometryType { + /// Instantiate a new enum with the provided [value]. + const GeometryType._(this.value); + + /// The underlying value of this enum member. + final int value; + + @override + String toString() => value.toString(); + + int toJson() => value; + + static const number0 = GeometryType._(0); + static const number1 = GeometryType._(1); + static const number2 = GeometryType._(2); + static const number3 = GeometryType._(3); + + /// List of all possible values in this [enum][GeometryType]. + static const values = [ + number0, + number1, + number2, + number3, + ]; + + static GeometryType? fromJson(dynamic value) => + GeometryTypeTypeTransformer().decode(value); + + static List listFromJson( + dynamic json, { + bool growable = false, + }) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = GeometryType.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } +} + +/// Transformation class that can [encode] an instance of [GeometryType] to int, +/// and [decode] dynamic data back to [GeometryType]. +class GeometryTypeTypeTransformer { + factory GeometryTypeTypeTransformer() => + _instance ??= const GeometryTypeTypeTransformer._(); + + const GeometryTypeTypeTransformer._(); + + int encode(GeometryType data) => data.value; + + /// Decodes a [dynamic value][data] to a GeometryType. + /// + /// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully, + /// then null is returned. However, if [allowNull] is false and the [dynamic value][data] + /// cannot be decoded successfully, then an [UnimplementedError] is thrown. + /// + /// The [allowNull] is very handy when an API changes and a new enum value is added or removed, + /// and users are still using an old app with the old code. + GeometryType? decode(dynamic data, {bool allowNull = true}) { + if (data != null) { + switch (data) { + case 0: + return GeometryType.number0; + case 1: + return GeometryType.number1; + case 2: + return GeometryType.number2; + case 3: + return GeometryType.number3; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + } + return null; + } + + /// Singleton [GeometryTypeTypeTransformer] instance. + static GeometryTypeTypeTransformer? _instance; +} diff --git a/manager_api_new/lib/model/guided_path.dart b/manager_api_new/lib/model/guided_path.dart new file mode 100644 index 0000000..b773305 --- /dev/null +++ b/manager_api_new/lib/model/guided_path.dart @@ -0,0 +1,282 @@ +// +// 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 GuidedPath { + /// Returns a new [GuidedPath] instance. + GuidedPath({ + required this.instanceId, + this.title = const [], + this.id, + this.description = const [], + this.sectionMapId, + this.sectionMap, + this.sectionEventId, + this.sectionEvent, + this.isLinear, + this.requireSuccessToAdvance, + this.hideNextStepsUntilComplete, + this.order, + this.steps = const [], + }); + + String instanceId; + + List title; + + String? id; + + List? description; + + String? sectionMapId; + + GuidedPathSectionMap? sectionMap; + + String? sectionEventId; + + ApplicationInstanceSectionEvent? sectionEvent; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? isLinear; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? requireSuccessToAdvance; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? hideNextStepsUntilComplete; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + int? order; + + List? steps; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GuidedPath && + other.instanceId == instanceId && + _deepEquality.equals(other.title, title) && + other.id == id && + _deepEquality.equals(other.description, description) && + other.sectionMapId == sectionMapId && + other.sectionMap == sectionMap && + other.sectionEventId == sectionEventId && + other.sectionEvent == sectionEvent && + other.isLinear == isLinear && + other.requireSuccessToAdvance == requireSuccessToAdvance && + other.hideNextStepsUntilComplete == hideNextStepsUntilComplete && + other.order == order && + _deepEquality.equals(other.steps, steps); + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (instanceId.hashCode) + + (title.hashCode) + + (id == null ? 0 : id!.hashCode) + + (description == null ? 0 : description!.hashCode) + + (sectionMapId == null ? 0 : sectionMapId!.hashCode) + + (sectionMap == null ? 0 : sectionMap!.hashCode) + + (sectionEventId == null ? 0 : sectionEventId!.hashCode) + + (sectionEvent == null ? 0 : sectionEvent!.hashCode) + + (isLinear == null ? 0 : isLinear!.hashCode) + + (requireSuccessToAdvance == null + ? 0 + : requireSuccessToAdvance!.hashCode) + + (hideNextStepsUntilComplete == null + ? 0 + : hideNextStepsUntilComplete!.hashCode) + + (order == null ? 0 : order!.hashCode) + + (steps == null ? 0 : steps!.hashCode); + + @override + String toString() => + 'GuidedPath[instanceId=$instanceId, title=$title, id=$id, description=$description, sectionMapId=$sectionMapId, sectionMap=$sectionMap, sectionEventId=$sectionEventId, sectionEvent=$sectionEvent, isLinear=$isLinear, requireSuccessToAdvance=$requireSuccessToAdvance, hideNextStepsUntilComplete=$hideNextStepsUntilComplete, order=$order, steps=$steps]'; + + Map toJson() { + final json = {}; + json[r'instanceId'] = this.instanceId; + json[r'title'] = this.title; + if (this.id != null) { + json[r'id'] = this.id; + } else { + json[r'id'] = null; + } + if (this.description != null) { + json[r'description'] = this.description; + } else { + json[r'description'] = null; + } + if (this.sectionMapId != null) { + json[r'sectionMapId'] = this.sectionMapId; + } else { + json[r'sectionMapId'] = null; + } + if (this.sectionMap != null) { + json[r'sectionMap'] = this.sectionMap; + } else { + json[r'sectionMap'] = null; + } + if (this.sectionEventId != null) { + json[r'sectionEventId'] = this.sectionEventId; + } else { + json[r'sectionEventId'] = null; + } + if (this.sectionEvent != null) { + json[r'sectionEvent'] = this.sectionEvent; + } else { + json[r'sectionEvent'] = null; + } + if (this.isLinear != null) { + json[r'isLinear'] = this.isLinear; + } else { + json[r'isLinear'] = null; + } + if (this.requireSuccessToAdvance != null) { + json[r'requireSuccessToAdvance'] = this.requireSuccessToAdvance; + } else { + json[r'requireSuccessToAdvance'] = null; + } + if (this.hideNextStepsUntilComplete != null) { + json[r'hideNextStepsUntilComplete'] = this.hideNextStepsUntilComplete; + } else { + json[r'hideNextStepsUntilComplete'] = null; + } + if (this.order != null) { + json[r'order'] = this.order; + } else { + json[r'order'] = null; + } + if (this.steps != null) { + json[r'steps'] = this.steps; + } else { + json[r'steps'] = null; + } + return json; + } + + /// Returns a new [GuidedPath] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GuidedPath? 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 "GuidedPath[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "GuidedPath[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GuidedPath( + instanceId: mapValueOfType(json, r'instanceId')!, + title: TranslationDTO.listFromJson(json[r'title']), + id: mapValueOfType(json, r'id'), + description: TranslationDTO.listFromJson(json[r'description']), + sectionMapId: mapValueOfType(json, r'sectionMapId'), + sectionMap: GuidedPathSectionMap.fromJson(json[r'sectionMap']), + sectionEventId: mapValueOfType(json, r'sectionEventId'), + sectionEvent: + ApplicationInstanceSectionEvent.fromJson(json[r'sectionEvent']), + isLinear: mapValueOfType(json, r'isLinear'), + requireSuccessToAdvance: + mapValueOfType(json, r'requireSuccessToAdvance'), + hideNextStepsUntilComplete: + mapValueOfType(json, r'hideNextStepsUntilComplete'), + order: mapValueOfType(json, r'order'), + steps: GuidedStep.listFromJson(json[r'steps']), + ); + } + 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 = GuidedPath.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 = GuidedPath.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GuidedPath-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] = GuidedPath.listFromJson( + entry.value, + growable: growable, + ); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + 'instanceId', + 'title', + }; +} diff --git a/manager_api_new/lib/model/guided_path_dto.dart b/manager_api_new/lib/model/guided_path_dto.dart new file mode 100644 index 0000000..e2b1cf1 --- /dev/null +++ b/manager_api_new/lib/model/guided_path_dto.dart @@ -0,0 +1,264 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class GuidedPathDTO { + /// Returns a new [GuidedPathDTO] instance. + GuidedPathDTO({ + this.id, + this.instanceId, + this.title = const [], + this.description = const [], + this.sectionMapId, + this.sectionEventId, + this.isLinear, + this.requireSuccessToAdvance, + this.hideNextStepsUntilComplete, + this.order, + this.steps = const [], + }); + + String? id; + + String? instanceId; + + List? title; + + List? description; + + String? sectionMapId; + + String? sectionEventId; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? isLinear; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? requireSuccessToAdvance; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? hideNextStepsUntilComplete; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + int? order; + + List? steps; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GuidedPathDTO && + other.id == id && + other.instanceId == instanceId && + _deepEquality.equals(other.title, title) && + _deepEquality.equals(other.description, description) && + other.sectionMapId == sectionMapId && + other.sectionEventId == sectionEventId && + other.isLinear == isLinear && + other.requireSuccessToAdvance == requireSuccessToAdvance && + other.hideNextStepsUntilComplete == hideNextStepsUntilComplete && + other.order == order && + _deepEquality.equals(other.steps, steps); + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (instanceId == null ? 0 : instanceId!.hashCode) + + (title == null ? 0 : title!.hashCode) + + (description == null ? 0 : description!.hashCode) + + (sectionMapId == null ? 0 : sectionMapId!.hashCode) + + (sectionEventId == null ? 0 : sectionEventId!.hashCode) + + (isLinear == null ? 0 : isLinear!.hashCode) + + (requireSuccessToAdvance == null + ? 0 + : requireSuccessToAdvance!.hashCode) + + (hideNextStepsUntilComplete == null + ? 0 + : hideNextStepsUntilComplete!.hashCode) + + (order == null ? 0 : order!.hashCode) + + (steps == null ? 0 : steps!.hashCode); + + @override + String toString() => + 'GuidedPathDTO[id=$id, instanceId=$instanceId, title=$title, description=$description, sectionMapId=$sectionMapId, sectionEventId=$sectionEventId, isLinear=$isLinear, requireSuccessToAdvance=$requireSuccessToAdvance, hideNextStepsUntilComplete=$hideNextStepsUntilComplete, order=$order, steps=$steps]'; + + Map toJson() { + final json = {}; + if (this.id != null) { + json[r'id'] = this.id; + } else { + json[r'id'] = null; + } + if (this.instanceId != null) { + json[r'instanceId'] = this.instanceId; + } else { + json[r'instanceId'] = null; + } + if (this.title != null) { + json[r'title'] = this.title; + } else { + json[r'title'] = null; + } + if (this.description != null) { + json[r'description'] = this.description; + } else { + json[r'description'] = null; + } + if (this.sectionMapId != null) { + json[r'sectionMapId'] = this.sectionMapId; + } else { + json[r'sectionMapId'] = null; + } + if (this.sectionEventId != null) { + json[r'sectionEventId'] = this.sectionEventId; + } else { + json[r'sectionEventId'] = null; + } + if (this.isLinear != null) { + json[r'isLinear'] = this.isLinear; + } else { + json[r'isLinear'] = null; + } + if (this.requireSuccessToAdvance != null) { + json[r'requireSuccessToAdvance'] = this.requireSuccessToAdvance; + } else { + json[r'requireSuccessToAdvance'] = null; + } + if (this.hideNextStepsUntilComplete != null) { + json[r'hideNextStepsUntilComplete'] = this.hideNextStepsUntilComplete; + } else { + json[r'hideNextStepsUntilComplete'] = null; + } + if (this.order != null) { + json[r'order'] = this.order; + } else { + json[r'order'] = null; + } + if (this.steps != null) { + json[r'steps'] = this.steps; + } else { + json[r'steps'] = null; + } + return json; + } + + /// Returns a new [GuidedPathDTO] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GuidedPathDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), + 'Required key "GuidedPathDTO[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "GuidedPathDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GuidedPathDTO( + id: mapValueOfType(json, r'id'), + instanceId: mapValueOfType(json, r'instanceId'), + title: TranslationDTO.listFromJson(json[r'title']), + description: TranslationDTO.listFromJson(json[r'description']), + sectionMapId: mapValueOfType(json, r'sectionMapId'), + sectionEventId: mapValueOfType(json, r'sectionEventId'), + isLinear: mapValueOfType(json, r'isLinear'), + requireSuccessToAdvance: + mapValueOfType(json, r'requireSuccessToAdvance'), + hideNextStepsUntilComplete: + mapValueOfType(json, r'hideNextStepsUntilComplete'), + order: mapValueOfType(json, r'order'), + steps: GuidedStepDTO.listFromJson(json[r'steps']), + ); + } + 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 = GuidedPathDTO.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 = GuidedPathDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GuidedPathDTO-objects as value to a dart map + static Map> 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] = GuidedPathDTO.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/geo_point_section_map.dart b/manager_api_new/lib/model/guided_path_section_map.dart similarity index 83% rename from manager_api_new/lib/model/geo_point_section_map.dart rename to manager_api_new/lib/model/guided_path_section_map.dart index c9a7653..9033131 100644 --- a/manager_api_new/lib/model/geo_point_section_map.dart +++ b/manager_api_new/lib/model/guided_path_section_map.dart @@ -10,9 +10,9 @@ part of openapi.api; -class GeoPointSectionMap { - /// Returns a new [GeoPointSectionMap] instance. - GeoPointSectionMap({ +class GuidedPathSectionMap { + /// Returns a new [GuidedPathSectionMap] instance. + GuidedPathSectionMap({ required this.id, required this.label, this.title = const [], @@ -32,6 +32,7 @@ class GeoPointSectionMap { this.latitude, this.longitude, this.meterZoneGPS, + this.isActive, this.mapZoom, this.mapMapType, this.mapTypeMapbox, @@ -99,6 +100,14 @@ class GeoPointSectionMap { 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. + /// + bool? isActive; + /// /// 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 @@ -126,7 +135,7 @@ class GeoPointSectionMap { @override bool operator ==(Object other) => identical(this, other) || - other is GeoPointSectionMap && + other is GuidedPathSectionMap && other.id == id && other.label == label && _deepEquality.equals(other.title, title) && @@ -146,6 +155,7 @@ class GeoPointSectionMap { other.latitude == latitude && other.longitude == longitude && other.meterZoneGPS == meterZoneGPS && + other.isActive == isActive && other.mapZoom == mapZoom && other.mapMapType == mapMapType && other.mapTypeMapbox == mapTypeMapbox && @@ -178,6 +188,7 @@ class GeoPointSectionMap { (latitude == null ? 0 : latitude!.hashCode) + (longitude == null ? 0 : longitude!.hashCode) + (meterZoneGPS == null ? 0 : meterZoneGPS!.hashCode) + + (isActive == null ? 0 : isActive!.hashCode) + (mapZoom == null ? 0 : mapZoom!.hashCode) + (mapMapType == null ? 0 : mapMapType!.hashCode) + (mapTypeMapbox == null ? 0 : mapTypeMapbox!.hashCode) + @@ -190,7 +201,7 @@ class GeoPointSectionMap { @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]'; + 'GuidedPathSectionMap[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, isActive=$isActive, mapZoom=$mapZoom, mapMapType=$mapMapType, mapTypeMapbox=$mapTypeMapbox, mapMapProvider=$mapMapProvider, mapPoints=$mapPoints, mapResourceId=$mapResourceId, mapResource=$mapResource, mapCenterLatitude=$mapCenterLatitude, mapCenterLongitude=$mapCenterLongitude]'; Map toJson() { final json = {}; @@ -257,6 +268,11 @@ class GeoPointSectionMap { } else { json[r'meterZoneGPS'] = null; } + if (this.isActive != null) { + json[r'isActive'] = this.isActive; + } else { + json[r'isActive'] = null; + } if (this.mapZoom != null) { json[r'mapZoom'] = this.mapZoom; } else { @@ -305,10 +321,10 @@ class GeoPointSectionMap { return json; } - /// Returns a new [GeoPointSectionMap] instance and imports its values from + /// Returns a new [GuidedPathSectionMap] 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) { + static GuidedPathSectionMap? fromJson(dynamic value) { if (value is Map) { final json = value.cast(); @@ -318,14 +334,14 @@ class GeoPointSectionMap { assert(() { requiredKeys.forEach((key) { assert(json.containsKey(key), - 'Required key "GeoPointSectionMap[$key]" is missing from JSON.'); + 'Required key "GuidedPathSectionMap[$key]" is missing from JSON.'); assert(json[key] != null, - 'Required key "GeoPointSectionMap[$key]" has a null value in JSON.'); + 'Required key "GuidedPathSectionMap[$key]" has a null value in JSON.'); }); return true; }()); - return GeoPointSectionMap( + return GuidedPathSectionMap( id: mapValueOfType(json, r'id')!, label: mapValueOfType(json, r'label')!, title: TranslationDTO.listFromJson(json[r'title']), @@ -345,6 +361,7 @@ class GeoPointSectionMap { latitude: mapValueOfType(json, r'latitude'), longitude: mapValueOfType(json, r'longitude'), meterZoneGPS: mapValueOfType(json, r'meterZoneGPS'), + isActive: mapValueOfType(json, r'isActive'), mapZoom: mapValueOfType(json, r'mapZoom'), mapMapType: SectionMapAllOfMapMapType.fromJson(json[r'mapMapType']), mapTypeMapbox: @@ -361,14 +378,14 @@ class GeoPointSectionMap { return null; } - static List listFromJson( + static List listFromJson( dynamic json, { bool growable = false, }) { - final result = []; + final result = []; if (json is List && json.isNotEmpty) { for (final row in json) { - final value = GeoPointSectionMap.fromJson(row); + final value = GuidedPathSectionMap.fromJson(row); if (value != null) { result.add(value); } @@ -377,12 +394,12 @@ class GeoPointSectionMap { return result.toList(growable: growable); } - static Map mapFromJson(dynamic json) { - final map = {}; + 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); + final value = GuidedPathSectionMap.fromJson(entry.value); if (value != null) { map[entry.key] = value; } @@ -391,17 +408,17 @@ class GeoPointSectionMap { return map; } - // maps a json object with a list of GeoPointSectionMap-objects as value to a dart map - static Map> mapListFromJson( + // maps a json object with a list of GuidedPathSectionMap-objects as value to a dart map + static Map> mapListFromJson( dynamic json, { bool growable = false, }) { - final map = >{}; + 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( + map[entry.key] = GuidedPathSectionMap.listFromJson( entry.value, growable: growable, ); diff --git a/manager_api_new/lib/model/guided_step.dart b/manager_api_new/lib/model/guided_step.dart new file mode 100644 index 0000000..5e16746 --- /dev/null +++ b/manager_api_new/lib/model/guided_step.dart @@ -0,0 +1,321 @@ +// +// 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 GuidedStep { + /// Returns a new [GuidedStep] instance. + GuidedStep({ + required this.guidedPathId, + this.title = const [], + this.id, + this.guidedPath, + this.order, + this.description = const [], + this.geometry, + this.zoneRadiusMeters, + this.imageUrl, + this.triggerGeoPointId, + this.triggerGeoPoint, + this.isHiddenInitially, + this.quizQuestions = const [], + this.isStepTimer, + this.isStepLocked, + this.timerSeconds, + this.timerExpiredMessage = const [], + }); + + String guidedPathId; + + List title; + + String? id; + + GuidedStepGuidedPath? guidedPath; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + int? order; + + List? description; + + PointAllOfBoundary? geometry; + + double? zoneRadiusMeters; + + String? imageUrl; + + int? triggerGeoPointId; + + GuidedStepTriggerGeoPoint? triggerGeoPoint; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? isHiddenInitially; + + List? quizQuestions; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? isStepTimer; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? isStepLocked; + + int? timerSeconds; + + List? timerExpiredMessage; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GuidedStep && + other.guidedPathId == guidedPathId && + _deepEquality.equals(other.title, title) && + other.id == id && + other.guidedPath == guidedPath && + other.order == order && + _deepEquality.equals(other.description, description) && + other.geometry == geometry && + other.zoneRadiusMeters == zoneRadiusMeters && + other.imageUrl == imageUrl && + other.triggerGeoPointId == triggerGeoPointId && + other.triggerGeoPoint == triggerGeoPoint && + other.isHiddenInitially == isHiddenInitially && + _deepEquality.equals(other.quizQuestions, quizQuestions) && + other.isStepTimer == isStepTimer && + other.isStepLocked == isStepLocked && + other.timerSeconds == timerSeconds && + _deepEquality.equals(other.timerExpiredMessage, timerExpiredMessage); + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (guidedPathId.hashCode) + + (title.hashCode) + + (id == null ? 0 : id!.hashCode) + + (guidedPath == null ? 0 : guidedPath!.hashCode) + + (order == null ? 0 : order!.hashCode) + + (description == null ? 0 : description!.hashCode) + + (geometry == null ? 0 : geometry!.hashCode) + + (zoneRadiusMeters == null ? 0 : zoneRadiusMeters!.hashCode) + + (imageUrl == null ? 0 : imageUrl!.hashCode) + + (triggerGeoPointId == null ? 0 : triggerGeoPointId!.hashCode) + + (triggerGeoPoint == null ? 0 : triggerGeoPoint!.hashCode) + + (isHiddenInitially == null ? 0 : isHiddenInitially!.hashCode) + + (quizQuestions == null ? 0 : quizQuestions!.hashCode) + + (isStepTimer == null ? 0 : isStepTimer!.hashCode) + + (isStepLocked == null ? 0 : isStepLocked!.hashCode) + + (timerSeconds == null ? 0 : timerSeconds!.hashCode) + + (timerExpiredMessage == null ? 0 : timerExpiredMessage!.hashCode); + + @override + String toString() => + 'GuidedStep[guidedPathId=$guidedPathId, title=$title, id=$id, guidedPath=$guidedPath, order=$order, description=$description, geometry=$geometry, zoneRadiusMeters=$zoneRadiusMeters, imageUrl=$imageUrl, triggerGeoPointId=$triggerGeoPointId, triggerGeoPoint=$triggerGeoPoint, isHiddenInitially=$isHiddenInitially, quizQuestions=$quizQuestions, isStepTimer=$isStepTimer, isStepLocked=$isStepLocked, timerSeconds=$timerSeconds, timerExpiredMessage=$timerExpiredMessage]'; + + Map toJson() { + final json = {}; + json[r'guidedPathId'] = this.guidedPathId; + json[r'title'] = this.title; + if (this.id != null) { + json[r'id'] = this.id; + } else { + json[r'id'] = null; + } + if (this.guidedPath != null) { + json[r'guidedPath'] = this.guidedPath; + } else { + json[r'guidedPath'] = null; + } + if (this.order != null) { + json[r'order'] = this.order; + } else { + json[r'order'] = null; + } + if (this.description != null) { + json[r'description'] = this.description; + } else { + json[r'description'] = null; + } + if (this.geometry != null) { + json[r'geometry'] = this.geometry; + } else { + json[r'geometry'] = null; + } + if (this.zoneRadiusMeters != null) { + json[r'zoneRadiusMeters'] = this.zoneRadiusMeters; + } else { + json[r'zoneRadiusMeters'] = null; + } + if (this.imageUrl != null) { + json[r'imageUrl'] = this.imageUrl; + } else { + json[r'imageUrl'] = null; + } + if (this.triggerGeoPointId != null) { + json[r'triggerGeoPointId'] = this.triggerGeoPointId; + } else { + json[r'triggerGeoPointId'] = null; + } + if (this.triggerGeoPoint != null) { + json[r'triggerGeoPoint'] = this.triggerGeoPoint; + } else { + json[r'triggerGeoPoint'] = null; + } + if (this.isHiddenInitially != null) { + json[r'isHiddenInitially'] = this.isHiddenInitially; + } else { + json[r'isHiddenInitially'] = null; + } + if (this.quizQuestions != null) { + json[r'quizQuestions'] = this.quizQuestions; + } else { + json[r'quizQuestions'] = null; + } + if (this.isStepTimer != null) { + json[r'isStepTimer'] = this.isStepTimer; + } else { + json[r'isStepTimer'] = null; + } + if (this.isStepLocked != null) { + json[r'isStepLocked'] = this.isStepLocked; + } else { + json[r'isStepLocked'] = null; + } + if (this.timerSeconds != null) { + json[r'timerSeconds'] = this.timerSeconds; + } else { + json[r'timerSeconds'] = null; + } + if (this.timerExpiredMessage != null) { + json[r'timerExpiredMessage'] = this.timerExpiredMessage; + } else { + json[r'timerExpiredMessage'] = null; + } + return json; + } + + /// Returns a new [GuidedStep] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GuidedStep? 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 "GuidedStep[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "GuidedStep[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GuidedStep( + guidedPathId: mapValueOfType(json, r'guidedPathId')!, + title: TranslationDTO.listFromJson(json[r'title']), + id: mapValueOfType(json, r'id'), + guidedPath: GuidedStepGuidedPath.fromJson(json[r'guidedPath']), + order: mapValueOfType(json, r'order'), + description: TranslationDTO.listFromJson(json[r'description']), + geometry: PointAllOfBoundary.fromJson(json[r'geometry']), + zoneRadiusMeters: mapValueOfType(json, r'zoneRadiusMeters'), + imageUrl: mapValueOfType(json, r'imageUrl'), + triggerGeoPointId: mapValueOfType(json, r'triggerGeoPointId'), + triggerGeoPoint: + GuidedStepTriggerGeoPoint.fromJson(json[r'triggerGeoPoint']), + isHiddenInitially: mapValueOfType(json, r'isHiddenInitially'), + quizQuestions: QuizQuestion.listFromJson(json[r'quizQuestions']), + isStepTimer: mapValueOfType(json, r'isStepTimer'), + isStepLocked: mapValueOfType(json, r'isStepLocked'), + timerSeconds: mapValueOfType(json, r'timerSeconds'), + timerExpiredMessage: + TranslationDTO.listFromJson(json[r'timerExpiredMessage']), + ); + } + 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 = GuidedStep.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 = GuidedStep.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GuidedStep-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] = GuidedStep.listFromJson( + entry.value, + growable: growable, + ); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + 'guidedPathId', + 'title', + }; +} diff --git a/manager_api_new/lib/model/guided_step_dto.dart b/manager_api_new/lib/model/guided_step_dto.dart new file mode 100644 index 0000000..f03fcd4 --- /dev/null +++ b/manager_api_new/lib/model/guided_step_dto.dart @@ -0,0 +1,316 @@ +// +// 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 GuidedStepDTO { + /// Returns a new [GuidedStepDTO] instance. + GuidedStepDTO({ + this.id, + this.guidedPathId, + this.order, + this.title = const [], + this.description = const [], + this.geometry, + this.zoneRadiusMeters, + this.imageUrl, + this.triggerGeoPointId, + this.triggerGeoPoint, + this.isHiddenInitially, + this.isStepTimer, + this.isStepLocked, + this.timerSeconds, + this.timerExpiredMessage = const [], + this.quizQuestions = const [], + }); + + String? id; + + String? guidedPathId; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + int? order; + + List? title; + + List? description; + + EventAddressDTOGeometry? geometry; + + double? zoneRadiusMeters; + + String? imageUrl; + + int? triggerGeoPointId; + + GuidedStepDTOTriggerGeoPoint? triggerGeoPoint; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? isHiddenInitially; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? isStepTimer; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? isStepLocked; + + int? timerSeconds; + + List? timerExpiredMessage; + + List? quizQuestions; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GuidedStepDTO && + other.id == id && + other.guidedPathId == guidedPathId && + other.order == order && + _deepEquality.equals(other.title, title) && + _deepEquality.equals(other.description, description) && + other.geometry == geometry && + other.zoneRadiusMeters == zoneRadiusMeters && + other.imageUrl == imageUrl && + other.triggerGeoPointId == triggerGeoPointId && + other.triggerGeoPoint == triggerGeoPoint && + other.isHiddenInitially == isHiddenInitially && + other.isStepTimer == isStepTimer && + other.isStepLocked == isStepLocked && + other.timerSeconds == timerSeconds && + _deepEquality.equals( + other.timerExpiredMessage, timerExpiredMessage) && + _deepEquality.equals(other.quizQuestions, quizQuestions); + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (guidedPathId == null ? 0 : guidedPathId!.hashCode) + + (order == null ? 0 : order!.hashCode) + + (title == null ? 0 : title!.hashCode) + + (description == null ? 0 : description!.hashCode) + + (geometry == null ? 0 : geometry!.hashCode) + + (zoneRadiusMeters == null ? 0 : zoneRadiusMeters!.hashCode) + + (imageUrl == null ? 0 : imageUrl!.hashCode) + + (triggerGeoPointId == null ? 0 : triggerGeoPointId!.hashCode) + + (triggerGeoPoint == null ? 0 : triggerGeoPoint!.hashCode) + + (isHiddenInitially == null ? 0 : isHiddenInitially!.hashCode) + + (isStepTimer == null ? 0 : isStepTimer!.hashCode) + + (isStepLocked == null ? 0 : isStepLocked!.hashCode) + + (timerSeconds == null ? 0 : timerSeconds!.hashCode) + + (timerExpiredMessage == null ? 0 : timerExpiredMessage!.hashCode) + + (quizQuestions == null ? 0 : quizQuestions!.hashCode); + + @override + String toString() => + 'GuidedStepDTO[id=$id, guidedPathId=$guidedPathId, order=$order, title=$title, description=$description, geometry=$geometry, zoneRadiusMeters=$zoneRadiusMeters, imageUrl=$imageUrl, triggerGeoPointId=$triggerGeoPointId, triggerGeoPoint=$triggerGeoPoint, isHiddenInitially=$isHiddenInitially, isStepTimer=$isStepTimer, isStepLocked=$isStepLocked, timerSeconds=$timerSeconds, timerExpiredMessage=$timerExpiredMessage, quizQuestions=$quizQuestions]'; + + Map toJson() { + final json = {}; + if (this.id != null) { + json[r'id'] = this.id; + } else { + json[r'id'] = null; + } + if (this.guidedPathId != null) { + json[r'guidedPathId'] = this.guidedPathId; + } else { + json[r'guidedPathId'] = null; + } + if (this.order != null) { + json[r'order'] = this.order; + } else { + json[r'order'] = null; + } + if (this.title != null) { + json[r'title'] = this.title; + } else { + json[r'title'] = null; + } + if (this.description != null) { + json[r'description'] = this.description; + } else { + json[r'description'] = null; + } + if (this.geometry != null) { + json[r'geometry'] = this.geometry; + } else { + json[r'geometry'] = null; + } + if (this.zoneRadiusMeters != null) { + json[r'zoneRadiusMeters'] = this.zoneRadiusMeters; + } else { + json[r'zoneRadiusMeters'] = null; + } + if (this.imageUrl != null) { + json[r'imageUrl'] = this.imageUrl; + } else { + json[r'imageUrl'] = null; + } + if (this.triggerGeoPointId != null) { + json[r'triggerGeoPointId'] = this.triggerGeoPointId; + } else { + json[r'triggerGeoPointId'] = null; + } + if (this.triggerGeoPoint != null) { + json[r'triggerGeoPoint'] = this.triggerGeoPoint; + } else { + json[r'triggerGeoPoint'] = null; + } + if (this.isHiddenInitially != null) { + json[r'isHiddenInitially'] = this.isHiddenInitially; + } else { + json[r'isHiddenInitially'] = null; + } + if (this.isStepTimer != null) { + json[r'isStepTimer'] = this.isStepTimer; + } else { + json[r'isStepTimer'] = null; + } + if (this.isStepLocked != null) { + json[r'isStepLocked'] = this.isStepLocked; + } else { + json[r'isStepLocked'] = null; + } + if (this.timerSeconds != null) { + json[r'timerSeconds'] = this.timerSeconds; + } else { + json[r'timerSeconds'] = null; + } + if (this.timerExpiredMessage != null) { + json[r'timerExpiredMessage'] = this.timerExpiredMessage; + } else { + json[r'timerExpiredMessage'] = null; + } + if (this.quizQuestions != null) { + json[r'quizQuestions'] = this.quizQuestions; + } else { + json[r'quizQuestions'] = null; + } + return json; + } + + /// Returns a new [GuidedStepDTO] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GuidedStepDTO? 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 "GuidedStepDTO[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "GuidedStepDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GuidedStepDTO( + id: mapValueOfType(json, r'id'), + guidedPathId: mapValueOfType(json, r'guidedPathId'), + order: mapValueOfType(json, r'order'), + title: TranslationDTO.listFromJson(json[r'title']), + description: TranslationDTO.listFromJson(json[r'description']), + geometry: EventAddressDTOGeometry.fromJson(json[r'geometry']), + zoneRadiusMeters: mapValueOfType(json, r'zoneRadiusMeters'), + imageUrl: mapValueOfType(json, r'imageUrl'), + triggerGeoPointId: mapValueOfType(json, r'triggerGeoPointId'), + triggerGeoPoint: + GuidedStepDTOTriggerGeoPoint.fromJson(json[r'triggerGeoPoint']), + isHiddenInitially: mapValueOfType(json, r'isHiddenInitially'), + isStepTimer: mapValueOfType(json, r'isStepTimer'), + isStepLocked: mapValueOfType(json, r'isStepLocked'), + timerSeconds: mapValueOfType(json, r'timerSeconds'), + timerExpiredMessage: + TranslationDTO.listFromJson(json[r'timerExpiredMessage']), + quizQuestions: QuizQuestion.listFromJson(json[r'quizQuestions']), + ); + } + 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 = GuidedStepDTO.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 = GuidedStepDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GuidedStepDTO-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] = GuidedStepDTO.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/guided_step_dto_trigger_geo_point.dart b/manager_api_new/lib/model/guided_step_dto_trigger_geo_point.dart new file mode 100644 index 0000000..d29ba68 --- /dev/null +++ b/manager_api_new/lib/model/guided_step_dto_trigger_geo_point.dart @@ -0,0 +1,289 @@ +// +// 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 GuidedStepDTOTriggerGeoPoint { + /// Returns a new [GuidedStepDTOTriggerGeoPoint] instance. + GuidedStepDTOTriggerGeoPoint({ + this.id, + this.title = const [], + this.description = const [], + this.contents = const [], + this.categorieId, + this.imageResourceId, + this.imageUrl, + this.schedules = const [], + this.prices = const [], + this.phone = const [], + this.email = const [], + this.site = const [], + this.geometry, + this.polyColor, + this.sectionMapId, + this.sectionEventId, + }); + + int? id; + + List? title; + + List? description; + + List? contents; + + int? categorieId; + + String? imageResourceId; + + String? imageUrl; + + List? schedules; + + List? prices; + + List? phone; + + List? email; + + List? site; + + EventAddressDTOGeometry? geometry; + + String? polyColor; + + String? sectionMapId; + + String? sectionEventId; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GuidedStepDTOTriggerGeoPoint && + other.id == id && + _deepEquality.equals(other.title, title) && + _deepEquality.equals(other.description, description) && + _deepEquality.equals(other.contents, contents) && + other.categorieId == categorieId && + other.imageResourceId == imageResourceId && + other.imageUrl == imageUrl && + _deepEquality.equals(other.schedules, schedules) && + _deepEquality.equals(other.prices, prices) && + _deepEquality.equals(other.phone, phone) && + _deepEquality.equals(other.email, email) && + _deepEquality.equals(other.site, site) && + other.geometry == geometry && + other.polyColor == polyColor && + other.sectionMapId == sectionMapId && + other.sectionEventId == sectionEventId; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (title == null ? 0 : title!.hashCode) + + (description == null ? 0 : description!.hashCode) + + (contents == null ? 0 : contents!.hashCode) + + (categorieId == null ? 0 : categorieId!.hashCode) + + (imageResourceId == null ? 0 : imageResourceId!.hashCode) + + (imageUrl == null ? 0 : imageUrl!.hashCode) + + (schedules == null ? 0 : schedules!.hashCode) + + (prices == null ? 0 : prices!.hashCode) + + (phone == null ? 0 : phone!.hashCode) + + (email == null ? 0 : email!.hashCode) + + (site == null ? 0 : site!.hashCode) + + (geometry == null ? 0 : geometry!.hashCode) + + (polyColor == null ? 0 : polyColor!.hashCode) + + (sectionMapId == null ? 0 : sectionMapId!.hashCode) + + (sectionEventId == null ? 0 : sectionEventId!.hashCode); + + @override + String toString() => + 'GuidedStepDTOTriggerGeoPoint[id=$id, title=$title, description=$description, contents=$contents, categorieId=$categorieId, imageResourceId=$imageResourceId, imageUrl=$imageUrl, schedules=$schedules, prices=$prices, phone=$phone, email=$email, site=$site, geometry=$geometry, polyColor=$polyColor, sectionMapId=$sectionMapId, sectionEventId=$sectionEventId]'; + + Map toJson() { + final json = {}; + if (this.id != null) { + json[r'id'] = this.id; + } else { + json[r'id'] = null; + } + if (this.title != null) { + json[r'title'] = this.title; + } else { + json[r'title'] = null; + } + if (this.description != null) { + json[r'description'] = this.description; + } else { + json[r'description'] = null; + } + if (this.contents != null) { + json[r'contents'] = this.contents; + } else { + json[r'contents'] = null; + } + if (this.categorieId != null) { + json[r'categorieId'] = this.categorieId; + } else { + json[r'categorieId'] = null; + } + if (this.imageResourceId != null) { + json[r'imageResourceId'] = this.imageResourceId; + } else { + json[r'imageResourceId'] = null; + } + if (this.imageUrl != null) { + json[r'imageUrl'] = this.imageUrl; + } else { + json[r'imageUrl'] = null; + } + if (this.schedules != null) { + json[r'schedules'] = this.schedules; + } else { + json[r'schedules'] = null; + } + if (this.prices != null) { + json[r'prices'] = this.prices; + } else { + json[r'prices'] = null; + } + if (this.phone != null) { + json[r'phone'] = this.phone; + } else { + json[r'phone'] = null; + } + if (this.email != null) { + json[r'email'] = this.email; + } else { + json[r'email'] = null; + } + if (this.site != null) { + json[r'site'] = this.site; + } else { + json[r'site'] = null; + } + if (this.geometry != null) { + json[r'geometry'] = this.geometry; + } else { + json[r'geometry'] = null; + } + if (this.polyColor != null) { + json[r'polyColor'] = this.polyColor; + } else { + json[r'polyColor'] = null; + } + if (this.sectionMapId != null) { + json[r'sectionMapId'] = this.sectionMapId; + } else { + json[r'sectionMapId'] = null; + } + if (this.sectionEventId != null) { + json[r'sectionEventId'] = this.sectionEventId; + } else { + json[r'sectionEventId'] = null; + } + return json; + } + + /// Returns a new [GuidedStepDTOTriggerGeoPoint] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GuidedStepDTOTriggerGeoPoint? 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 "GuidedStepDTOTriggerGeoPoint[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "GuidedStepDTOTriggerGeoPoint[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GuidedStepDTOTriggerGeoPoint( + id: mapValueOfType(json, r'id'), + title: TranslationDTO.listFromJson(json[r'title']), + description: TranslationDTO.listFromJson(json[r'description']), + contents: ContentDTO.listFromJson(json[r'contents']), + categorieId: mapValueOfType(json, r'categorieId'), + imageResourceId: mapValueOfType(json, r'imageResourceId'), + imageUrl: mapValueOfType(json, r'imageUrl'), + schedules: TranslationDTO.listFromJson(json[r'schedules']), + prices: TranslationDTO.listFromJson(json[r'prices']), + phone: TranslationDTO.listFromJson(json[r'phone']), + email: TranslationDTO.listFromJson(json[r'email']), + site: TranslationDTO.listFromJson(json[r'site']), + geometry: EventAddressDTOGeometry.fromJson(json[r'geometry']), + polyColor: mapValueOfType(json, r'polyColor'), + sectionMapId: mapValueOfType(json, r'sectionMapId'), + sectionEventId: mapValueOfType(json, r'sectionEventId'), + ); + } + 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 = GuidedStepDTOTriggerGeoPoint.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 = GuidedStepDTOTriggerGeoPoint.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GuidedStepDTOTriggerGeoPoint-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] = GuidedStepDTOTriggerGeoPoint.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/guided_step_guided_path.dart b/manager_api_new/lib/model/guided_step_guided_path.dart new file mode 100644 index 0000000..148cfbf --- /dev/null +++ b/manager_api_new/lib/model/guided_step_guided_path.dart @@ -0,0 +1,282 @@ +// +// 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 GuidedStepGuidedPath { + /// Returns a new [GuidedStepGuidedPath] instance. + GuidedStepGuidedPath({ + required this.instanceId, + this.title = const [], + this.id, + this.description = const [], + this.sectionMapId, + this.sectionMap, + this.sectionEventId, + this.sectionEvent, + this.isLinear, + this.requireSuccessToAdvance, + this.hideNextStepsUntilComplete, + this.order, + this.steps = const [], + }); + + String instanceId; + + List title; + + String? id; + + List? description; + + String? sectionMapId; + + GuidedPathSectionMap? sectionMap; + + String? sectionEventId; + + ApplicationInstanceSectionEvent? sectionEvent; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? isLinear; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? requireSuccessToAdvance; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? hideNextStepsUntilComplete; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + int? order; + + List? steps; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GuidedStepGuidedPath && + other.instanceId == instanceId && + _deepEquality.equals(other.title, title) && + other.id == id && + _deepEquality.equals(other.description, description) && + other.sectionMapId == sectionMapId && + other.sectionMap == sectionMap && + other.sectionEventId == sectionEventId && + other.sectionEvent == sectionEvent && + other.isLinear == isLinear && + other.requireSuccessToAdvance == requireSuccessToAdvance && + other.hideNextStepsUntilComplete == hideNextStepsUntilComplete && + other.order == order && + _deepEquality.equals(other.steps, steps); + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (instanceId.hashCode) + + (title.hashCode) + + (id == null ? 0 : id!.hashCode) + + (description == null ? 0 : description!.hashCode) + + (sectionMapId == null ? 0 : sectionMapId!.hashCode) + + (sectionMap == null ? 0 : sectionMap!.hashCode) + + (sectionEventId == null ? 0 : sectionEventId!.hashCode) + + (sectionEvent == null ? 0 : sectionEvent!.hashCode) + + (isLinear == null ? 0 : isLinear!.hashCode) + + (requireSuccessToAdvance == null + ? 0 + : requireSuccessToAdvance!.hashCode) + + (hideNextStepsUntilComplete == null + ? 0 + : hideNextStepsUntilComplete!.hashCode) + + (order == null ? 0 : order!.hashCode) + + (steps == null ? 0 : steps!.hashCode); + + @override + String toString() => + 'GuidedStepGuidedPath[instanceId=$instanceId, title=$title, id=$id, description=$description, sectionMapId=$sectionMapId, sectionMap=$sectionMap, sectionEventId=$sectionEventId, sectionEvent=$sectionEvent, isLinear=$isLinear, requireSuccessToAdvance=$requireSuccessToAdvance, hideNextStepsUntilComplete=$hideNextStepsUntilComplete, order=$order, steps=$steps]'; + + Map toJson() { + final json = {}; + json[r'instanceId'] = this.instanceId; + json[r'title'] = this.title; + if (this.id != null) { + json[r'id'] = this.id; + } else { + json[r'id'] = null; + } + if (this.description != null) { + json[r'description'] = this.description; + } else { + json[r'description'] = null; + } + if (this.sectionMapId != null) { + json[r'sectionMapId'] = this.sectionMapId; + } else { + json[r'sectionMapId'] = null; + } + if (this.sectionMap != null) { + json[r'sectionMap'] = this.sectionMap; + } else { + json[r'sectionMap'] = null; + } + if (this.sectionEventId != null) { + json[r'sectionEventId'] = this.sectionEventId; + } else { + json[r'sectionEventId'] = null; + } + if (this.sectionEvent != null) { + json[r'sectionEvent'] = this.sectionEvent; + } else { + json[r'sectionEvent'] = null; + } + if (this.isLinear != null) { + json[r'isLinear'] = this.isLinear; + } else { + json[r'isLinear'] = null; + } + if (this.requireSuccessToAdvance != null) { + json[r'requireSuccessToAdvance'] = this.requireSuccessToAdvance; + } else { + json[r'requireSuccessToAdvance'] = null; + } + if (this.hideNextStepsUntilComplete != null) { + json[r'hideNextStepsUntilComplete'] = this.hideNextStepsUntilComplete; + } else { + json[r'hideNextStepsUntilComplete'] = null; + } + if (this.order != null) { + json[r'order'] = this.order; + } else { + json[r'order'] = null; + } + if (this.steps != null) { + json[r'steps'] = this.steps; + } else { + json[r'steps'] = null; + } + return json; + } + + /// Returns a new [GuidedStepGuidedPath] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GuidedStepGuidedPath? 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 "GuidedStepGuidedPath[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "GuidedStepGuidedPath[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GuidedStepGuidedPath( + instanceId: mapValueOfType(json, r'instanceId')!, + title: TranslationDTO.listFromJson(json[r'title']), + id: mapValueOfType(json, r'id'), + description: TranslationDTO.listFromJson(json[r'description']), + sectionMapId: mapValueOfType(json, r'sectionMapId'), + sectionMap: GuidedPathSectionMap.fromJson(json[r'sectionMap']), + sectionEventId: mapValueOfType(json, r'sectionEventId'), + sectionEvent: + ApplicationInstanceSectionEvent.fromJson(json[r'sectionEvent']), + isLinear: mapValueOfType(json, r'isLinear'), + requireSuccessToAdvance: + mapValueOfType(json, r'requireSuccessToAdvance'), + hideNextStepsUntilComplete: + mapValueOfType(json, r'hideNextStepsUntilComplete'), + order: mapValueOfType(json, r'order'), + steps: GuidedStep.listFromJson(json[r'steps']), + ); + } + 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 = GuidedStepGuidedPath.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 = GuidedStepGuidedPath.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GuidedStepGuidedPath-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] = GuidedStepGuidedPath.listFromJson( + entry.value, + growable: growable, + ); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + 'instanceId', + 'title', + }; +} diff --git a/manager_api_new/lib/model/guided_step_trigger_geo_point.dart b/manager_api_new/lib/model/guided_step_trigger_geo_point.dart new file mode 100644 index 0000000..9f4e5bb --- /dev/null +++ b/manager_api_new/lib/model/guided_step_trigger_geo_point.dart @@ -0,0 +1,286 @@ +// +// 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 GuidedStepTriggerGeoPoint { + /// Returns a new [GuidedStepTriggerGeoPoint] instance. + GuidedStepTriggerGeoPoint({ + required this.id, + this.title = const [], + this.description = const [], + this.contents = const [], + this.schedules = const [], + this.prices = const [], + this.phone = const [], + this.email = const [], + this.site = const [], + this.categorieId, + this.geometry, + this.polyColor, + this.imageResourceId, + this.imageUrl, + this.sectionMapId, + this.sectionMap, + this.sectionEventId, + this.sectionEvent, + }); + + int id; + + List title; + + List description; + + List contents; + + List schedules; + + List prices; + + List phone; + + List email; + + List site; + + int? categorieId; + + PointAllOfBoundary? geometry; + + String? polyColor; + + String? imageResourceId; + + String? imageUrl; + + String? sectionMapId; + + GuidedPathSectionMap? sectionMap; + + String? sectionEventId; + + ApplicationInstanceSectionEvent? sectionEvent; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is GuidedStepTriggerGeoPoint && + other.id == id && + _deepEquality.equals(other.title, title) && + _deepEquality.equals(other.description, description) && + _deepEquality.equals(other.contents, contents) && + _deepEquality.equals(other.schedules, schedules) && + _deepEquality.equals(other.prices, prices) && + _deepEquality.equals(other.phone, phone) && + _deepEquality.equals(other.email, email) && + _deepEquality.equals(other.site, site) && + other.categorieId == categorieId && + other.geometry == geometry && + other.polyColor == polyColor && + other.imageResourceId == imageResourceId && + other.imageUrl == imageUrl && + other.sectionMapId == sectionMapId && + other.sectionMap == sectionMap && + other.sectionEventId == sectionEventId && + other.sectionEvent == sectionEvent; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (id.hashCode) + + (title.hashCode) + + (description.hashCode) + + (contents.hashCode) + + (schedules.hashCode) + + (prices.hashCode) + + (phone.hashCode) + + (email.hashCode) + + (site.hashCode) + + (categorieId == null ? 0 : categorieId!.hashCode) + + (geometry == null ? 0 : geometry!.hashCode) + + (polyColor == null ? 0 : polyColor!.hashCode) + + (imageResourceId == null ? 0 : imageResourceId!.hashCode) + + (imageUrl == null ? 0 : imageUrl!.hashCode) + + (sectionMapId == null ? 0 : sectionMapId!.hashCode) + + (sectionMap == null ? 0 : sectionMap!.hashCode) + + (sectionEventId == null ? 0 : sectionEventId!.hashCode) + + (sectionEvent == null ? 0 : sectionEvent!.hashCode); + + @override + String toString() => + 'GuidedStepTriggerGeoPoint[id=$id, title=$title, description=$description, contents=$contents, schedules=$schedules, prices=$prices, phone=$phone, email=$email, site=$site, categorieId=$categorieId, geometry=$geometry, polyColor=$polyColor, imageResourceId=$imageResourceId, imageUrl=$imageUrl, sectionMapId=$sectionMapId, sectionMap=$sectionMap, sectionEventId=$sectionEventId, sectionEvent=$sectionEvent]'; + + Map toJson() { + final json = {}; + json[r'id'] = this.id; + json[r'title'] = this.title; + json[r'description'] = this.description; + json[r'contents'] = this.contents; + json[r'schedules'] = this.schedules; + json[r'prices'] = this.prices; + json[r'phone'] = this.phone; + json[r'email'] = this.email; + json[r'site'] = this.site; + if (this.categorieId != null) { + json[r'categorieId'] = this.categorieId; + } else { + json[r'categorieId'] = null; + } + if (this.geometry != null) { + json[r'geometry'] = this.geometry; + } else { + json[r'geometry'] = null; + } + if (this.polyColor != null) { + json[r'polyColor'] = this.polyColor; + } else { + json[r'polyColor'] = null; + } + if (this.imageResourceId != null) { + json[r'imageResourceId'] = this.imageResourceId; + } else { + json[r'imageResourceId'] = null; + } + if (this.imageUrl != null) { + json[r'imageUrl'] = this.imageUrl; + } 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; + } + if (this.sectionEventId != null) { + json[r'sectionEventId'] = this.sectionEventId; + } else { + json[r'sectionEventId'] = null; + } + if (this.sectionEvent != null) { + json[r'sectionEvent'] = this.sectionEvent; + } else { + json[r'sectionEvent'] = null; + } + return json; + } + + /// Returns a new [GuidedStepTriggerGeoPoint] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GuidedStepTriggerGeoPoint? 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 "GuidedStepTriggerGeoPoint[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "GuidedStepTriggerGeoPoint[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GuidedStepTriggerGeoPoint( + id: mapValueOfType(json, r'id')!, + title: TranslationDTO.listFromJson(json[r'title']), + description: TranslationDTO.listFromJson(json[r'description']), + contents: ContentDTO.listFromJson(json[r'contents']), + schedules: TranslationDTO.listFromJson(json[r'schedules']), + prices: TranslationDTO.listFromJson(json[r'prices']), + phone: TranslationDTO.listFromJson(json[r'phone']), + email: TranslationDTO.listFromJson(json[r'email']), + site: TranslationDTO.listFromJson(json[r'site']), + categorieId: mapValueOfType(json, r'categorieId'), + geometry: PointAllOfBoundary.fromJson(json[r'geometry']), + polyColor: mapValueOfType(json, r'polyColor'), + imageResourceId: mapValueOfType(json, r'imageResourceId'), + imageUrl: mapValueOfType(json, r'imageUrl'), + sectionMapId: mapValueOfType(json, r'sectionMapId'), + sectionMap: GuidedPathSectionMap.fromJson(json[r'sectionMap']), + sectionEventId: mapValueOfType(json, r'sectionEventId'), + sectionEvent: + ApplicationInstanceSectionEvent.fromJson(json[r'sectionEvent']), + ); + } + 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 = GuidedStepTriggerGeoPoint.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 = GuidedStepTriggerGeoPoint.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GuidedStepTriggerGeoPoint-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] = GuidedStepTriggerGeoPoint.listFromJson( + entry.value, + growable: growable, + ); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + 'id', + 'title', + 'description', + 'contents', + 'schedules', + 'prices', + 'phone', + 'email', + 'site', + }; +} diff --git a/manager_api_new/lib/model/image_geo_point.dart b/manager_api_new/lib/model/image_geo_point.dart deleted file mode 100644 index e92d32b..0000000 --- a/manager_api_new/lib/model/image_geo_point.dart +++ /dev/null @@ -1,135 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// -// @dart=2.12 - -// 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 ImageGeoPoint { - /// Returns a new [ImageGeoPoint] instance. - ImageGeoPoint({ - this.imageResourceId, - this.imageSource, - }); - - String? imageResourceId; - - String? imageSource; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is ImageGeoPoint && - other.imageResourceId == imageResourceId && - other.imageSource == imageSource; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (imageResourceId == null ? 0 : imageResourceId!.hashCode) + - (imageSource == null ? 0 : imageSource!.hashCode); - - @override - String toString() => - 'ImageGeoPoint[imageResourceId=$imageResourceId, imageSource=$imageSource]'; - - Map toJson() { - final json = {}; - if (this.imageResourceId != null) { - json[r'imageResourceId'] = this.imageResourceId; - } else { - json[r'imageResourceId'] = null; - } - if (this.imageSource != null) { - json[r'imageSource'] = this.imageSource; - } else { - json[r'imageSource'] = null; - } - return json; - } - - /// Returns a new [ImageGeoPoint] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static ImageGeoPoint? 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 "ImageGeoPoint[$key]" is missing from JSON.'); - assert(json[key] != null, - 'Required key "ImageGeoPoint[$key]" has a null value in JSON.'); - }); - return true; - }()); - - return ImageGeoPoint( - imageResourceId: mapValueOfType(json, r'imageResourceId'), - imageSource: mapValueOfType(json, r'imageSource'), - ); - } - 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 = ImageGeoPoint.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 = ImageGeoPoint.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of ImageGeoPoint-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] = ImageGeoPoint.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/layout_main_page_type.dart b/manager_api_new/lib/model/layout_main_page_type.dart new file mode 100644 index 0000000..f70b7f3 --- /dev/null +++ b/manager_api_new/lib/model/layout_main_page_type.dart @@ -0,0 +1,91 @@ +// +// 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; + +/// 0 = SimpleGrid 1 = MasonryGrid +class LayoutMainPageType { + /// Instantiate a new enum with the provided [value]. + const LayoutMainPageType._(this.value); + + /// The underlying value of this enum member. + final int value; + + @override + String toString() => value.toString(); + + int toJson() => value; + + static const number0 = LayoutMainPageType._(0); + static const number1 = LayoutMainPageType._(1); + + /// List of all possible values in this [enum][LayoutMainPageType]. + static const values = [ + number0, + number1, + ]; + + static LayoutMainPageType? fromJson(dynamic value) => + LayoutMainPageTypeTypeTransformer().decode(value); + + static List listFromJson( + dynamic json, { + bool growable = false, + }) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = LayoutMainPageType.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } +} + +/// Transformation class that can [encode] an instance of [LayoutMainPageType] to int, +/// and [decode] dynamic data back to [LayoutMainPageType]. +class LayoutMainPageTypeTypeTransformer { + factory LayoutMainPageTypeTypeTransformer() => + _instance ??= const LayoutMainPageTypeTypeTransformer._(); + + const LayoutMainPageTypeTypeTransformer._(); + + int encode(LayoutMainPageType data) => data.value; + + /// Decodes a [dynamic value][data] to a LayoutMainPageType. + /// + /// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully, + /// then null is returned. However, if [allowNull] is false and the [dynamic value][data] + /// cannot be decoded successfully, then an [UnimplementedError] is thrown. + /// + /// The [allowNull] is very handy when an API changes and a new enum value is added or removed, + /// and users are still using an old app with the old code. + LayoutMainPageType? decode(dynamic data, {bool allowNull = true}) { + if (data != null) { + switch (data) { + case 0: + return LayoutMainPageType.number0; + case 1: + return LayoutMainPageType.number1; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + } + return null; + } + + /// Singleton [LayoutMainPageTypeTypeTransformer] instance. + static LayoutMainPageTypeTypeTransformer? _instance; +} diff --git a/manager_api_new/lib/model/map_annotation.dart b/manager_api_new/lib/model/map_annotation.dart new file mode 100644 index 0000000..407b24c --- /dev/null +++ b/manager_api_new/lib/model/map_annotation.dart @@ -0,0 +1,218 @@ +// +// 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 MapAnnotation { + /// Returns a new [MapAnnotation] instance. + MapAnnotation({ + this.id, + this.type = const [], + this.label = const [], + this.geometryType, + this.geometry, + this.polyColor, + this.icon, + this.iconResourceId, + this.iconResource, + }); + + String? id; + + List? type; + + List? label; + + /// + /// 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. + /// + GeometryType? geometryType; + + MapAnnotationGeometry? geometry; + + String? polyColor; + + String? icon; + + String? iconResourceId; + + MapAnnotationIconResource? iconResource; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is MapAnnotation && + other.id == id && + _deepEquality.equals(other.type, type) && + _deepEquality.equals(other.label, label) && + other.geometryType == geometryType && + other.geometry == geometry && + other.polyColor == polyColor && + other.icon == icon && + other.iconResourceId == iconResourceId && + other.iconResource == iconResource; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (type == null ? 0 : type!.hashCode) + + (label == null ? 0 : label!.hashCode) + + (geometryType == null ? 0 : geometryType!.hashCode) + + (geometry == null ? 0 : geometry!.hashCode) + + (polyColor == null ? 0 : polyColor!.hashCode) + + (icon == null ? 0 : icon!.hashCode) + + (iconResourceId == null ? 0 : iconResourceId!.hashCode) + + (iconResource == null ? 0 : iconResource!.hashCode); + + @override + String toString() => + 'MapAnnotation[id=$id, type=$type, label=$label, geometryType=$geometryType, geometry=$geometry, polyColor=$polyColor, icon=$icon, iconResourceId=$iconResourceId, iconResource=$iconResource]'; + + Map toJson() { + final json = {}; + if (this.id != null) { + json[r'id'] = this.id; + } else { + json[r'id'] = null; + } + if (this.type != null) { + json[r'type'] = this.type; + } else { + json[r'type'] = null; + } + if (this.label != null) { + json[r'label'] = this.label; + } else { + json[r'label'] = null; + } + if (this.geometryType != null) { + json[r'geometryType'] = this.geometryType; + } else { + json[r'geometryType'] = null; + } + if (this.geometry != null) { + json[r'geometry'] = this.geometry; + } else { + json[r'geometry'] = null; + } + if (this.polyColor != null) { + json[r'polyColor'] = this.polyColor; + } else { + json[r'polyColor'] = null; + } + if (this.icon != null) { + json[r'icon'] = this.icon; + } else { + json[r'icon'] = null; + } + if (this.iconResourceId != null) { + json[r'iconResourceId'] = this.iconResourceId; + } else { + json[r'iconResourceId'] = null; + } + if (this.iconResource != null) { + json[r'iconResource'] = this.iconResource; + } else { + json[r'iconResource'] = null; + } + return json; + } + + /// Returns a new [MapAnnotation] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static MapAnnotation? 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 "MapAnnotation[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "MapAnnotation[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return MapAnnotation( + id: mapValueOfType(json, r'id'), + type: TranslationDTO.listFromJson(json[r'type']), + label: TranslationDTO.listFromJson(json[r'label']), + geometryType: GeometryType.fromJson(json[r'geometryType']), + geometry: MapAnnotationGeometry.fromJson(json[r'geometry']), + polyColor: mapValueOfType(json, r'polyColor'), + icon: mapValueOfType(json, r'icon'), + iconResourceId: mapValueOfType(json, r'iconResourceId'), + iconResource: MapAnnotationIconResource.fromJson(json[r'iconResource']), + ); + } + 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 = MapAnnotation.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 = MapAnnotation.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of MapAnnotation-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] = MapAnnotation.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/map_annotation_dto.dart b/manager_api_new/lib/model/map_annotation_dto.dart new file mode 100644 index 0000000..e6c292e --- /dev/null +++ b/manager_api_new/lib/model/map_annotation_dto.dart @@ -0,0 +1,218 @@ +// +// 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 MapAnnotationDTO { + /// Returns a new [MapAnnotationDTO] instance. + MapAnnotationDTO({ + this.id, + this.type = const [], + this.label = const [], + this.geometryType, + this.geometry, + this.polyColor, + this.icon, + this.iconResourceId, + this.iconResource, + }); + + String? id; + + List? type; + + List? label; + + /// + /// 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. + /// + GeometryType? geometryType; + + EventAddressDTOGeometry? geometry; + + String? polyColor; + + String? icon; + + String? iconResourceId; + + PuzzleDTOAllOfPuzzleImage? iconResource; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is MapAnnotationDTO && + other.id == id && + _deepEquality.equals(other.type, type) && + _deepEquality.equals(other.label, label) && + other.geometryType == geometryType && + other.geometry == geometry && + other.polyColor == polyColor && + other.icon == icon && + other.iconResourceId == iconResourceId && + other.iconResource == iconResource; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (type == null ? 0 : type!.hashCode) + + (label == null ? 0 : label!.hashCode) + + (geometryType == null ? 0 : geometryType!.hashCode) + + (geometry == null ? 0 : geometry!.hashCode) + + (polyColor == null ? 0 : polyColor!.hashCode) + + (icon == null ? 0 : icon!.hashCode) + + (iconResourceId == null ? 0 : iconResourceId!.hashCode) + + (iconResource == null ? 0 : iconResource!.hashCode); + + @override + String toString() => + 'MapAnnotationDTO[id=$id, type=$type, label=$label, geometryType=$geometryType, geometry=$geometry, polyColor=$polyColor, icon=$icon, iconResourceId=$iconResourceId, iconResource=$iconResource]'; + + Map toJson() { + final json = {}; + if (this.id != null) { + json[r'id'] = this.id; + } else { + json[r'id'] = null; + } + if (this.type != null) { + json[r'type'] = this.type; + } else { + json[r'type'] = null; + } + if (this.label != null) { + json[r'label'] = this.label; + } else { + json[r'label'] = null; + } + if (this.geometryType != null) { + json[r'geometryType'] = this.geometryType; + } else { + json[r'geometryType'] = null; + } + if (this.geometry != null) { + json[r'geometry'] = this.geometry; + } else { + json[r'geometry'] = null; + } + if (this.polyColor != null) { + json[r'polyColor'] = this.polyColor; + } else { + json[r'polyColor'] = null; + } + if (this.icon != null) { + json[r'icon'] = this.icon; + } else { + json[r'icon'] = null; + } + if (this.iconResourceId != null) { + json[r'iconResourceId'] = this.iconResourceId; + } else { + json[r'iconResourceId'] = null; + } + if (this.iconResource != null) { + json[r'iconResource'] = this.iconResource; + } else { + json[r'iconResource'] = null; + } + return json; + } + + /// Returns a new [MapAnnotationDTO] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static MapAnnotationDTO? 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 "MapAnnotationDTO[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "MapAnnotationDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return MapAnnotationDTO( + id: mapValueOfType(json, r'id'), + type: TranslationDTO.listFromJson(json[r'type']), + label: TranslationDTO.listFromJson(json[r'label']), + geometryType: GeometryType.fromJson(json[r'geometryType']), + geometry: EventAddressDTOGeometry.fromJson(json[r'geometry']), + polyColor: mapValueOfType(json, r'polyColor'), + icon: mapValueOfType(json, r'icon'), + iconResourceId: mapValueOfType(json, r'iconResourceId'), + iconResource: PuzzleDTOAllOfPuzzleImage.fromJson(json[r'iconResource']), + ); + } + 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 = MapAnnotationDTO.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 = MapAnnotationDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of MapAnnotationDTO-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] = MapAnnotationDTO.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/map_annotation_geometry.dart b/manager_api_new/lib/model/map_annotation_geometry.dart new file mode 100644 index 0000000..f2d5a45 --- /dev/null +++ b/manager_api_new/lib/model/map_annotation_geometry.dart @@ -0,0 +1,322 @@ +// +// 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 MapAnnotationGeometry { + /// Returns a new [MapAnnotationGeometry] instance. + MapAnnotationGeometry({ + this.factory_, + this.userData, + this.srid, + this.precisionModel, + this.numGeometries, + this.isSimple, + this.isValid, + this.area, + this.length, + this.centroid, + this.interiorPoint, + this.pointOnSurface, + this.envelope, + this.envelopeInternal, + this.isRectangle, + }); + + GeometryFactory? factory_; + + Object? userData; + + /// + /// 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? srid; + + GeometryPrecisionModel? precisionModel; + + /// + /// 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? numGeometries; + + /// + /// 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? isSimple; + + /// + /// 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? isValid; + + /// + /// 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. + /// + double? area; + + /// + /// 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. + /// + double? length; + + GeometryCentroid? centroid; + + GeometryCentroid? interiorPoint; + + GeometryCentroid? pointOnSurface; + + MapAnnotationGeometry? envelope; + + GeometryEnvelopeInternal? envelopeInternal; + + /// + /// 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? isRectangle; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is MapAnnotationGeometry && + other.factory_ == factory_ && + other.userData == userData && + other.srid == srid && + other.precisionModel == precisionModel && + other.numGeometries == numGeometries && + other.isSimple == isSimple && + other.isValid == isValid && + other.area == area && + other.length == length && + other.centroid == centroid && + other.interiorPoint == interiorPoint && + other.pointOnSurface == pointOnSurface && + other.envelope == envelope && + other.envelopeInternal == envelopeInternal && + other.isRectangle == isRectangle; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (factory_ == null ? 0 : factory_!.hashCode) + + (userData == null ? 0 : userData!.hashCode) + + (srid == null ? 0 : srid!.hashCode) + + (precisionModel == null ? 0 : precisionModel!.hashCode) + + (numGeometries == null ? 0 : numGeometries!.hashCode) + + (isSimple == null ? 0 : isSimple!.hashCode) + + (isValid == null ? 0 : isValid!.hashCode) + + (area == null ? 0 : area!.hashCode) + + (length == null ? 0 : length!.hashCode) + + (centroid == null ? 0 : centroid!.hashCode) + + (interiorPoint == null ? 0 : interiorPoint!.hashCode) + + (pointOnSurface == null ? 0 : pointOnSurface!.hashCode) + + (envelope == null ? 0 : envelope!.hashCode) + + (envelopeInternal == null ? 0 : envelopeInternal!.hashCode) + + (isRectangle == null ? 0 : isRectangle!.hashCode); + + @override + String toString() => + 'MapAnnotationGeometry[factory_=$factory_, userData=$userData, srid=$srid, precisionModel=$precisionModel, numGeometries=$numGeometries, isSimple=$isSimple, isValid=$isValid, area=$area, length=$length, centroid=$centroid, interiorPoint=$interiorPoint, pointOnSurface=$pointOnSurface, envelope=$envelope, envelopeInternal=$envelopeInternal, isRectangle=$isRectangle]'; + + Map toJson() { + final json = {}; + if (this.factory_ != null) { + json[r'factory'] = this.factory_; + } else { + json[r'factory'] = null; + } + if (this.userData != null) { + json[r'userData'] = this.userData; + } else { + json[r'userData'] = null; + } + if (this.srid != null) { + json[r'srid'] = this.srid; + } else { + json[r'srid'] = null; + } + if (this.precisionModel != null) { + json[r'precisionModel'] = this.precisionModel; + } else { + json[r'precisionModel'] = null; + } + if (this.numGeometries != null) { + json[r'numGeometries'] = this.numGeometries; + } else { + json[r'numGeometries'] = null; + } + if (this.isSimple != null) { + json[r'isSimple'] = this.isSimple; + } else { + json[r'isSimple'] = null; + } + if (this.isValid != null) { + json[r'isValid'] = this.isValid; + } else { + json[r'isValid'] = null; + } + if (this.area != null) { + json[r'area'] = this.area; + } else { + json[r'area'] = null; + } + if (this.length != null) { + json[r'length'] = this.length; + } else { + json[r'length'] = null; + } + if (this.centroid != null) { + json[r'centroid'] = this.centroid; + } else { + json[r'centroid'] = null; + } + if (this.interiorPoint != null) { + json[r'interiorPoint'] = this.interiorPoint; + } else { + json[r'interiorPoint'] = null; + } + if (this.pointOnSurface != null) { + json[r'pointOnSurface'] = this.pointOnSurface; + } else { + json[r'pointOnSurface'] = null; + } + if (this.envelope != null) { + json[r'envelope'] = this.envelope; + } else { + json[r'envelope'] = null; + } + if (this.envelopeInternal != null) { + json[r'envelopeInternal'] = this.envelopeInternal; + } else { + json[r'envelopeInternal'] = null; + } + if (this.isRectangle != null) { + json[r'isRectangle'] = this.isRectangle; + } else { + json[r'isRectangle'] = null; + } + return json; + } + + /// Returns a new [MapAnnotationGeometry] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static MapAnnotationGeometry? 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 "MapAnnotationGeometry[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "MapAnnotationGeometry[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return MapAnnotationGeometry( + factory_: GeometryFactory.fromJson(json[r'factory']), + userData: mapValueOfType(json, r'userData'), + srid: mapValueOfType(json, r'srid'), + precisionModel: + GeometryPrecisionModel.fromJson(json[r'precisionModel']), + numGeometries: mapValueOfType(json, r'numGeometries'), + isSimple: mapValueOfType(json, r'isSimple'), + isValid: mapValueOfType(json, r'isValid'), + area: mapValueOfType(json, r'area'), + length: mapValueOfType(json, r'length'), + centroid: GeometryCentroid.fromJson(json[r'centroid']), + interiorPoint: GeometryCentroid.fromJson(json[r'interiorPoint']), + pointOnSurface: GeometryCentroid.fromJson(json[r'pointOnSurface']), + envelope: MapAnnotationGeometry.fromJson(json[r'envelope']), + envelopeInternal: + GeometryEnvelopeInternal.fromJson(json[r'envelopeInternal']), + isRectangle: mapValueOfType(json, r'isRectangle'), + ); + } + 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 = MapAnnotationGeometry.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 = MapAnnotationGeometry.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of MapAnnotationGeometry-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] = MapAnnotationGeometry.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/quiz_question_resource.dart b/manager_api_new/lib/model/map_annotation_icon_resource.dart similarity index 74% rename from manager_api_new/lib/model/quiz_question_resource.dart rename to manager_api_new/lib/model/map_annotation_icon_resource.dart index 84171ba..36a68c5 100644 --- a/manager_api_new/lib/model/quiz_question_resource.dart +++ b/manager_api_new/lib/model/map_annotation_icon_resource.dart @@ -10,9 +10,9 @@ part of openapi.api; -class QuizQuestionResource { - /// Returns a new [QuizQuestionResource] instance. - QuizQuestionResource({ +class MapAnnotationIconResource { + /// Returns a new [MapAnnotationIconResource] instance. + MapAnnotationIconResource({ required this.id, required this.type, required this.label, @@ -42,7 +42,7 @@ class QuizQuestionResource { @override bool operator ==(Object other) => identical(this, other) || - other is QuizQuestionResource && + other is MapAnnotationIconResource && other.id == id && other.type == type && other.label == label && @@ -62,7 +62,7 @@ class QuizQuestionResource { @override String toString() => - 'QuizQuestionResource[id=$id, type=$type, label=$label, instanceId=$instanceId, dateCreation=$dateCreation, url=$url]'; + 'MapAnnotationIconResource[id=$id, type=$type, label=$label, instanceId=$instanceId, dateCreation=$dateCreation, url=$url]'; Map toJson() { final json = {}; @@ -83,10 +83,10 @@ class QuizQuestionResource { return json; } - /// Returns a new [QuizQuestionResource] instance and imports its values from + /// Returns a new [MapAnnotationIconResource] instance and imports its values from /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods - static QuizQuestionResource? fromJson(dynamic value) { + static MapAnnotationIconResource? fromJson(dynamic value) { if (value is Map) { final json = value.cast(); @@ -96,14 +96,14 @@ class QuizQuestionResource { assert(() { requiredKeys.forEach((key) { assert(json.containsKey(key), - 'Required key "QuizQuestionResource[$key]" is missing from JSON.'); + 'Required key "MapAnnotationIconResource[$key]" is missing from JSON.'); assert(json[key] != null, - 'Required key "QuizQuestionResource[$key]" has a null value in JSON.'); + 'Required key "MapAnnotationIconResource[$key]" has a null value in JSON.'); }); return true; }()); - return QuizQuestionResource( + return MapAnnotationIconResource( id: mapValueOfType(json, r'id')!, type: ResourceType.fromJson(json[r'type'])!, label: mapValueOfType(json, r'label')!, @@ -115,14 +115,14 @@ class QuizQuestionResource { return null; } - static List listFromJson( + static List listFromJson( dynamic json, { bool growable = false, }) { - final result = []; + final result = []; if (json is List && json.isNotEmpty) { for (final row in json) { - final value = QuizQuestionResource.fromJson(row); + final value = MapAnnotationIconResource.fromJson(row); if (value != null) { result.add(value); } @@ -131,12 +131,12 @@ class QuizQuestionResource { return result.toList(growable: growable); } - static Map mapFromJson(dynamic json) { - final map = {}; + 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 = QuizQuestionResource.fromJson(entry.value); + final value = MapAnnotationIconResource.fromJson(entry.value); if (value != null) { map[entry.key] = value; } @@ -145,17 +145,17 @@ class QuizQuestionResource { return map; } - // maps a json object with a list of QuizQuestionResource-objects as value to a dart map - static Map> mapListFromJson( + // maps a json object with a list of MapAnnotationIconResource-objects as value to a dart map + static Map> mapListFromJson( dynamic json, { bool growable = false, }) { - final map = >{}; + final map = >{}; if (json is Map && json.isNotEmpty) { // ignore: parameter_assignments json = json.cast(); for (final entry in json.entries) { - map[entry.key] = QuizQuestionResource.listFromJson( + map[entry.key] = MapAnnotationIconResource.listFromJson( entry.value, growable: growable, ); diff --git a/manager_api_new/lib/model/menu_dto.dart b/manager_api_new/lib/model/menu_dto.dart index 298fba9..657821b 100644 --- a/manager_api_new/lib/model/menu_dto.dart +++ b/manager_api_new/lib/model/menu_dto.dart @@ -17,6 +17,7 @@ class MenuDTO { this.label, this.title = const [], this.description = const [], + this.isActive, this.imageId, this.imageSource, this.configurationId, @@ -42,6 +43,14 @@ class MenuDTO { 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. + /// + bool? isActive; + String? imageId; String? imageSource; @@ -66,12 +75,6 @@ class MenuDTO { /// SectionType? type; - /// - /// 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; int? order; @@ -99,34 +102,36 @@ class MenuDTO { @override bool operator ==(Object other) => identical(this, other) || - other is MenuDTO && - other.id == id && - other.label == label && - _deepEquality.equals(other.title, title) && - _deepEquality.equals(other.description, description) && - other.imageId == imageId && - other.imageSource == imageSource && - other.configurationId == configurationId && - other.isSubSection == isSubSection && - other.parentId == parentId && - other.type == type && - other.dateCreation == dateCreation && - other.order == order && - other.instanceId == instanceId && - other.latitude == latitude && - other.longitude == longitude && - other.meterZoneGPS == meterZoneGPS && - other.isBeacon == isBeacon && - other.beaconId == beaconId && - _deepEquality.equals(other.sections, sections); + other is MenuDTO && + other.id == id && + other.label == label && + _deepEquality.equals(other.title, title) && + _deepEquality.equals(other.description, description) && + other.isActive == isActive && + other.imageId == imageId && + other.imageSource == imageSource && + other.configurationId == configurationId && + other.isSubSection == isSubSection && + other.parentId == parentId && + other.type == type && + other.dateCreation == dateCreation && + other.order == order && + other.instanceId == instanceId && + other.latitude == latitude && + other.longitude == longitude && + other.meterZoneGPS == meterZoneGPS && + other.isBeacon == isBeacon && + other.beaconId == beaconId && + _deepEquality.equals(other.sections, sections); @override int get hashCode => // ignore: unnecessary_parenthesis - (id == null ? 0 : id!.hashCode) + + (id == null ? 0 : id!.hashCode) + (label == null ? 0 : label!.hashCode) + (title == null ? 0 : title!.hashCode) + (description == null ? 0 : description!.hashCode) + + (isActive == null ? 0 : isActive!.hashCode) + (imageId == null ? 0 : imageId!.hashCode) + (imageSource == null ? 0 : imageSource!.hashCode) + (configurationId == null ? 0 : configurationId!.hashCode) + @@ -145,7 +150,7 @@ class MenuDTO { @override String toString() => - 'MenuDTO[id=$id, label=$label, title=$title, description=$description, imageId=$imageId, imageSource=$imageSource, configurationId=$configurationId, isSubSection=$isSubSection, parentId=$parentId, type=$type, dateCreation=$dateCreation, order=$order, instanceId=$instanceId, latitude=$latitude, longitude=$longitude, meterZoneGPS=$meterZoneGPS, isBeacon=$isBeacon, beaconId=$beaconId, sections=$sections]'; + 'MenuDTO[id=$id, label=$label, title=$title, description=$description, isActive=$isActive, imageId=$imageId, imageSource=$imageSource, configurationId=$configurationId, isSubSection=$isSubSection, parentId=$parentId, type=$type, dateCreation=$dateCreation, order=$order, instanceId=$instanceId, latitude=$latitude, longitude=$longitude, meterZoneGPS=$meterZoneGPS, isBeacon=$isBeacon, beaconId=$beaconId, sections=$sections]'; Map toJson() { final json = {}; @@ -169,6 +174,11 @@ class MenuDTO { } else { json[r'description'] = null; } + if (this.isActive != null) { + json[r'isActive'] = this.isActive; + } else { + json[r'isActive'] = null; + } if (this.imageId != null) { json[r'imageId'] = this.imageId; } else { @@ -260,9 +270,9 @@ class MenuDTO { assert(() { requiredKeys.forEach((key) { assert(json.containsKey(key), - 'Required key "MenuDTO[$key]" is missing from JSON.'); + 'Required key "MenuDTO[$key]" is missing from JSON.'); assert(json[key] != null, - 'Required key "MenuDTO[$key]" has a null value in JSON.'); + 'Required key "MenuDTO[$key]" has a null value in JSON.'); }); return true; }()); @@ -272,6 +282,7 @@ class MenuDTO { label: mapValueOfType(json, r'label'), title: TranslationDTO.listFromJson(json[r'title']), description: TranslationDTO.listFromJson(json[r'description']), + isActive: mapValueOfType(json, r'isActive'), imageId: mapValueOfType(json, r'imageId'), imageSource: mapValueOfType(json, r'imageSource'), configurationId: mapValueOfType(json, r'configurationId'), @@ -293,9 +304,9 @@ class MenuDTO { } static List listFromJson( - dynamic json, { - bool growable = false, - }) { + dynamic json, { + bool growable = false, + }) { final result = []; if (json is List && json.isNotEmpty) { for (final row in json) { @@ -324,9 +335,9 @@ class MenuDTO { // maps a json object with a list of MenuDTO-objects as value to a dart map static Map> mapListFromJson( - dynamic json, { - bool growable = false, - }) { + dynamic json, { + bool growable = false, + }) { final map = >{}; if (json is Map && json.isNotEmpty) { // ignore: parameter_assignments diff --git a/manager_api_new/lib/model/nts_geometry_services.dart b/manager_api_new/lib/model/nts_geometry_services.dart new file mode 100644 index 0000000..fc328d6 --- /dev/null +++ b/manager_api_new/lib/model/nts_geometry_services.dart @@ -0,0 +1,186 @@ +// +// 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 NtsGeometryServices { + /// Returns a new [NtsGeometryServices] instance. + NtsGeometryServices({ + this.geometryOverlay, + this.coordinateEqualityComparer, + this.defaultSRID, + this.defaultCoordinateSequenceFactory, + this.defaultPrecisionModel, + }); + + NtsGeometryServicesGeometryOverlay? geometryOverlay; + + NtsGeometryServicesCoordinateEqualityComparer? coordinateEqualityComparer; + + /// + /// 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? defaultSRID; + + GeometryFactoryCoordinateSequenceFactory? defaultCoordinateSequenceFactory; + + GeometryPrecisionModel? defaultPrecisionModel; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is NtsGeometryServices && + other.geometryOverlay == geometryOverlay && + other.coordinateEqualityComparer == coordinateEqualityComparer && + other.defaultSRID == defaultSRID && + other.defaultCoordinateSequenceFactory == + defaultCoordinateSequenceFactory && + other.defaultPrecisionModel == defaultPrecisionModel; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (geometryOverlay == null ? 0 : geometryOverlay!.hashCode) + + (coordinateEqualityComparer == null + ? 0 + : coordinateEqualityComparer!.hashCode) + + (defaultSRID == null ? 0 : defaultSRID!.hashCode) + + (defaultCoordinateSequenceFactory == null + ? 0 + : defaultCoordinateSequenceFactory!.hashCode) + + (defaultPrecisionModel == null ? 0 : defaultPrecisionModel!.hashCode); + + @override + String toString() => + 'NtsGeometryServices[geometryOverlay=$geometryOverlay, coordinateEqualityComparer=$coordinateEqualityComparer, defaultSRID=$defaultSRID, defaultCoordinateSequenceFactory=$defaultCoordinateSequenceFactory, defaultPrecisionModel=$defaultPrecisionModel]'; + + Map toJson() { + final json = {}; + if (this.geometryOverlay != null) { + json[r'geometryOverlay'] = this.geometryOverlay; + } else { + json[r'geometryOverlay'] = null; + } + if (this.coordinateEqualityComparer != null) { + json[r'coordinateEqualityComparer'] = this.coordinateEqualityComparer; + } else { + json[r'coordinateEqualityComparer'] = null; + } + if (this.defaultSRID != null) { + json[r'defaultSRID'] = this.defaultSRID; + } else { + json[r'defaultSRID'] = null; + } + if (this.defaultCoordinateSequenceFactory != null) { + json[r'defaultCoordinateSequenceFactory'] = + this.defaultCoordinateSequenceFactory; + } else { + json[r'defaultCoordinateSequenceFactory'] = null; + } + if (this.defaultPrecisionModel != null) { + json[r'defaultPrecisionModel'] = this.defaultPrecisionModel; + } else { + json[r'defaultPrecisionModel'] = null; + } + return json; + } + + /// Returns a new [NtsGeometryServices] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static NtsGeometryServices? 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 "NtsGeometryServices[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "NtsGeometryServices[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return NtsGeometryServices( + geometryOverlay: NtsGeometryServicesGeometryOverlay.fromJson( + json[r'geometryOverlay']), + coordinateEqualityComparer: + NtsGeometryServicesCoordinateEqualityComparer.fromJson( + json[r'coordinateEqualityComparer']), + defaultSRID: mapValueOfType(json, r'defaultSRID'), + defaultCoordinateSequenceFactory: + GeometryFactoryCoordinateSequenceFactory.fromJson( + json[r'defaultCoordinateSequenceFactory']), + defaultPrecisionModel: + GeometryPrecisionModel.fromJson(json[r'defaultPrecisionModel']), + ); + } + 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 = NtsGeometryServices.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 = NtsGeometryServices.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of NtsGeometryServices-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] = NtsGeometryServices.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/nts_geometry_services_coordinate_equality_comparer.dart b/manager_api_new/lib/model/nts_geometry_services_coordinate_equality_comparer.dart new file mode 100644 index 0000000..9338bc6 --- /dev/null +++ b/manager_api_new/lib/model/nts_geometry_services_coordinate_equality_comparer.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 NtsGeometryServicesCoordinateEqualityComparer { + /// Returns a new [NtsGeometryServicesCoordinateEqualityComparer] instance. + NtsGeometryServicesCoordinateEqualityComparer(); + + @override + bool operator ==(Object other) => identical(this, other) || other is NtsGeometryServicesCoordinateEqualityComparer; + + /*@override + int get hashCode => + // ignore: unnecessary_parenthesis +*/ + @override + String toString() => 'NtsGeometryServicesCoordinateEqualityComparer[]'; + + Map toJson() { + final json = {}; + return json; + } + + /// Returns a new [NtsGeometryServicesCoordinateEqualityComparer] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static NtsGeometryServicesCoordinateEqualityComparer? 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 "NtsGeometryServicesCoordinateEqualityComparer[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "NtsGeometryServicesCoordinateEqualityComparer[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return NtsGeometryServicesCoordinateEqualityComparer( + ); + } + 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 = NtsGeometryServicesCoordinateEqualityComparer.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 = NtsGeometryServicesCoordinateEqualityComparer.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of NtsGeometryServicesCoordinateEqualityComparer-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] = NtsGeometryServicesCoordinateEqualityComparer.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/nts_geometry_services_geometry_overlay.dart b/manager_api_new/lib/model/nts_geometry_services_geometry_overlay.dart new file mode 100644 index 0000000..477a346 --- /dev/null +++ b/manager_api_new/lib/model/nts_geometry_services_geometry_overlay.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 NtsGeometryServicesGeometryOverlay { + /// Returns a new [NtsGeometryServicesGeometryOverlay] instance. + NtsGeometryServicesGeometryOverlay(); + + @override + bool operator ==(Object other) => identical(this, other) || other is NtsGeometryServicesGeometryOverlay; + + /*@override + int get hashCode => + // ignore: unnecessary_parenthesis +*/ + @override + String toString() => 'NtsGeometryServicesGeometryOverlay[]'; + + Map toJson() { + final json = {}; + return json; + } + + /// Returns a new [NtsGeometryServicesGeometryOverlay] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static NtsGeometryServicesGeometryOverlay? 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 "NtsGeometryServicesGeometryOverlay[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "NtsGeometryServicesGeometryOverlay[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return NtsGeometryServicesGeometryOverlay( + ); + } + 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 = NtsGeometryServicesGeometryOverlay.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 = NtsGeometryServicesGeometryOverlay.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of NtsGeometryServicesGeometryOverlay-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] = NtsGeometryServicesGeometryOverlay.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/ogc_geometry_type.dart b/manager_api_new/lib/model/ogc_geometry_type.dart new file mode 100644 index 0000000..5b1a27c --- /dev/null +++ b/manager_api_new/lib/model/ogc_geometry_type.dart @@ -0,0 +1,147 @@ +// +// 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; + +/// 1 = Point 2 = LineString 3 = Polygon 4 = MultiPoint 5 = MultiLineString 6 = MultiPolygon 7 = GeometryCollection 8 = CircularString 9 = CompoundCurve 10 = CurvePolygon 11 = MultiCurve 12 = MultiSurface 13 = Curve 14 = Surface 15 = PolyhedralSurface 16 = TIN +class OgcGeometryType { + /// Instantiate a new enum with the provided [value]. + const OgcGeometryType._(this.value); + + /// The underlying value of this enum member. + final int value; + + @override + String toString() => value.toString(); + + int toJson() => value; + + static const number1 = OgcGeometryType._(1); + static const number2 = OgcGeometryType._(2); + static const number3 = OgcGeometryType._(3); + static const number4 = OgcGeometryType._(4); + static const number5 = OgcGeometryType._(5); + static const number6 = OgcGeometryType._(6); + static const number7 = OgcGeometryType._(7); + static const number8 = OgcGeometryType._(8); + static const number9 = OgcGeometryType._(9); + static const number10 = OgcGeometryType._(10); + static const number11 = OgcGeometryType._(11); + static const number12 = OgcGeometryType._(12); + static const number13 = OgcGeometryType._(13); + static const number14 = OgcGeometryType._(14); + static const number15 = OgcGeometryType._(15); + static const number16 = OgcGeometryType._(16); + + /// List of all possible values in this [enum][OgcGeometryType]. + static const values = [ + number1, + number2, + number3, + number4, + number5, + number6, + number7, + number8, + number9, + number10, + number11, + number12, + number13, + number14, + number15, + number16, + ]; + + static OgcGeometryType? fromJson(dynamic value) => + OgcGeometryTypeTypeTransformer().decode(value); + + static List listFromJson( + dynamic json, { + bool growable = false, + }) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = OgcGeometryType.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } +} + +/// Transformation class that can [encode] an instance of [OgcGeometryType] to int, +/// and [decode] dynamic data back to [OgcGeometryType]. +class OgcGeometryTypeTypeTransformer { + factory OgcGeometryTypeTypeTransformer() => + _instance ??= const OgcGeometryTypeTypeTransformer._(); + + const OgcGeometryTypeTypeTransformer._(); + + int encode(OgcGeometryType data) => data.value; + + /// Decodes a [dynamic value][data] to a OgcGeometryType. + /// + /// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully, + /// then null is returned. However, if [allowNull] is false and the [dynamic value][data] + /// cannot be decoded successfully, then an [UnimplementedError] is thrown. + /// + /// The [allowNull] is very handy when an API changes and a new enum value is added or removed, + /// and users are still using an old app with the old code. + OgcGeometryType? decode(dynamic data, {bool allowNull = true}) { + if (data != null) { + switch (data) { + case 1: + return OgcGeometryType.number1; + case 2: + return OgcGeometryType.number2; + case 3: + return OgcGeometryType.number3; + case 4: + return OgcGeometryType.number4; + case 5: + return OgcGeometryType.number5; + case 6: + return OgcGeometryType.number6; + case 7: + return OgcGeometryType.number7; + case 8: + return OgcGeometryType.number8; + case 9: + return OgcGeometryType.number9; + case 10: + return OgcGeometryType.number10; + case 11: + return OgcGeometryType.number11; + case 12: + return OgcGeometryType.number12; + case 13: + return OgcGeometryType.number13; + case 14: + return OgcGeometryType.number14; + case 15: + return OgcGeometryType.number15; + case 16: + return OgcGeometryType.number16; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + } + return null; + } + + /// Singleton [OgcGeometryTypeTypeTransformer] instance. + static OgcGeometryTypeTypeTransformer? _instance; +} diff --git a/manager_api_new/lib/model/ordinates.dart b/manager_api_new/lib/model/ordinates.dart new file mode 100644 index 0000000..0d68632 --- /dev/null +++ b/manager_api_new/lib/model/ordinates.dart @@ -0,0 +1,259 @@ +// +// 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; + +/// 0 = None 1 = X 1 = Spatial1 2 = Y 2 = Spatial2 3 = XY 4 = Z 4 = Spatial3 7 = XYZ 8 = Spatial4 16 = Spatial5 32 = Spatial6 64 = Spatial7 128 = Spatial8 256 = Spatial9 512 = Spatial10 1024 = Spatial11 2048 = Spatial12 4096 = Spatial13 8192 = Spatial14 16384 = Spatial15 32768 = Spatial16 65535 = AllSpatialOrdinates 65536 = M 65536 = Measure1 65539 = XYM 65543 = XYZM 131072 = Measure2 262144 = Measure3 524288 = Measure4 1048576 = Measure5 2097152 = Measure6 4194304 = Measure7 8388608 = Measure8 16777216 = Measure9 33554432 = Measure10 67108864 = Measure11 134217728 = Measure12 268435456 = Measure13 536870912 = Measure14 1073741824 = Measure15 -2147483648 = Measure16 -65536 = AllMeasureOrdinates -1 = AllOrdinates +class Ordinates { + /// Instantiate a new enum with the provided [value]. + const Ordinates._(this.value); + + /// The underlying value of this enum member. + final int value; + + @override + String toString() => value.toString(); + + int toJson() => value; + + static const number0 = Ordinates._(0); + static const number1 = Ordinates._(1); + static const number12 = Ordinates._(1); + static const number2 = Ordinates._(2); + static const number22 = Ordinates._(2); + static const number3 = Ordinates._(3); + static const number4 = Ordinates._(4); + static const number42 = Ordinates._(4); + static const number7 = Ordinates._(7); + static const number8 = Ordinates._(8); + static const number16 = Ordinates._(16); + static const number32 = Ordinates._(32); + static const number64 = Ordinates._(64); + static const number128 = Ordinates._(128); + static const number256 = Ordinates._(256); + static const number512 = Ordinates._(512); + static const number1024 = Ordinates._(1024); + static const number2048 = Ordinates._(2048); + static const number4096 = Ordinates._(4096); + static const number8192 = Ordinates._(8192); + static const number16384 = Ordinates._(16384); + static const number32768 = Ordinates._(32768); + static const number65535 = Ordinates._(65535); + static const number65536 = Ordinates._(65536); + static const number655362 = Ordinates._(65536); + static const number65539 = Ordinates._(65539); + static const number65543 = Ordinates._(65543); + static const number131072 = Ordinates._(131072); + static const number262144 = Ordinates._(262144); + static const number524288 = Ordinates._(524288); + static const number1048576 = Ordinates._(1048576); + static const number2097152 = Ordinates._(2097152); + static const number4194304 = Ordinates._(4194304); + static const number8388608 = Ordinates._(8388608); + static const number16777216 = Ordinates._(16777216); + static const number33554432 = Ordinates._(33554432); + static const number67108864 = Ordinates._(67108864); + static const number134217728 = Ordinates._(134217728); + static const number268435456 = Ordinates._(268435456); + static const number536870912 = Ordinates._(536870912); + static const number1073741824 = Ordinates._(1073741824); + static const numberNegative2147483648 = Ordinates._(-2147483648); + static const numberNegative65536 = Ordinates._(-65536); + static const numberNegative1 = Ordinates._(-1); + + /// List of all possible values in this [enum][Ordinates]. + static const values = [ + number0, + number1, + number12, + number2, + number22, + number3, + number4, + number42, + number7, + number8, + number16, + number32, + number64, + number128, + number256, + number512, + number1024, + number2048, + number4096, + number8192, + number16384, + number32768, + number65535, + number65536, + number655362, + number65539, + number65543, + number131072, + number262144, + number524288, + number1048576, + number2097152, + number4194304, + number8388608, + number16777216, + number33554432, + number67108864, + number134217728, + number268435456, + number536870912, + number1073741824, + numberNegative2147483648, + numberNegative65536, + numberNegative1, + ]; + + static Ordinates? fromJson(dynamic value) => + OrdinatesTypeTransformer().decode(value); + + static List listFromJson( + dynamic json, { + bool growable = false, + }) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = Ordinates.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } +} + +/// Transformation class that can [encode] an instance of [Ordinates] to int, +/// and [decode] dynamic data back to [Ordinates]. +class OrdinatesTypeTransformer { + factory OrdinatesTypeTransformer() => + _instance ??= const OrdinatesTypeTransformer._(); + + const OrdinatesTypeTransformer._(); + + int encode(Ordinates data) => data.value; + + /// Decodes a [dynamic value][data] to a Ordinates. + /// + /// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully, + /// then null is returned. However, if [allowNull] is false and the [dynamic value][data] + /// cannot be decoded successfully, then an [UnimplementedError] is thrown. + /// + /// The [allowNull] is very handy when an API changes and a new enum value is added or removed, + /// and users are still using an old app with the old code. + Ordinates? decode(dynamic data, {bool allowNull = true}) { + if (data != null) { + switch (data) { + case 0: + return Ordinates.number0; + case 1: + return Ordinates.number1; + case 1: + return Ordinates.number12; + case 2: + return Ordinates.number2; + case 2: + return Ordinates.number22; + case 3: + return Ordinates.number3; + case 4: + return Ordinates.number4; + case 4: + return Ordinates.number42; + case 7: + return Ordinates.number7; + case 8: + return Ordinates.number8; + case 16: + return Ordinates.number16; + case 32: + return Ordinates.number32; + case 64: + return Ordinates.number64; + case 128: + return Ordinates.number128; + case 256: + return Ordinates.number256; + case 512: + return Ordinates.number512; + case 1024: + return Ordinates.number1024; + case 2048: + return Ordinates.number2048; + case 4096: + return Ordinates.number4096; + case 8192: + return Ordinates.number8192; + case 16384: + return Ordinates.number16384; + case 32768: + return Ordinates.number32768; + case 65535: + return Ordinates.number65535; + case 65536: + return Ordinates.number65536; + case 65536: + return Ordinates.number655362; + case 65539: + return Ordinates.number65539; + case 65543: + return Ordinates.number65543; + case 131072: + return Ordinates.number131072; + case 262144: + return Ordinates.number262144; + case 524288: + return Ordinates.number524288; + case 1048576: + return Ordinates.number1048576; + case 2097152: + return Ordinates.number2097152; + case 4194304: + return Ordinates.number4194304; + case 8388608: + return Ordinates.number8388608; + case 16777216: + return Ordinates.number16777216; + case 33554432: + return Ordinates.number33554432; + case 67108864: + return Ordinates.number67108864; + case 134217728: + return Ordinates.number134217728; + case 268435456: + return Ordinates.number268435456; + case 536870912: + return Ordinates.number536870912; + case 1073741824: + return Ordinates.number1073741824; + case -2147483648: + return Ordinates.numberNegative2147483648; + case -65536: + return Ordinates.numberNegative65536; + case -1: + return Ordinates.numberNegative1; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + } + return null; + } + + /// Singleton [OrdinatesTypeTransformer] instance. + static OrdinatesTypeTransformer? _instance; +} diff --git a/manager_api_new/lib/model/pdf_file_dto.dart b/manager_api_new/lib/model/pdf_file_dto.dart deleted file mode 100644 index dc4cfa3..0000000 --- a/manager_api_new/lib/model/pdf_file_dto.dart +++ /dev/null @@ -1,136 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// -// @dart=2.12 - -// 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 PDFFileDTO { - /// Returns a new [PDFFileDTO] instance. - PDFFileDTO({ - this.pdfFilesAndTitles = const [], - this.order, - }); - - List? pdfFilesAndTitles; - - int? order; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is PDFFileDTO && - other.pdfFilesAndTitles == pdfFilesAndTitles && - other.order == order; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (pdfFilesAndTitles == null ? 0 : pdfFilesAndTitles!.hashCode) + - (order == null ? 0 : order!.hashCode); - - @override - String toString() => - 'PDFFileDTO[pdfFilesAndTitles=$pdfFilesAndTitles, order=$order]'; - - Map toJson() { - final json = {}; - if (this.pdfFilesAndTitles != null) { - json[r'pdfFilesAndTitles'] = this.pdfFilesAndTitles; - } else { - json[r'pdfFilesAndTitles'] = null; - } - if (this.order != null) { - json[r'order'] = this.order; - } else { - json[r'order'] = null; - } - return json; - } - - /// Returns a new [PDFFileDTO] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static PDFFileDTO? 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 "PDFFileDTO[$key]" is missing from JSON.'); - assert(json[key] != null, - 'Required key "PDFFileDTO[$key]" has a null value in JSON.'); - }); - return true; - }()); - - return PDFFileDTO( - pdfFilesAndTitles: - TranslationAndResourceDTO.listFromJson(json[r'pdfFilesAndTitles']), - order: mapValueOfType(json, r'order'), - ); - } - 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 = PDFFileDTO.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 = PDFFileDTO.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of PDFFileDTO-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] = PDFFileDTO.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/point.dart b/manager_api_new/lib/model/point.dart new file mode 100644 index 0000000..8285c67 --- /dev/null +++ b/manager_api_new/lib/model/point.dart @@ -0,0 +1,531 @@ +// +// 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 Point { + /// Returns a new [Point] instance. + Point({ + this.factory_, + this.userData, + this.srid, + this.precisionModel, + this.numGeometries, + this.isSimple, + this.isValid, + this.area, + this.length, + this.centroid, + this.interiorPoint, + this.pointOnSurface, + this.envelope, + this.envelopeInternal, + this.isRectangle, + this.coordinateSequence, + this.coordinates = const [], + this.numPoints, + this.isEmpty, + this.dimension, + this.boundaryDimension, + this.x, + this.y, + this.coordinate, + this.geometryType, + this.ogcGeometryType, + this.boundary, + this.z, + this.m, + }); + + GeometryFactory? factory_; + + Object? userData; + + /// + /// 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? srid; + + GeometryPrecisionModel? precisionModel; + + /// + /// 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? numGeometries; + + /// + /// 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? isSimple; + + /// + /// 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? isValid; + + /// + /// 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. + /// + double? area; + + /// + /// 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. + /// + double? length; + + GeometryCentroid? centroid; + + GeometryCentroid? interiorPoint; + + GeometryCentroid? pointOnSurface; + + MapAnnotationGeometry? envelope; + + GeometryEnvelopeInternal? envelopeInternal; + + /// + /// 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? isRectangle; + + PointAllOfCoordinateSequence? coordinateSequence; + + List? coordinates; + + /// + /// 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? numPoints; + + /// + /// 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? isEmpty; + + /// + /// 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. + /// + Dimension? dimension; + + /// + /// 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. + /// + Dimension? boundaryDimension; + + /// + /// 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. + /// + double? x; + + /// + /// 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. + /// + double? y; + + PointAllOfCoordinate? coordinate; + + String? geometryType; + + /// + /// 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. + /// + OgcGeometryType? ogcGeometryType; + + PointAllOfBoundary? boundary; + + /// + /// 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. + /// + double? z; + + /// + /// 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. + /// + double? m; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is Point && + other.factory_ == factory_ && + other.userData == userData && + other.srid == srid && + other.precisionModel == precisionModel && + other.numGeometries == numGeometries && + other.isSimple == isSimple && + other.isValid == isValid && + other.area == area && + other.length == length && + other.centroid == centroid && + other.interiorPoint == interiorPoint && + other.pointOnSurface == pointOnSurface && + other.envelope == envelope && + other.envelopeInternal == envelopeInternal && + other.isRectangle == isRectangle && + other.coordinateSequence == coordinateSequence && + _deepEquality.equals(other.coordinates, coordinates) && + other.numPoints == numPoints && + other.isEmpty == isEmpty && + other.dimension == dimension && + other.boundaryDimension == boundaryDimension && + other.x == x && + other.y == y && + other.coordinate == coordinate && + other.geometryType == geometryType && + other.ogcGeometryType == ogcGeometryType && + other.boundary == boundary && + other.z == z && + other.m == m; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (factory_ == null ? 0 : factory_!.hashCode) + + (userData == null ? 0 : userData!.hashCode) + + (srid == null ? 0 : srid!.hashCode) + + (precisionModel == null ? 0 : precisionModel!.hashCode) + + (numGeometries == null ? 0 : numGeometries!.hashCode) + + (isSimple == null ? 0 : isSimple!.hashCode) + + (isValid == null ? 0 : isValid!.hashCode) + + (area == null ? 0 : area!.hashCode) + + (length == null ? 0 : length!.hashCode) + + (centroid == null ? 0 : centroid!.hashCode) + + (interiorPoint == null ? 0 : interiorPoint!.hashCode) + + (pointOnSurface == null ? 0 : pointOnSurface!.hashCode) + + (envelope == null ? 0 : envelope!.hashCode) + + (envelopeInternal == null ? 0 : envelopeInternal!.hashCode) + + (isRectangle == null ? 0 : isRectangle!.hashCode) + + (coordinateSequence == null ? 0 : coordinateSequence!.hashCode) + + (coordinates == null ? 0 : coordinates!.hashCode) + + (numPoints == null ? 0 : numPoints!.hashCode) + + (isEmpty == null ? 0 : isEmpty!.hashCode) + + (dimension == null ? 0 : dimension!.hashCode) + + (boundaryDimension == null ? 0 : boundaryDimension!.hashCode) + + (x == null ? 0 : x!.hashCode) + + (y == null ? 0 : y!.hashCode) + + (coordinate == null ? 0 : coordinate!.hashCode) + + (geometryType == null ? 0 : geometryType!.hashCode) + + (ogcGeometryType == null ? 0 : ogcGeometryType!.hashCode) + + (boundary == null ? 0 : boundary!.hashCode) + + (z == null ? 0 : z!.hashCode) + + (m == null ? 0 : m!.hashCode); + + @override + String toString() => + 'Point[factory_=$factory_, userData=$userData, srid=$srid, precisionModel=$precisionModel, numGeometries=$numGeometries, isSimple=$isSimple, isValid=$isValid, area=$area, length=$length, centroid=$centroid, interiorPoint=$interiorPoint, pointOnSurface=$pointOnSurface, envelope=$envelope, envelopeInternal=$envelopeInternal, isRectangle=$isRectangle, coordinateSequence=$coordinateSequence, coordinates=$coordinates, numPoints=$numPoints, isEmpty=$isEmpty, dimension=$dimension, boundaryDimension=$boundaryDimension, x=$x, y=$y, coordinate=$coordinate, geometryType=$geometryType, ogcGeometryType=$ogcGeometryType, boundary=$boundary, z=$z, m=$m]'; + + Map toJson() { + final json = {}; + if (this.factory_ != null) { + json[r'factory'] = this.factory_; + } else { + json[r'factory'] = null; + } + if (this.userData != null) { + json[r'userData'] = this.userData; + } else { + json[r'userData'] = null; + } + if (this.srid != null) { + json[r'srid'] = this.srid; + } else { + json[r'srid'] = null; + } + if (this.precisionModel != null) { + json[r'precisionModel'] = this.precisionModel; + } else { + json[r'precisionModel'] = null; + } + if (this.numGeometries != null) { + json[r'numGeometries'] = this.numGeometries; + } else { + json[r'numGeometries'] = null; + } + if (this.isSimple != null) { + json[r'isSimple'] = this.isSimple; + } else { + json[r'isSimple'] = null; + } + if (this.isValid != null) { + json[r'isValid'] = this.isValid; + } else { + json[r'isValid'] = null; + } + if (this.area != null) { + json[r'area'] = this.area; + } else { + json[r'area'] = null; + } + if (this.length != null) { + json[r'length'] = this.length; + } else { + json[r'length'] = null; + } + if (this.centroid != null) { + json[r'centroid'] = this.centroid; + } else { + json[r'centroid'] = null; + } + if (this.interiorPoint != null) { + json[r'interiorPoint'] = this.interiorPoint; + } else { + json[r'interiorPoint'] = null; + } + if (this.pointOnSurface != null) { + json[r'pointOnSurface'] = this.pointOnSurface; + } else { + json[r'pointOnSurface'] = null; + } + if (this.envelope != null) { + json[r'envelope'] = this.envelope; + } else { + json[r'envelope'] = null; + } + if (this.envelopeInternal != null) { + json[r'envelopeInternal'] = this.envelopeInternal; + } else { + json[r'envelopeInternal'] = null; + } + if (this.isRectangle != null) { + json[r'isRectangle'] = this.isRectangle; + } else { + json[r'isRectangle'] = null; + } + if (this.coordinateSequence != null) { + json[r'coordinateSequence'] = this.coordinateSequence; + } else { + json[r'coordinateSequence'] = null; + } + if (this.coordinates != null) { + json[r'coordinates'] = this.coordinates; + } else { + json[r'coordinates'] = null; + } + if (this.numPoints != null) { + json[r'numPoints'] = this.numPoints; + } else { + json[r'numPoints'] = null; + } + if (this.isEmpty != null) { + json[r'isEmpty'] = this.isEmpty; + } else { + json[r'isEmpty'] = null; + } + if (this.dimension != null) { + json[r'dimension'] = this.dimension; + } else { + json[r'dimension'] = null; + } + if (this.boundaryDimension != null) { + json[r'boundaryDimension'] = this.boundaryDimension; + } else { + json[r'boundaryDimension'] = null; + } + if (this.x != null) { + json[r'x'] = this.x; + } else { + json[r'x'] = null; + } + if (this.y != null) { + json[r'y'] = this.y; + } else { + json[r'y'] = null; + } + if (this.coordinate != null) { + json[r'coordinate'] = this.coordinate; + } else { + json[r'coordinate'] = null; + } + if (this.geometryType != null) { + json[r'geometryType'] = this.geometryType; + } else { + json[r'geometryType'] = null; + } + if (this.ogcGeometryType != null) { + json[r'ogcGeometryType'] = this.ogcGeometryType; + } else { + json[r'ogcGeometryType'] = null; + } + if (this.boundary != null) { + json[r'boundary'] = this.boundary; + } else { + json[r'boundary'] = null; + } + if (this.z != null) { + json[r'z'] = this.z; + } else { + json[r'z'] = null; + } + if (this.m != null) { + json[r'm'] = this.m; + } else { + json[r'm'] = null; + } + return json; + } + + /// Returns a new [Point] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static Point? 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 "Point[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "Point[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return Point( + factory_: GeometryFactory.fromJson(json[r'factory']), + userData: mapValueOfType(json, r'userData'), + srid: mapValueOfType(json, r'srid'), + precisionModel: + GeometryPrecisionModel.fromJson(json[r'precisionModel']), + numGeometries: mapValueOfType(json, r'numGeometries'), + isSimple: mapValueOfType(json, r'isSimple'), + isValid: mapValueOfType(json, r'isValid'), + area: mapValueOfType(json, r'area'), + length: mapValueOfType(json, r'length'), + centroid: GeometryCentroid.fromJson(json[r'centroid']), + interiorPoint: GeometryCentroid.fromJson(json[r'interiorPoint']), + pointOnSurface: GeometryCentroid.fromJson(json[r'pointOnSurface']), + envelope: MapAnnotationGeometry.fromJson(json[r'envelope']), + envelopeInternal: + GeometryEnvelopeInternal.fromJson(json[r'envelopeInternal']), + isRectangle: mapValueOfType(json, r'isRectangle'), + coordinateSequence: + PointAllOfCoordinateSequence.fromJson(json[r'coordinateSequence']), + coordinates: Coordinate.listFromJson(json[r'coordinates']), + numPoints: mapValueOfType(json, r'numPoints'), + isEmpty: mapValueOfType(json, r'isEmpty'), + dimension: Dimension.fromJson(json[r'dimension']), + boundaryDimension: Dimension.fromJson(json[r'boundaryDimension']), + x: mapValueOfType(json, r'x'), + y: mapValueOfType(json, r'y'), + coordinate: PointAllOfCoordinate.fromJson(json[r'coordinate']), + geometryType: mapValueOfType(json, r'geometryType'), + ogcGeometryType: OgcGeometryType.fromJson(json[r'ogcGeometryType']), + boundary: PointAllOfBoundary.fromJson(json[r'boundary']), + z: mapValueOfType(json, r'z'), + m: mapValueOfType(json, r'm'), + ); + } + 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 = Point.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 = Point.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of Point-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] = Point.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/point_all_of_boundary.dart b/manager_api_new/lib/model/point_all_of_boundary.dart new file mode 100644 index 0000000..9dda17d --- /dev/null +++ b/manager_api_new/lib/model/point_all_of_boundary.dart @@ -0,0 +1,322 @@ +// +// 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 PointAllOfBoundary { + /// Returns a new [PointAllOfBoundary] instance. + PointAllOfBoundary({ + this.factory_, + this.userData, + this.srid, + this.precisionModel, + this.numGeometries, + this.isSimple, + this.isValid, + this.area, + this.length, + this.centroid, + this.interiorPoint, + this.pointOnSurface, + this.envelope, + this.envelopeInternal, + this.isRectangle, + }); + + GeometryFactory? factory_; + + Object? userData; + + /// + /// 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? srid; + + GeometryPrecisionModel? precisionModel; + + /// + /// 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? numGeometries; + + /// + /// 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? isSimple; + + /// + /// 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? isValid; + + /// + /// 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. + /// + double? area; + + /// + /// 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. + /// + double? length; + + GeometryCentroid? centroid; + + GeometryCentroid? interiorPoint; + + GeometryCentroid? pointOnSurface; + + MapAnnotationGeometry? envelope; + + GeometryEnvelopeInternal? envelopeInternal; + + /// + /// 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? isRectangle; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is PointAllOfBoundary && + other.factory_ == factory_ && + other.userData == userData && + other.srid == srid && + other.precisionModel == precisionModel && + other.numGeometries == numGeometries && + other.isSimple == isSimple && + other.isValid == isValid && + other.area == area && + other.length == length && + other.centroid == centroid && + other.interiorPoint == interiorPoint && + other.pointOnSurface == pointOnSurface && + other.envelope == envelope && + other.envelopeInternal == envelopeInternal && + other.isRectangle == isRectangle; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (factory_ == null ? 0 : factory_!.hashCode) + + (userData == null ? 0 : userData!.hashCode) + + (srid == null ? 0 : srid!.hashCode) + + (precisionModel == null ? 0 : precisionModel!.hashCode) + + (numGeometries == null ? 0 : numGeometries!.hashCode) + + (isSimple == null ? 0 : isSimple!.hashCode) + + (isValid == null ? 0 : isValid!.hashCode) + + (area == null ? 0 : area!.hashCode) + + (length == null ? 0 : length!.hashCode) + + (centroid == null ? 0 : centroid!.hashCode) + + (interiorPoint == null ? 0 : interiorPoint!.hashCode) + + (pointOnSurface == null ? 0 : pointOnSurface!.hashCode) + + (envelope == null ? 0 : envelope!.hashCode) + + (envelopeInternal == null ? 0 : envelopeInternal!.hashCode) + + (isRectangle == null ? 0 : isRectangle!.hashCode); + + @override + String toString() => + 'PointAllOfBoundary[factory_=$factory_, userData=$userData, srid=$srid, precisionModel=$precisionModel, numGeometries=$numGeometries, isSimple=$isSimple, isValid=$isValid, area=$area, length=$length, centroid=$centroid, interiorPoint=$interiorPoint, pointOnSurface=$pointOnSurface, envelope=$envelope, envelopeInternal=$envelopeInternal, isRectangle=$isRectangle]'; + + Map toJson() { + final json = {}; + if (this.factory_ != null) { + json[r'factory'] = this.factory_; + } else { + json[r'factory'] = null; + } + if (this.userData != null) { + json[r'userData'] = this.userData; + } else { + json[r'userData'] = null; + } + if (this.srid != null) { + json[r'srid'] = this.srid; + } else { + json[r'srid'] = null; + } + if (this.precisionModel != null) { + json[r'precisionModel'] = this.precisionModel; + } else { + json[r'precisionModel'] = null; + } + if (this.numGeometries != null) { + json[r'numGeometries'] = this.numGeometries; + } else { + json[r'numGeometries'] = null; + } + if (this.isSimple != null) { + json[r'isSimple'] = this.isSimple; + } else { + json[r'isSimple'] = null; + } + if (this.isValid != null) { + json[r'isValid'] = this.isValid; + } else { + json[r'isValid'] = null; + } + if (this.area != null) { + json[r'area'] = this.area; + } else { + json[r'area'] = null; + } + if (this.length != null) { + json[r'length'] = this.length; + } else { + json[r'length'] = null; + } + if (this.centroid != null) { + json[r'centroid'] = this.centroid; + } else { + json[r'centroid'] = null; + } + if (this.interiorPoint != null) { + json[r'interiorPoint'] = this.interiorPoint; + } else { + json[r'interiorPoint'] = null; + } + if (this.pointOnSurface != null) { + json[r'pointOnSurface'] = this.pointOnSurface; + } else { + json[r'pointOnSurface'] = null; + } + if (this.envelope != null) { + json[r'envelope'] = this.envelope; + } else { + json[r'envelope'] = null; + } + if (this.envelopeInternal != null) { + json[r'envelopeInternal'] = this.envelopeInternal; + } else { + json[r'envelopeInternal'] = null; + } + if (this.isRectangle != null) { + json[r'isRectangle'] = this.isRectangle; + } else { + json[r'isRectangle'] = null; + } + return json; + } + + /// Returns a new [PointAllOfBoundary] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static PointAllOfBoundary? 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 "PointAllOfBoundary[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "PointAllOfBoundary[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return PointAllOfBoundary( + factory_: GeometryFactory.fromJson(json[r'factory']), + userData: mapValueOfType(json, r'userData'), + srid: mapValueOfType(json, r'srid'), + precisionModel: + GeometryPrecisionModel.fromJson(json[r'precisionModel']), + numGeometries: mapValueOfType(json, r'numGeometries'), + isSimple: mapValueOfType(json, r'isSimple'), + isValid: mapValueOfType(json, r'isValid'), + area: mapValueOfType(json, r'area'), + length: mapValueOfType(json, r'length'), + centroid: GeometryCentroid.fromJson(json[r'centroid']), + interiorPoint: GeometryCentroid.fromJson(json[r'interiorPoint']), + pointOnSurface: GeometryCentroid.fromJson(json[r'pointOnSurface']), + envelope: MapAnnotationGeometry.fromJson(json[r'envelope']), + envelopeInternal: + GeometryEnvelopeInternal.fromJson(json[r'envelopeInternal']), + isRectangle: mapValueOfType(json, r'isRectangle'), + ); + } + 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 = PointAllOfBoundary.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 = PointAllOfBoundary.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of PointAllOfBoundary-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] = PointAllOfBoundary.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/point_all_of_coordinate.dart b/manager_api_new/lib/model/point_all_of_coordinate.dart new file mode 100644 index 0000000..532d94f --- /dev/null +++ b/manager_api_new/lib/model/point_all_of_coordinate.dart @@ -0,0 +1,210 @@ +// +// 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 PointAllOfCoordinate { + /// Returns a new [PointAllOfCoordinate] instance. + PointAllOfCoordinate({ + this.x, + this.y, + this.z, + this.m, + this.coordinateValue, + this.isValid, + }); + + /// + /// 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. + /// + double? x; + + /// + /// 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. + /// + double? y; + + /// + /// 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. + /// + double? z; + + /// + /// 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. + /// + double? m; + + PointAllOfCoordinate? coordinateValue; + + /// + /// 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? isValid; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is PointAllOfCoordinate && + other.x == x && + other.y == y && + other.z == z && + other.m == m && + other.coordinateValue == coordinateValue && + other.isValid == isValid; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (x == null ? 0 : x!.hashCode) + + (y == null ? 0 : y!.hashCode) + + (z == null ? 0 : z!.hashCode) + + (m == null ? 0 : m!.hashCode) + + (coordinateValue == null ? 0 : coordinateValue!.hashCode) + + (isValid == null ? 0 : isValid!.hashCode); + + @override + String toString() => + 'PointAllOfCoordinate[x=$x, y=$y, z=$z, m=$m, coordinateValue=$coordinateValue, isValid=$isValid]'; + + Map toJson() { + final json = {}; + if (this.x != null) { + json[r'x'] = this.x; + } else { + json[r'x'] = null; + } + if (this.y != null) { + json[r'y'] = this.y; + } else { + json[r'y'] = null; + } + if (this.z != null) { + json[r'z'] = this.z; + } else { + json[r'z'] = null; + } + if (this.m != null) { + json[r'm'] = this.m; + } else { + json[r'm'] = null; + } + if (this.coordinateValue != null) { + json[r'coordinateValue'] = this.coordinateValue; + } else { + json[r'coordinateValue'] = null; + } + if (this.isValid != null) { + json[r'isValid'] = this.isValid; + } else { + json[r'isValid'] = null; + } + return json; + } + + /// Returns a new [PointAllOfCoordinate] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static PointAllOfCoordinate? 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 "PointAllOfCoordinate[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "PointAllOfCoordinate[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return PointAllOfCoordinate( + x: mapValueOfType(json, r'x'), + y: mapValueOfType(json, r'y'), + z: mapValueOfType(json, r'z'), + m: mapValueOfType(json, r'm'), + coordinateValue: + PointAllOfCoordinate.fromJson(json[r'coordinateValue']), + isValid: mapValueOfType(json, r'isValid'), + ); + } + 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 = PointAllOfCoordinate.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 = PointAllOfCoordinate.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of PointAllOfCoordinate-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] = PointAllOfCoordinate.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/point_all_of_coordinate_sequence.dart b/manager_api_new/lib/model/point_all_of_coordinate_sequence.dart new file mode 100644 index 0000000..ec8b1e8 --- /dev/null +++ b/manager_api_new/lib/model/point_all_of_coordinate_sequence.dart @@ -0,0 +1,288 @@ +// +// 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 PointAllOfCoordinateSequence { + /// Returns a new [PointAllOfCoordinateSequence] instance. + PointAllOfCoordinateSequence({ + this.dimension, + this.measures, + this.spatial, + this.ordinates, + this.hasZ, + this.hasM, + this.zOrdinateIndex, + this.mOrdinateIndex, + this.first, + this.last, + this.count, + }); + + /// + /// 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? dimension; + + /// + /// 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? measures; + + /// + /// 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? spatial; + + /// + /// 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. + /// + Ordinates? ordinates; + + /// + /// 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? hasZ; + + /// + /// 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? hasM; + + /// + /// 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? zOrdinateIndex; + + /// + /// 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? mOrdinateIndex; + + PointAllOfCoordinate? first; + + PointAllOfCoordinate? last; + + /// + /// 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? count; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is PointAllOfCoordinateSequence && + other.dimension == dimension && + other.measures == measures && + other.spatial == spatial && + other.ordinates == ordinates && + other.hasZ == hasZ && + other.hasM == hasM && + other.zOrdinateIndex == zOrdinateIndex && + other.mOrdinateIndex == mOrdinateIndex && + other.first == first && + other.last == last && + other.count == count; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (dimension == null ? 0 : dimension!.hashCode) + + (measures == null ? 0 : measures!.hashCode) + + (spatial == null ? 0 : spatial!.hashCode) + + (ordinates == null ? 0 : ordinates!.hashCode) + + (hasZ == null ? 0 : hasZ!.hashCode) + + (hasM == null ? 0 : hasM!.hashCode) + + (zOrdinateIndex == null ? 0 : zOrdinateIndex!.hashCode) + + (mOrdinateIndex == null ? 0 : mOrdinateIndex!.hashCode) + + (first == null ? 0 : first!.hashCode) + + (last == null ? 0 : last!.hashCode) + + (count == null ? 0 : count!.hashCode); + + @override + String toString() => + 'PointAllOfCoordinateSequence[dimension=$dimension, measures=$measures, spatial=$spatial, ordinates=$ordinates, hasZ=$hasZ, hasM=$hasM, zOrdinateIndex=$zOrdinateIndex, mOrdinateIndex=$mOrdinateIndex, first=$first, last=$last, count=$count]'; + + Map toJson() { + final json = {}; + if (this.dimension != null) { + json[r'dimension'] = this.dimension; + } else { + json[r'dimension'] = null; + } + if (this.measures != null) { + json[r'measures'] = this.measures; + } else { + json[r'measures'] = null; + } + if (this.spatial != null) { + json[r'spatial'] = this.spatial; + } else { + json[r'spatial'] = null; + } + if (this.ordinates != null) { + json[r'ordinates'] = this.ordinates; + } else { + json[r'ordinates'] = null; + } + if (this.hasZ != null) { + json[r'hasZ'] = this.hasZ; + } else { + json[r'hasZ'] = null; + } + if (this.hasM != null) { + json[r'hasM'] = this.hasM; + } else { + json[r'hasM'] = null; + } + if (this.zOrdinateIndex != null) { + json[r'zOrdinateIndex'] = this.zOrdinateIndex; + } else { + json[r'zOrdinateIndex'] = null; + } + if (this.mOrdinateIndex != null) { + json[r'mOrdinateIndex'] = this.mOrdinateIndex; + } else { + json[r'mOrdinateIndex'] = null; + } + if (this.first != null) { + json[r'first'] = this.first; + } else { + json[r'first'] = null; + } + if (this.last != null) { + json[r'last'] = this.last; + } else { + json[r'last'] = null; + } + if (this.count != null) { + json[r'count'] = this.count; + } else { + json[r'count'] = null; + } + return json; + } + + /// Returns a new [PointAllOfCoordinateSequence] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static PointAllOfCoordinateSequence? 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 "PointAllOfCoordinateSequence[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "PointAllOfCoordinateSequence[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return PointAllOfCoordinateSequence( + dimension: mapValueOfType(json, r'dimension'), + measures: mapValueOfType(json, r'measures'), + spatial: mapValueOfType(json, r'spatial'), + ordinates: Ordinates.fromJson(json[r'ordinates']), + hasZ: mapValueOfType(json, r'hasZ'), + hasM: mapValueOfType(json, r'hasM'), + zOrdinateIndex: mapValueOfType(json, r'zOrdinateIndex'), + mOrdinateIndex: mapValueOfType(json, r'mOrdinateIndex'), + first: PointAllOfCoordinate.fromJson(json[r'first']), + last: PointAllOfCoordinate.fromJson(json[r'last']), + count: mapValueOfType(json, r'count'), + ); + } + 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 = PointAllOfCoordinateSequence.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 = PointAllOfCoordinateSequence.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of PointAllOfCoordinateSequence-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] = PointAllOfCoordinateSequence.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/precision_model.dart b/manager_api_new/lib/model/precision_model.dart new file mode 100644 index 0000000..8681e5f --- /dev/null +++ b/manager_api_new/lib/model/precision_model.dart @@ -0,0 +1,202 @@ +// +// 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 PrecisionModel { + /// Returns a new [PrecisionModel] instance. + PrecisionModel({ + this.isFloating, + this.maximumSignificantDigits, + this.scale, + this.gridSize, + this.precisionModelType, + }); + + /// + /// 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? isFloating; + + /// + /// 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? maximumSignificantDigits; + + /// + /// 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. + /// + double? scale; + + /// + /// 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. + /// + double? gridSize; + + /// + /// 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. + /// + PrecisionModels? precisionModelType; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is PrecisionModel && + other.isFloating == isFloating && + other.maximumSignificantDigits == maximumSignificantDigits && + other.scale == scale && + other.gridSize == gridSize && + other.precisionModelType == precisionModelType; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (isFloating == null ? 0 : isFloating!.hashCode) + + (maximumSignificantDigits == null + ? 0 + : maximumSignificantDigits!.hashCode) + + (scale == null ? 0 : scale!.hashCode) + + (gridSize == null ? 0 : gridSize!.hashCode) + + (precisionModelType == null ? 0 : precisionModelType!.hashCode); + + @override + String toString() => + 'PrecisionModel[isFloating=$isFloating, maximumSignificantDigits=$maximumSignificantDigits, scale=$scale, gridSize=$gridSize, precisionModelType=$precisionModelType]'; + + Map toJson() { + final json = {}; + if (this.isFloating != null) { + json[r'isFloating'] = this.isFloating; + } else { + json[r'isFloating'] = null; + } + if (this.maximumSignificantDigits != null) { + json[r'maximumSignificantDigits'] = this.maximumSignificantDigits; + } else { + json[r'maximumSignificantDigits'] = null; + } + if (this.scale != null) { + json[r'scale'] = this.scale; + } else { + json[r'scale'] = null; + } + if (this.gridSize != null) { + json[r'gridSize'] = this.gridSize; + } else { + json[r'gridSize'] = null; + } + if (this.precisionModelType != null) { + json[r'precisionModelType'] = this.precisionModelType; + } else { + json[r'precisionModelType'] = null; + } + return json; + } + + /// Returns a new [PrecisionModel] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static PrecisionModel? 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 "PrecisionModel[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "PrecisionModel[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return PrecisionModel( + isFloating: mapValueOfType(json, r'isFloating'), + maximumSignificantDigits: + mapValueOfType(json, r'maximumSignificantDigits'), + scale: mapValueOfType(json, r'scale'), + gridSize: mapValueOfType(json, r'gridSize'), + precisionModelType: + PrecisionModels.fromJson(json[r'precisionModelType']), + ); + } + 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 = PrecisionModel.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 = PrecisionModel.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of PrecisionModel-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] = PrecisionModel.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/precision_models.dart b/manager_api_new/lib/model/precision_models.dart new file mode 100644 index 0000000..8fbba99 --- /dev/null +++ b/manager_api_new/lib/model/precision_models.dart @@ -0,0 +1,95 @@ +// +// 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; + +/// 0 = Floating 1 = FloatingSingle 2 = Fixed +class PrecisionModels { + /// Instantiate a new enum with the provided [value]. + const PrecisionModels._(this.value); + + /// The underlying value of this enum member. + final int value; + + @override + String toString() => value.toString(); + + int toJson() => value; + + static const number0 = PrecisionModels._(0); + static const number1 = PrecisionModels._(1); + static const number2 = PrecisionModels._(2); + + /// List of all possible values in this [enum][PrecisionModels]. + static const values = [ + number0, + number1, + number2, + ]; + + static PrecisionModels? fromJson(dynamic value) => + PrecisionModelsTypeTransformer().decode(value); + + static List listFromJson( + dynamic json, { + bool growable = false, + }) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = PrecisionModels.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } +} + +/// Transformation class that can [encode] an instance of [PrecisionModels] to int, +/// and [decode] dynamic data back to [PrecisionModels]. +class PrecisionModelsTypeTransformer { + factory PrecisionModelsTypeTransformer() => + _instance ??= const PrecisionModelsTypeTransformer._(); + + const PrecisionModelsTypeTransformer._(); + + int encode(PrecisionModels data) => data.value; + + /// Decodes a [dynamic value][data] to a PrecisionModels. + /// + /// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully, + /// then null is returned. However, if [allowNull] is false and the [dynamic value][data] + /// cannot be decoded successfully, then an [UnimplementedError] is thrown. + /// + /// The [allowNull] is very handy when an API changes and a new enum value is added or removed, + /// and users are still using an old app with the old code. + PrecisionModels? decode(dynamic data, {bool allowNull = true}) { + if (data != null) { + switch (data) { + case 0: + return PrecisionModels.number0; + case 1: + return PrecisionModels.number1; + case 2: + return PrecisionModels.number2; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + } + return null; + } + + /// Singleton [PrecisionModelsTypeTransformer] instance. + static PrecisionModelsTypeTransformer? _instance; +} diff --git a/manager_api_new/lib/model/puzzle_dto_image.dart b/manager_api_new/lib/model/programme_block.dart similarity index 58% rename from manager_api_new/lib/model/puzzle_dto_image.dart rename to manager_api_new/lib/model/programme_block.dart index d47344f..ac44668 100644 --- a/manager_api_new/lib/model/puzzle_dto_image.dart +++ b/manager_api_new/lib/model/programme_block.dart @@ -1,7 +1,7 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.12 +// @dart=2.18 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first @@ -10,24 +10,30 @@ part of openapi.api; -class PuzzleDTOImage { - /// Returns a new [PuzzleDTOImage] instance. - PuzzleDTOImage({ +class ProgrammeBlock { + /// Returns a new [ProgrammeBlock] instance. + ProgrammeBlock({ + this.id, this.title = const [], this.description = const [], - this.resourceId, - this.resourceUrl, - this.order, - this.resourceType, + this.startTime, + this.endTime, + this.mapAnnotations = const [], }); + String? id; + List? title; List? description; - String? resourceId; - - String? resourceUrl; + /// + /// 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? startTime; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -35,43 +41,42 @@ class PuzzleDTOImage { /// 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; + DateTime? endTime; - /// - /// 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. - /// - ResourceType? resourceType; + List? mapAnnotations; @override bool operator ==(Object other) => identical(this, other) || - other is PuzzleDTOImage && - other.title == title && - other.description == description && - other.resourceId == resourceId && - other.resourceUrl == resourceUrl && - other.order == order && - other.resourceType == resourceType; + other is ProgrammeBlock && + other.id == id && + _deepEquality.equals(other.title, title) && + _deepEquality.equals(other.description, description) && + other.startTime == startTime && + other.endTime == endTime && + _deepEquality.equals(other.mapAnnotations, mapAnnotations); @override int get hashCode => // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + (title == null ? 0 : title!.hashCode) + (description == null ? 0 : description!.hashCode) + - (resourceId == null ? 0 : resourceId!.hashCode) + - (resourceUrl == null ? 0 : resourceUrl!.hashCode) + - (order == null ? 0 : order!.hashCode) + - (resourceType == null ? 0 : resourceType!.hashCode); + (startTime == null ? 0 : startTime!.hashCode) + + (endTime == null ? 0 : endTime!.hashCode) + + (mapAnnotations == null ? 0 : mapAnnotations!.hashCode); @override String toString() => - 'PuzzleDTOImage[title=$title, description=$description, resourceId=$resourceId, resourceUrl=$resourceUrl, order=$order, resourceType=$resourceType]'; + 'ProgrammeBlock[id=$id, title=$title, description=$description, startTime=$startTime, endTime=$endTime, mapAnnotations=$mapAnnotations]'; Map toJson() { final json = {}; + if (this.id != null) { + json[r'id'] = this.id; + } else { + json[r'id'] = null; + } if (this.title != null) { json[r'title'] = this.title; } else { @@ -82,33 +87,28 @@ class PuzzleDTOImage { } else { json[r'description'] = null; } - if (this.resourceId != null) { - json[r'resourceId'] = this.resourceId; + if (this.startTime != null) { + json[r'startTime'] = this.startTime!.toUtc().toIso8601String(); } else { - json[r'resourceId'] = null; + json[r'startTime'] = null; } - if (this.resourceUrl != null) { - json[r'resourceUrl'] = this.resourceUrl; + if (this.endTime != null) { + json[r'endTime'] = this.endTime!.toUtc().toIso8601String(); } else { - json[r'resourceUrl'] = null; + json[r'endTime'] = null; } - if (this.order != null) { - json[r'order'] = this.order; + if (this.mapAnnotations != null) { + json[r'mapAnnotations'] = this.mapAnnotations; } else { - json[r'order'] = null; - } - if (this.resourceType != null) { - json[r'resourceType'] = this.resourceType; - } else { - json[r'resourceType'] = null; + json[r'mapAnnotations'] = null; } return json; } - /// Returns a new [PuzzleDTOImage] instance and imports its values from + /// Returns a new [ProgrammeBlock] instance and imports its values from /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods - static PuzzleDTOImage? fromJson(dynamic value) { + static ProgrammeBlock? fromJson(dynamic value) { if (value is Map) { final json = value.cast(); @@ -118,33 +118,33 @@ class PuzzleDTOImage { assert(() { requiredKeys.forEach((key) { assert(json.containsKey(key), - 'Required key "PuzzleDTOImage[$key]" is missing from JSON.'); + 'Required key "ProgrammeBlock[$key]" is missing from JSON.'); assert(json[key] != null, - 'Required key "PuzzleDTOImage[$key]" has a null value in JSON.'); + 'Required key "ProgrammeBlock[$key]" has a null value in JSON.'); }); return true; }()); - return PuzzleDTOImage( + return ProgrammeBlock( + id: mapValueOfType(json, r'id'), title: TranslationDTO.listFromJson(json[r'title']), description: TranslationDTO.listFromJson(json[r'description']), - resourceId: mapValueOfType(json, r'resourceId'), - resourceUrl: mapValueOfType(json, r'resourceUrl'), - order: mapValueOfType(json, r'order'), - resourceType: ResourceType.fromJson(json[r'resourceType']), + startTime: mapDateTime(json, r'startTime', r''), + endTime: mapDateTime(json, r'endTime', r''), + mapAnnotations: MapAnnotation.listFromJson(json[r'mapAnnotations']), ); } return null; } - static List listFromJson( + static List listFromJson( dynamic json, { bool growable = false, }) { - final result = []; + final result = []; if (json is List && json.isNotEmpty) { for (final row in json) { - final value = PuzzleDTOImage.fromJson(row); + final value = ProgrammeBlock.fromJson(row); if (value != null) { result.add(value); } @@ -153,12 +153,12 @@ class PuzzleDTOImage { return result.toList(growable: growable); } - static Map mapFromJson(dynamic json) { - final map = {}; + 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 = PuzzleDTOImage.fromJson(entry.value); + final value = ProgrammeBlock.fromJson(entry.value); if (value != null) { map[entry.key] = value; } @@ -167,17 +167,17 @@ class PuzzleDTOImage { return map; } - // maps a json object with a list of PuzzleDTOImage-objects as value to a dart map - static Map> mapListFromJson( + // maps a json object with a list of ProgrammeBlock-objects as value to a dart map + static Map> mapListFromJson( dynamic json, { bool growable = false, }) { - final map = >{}; + final map = >{}; if (json is Map && json.isNotEmpty) { // ignore: parameter_assignments json = json.cast(); for (final entry in json.entries) { - map[entry.key] = PuzzleDTOImage.listFromJson( + map[entry.key] = ProgrammeBlock.listFromJson( entry.value, growable: growable, ); diff --git a/manager_api_new/lib/model/image_dto.dart b/manager_api_new/lib/model/programme_block_dto.dart similarity index 51% rename from manager_api_new/lib/model/image_dto.dart rename to manager_api_new/lib/model/programme_block_dto.dart index c0120e3..a104434 100644 --- a/manager_api_new/lib/model/image_dto.dart +++ b/manager_api_new/lib/model/programme_block_dto.dart @@ -1,7 +1,7 @@ // // AUTO-GENERATED FILE, DO NOT MODIFY! // -// @dart=2.12 +// @dart=2.18 // ignore_for_file: unused_element, unused_import // ignore_for_file: always_put_required_named_parameters_first @@ -10,57 +10,73 @@ part of openapi.api; -class ImageDTO { - /// Returns a new [ImageDTO] instance. - ImageDTO({ +class ProgrammeBlockDTO { + /// Returns a new [ProgrammeBlockDTO] instance. + ProgrammeBlockDTO({ + this.id, this.title = const [], this.description = const [], - this.resourceId, - this.source_, - this.order, + this.startTime, + this.endTime, + this.mapAnnotations = const [], }); + String? id; + List? title; List? description; - String? resourceId; - - String? source_; - /// /// 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; + DateTime? startTime; + + /// + /// 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? endTime; + + List? mapAnnotations; @override bool operator ==(Object other) => identical(this, other) || - other is ImageDTO && - other.title == title && - other.description == description && - other.resourceId == resourceId && - other.source_ == source_ && - other.order == order; + other is ProgrammeBlockDTO && + other.id == id && + _deepEquality.equals(other.title, title) && + _deepEquality.equals(other.description, description) && + other.startTime == startTime && + other.endTime == endTime && + _deepEquality.equals(other.mapAnnotations, mapAnnotations); @override int get hashCode => // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + (title == null ? 0 : title!.hashCode) + (description == null ? 0 : description!.hashCode) + - (resourceId == null ? 0 : resourceId!.hashCode) + - (source_ == null ? 0 : source_!.hashCode) + - (order == null ? 0 : order!.hashCode); + (startTime == null ? 0 : startTime!.hashCode) + + (endTime == null ? 0 : endTime!.hashCode) + + (mapAnnotations == null ? 0 : mapAnnotations!.hashCode); @override String toString() => - 'ImageDTO[title=$title, description=$description, resourceId=$resourceId, source_=$source_, order=$order]'; + 'ProgrammeBlockDTO[id=$id, title=$title, description=$description, startTime=$startTime, endTime=$endTime, mapAnnotations=$mapAnnotations]'; Map toJson() { final json = {}; + if (this.id != null) { + json[r'id'] = this.id; + } else { + json[r'id'] = null; + } if (this.title != null) { json[r'title'] = this.title; } else { @@ -71,28 +87,28 @@ class ImageDTO { } else { json[r'description'] = null; } - if (this.resourceId != null) { - json[r'resourceId'] = this.resourceId; + if (this.startTime != null) { + json[r'startTime'] = this.startTime!.toUtc().toIso8601String(); } else { - json[r'resourceId'] = null; + json[r'startTime'] = null; } - if (this.source_ != null) { - json[r'source'] = this.source_; + if (this.endTime != null) { + json[r'endTime'] = this.endTime!.toUtc().toIso8601String(); } else { - json[r'source'] = null; + json[r'endTime'] = null; } - if (this.order != null) { - json[r'order'] = this.order; + if (this.mapAnnotations != null) { + json[r'mapAnnotations'] = this.mapAnnotations; } else { - json[r'order'] = null; + json[r'mapAnnotations'] = null; } return json; } - /// Returns a new [ImageDTO] instance and imports its values from + /// Returns a new [ProgrammeBlockDTO] instance and imports its values from /// [value] if it's a [Map], null otherwise. // ignore: prefer_constructors_over_static_methods - static ImageDTO? fromJson(dynamic value) { + static ProgrammeBlockDTO? fromJson(dynamic value) { if (value is Map) { final json = value.cast(); @@ -102,32 +118,33 @@ class ImageDTO { assert(() { requiredKeys.forEach((key) { assert(json.containsKey(key), - 'Required key "ImageDTO[$key]" is missing from JSON.'); + 'Required key "ProgrammeBlockDTO[$key]" is missing from JSON.'); assert(json[key] != null, - 'Required key "ImageDTO[$key]" has a null value in JSON.'); + 'Required key "ProgrammeBlockDTO[$key]" has a null value in JSON.'); }); return true; }()); - return ImageDTO( + return ProgrammeBlockDTO( + id: mapValueOfType(json, r'id'), title: TranslationDTO.listFromJson(json[r'title']), description: TranslationDTO.listFromJson(json[r'description']), - resourceId: mapValueOfType(json, r'resourceId'), - source_: mapValueOfType(json, r'source'), - order: mapValueOfType(json, r'order'), + startTime: mapDateTime(json, r'startTime', r''), + endTime: mapDateTime(json, r'endTime', r''), + mapAnnotations: MapAnnotationDTO.listFromJson(json[r'mapAnnotations']), ); } return null; } - static List listFromJson( + static List listFromJson( dynamic json, { bool growable = false, }) { - final result = []; + final result = []; if (json is List && json.isNotEmpty) { for (final row in json) { - final value = ImageDTO.fromJson(row); + final value = ProgrammeBlockDTO.fromJson(row); if (value != null) { result.add(value); } @@ -136,12 +153,12 @@ class ImageDTO { return result.toList(growable: growable); } - static Map mapFromJson(dynamic json) { - final map = {}; + 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 = ImageDTO.fromJson(entry.value); + final value = ProgrammeBlockDTO.fromJson(entry.value); if (value != null) { map[entry.key] = value; } @@ -150,17 +167,17 @@ class ImageDTO { return map; } - // maps a json object with a list of ImageDTO-objects as value to a dart map - static Map> mapListFromJson( + // maps a json object with a list of ProgrammeBlockDTO-objects as value to a dart map + static Map> mapListFromJson( dynamic json, { bool growable = false, }) { - final map = >{}; + final map = >{}; if (json is Map && json.isNotEmpty) { // ignore: parameter_assignments json = json.cast(); for (final entry in json.entries) { - map[entry.key] = ImageDTO.listFromJson( + map[entry.key] = ProgrammeBlockDTO.listFromJson( entry.value, growable: growable, ); diff --git a/manager_api_new/lib/model/question_type.dart b/manager_api_new/lib/model/question_type.dart new file mode 100644 index 0000000..d931d30 --- /dev/null +++ b/manager_api_new/lib/model/question_type.dart @@ -0,0 +1,95 @@ +// +// 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; + +/// 0 = Simple 1 = MultipleChoice 2 = Puzzle +class QuestionType { + /// Instantiate a new enum with the provided [value]. + const QuestionType._(this.value); + + /// The underlying value of this enum member. + final int value; + + @override + String toString() => value.toString(); + + int toJson() => value; + + static const number0 = QuestionType._(0); + static const number1 = QuestionType._(1); + static const number2 = QuestionType._(2); + + /// List of all possible values in this [enum][QuestionType]. + static const values = [ + number0, + number1, + number2, + ]; + + static QuestionType? fromJson(dynamic value) => + QuestionTypeTypeTransformer().decode(value); + + static List listFromJson( + dynamic json, { + bool growable = false, + }) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = QuestionType.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } +} + +/// Transformation class that can [encode] an instance of [QuestionType] to int, +/// and [decode] dynamic data back to [QuestionType]. +class QuestionTypeTypeTransformer { + factory QuestionTypeTypeTransformer() => + _instance ??= const QuestionTypeTypeTransformer._(); + + const QuestionTypeTypeTransformer._(); + + int encode(QuestionType data) => data.value; + + /// Decodes a [dynamic value][data] to a QuestionType. + /// + /// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully, + /// then null is returned. However, if [allowNull] is false and the [dynamic value][data] + /// cannot be decoded successfully, then an [UnimplementedError] is thrown. + /// + /// The [allowNull] is very handy when an API changes and a new enum value is added or removed, + /// and users are still using an old app with the old code. + QuestionType? decode(dynamic data, {bool allowNull = true}) { + if (data != null) { + switch (data) { + case 0: + return QuestionType.number0; + case 1: + return QuestionType.number1; + case 2: + return QuestionType.number2; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + } + return null; + } + + /// Singleton [QuestionTypeTypeTransformer] instance. + static QuestionTypeTypeTransformer? _instance; +} diff --git a/manager_api_new/lib/model/quiz_question_guided_step.dart b/manager_api_new/lib/model/quiz_question_guided_step.dart new file mode 100644 index 0000000..259191a --- /dev/null +++ b/manager_api_new/lib/model/quiz_question_guided_step.dart @@ -0,0 +1,321 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class QuizQuestionGuidedStep { + /// Returns a new [QuizQuestionGuidedStep] instance. + QuizQuestionGuidedStep({ + required this.guidedPathId, + this.title = const [], + this.id, + this.guidedPath, + this.order, + this.description = const [], + this.geometry, + this.zoneRadiusMeters, + this.imageUrl, + this.triggerGeoPointId, + this.triggerGeoPoint, + this.isHiddenInitially, + this.quizQuestions = const [], + this.isStepTimer, + this.isStepLocked, + this.timerSeconds, + this.timerExpiredMessage = const [], + }); + + String guidedPathId; + + List title; + + String? id; + + GuidedStepGuidedPath? guidedPath; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + int? order; + + List? description; + + PointAllOfBoundary? geometry; + + double? zoneRadiusMeters; + + String? imageUrl; + + int? triggerGeoPointId; + + GuidedStepTriggerGeoPoint? triggerGeoPoint; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? isHiddenInitially; + + List? quizQuestions; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? isStepTimer; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? isStepLocked; + + int? timerSeconds; + + List? timerExpiredMessage; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is QuizQuestionGuidedStep && + other.guidedPathId == guidedPathId && + _deepEquality.equals(other.title, title) && + other.id == id && + other.guidedPath == guidedPath && + other.order == order && + _deepEquality.equals(other.description, description) && + other.geometry == geometry && + other.zoneRadiusMeters == zoneRadiusMeters && + other.imageUrl == imageUrl && + other.triggerGeoPointId == triggerGeoPointId && + other.triggerGeoPoint == triggerGeoPoint && + other.isHiddenInitially == isHiddenInitially && + _deepEquality.equals(other.quizQuestions, quizQuestions) && + other.isStepTimer == isStepTimer && + other.isStepLocked == isStepLocked && + other.timerSeconds == timerSeconds && + _deepEquality.equals(other.timerExpiredMessage, timerExpiredMessage); + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (guidedPathId.hashCode) + + (title.hashCode) + + (id == null ? 0 : id!.hashCode) + + (guidedPath == null ? 0 : guidedPath!.hashCode) + + (order == null ? 0 : order!.hashCode) + + (description == null ? 0 : description!.hashCode) + + (geometry == null ? 0 : geometry!.hashCode) + + (zoneRadiusMeters == null ? 0 : zoneRadiusMeters!.hashCode) + + (imageUrl == null ? 0 : imageUrl!.hashCode) + + (triggerGeoPointId == null ? 0 : triggerGeoPointId!.hashCode) + + (triggerGeoPoint == null ? 0 : triggerGeoPoint!.hashCode) + + (isHiddenInitially == null ? 0 : isHiddenInitially!.hashCode) + + (quizQuestions == null ? 0 : quizQuestions!.hashCode) + + (isStepTimer == null ? 0 : isStepTimer!.hashCode) + + (isStepLocked == null ? 0 : isStepLocked!.hashCode) + + (timerSeconds == null ? 0 : timerSeconds!.hashCode) + + (timerExpiredMessage == null ? 0 : timerExpiredMessage!.hashCode); + + @override + String toString() => + 'QuizQuestionGuidedStep[guidedPathId=$guidedPathId, title=$title, id=$id, guidedPath=$guidedPath, order=$order, description=$description, geometry=$geometry, zoneRadiusMeters=$zoneRadiusMeters, imageUrl=$imageUrl, triggerGeoPointId=$triggerGeoPointId, triggerGeoPoint=$triggerGeoPoint, isHiddenInitially=$isHiddenInitially, quizQuestions=$quizQuestions, isStepTimer=$isStepTimer, isStepLocked=$isStepLocked, timerSeconds=$timerSeconds, timerExpiredMessage=$timerExpiredMessage]'; + + Map toJson() { + final json = {}; + json[r'guidedPathId'] = this.guidedPathId; + json[r'title'] = this.title; + if (this.id != null) { + json[r'id'] = this.id; + } else { + json[r'id'] = null; + } + if (this.guidedPath != null) { + json[r'guidedPath'] = this.guidedPath; + } else { + json[r'guidedPath'] = null; + } + if (this.order != null) { + json[r'order'] = this.order; + } else { + json[r'order'] = null; + } + if (this.description != null) { + json[r'description'] = this.description; + } else { + json[r'description'] = null; + } + if (this.geometry != null) { + json[r'geometry'] = this.geometry; + } else { + json[r'geometry'] = null; + } + if (this.zoneRadiusMeters != null) { + json[r'zoneRadiusMeters'] = this.zoneRadiusMeters; + } else { + json[r'zoneRadiusMeters'] = null; + } + if (this.imageUrl != null) { + json[r'imageUrl'] = this.imageUrl; + } else { + json[r'imageUrl'] = null; + } + if (this.triggerGeoPointId != null) { + json[r'triggerGeoPointId'] = this.triggerGeoPointId; + } else { + json[r'triggerGeoPointId'] = null; + } + if (this.triggerGeoPoint != null) { + json[r'triggerGeoPoint'] = this.triggerGeoPoint; + } else { + json[r'triggerGeoPoint'] = null; + } + if (this.isHiddenInitially != null) { + json[r'isHiddenInitially'] = this.isHiddenInitially; + } else { + json[r'isHiddenInitially'] = null; + } + if (this.quizQuestions != null) { + json[r'quizQuestions'] = this.quizQuestions; + } else { + json[r'quizQuestions'] = null; + } + if (this.isStepTimer != null) { + json[r'isStepTimer'] = this.isStepTimer; + } else { + json[r'isStepTimer'] = null; + } + if (this.isStepLocked != null) { + json[r'isStepLocked'] = this.isStepLocked; + } else { + json[r'isStepLocked'] = null; + } + if (this.timerSeconds != null) { + json[r'timerSeconds'] = this.timerSeconds; + } else { + json[r'timerSeconds'] = null; + } + if (this.timerExpiredMessage != null) { + json[r'timerExpiredMessage'] = this.timerExpiredMessage; + } else { + json[r'timerExpiredMessage'] = null; + } + return json; + } + + /// Returns a new [QuizQuestionGuidedStep] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static QuizQuestionGuidedStep? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), + 'Required key "QuizQuestionGuidedStep[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "QuizQuestionGuidedStep[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return QuizQuestionGuidedStep( + guidedPathId: mapValueOfType(json, r'guidedPathId')!, + title: TranslationDTO.listFromJson(json[r'title']), + id: mapValueOfType(json, r'id'), + guidedPath: GuidedStepGuidedPath.fromJson(json[r'guidedPath']), + order: mapValueOfType(json, r'order'), + description: TranslationDTO.listFromJson(json[r'description']), + geometry: PointAllOfBoundary.fromJson(json[r'geometry']), + zoneRadiusMeters: mapValueOfType(json, r'zoneRadiusMeters'), + imageUrl: mapValueOfType(json, r'imageUrl'), + triggerGeoPointId: mapValueOfType(json, r'triggerGeoPointId'), + triggerGeoPoint: + GuidedStepTriggerGeoPoint.fromJson(json[r'triggerGeoPoint']), + isHiddenInitially: mapValueOfType(json, r'isHiddenInitially'), + quizQuestions: QuizQuestion.listFromJson(json[r'quizQuestions']), + isStepTimer: mapValueOfType(json, r'isStepTimer'), + isStepLocked: mapValueOfType(json, r'isStepLocked'), + timerSeconds: mapValueOfType(json, r'timerSeconds'), + timerExpiredMessage: + TranslationDTO.listFromJson(json[r'timerExpiredMessage']), + ); + } + 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 = QuizQuestionGuidedStep.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 = QuizQuestionGuidedStep.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of QuizQuestionGuidedStep-objects as value to a dart map + static Map> 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] = QuizQuestionGuidedStep.listFromJson( + entry.value, + growable: growable, + ); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + 'guidedPathId', + 'title', + }; +} diff --git a/manager_api_new/lib/model/quizz_dto.dart b/manager_api_new/lib/model/quizz_dto.dart deleted file mode 100644 index 6daa28d..0000000 --- a/manager_api_new/lib/model/quizz_dto.dart +++ /dev/null @@ -1,168 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// -// @dart=2.12 - -// 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 QuizzDTO { - /// Returns a new [QuizzDTO] instance. - QuizzDTO({ - this.questions = const [], - this.badLevel, - this.mediumLevel, - this.goodLevel, - this.greatLevel, - }); - - List? questions; - - LevelDTO? badLevel; - - LevelDTO? mediumLevel; - - LevelDTO? goodLevel; - - LevelDTO? greatLevel; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is QuizzDTO && - other.questions == questions && - other.badLevel == badLevel && - other.mediumLevel == mediumLevel && - other.goodLevel == goodLevel && - other.greatLevel == greatLevel; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (questions == null ? 0 : questions!.hashCode) + - (badLevel == null ? 0 : badLevel!.hashCode) + - (mediumLevel == null ? 0 : mediumLevel!.hashCode) + - (goodLevel == null ? 0 : goodLevel!.hashCode) + - (greatLevel == null ? 0 : greatLevel!.hashCode); - - @override - String toString() => - 'QuizzDTO[questions=$questions, badLevel=$badLevel, mediumLevel=$mediumLevel, goodLevel=$goodLevel, greatLevel=$greatLevel]'; - - Map toJson() { - final json = {}; - if (this.questions != null) { - json[r'questions'] = this.questions; - } else { - json[r'questions'] = null; - } - if (this.badLevel != null) { - json[r'bad_level'] = this.badLevel; - } else { - json[r'bad_level'] = null; - } - if (this.mediumLevel != null) { - json[r'medium_level'] = this.mediumLevel; - } else { - json[r'medium_level'] = null; - } - if (this.goodLevel != null) { - json[r'good_level'] = this.goodLevel; - } else { - json[r'good_level'] = null; - } - if (this.greatLevel != null) { - json[r'great_level'] = this.greatLevel; - } else { - json[r'great_level'] = null; - } - return json; - } - - /// Returns a new [QuizzDTO] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static QuizzDTO? 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 "QuizzDTO[$key]" is missing from JSON.'); - assert(json[key] != null, - 'Required key "QuizzDTO[$key]" has a null value in JSON.'); - }); - return true; - }()); - - return QuizzDTO( - questions: QuestionDTO.listFromJson(json[r'questions']) ?? const [], - badLevel: LevelDTO.fromJson(json[r'bad_level']), - mediumLevel: LevelDTO.fromJson(json[r'medium_level']), - goodLevel: LevelDTO.fromJson(json[r'good_level']), - greatLevel: LevelDTO.fromJson(json[r'great_level']), - ); - } - 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 = QuizzDTO.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 = QuizzDTO.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of QuizzDTO-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] = QuizzDTO.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_event.dart b/manager_api_new/lib/model/section_event.dart new file mode 100644 index 0000000..3a7a56a --- /dev/null +++ b/manager_api_new/lib/model/section_event.dart @@ -0,0 +1,386 @@ +// +// 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 SectionEvent { + /// Returns a new [SectionEvent] instance. + SectionEvent({ + 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, + this.isActive, + this.startDate, + this.endDate, + this.programme = const [], + this.parcoursIds = const [], + }); + + 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; + + /// + /// 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? isActive; + + /// + /// 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? startDate; + + /// + /// 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? endDate; + + List? programme; + + List? parcoursIds; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SectionEvent && + 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 && + other.isActive == isActive && + other.startDate == startDate && + other.endDate == endDate && + _deepEquality.equals(other.programme, programme) && + _deepEquality.equals(other.parcoursIds, parcoursIds); + + @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) + + (isActive == null ? 0 : isActive!.hashCode) + + (startDate == null ? 0 : startDate!.hashCode) + + (endDate == null ? 0 : endDate!.hashCode) + + (programme == null ? 0 : programme!.hashCode) + + (parcoursIds == null ? 0 : parcoursIds!.hashCode); + + @override + String toString() => + 'SectionEvent[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, isActive=$isActive, startDate=$startDate, endDate=$endDate, programme=$programme, parcoursIds=$parcoursIds]'; + + 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; + } + if (this.isActive != null) { + json[r'isActive'] = this.isActive; + } else { + json[r'isActive'] = null; + } + if (this.startDate != null) { + json[r'startDate'] = this.startDate!.toUtc().toIso8601String(); + } else { + json[r'startDate'] = null; + } + if (this.endDate != null) { + json[r'endDate'] = this.endDate!.toUtc().toIso8601String(); + } else { + json[r'endDate'] = null; + } + if (this.programme != null) { + json[r'programme'] = this.programme; + } else { + json[r'programme'] = null; + } + if (this.parcoursIds != null) { + json[r'parcoursIds'] = this.parcoursIds; + } else { + json[r'parcoursIds'] = null; + } + return json; + } + + /// Returns a new [SectionEvent] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static SectionEvent? 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 "SectionEvent[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "SectionEvent[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return SectionEvent( + 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'), + isActive: mapValueOfType(json, r'isActive'), + startDate: mapDateTime(json, r'startDate', r''), + endDate: mapDateTime(json, r'endDate', r''), + programme: ProgrammeBlock.listFromJson(json[r'programme']), + parcoursIds: json[r'parcoursIds'] is Iterable + ? (json[r'parcoursIds'] as Iterable) + .cast() + .toList(growable: false) + : const [], + ); + } + 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 = SectionEvent.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 = SectionEvent.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of SectionEvent-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] = SectionEvent.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_event_dto.dart b/manager_api_new/lib/model/section_event_dto.dart new file mode 100644 index 0000000..00ae563 --- /dev/null +++ b/manager_api_new/lib/model/section_event_dto.dart @@ -0,0 +1,406 @@ +// +// 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 SectionEventDTO { + /// Returns a new [SectionEventDTO] instance. + SectionEventDTO({ + this.id, + this.label, + this.title = const [], + this.description = const [], + this.isActive, + this.imageId, + this.imageSource, + this.configurationId, + this.isSubSection, + this.parentId, + this.type, + this.dateCreation, + this.order, + this.instanceId, + this.latitude, + this.longitude, + this.meterZoneGPS, + this.isBeacon, + this.beaconId, + this.startDate, + this.endDate, + this.parcoursIds = const [], + this.programme = const [], + }); + + String? id; + + String? label; + + List? title; + + 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. + /// + bool? isActive; + + String? imageId; + + String? imageSource; + + String? configurationId; + + /// + /// 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? isSubSection; + + 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. + /// + SectionType? type; + + DateTime? dateCreation; + + int? order; + + String? instanceId; + + 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. + /// + bool? isBeacon; + + int? beaconId; + + /// + /// 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? startDate; + + /// + /// 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? endDate; + + List? parcoursIds; + + List? programme; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SectionEventDTO && + other.id == id && + other.label == label && + _deepEquality.equals(other.title, title) && + _deepEquality.equals(other.description, description) && + other.isActive == isActive && + other.imageId == imageId && + other.imageSource == imageSource && + other.configurationId == configurationId && + other.isSubSection == isSubSection && + other.parentId == parentId && + other.type == type && + other.dateCreation == dateCreation && + other.order == order && + other.instanceId == instanceId && + other.latitude == latitude && + other.longitude == longitude && + other.meterZoneGPS == meterZoneGPS && + other.isBeacon == isBeacon && + other.beaconId == beaconId && + other.startDate == startDate && + other.endDate == endDate && + _deepEquality.equals(other.parcoursIds, parcoursIds) && + _deepEquality.equals(other.programme, programme); + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (label == null ? 0 : label!.hashCode) + + (title == null ? 0 : title!.hashCode) + + (description == null ? 0 : description!.hashCode) + + (isActive == null ? 0 : isActive!.hashCode) + + (imageId == null ? 0 : imageId!.hashCode) + + (imageSource == null ? 0 : imageSource!.hashCode) + + (configurationId == null ? 0 : configurationId!.hashCode) + + (isSubSection == null ? 0 : isSubSection!.hashCode) + + (parentId == null ? 0 : parentId!.hashCode) + + (type == null ? 0 : type!.hashCode) + + (dateCreation == null ? 0 : dateCreation!.hashCode) + + (order == null ? 0 : order!.hashCode) + + (instanceId == null ? 0 : instanceId!.hashCode) + + (latitude == null ? 0 : latitude!.hashCode) + + (longitude == null ? 0 : longitude!.hashCode) + + (meterZoneGPS == null ? 0 : meterZoneGPS!.hashCode) + + (isBeacon == null ? 0 : isBeacon!.hashCode) + + (beaconId == null ? 0 : beaconId!.hashCode) + + (startDate == null ? 0 : startDate!.hashCode) + + (endDate == null ? 0 : endDate!.hashCode) + + (parcoursIds == null ? 0 : parcoursIds!.hashCode) + + (programme == null ? 0 : programme!.hashCode); + + @override + String toString() => + 'SectionEventDTO[id=$id, label=$label, title=$title, description=$description, isActive=$isActive, imageId=$imageId, imageSource=$imageSource, configurationId=$configurationId, isSubSection=$isSubSection, parentId=$parentId, type=$type, dateCreation=$dateCreation, order=$order, instanceId=$instanceId, latitude=$latitude, longitude=$longitude, meterZoneGPS=$meterZoneGPS, isBeacon=$isBeacon, beaconId=$beaconId, startDate=$startDate, endDate=$endDate, parcoursIds=$parcoursIds, programme=$programme]'; + + Map toJson() { + final json = {}; + if (this.id != null) { + json[r'id'] = this.id; + } else { + json[r'id'] = null; + } + if (this.label != null) { + json[r'label'] = this.label; + } else { + json[r'label'] = null; + } + if (this.title != null) { + json[r'title'] = this.title; + } else { + json[r'title'] = null; + } + if (this.description != null) { + json[r'description'] = this.description; + } else { + json[r'description'] = null; + } + if (this.isActive != null) { + json[r'isActive'] = this.isActive; + } else { + json[r'isActive'] = 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.configurationId != null) { + json[r'configurationId'] = this.configurationId; + } else { + json[r'configurationId'] = null; + } + if (this.isSubSection != null) { + json[r'isSubSection'] = this.isSubSection; + } else { + json[r'isSubSection'] = null; + } + if (this.parentId != null) { + json[r'parentId'] = this.parentId; + } else { + json[r'parentId'] = null; + } + if (this.type != null) { + json[r'type'] = this.type; + } else { + json[r'type'] = null; + } + if (this.dateCreation != null) { + json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String(); + } else { + json[r'dateCreation'] = null; + } + if (this.order != null) { + json[r'order'] = this.order; + } else { + json[r'order'] = null; + } + if (this.instanceId != null) { + json[r'instanceId'] = this.instanceId; + } else { + json[r'instanceId'] = 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.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.startDate != null) { + json[r'startDate'] = this.startDate!.toUtc().toIso8601String(); + } else { + json[r'startDate'] = null; + } + if (this.endDate != null) { + json[r'endDate'] = this.endDate!.toUtc().toIso8601String(); + } else { + json[r'endDate'] = null; + } + if (this.parcoursIds != null) { + json[r'parcoursIds'] = this.parcoursIds; + } else { + json[r'parcoursIds'] = null; + } + if (this.programme != null) { + json[r'programme'] = this.programme; + } else { + json[r'programme'] = null; + } + return json; + } + + /// Returns a new [SectionEventDTO] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static SectionEventDTO? 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 "SectionEventDTO[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "SectionEventDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return SectionEventDTO( + id: mapValueOfType(json, r'id'), + label: mapValueOfType(json, r'label'), + title: TranslationDTO.listFromJson(json[r'title']), + description: TranslationDTO.listFromJson(json[r'description']), + isActive: mapValueOfType(json, r'isActive'), + imageId: mapValueOfType(json, r'imageId'), + imageSource: mapValueOfType(json, r'imageSource'), + configurationId: mapValueOfType(json, r'configurationId'), + isSubSection: mapValueOfType(json, r'isSubSection'), + parentId: mapValueOfType(json, r'parentId'), + type: SectionType.fromJson(json[r'type']), + dateCreation: mapDateTime(json, r'dateCreation', r''), + order: mapValueOfType(json, r'order'), + instanceId: mapValueOfType(json, r'instanceId'), + latitude: mapValueOfType(json, r'latitude'), + longitude: mapValueOfType(json, r'longitude'), + meterZoneGPS: mapValueOfType(json, r'meterZoneGPS'), + isBeacon: mapValueOfType(json, r'isBeacon'), + beaconId: mapValueOfType(json, r'beaconId'), + startDate: mapDateTime(json, r'startDate', r''), + endDate: mapDateTime(json, r'endDate', r''), + parcoursIds: json[r'parcoursIds'] is Iterable + ? (json[r'parcoursIds'] as Iterable) + .cast() + .toList(growable: false) + : const [], + programme: ProgrammeBlock.listFromJson(json[r'programme']), + ); + } + 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 = SectionEventDTO.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 = SectionEventDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of SectionEventDTO-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] = SectionEventDTO.listFromJson( + entry.value, + growable: growable, + ); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = {}; +}