From 30d88df7b645ad83b4aa3059da7263bba1a74510 Mon Sep 17 00:00:00 2001 From: Thomas Fransolet Date: Fri, 13 Mar 2026 15:10:45 +0100 Subject: [PATCH] useless manager api new updates.. to be removed --- manager_api_new/lib/api.dart | 13 + .../lib/model/app_configuration_link.dart | 369 ++++++++++++++++ ...nfiguration_link_application_instance.dart | 277 ++++++++++++ .../app_configuration_link_configuration.dart | 21 + .../model/app_configuration_link_device.dart | 21 + manager_api_new/lib/model/app_type.dart | 110 +++++ .../lib/model/application_instance_dto.dart | 295 +++++++++++++ ...cation_instance_dto_section_event_dto.dart | 409 ++++++++++++++++++ .../application_instance_section_event.dart | 387 +++++++++++++++++ manager_api_new/lib/model/instance_dto.dart | 132 +++++- .../lib/model/layout_main_page_type.dart | 102 +++++ manager_api_new/lib/model/map_annotation.dart | 31 ++ .../lib/model/programme_block.dart | 31 ++ manager_api_new/lib/model/section_event.dart | 386 +++++++++++++++++ .../lib/model/section_event_dto.dart | 406 +++++++++++++++++ 15 files changed, 2987 insertions(+), 3 deletions(-) create mode 100644 manager_api_new/lib/model/app_configuration_link.dart create mode 100644 manager_api_new/lib/model/app_configuration_link_application_instance.dart create mode 100644 manager_api_new/lib/model/app_configuration_link_configuration.dart create mode 100644 manager_api_new/lib/model/app_configuration_link_device.dart create mode 100644 manager_api_new/lib/model/app_type.dart create mode 100644 manager_api_new/lib/model/application_instance_dto.dart create mode 100644 manager_api_new/lib/model/application_instance_dto_section_event_dto.dart create mode 100644 manager_api_new/lib/model/application_instance_section_event.dart create mode 100644 manager_api_new/lib/model/layout_main_page_type.dart create mode 100644 manager_api_new/lib/model/map_annotation.dart create mode 100644 manager_api_new/lib/model/programme_block.dart create mode 100644 manager_api_new/lib/model/section_event.dart create mode 100644 manager_api_new/lib/model/section_event_dto.dart diff --git a/manager_api_new/lib/api.dart b/manager_api_new/lib/api.dart index 142059a..5f5481f 100644 --- a/manager_api_new/lib/api.dart +++ b/manager_api_new/lib/api.dart @@ -91,6 +91,19 @@ part 'model/user_detail_dto.dart'; part 'model/video_dto.dart'; part 'model/weather_dto.dart'; part 'model/web_dto.dart'; +part 'model/map_annotation.dart'; +part 'model/programme_block.dart'; +part 'model/app_configuration_link_configuration.dart'; +part 'model/app_configuration_link_device.dart'; +part 'model/app_configuration_link.dart'; +part 'model/app_configuration_link_application_instance.dart'; +part 'model/app_type.dart'; +part 'model/layout_main_page_type.dart'; +part 'model/application_instance_dto.dart'; +part 'model/application_instance_dto_section_event_dto.dart'; +part 'model/application_instance_section_event.dart'; +part 'model/section_event.dart'; +part 'model/section_event_dto.dart'; /// An [ApiClient] instance that uses the default values obtained from /// the OpenAPI specification file. diff --git a/manager_api_new/lib/model/app_configuration_link.dart b/manager_api_new/lib/model/app_configuration_link.dart new file mode 100644 index 0000000..d2f3600 --- /dev/null +++ b/manager_api_new/lib/model/app_configuration_link.dart @@ -0,0 +1,369 @@ +// +// 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 AppConfigurationLink { + /// Returns a new [AppConfigurationLink] instance. + AppConfigurationLink({ + required this.configurationId, + required this.applicationInstanceId, + this.id, + this.order, + this.isActive, + this.weightMasonryGrid, + this.isDate, + this.isHour, + this.roundedValue, + this.screenPercentageSectionsMainPage, + this.isSectionImageBackground, + this.layoutMainPage, + this.loaderImageId, + this.loaderImageUrl, + this.primaryColor, + this.secondaryColor, + this.configuration, + this.applicationInstance, + this.deviceId, + this.device, + }); + + String configurationId; + + String applicationInstanceId; + + String? id; + + int? order; + + /// + /// 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; + + int? weightMasonryGrid; + + /// + /// 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? isDate; + + /// + /// 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? isHour; + + int? roundedValue; + + int? screenPercentageSectionsMainPage; + + /// + /// 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? isSectionImageBackground; + + /// + /// 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. + /// + LayoutMainPageType? layoutMainPage; + + String? loaderImageId; + + String? loaderImageUrl; + + String? primaryColor; + + String? secondaryColor; + + AppConfigurationLinkConfiguration? configuration; + + AppConfigurationLinkApplicationInstance? applicationInstance; + + String? deviceId; + + AppConfigurationLinkDevice? device; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AppConfigurationLink && + other.configurationId == configurationId && + other.applicationInstanceId == applicationInstanceId && + other.id == id && + other.order == order && + other.isActive == isActive && + other.weightMasonryGrid == weightMasonryGrid && + other.isDate == isDate && + other.isHour == isHour && + other.roundedValue == roundedValue && + other.screenPercentageSectionsMainPage == + screenPercentageSectionsMainPage && + other.isSectionImageBackground == isSectionImageBackground && + other.layoutMainPage == layoutMainPage && + other.loaderImageId == loaderImageId && + other.loaderImageUrl == loaderImageUrl && + other.primaryColor == primaryColor && + other.secondaryColor == secondaryColor && + other.configuration == configuration && + other.applicationInstance == applicationInstance && + other.deviceId == deviceId && + other.device == device; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (configurationId.hashCode) + + (applicationInstanceId.hashCode) + + (id == null ? 0 : id!.hashCode) + + (order == null ? 0 : order!.hashCode) + + (isActive == null ? 0 : isActive!.hashCode) + + (weightMasonryGrid == null ? 0 : weightMasonryGrid!.hashCode) + + (isDate == null ? 0 : isDate!.hashCode) + + (isHour == null ? 0 : isHour!.hashCode) + + (roundedValue == null ? 0 : roundedValue!.hashCode) + + (screenPercentageSectionsMainPage == null + ? 0 + : screenPercentageSectionsMainPage!.hashCode) + + (isSectionImageBackground == null + ? 0 + : isSectionImageBackground!.hashCode) + + (layoutMainPage == null ? 0 : layoutMainPage!.hashCode) + + (loaderImageId == null ? 0 : loaderImageId!.hashCode) + + (loaderImageUrl == null ? 0 : loaderImageUrl!.hashCode) + + (primaryColor == null ? 0 : primaryColor!.hashCode) + + (secondaryColor == null ? 0 : secondaryColor!.hashCode) + + (configuration == null ? 0 : configuration!.hashCode) + + (applicationInstance == null ? 0 : applicationInstance!.hashCode) + + (deviceId == null ? 0 : deviceId!.hashCode) + + (device == null ? 0 : device!.hashCode); + + @override + String toString() => + 'AppConfigurationLink[configurationId=$configurationId, applicationInstanceId=$applicationInstanceId, id=$id, order=$order, isActive=$isActive, weightMasonryGrid=$weightMasonryGrid, isDate=$isDate, isHour=$isHour, roundedValue=$roundedValue, screenPercentageSectionsMainPage=$screenPercentageSectionsMainPage, isSectionImageBackground=$isSectionImageBackground, layoutMainPage=$layoutMainPage, loaderImageId=$loaderImageId, loaderImageUrl=$loaderImageUrl, primaryColor=$primaryColor, secondaryColor=$secondaryColor, configuration=$configuration, applicationInstance=$applicationInstance, deviceId=$deviceId, device=$device]'; + + Map toJson() { + final json = {}; + json[r'configurationId'] = this.configurationId; + json[r'applicationInstanceId'] = this.applicationInstanceId; + if (this.id != null) { + json[r'id'] = this.id; + } else { + json[r'id'] = null; + } + if (this.order != null) { + json[r'order'] = this.order; + } else { + json[r'order'] = null; + } + if (this.isActive != null) { + json[r'isActive'] = this.isActive; + } else { + json[r'isActive'] = null; + } + if (this.weightMasonryGrid != null) { + json[r'weightMasonryGrid'] = this.weightMasonryGrid; + } else { + json[r'weightMasonryGrid'] = null; + } + if (this.isDate != null) { + json[r'isDate'] = this.isDate; + } else { + json[r'isDate'] = null; + } + if (this.isHour != null) { + json[r'isHour'] = this.isHour; + } else { + json[r'isHour'] = null; + } + if (this.roundedValue != null) { + json[r'roundedValue'] = this.roundedValue; + } else { + json[r'roundedValue'] = null; + } + if (this.screenPercentageSectionsMainPage != null) { + json[r'screenPercentageSectionsMainPage'] = + this.screenPercentageSectionsMainPage; + } else { + json[r'screenPercentageSectionsMainPage'] = null; + } + if (this.isSectionImageBackground != null) { + json[r'isSectionImageBackground'] = this.isSectionImageBackground; + } else { + json[r'isSectionImageBackground'] = null; + } + if (this.layoutMainPage != null) { + json[r'layoutMainPage'] = this.layoutMainPage; + } else { + json[r'layoutMainPage'] = null; + } + if (this.loaderImageId != null) { + json[r'loaderImageId'] = this.loaderImageId; + } else { + json[r'loaderImageId'] = null; + } + if (this.loaderImageUrl != null) { + json[r'loaderImageUrl'] = this.loaderImageUrl; + } else { + json[r'loaderImageUrl'] = null; + } + if (this.primaryColor != null) { + json[r'primaryColor'] = this.primaryColor; + } else { + json[r'primaryColor'] = null; + } + if (this.secondaryColor != null) { + json[r'secondaryColor'] = this.secondaryColor; + } else { + json[r'secondaryColor'] = null; + } + if (this.configuration != null) { + json[r'configuration'] = this.configuration; + } else { + json[r'configuration'] = null; + } + if (this.applicationInstance != null) { + json[r'applicationInstance'] = this.applicationInstance; + } else { + json[r'applicationInstance'] = null; + } + if (this.deviceId != null) { + json[r'deviceId'] = this.deviceId; + } else { + json[r'deviceId'] = null; + } + if (this.device != null) { + json[r'device'] = this.device; + } else { + json[r'device'] = null; + } + return json; + } + + /// Returns a new [AppConfigurationLink] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static AppConfigurationLink? 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 "AppConfigurationLink[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "AppConfigurationLink[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return AppConfigurationLink( + configurationId: mapValueOfType(json, r'configurationId')!, + applicationInstanceId: + mapValueOfType(json, r'applicationInstanceId')!, + id: mapValueOfType(json, r'id'), + order: mapValueOfType(json, r'order'), + isActive: mapValueOfType(json, r'isActive'), + weightMasonryGrid: mapValueOfType(json, r'weightMasonryGrid'), + isDate: mapValueOfType(json, r'isDate'), + isHour: mapValueOfType(json, r'isHour'), + roundedValue: mapValueOfType(json, r'roundedValue'), + screenPercentageSectionsMainPage: + mapValueOfType(json, r'screenPercentageSectionsMainPage'), + isSectionImageBackground: + mapValueOfType(json, r'isSectionImageBackground'), + layoutMainPage: LayoutMainPageType.fromJson(json[r'layoutMainPage']), + loaderImageId: mapValueOfType(json, r'loaderImageId'), + loaderImageUrl: mapValueOfType(json, r'loaderImageUrl'), + primaryColor: mapValueOfType(json, r'primaryColor'), + secondaryColor: mapValueOfType(json, r'secondaryColor'), + configuration: + AppConfigurationLinkConfiguration.fromJson(json[r'configuration']), + applicationInstance: AppConfigurationLinkApplicationInstance.fromJson( + json[r'applicationInstance']), + deviceId: mapValueOfType(json, r'deviceId'), + device: AppConfigurationLinkDevice.fromJson(json[r'device']), + ); + } + 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 = AppConfigurationLink.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 = AppConfigurationLink.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of AppConfigurationLink-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] = AppConfigurationLink.listFromJson( + entry.value, + growable: growable, + ); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + 'configurationId', + 'applicationInstanceId', + }; +} diff --git a/manager_api_new/lib/model/app_configuration_link_application_instance.dart b/manager_api_new/lib/model/app_configuration_link_application_instance.dart new file mode 100644 index 0000000..d34d758 --- /dev/null +++ b/manager_api_new/lib/model/app_configuration_link_application_instance.dart @@ -0,0 +1,277 @@ +// +// 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 AppConfigurationLinkApplicationInstance { + /// Returns a new [AppConfigurationLinkApplicationInstance] instance. + AppConfigurationLinkApplicationInstance({ + required this.instanceId, + required this.appType, + this.id, + this.configurations = const [], + this.mainImageId, + this.mainImageUrl, + this.loaderImageId, + this.loaderImageUrl, + this.primaryColor, + this.secondaryColor, + this.layoutMainPage, + this.languages = const [], + this.sectionEventId, + this.sectionEvent, + }); + + String instanceId; + + AppType appType; + + String? id; + + List? configurations; + + String? mainImageId; + + String? mainImageUrl; + + String? loaderImageId; + + String? loaderImageUrl; + + String? primaryColor; + + String? secondaryColor; + + /// + /// 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. + /// + LayoutMainPageType? layoutMainPage; + + List? languages; + + String? sectionEventId; + + ApplicationInstanceSectionEvent? sectionEvent; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is AppConfigurationLinkApplicationInstance && + other.instanceId == instanceId && + other.appType == appType && + other.id == id && + _deepEquality.equals(other.configurations, configurations) && + other.mainImageId == mainImageId && + other.mainImageUrl == mainImageUrl && + other.loaderImageId == loaderImageId && + other.loaderImageUrl == loaderImageUrl && + other.primaryColor == primaryColor && + other.secondaryColor == secondaryColor && + other.layoutMainPage == layoutMainPage && + _deepEquality.equals(other.languages, languages) && + other.sectionEventId == sectionEventId && + other.sectionEvent == sectionEvent; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (instanceId.hashCode) + + (appType.hashCode) + + (id == null ? 0 : id!.hashCode) + + (configurations == null ? 0 : configurations!.hashCode) + + (mainImageId == null ? 0 : mainImageId!.hashCode) + + (mainImageUrl == null ? 0 : mainImageUrl!.hashCode) + + (loaderImageId == null ? 0 : loaderImageId!.hashCode) + + (loaderImageUrl == null ? 0 : loaderImageUrl!.hashCode) + + (primaryColor == null ? 0 : primaryColor!.hashCode) + + (secondaryColor == null ? 0 : secondaryColor!.hashCode) + + (layoutMainPage == null ? 0 : layoutMainPage!.hashCode) + + (languages == null ? 0 : languages!.hashCode) + + (sectionEventId == null ? 0 : sectionEventId!.hashCode) + + (sectionEvent == null ? 0 : sectionEvent!.hashCode); + + @override + String toString() => + 'AppConfigurationLinkApplicationInstance[instanceId=$instanceId, appType=$appType, id=$id, configurations=$configurations, mainImageId=$mainImageId, mainImageUrl=$mainImageUrl, loaderImageId=$loaderImageId, loaderImageUrl=$loaderImageUrl, primaryColor=$primaryColor, secondaryColor=$secondaryColor, layoutMainPage=$layoutMainPage, languages=$languages, sectionEventId=$sectionEventId, sectionEvent=$sectionEvent]'; + + Map toJson() { + final json = {}; + json[r'instanceId'] = this.instanceId; + json[r'appType'] = this.appType; + if (this.id != null) { + json[r'id'] = this.id; + } else { + json[r'id'] = null; + } + if (this.configurations != null) { + json[r'configurations'] = this.configurations; + } else { + json[r'configurations'] = null; + } + if (this.mainImageId != null) { + json[r'mainImageId'] = this.mainImageId; + } else { + json[r'mainImageId'] = null; + } + if (this.mainImageUrl != null) { + json[r'mainImageUrl'] = this.mainImageUrl; + } else { + json[r'mainImageUrl'] = null; + } + if (this.loaderImageId != null) { + json[r'loaderImageId'] = this.loaderImageId; + } else { + json[r'loaderImageId'] = null; + } + if (this.loaderImageUrl != null) { + json[r'loaderImageUrl'] = this.loaderImageUrl; + } else { + json[r'loaderImageUrl'] = null; + } + if (this.primaryColor != null) { + json[r'primaryColor'] = this.primaryColor; + } else { + json[r'primaryColor'] = null; + } + if (this.secondaryColor != null) { + json[r'secondaryColor'] = this.secondaryColor; + } else { + json[r'secondaryColor'] = null; + } + if (this.layoutMainPage != null) { + json[r'layoutMainPage'] = this.layoutMainPage; + } else { + json[r'layoutMainPage'] = null; + } + if (this.languages != null) { + json[r'languages'] = this.languages; + } else { + json[r'languages'] = 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 [AppConfigurationLinkApplicationInstance] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static AppConfigurationLinkApplicationInstance? 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 "AppConfigurationLinkApplicationInstance[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "AppConfigurationLinkApplicationInstance[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return AppConfigurationLinkApplicationInstance( + instanceId: mapValueOfType(json, r'instanceId')!, + appType: AppType.fromJson(json[r'appType'])!, + id: mapValueOfType(json, r'id'), + configurations: + AppConfigurationLink.listFromJson(json[r'configurations']), + mainImageId: mapValueOfType(json, r'mainImageId'), + mainImageUrl: mapValueOfType(json, r'mainImageUrl'), + loaderImageId: mapValueOfType(json, r'loaderImageId'), + loaderImageUrl: mapValueOfType(json, r'loaderImageUrl'), + primaryColor: mapValueOfType(json, r'primaryColor'), + secondaryColor: mapValueOfType(json, r'secondaryColor'), + layoutMainPage: LayoutMainPageType.fromJson(json[r'layoutMainPage']), + languages: json[r'languages'] is Iterable + ? (json[r'languages'] as Iterable) + .cast() + .toList(growable: false) + : const [], + 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 = AppConfigurationLinkApplicationInstance.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 = + AppConfigurationLinkApplicationInstance.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of AppConfigurationLinkApplicationInstance-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] = AppConfigurationLinkApplicationInstance.listFromJson( + entry.value, + growable: growable, + ); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + 'instanceId', + 'appType', + }; +} diff --git a/manager_api_new/lib/model/app_configuration_link_configuration.dart b/manager_api_new/lib/model/app_configuration_link_configuration.dart new file mode 100644 index 0000000..4614fd3 --- /dev/null +++ b/manager_api_new/lib/model/app_configuration_link_configuration.dart @@ -0,0 +1,21 @@ +// +// 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 AppConfigurationLinkConfiguration { + AppConfigurationLinkConfiguration({this.id}); + String? id; + + static AppConfigurationLinkConfiguration? fromJson(dynamic value) => + value is Map ? AppConfigurationLinkConfiguration() : null; + + static const requiredKeys = {}; +} diff --git a/manager_api_new/lib/model/app_configuration_link_device.dart b/manager_api_new/lib/model/app_configuration_link_device.dart new file mode 100644 index 0000000..fe05631 --- /dev/null +++ b/manager_api_new/lib/model/app_configuration_link_device.dart @@ -0,0 +1,21 @@ +// +// 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 AppConfigurationLinkDevice { + AppConfigurationLinkDevice({this.id}); + String? id; + + static AppConfigurationLinkDevice? fromJson(dynamic value) => + value is Map ? AppConfigurationLinkDevice() : null; + + static const requiredKeys = {}; +} diff --git a/manager_api_new/lib/model/app_type.dart b/manager_api_new/lib/model/app_type.dart new file mode 100644 index 0000000..7779efc --- /dev/null +++ b/manager_api_new/lib/model/app_type.dart @@ -0,0 +1,110 @@ +// +// 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 = Mobile 1 = Tablet 2 = Web 3 = VR +class AppType { + /// Instantiate a new enum with the provided [value]. + const AppType._(this.value); + + /// The underlying value of this enum member. + final int value; + + @override + String toString() => value.toString(); + + int toJson() => value; + + static const Mobile = AppType._(0); + static const Tablet = AppType._(1); + static const Web = AppType._(2); + static const VR = AppType._(3); + + /// List of all possible values in this [enum][AppType]. + static const values = [ + Mobile, + Tablet, + Web, + VR, + ]; + + static AppType? fromJson(dynamic value) => + AppTypeTypeTransformer().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 = AppType.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } +} + +/// Transformation class that can [encode] an instance of [AppType] to int, +/// and [decode] dynamic data back to [AppType]. +class AppTypeTypeTransformer { + factory AppTypeTypeTransformer() => + _instance ??= const AppTypeTypeTransformer._(); + + const AppTypeTypeTransformer._(); + + int encode(AppType data) => data.value; + + /// Decodes a [dynamic value][data] to a AppType. + /// + /// 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. + AppType? decode(dynamic data, {bool allowNull = true}) { + if (data != null) { + if(data.runtimeType == String) { + switch (data.toString()) { + case r'Mobile': return AppType.Mobile; + case r'Tablet': return AppType.Tablet; + case r'Web': return AppType.Web; + case r'VR': return AppType.VR; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + } else { + if(data.runtimeType == int) { + switch (data) { + case 0: return AppType.Mobile; + case 1: return AppType.Tablet; + case 2: return AppType.Web; + case 3: return AppType.VR; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + } + } + } + return null; + } + + /// Singleton [AppTypeTypeTransformer] instance. + static AppTypeTypeTransformer? _instance; +} diff --git a/manager_api_new/lib/model/application_instance_dto.dart b/manager_api_new/lib/model/application_instance_dto.dart new file mode 100644 index 0000000..0179a95 --- /dev/null +++ b/manager_api_new/lib/model/application_instance_dto.dart @@ -0,0 +1,295 @@ +// +// 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 ApplicationInstanceDTO { + /// Returns a new [ApplicationInstanceDTO] instance. + ApplicationInstanceDTO({ + this.id, + this.instanceId, + this.appType, + this.configurations = const [], + this.mainImageId, + this.mainImageUrl, + this.loaderImageId, + this.loaderImageUrl, + this.primaryColor, + this.secondaryColor, + this.layoutMainPage, + this.languages = const [], + this.sectionEventId, + this.sectionEventDTO, + this.isAssistant, + }); + + String? id; + + String? instanceId; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + AppType? appType; + + List? configurations; + + String? mainImageId; + + String? mainImageUrl; + + String? loaderImageId; + + String? loaderImageUrl; + + String? primaryColor; + + String? secondaryColor; + + /// + /// 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. + /// + LayoutMainPageType? layoutMainPage; + + List? languages; + + String? sectionEventId; + + SectionEventDTO? sectionEventDTO; + + bool? isAssistant; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ApplicationInstanceDTO && + other.id == id && + other.instanceId == instanceId && + other.appType == appType && + _deepEquality.equals(other.configurations, configurations) && + other.mainImageId == mainImageId && + other.mainImageUrl == mainImageUrl && + other.loaderImageId == loaderImageId && + other.loaderImageUrl == loaderImageUrl && + other.primaryColor == primaryColor && + other.secondaryColor == secondaryColor && + other.layoutMainPage == layoutMainPage && + _deepEquality.equals(other.languages, languages) && + other.sectionEventId == sectionEventId && + other.sectionEventDTO == sectionEventDTO && + other.isAssistant == isAssistant; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (instanceId == null ? 0 : instanceId!.hashCode) + + (appType == null ? 0 : appType!.hashCode) + + (configurations == null ? 0 : configurations!.hashCode) + + (mainImageId == null ? 0 : mainImageId!.hashCode) + + (mainImageUrl == null ? 0 : mainImageUrl!.hashCode) + + (loaderImageId == null ? 0 : loaderImageId!.hashCode) + + (loaderImageUrl == null ? 0 : loaderImageUrl!.hashCode) + + (primaryColor == null ? 0 : primaryColor!.hashCode) + + (secondaryColor == null ? 0 : secondaryColor!.hashCode) + + (layoutMainPage == null ? 0 : layoutMainPage!.hashCode) + + (languages == null ? 0 : languages!.hashCode) + + (sectionEventId == null ? 0 : sectionEventId!.hashCode) + + (sectionEventDTO == null ? 0 : sectionEventDTO!.hashCode) + + (isAssistant == null ? 0 : isAssistant!.hashCode); + + @override + String toString() => + 'ApplicationInstanceDTO[id=$id, instanceId=$instanceId, appType=$appType, configurations=$configurations, mainImageId=$mainImageId, mainImageUrl=$mainImageUrl, loaderImageId=$loaderImageId, loaderImageUrl=$loaderImageUrl, primaryColor=$primaryColor, secondaryColor=$secondaryColor, layoutMainPage=$layoutMainPage, languages=$languages, sectionEventId=$sectionEventId, sectionEventDTO=$sectionEventDTO, isAssistant=$isAssistant]'; + + 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.appType != null) { + json[r'appType'] = this.appType; + } else { + json[r'appType'] = null; + } + if (this.configurations != null) { + json[r'configurations'] = this.configurations; + } else { + json[r'configurations'] = null; + } + if (this.mainImageId != null) { + json[r'mainImageId'] = this.mainImageId; + } else { + json[r'mainImageId'] = null; + } + if (this.mainImageUrl != null) { + json[r'mainImageUrl'] = this.mainImageUrl; + } else { + json[r'mainImageUrl'] = null; + } + if (this.loaderImageId != null) { + json[r'loaderImageId'] = this.loaderImageId; + } else { + json[r'loaderImageId'] = null; + } + if (this.loaderImageUrl != null) { + json[r'loaderImageUrl'] = this.loaderImageUrl; + } else { + json[r'loaderImageUrl'] = null; + } + if (this.primaryColor != null) { + json[r'primaryColor'] = this.primaryColor; + } else { + json[r'primaryColor'] = null; + } + if (this.secondaryColor != null) { + json[r'secondaryColor'] = this.secondaryColor; + } else { + json[r'secondaryColor'] = null; + } + if (this.layoutMainPage != null) { + json[r'layoutMainPage'] = this.layoutMainPage; + } else { + json[r'layoutMainPage'] = null; + } + if (this.languages != null) { + json[r'languages'] = this.languages; + } else { + json[r'languages'] = null; + } + if (this.sectionEventId != null) { + json[r'sectionEventId'] = this.sectionEventId; + } else { + json[r'sectionEventId'] = null; + } + if (this.sectionEventDTO != null) { + json[r'sectionEventDTO'] = this.sectionEventDTO; + } else { + json[r'sectionEventDTO'] = null; + } + if (this.isAssistant != null) { + json[r'isAssistant'] = this.isAssistant; + } else { + json[r'isAssistant'] = null; + } + return json; + } + + /// Returns a new [ApplicationInstanceDTO] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static ApplicationInstanceDTO? 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 "ApplicationInstanceDTO[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "ApplicationInstanceDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return ApplicationInstanceDTO( + id: mapValueOfType(json, r'id'), + instanceId: mapValueOfType(json, r'instanceId'), + appType: AppType.fromJson(json[r'appType']), + configurations: + AppConfigurationLink.listFromJson(json[r'configurations']), + mainImageId: mapValueOfType(json, r'mainImageId'), + mainImageUrl: mapValueOfType(json, r'mainImageUrl'), + loaderImageId: mapValueOfType(json, r'loaderImageId'), + loaderImageUrl: mapValueOfType(json, r'loaderImageUrl'), + primaryColor: mapValueOfType(json, r'primaryColor'), + secondaryColor: mapValueOfType(json, r'secondaryColor'), + layoutMainPage: LayoutMainPageType.fromJson(json[r'layoutMainPage']), + languages: json[r'languages'] is Iterable + ? (json[r'languages'] as Iterable) + .cast() + .toList(growable: false) + : const [], + sectionEventId: mapValueOfType(json, r'sectionEventId'), + sectionEventDTO: SectionEventDTO.fromJson(json[r'sectionEventDTO']), + isAssistant: mapValueOfType(json, r'isAssistant'), + ); + } + 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 = ApplicationInstanceDTO.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 = ApplicationInstanceDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of ApplicationInstanceDTO-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] = ApplicationInstanceDTO.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/application_instance_dto_section_event_dto.dart b/manager_api_new/lib/model/application_instance_dto_section_event_dto.dart new file mode 100644 index 0000000..8bde1c8 --- /dev/null +++ b/manager_api_new/lib/model/application_instance_dto_section_event_dto.dart @@ -0,0 +1,409 @@ +// +// 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 ApplicationInstanceDTOSectionEventDTO { + /// Returns a new [ApplicationInstanceDTOSectionEventDTO] instance. + ApplicationInstanceDTOSectionEventDTO({ + 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 ApplicationInstanceDTOSectionEventDTO && + 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() => + 'ApplicationInstanceDTOSectionEventDTO[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 [ApplicationInstanceDTOSectionEventDTO] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static ApplicationInstanceDTOSectionEventDTO? 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 "ApplicationInstanceDTOSectionEventDTO[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "ApplicationInstanceDTOSectionEventDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return ApplicationInstanceDTOSectionEventDTO( + 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 = ApplicationInstanceDTOSectionEventDTO.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 = + ApplicationInstanceDTOSectionEventDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of ApplicationInstanceDTOSectionEventDTO-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] = ApplicationInstanceDTOSectionEventDTO.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/application_instance_section_event.dart b/manager_api_new/lib/model/application_instance_section_event.dart new file mode 100644 index 0000000..e878de6 --- /dev/null +++ b/manager_api_new/lib/model/application_instance_section_event.dart @@ -0,0 +1,387 @@ +// +// 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 ApplicationInstanceSectionEvent { + /// Returns a new [ApplicationInstanceSectionEvent] instance. + ApplicationInstanceSectionEvent({ + 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 ApplicationInstanceSectionEvent && + 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() => + 'ApplicationInstanceSectionEvent[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 [ApplicationInstanceSectionEvent] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static ApplicationInstanceSectionEvent? 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 "ApplicationInstanceSectionEvent[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "ApplicationInstanceSectionEvent[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return ApplicationInstanceSectionEvent( + 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 = ApplicationInstanceSectionEvent.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 = ApplicationInstanceSectionEvent.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of ApplicationInstanceSectionEvent-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] = ApplicationInstanceSectionEvent.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/instance_dto.dart b/manager_api_new/lib/model/instance_dto.dart index 3dff3e1..8d7e076 100644 --- a/manager_api_new/lib/model/instance_dto.dart +++ b/manager_api_new/lib/model/instance_dto.dart @@ -17,6 +17,14 @@ class InstanceDTO { this.name, this.dateCreation, this.pinCode, + this.isPushNotification, + this.isStatistic, + this.isMobile, + this.isTablet, + this.isWeb, + this.isVR, + this.isAssistant, + this.applicationInstanceDTOs = const [], }); String? id; @@ -27,6 +35,58 @@ class InstanceDTO { String? pinCode; + /// + /// 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? isPushNotification; + + /// + /// 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? isStatistic; + + /// + /// 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? isMobile; + + /// + /// 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? isTablet; + + /// + /// 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? isWeb; + + /// + /// 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? isVR; + + bool? isAssistant; + + List? applicationInstanceDTOs; + @override bool operator ==(Object other) => identical(this, other) || @@ -34,7 +94,16 @@ class InstanceDTO { other.id == id && other.name == name && other.dateCreation == dateCreation && - other.pinCode == pinCode; + other.pinCode == pinCode && + other.isPushNotification == isPushNotification && + other.isStatistic == isStatistic && + other.isMobile == isMobile && + other.isTablet == isTablet && + other.isWeb == isWeb && + other.isVR == isVR && + other.isAssistant == isAssistant && + _deepEquality.equals( + other.applicationInstanceDTOs, applicationInstanceDTOs); @override int get hashCode => @@ -42,11 +111,19 @@ class InstanceDTO { (id == null ? 0 : id!.hashCode) + (name == null ? 0 : name!.hashCode) + (dateCreation == null ? 0 : dateCreation!.hashCode) + - (pinCode == null ? 0 : pinCode!.hashCode); + (pinCode == null ? 0 : pinCode!.hashCode) + + (isPushNotification == null ? 0 : isPushNotification!.hashCode) + + (isStatistic == null ? 0 : isStatistic!.hashCode) + + (isMobile == null ? 0 : isMobile!.hashCode) + + (isTablet == null ? 0 : isTablet!.hashCode) + + (isWeb == null ? 0 : isWeb!.hashCode) + + (isVR == null ? 0 : isVR!.hashCode) + + (isAssistant == null ? 0 : isAssistant!.hashCode) + + (applicationInstanceDTOs == null ? 0 : applicationInstanceDTOs!.hashCode); @override String toString() => - 'InstanceDTO[id=$id, name=$name, dateCreation=$dateCreation, pinCode=$pinCode]'; + 'InstanceDTO[id=$id, name=$name, dateCreation=$dateCreation, pinCode=$pinCode, isPushNotification=$isPushNotification, isStatistic=$isStatistic, isMobile=$isMobile, isTablet=$isTablet, isWeb=$isWeb, isVR=$isVR, isAssistant=$isAssistant, applicationInstanceDTOs=$applicationInstanceDTOs]'; Map toJson() { final json = {}; @@ -70,6 +147,46 @@ class InstanceDTO { } else { json[r'pinCode'] = null; } + if (this.isPushNotification != null) { + json[r'isPushNotification'] = this.isPushNotification; + } else { + json[r'isPushNotification'] = null; + } + if (this.isStatistic != null) { + json[r'isStatistic'] = this.isStatistic; + } else { + json[r'isStatistic'] = null; + } + if (this.isMobile != null) { + json[r'isMobile'] = this.isMobile; + } else { + json[r'isMobile'] = null; + } + if (this.isTablet != null) { + json[r'isTablet'] = this.isTablet; + } else { + json[r'isTablet'] = null; + } + if (this.isWeb != null) { + json[r'isWeb'] = this.isWeb; + } else { + json[r'isWeb'] = null; + } + if (this.isVR != null) { + json[r'isVR'] = this.isVR; + } else { + json[r'isVR'] = null; + } + if (this.isAssistant != null) { + json[r'isAssistant'] = this.isAssistant; + } else { + json[r'isAssistant'] = null; + } + if (this.applicationInstanceDTOs != null) { + json[r'applicationInstanceDTOs'] = this.applicationInstanceDTOs; + } else { + json[r'applicationInstanceDTOs'] = null; + } return json; } @@ -98,6 +215,15 @@ class InstanceDTO { name: mapValueOfType(json, r'name'), dateCreation: mapDateTime(json, r'dateCreation', r''), pinCode: mapValueOfType(json, r'pinCode'), + isPushNotification: mapValueOfType(json, r'isPushNotification'), + isStatistic: mapValueOfType(json, r'isStatistic'), + isMobile: mapValueOfType(json, r'isMobile'), + isTablet: mapValueOfType(json, r'isTablet'), + isWeb: mapValueOfType(json, r'isWeb'), + isVR: mapValueOfType(json, r'isVR'), + isAssistant: mapValueOfType(json, r'isAssistant'), + applicationInstanceDTOs: ApplicationInstanceDTO.listFromJson( + json[r'applicationInstanceDTOs']), ); } return null; 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..1386215 --- /dev/null +++ b/manager_api_new/lib/model/layout_main_page_type.dart @@ -0,0 +1,102 @@ +// +// 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 SimpleGrid = LayoutMainPageType._(0); + static const MasonryGrid = LayoutMainPageType._(1); + + /// List of all possible values in this [enum][LayoutMainPageType]. + static const values = [ + SimpleGrid, + MasonryGrid, + ]; + + 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) { + if(data.runtimeType == String) { + switch (data.toString()) { + case r'SimpleGrid': return LayoutMainPageType.SimpleGrid; + case r'MasonryGrid': return LayoutMainPageType.MasonryGrid; + default: + if (!allowNull) { + throw ArgumentError('Unknown enum value to decode: $data'); + } + } + } else { + if(data.runtimeType == int) { + switch (data) { + case 0: return LayoutMainPageType.SimpleGrid; + case 1: return LayoutMainPageType.MasonryGrid; + 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..27418e0 --- /dev/null +++ b/manager_api_new/lib/model/map_annotation.dart @@ -0,0 +1,31 @@ +// +// 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 { + MapAnnotation({this.id}); + String? id; + + static MapAnnotation? fromJson(dynamic value) => value is Map ? MapAnnotation() : 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 const requiredKeys = {}; +} diff --git a/manager_api_new/lib/model/programme_block.dart b/manager_api_new/lib/model/programme_block.dart new file mode 100644 index 0000000..671add8 --- /dev/null +++ b/manager_api_new/lib/model/programme_block.dart @@ -0,0 +1,31 @@ +// +// 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 ProgrammeBlock { + ProgrammeBlock({this.id}); + String? id; + + static ProgrammeBlock? fromJson(dynamic value) => value is Map ? ProgrammeBlock() : null; + + static List listFromJson(dynamic json, {bool growable = false}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = ProgrammeBlock.fromJson(row); + if (value != null) result.add(value); + } + } + return result.toList(growable: growable); + } + + 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 = {}; +}